diff --git a/plugins/generic/enumeration.py b/plugins/generic/enumeration.py index 02a43019f..823f0676e 100644 --- a/plugins/generic/enumeration.py +++ b/plugins/generic/enumeration.py @@ -784,11 +784,6 @@ class Enumeration: def dumpTable(self): - if kb.dbms == "MySQL" and not self.has_information_schema: - errMsg = "information_schema not available, " - errMsg += "back-end DBMS is MySQL < 5.0" - raise sqlmapUnsupportedFeatureException, errMsg - if not conf.tbl: errMsg = "missing table parameter" raise sqlmapMissingMandatoryOptionException, errMsg @@ -804,6 +799,23 @@ class Enumeration: rootQuery = queries[kb.dbms].dumpTable + if conf.col: + self.cachedColumns[conf.db] = {} + self.cachedColumns[conf.db][conf.tbl] = {} + for column in colList: + self.cachedColumns[conf.db][conf.tbl][column] = None + elif not self.cachedColumns: + if kb.dbms == "MySQL" and not self.has_information_schema: + errMsg = "information_schema not available, " + errMsg += "back-end DBMS is MySQL < 5.0" + raise sqlmapUnsupportedFeatureException, errMsg + + self.cachedColumns = self.getColumns(onlyColNames=True) + + colList = self.cachedColumns[conf.db][conf.tbl].keys() + colList.sort(key=lambda x: x.lower()) + colString = ", ".join(column for column in colList) + logMsg = "fetching" if conf.col: colList = conf.col.split(",") @@ -813,18 +825,6 @@ class Enumeration: logMsg += " on database '%s'" % conf.db logger.info(logMsg) - if conf.col: - self.cachedColumns[conf.db] = {} - self.cachedColumns[conf.db][conf.tbl] = {} - for column in colList: - self.cachedColumns[conf.db][conf.tbl][column] = None - elif not self.cachedColumns: - self.cachedColumns = self.getColumns(onlyColNames=True) - - colList = self.cachedColumns[conf.db][conf.tbl].keys() - colList.sort(key=lambda x: x.lower()) - colString = ", ".join(column for column in colList) - if conf.unionUse: if kb.dbms == "Oracle": query = rootQuery["inband"]["query"] % (colString, conf.tbl.upper())