Save the position of any open cursors before a rollback. (CVS 3026)
FossilOrigin-Name: 32d45bcf746e7e926b8cc8bd038d66e7c2ec6562
This commit is contained in:
+43
-2
@@ -9,7 +9,7 @@
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
# $Id: shared2.test,v 1.2 2006/01/24 11:30:27 danielk1977 Exp $
|
||||
# $Id: shared2.test,v 1.3 2006/01/24 14:21:24 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -78,10 +78,51 @@ do_test shared2-1.3 {
|
||||
list $a $count
|
||||
} {32 64}
|
||||
|
||||
# Rollback data into or out of a table while a read-uncommitted
|
||||
# cursor is scanning it.
|
||||
#
|
||||
do_test shared2-2.1 {
|
||||
execsql {
|
||||
INSERT INTO numbers VALUES(1, 'Medium length text field');
|
||||
INSERT INTO numbers VALUES(2, 'Medium length text field');
|
||||
INSERT INTO numbers VALUES(3, 'Medium length text field');
|
||||
INSERT INTO numbers VALUES(4, 'Medium length text field');
|
||||
BEGIN;
|
||||
DELETE FROM numbers WHERE (a%2)=0;
|
||||
} db1
|
||||
set res [list]
|
||||
db2 eval {
|
||||
SELECT a FROM numbers ORDER BY a;
|
||||
} {
|
||||
lappend res $a
|
||||
if {$a==3} {
|
||||
execsql {ROLLBACK} db1
|
||||
}
|
||||
}
|
||||
set res
|
||||
} {1 3 4}
|
||||
do_test shared2-2.2 {
|
||||
execsql {
|
||||
BEGIN;
|
||||
INSERT INTO numbers VALUES(5, 'Medium length text field');
|
||||
INSERT INTO numbers VALUES(6, 'Medium length text field');
|
||||
} db1
|
||||
set res [list]
|
||||
db2 eval {
|
||||
SELECT a FROM numbers ORDER BY a;
|
||||
} {
|
||||
lappend res $a
|
||||
if {$a==5} {
|
||||
execsql {ROLLBACK} db1
|
||||
}
|
||||
}
|
||||
set res
|
||||
} {1 2 3 4 5}
|
||||
|
||||
db1 close
|
||||
db2 close
|
||||
|
||||
do_test shared2-1.4 {
|
||||
do_test shared2-3.2 {
|
||||
sqlite3_thread_cleanup
|
||||
sqlite3_enable_shared_cache 1
|
||||
} {0}
|
||||
|
||||
Reference in New Issue
Block a user