mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Fix an assert or memory leak that occurs when trying to EXPLAIN a statement
other than a SELECT that outputs results. Examples of such statements include PRAGMA integrity_check or INSERT/DELETE/UPDATE with PRAGMA count_changes=ON. (CVS 2743) FossilOrigin-Name: 533a85eee2370aafe204ff3eed50eb7fc0149e83
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 DELETE FROM statement.
|
||||
#
|
||||
# $Id: delete.test,v 1.19 2005/05/27 09:41:13 danielk1977 Exp $
|
||||
# $Id: delete.test,v 1.20 2005/10/05 11:35:09 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -49,6 +49,9 @@ do_test delete-3.1.3 {
|
||||
do_test delete-3.1.4 {
|
||||
execsql {CREATE INDEX index1 ON table1(f1)}
|
||||
execsql {PRAGMA count_changes=on}
|
||||
ifcapable explain {
|
||||
execsql {EXPLAIN DELETE FROM table1 WHERE f1=3}
|
||||
}
|
||||
execsql {DELETE FROM 'table1' WHERE f1=3}
|
||||
} {0}
|
||||
do_test delete-3.1.5 {
|
||||
|
@@ -12,7 +12,7 @@
|
||||
# focus of this file is testing the INSERT statement that takes is
|
||||
# result from a SELECT.
|
||||
#
|
||||
# $Id: insert2.test,v 1.17 2005/05/29 14:23:13 danielk1977 Exp $
|
||||
# $Id: insert2.test,v 1.18 2005/10/05 11:35:09 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -34,6 +34,13 @@ do_test insert2-1.1.1 {
|
||||
execsql {
|
||||
CREATE TABLE t1(log int, cnt int);
|
||||
PRAGMA count_changes=on;
|
||||
}
|
||||
ifcapable explain {
|
||||
execsql {
|
||||
EXPLAIN INSERT INTO t1 SELECT log, count(*) FROM d1 GROUP BY log;
|
||||
}
|
||||
}
|
||||
execsql {
|
||||
INSERT INTO t1 SELECT log, count(*) FROM d1 GROUP BY log;
|
||||
}
|
||||
} {6}
|
||||
@@ -269,4 +276,3 @@ ifcapable subquery {
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
|
Reference in New Issue
Block a user