Re: [sqlite] Error messages from user-defined functions calling sqlite3_result_error() requires sqlite3_finalize?

2011-10-27 Thread Dan Kennedy

On 10/27/2011 07:12 AM, Peter Aronson wrote:

This may be a known thing, but I can't find anything on it on-line.  I finally
figured out a solution by examining the code to shell.c.

OK, I have a user-defined function in an extension that calls
sqlite3_result_error() when an out-of-bounds argument is passed in.  I called
sqlite3_prepare16_v2() on the SQL, which worked, then sqlite3_step(), which
failed.  Then I called sqlite3_errmsg16(), and got instead of my message, this
message: SQL logic error or missing database.  Only once I called
sqlite3_finalize() before sqlite3_errmsg16 did I get the error message from my
function (I was calling sqlite3_finalize() after calling sqlite3_errmsg() before
that).

Now the on-line doc notes that you need to call sqlite3_finalize() to get the
proper error code when using the legacy interface.  But I'm not using the legacy
interface and it says nothing about the error message functions anyway.


Fixed here:

  http://www.sqlite.org/src/info/8f88cc4e61

If you use sqlite3_prepare_v2() to prepare the statement, the custom
error message will now be available after sqlite3_step() returns.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error messages from user-defined functions calling sqlite3_result_error() requires sqlite3_finalize?

2011-10-27 Thread Jean-Christophe Deschamps



Fixed here:

  http://www.sqlite.org/src/info/8f88cc4e61

If you use sqlite3_prepare_v2() to prepare the statement, the custom
error message will now be available after sqlite3_step() returns.


Many thanks Dan. 


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Error messages from user-defined functions calling sqlite3_result_error() requires sqlite3_finalize?

2011-10-26 Thread Peter Aronson
This may be a known thing, but I can't find anything on it on-line.  I finally 
figured out a solution by examining the code to shell.c.

OK, I have a user-defined function in an extension that calls 
sqlite3_result_error() when an out-of-bounds argument is passed in.  I called 
sqlite3_prepare16_v2() on the SQL, which worked, then sqlite3_step(), which 
failed.  Then I called sqlite3_errmsg16(), and got instead of my message, this 
message: SQL logic error or missing database.  Only once I called 
sqlite3_finalize() before sqlite3_errmsg16 did I get the error message from my 
function (I was calling sqlite3_finalize() after calling sqlite3_errmsg() 
before 
that).

Now the on-line doc notes that you need to call sqlite3_finalize() to get the 
proper error code when using the legacy interface.  But I'm not using the 
legacy 
interface and it says nothing about the error message functions anyway.

So, is this a software error, a documentation error, or did I simply miss 
something somewhere?

Best regards,

Peter
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error messages from user-defined functions calling sqlite3_result_error() requires sqlite3_finalize?

2011-10-26 Thread Jean-Christophe Deschamps
Funny coincidence in time, I just posted on the same subject while your 
post was being received!


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error messages from user-defined functions calling sqlite3_result_error() requires sqlite3_finalize?

2011-10-26 Thread Peter Aronson
Oh, that *is* funny.

Peter

 -Original Message-
 From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
 boun...@sqlite.org] On Behalf Of Jean-Christophe Deschamps
 Sent: Wednesday, October 26, 2011 6:12 PM
 To: General Discussion of SQLite Database
 Subject: Re: [sqlite] Error messages from user-defined functions calling
 sqlite3_result_error() requires sqlite3_finalize?
 
 Funny coincidence in time, I just posted on the same subject while your
 post was being received!
 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Error Messages

2005-07-11 Thread Ben Clewett

Sorry to bombard with so much email.

A small request for later version of SQLite.

Would it be possible to change this error message:

logic error or missing database

To:

logic error, missing database, database read-only, or database 
directory read-only.


I hope this is not unreasonable, it took me a long time to work out why 
I was getting this message.


Kind regards,

Ben Clewett.