From de7ca5a27c3cfe6d9978efcf50b40a92f84b2069 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 19 Feb 2011 09:40:41 +0000 Subject: [PATCH] minor update --- plugins/generic/enumeration.py | 43 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 900d57630..5f5dba868 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -1130,30 +1130,29 @@ class Enumeration: validColumnList = False validPivotValue = False - if len(colList) > 1: - for column in colList: - infoMsg = "fetching number of distinct " - infoMsg += "values for column '%s'" % column - logger.info(infoMsg) + for column in colList: + infoMsg = "fetching number of distinct " + infoMsg += "values for column '%s'" % column + logger.info(infoMsg) - query = dumpNode.count2 % (column, table) - if blind: - value = inject.getValue(query, inband=False, error=False) - else: - value = inject.getValue(query, blind=False) + query = dumpNode.count2 % (column, table) + if blind: + value = inject.getValue(query, inband=False, error=False) + else: + value = inject.getValue(query, blind=False) - if isNumPosStrValue(value): - validColumnList = True - if value == count: - infoMsg = "using column '%s' as a pivot " % column - infoMsg += "for retrieving row data" - logger.info(infoMsg) + if isNumPosStrValue(value): + validColumnList = True + if value == count: + infoMsg = "using column '%s' as a pivot " % column + infoMsg += "for retrieving row data" + logger.info(infoMsg) - validPivotValue = True + validPivotValue = True - colList.remove(column) - colList.insert(0, column) - break + colList.remove(column) + colList.insert(0, column) + break if not validColumnList: errMsg = "all column name(s) provided are non-existent" @@ -1167,7 +1166,7 @@ class Enumeration: pivotValue = " " breakRetrieval = False - for i in xrange(count): + for i in xrange(int(count)): if breakRetrieval: break @@ -1376,7 +1375,7 @@ class Enumeration: elif DBMS.SYBASE: table = "%s..%s" % (conf.db, conf.tbl) - entries, lengths = self.__pivotDumpTable(rootQuery.blind, table, colList, int(count), blind=True) + entries, lengths = self.__pivotDumpTable(rootQuery.blind, table, colList, count, blind=True) else: if Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.MSSQL, DBMS.SYBASE):