/ Check-in [3c00f598]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improved error message when a #NNN parameter appears on user input. Additional coverage testing. (CVS 2582)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3c00f5982ae61dfcd26c33ccdb81736628dbfce5
User & Date: drh 2005-08-12 22:58:53
Context
2005-08-12
23:20
3rd argument to sqlite3Error() should always be a format string, never user-supplied error message text. Ticket #1354. (CVS 2583) check-in: d6146a54 user: drh tags: trunk
22:58
Improved error message when a #NNN parameter appears on user input. Additional coverage testing. (CVS 2582) check-in: 3c00f598 user: drh tags: trunk
22:56
Optimize LIKE and GLOB operators in the WHERE clause. Code passes all regression tests but still needs additional tests. (CVS 2581) check-in: 3edbe8d6 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains routines used for analyzing expressions and
    13     13   ** for generating VDBE code that evaluates expressions in SQLite.
    14     14   **
    15         -** $Id: expr.c,v 1.215 2005/08/12 22:56:09 drh Exp $
           15  +** $Id: expr.c,v 1.216 2005/08/12 22:58:53 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <ctype.h>
    19     19   
    20     20   /*
    21     21   ** Return the 'affinity' of the expression pExpr if any.
    22     22   **
................................................................................
   222    222   ** The returns an expression that will code to extract the value from
   223    223   ** that memory location as needed.
   224    224   */
   225    225   Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){
   226    226     Vdbe *v = pParse->pVdbe;
   227    227     Expr *p;
   228    228     int depth;
   229         -  if( v==0 ) return 0;
   230    229     if( pParse->nested==0 ){
   231    230       sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", pToken);
   232    231       return 0;
   233    232     }
          233  +  if( v==0 ) return 0;
   234    234     p = sqlite3Expr(TK_REGISTER, 0, 0, pToken);
   235    235     if( p==0 ){
   236    236       return 0;  /* Malloc failed */
   237    237     }
   238    238     depth = atoi(&pToken->z[1]);
   239    239     p->iTable = pParse->nMem++;
   240    240     sqlite3VdbeAddOp(v, OP_Dup, depth, 0);

Changes to test/main.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is exercising the code in main.c.
    13     13   #
    14         -# $Id: main.test,v 1.20 2005/02/26 17:31:28 drh Exp $
           14  +# $Id: main.test,v 1.21 2005/08/12 22:58:53 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Only do the next group of tests if the sqlite3_complete API is available
    20     20   #
    21     21   ifcapable {complete} {
................................................................................
   301    301     set v [catch {execsql {create bogus}} msg]
   302    302     lappend v $msg
   303    303   } {1 {near "bogus": syntax error}}
   304    304   do_test main-3.5 {
   305    305     set v [catch {execsql {create}} msg]
   306    306     lappend v $msg
   307    307   } {1 {near "create": syntax error}}
          308  +do_test main-3.6 {
          309  +  catchsql {SELECT 'abc' + #9}
          310  +} {1 {near "#9": syntax error}}
          311  +
   308    312   
   309    313   finish_test

Changes to test/trigger1.test.

   584    584     } {}
   585    585     do_test trigger1-10.11 {
   586    586       execsql {
   587    587         SELECT * FROM insert_log;
   588    588       }
   589    589     } {main 21 22 23 temp 24 25 26 aux 27 28 29}
   590    590   }
          591  +
          592  +do_test trigger1-11.1 {
          593  +  catchsql {SELECT raise(abort,'message');}
          594  +} {1 {RAISE() may only be used within a trigger-program}}
          595  +
   591    596   
   592    597   finish_test