Index: src/expr.c ================================================================== --- src/expr.c +++ src/expr.c @@ -395,10 +395,11 @@ ** ** Also propagate all EP_Propagate flags from the Expr.x.pList into ** Expr.flags. */ void sqlite3ExprSetHeightAndFlags(Parse *pParse, Expr *p){ + if( pParse->nErr ) return; exprSetHeight(p); sqlite3ExprCheckHeight(pParse, p->nHeight); } /* Index: test/misc1.test ================================================================== --- test/misc1.test +++ test/misc1.test @@ -11,11 +11,10 @@ # This file implements regression tests for SQLite library. # # This file implements tests for miscellanous features that were # left out of other test files. # -# $Id: misc1.test,v 1.42 2007/11/05 14:58:23 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Mimic the SQLite 2 collation type NUMERIC. @@ -628,7 +627,16 @@ do_execsql_test misc1-20.1 { CREATE TABLE t0(x INTEGER DEFAULT(0==0) NOT NULL); REPLACE INTO t0(x) VALUES(''); SELECT rowid, quote(x) FROM t0; } {1 ''} + +# 2015-03-22: NULL pointer dereference after a syntax error +# +do_catchsql_test misc1-21.1 { + select''like''like''like#0; +} {1 {near "#0": syntax error}} +do_catchsql_test misc1-21.2 { + VALUES(0,0x0MATCH#0; +} {1 {near ";": syntax error}} finish_test