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

Always reload the schema after a rollback. Ticket #594. (CVS 1229)

FossilOrigin-Name: 12c7a83f8e4055c4590983ef212648c781ebd963
This commit is contained in:
drh
2004-02-12 15:31:21 +00:00
parent 93581642d2
commit 8ef83ffed8
9 changed files with 69 additions and 26 deletions

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script is the sqlite_interrupt() API.
#
# $Id: interrupt.test,v 1.1 2004/02/12 13:02:57 drh Exp $
# $Id: interrupt.test,v 1.2 2004/02/12 15:31:22 drh Exp $
set testdir [file dirname $argv0]
@ -105,5 +105,40 @@ do_test interrupt-2.4 {
} 1
integrity_check interrupt-2.5
# Ticket #594. If an interrupt occurs in the middle of a transaction
# and that transaction is later rolled back, the internal schema tables do
# not reset.
#
for {set i 1} {$i<50} {incr i 5} {
do_test interrupt-3.$i.1 {
execsql {
BEGIN;
CREATE TEMP TABLE t2(x,y);
SELECT name FROM sqlite_temp_master;
}
} {t2}
do_test interrupt-3.$i.2 {
set ::sqlite_interrupt_count $::i
catchsql {
INSERT INTO t2 SELECT * FROM t1;
}
} {1 interrupted}
do_test interrupt-3.$i.3 {
execsql {
SELECT name FROM sqlite_temp_master;
}
} {t2}
do_test interrupt-3.$i.4 {
catchsql {
ROLLBACK
}
} {0 {}}
do_test interrupt-3.$i.5 {
catchsql {SELECT name FROM sqlite_temp_master};
execsql {
SELECT name FROM sqlite_temp_master;
}
} {}
}
finish_test