/ Check-in [95b27ebd]
Login

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

Overview
Comment:All LIKE and GLOB operators to use function notation. "A LIKE B" can be expressed as "LIKE(B,A)". (CVS 1108)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 95b27ebd1322a877112dee514dffddb0937e45fa
User & Date: drh 2003-09-30 01:54:14
Context
2003-10-03
00:13
Allow quoted trigger names. Ticket #468. (CVS 1109) check-in: 54aa0fb2 user: drh tags: trunk
2003-09-30
01:54
All LIKE and GLOB operators to use function notation. "A LIKE B" can be expressed as "LIKE(B,A)". (CVS 1108) check-in: 95b27ebd user: drh tags: trunk
2003-09-29
12:20
Patch the spec.template file (for generating RPMs) as suggested by Jeremy Hinegardner. Untested. (CVS 1107) check-in: 703741ca user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/parse.y.

    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains SQLite's grammar for SQL.  Process this file
    13     13   ** using the lemon parser generator to generate C code that runs
    14     14   ** the parser.  Lemon will also generate a header file containing
    15     15   ** numeric codes for all of the tokens.
    16     16   **
    17         -** @(#) $Id: parse.y,v 1.102 2003/09/27 13:39:39 drh Exp $
           17  +** @(#) $Id: parse.y,v 1.103 2003/09/30 01:54:14 drh Exp $
    18     18   */
    19     19   %token_prefix TK_
    20     20   %token_type {Token}
    21     21   %default_type {Token}
    22     22   %extra_argument {Parse *pParse}
    23     23   %syntax_error {
    24     24     if( pParse->zErrMsg==0 ){
................................................................................
   121    121   %type id {Token}
   122    122   id(A) ::= ID(X).         {A = X;}
   123    123   
   124    124   // The following directive causes tokens ABORT, AFTER, ASC, etc. to
   125    125   // fallback to ID if they will not parse as their original value.
   126    126   // This obviates the need for the "id" nonterminal.
   127    127   //
   128         -%fallback ID 
          128  +%fallback ID
   129    129     ABORT AFTER ASC ATTACH BEFORE BEGIN CASCADE CLUSTER CONFLICT
   130    130     COPY DATABASE DEFERRED DELIMITERS DESC DETACH EACH END EXPLAIN FAIL FOR
   131         -  IGNORE IMMEDIATE INITIALLY INSTEAD MATCH KEY
          131  +  GLOB IGNORE IMMEDIATE INITIALLY INSTEAD LIKE MATCH KEY
   132    132     OF OFFSET PRAGMA RAISE REPLACE RESTRICT ROW STATEMENT
   133    133     TEMP TRIGGER VACUUM VIEW.
   134    134   
   135    135   // And "ids" is an identifer-or-string.
   136    136   //
   137    137   %type ids {Token}
   138    138   ids(A) ::= ID(X).        {A = X;}

Changes to test/expr.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 testing expressions.
    13     13   #
    14         -# $Id: expr.test,v 1.29 2003/04/16 02:17:36 drh Exp $
           14  +# $Id: expr.test,v 1.30 2003/09/30 01:54:15 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Create a table to work with.
    20     20   #
    21     21   execsql {CREATE TABLE test1(i1 int, i2 int, r1 real, r2 real, t1 text, t2 text)}
................................................................................
   502    502   test_expr2 expr-7.54 {((a>0 OR 0) AND a<3) OR 0} {1 2}
   503    503   test_expr2 expr-7.55 {((a in (1,2) OR 0) IS NULL AND 1) OR 0} {{}}
   504    504   test_expr2 expr-7.56 {((a not in (3,4,5,6,7,8,9,10) IS NULL OR 0) AND 1) OR 0} \
   505    505      {{}}
   506    506   test_expr2 expr-7.57 {((a>0 IS NULL OR 0) AND 1) OR 0} {{}}
   507    507   
   508    508   test_expr2 expr-7.58  {(a||'')<='1'}                  {1}
          509  +
          510  +test_expr2 expr-7.59 {LIKE('10%',b)}                  {10 20}
          511  +test_expr2 expr-7.60 {LIKE('_4',b)}                   {6}
          512  +test_expr2 expr-7.61 {GLOB('1?',a)}            {10 11 12 13 14 15 16 17 18 19}
          513  +test_expr2 expr-7.62 {GLOB('1*4',b)}                  {10 14}
          514  +test_expr2 expr-7.63 {GLOB('*1[456]',b)}              {4}
          515  +
   509    516   
   510    517   finish_test