From 9523da7663103fc65ff4b492425feb6af55c6589 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 25 Oct 2011 13:21:01 +0000 Subject: [PATCH] minor optimization --- plugins/generic/enumeration.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index a8c36126a..7cff4153c 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -883,6 +883,9 @@ class Enumeration: query += " WHERE " query += " OR ".join("%s = '%s'" % (condition, unsafeSQLIdentificatorNaming(db)) for db in sorted(dbs)) + if len(dbs) < 2 and ("%s," % condition) in query: + query = query.replace("%s," % condition, "", 1) + if Backend.isDbms(DBMS.MSSQL): query = safeStringFormat(query, conf.db)