Bug in SQLite C++ Wrapper?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in SQLite C++ Wrapper?

Brown, Dave

In looking at the SQLite C++ Wrapper (http://dev.int64.org/sqlite.html) I
noticed the example insert code has a loop like:

 for(int i=0; i<10000; i++) {
    cmd.bind(1, i);
    cmd.executenonquery();
 }

but sqlite3_reset() isn't being called each time after the statement is
executed (executenonquery() just ends up calling sqlite3_step() ). Doesn't
sqlite3_reset() have to be called in order to reuse a prepared query?

-Dave
Reply | Threaded
Open this post in threaded view
|

Re: Bug in SQLite C++ Wrapper?

Cory Nelson
cmd.executenonquery() creates a reader, which calls reset when destructed :)

On 6/25/05, Brown, Dave <[hidden email]> wrote:

>
> In looking at the SQLite C++ Wrapper (http://dev.int64.org/sqlite.html) I
> noticed the example insert code has a loop like:
>
>  for(int i=0; i<10000; i++) {
>     cmd.bind(1, i);
>     cmd.executenonquery();
>  }
>
> but sqlite3_reset() isn't being called each time after the statement is
> executed (executenonquery() just ends up calling sqlite3_step() ). Doesn't
> sqlite3_reset() have to be called in order to reuse a prepared query?
>
> -Dave
>


--
Cory Nelson
http://www.int64.org
Reply | Threaded
Open this post in threaded view
|

RE: Bug in SQLite C++ Wrapper?

Brown, Dave
In reply to this post by Brown, Dave
Aha, thanks!

-----Original Message-----
From: Cory Nelson [mailto:[hidden email]]
Sent: Saturday, June 25, 2005 11:30 AM
To: [hidden email]
Subject: Re: [sqlite] Bug in SQLite C++ Wrapper?

cmd.executenonquery() creates a reader, which calls reset when destructed :)

On 6/25/05, Brown, Dave <[hidden email]> wrote:
>
> In looking at the SQLite C++ Wrapper
> (http://dev.int64.org/sqlite.html) I noticed the example insert code has a
loop like:

>
>  for(int i=0; i<10000; i++) {
>     cmd.bind(1, i);
>     cmd.executenonquery();
>  }
>
> but sqlite3_reset() isn't being called each time after the statement
> is executed (executenonquery() just ends up calling sqlite3_step() ).
> Doesn't
> sqlite3_reset() have to be called in order to reuse a prepared query?
>
> -Dave
>


--
Cory Nelson
http://www.int64.org