From 3dc8820caa9f78d7ebfee3659d8feb69312a4c4c Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 19 Oct 2015 10:38:38 +0200 Subject: [PATCH] Fixes #1474 --- lib/request/inject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/request/inject.py b/lib/request/inject.py index ecbf65384..64c5a534c 100644 --- a/lib/request/inject.py +++ b/lib/request/inject.py @@ -190,7 +190,7 @@ def _goInferenceProxy(expression, fromUser=False, batch=False, unpack=True, char countFirstField = queries[Backend.getIdentifiedDbms()].count.query % expressionFieldsList[0] countedExpression = expression.replace(expressionFields, countFirstField, 1) - if " ORDER BY " in expression.upper(): + if " ORDER BY " in countedExpression.upper(): _ = countedExpression.upper().rindex(" ORDER BY ") countedExpression = countedExpression[:_]