@@ -440,7 +440,7 @@ def getColumns(self, onlyColNames=False, colTuple=None, bruteForce=None):
440440 logger .error (errMsg )
441441 bruteForce = True
442442
443- if bruteForce or colList :
443+ if bruteForce :
444444 resumeAvailable = False
445445
446446 for tbl in tblList :
@@ -492,21 +492,20 @@ def getColumns(self, onlyColNames=False, colTuple=None, bruteForce=None):
492492 return {conf .db : kb .data .cachedColumns [conf .db ]}
493493
494494 infoMsg = "fetching columns "
495+ condQuery = ""
495496
496497 if len (colList ) > 0 :
497- if colTuple is None :
498- colConsider , colCondParam = self .likeOrExact ("column" )
499- else :
500- colConsider , colCondParam = colTuple
501- condQueryStr = "%%s%s" % colCondParam
502- condQuery = " AND (%s)" % " OR " .join (condQueryStr % (condition , unsafeSQLIdentificatorNaming (col )) for col in sorted (colList ))
503-
504- if colConsider == "1" :
498+ if colTuple :
499+ _ , colCondParam = colTuple
505500 infoMsg += "like '%s' " % ", " .join (unsafeSQLIdentificatorNaming (col ) for col in sorted (colList ))
506501 else :
502+ colCondParam = "='%s'"
507503 infoMsg += "'%s' " % ", " .join (unsafeSQLIdentificatorNaming (col ) for col in sorted (colList ))
504+
505+ condQueryStr = "%%s%s" % colCondParam
506+ condQuery = " AND (%s)" % " OR " .join (condQueryStr % (condition , unsafeSQLIdentificatorNaming (col )) for col in sorted (colList ))
508507 else :
509- condQuery = ""
508+ infoMsg + = "'%s' " % ", " . join ( unsafeSQLIdentificatorNaming ( col ) for col in sorted ( colList ))
510509
511510 infoMsg += "for table '%s' " % unsafeSQLIdentificatorNaming (tbl )
512511 infoMsg += "in database '%s'" % unsafeSQLIdentificatorNaming (conf .db )
@@ -561,21 +560,20 @@ def getColumns(self, onlyColNames=False, colTuple=None, bruteForce=None):
561560 return {conf .db : kb .data .cachedColumns [conf .db ]}
562561
563562 infoMsg = "fetching columns "
563+ condQuery = ""
564564
565565 if len (colList ) > 0 :
566- if colTuple is None :
567- colConsider , colCondParam = self .likeOrExact ("column" )
568- else :
569- colConsider , colCondParam = colTuple
570- condQueryStr = "%%s%s" % colCondParam
571- condQuery = " AND (%s)" % " OR " .join (condQueryStr % (condition , unsafeSQLIdentificatorNaming (col )) for col in sorted (colList ))
572-
573- if colConsider == "1" :
566+ if colTuple :
567+ _ , colCondParam = colTuple
574568 infoMsg += "like '%s' " % ", " .join (unsafeSQLIdentificatorNaming (col ) for col in sorted (colList ))
575569 else :
570+ colCondParam = "='%s'"
576571 infoMsg += "'%s' " % ", " .join (unsafeSQLIdentificatorNaming (col ) for col in sorted (colList ))
572+
573+ condQueryStr = "%%s%s" % colCondParam
574+ condQuery = " AND (%s)" % " OR " .join (condQueryStr % (condition , unsafeSQLIdentificatorNaming (col )) for col in sorted (colList ))
577575 else :
578- condQuery = ""
576+ infoMsg + = "'%s' " % ", " . join ( unsafeSQLIdentificatorNaming ( col ) for col in sorted ( colList ))
579577
580578 infoMsg += "for table '%s' " % unsafeSQLIdentificatorNaming (tbl )
581579 infoMsg += "in database '%s'" % unsafeSQLIdentificatorNaming (conf .db )
0 commit comments