Fix more problems with deferred execution of CREATE. Still need to do DROP.

There is now a memory leak. (CVS 1865)

FossilOrigin-Name: 6db3f122aad25b5226670ce682b7263d55c0d301
This commit is contained in:
drh
2004-07-24 14:35:58 +00:00
parent 234c39dff7
commit 3f7d4e49d8
11 changed files with 81 additions and 45 deletions
+9 -3
View File
@@ -13,7 +13,7 @@
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc4.test,v 1.4 2004/07/24 03:30:49 drh Exp $
# $Id: misc4.test,v 1.5 2004/07/24 14:35:59 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -28,6 +28,8 @@ do_test misc4-1.1 {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(1);
}
} {}
do_test misc4-1.2 {
set sql {CREATE TEMP TABLE t2 AS SELECT * FROM t1}
set stmt [sqlite3_prepare $DB $sql -1 TAIL]
execsql {
@@ -36,7 +38,11 @@ do_test misc4-1.1 {
INSERT INTO t1 SELECT * FROM t1;
ROLLBACK;
}
} {}
do_test misc4-1.3 {
sqlite3_step $stmt
} SQLITE_DONE
do_test misc4-1.4 {
execsql {
SELECT * FROM temp.t2;
}
@@ -45,12 +51,12 @@ do_test misc4-1.1 {
# Drop the temporary table, then rerun the prepared statement to
# recreate it again. This recreates ticket #807.
#
do_test misc4-1.2 {
do_test misc4-1.5 {
execsql {DROP TABLE t2}
sqlite3_reset $stmt
sqlite3_step $stmt
} {SQLITE_ERROR}
do_test misc4-1.3 {
do_test misc4-1.6 {
sqlite3_finalize $stmt
} {SQLITE_SCHEMA}