Open fsaad opened 7 years ago
Can you share gapminder.bdb, or the results of the initial SELECT, or a SQL trace from this program?
Saving another incarnation of this error using COUNT(*)
for future reference, where bdb.execute
complains
E AssertionError: Invalid select table: u't'
but bdb.sql_execute
is fine
qt = sqlite3_quote_name(table)
qc = sqlite3_quote_name(cmd.name)
cursor = bdb.execute(
'SELECT COUNT(*) FROM %s WHERE %s IS NOT NULL' %
(qt, qc))
The data is from test_csv.csv_data
and qc
is height
.
Date: Wed, 18 Jan 2017 03:41:37 -0800 From: F Saad notifications@github.com
Saving another incarnation of this error using COUNT(*)
for future reference, where bdb.execute
complains
E AssertionError: Invalid select table: u't'
but bdb.sql_execute
is fine
qt = sqlite3_quote_name(table)
qc = sqlite3_quote_name(cmd.name)
cursor = bdb.execute(
'SELECT COUNT(*) FROM %s WHERE %s IS NOT NULL' %
(qt, qc))
The data is from test_csv.csv_data
and qc
is height
.
Interesting. Somehow a Unicode string is getting passed through, but as I recall BQL works exclusively in US-ASCII. The reason this assertion fires is that the select table is the Unicode string u't', not the byte string b't' (a.k.a. just 't' in Python 2).
What is query
here?
OK, but replacing the line
returns