From 60050462806afa2f287a20a492a9f1f21e9dbf04 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 30 Jan 2013 11:36:04 +0100 Subject: [PATCH] Bug fix (--dbms=mysql --tables -D testdb --exclude-sysdbs --technique=E was not working) --- plugins/generic/databases.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/generic/databases.py b/plugins/generic/databases.py index 6ad8b1c04..edba26c2e 100644 --- a/plugins/generic/databases.py +++ b/plugins/generic/databases.py @@ -259,12 +259,13 @@ class Databases: if condition: if not Backend.isDbms(DBMS.SQLITE): query += " WHERE %s" % condition - query += " IN (%s)" % ",".join("'%s'" % unsafeSQLIdentificatorNaming(db) for db in sorted(dbs)) if conf.excludeSysDbs: - query += "".join(" AND %s != '%s'" % (condition, unsafeSQLIdentificatorNaming(db)) for db in self.excludeDbsList) infoMsg = "skipping system database%s '%s'" % ("s" if len(self.excludeDbsList) > 1 else "", ", ".join(db for db in self.excludeDbsList)) logger.info(infoMsg) + query += " IN (%s)" % ",".join("'%s'" % unsafeSQLIdentificatorNaming(db) for db in sorted(dbs) if db not in self.excludeDbsList) + else: + query += " IN (%s)" % ",".join("'%s'" % unsafeSQLIdentificatorNaming(db) for db in sorted(dbs)) if len(dbs) < 2 and ("%s," % condition) in query: query = query.replace("%s," % condition, "", 1)