Fix 'too many SQL variables' variant

This commit is contained in:
Jay Kamat 2019-04-02 22:35:57 -07:00 committed by Florian Bruhin
parent 0a2c177120
commit 47289e4560
2 changed files with 10 additions and 4 deletions

View File

@ -107,6 +107,7 @@ class HistoryCategory(QSqlQueryModel):
except sql.SqlKnownError as e:
# Sometimes, the query we built up was invalid, for example,
# due to a large amount of words.
# Also catches failures in the DB we can't solve.
message.error("Error with SQL Query: {}".format(e.text()))
return
self.setQuery(self._query.query)

View File

@ -111,10 +111,15 @@ def raise_sqlite_error(msg, error):
driver_text == "Error opening database" and
database_text == "out of memory")
if ((error_code in environmental_errors or qtbug_70506) or
(error_code == SqliteErrorCode.ERROR and
driver_text == "Unable to execute statement" and
database_text.startswith("Expression tree is too large"))):
# https://github.com/qutebrowser/qutebrowser/issues/4681
# If the query we built was too long
too_long_err = (
error_code == SqliteErrorCode.ERROR and
driver_text == "Unable to execute statement" and
(database_text.startswith("Expression tree is too large") or
database_text == "too many SQL variables"))
if (error_code in environmental_errors or qtbug_70506 or too_long_err):
raise SqlKnownError(msg, error)
raise SqlBugError(msg, error)