On 21 September 2015 at 16:36, Simon Slavin <slavins at bigfraud.org> wrote:

>
> On 21 Sep 2015, at 8:29am, Rowan Worth <rowanw at dugeo.com> wrote:
>
> > 1) Statement is prepared
> > 2) Statement is stepped
> > 3) Statement is reset
> > 4) ... time passes ...
> > 5) Statement is stepped
> > 6) Statement is reset
> > 7) ... time passes ...
> > etc. etc.
> >
> > The assertion seems to be that if the return value of
> sqlite3_column_count
> > is cached at step 2 it will still be valid at step 5
>
> Sorry, no.  I was saying that if it was cached at step 2 it will still be
> valid until the end of step 3.  And that if cached at step 5 it will still
> be valid until the end of step 6.  My understanding is that the database is
> locked by the first call to _step() and unlocked at the first of ...
>

Sorry, I meant gwenn's assertion, not yours :) Although assertion was a
poor choice of words - "premise of this thread" would have fit better.
It seems reasonable on the surface - I can't think of how to phrase an SQL
query such that it returns a different number of columns on a subsequent
execution without the schema changing. But then I'm no SQL expert.

Another solution is not to use "SELECT *" but instead to specify the values
> you want returned.
>

I like this advice, but it kind of sounds like gwenn is working on a
language binding so can't control the SQL itself.

-Rowan

Reply via email to