DB-API: some SQL implementations need subqueries to be named

This commit is contained in:
Doug Blank 2016-04-23 16:07:27 -04:00
parent a925aa5cc8
commit 3ccc3a3512

View File

@ -1867,7 +1867,7 @@ class DBAPI(DbGeneric):
", ".join(select_fields), table_name, where_clause, order_clause, limit
)
if get_count_only:
self.dbapi.execute("SELECT count(1) from (%s);" % query)
self.dbapi.execute("SELECT count(1) from (%s) AS temp_select;" % query)
rows = self.dbapi.fetchall()
yield rows[0][0]
return