1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Transactions commit on the last sqlite3_step(), not on sqlite3_finalize().

This allows the sqlite3_step() to return SQLITE_BUSY if the commit is
blocked by a lock.  Ticket #885. (CVS 1928)

FossilOrigin-Name: d1b29156558f1c576002cdb2544dffaa693da39b
This commit is contained in:
drh
2004-09-02 14:57:08 +00:00
parent 66cbd1543b
commit 92f02c31d4
12 changed files with 240 additions and 100 deletions

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script testing the callback-free C/C++ API.
#
# $Id: capi2.test,v 1.18 2004/06/30 06:30:26 danielk1977 Exp $
# $Id: capi2.test,v 1.19 2004/09/02 14:57:09 drh Exp $
#
set testdir [file dirname $argv0]
@ -203,7 +203,8 @@ do_test capi2-3.10 {
# Update for v3 - the change has not actually happened until the query is
# finalized. Is this going to cause trouble for anyone? Lee Nelson maybe?
do_test capi2-3.10b {db changes} {0}
# (Later:) The change now happens just before SQLITE_DONE is returned.
do_test capi2-3.10b {db changes} {1}
do_test capi2-3.11 {
sqlite3_finalize $VM
} {SQLITE_OK}
@ -220,8 +221,9 @@ do_test capi2-3.13 {
} {SQLITE_ERROR 0 {} {}}
# Update for v3: Preparing a statement does not affect the change counter.
# (Test result changes from 0 to 1).
do_test capi2-3.13b {db changes} {1}
# (Test result changes from 0 to 1). (Later:) change counter updates occur
# when sqlite3_step returns, not at finalize time.
do_test capi2-3.13b {db changes} {0}
do_test capi2-3.14 {
list [sqlite3_finalize $VM] [sqlite3_errmsg $DB]