- attached sqlalchemy-bug.py
No-value SQLite insert triggers OperationalError on Windows
The attached script triggers this exception on Windows (but not Unix):
sqlalchemy.exc.OperationalError: (OperationalError) near "DEFAULT": syntax error u'INSERT INTO items DEFAULT VALUES' []
I am at a loss for what's going on here, but the fact that the statement is actually a Unicode string struck me as strange.
(This is on Python 2.5.2 and sqlalchemy 0.5.0beta1.)
Comments (3)
-
Account Deleted -
repo owner - changed status to wontfix
older versions of sqlite (which are not specifically known, they're not well documented) do not support the "DEFAULT VALUES" syntax. You need to upgrade the sqlite binary in use. Reopen this ticket if problems persist.
-
Just to expound on this. The default installation of Python 2.5.2 on Windows installs the following versions:
>>> print sqlite3.version # pysqlite version 2.3.2 >>> print sqlite3.sqlite_version #sqlite3 version 3.3.4
That version of the sqlite3 engine does not support the DEFAULT VALUES syntax, as zzeek stated. We might want to point out in the Installing a Database API section of the docs, or elsewhere, that the default version of the engine will not work properly.
- Log in to comment
script demonstrating the bug