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

Fix some memory leaks caused by obscure syntax errors in SQL. (CVS 2882)

FossilOrigin-Name: 6593199a4d0d0e1f9cc2f48d30327b1c03a8170e
This commit is contained in:
danielk1977
2006-01-07 14:02:26 +00:00
parent c00da10565
commit dba99bcc96
4 changed files with 27 additions and 11 deletions

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing expressions.
#
# $Id: expr.test,v 1.48 2005/11/14 22:29:06 drh Exp $
# $Id: expr.test,v 1.49 2006/01/07 14:02:27 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -633,6 +633,17 @@ do_test expr-11.2 {
execsql {SELECT typeof(9223372036854775808)}
} {real}
# These two statements used to leak memory (because of missing %destructor
# directives in parse.y).
do_test expr-12.1 {
catchsql {
SELECT (CASE a>4 THEN 1 ELSE 0 END) FROM test1;
}
} {1 {near "THEN": syntax error}}
do_test expr-12.2 {
catchsql {
SELECT (CASE WHEN a>4 THEN 1 ELSE 0) FROM test1;
}
} {1 {near ")": syntax error}}
finish_test