Hi again!
I found what the problem is that sqlite returns the wrong error code.
What happens is next (in version 3.3.7):
-vdbe.c:2593 -> sqlite3BtreeCursor returns code 6 (table locked) => rc = 6
-vdbe.c:2606 -> switch checks rc value
-vdbe.c:2642 -> falls to default which is goto abort_due_to_error (:4975)
-vdbe.c:4980 -> goto vbe_halt (:4947)
-vdbe.c:4948 -> rc > 0 == true
-vdbe.c:4950 -> rc = SQLITE_ERROR <== PROBLEM we forget the correct
error code
-vdbe.c:4956 -> return rc (value is 1) == WRONG!
I added it as a bug (ticket 1965).
Regards Simon
Simon Posnjak wrote:
Hi all!
When I try to do UPDATE of a record i get: SQL logic error or missing
database (error code 1)? The database is not missing or corrupted
because I can UPDATE stuff in it with sqlite3 and I can INSERT into,
SELECT from it and also DELETE. My application uses two threads. The
first thread does INSERT,UPDATE,DELETE and SELECT in to the db and the
other thread only does SELECT. To speed up things I use precompiled
query's. They are created at application startup and they last
throughout the whole running time of the application. I have read and
followed the instructions
(http://www.sqlite.org/cvstrac/wiki?p=MultiThreading) on how to build
multi threaded applications.
Regards Simon
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------