Improved error message when a #NNN parameter appears on user input.

Additional coverage testing. (CVS 2582)

FossilOrigin-Name: 3c00f5982ae61dfcd26c33ccdb81736628dbfce5
This commit is contained in:
drh 2005-08-12 22:58:53 +00:00
parent d2687b7731
commit bb7ac00bf0
5 changed files with 21 additions and 12 deletions

View File

@ -1,5 +1,5 @@
C Optimize\sLIKE\sand\sGLOB\soperators\sin\sthe\sWHERE\sclause.\s\sCode\spasses\sall\nregression\stests\sbut\sstill\sneeds\sadditional\stests.\s(CVS\s2581)
D 2005-08-12T22:56:09
C Improved\serror\smessage\swhen\sa\s#NNN\sparameter\sappears\son\suser\sinput.\nAdditional\scoverage\stesting.\s(CVS\s2582)
D 2005-08-12T22:58:53
F Makefile.in 22ea9c0fe748f591712d8fe3c6d972c6c173a165
F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -39,7 +39,7 @@ F src/callback.c 0910b611e0c158f107ee3ff86f8a371654971e2b
F src/date.c 7444b0900a28da77e57e3337a636873cff0ae940
F src/delete.c be1fc25c9e109cd8cbab42a43ee696263da7c04b
F src/experimental.c 50c1e3b34f752f4ac10c36f287db095c2b61766d
F src/expr.c 9c319b9f9fbb79f06adbcd0ed2deab012a00ba37
F src/expr.c cad7f9197587db4897192cf21a8629b3b102c682
F src/func.c 2be0799df0c05066a29e589485ebee0b3f756a15
F src/hash.c 2b1b13f7400e179631c83a1be0c664608c8f021f
F src/hash.h 1b0c445e1c89ff2aaad9b4605ba61375af001e84
@ -163,7 +163,7 @@ F test/limit.test 270b076f31c5c32f7187de5727e74da4de43e477
F test/lock.test 9b7afcb24f53d24da502abb33daaad2cd6d44107
F test/lock2.test 59c3dd7d9b24d1bf7ec91b2d1541c37e97939d5f
F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9
F test/main.test febb69416071134dc38b9b1971c0c2e5b0ca3ff8
F test/main.test 249f139ef2f75710db1b49bb79e8b27767eacae1
F test/malloc.test b7bc72bb1627e09d6003f58de9bcd6e4be839753
F test/malloc2.test 655b972372d2754a3f6c6ed54d7cfd18fde9bd32
F test/memdb.test 1860e060be810bf0775bc57408a5b7c4954bcaea
@ -211,7 +211,7 @@ F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b
F test/threadtest2.c 97a830d53c24c42290501fdfba4a6e5bdd34748b
F test/trace.test a54fa8df0d01cf827289a7659d78959e8fd2f955
F test/trans.test 10506dc30305cfb8c4098359f7f6f64786f69c5e
F test/trigger1.test 4c68031fbf62966311163586bdb504b168643b49
F test/trigger1.test 152aed5a1fa90709fe171f2ca501a6b7f7901479
F test/trigger2.test f671b922c88f70c3cd2c6f03fe7c256ae7a52fc4
F test/trigger3.test 9102fd3933db294dc654b5aee9edfe9e94f2b9e2
F test/trigger4.test 9615207f3746b1f3965113007869e45a895d2497
@ -291,7 +291,7 @@ F www/tclsqlite.tcl 3df553505b6efcad08f91e9b975deb2e6c9bb955
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 528299b8316726dbcc5548e9aa0648c8b1bd055b
P fa7403c7d9948cc4a6c6ed00a614e3d6a3682e78
R f95355ea47c912177ab06d841df32b8a
P 3edbe8d6217fd1180883e6b9f1e5b9011a39f80d
R ae2c3b65474b0ccf695425e1d93f57a6
U drh
Z ca309b724231e8b642eb0d9abe08ca05
Z 566241899895f3971c3c12f45ff1e8b0

View File

@ -1 +1 @@
3edbe8d6217fd1180883e6b9f1e5b9011a39f80d
3c00f5982ae61dfcd26c33ccdb81736628dbfce5

View File

@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
** $Id: expr.c,v 1.215 2005/08/12 22:56:09 drh Exp $
** $Id: expr.c,v 1.216 2005/08/12 22:58:53 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@ -226,11 +226,11 @@ Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
Vdbe *v = pParse->pVdbe;
Expr *p;
int depth;
if( v==0 ) return 0;
if( pParse->nested==0 ){
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", pToken);
return 0;
}
if( v==0 ) return 0;
p = sqlite3Expr(TK_REGISTER, 0, 0, pToken);
if( p==0 ){
return 0; /* Malloc failed */

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is exercising the code in main.c.
#
# $Id: main.test,v 1.20 2005/02/26 17:31:28 drh Exp $
# $Id: main.test,v 1.21 2005/08/12 22:58:53 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -305,5 +305,9 @@ do_test main-3.5 {
set v [catch {execsql {create}} msg]
lappend v $msg
} {1 {near "create": syntax error}}
do_test main-3.6 {
catchsql {SELECT 'abc' + #9}
} {1 {near "#9": syntax error}}
finish_test

View File

@ -589,4 +589,9 @@ ifcapable tempdb {
} {main 21 22 23 temp 24 25 26 aux 27 28 29}
}
do_test trigger1-11.1 {
catchsql {SELECT raise(abort,'message');}
} {1 {RAISE() may only be used within a trigger-program}}
finish_test