(self, db, table)
| 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: |
no test coverage detected