Re: [sqlite] SQLITE_SCHEMA and statement parameters

2005-04-22 Thread D. Richard Hipp
On Thu, 2005-04-21 at 19:33 -0700, Vladimir Vukicevic wrote: > That would work, except right now you only get SQLITE_SCHEMA from > sqlite3_finalize() -- sqlite_step just returns SQLITE_ERROR. If > step() returned SQLITE_SCHEMA(), transfer_bindings() would work well, > or even if there was another

Re: [sqlite] SQLITE_SCHEMA and statement parameters

2005-04-22 Thread Vladimir Vukicevic
On 4/22/05, Jan-Eric Duden <[EMAIL PROTECTED]> wrote: > I use the sqlite3_expired api - which is only documented in the > sqlite3.h header. > Unfortunately it is considered an experimental API. Huh, I never noticed that function in the header -- thanks for pointing it out! It looks like the call

Re: [sqlite] SQLITE_SCHEMA and statement parameters

2005-04-22 Thread Jan-Eric Duden
Vladimir Vukicevic wrote: On 4/21/05, D. Richard Hipp <[EMAIL PROTECTED]> wrote: How about sqlite3_transfer_bindings(). So if you get an SQLITE_SCHEMA error you rerun sqlite3_prepare() to get a new sqlite3_stmt, then call sqlite3_transfer_bindings() to transfer bindings from the old statement o

Re: [sqlite] SQLITE_SCHEMA and statement parameters

2005-04-21 Thread Vladimir Vukicevic
On 4/21/05, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > How about sqlite3_transfer_bindings(). So if you get an > SQLITE_SCHEMA error you rerun sqlite3_prepare() to get > a new sqlite3_stmt, then call sqlite3_transfer_bindings() > to transfer bindings from the old statement over to the > new stat

Re: [sqlite] SQLITE_SCHEMA and statement parameters

2005-04-21 Thread D. Richard Hipp
On Thu, 2005-04-21 at 18:18 -0700, Vladimir Vukicevic wrote: > On 4/21/05, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > > So when the schema changes, it is not a matter of changes > > a few bits and pieces of the VM. The VM must be completely > > reconstructed. Its a complete do-over. > > Yep, I

Re: [sqlite] SQLITE_SCHEMA and statement parameters

2005-04-21 Thread Vladimir Vukicevic
On 4/21/05, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > So when the schema changes, it is not a matter of changes > a few bits and pieces of the VM. The VM must be completely > reconstructed. Its a complete do-over. Yep, I guess what I'm suggesting is just doing that reconstruction internally t

Re: [sqlite] SQLITE_SCHEMA and statement parameters

2005-04-21 Thread D. Richard Hipp
On Thu, 2005-04-21 at 14:10 -0700, Vladimir Vukicevic wrote: > Is there any reason that step() can't recreate the > bits of the VDBE that need to be updated itself in case of a > SQLITE_SCHEMA error, while preserving current parameter bindings? > You make it sound as if only a few parameters in a

Re: [sqlite] SQLITE_SCHEMA and statement parameters

2005-04-21 Thread Vladimir Vukicevic
(Sorry, accidentally dropped the sqlite mailing list from my first reply) You're misunderstanding. The only "schema change" is creating additional tables, that are not referenced by any existing statements. There are many reasons why one might want to do this. However, currently, doing so inval

Re: [sqlite] SQLITE_SCHEMA and statement parameters

2005-04-21 Thread Jay Sprenkle
I've been using sqlite for several months now and have never had a SQLITE_SCHEMA error. What are you doing that's causing it? On 4/21/05, Vladimir Vukicevic <[EMAIL PROTECTED]> wrote: > Right now it's quite difficult to implement any kind of higher-level > wrapper over sqlite3_prepare()/sqlite3_s

[sqlite] SQLITE_SCHEMA and statement parameters

2005-04-21 Thread Vladimir Vukicevic
Right now it's quite difficult to implement any kind of higher-level wrapper over sqlite3_prepare()/sqlite3_step()/etc., because of the semantics of the SQLITE_SCHEMA error. If you bind values to parameters of a sqlite3_stmt, you have to redo that binding after you recreate the sqlite3_stmt due to