On 13 Sep 2018, at 3:49pm, Brian Vincent <bra...@gmail.com> wrote:

> From my testing, it appears that this information isn't exactly correct.
> In my tests, when I call sqlite3_column_int64 for example, and it's
> successful, sqlite_errcode() immediately afterwards is returning
> SQLITE_ROW, which leads me to believe that it's not setting the error code
> to SQLITE_OK when it's successful.  If I can't trust sqlite_errcode() when
> it's successful, how can I be sure that it succeeded?

You are correct.  The documentation is correct.  The post you are reading is 
incorrect.

The documentation for sqlite_errcode() states clearly that if the previous 
operation was successful, the value returned by sqlite_errcode() is undefined.  
In other words, the only time you can use sqlite_errcode() with confidence is 
when an API call has just returned an error code.

However sqlite3_column_int64() can return 0 for two reasons: the value it's 
returning is genuinely 0, or an error occurred during its execution.  If it 
does return 0 then sqlite_errcode() alone is not sufficient to determine which 
of these happened.

I believe that your concern is valid and should be addressed.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to