From 9a1ac96756a7add4af4b9b8dc48e64dd2fe4d2d7 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 11 Sep 2011 17:22:27 +0000 Subject: [PATCH] bug fix --- plugins/generic/enumeration.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 5d0aef64b..3a55c8e30 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -1166,22 +1166,24 @@ class Enumeration: infoMsg = "fetching columns " if len(colList) > 0: - condQuery = " AND (%s)" % " OR ".join("%s LIKE '%%%s%%'" % (condition, unsafeSQLIdentificatorNaming(col)) for col in sorted(colList)) - likeMsg = "like '%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList)) - infoMsg += likeMsg + if colTuple is None: + colConsider, colCondParam = self.likeOrExact("column") + else: + colConsider, colCondParam = colTuple + condQueryStr = "%%s%s" % colCondParam + condQuery = " AND (%s)" % " OR ".join(condQueryStr % (condition, unsafeSQLIdentificatorNaming(col)) for col in sorted(colList)) + + if colConsider == "1": + infoMsg += "LIKE '%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList)) + else: + infoMsg += "'%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList)) else: condQuery = "" - likeMsg = "" infoMsg += "for table '%s' " % tbl infoMsg += "on database '%s'" % conf.db logger.info(infoMsg) - countMsg = "fetching number of columns %s" % likeMsg - countMsg += "for table '%s'" % tbl - countMsg += " on database '%s'" % conf.db - logger.info(countMsg) - if Backend.getIdentifiedDbms() in ( DBMS.MYSQL, DBMS.PGSQL ): query = rootQuery.blind.count % (unsafeSQLIdentificatorNaming(tbl), unsafeSQLIdentificatorNaming(conf.db)) query += condQuery