aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2006-01-07 14:02:26 +0000
committerdanielk1977 <danielk1977@noemail.net>2006-01-07 14:02:26 +0000
commitdba99bcc964233d7b8ac7d480c929c7874a03f83 (patch)
tree4086b9c6797940f2e4630940d85b5cb7905232ff /test
parentc00da105654fb2bd0712acccac3e36b539805d08 (diff)
downloadsqlite-dba99bcc964233d7b8ac7d480c929c7874a03f83.tar.gz
sqlite-dba99bcc964233d7b8ac7d480c929c7874a03f83.zip
Fix some memory leaks caused by obscure syntax errors in SQL. (CVS 2882)
FossilOrigin-Name: 6593199a4d0d0e1f9cc2f48d30327b1c03a8170e
Diffstat (limited to 'test')
-rw-r--r--test/expr.test15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/expr.test b/test/expr.test
index a54cce35c..6f9209807 100644
--- a/test/expr.test
+++ b/test/expr.test
@@ -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