/ Check-in [2c76ce4f]
Login

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

Overview
Comment:Merge the pre-3.26.0 fixes from trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA3-256: 2c76ce4f42c486c7c2ead64a602ae02eaefcb1438ed1d401221a2e0ff6c9cf23
User & Date: drh 2018-11-30 18:22:49
Context
2018-12-05
18:28
Merge enhancements and the ALTER TABLE bug fix from trunk. check-in: edfc2acf user: drh tags: apple-osx
2018-11-30
18:22
Merge the pre-3.26.0 fixes from trunk. check-in: 2c76ce4f user: drh tags: apple-osx
2018-11-29
12:00
Fix the name of the trig function approximation in geopoly. No functional changes to the code. check-in: 33576b12 user: drh tags: trunk
2018-11-26
23:35
Merge recent enhancements from trunk. check-in: e8c20a88 user: drh tags: apple-osx
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

    28     28   # are provide so that these aspects of the build process can be changed
    29     29   # on the "make" command-line.  Ex:  "make CC=clang CFLAGS=-fsanitize=undefined"
    30     30   #
    31     31   CC = @CC@
    32     32   CFLAGS = @CPPFLAGS@ @CFLAGS@
    33     33   TCC = ${CC} ${CFLAGS} -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/icu
    34     34   TCC += -I${TOP}/ext/fts3 -I${TOP}/ext/async -I${TOP}/ext/session
           35  +TCC += -I${TOP}/ext/userauth
    35     36   
    36     37   # Define this for the autoconf-based build, so that the code knows it can
    37     38   # include the generated config.h
    38     39   #
    39     40   TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
    40     41   
    41     42   # Define -DNDEBUG to compile without debugging (i.e., for production usage)
................................................................................
   183    184            memdb.lo memjournal.lo \
   184    185            mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
   185    186            notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
   186    187            pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
   187    188            random.lo resolve.lo rowset.lo rtree.lo \
   188    189            sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
   189    190            table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
   190         -         update.lo upsert.lo util.lo vacuum.lo \
          191  +         update.lo userauth.lo upsert.lo util.lo vacuum.lo \
   191    192            vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
   192    193            vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
   193    194            window.lo utf.lo vtab.lo
   194    195   
   195    196   # Object files for the amalgamation.
   196    197   #
   197    198   LIBOBJS1 = sqlite3.lo
................................................................................
   355    356   SRC += \
   356    357     $(TOP)/ext/sqlrr/sqlrr.h \
   357    358     $(TOP)/ext/sqlrr/sqlrr.c
   358    359   SRC += \
   359    360     $(TOP)/ext/session/sqlite3session.c \
   360    361     $(TOP)/ext/session/sqlite3session.h
   361    362   SRC += \
          363  +  $(TOP)/ext/userauth/userauth.c \
          364  +  $(TOP)/ext/userauth/sqlite3userauth.h
          365  +SRC += \
   362    366     $(TOP)/ext/rbu/sqlite3rbu.h \
   363    367     $(TOP)/ext/rbu/sqlite3rbu.c
   364    368   SRC += \
   365    369     $(TOP)/ext/misc/json1.c \
   366    370     $(TOP)/ext/misc/stmt.c
   367    371   
   368    372   # Generated source code files
................................................................................
   454    458     $(TOP)/ext/misc/regexp.c \
   455    459     $(TOP)/ext/misc/remember.c \
   456    460     $(TOP)/ext/misc/series.c \
   457    461     $(TOP)/ext/misc/spellfix.c \
   458    462     $(TOP)/ext/misc/totype.c \
   459    463     $(TOP)/ext/misc/unionvtab.c \
   460    464     $(TOP)/ext/misc/wholenumber.c \
   461         -  $(TOP)/ext/misc/zipfile.c
          465  +  $(TOP)/ext/misc/zipfile.c \
          466  +  $(TOP)/ext/userauth/userauth.c
   462    467   
   463    468   # Source code to the library files needed by the test fixture
   464    469   #
   465    470   TESTSRC2 = \
   466    471     $(TOP)/src/attach.c \
   467    472     $(TOP)/src/backup.c \
   468    473     $(TOP)/src/bitvec.c \
................................................................................
   560    565   EXTHDR += \
   561    566     $(TOP)/ext/rtree/rtree.h \
   562    567     $(TOP)/ext/rtree/geopoly.c
   563    568   EXTHDR += \
   564    569     $(TOP)/ext/icu/sqliteicu.h
   565    570   EXTHDR += \
   566    571     $(TOP)/ext/rtree/sqlite3rtree.h
          572  +EXTHDR += \
          573  +  $(TOP)/ext/userauth/sqlite3userauth.h
   567    574   EXTHDR += \
   568    575     $(TOP)/ext/sqlrr/sqlrr.h
   569    576   
   570    577   # If using the amalgamation, use sqlite3.c directly to build the test
   571    578   # fixture.  Otherwise link against libsqlite3.la.  (This distinction is
   572    579   # necessary because the test fixture requires non-API symbols which are
   573    580   # hidden when the library is built via the amalgamation).
................................................................................
  1127   1134   
  1128   1135   fts3_write.lo:	$(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
  1129   1136   	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_write.c
  1130   1137   
  1131   1138   rtree.lo:	$(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
  1132   1139   	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
  1133   1140   
  1134         -sqlite3session.lo:	$(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
         1141  +sqlite3session.lo:	$(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
         1142  +	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
         1143  +
         1144  +userauth.lo:	$(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
  1135   1145   	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
  1136   1146   
  1137   1147   json1.lo:	$(TOP)/ext/misc/json1.c
  1138   1148   	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
  1139   1149   
  1140   1150   stmt.lo:	$(TOP)/ext/misc/stmt.c
  1141   1151   	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c

Changes to Makefile.msc.

   341    341   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
   342    342   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1
   343    343   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_JSON1=1
   344    344   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
   345    345   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
   346    346   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1
   347    347   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1
          348  +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1
   348    349   !ENDIF
   349    350   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
   350    351   !ENDIF
   351    352   
   352    353   # Should the session extension be enabled?  If so, add compilation options
   353    354   # to enable it.
   354    355   #

Changes to doc/lemon.html.

   772    772   
   773    773   <p><pre>
   774    774      %include {#include &lt;unistd.h&gt;}
   775    775   </pre></p>
   776    776   
   777    777   <p>This might be needed, for example, if some of the C actions in the
   778    778   grammar call functions that are prototyped in unistd.h.</p>
          779  +
          780  +<p>Use the <tt><a href="#pcode">%code</a></tt> directive to add code to
          781  +the end of the generated parser.</p>
   779    782   
   780    783   <a name='pleft'></a>
   781    784   <h4>The <tt>%left</tt> directive</h4>
   782    785   
   783    786   The <tt>%left</tt> directive is used (along with the
   784    787   <tt><a href='#pright'>%right</a></tt> and
   785    788   <tt><a href='#pnonassoc'>%nonassoc</a></tt> directives) to declare

Changes to ext/fts3/fts3.c.

  4162   4162       }
  4163   4163       assert( pToken->pSegcsr==0 );
  4164   4164     }
  4165   4165   
  4166   4166     return rc;
  4167   4167   }
  4168   4168   
         4169  +#ifndef SQLITE_DISABLE_FTS4_DEFERRED
  4169   4170   /*
  4170   4171   ** This function is called on each phrase after the position lists for
  4171   4172   ** any deferred tokens have been loaded into memory. It updates the phrases
  4172   4173   ** current position list to include only those positions that are really
  4173   4174   ** instances of the phrase (after considering deferred tokens). If this
  4174   4175   ** means that the phrase does not appear in the current row, doclist.pList
  4175   4176   ** and doclist.nList are both zeroed.
................................................................................
  4265   4266         }
  4266   4267         sqlite3_free(aPoslist);
  4267   4268       }
  4268   4269     }
  4269   4270   
  4270   4271     return SQLITE_OK;
  4271   4272   }
         4273  +#endif /* SQLITE_DISABLE_FTS4_DEFERRED */
  4272   4274   
  4273   4275   /*
  4274   4276   ** Maximum number of tokens a phrase may have to be considered for the
  4275   4277   ** incremental doclists strategy.
  4276   4278   */
  4277   4279   #define MAX_INCR_PHRASE_TOKENS 4
  4278   4280   

Changes to ext/rtree/geopoly.c.

   540    540          4+8*p->nVertex, SQLITE_TRANSIENT);
   541    541       sqlite3_free(p);
   542    542     }            
   543    543   }
   544    544   
   545    545   #define GEOPOLY_PI 3.1415926535897932385
   546    546   
   547         -/* Fast approximation for cosine(X) for X between -0.5*pi and 2*pi
          547  +/* Fast approximation for sine(X) for X between -0.5*pi and 2*pi
   548    548   */
   549         -static double geopolyCosine(double r){
          549  +static double geopolySine(double r){
   550    550     assert( r>=-0.5*GEOPOLY_PI && r<=2.0*GEOPOLY_PI );
   551    551     if( r>=1.5*GEOPOLY_PI ){
   552    552       r -= 2.0*GEOPOLY_PI;
   553    553     }
   554    554     if( r>=0.5*GEOPOLY_PI ){
   555         -    return -geopolyCosine(r-GEOPOLY_PI);
          555  +    return -geopolySine(r-GEOPOLY_PI);
   556    556     }else{
   557    557       double r2 = r*r;
   558    558       double r3 = r2*r;
   559    559       double r5 = r3*r2;
   560    560       return 0.9996949*r - 0.1656700*r3 + 0.0075134*r5;
   561    561     }
   562    562   }
................................................................................
   589    589     i = 1;
   590    590     p->hdr[0] = *(unsigned char*)&i;
   591    591     p->hdr[1] = 0;
   592    592     p->hdr[2] = (n>>8)&0xff;
   593    593     p->hdr[3] = n&0xff;
   594    594     for(i=0; i<n; i++){
   595    595       double rAngle = 2.0*GEOPOLY_PI*i/n;
   596         -    p->a[i*2] = x - r*geopolyCosine(rAngle-0.5*GEOPOLY_PI);
   597         -    p->a[i*2+1] = y + r*geopolyCosine(rAngle);
          596  +    p->a[i*2] = x - r*geopolySine(rAngle-0.5*GEOPOLY_PI);
          597  +    p->a[i*2+1] = y + r*geopolySine(rAngle);
   598    598     }
   599    599     sqlite3_result_blob(context, p->hdr, 4+8*n, SQLITE_TRANSIENT);
   600    600     sqlite3_free(p);
   601    601   }
   602    602   
   603    603   /*
   604    604   ** If pPoly is a polygon, compute its bounding box. Then:

Changes to src/build.c.

   540    540   /*
   541    541   ** Erase all schema information from all attached databases (including
   542    542   ** "main" and "temp") for a single database connection.
   543    543   */
   544    544   void sqlite3ResetAllSchemasOfConnection(sqlite3 *db){
   545    545     int i;
   546    546     sqlite3BtreeEnterAll(db);
   547         -  assert( db->nSchemaLock==0 );
   548    547     for(i=0; i<db->nDb; i++){
   549    548       Db *pDb = &db->aDb[i];
   550    549       if( pDb->pSchema ){
   551         -      sqlite3SchemaClear(pDb->pSchema);
          550  +      if( db->nSchemaLock==0 ){
          551  +        sqlite3SchemaClear(pDb->pSchema);
          552  +      }else{
          553  +        DbSetProperty(db, i, DB_ResetWanted);
          554  +      }
   552    555       }
   553    556     }
   554    557     db->mDbFlags &= ~(DBFLAG_SchemaChange|DBFLAG_SchemaKnownOk);
   555    558     sqlite3VtabUnlockList(db);
   556    559     sqlite3BtreeLeaveAll(db);
   557         -  sqlite3CollapseDatabaseArray(db);
          560  +  if( db->nSchemaLock==0 ){
          561  +    sqlite3CollapseDatabaseArray(db);
          562  +  }
   558    563   }
   559    564   
   560    565   /*
   561    566   ** This routine is called when a commit occurs.
   562    567   */
   563    568   void sqlite3CommitInternalChanges(sqlite3 *db){
   564    569     db->mDbFlags &= ~DBFLAG_SchemaChange;
................................................................................
  1890   1895       assert( pTab->nCol==j );
  1891   1896     }else{
  1892   1897       pPk->nColumn = pTab->nCol;
  1893   1898     }
  1894   1899     recomputeColumnsNotIndexed(pPk);
  1895   1900   }
  1896   1901   
         1902  +#ifndef SQLITE_OMIT_VIRTUALTABLE
  1897   1903   /*
  1898   1904   ** Return true if zName is a shadow table name in the current database
  1899   1905   ** connection.
  1900   1906   **
  1901   1907   ** zName is temporarily modified while this routine is running, but is
  1902   1908   ** restored to its original value prior to this routine returning.
  1903   1909   */
................................................................................
  1915   1921     if( !IsVirtual(pTab) ) return 0;
  1916   1922     pMod = (Module*)sqlite3HashFind(&db->aModule, pTab->azModuleArg[0]);
  1917   1923     if( pMod==0 ) return 0;
  1918   1924     if( pMod->pModule->iVersion<3 ) return 0;
  1919   1925     if( pMod->pModule->xShadowName==0 ) return 0;
  1920   1926     return pMod->pModule->xShadowName(zTail+1);
  1921   1927   }
         1928  +#else
         1929  +# define isShadowTableName(x,y) 0
         1930  +#endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
  1922   1931   
  1923   1932   /*
  1924   1933   ** This routine is called to report the final ")" that terminates
  1925   1934   ** a CREATE TABLE statement.
  1926   1935   **
  1927   1936   ** The table structure that other action routines have been building
  1928   1937   ** is added to the internal hash tables, assuming no errors have

Changes to src/delete.c.

    66     66     }
    67     67     if( (pTab->tabFlags & (TF_Readonly|TF_Shadow))==0 ) return 0;
    68     68     db = pParse->db;
    69     69     if( (pTab->tabFlags & TF_Readonly)!=0 ){
    70     70       return sqlite3WritableSchema(db)==0 && pParse->nested==0;
    71     71     }
    72     72     assert( pTab->tabFlags & TF_Shadow );
    73         -  return (db->flags & SQLITE_Defensive)!=0
    74         -           && db->nVdbeExec==0
    75         -           && db->pVtabCtx==0;
           73  +  return (db->flags & SQLITE_Defensive)!=0 
           74  +#ifndef SQLITE_OMIT_VIRTUALTABLE
           75  +          && db->pVtabCtx==0
           76  +#endif
           77  +          && db->nVdbeExec==0;
    76     78   }
    77     79   
    78     80   /*
    79     81   ** Check to make sure the given table is writable.  If it is not
    80     82   ** writable, generate an error message and return 1.  If it is
    81     83   ** writable return 0;
    82     84   */

Changes to src/loadext.c.

    80     80   
    81     81   #ifdef SQLITE_OMIT_VIRTUALTABLE
    82     82   # define sqlite3_create_module 0
    83     83   # define sqlite3_create_module_v2 0
    84     84   # define sqlite3_declare_vtab 0
    85     85   # define sqlite3_vtab_config 0
    86     86   # define sqlite3_vtab_on_conflict 0
           87  +# define sqlite3_vtab_collation 0
    87     88   #endif
    88     89   
    89     90   #ifdef SQLITE_OMIT_SHARED_CACHE
    90     91   # define sqlite3_enable_shared_cache 0
    91     92   #endif
    92     93   
    93     94   #if defined(SQLITE_OMIT_TRACE) || defined(SQLITE_OMIT_DEPRECATED)

Changes to src/pager.c.

   845    845       return (rc==SQLITE_OK && iRead==0);
   846    846     }
   847    847   #endif
   848    848     return 1;
   849    849   }
   850    850   #endif
   851    851   
   852         -/*
   853         -** Return true if this pager uses a write-ahead log to read page pgno.
   854         -** Return false if the pager reads pgno directly from the database.
   855         -*/
   856         -#if !defined(SQLITE_OMIT_WAL) && defined(SQLITE_DIRECT_OVERFLOW_READ)
   857         -int sqlite3PagerUseWal(Pager *pPager, Pgno pgno){
   858         -  u32 iRead = 0;
   859         -  int rc;
   860         -  if( pPager->pWal==0 ) return 0;
   861         -  rc = sqlite3WalFindFrame(pPager->pWal, pgno, &iRead);
   862         -  return rc || iRead;
   863         -}
   864         -#endif
   865    852   #ifndef SQLITE_OMIT_WAL
   866    853   # define pagerUseWal(x) ((x)->pWal!=0)
   867    854   #else
   868    855   # define pagerUseWal(x) 0
   869    856   # define pagerRollbackWal(x) 0
   870    857   # define pagerWalFrames(v,w,x,y) 0
   871    858   # define pagerOpenWalIfPresent(z) SQLITE_OK
................................................................................
  7076   7063   void sqlite3PagerSetCodec(
  7077   7064     Pager *pPager,
  7078   7065     void *(*xCodec)(void*,void*,Pgno,int),
  7079   7066     void (*xCodecSizeChng)(void*,int,int),
  7080   7067     void (*xCodecFree)(void*),
  7081   7068     void *pCodec
  7082   7069   ){
  7083         -  pager_reset(pPager);
  7084         -  if( pPager->xCodecFree ) pPager->xCodecFree(pPager->pCodec);
         7070  +  if( pPager->xCodecFree ){
         7071  +    pPager->xCodecFree(pPager->pCodec);
         7072  +  }else{
         7073  +    pager_reset(pPager);
         7074  +  }
  7085   7075     pPager->xCodec = pPager->memDb ? 0 : xCodec;
  7086   7076     pPager->xCodecSizeChng = xCodecSizeChng;
  7087   7077     pPager->xCodecFree = xCodecFree;
  7088   7078     pPager->pCodec = pCodec;
  7089   7079     setGetterMethod(pPager);
  7090   7080     pagerReportSize(pPager);
  7091   7081   }

Changes to src/pager.h.

   175    175   
   176    176   #ifndef SQLITE_OMIT_WAL
   177    177     int sqlite3PagerCheckpoint(Pager *pPager, sqlite3*, int, int*, int*);
   178    178     int sqlite3PagerWalSupported(Pager *pPager);
   179    179     int sqlite3PagerWalCallback(Pager *pPager);
   180    180     int sqlite3PagerOpenWal(Pager *pPager, int *pisOpen);
   181    181     int sqlite3PagerCloseWal(Pager *pPager, sqlite3*);
   182         -# ifdef SQLITE_DIRECT_OVERFLOW_READ
   183         -  int sqlite3PagerUseWal(Pager *pPager, Pgno);
   184         -# endif
   185    182   # ifdef SQLITE_ENABLE_SNAPSHOT
   186    183     int sqlite3PagerSnapshotGet(Pager *pPager, sqlite3_snapshot **ppSnapshot);
   187    184     int sqlite3PagerSnapshotOpen(Pager *pPager, sqlite3_snapshot *pSnapshot);
   188    185     int sqlite3PagerSnapshotRecover(Pager *pPager);
   189    186     int sqlite3PagerSnapshotCheck(Pager *pPager, sqlite3_snapshot *pSnapshot);
   190    187     void sqlite3PagerSnapshotUnlock(Pager *pPager);
   191    188   # endif
   192         -#else
   193         -# define sqlite3PagerUseWal(x,y) 0
   194    189   #endif
   195    190   
   196    191   #ifdef SQLITE_DIRECT_OVERFLOW_READ
   197    192     int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno);
   198    193   #endif
   199    194   
   200    195   #ifdef SQLITE_ENABLE_ZIPVFS

Changes to src/pcache1.c.

   101    101     PgHdr1 *pNext;                 /* Next in hash table chain */
   102    102     PCache1 *pCache;               /* Cache that currently owns this page */
   103    103     PgHdr1 *pLruNext;              /* Next in LRU list of unpinned pages */
   104    104     PgHdr1 *pLruPrev;              /* Previous in LRU list of unpinned pages */
   105    105   };
   106    106   
   107    107   /*
   108         -** A page is pinned if it is no on the LRU list
          108  +** A page is pinned if it is not on the LRU list.  To be "pinned" means
          109  +** that the page is in active use and must not be deallocated.
   109    110   */
   110    111   #define PAGE_IS_PINNED(p)    ((p)->pLruNext==0)
   111    112   #define PAGE_IS_UNPINNED(p)  ((p)->pLruNext!=0)
   112    113   
   113    114   /* Each page cache (or PCache) belongs to a PGroup.  A PGroup is a set 
   114    115   ** of one or more PCaches that are able to recycle each other's unpinned
   115    116   ** pages when they are under memory pressure.  A PGroup is an instance of

Changes to src/sqlite.h.in.

  3630   3630   ** deplete the limited store of lookaside memory. Future versions of
  3631   3631   ** SQLite may act on this hint differently.
  3632   3632   **
  3633   3633   ** [[SQLITE_PREPARE_NORMALIZE]] ^(<dt>SQLITE_PREPARE_NORMALIZE</dt>
  3634   3634   ** <dd>The SQLITE_PREPARE_NORMALIZE flag indicates that a normalized
  3635   3635   ** representation of the SQL statement should be calculated and then
  3636   3636   ** associated with the prepared statement, which can be obtained via
  3637         -** the [sqlite3_normalized_sql()] interface.  The semantics used to
         3637  +** the [sqlite3_normalized_sql()] interface.)^  The semantics used to
  3638   3638   ** normalize a SQL statement are unspecified and subject to change.
  3639   3639   ** At a minimum, literal values will be replaced with suitable
  3640   3640   ** placeholders.
  3641   3641   ** </dl>
  3642   3642   */
  3643   3643   #define SQLITE_PREPARE_PERSISTENT              0x01
  3644   3644   #define SQLITE_PREPARE_NORMALIZE               0x02

Changes to test/attach.test.

   722    722       catchsql {
   723    723         CREATE TRIGGER r5 AFTER INSERT ON t5 BEGIN
   724    724           DELETE FROM t1 WHERE x<(SELECT min(x) FROM temp.t6);
   725    725         END;
   726    726       } db2
   727    727     } {1 {trigger r5 cannot reference objects in database temp}}
   728    728   } ;# endif subquery
   729         -ifcapable json1 {
          729  +ifcapable json1&&vtab {
   730    730     do_test attach-5.10 {
   731    731       db close
   732    732       catch {db2 close}
   733    733       forcedelete test.db
   734    734       sqlite3 db test.db
   735    735       db eval {
   736    736         CREATE TABLE t1(x);

Changes to test/incrvacuum.test.

   784    784   } {ok}
   785    785   
   786    786   #-------------------------------------------------------------------------
   787    787   # At one point it was unsafe to truncate a db file on windows while there
   788    788   # were outstanding xFetch() references. This test case attempts to hit
   789    789   # that case.
   790    790   #
   791         -reset_db
   792         -do_execsql_test incrvacuum-16.0 {
   793         -  PRAGMA auto_vacuum = 2;
   794         -  CREATE TABLE t3(a);
   795         -  INSERT INTO t3 VALUES(1), (2), (3), (4);
   796         -
   797         -  CREATE TABLE t2(x);
   798         -  INSERT INTO t2 VALUES( randomblob(1000) );
   799         -  INSERT INTO t2 VALUES( randomblob(1000) );
   800         -  INSERT INTO t2 VALUES( randomblob(1000) );
   801         -  INSERT INTO t2 VALUES( randomblob(1000) );
   802         -  INSERT INTO t2 VALUES( randomblob(1000) );
   803         -  INSERT INTO t2 VALUES( randomblob(1000) );
   804         -} {}
   805         -
   806         -# Reopen db to ensure the page-cache is empty.
   807         -#
   808         -db close
   809         -sqlite3 db test.db
   810         -
   811         -# Open db in mmap-mode. Open a transaction, delete some data, then run
   812         -# incremental-vacuum. Do not commit the transaction. 
   813         -#
   814         -do_execsql_test incrvacuum-16.1 {
   815         -  PRAGMA mmap_size = 1000000;
   816         -  BEGIN;
   817         -  DELETE FROM t2;
   818         -  PRAGMA incremental_vacuum = 1000;
   819         -} {1000000}
          791  +ifcapable mmap {
          792  +  reset_db
          793  +  do_execsql_test incrvacuum-16.0 {
          794  +    PRAGMA auto_vacuum = 2;
          795  +    CREATE TABLE t3(a);
          796  +    INSERT INTO t3 VALUES(1), (2), (3), (4);
          797  +  
          798  +    CREATE TABLE t2(x);
          799  +    INSERT INTO t2 VALUES( randomblob(1000) );
          800  +    INSERT INTO t2 VALUES( randomblob(1000) );
          801  +    INSERT INTO t2 VALUES( randomblob(1000) );
          802  +    INSERT INTO t2 VALUES( randomblob(1000) );
          803  +    INSERT INTO t2 VALUES( randomblob(1000) );
          804  +    INSERT INTO t2 VALUES( randomblob(1000) );
          805  +  } {}
          806  +  
          807  +  # Reopen db to ensure the page-cache is empty.
          808  +  #
          809  +  db close
          810  +  sqlite3 db test.db
          811  +  
          812  +  # Open db in mmap-mode. Open a transaction, delete some data, then run
          813  +  # incremental-vacuum. Do not commit the transaction. 
          814  +  #
          815  +  do_execsql_test incrvacuum-16.1 {
          816  +    PRAGMA mmap_size = 1000000;
          817  +    BEGIN;
          818  +    DELETE FROM t2;
          819  +    PRAGMA incremental_vacuum = 1000;
          820  +  } {1000000}
   820    821   
   821         -# Scan through table t3 (which is all clean pages - so mmap is used). Then,
   822         -# midway through, commit the transaction. This causes the db to be truncated
   823         -# while there are outstanding xFetch pages.
   824         -#
   825         -do_test incrvacuum-16.2 {
   826         -  set res [list]
   827         -  db eval { SELECT a FROM t3 } {
   828         -    if {$a==3} { db eval COMMIT }
   829         -    lappend res $a
   830         -  }
   831         -  set res
   832         -} {1 2 3 4}
   833         -
          822  +  # Scan through table t3 (which is all clean pages - so mmap is used). Then,
          823  +  # midway through, commit the transaction. This causes the db to be truncated
          824  +  # while there are outstanding xFetch pages.
          825  +  #
          826  +  do_test incrvacuum-16.2 {
          827  +    set res [list]
          828  +    db eval { SELECT a FROM t3 } {
          829  +      if {$a==3} { db eval COMMIT }
          830  +      lappend res $a
          831  +    }
          832  +    set res
          833  +  } {1 2 3 4}
          834  +}
          835  +  
   834    836   finish_test

Changes to test/indexexpr2.test.

   197    197     set ::cnt
   198    198     # Refcnt() should not be invoked because that index does not change.
   199    199   } {0}
   200    200   
   201    201   # Additional test cases to show that UPDATE does not modify indexes that
   202    202   # do not involve unchanged columns.
   203    203   #
   204         -load_static_extension db explain
   205         -do_execsql_test 4.200 {
   206         -  CREATE TABLE t2(a,b,c,d,e,f);
   207         -  INSERT INTO t2 VALUES(2,3,4,5,6,7);
   208         -  CREATE INDEX t2abc ON t2(a+b+c);
   209         -  CREATE INDEX t2cd ON t2(c*d);
   210         -  CREATE INDEX t2def ON t2(d,e+25*f);
   211         -  SELECT sqlite_master.name 
   212         -    FROM sqlite_master, explain('UPDATE t2 SET b=b+1')
   213         -   WHERE explain.opcode LIKE 'Open%'
   214         -     AND sqlite_master.rootpage=explain.p2
   215         -   ORDER BY 1;
   216         -} {t2 t2abc}
   217         -do_execsql_test 4.210 {
   218         -  SELECT sqlite_master.name 
   219         -    FROM sqlite_master, explain('UPDATE t2 SET c=c+1')
   220         -   WHERE explain.opcode LIKE 'Open%'
   221         -     AND sqlite_master.rootpage=explain.p2
   222         -   ORDER BY 1;
   223         -} {t2 t2abc t2cd}
   224         -do_execsql_test 4.220 {
   225         -  SELECT sqlite_master.name 
   226         -    FROM sqlite_master, explain('UPDATE t2 SET c=c+1, f=NULL')
   227         -   WHERE explain.opcode LIKE 'Open%'
   228         -     AND sqlite_master.rootpage=explain.p2
   229         -   ORDER BY 1;
   230         -} {t2 t2abc t2cd t2def}
          204  +ifcapable vtab {
          205  +  load_static_extension db explain
          206  +  do_execsql_test 4.200 {
          207  +    CREATE TABLE t2(a,b,c,d,e,f);
          208  +    INSERT INTO t2 VALUES(2,3,4,5,6,7);
          209  +    CREATE INDEX t2abc ON t2(a+b+c);
          210  +    CREATE INDEX t2cd ON t2(c*d);
          211  +    CREATE INDEX t2def ON t2(d,e+25*f);
          212  +    SELECT sqlite_master.name 
          213  +      FROM sqlite_master, explain('UPDATE t2 SET b=b+1')
          214  +     WHERE explain.opcode LIKE 'Open%'
          215  +       AND sqlite_master.rootpage=explain.p2
          216  +     ORDER BY 1;
          217  +  } {t2 t2abc}
          218  +  do_execsql_test 4.210 {
          219  +    SELECT sqlite_master.name 
          220  +      FROM sqlite_master, explain('UPDATE t2 SET c=c+1')
          221  +     WHERE explain.opcode LIKE 'Open%'
          222  +       AND sqlite_master.rootpage=explain.p2
          223  +     ORDER BY 1;
          224  +  } {t2 t2abc t2cd}
          225  +  do_execsql_test 4.220 {
          226  +    SELECT sqlite_master.name 
          227  +      FROM sqlite_master, explain('UPDATE t2 SET c=c+1, f=NULL')
          228  +     WHERE explain.opcode LIKE 'Open%'
          229  +       AND sqlite_master.rootpage=explain.p2
          230  +     ORDER BY 1;
          231  +  } {t2 t2abc t2cd t2def}
          232  +}
   231    233   
   232    234   
   233    235   finish_test

Added test/lemon-test01.y.

            1  +// A test case for the LEMON parser generator.  Run as follows:
            2  +//
            3  +//     lemon lemon-test01.y && gcc -g lemon-test01.c && ./a.out
            4  +//
            5  +%token_prefix TK_
            6  +%token_type   int
            7  +%default_type int
            8  +%include {
            9  +  static int nSyntaxError = 0;
           10  +  static int nAccept = 0;
           11  +  static int nFailure = 0;
           12  +}
           13  +
           14  +all ::=  A B.
           15  +all ::=  error B.
           16  +
           17  +%syntax_error {
           18  +  nSyntaxError++;
           19  +}
           20  +%parse_accept {
           21  +  nAccept++;
           22  +}
           23  +%parse_failure {
           24  +  nFailure++;
           25  +}
           26  +%code {
           27  +  #include <assert.h>
           28  +  #include "lemon-test01.h"
           29  +  static int nTest = 0;
           30  +  static int nErr = 0;
           31  +  static int testCase(int testId, int shouldBe, int actual){
           32  +    nTest++;
           33  +    if( shouldBe==actual ){
           34  +      printf("test %d: ok\n", testId);
           35  +    }else{
           36  +      printf("test %d: got %d, expected %d\n", testId, actual, shouldBe);
           37  +      nErr++;
           38  +    }
           39  +  }
           40  +  int main(int argc, char **argv){
           41  +    yyParser xp;
           42  +    ParseInit(&xp);
           43  +    Parse(&xp, TK_A, 0);
           44  +    Parse(&xp, TK_B, 0);
           45  +    Parse(&xp, 0, 0);
           46  +    ParseFinalize(&xp);
           47  +    testCase(100, 0, nSyntaxError);
           48  +    testCase(110, 1, nAccept);
           49  +    testCase(120, 0, nFailure);
           50  +    nSyntaxError = nAccept = nFailure = 0;
           51  +    ParseInit(&xp);
           52  +    Parse(&xp, TK_B, 0);
           53  +    Parse(&xp, TK_B, 0);
           54  +    Parse(&xp, 0, 0);
           55  +    ParseFinalize(&xp);
           56  +    testCase(200, 1, nSyntaxError);
           57  +    testCase(210, 1, nAccept);
           58  +    testCase(220, 0, nFailure);
           59  +    nSyntaxError = nAccept = nFailure = 0;
           60  +    ParseInit(&xp);
           61  +    Parse(&xp, TK_A, 0);
           62  +    Parse(&xp, TK_A, 0);
           63  +    Parse(&xp, 0, 0);
           64  +    ParseFinalize(&xp);
           65  +    testCase(200, 1, nSyntaxError);
           66  +    testCase(210, 0, nAccept);
           67  +    testCase(220, 0, nFailure);
           68  +    if( nErr==0 ){
           69  +      printf("%d tests pass\n", nTest);
           70  +    }else{
           71  +      printf("%d errors out %d tests\n", nErr, nTest);
           72  +    }
           73  +    return nErr;
           74  +  }
           75  +}

Changes to test/pragma4.test.

   120    120   }
   121    121   do_test 4.1.4 { 
   122    122     sqlite3 db3 test.db
   123    123     sqlite3 db2 test.db2
   124    124     execsql { DROP TABLE t1 } db3
   125    125     execsql { DROP TABLE t2 } db2
   126    126   } {}
   127         -do_execsql_test 4.1.5 { PRAGMA table_info = t1 }
   128         -do_execsql_test 4.1.6 { PRAGMA table_info = t2 }
          127  +do_execsql_test 4.1.5 { PRAGMA table_info(t1) }
          128  +do_execsql_test 4.1.6 { PRAGMA table_info(t2) }
   129    129   
   130    130   db2 close
   131    131   db3 close
   132    132   reset_db
   133    133   forcedelete test.db2
   134    134   do_execsql_test 4.2.1 {
   135    135     CREATE TABLE t1(a, b, c);
   136    136     ATTACH 'test.db2' AS aux;
   137    137     CREATE TABLE aux.t2(d, e, f);
   138    138   }
   139         -do_execsql_test 4.2.2 { SELECT * FROM pragma_table_info('t1') } {
   140         -  0 a {} 0 {} 0 1 b {} 0 {} 0 2 c {} 0 {} 0
   141         -}
   142         -do_execsql_test 4.2.3 { SELECT * FROM pragma_table_info('t2') } {
   143         -  0 d {} 0 {} 0 1 e {} 0 {} 0 2 f {} 0 {} 0
          139  +ifcapable vtab {
          140  +  do_execsql_test 4.2.2 { SELECT * FROM pragma_table_info('t1') } {
          141  +    0 a {} 0 {} 0 1 b {} 0 {} 0 2 c {} 0 {} 0
          142  +  }
          143  +  do_execsql_test 4.2.3 { SELECT * FROM pragma_table_info('t2') } {
          144  +    0 d {} 0 {} 0 1 e {} 0 {} 0 2 f {} 0 {} 0
          145  +  }
   144    146   }
   145    147   do_test 4.2.4 { 
   146    148     sqlite3 db3 test.db
   147    149     sqlite3 db2 test.db2
   148    150     execsql { DROP TABLE t1 } db3
   149    151     execsql { DROP TABLE t2 } db2
   150    152   } {}
   151         -do_execsql_test 4.2.5 { SELECT * FROM pragma_table_info('t1') } 
   152         -do_execsql_test 4.2.6 { SELECT * FROM pragma_table_info('t2') } 
          153  +ifcapable vtab {
          154  +  do_execsql_test 4.2.5 { SELECT * FROM pragma_table_info('t1') } 
          155  +  do_execsql_test 4.2.6 { SELECT * FROM pragma_table_info('t2') } 
          156  +}
   153    157   
   154    158   db2 close
   155    159   db3 close
   156    160   reset_db
   157    161   forcedelete test.db2
   158    162   do_execsql_test 4.3.1 {
   159    163     CREATE TABLE t1(a, b, c);
   160    164     CREATE INDEX i1 ON t1(b);
   161    165     ATTACH 'test.db2' AS aux;
   162    166     CREATE TABLE aux.t2(d, e, f);
   163    167     CREATE INDEX aux.i2 ON t2(e);
   164    168   }
   165         -do_execsql_test 4.3.2 { SELECT * FROM pragma_index_info('i1') } {0 1 b}
   166         -do_execsql_test 4.3.3 { SELECT * FROM pragma_index_info('i2') } {0 1 e}
          169  +ifcapable vtab {
          170  +  do_execsql_test 4.3.2 { SELECT * FROM pragma_index_info('i1') } {0 1 b}
          171  +  do_execsql_test 4.3.3 { SELECT * FROM pragma_index_info('i2') } {0 1 e}
          172  +}
   167    173   do_test 4.3.4 { 
   168    174     sqlite3 db3 test.db
   169    175     sqlite3 db2 test.db2
   170    176     execsql { DROP INDEX i1 } db3
   171    177     execsql { DROP INDEX i2 } db2
   172    178   } {}
   173         -do_execsql_test 4.3.5 { SELECT * FROM pragma_index_info('i1') } 
   174         -do_execsql_test 4.3.6 { SELECT * FROM pragma_index_info('i2') } 
          179  +ifcapable vtab {
          180  +  do_execsql_test 4.3.5 { SELECT * FROM pragma_index_info('i1') } 
          181  +  do_execsql_test 4.3.6 { SELECT * FROM pragma_index_info('i2') } 
          182  +}
   175    183   
          184  +execsql {SELECT * FROM main.sqlite_master, aux.sqlite_master}
   176    185   do_execsql_test 4.4.0 {
   177    186     CREATE INDEX main.i1 ON t1(b, c);
   178    187     CREATE INDEX aux.i2 ON t2(e, f);
   179    188   }
   180         -do_execsql_test 4.4.1 { SELECT * FROM pragma_index_list('t1') } {0 i1 0 c 0}
   181         -do_execsql_test 4.4.2 { SELECT * FROM pragma_index_list('t2') } {0 i2 0 c 0}
          189  +ifcapable vtab {
          190  +  do_execsql_test 4.4.1 { SELECT * FROM pragma_index_list('t1') } {0 i1 0 c 0}
          191  +  do_execsql_test 4.4.2 { SELECT * FROM pragma_index_list('t2') } {0 i2 0 c 0}
          192  +}
   182    193   do_test 4.4.3 { 
   183    194     execsql { DROP INDEX i1 } db3
   184    195     execsql { DROP INDEX i2 } db2
   185    196   } {}
   186         -do_execsql_test 4.4.5 { SELECT * FROM pragma_index_list('t1') } {}
   187         -do_execsql_test 4.4.6 { SELECT * FROM pragma_index_list('t2') } {}
          197  +ifcapable vtab {
          198  +  do_execsql_test 4.4.5 { SELECT * FROM pragma_index_list('t1') } {}
          199  +  do_execsql_test 4.4.6 { SELECT * FROM pragma_index_list('t2') } {}
          200  +}
          201  +execsql {SELECT * FROM main.sqlite_master, aux.sqlite_master}
   188    202   
   189    203   do_execsql_test 4.5.0 {
   190    204     CREATE UNIQUE INDEX main.i1 ON t1(a);
   191    205     CREATE UNIQUE INDEX aux.i2 ON t2(d);
   192    206     CREATE TABLE main.c1 (a, b, c REFERENCES t1(a));
   193    207     CREATE TABLE aux.c2 (d, e, r REFERENCES t2(d));
   194    208   }
   195         -do_execsql_test 4.5.1 { SELECT * FROM pragma_foreign_key_list('c1') } {
   196         -  0 0 t1 c a {NO ACTION} {NO ACTION} NONE
   197         -}
   198         -do_execsql_test 4.5.2 { SELECT * FROM pragma_foreign_key_list('c2') } {
   199         -  0 0 t2 r d {NO ACTION} {NO ACTION} NONE
          209  +ifcapable vtab {
          210  +  do_execsql_test 4.5.1 { SELECT * FROM pragma_foreign_key_list('c1') } {
          211  +    0 0 t1 c a {NO ACTION} {NO ACTION} NONE
          212  +  }
          213  +  do_execsql_test 4.5.2 { SELECT * FROM pragma_foreign_key_list('c2') } {
          214  +    0 0 t2 r d {NO ACTION} {NO ACTION} NONE
          215  +  }
   200    216   }
   201    217   do_test 4.5.3 { 
   202    218     execsql { DROP TABLE c1 } db3
   203    219     execsql { DROP TABLE c2 } db2
   204    220   } {}
   205         -do_execsql_test 4.5.1 { SELECT * FROM pragma_foreign_key_list('c1') }
   206         -do_execsql_test 4.5.2 { SELECT * FROM pragma_foreign_key_list('c2') } 
          221  +ifcapable vtab {
          222  +  do_execsql_test 4.5.4 { SELECT * FROM pragma_foreign_key_list('c1') }
          223  +  do_execsql_test 4.5.5 { SELECT * FROM pragma_foreign_key_list('c2') } 
          224  +}
          225  +execsql {SELECT * FROM main.sqlite_master, aux.sqlite_master}
   207    226   
   208    227   do_execsql_test 4.6.0 {
   209    228     CREATE TABLE main.c1 (a, b, c REFERENCES t1(a));
   210    229     CREATE TABLE aux.c2 (d, e, r REFERENCES t2(d));
   211    230     INSERT INTO main.c1 VALUES(1, 2, 3);
   212    231     INSERT INTO aux.c2 VALUES(4, 5, 6);
   213    232   }
................................................................................
   222    241   } {}
   223    242   do_execsql_test 4.6.4 { pragma foreign_key_check('c1') } {c1 1 t1 0}
   224    243   do_catchsql_test 4.6.5 { 
   225    244     pragma foreign_key_check('c2') 
   226    245   } {1 {no such table: c2}}
   227    246   
   228    247   finish_test
   229         -

Changes to test/releasetest.tcl.

    75     75       -DHAVE_UTIME=0
    76     76     }
    77     77     "Unlock-Notify" {
    78     78       -O2
    79     79       -DSQLITE_ENABLE_UNLOCK_NOTIFY
    80     80       -DSQLITE_THREADSAFE
    81     81       -DSQLITE_TCL_DEFAULT_FULLMUTEX=1
           82  +  }
           83  +  "User-Auth" {
           84  +    -O2
    82     85       -DSQLITE_USER_AUTHENTICATION=1
    83     86     }
    84     87     "Secure-Delete" {
    85     88       -O2
    86     89       -DSQLITE_SECURE_DELETE=1
    87     90       -DSQLITE_SOUNDEX=1
    88     91     }
................................................................................
   270    273     Linux-x86_64 {
   271    274       "Check-Symbols"           checksymbols
   272    275       "Fast-One"                "fuzztest test"
   273    276       "Debug-One"               "mptest test"
   274    277       "Have-Not"                test
   275    278       "Secure-Delete"           test
   276    279       "Unlock-Notify"           "QUICKTEST_INCLUDE=notify2.test test"
          280  +    "User-Auth"               tcltest
   277    281       "Update-Delete-Limit"     test
   278    282       "Extra-Robustness"        test
   279    283       "Device-Two"              test
   280    284       "No-lookaside"            test
   281    285       "Devkit"                  test
   282    286       "Apple"                   test
   283    287       "Sanitize"                {QUICKTEST_OMIT=func4.test,nan.test test}

Changes to test/vtab_err.test.

    16     16   
    17     17   ifcapable !vtab {
    18     18     finish_test
    19     19     return
    20     20   }
    21     21   
    22     22   
    23         -
    24     23   unset -nocomplain echo_module_begin_fail
    25     24   do_ioerr_test vtab_err-1 -tclprep {
    26     25     register_echo_module [sqlite3_connection_pointer db]
    27     26   } -sqlbody {
    28     27     BEGIN;
    29     28     CREATE TABLE r(a PRIMARY KEY, b, c);
    30     29     CREATE VIRTUAL TABLE e USING echo(r);
................................................................................
    58     57       CREATE TABLE r2(a, b, c);
    59     58       INSERT INTO r2 SELECT * FROM e;
    60     59       INSERT INTO e SELECT a||'x', b, c FROM r2;
    61     60     COMMIT;
    62     61   } 
    63     62   
    64     63   sqlite3_memdebug_fail -1
           64  +
           65  +reset_db
           66  +register_echo_module [sqlite3_connection_pointer db]
           67  +do_execsql_test vtab_err-3.0 {
           68  +  CREATE TABLE r(a PRIMARY KEY, b, c);
           69  +  CREATE VIRTUAL TABLE e USING echo(r);
           70  +}
           71  +faultsim_save_and_close
           72  +
           73  +do_faultsim_test vtab_err-3 -faults oom-t* -prep {
           74  +  faultsim_restore_and_reopen
           75  +  register_echo_module [sqlite3_connection_pointer db]
           76  +} -body {
           77  +  execsql {
           78  +    BEGIN;
           79  +      CREATE TABLE xyz(x);
           80  +      SELECT a FROM e;
           81  +    COMMIT;
           82  +  }
           83  +} -test {
           84  +  faultsim_test_result {0 {}}
           85  +}
    65     86   
    66     87   finish_test

Changes to tool/lempar.c.

    19     19   ** of this template is copied straight through into the generate parser
    20     20   ** source file.
    21     21   **
    22     22   ** The following is the concatenation of all %include directives from the
    23     23   ** input grammar file:
    24     24   */
    25     25   #include <stdio.h>
           26  +#include <assert.h>
    26     27   /************ Begin %include sections from the grammar ************************/
    27     28   %%
    28     29   /**************** End of %include directives **********************************/
    29     30   /* These constants specify the various numeric values for terminal symbols
    30     31   ** in a format understandable to "makeheaders".  This section is blank unless
    31     32   ** "lemon" is run with the "-m" command-line option.
    32     33   ***************** Begin makeheaders token definitions *************************/
................................................................................
   983    984                yyTracePrompt,yyTokenName[yymajor]);
   984    985           }
   985    986   #endif
   986    987           yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
   987    988           yymajor = YYNOCODE;
   988    989         }else{
   989    990           while( yypParser->yytos >= yypParser->yystack
   990         -            && yymx != YYERRORSYMBOL
   991    991               && (yyact = yy_find_reduce_action(
   992    992                           yypParser->yytos->stateno,
   993         -                        YYERRORSYMBOL)) >= YY_MIN_REDUCE
          993  +                        YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE
   994    994           ){
   995    995             yy_pop_parser_stack(yypParser);
   996    996           }
   997    997           if( yypParser->yytos < yypParser->yystack || yymajor==0 ){
   998    998             yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
   999    999             yy_parse_failed(yypParser);
  1000   1000   #ifndef YYNOERRORRECOVERY