mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Fix a memory leak in triggers and update tests to show the latest error
message text. (CVS 886) FossilOrigin-Name: b90d9de32d10a71fe81f5bfd0cf57faae8c5c3b4
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing the CREATE INDEX statement.
|
||||
#
|
||||
# $Id: index.test,v 1.20 2002/08/13 23:02:58 drh Exp $
|
||||
# $Id: index.test,v 1.21 2003/03/30 00:19:50 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -160,7 +160,7 @@ do_test index-4.13 {
|
||||
do_test index-5.1 {
|
||||
set v [catch {execsql {CREATE INDEX index1 ON sqlite_master(name)}} msg]
|
||||
lappend v $msg
|
||||
} {1 {table sqlite_master may not have new indices added}}
|
||||
} {1 {table sqlite_master may not be indexed}}
|
||||
do_test index-5.2 {
|
||||
execsql {SELECT name FROM sqlite_master WHERE type!='meta'}
|
||||
} {}
|
||||
|
@ -12,7 +12,7 @@
|
||||
#
|
||||
# This file implements tests for temporary tables and indices.
|
||||
#
|
||||
# $Id: temptable.test,v 1.8 2002/09/02 12:14:51 drh Exp $
|
||||
# $Id: temptable.test,v 1.9 2003/03/30 00:19:50 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -166,17 +166,28 @@ do_test temptable-4.3 {
|
||||
SELECT * FROM t2;
|
||||
} db2
|
||||
} {1 {database schema has changed}}
|
||||
do_test temptable-4.4 {
|
||||
do_test temptable-4.4.1 {
|
||||
catchsql {
|
||||
SELECT * FROM temp.t2;
|
||||
} db2
|
||||
} {0 {10 20}}
|
||||
do_test temptable-4.4.2 {
|
||||
catchsql {
|
||||
SELECT * FROM main.t2;
|
||||
} db2
|
||||
} {0 {9 8 7}}
|
||||
do_test temptable-4.4.3 {
|
||||
# TEMP takes precedence over MAIN
|
||||
catchsql {
|
||||
SELECT * FROM t2;
|
||||
} db2
|
||||
} {0 {10 20}}
|
||||
do_test temptable-4.5 {
|
||||
catchsql {
|
||||
DROP TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2; -- should drop TEMP
|
||||
SELECT * FROM t2; -- data should be from MAIN
|
||||
} db2
|
||||
} {1 {no such table: t2}}
|
||||
} {0 {9 8 7}}
|
||||
do_test temptable-4.6 {
|
||||
db2 close
|
||||
sqlite db2 ./test.db
|
||||
@ -223,10 +234,10 @@ do_test temptable-4.12 {
|
||||
} {3 4}
|
||||
do_test temptable-4.13 {
|
||||
catchsql {
|
||||
DROP TABLE t2;
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2; -- drops TEMP.T2
|
||||
SELECT * FROM t2; -- uses MAIN.T2
|
||||
} db2
|
||||
} {1 {no such table: t2}}
|
||||
} {0 {3 4}}
|
||||
do_test temptable-4.14 {
|
||||
execsql {
|
||||
SELECT * FROM t2;
|
||||
|
@ -114,7 +114,7 @@ do_test trigger1-1.9 {
|
||||
SELECT * FROM sqlite_master;
|
||||
END;
|
||||
}
|
||||
} {1 {cannot create trigger on system table: sqlite_master}}
|
||||
} {1 {cannot create trigger on system table}}
|
||||
|
||||
# Check to make sure that a DELETE statement within the body of
|
||||
# a trigger does not mess up the DELETE that caused the trigger to
|
||||
|
Reference in New Issue
Block a user