/ Check-in [ab6322bf]
Login

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

Overview
Comment:Parser changes to allow parenthesized numerical arguments to pragmas, in support of the integrity_check enhancement of check-in (3609) and ticket #2176. (CVS 3610)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ab6322bf9398c2989b648b24c1ebdf09493accdf
User & Date: drh 2007-01-27 02:38:30
Context
2007-01-27
13:37
Fix a documentation comment in vdbe.c. Ticket #2188. (CVS 3611) check-in: 3eec703b user: drh tags: trunk
02:38
Parser changes to allow parenthesized numerical arguments to pragmas, in support of the integrity_check enhancement of check-in (3609) and ticket #2176. (CVS 3610) check-in: ab6322bf user: drh tags: trunk
02:24
Limit the number of errors returned by PRAGMA integrity_check to 100 by default. Specify an alternative limit using an argument to the pragma. Ticket #2176. (CVS 3609) check-in: d564a039 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.212 2006/12/20 02:15:00 drh Exp $
           17  +** @(#) $Id: parse.y,v 1.213 2007/01/27 02:38:30 drh Exp $
    18     18   */
    19     19   
    20     20   // All token codes are small integers with #defines that begin with "TK_"
    21     21   %token_prefix TK_
    22     22   
    23     23   // The type of the data attached to each token is Token.  This is also the
    24     24   // default type for non-terminals.
................................................................................
   888    888   cmd ::= VACUUM.                {sqlite3Vacuum(pParse);}
   889    889   cmd ::= VACUUM nm.             {sqlite3Vacuum(pParse);}
   890    890   %endif  SQLITE_OMIT_VACUUM
   891    891   
   892    892   ///////////////////////////// The PRAGMA command /////////////////////////////
   893    893   //
   894    894   %ifndef SQLITE_OMIT_PRAGMA
   895         -cmd ::= PRAGMA nm(X) dbnm(Z) EQ nm(Y).  {sqlite3Pragma(pParse,&X,&Z,&Y,0);}
          895  +cmd ::= PRAGMA nm(X) dbnm(Z) EQ nmnum(Y).  {sqlite3Pragma(pParse,&X,&Z,&Y,0);}
   896    896   cmd ::= PRAGMA nm(X) dbnm(Z) EQ ON(Y).  {sqlite3Pragma(pParse,&X,&Z,&Y,0);}
   897         -cmd ::= PRAGMA nm(X) dbnm(Z) EQ plus_num(Y). {sqlite3Pragma(pParse,&X,&Z,&Y,0);}
   898    897   cmd ::= PRAGMA nm(X) dbnm(Z) EQ minus_num(Y). {
   899    898     sqlite3Pragma(pParse,&X,&Z,&Y,1);
   900    899   }
   901         -cmd ::= PRAGMA nm(X) dbnm(Z) LP nm(Y) RP. {sqlite3Pragma(pParse,&X,&Z,&Y,0);}
          900  +cmd ::= PRAGMA nm(X) dbnm(Z) LP nmnum(Y) RP. {sqlite3Pragma(pParse,&X,&Z,&Y,0);}
   902    901   cmd ::= PRAGMA nm(X) dbnm(Z).             {sqlite3Pragma(pParse,&X,&Z,0,0);}
          902  +nmnum(A) ::= plus_num(X).             {A = X;}
          903  +nmnum(A) ::= nm(X).                   {A = X;}
   903    904   %endif SQLITE_OMIT_PRAGMA
   904    905   plus_num(A) ::= plus_opt number(X).   {A = X;}
   905    906   minus_num(A) ::= MINUS number(X).     {A = X;}
   906    907   number(A) ::= INTEGER|FLOAT(X).       {A = X;}
   907    908   plus_opt ::= PLUS.
   908    909   plus_opt ::= .
   909    910