> -----Original Message----- > From: Ran [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 11:47 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] "SQL logic error or missing database" > > Indeed if I reset after the first step failed, and than > prepare again, the select works. But I guess this is not the > usual way to do things right? I mean - shouldn't the first > prepare be aware of the fact that the database was changed? > Or maybe CREATE TABLE is a special case?
I suspect that in order to save time, prepare() will not check to see if the schema has changed unless the SQL fails to compile. If the SQL fails to compile, it'll go ahead and check the schema and report the schema failure if there is one. Since your SQL didn't fail to compile, it didn't bother checking to see if the schema had expired. The overhead of checking for expired schema on every prepare would be prohibitive, I would think. Robert