Skip to content

Commit d1acdee

Browse files
committed
fixed --count for DBMSes that are single-database
1 parent 8748cce commit d1acdee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: plugins/generic/databases.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,11 @@ def _tableGetCount(self, db, table):
738738
db = db.upper()
739739
table = table.upper()
740740

741-
query = "SELECT %s FROM %s.%s" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(db), safeSQLIdentificatorNaming(table, True))
741+
if Backend.getIdentifiedDbms() in (DBMS.SQLITE, DBMS.ACCESS, DBMS.FIREBIRD):
742+
query = "SELECT %s FROM %s" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(table, True))
743+
else:
744+
query = "SELECT %s FROM %s.%s" % (queries[Backend.getIdentifiedDbms()].count.query % '*', safeSQLIdentificatorNaming(db), safeSQLIdentificatorNaming(table, True))
745+
742746
count = inject.getValue(query, expected=EXPECTED.INT, charsetType=CHARSET_TYPE.DIGITS)
743747

744748
if isNumPosStrValue(count):

0 commit comments

Comments
 (0)