MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _tableGetCount

Method _tableGetCount

plugins/generic/databases.py:967–990  ·  view source on GitHub ↗
(self, db, table)

Source from the content-addressed store, hash-verified

965 return kb.data.cachedColumns
966
967 def _tableGetCount(self, db, table):
968 if not db or not table:
969 return None
970
971 if Backend.getIdentifiedDbms() in UPPER_CASE_DBMSES:
972 db = db.upper()
973 table = table.upper()
974
975 if Backend.getIdentifiedDbms() in (DBMS.SQLITE, DBMS.ACCESS, DBMS.FIREBIRD, DBMS.MCKOI, DBMS.EXTREMEDB):
976 query = "SELECT %s FROM %s" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(table, True))
977 else:
978 query = "SELECT %s FROM %s.%s" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(db), safeSQLIdentificatorNaming(table, True))
979
980 query = agent.whereQuery(query)
981 count = inject.getValue(query, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS)
982
983 if isNumPosStrValue(count):
984 if safeSQLIdentificatorNaming(db) not in kb.data.cachedCounts:
985 kb.data.cachedCounts[safeSQLIdentificatorNaming(db)] = {}
986
987 if int(count) in kb.data.cachedCounts[safeSQLIdentificatorNaming(db)]:
988 kb.data.cachedCounts[safeSQLIdentificatorNaming(db)][int(count)].append(safeSQLIdentificatorNaming(table, True))
989 else:
990 kb.data.cachedCounts[safeSQLIdentificatorNaming(db)][int(count)] = [safeSQLIdentificatorNaming(table, True)]
991
992 def getCount(self):
993 if not conf.tbl:

Callers 1

getCountMethod · 0.95

Calls 5

isNumPosStrValueFunction · 0.90
getIdentifiedDbmsMethod · 0.80
whereQueryMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected