The documentation (https://www.sqlite.org/c3ref/reset.html) seems to
suggest that sqlite3_reset can only be unsuccessful if sqlite3_step
returned an error.
Not sure about sqlite3_clear_bindings.
I will do some testing and see if there is any performance gain in leaving
these checks out. Very likely there is no relevant gain.

RBS

On Sun, May 28, 2017 at 12:28 PM, Gwendal Roué <gwendal.r...@gmail.com>
wrote:

>
> > Le 28 mai 2017 à 13:24, Bart Smissaert <bart.smissa...@gmail.com> a
> écrit :
> >
> >> Calling sqlite3_clear_bindings does the same thing as calling
> > sqlite3_bind_null for all arguments.
> >
> > Yes, I understand that, just thinking about efficiency.
>
> Then I don't know. Your experience will tell.
>
> >> I personnally call sqlite3_reset before sqlite3_clear_bingings with
> great
> > success
> >
> > I am doing the same now. Probably no difference there
>
> I suppose so.
>
> >> is there any point *not* checking a result code whenever you are given
> > the opportunity to?
> >
> > Yes, there is if there is no possible way in that particular situation
> that
> > the result could be other than success.
> > If there was a successful sqlite3_step just preceding it could a
> > sqlite3_reset possibly be unsuccessful?
> > If there was a successful sqlite3_reset just preceding it could a
> > sqlite3_clear_bindings possibly be unsuccessful?
>
> The documentation is your reference. If the documentation does not answer
> your questions, then you shouldn't assume anything, and take the only
> reasonable decision: check for errors whenever you can.
>
> Gwendal
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to