From a40d7a5bca1a8c1f7e22a228860f8223c3e95eba Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 15 Nov 2012 15:06:54 +0100 Subject: [PATCH] Minor improvement (safer to use column name in COUNT than *, especially when only one column is needed) --- lib/techniques/error/use.py | 2 +- lib/techniques/union/use.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/techniques/error/use.py b/lib/techniques/error/use.py index 2e9f20af2..9fc736a80 100644 --- a/lib/techniques/error/use.py +++ b/lib/techniques/error/use.py @@ -306,7 +306,7 @@ def errorUse(expression, dump=False): stopLimit = conf.limitStop # Count the number of SQL query entries output - countedExpression = expression.replace(expressionFields, queries[Backend.getIdentifiedDbms()].count.query % '*', 1) + countedExpression = expression.replace(expressionFields, queries[Backend.getIdentifiedDbms()].count.query % ('*' if len(expressionFieldsList) > 1 else expressionFields), 1) if " ORDER BY " in expression: countedExpression = countedExpression[:countedExpression.index(" ORDER BY ")] diff --git a/lib/techniques/union/use.py b/lib/techniques/union/use.py index 72f71c362..6d85decec 100644 --- a/lib/techniques/union/use.py +++ b/lib/techniques/union/use.py @@ -233,7 +233,7 @@ def unionUse(expression, unpack=True, dump=False): stopLimit = conf.limitStop # Count the number of SQL query entries output - countedExpression = expression.replace(expressionFields, queries[Backend.getIdentifiedDbms()].count.query % '*', 1) + countedExpression = expression.replace(expressionFields, queries[Backend.getIdentifiedDbms()].count.query % ('*' if len(expressionFieldsList) > 1 else expressionFields), 1) if " ORDER BY " in countedExpression.upper(): _ = countedExpression.upper().rindex(" ORDER BY ")