On 9/8/16, Simon Slavin <slav...@bigfraud.org> wrote: > > On 8 Sep 2016, at 10:43am, Richard Hipp <d...@sqlite.org> wrote: > >> On 9/7/16, David Empson <demp...@emptech.co.nz> wrote: >>> >>> every ATTACH DATABASE or >>> DETACH DATABASE triggers a schema change... >> >> That's because the set of tables and indexes available to the query >> planner changes, and so all of the SQL statements need to be reparsed >> and replanned, to take into account those changes. > > In other words, the "schema version number" value isn't there to count the > number of times the schema has changed. It's there to signal the query > planner that it needs to replan everything. The signal is used by other > things than changes to the schema saved in the database. >
There are no writes to the database files that result from an ATTACH or DETACH, so the "schema version" numbers do not change in that case. But all existing prepared statements do automatically get reprepared upon next use, which triggers SQLITE_SCHEMA messages in the error and warning log. -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users