I just switched to 3.3.10 and I'm playing around with sqlite3_prepare_v2. I
have a database with two open connections, and each connection creates its
own table. After the second connection creates its table all statements
created with sqlite3_prepare_v2 on the first connection fail with
SQLITE_SCHEMA. I searched the mailing list and found this earlier discussion
about schema changes from different connections:
http://www.mail-archive.com/sqlite-users@sqlite.org/msg17823.html, but I'm
wondering if sqlite3_prepare_v2 should try to reload the schema before
returning the SQLITE_SCHEMA error. The new documentation states:

"If the schema has changed in a way that makes the statement no longer
valid, sqlite3_step <http://sqlite.org/capi3ref.html#sqlite3_step>() will
still return SQLITE_SCHEMA. But unlike the legacy behavior, SQLITE_SCHEMA is
now a fatal error. Calling
sqlite3_prepare_v2<http://sqlite.org/capi3ref.html#sqlite3_prepare_v2>()
again will not make the error go away."

which implies that SQLITE_SCHEMA is only returned when the schema change is
fatal, i.e. the table has been removed. If v2 statements are going to
continue returning an error for schema changes from another connection, can
there at least be separate error codes for fatal vs. non-fatal schema
changes?

Reply via email to