/ Check-in [983cb692]
Login

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

Overview
Comment:Remove two unused fields from the Parse structure. The TCL interface now removes leading whitespace from SQL statements before parsing them. (CVS 6846)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 983cb6924b8a7d3057718b9228c0cb2fbe7f0dc4
User & Date: drh 2009-07-03 22:54:37
Context
2009-07-04
15:41
Remove a redundant branch from btree.c. (CVS 6847) check-in: 133357d2 user: danielk1977 tags: trunk
2009-07-03
22:54
Remove two unused fields from the Parse structure. The TCL interface now removes leading whitespace from SQL statements before parsing them. (CVS 6846) check-in: 983cb692 user: drh tags: trunk
19:19
Remove unused code (that was commented out) from prepare.c. Remove an incorrect NEVER() macro. Fix the comment on schemaIsValid() to correctly describe its return behavior. (CVS 6845) check-in: 90deb658 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqliteInt.h.

     7      7   **    May you do good and not evil.
     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   ** Internal interface definitions for SQLite.
    13     13   **
    14         -** @(#) $Id: sqliteInt.h,v 1.891 2009/07/03 15:37:28 drh Exp $
           14  +** @(#) $Id: sqliteInt.h,v 1.892 2009/07/03 22:54:37 drh Exp $
    15     15   */
    16     16   #ifndef _SQLITEINT_H_
    17     17   #define _SQLITEINT_H_
    18     18   
    19     19   /*
    20     20   ** Include the configuration header output by 'configure' if we're using the
    21     21   ** autoconf-based build
................................................................................
  2016   2016     int nVarExpr;        /* Number of used slots in apVarExpr[] */
  2017   2017     int nVarExprAlloc;   /* Number of allocated slots in apVarExpr[] */
  2018   2018     Expr **apVarExpr;    /* Pointers to :aaa and $aaaa wildcard expressions */
  2019   2019     int nAlias;          /* Number of aliased result set columns */
  2020   2020     int nAliasAlloc;     /* Number of allocated slots for aAlias[] */
  2021   2021     int *aAlias;         /* Register used to hold aliased result */
  2022   2022     u8 explain;          /* True if the EXPLAIN flag is found on the query */
  2023         -  Token sErrToken;     /* The token at which the error occurred */
  2024   2023     Token sNameToken;    /* Token with unqualified schema object name */
  2025   2024     Token sLastToken;    /* The last token parsed */
  2026         -  const char *zSql;    /* All SQL text */
  2027   2025     const char *zTail;   /* All SQL text past the last semicolon parsed */
  2028   2026     Table *pNewTable;    /* A table being constructed by CREATE TABLE */
  2029   2027     Trigger *pNewTrigger;     /* Trigger under construct by a CREATE TRIGGER */
  2030   2028     TriggerStack *trigStack;  /* Trigger actions being coded */
  2031   2029     const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
  2032   2030   #ifndef SQLITE_OMIT_VIRTUALTABLE
  2033   2031     Token sArg;                /* Complete text of a module argument */

Changes to src/tclsqlite.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   ** A TCL Interface to SQLite.  Append this file to sqlite3.c and
    13     13   ** compile the whole thing to build a TCL-enabled version of SQLite.
    14     14   **
    15         -** $Id: tclsqlite.c,v 1.241 2009/03/27 12:44:35 drh Exp $
           15  +** $Id: tclsqlite.c,v 1.242 2009/07/03 22:54:37 drh Exp $
    16     16   */
    17     17   #include "tcl.h"
    18     18   #include <errno.h>
    19     19   
    20     20   /*
    21     21   ** Some additional include files are needed if this file is not
    22     22   ** appended to the amalgamation.
................................................................................
  1670   1670         Tcl_Obj **apColName = 0;   /* Array of column names */
  1671   1671         int len;                   /* String length of zSql */
  1672   1672     
  1673   1673         /* Try to find a SQL statement that has already been compiled and
  1674   1674         ** which matches the next sequence of SQL.
  1675   1675         */
  1676   1676         pStmt = 0;
         1677  +      while( isspace(zSql[0]) ){ zSql++; }
  1677   1678         len = strlen30(zSql);
  1678   1679         for(pPreStmt = pDb->stmtList; pPreStmt; pPreStmt=pPreStmt->pNext){
  1679   1680           int n = pPreStmt->nSql;
  1680   1681           if( len>=n 
  1681   1682               && memcmp(pPreStmt->zSql, zSql, n)==0
  1682   1683               && (zSql[n]==0 || zSql[n-1]==';')
  1683   1684           ){

Changes to src/tokenize.c.

    11     11   *************************************************************************
    12     12   ** An tokenizer for SQL
    13     13   **
    14     14   ** This file contains C code that splits an SQL input string up into
    15     15   ** individual tokens and sends those tokens one-by-one over to the
    16     16   ** parser for analysis.
    17     17   **
    18         -** $Id: tokenize.c,v 1.162 2009/06/23 20:28:54 drh Exp $
           18  +** $Id: tokenize.c,v 1.163 2009/07/03 22:54:37 drh Exp $
    19     19   */
    20     20   #include "sqliteInt.h"
    21     21   #include <stdlib.h>
    22     22   
    23     23   /*
    24     24   ** The charMap() macro maps alphabetic characters into their
    25     25   ** lower-case ASCII equivalent.  On ASCII machines, this is just
................................................................................
   406    406   
   407    407   
   408    408     mxSqlLen = db->aLimit[SQLITE_LIMIT_SQL_LENGTH];
   409    409     if( db->activeVdbeCnt==0 ){
   410    410       db->u1.isInterrupted = 0;
   411    411     }
   412    412     pParse->rc = SQLITE_OK;
   413         -  pParse->zTail = pParse->zSql = zSql;
          413  +  pParse->zTail = zSql;
   414    414     i = 0;
   415    415     assert( pzErrMsg!=0 );
   416    416     pEngine = sqlite3ParserAlloc((void*(*)(size_t))sqlite3Malloc);
   417    417     if( pEngine==0 ){
   418    418       db->mallocFailed = 1;
   419    419       return SQLITE_NOMEM;
   420    420     }