Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a1ac96

Browse files
committed
bug fix
1 parent 1bdde51 commit 9a1ac96

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

plugins/generic/enumeration.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,22 +1166,24 @@ def getColumns(self, onlyColNames=False, colTuple=None, bruteForce=None):
11661166
infoMsg = "fetching columns "
11671167

11681168
if len(colList) > 0:
1169-
condQuery = " AND (%s)" % " OR ".join("%s LIKE '%%%s%%'" % (condition, unsafeSQLIdentificatorNaming(col)) for col in sorted(colList))
1170-
likeMsg = "like '%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList))
1171-
infoMsg += likeMsg
1169+
if colTuple is None:
1170+
colConsider, colCondParam = self.likeOrExact("column")
1171+
else:
1172+
colConsider, colCondParam = colTuple
1173+
condQueryStr = "%%s%s" % colCondParam
1174+
condQuery = " AND (%s)" % " OR ".join(condQueryStr % (condition, unsafeSQLIdentificatorNaming(col)) for col in sorted(colList))
1175+
1176+
if colConsider == "1":
1177+
infoMsg += "LIKE '%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList))
1178+
else:
1179+
infoMsg += "'%s' " % ", ".join(unsafeSQLIdentificatorNaming(col) for col in sorted(colList))
11721180
else:
11731181
condQuery = ""
1174-
likeMsg = ""
11751182

11761183
infoMsg += "for table '%s' " % tbl
11771184
infoMsg += "on database '%s'" % conf.db
11781185
logger.info(infoMsg)
11791186

1180-
countMsg = "fetching number of columns %s" % likeMsg
1181-
countMsg += "for table '%s'" % tbl
1182-
countMsg += " on database '%s'" % conf.db
1183-
logger.info(countMsg)
1184-
11851187
if Backend.getIdentifiedDbms() in ( DBMS.MYSQL, DBMS.PGSQL ):
11861188
query = rootQuery.blind.count % (unsafeSQLIdentificatorNaming(tbl), unsafeSQLIdentificatorNaming(conf.db))
11871189
query += condQuery

0 commit comments

Comments
 (0)