Fossil SCM

Update the built-in SQLite to an early 3.35 version containing support for generalized upsert, math functions, and reduced memory usage for VACUUM of large blobs.

drh 2020-12-15 14:21 trunk
Commit ea5465149ff5bc27a303bc7819689400bfaf18fcfb5ef7043063c6a622314a20
3 files changed +45 -40 +2641 -1906 +5 -4
+45 -40
--- src/shell.c
+++ src/shell.c
@@ -1422,11 +1422,14 @@
14221422
/* #include "sqlite3ext.h" */
14231423
SQLITE_EXTENSION_INIT1
14241424
#include <assert.h>
14251425
#include <string.h>
14261426
#include <stdarg.h>
1427
+
1428
+#ifndef SQLITE_AMALGAMATION
14271429
/* typedef sqlite3_uint64 u64; */
1430
+#endif /* SQLITE_AMALGAMATION */
14281431
14291432
/******************************************************************************
14301433
** The Hash Engine
14311434
*/
14321435
/*
@@ -5561,11 +5564,12 @@
55615564
** 1: start=VALUE
55625565
** 2: stop=VALUE
55635566
** 4: step=VALUE
55645567
**
55655568
** Also, if bit 8 is set, that means that the series should be output
5566
-** in descending order rather than in ascending order.
5569
+** in descending order rather than in ascending order. If bit 16 is
5570
+** set, then output must appear in ascending order.
55675571
**
55685572
** This routine should initialize the cursor and position it so that it
55695573
** is pointing at the first row, or pointing off the end of the table
55705574
** (so that seriesEof() will return true) if the table is empty.
55715575
*/
@@ -5587,11 +5591,16 @@
55875591
}else{
55885592
pCur->mxValue = 0xffffffff;
55895593
}
55905594
if( idxNum & 4 ){
55915595
pCur->iStep = sqlite3_value_int64(argv[i++]);
5592
- if( pCur->iStep<1 ) pCur->iStep = 1;
5596
+ if( pCur->iStep==0 ){
5597
+ pCur->iStep = 1;
5598
+ }else if( pCur->iStep<0 ){
5599
+ pCur->iStep = -pCur->iStep;
5600
+ if( (idxNum & 16)==0 ) idxNum |= 8;
5601
+ }
55935602
}else{
55945603
pCur->iStep = 1;
55955604
}
55965605
for(i=0; i<argc; i++){
55975606
if( sqlite3_value_type(argv[i])==SQLITE_NULL ){
@@ -5681,11 +5690,15 @@
56815690
/* Both start= and stop= boundaries are available. This is the
56825691
** the preferred case */
56835692
pIdxInfo->estimatedCost = (double)(2 - ((idxNum&4)!=0));
56845693
pIdxInfo->estimatedRows = 1000;
56855694
if( pIdxInfo->nOrderBy==1 ){
5686
- if( pIdxInfo->aOrderBy[0].desc ) idxNum |= 8;
5695
+ if( pIdxInfo->aOrderBy[0].desc ){
5696
+ idxNum |= 8;
5697
+ }else{
5698
+ idxNum |= 16;
5699
+ }
56875700
pIdxInfo->orderByConsumed = 1;
56885701
}
56895702
}else{
56905703
/* If either boundary is missing, we have to generate a huge span
56915704
** of numbers. Make this case very expensive so that the query
@@ -8932,11 +8945,11 @@
89328945
IdxTable *pNew = 0;
89338946
int rc, rc2;
89348947
char *pCsr = 0;
89358948
int nPk = 0;
89368949
8937
- rc = idxPrintfPrepareStmt(db, &p1, pzErrmsg, "PRAGMA table_info=%Q", zTab);
8950
+ rc = idxPrintfPrepareStmt(db, &p1, pzErrmsg, "PRAGMA table_xinfo=%Q", zTab);
89388951
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(p1) ){
89398952
const char *zCol = (const char*)sqlite3_column_text(p1, 1);
89408953
nByte += 1 + STRLEN(zCol);
89418954
rc = sqlite3_table_column_metadata(
89428955
db, "main", zTab, zCol, 0, &zCol, 0, 0, 0
@@ -9966,14 +9979,16 @@
99669979
99679980
idxFinalize(&rc, pAllIndex);
99689981
idxFinalize(&rc, pIndexXInfo);
99699982
idxFinalize(&rc, pWrite);
99709983
9971
- for(i=0; i<pCtx->nSlot; i++){
9972
- sqlite3_free(pCtx->aSlot[i].z);
9984
+ if( pCtx ){
9985
+ for(i=0; i<pCtx->nSlot; i++){
9986
+ sqlite3_free(pCtx->aSlot[i].z);
9987
+ }
9988
+ sqlite3_free(pCtx);
99739989
}
9974
- sqlite3_free(pCtx);
99759990
99769991
if( rc==SQLITE_OK ){
99779992
rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0);
99789993
}
99799994
@@ -12906,35 +12921,22 @@
1290612921
}
1290712922
1290812923
/*
1290912924
** Disable and restore .wheretrace and .selecttrace settings.
1291012925
*/
12911
-#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12912
-extern unsigned int sqlite3_unsupported_selecttrace;
12913
-static int savedSelectTrace;
12914
-#endif
12915
-#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12916
-extern int sqlite3WhereTrace;
12917
-static int savedWhereTrace;
12918
-#endif
12926
+static unsigned int savedSelectTrace;
12927
+static unsigned int savedWhereTrace;
1291912928
static void disable_debug_trace_modes(void){
12920
-#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12921
- savedSelectTrace = sqlite3_unsupported_selecttrace;
12922
- sqlite3_unsupported_selecttrace = 0;
12923
-#endif
12924
-#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12925
- savedWhereTrace = sqlite3WhereTrace;
12926
- sqlite3WhereTrace = 0;
12927
-#endif
12929
+ unsigned int zero = 0;
12930
+ sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 0, &savedSelectTrace);
12931
+ sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 1, &zero);
12932
+ sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 2, &savedWhereTrace);
12933
+ sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 3, &zero);
1292812934
}
1292912935
static void restore_debug_trace_modes(void){
12930
-#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12931
- sqlite3_unsupported_selecttrace = savedSelectTrace;
12932
-#endif
12933
-#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12934
- sqlite3WhereTrace = savedWhereTrace;
12935
-#endif
12936
+ sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 1, &savedSelectTrace);
12937
+ sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 3, &savedWhereTrace);
1293612938
}
1293712939
1293812940
/* Create the TEMP table used to store parameter bindings */
1293912941
static void bind_table_init(ShellState *p){
1294012942
int wrSchema = 0;
@@ -18705,13 +18707,13 @@
1870518707
}
1870618708
}else
1870718709
#endif /* SQLITE_DEBUG */
1870818710
1870918711
if( c=='o' && strncmp(azArg[0], "open", n)==0 && n>=2 ){
18710
- char *zNewFilename; /* Name of the database file to open */
18711
- int iName = 1; /* Index in azArg[] of the filename */
18712
- int newFlag = 0; /* True to delete file before opening */
18712
+ char *zNewFilename = 0; /* Name of the database file to open */
18713
+ int iName = 1; /* Index in azArg[] of the filename */
18714
+ int newFlag = 0; /* True to delete file before opening */
1871318715
/* Close the existing database */
1871418716
session_close_all(p);
1871518717
close_db(p->db);
1871618718
p->db = 0;
1871718719
p->zDbFilename = 0;
@@ -18719,11 +18721,11 @@
1871918721
p->zFreeOnClose = 0;
1872018722
p->openMode = SHELL_OPEN_UNSPEC;
1872118723
p->openFlags = 0;
1872218724
p->szMax = 0;
1872318725
/* Check for command-line arguments */
18724
- for(iName=1; iName<nArg && azArg[iName][0]=='-'; iName++){
18726
+ for(iName=1; iName<nArg; iName++){
1872518727
const char *z = azArg[iName];
1872618728
if( optionMatch(z,"new") ){
1872718729
newFlag = 1;
1872818730
#ifdef SQLITE_HAVE_ZLIB
1872918731
}else if( optionMatch(z, "zip") ){
@@ -18745,14 +18747,19 @@
1874518747
#endif /* SQLITE_ENABLE_DESERIALIZE */
1874618748
}else if( z[0]=='-' ){
1874718749
utf8_printf(stderr, "unknown option: %s\n", z);
1874818750
rc = 1;
1874918751
goto meta_command_exit;
18752
+ }else if( zNewFilename ){
18753
+ utf8_printf(stderr, "extra argument: \"%s\"\n", z);
18754
+ rc = 1;
18755
+ goto meta_command_exit;
18756
+ }else{
18757
+ zNewFilename = sqlite3_mprintf("%s", z);
1875018758
}
1875118759
}
1875218760
/* If a filename is specified, try to open it first */
18753
- zNewFilename = nArg>iName ? sqlite3_mprintf("%s", azArg[iName]) : 0;
1875418761
if( zNewFilename || p->openMode==SHELL_OPEN_HEXDB ){
1875518762
if( newFlag ) shellDeleteFile(zNewFilename);
1875618763
p->zDbFilename = zNewFilename;
1875718764
open_db(p, OPEN_DB_KEEPALIVE);
1875818765
if( p->db==0 ){
@@ -19271,15 +19278,14 @@
1927119278
}else{
1927219279
rc = 0;
1927319280
}
1927419281
}else
1927519282
19276
-#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
1927719283
if( c=='s' && n==11 && strncmp(azArg[0], "selecttrace", n)==0 ){
19278
- sqlite3_unsupported_selecttrace = nArg>=2 ? (int)integerValue(azArg[1]) : 0xffff;
19284
+ unsigned int x = nArg>=2 ? (unsigned int)integerValue(azArg[1]) : 0xffffffff;
19285
+ sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 1, &x);
1927919286
}else
19280
-#endif
1928119287
1928219288
#if defined(SQLITE_ENABLE_SESSION)
1928319289
if( c=='s' && strncmp(azArg[0],"session",n)==0 && n>=3 ){
1928419290
OpenSession *pSession = &p->aSession[0];
1928519291
char **azCmd = &azArg[1];
@@ -20330,15 +20336,14 @@
2033020336
sqlite3_free(zVfsName);
2033120337
}
2033220338
}
2033320339
}else
2033420340
20335
-#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
2033620341
if( c=='w' && strncmp(azArg[0], "wheretrace", n)==0 ){
20337
- sqlite3WhereTrace = nArg>=2 ? booleanValue(azArg[1]) : 0xff;
20342
+ unsigned int x = nArg>=2 ? (unsigned int)integerValue(azArg[1]) : 0xffffffff;
20343
+ sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 3, &x);
2033820344
}else
20339
-#endif
2034020345
2034120346
if( c=='w' && strncmp(azArg[0], "width", n)==0 ){
2034220347
int j;
2034320348
assert( nArg<=ArraySize(azArg) );
2034420349
p->nWidth = nArg-1;
2034520350
--- src/shell.c
+++ src/shell.c
@@ -1422,11 +1422,14 @@
1422 /* #include "sqlite3ext.h" */
1423 SQLITE_EXTENSION_INIT1
1424 #include <assert.h>
1425 #include <string.h>
1426 #include <stdarg.h>
 
 
1427 /* typedef sqlite3_uint64 u64; */
 
1428
1429 /******************************************************************************
1430 ** The Hash Engine
1431 */
1432 /*
@@ -5561,11 +5564,12 @@
5561 ** 1: start=VALUE
5562 ** 2: stop=VALUE
5563 ** 4: step=VALUE
5564 **
5565 ** Also, if bit 8 is set, that means that the series should be output
5566 ** in descending order rather than in ascending order.
 
5567 **
5568 ** This routine should initialize the cursor and position it so that it
5569 ** is pointing at the first row, or pointing off the end of the table
5570 ** (so that seriesEof() will return true) if the table is empty.
5571 */
@@ -5587,11 +5591,16 @@
5587 }else{
5588 pCur->mxValue = 0xffffffff;
5589 }
5590 if( idxNum & 4 ){
5591 pCur->iStep = sqlite3_value_int64(argv[i++]);
5592 if( pCur->iStep<1 ) pCur->iStep = 1;
 
 
 
 
 
5593 }else{
5594 pCur->iStep = 1;
5595 }
5596 for(i=0; i<argc; i++){
5597 if( sqlite3_value_type(argv[i])==SQLITE_NULL ){
@@ -5681,11 +5690,15 @@
5681 /* Both start= and stop= boundaries are available. This is the
5682 ** the preferred case */
5683 pIdxInfo->estimatedCost = (double)(2 - ((idxNum&4)!=0));
5684 pIdxInfo->estimatedRows = 1000;
5685 if( pIdxInfo->nOrderBy==1 ){
5686 if( pIdxInfo->aOrderBy[0].desc ) idxNum |= 8;
 
 
 
 
5687 pIdxInfo->orderByConsumed = 1;
5688 }
5689 }else{
5690 /* If either boundary is missing, we have to generate a huge span
5691 ** of numbers. Make this case very expensive so that the query
@@ -8932,11 +8945,11 @@
8932 IdxTable *pNew = 0;
8933 int rc, rc2;
8934 char *pCsr = 0;
8935 int nPk = 0;
8936
8937 rc = idxPrintfPrepareStmt(db, &p1, pzErrmsg, "PRAGMA table_info=%Q", zTab);
8938 while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(p1) ){
8939 const char *zCol = (const char*)sqlite3_column_text(p1, 1);
8940 nByte += 1 + STRLEN(zCol);
8941 rc = sqlite3_table_column_metadata(
8942 db, "main", zTab, zCol, 0, &zCol, 0, 0, 0
@@ -9966,14 +9979,16 @@
9966
9967 idxFinalize(&rc, pAllIndex);
9968 idxFinalize(&rc, pIndexXInfo);
9969 idxFinalize(&rc, pWrite);
9970
9971 for(i=0; i<pCtx->nSlot; i++){
9972 sqlite3_free(pCtx->aSlot[i].z);
 
 
 
9973 }
9974 sqlite3_free(pCtx);
9975
9976 if( rc==SQLITE_OK ){
9977 rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0);
9978 }
9979
@@ -12906,35 +12921,22 @@
12906 }
12907
12908 /*
12909 ** Disable and restore .wheretrace and .selecttrace settings.
12910 */
12911 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12912 extern unsigned int sqlite3_unsupported_selecttrace;
12913 static int savedSelectTrace;
12914 #endif
12915 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12916 extern int sqlite3WhereTrace;
12917 static int savedWhereTrace;
12918 #endif
12919 static void disable_debug_trace_modes(void){
12920 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12921 savedSelectTrace = sqlite3_unsupported_selecttrace;
12922 sqlite3_unsupported_selecttrace = 0;
12923 #endif
12924 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12925 savedWhereTrace = sqlite3WhereTrace;
12926 sqlite3WhereTrace = 0;
12927 #endif
12928 }
12929 static void restore_debug_trace_modes(void){
12930 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
12931 sqlite3_unsupported_selecttrace = savedSelectTrace;
12932 #endif
12933 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
12934 sqlite3WhereTrace = savedWhereTrace;
12935 #endif
12936 }
12937
12938 /* Create the TEMP table used to store parameter bindings */
12939 static void bind_table_init(ShellState *p){
12940 int wrSchema = 0;
@@ -18705,13 +18707,13 @@
18705 }
18706 }else
18707 #endif /* SQLITE_DEBUG */
18708
18709 if( c=='o' && strncmp(azArg[0], "open", n)==0 && n>=2 ){
18710 char *zNewFilename; /* Name of the database file to open */
18711 int iName = 1; /* Index in azArg[] of the filename */
18712 int newFlag = 0; /* True to delete file before opening */
18713 /* Close the existing database */
18714 session_close_all(p);
18715 close_db(p->db);
18716 p->db = 0;
18717 p->zDbFilename = 0;
@@ -18719,11 +18721,11 @@
18719 p->zFreeOnClose = 0;
18720 p->openMode = SHELL_OPEN_UNSPEC;
18721 p->openFlags = 0;
18722 p->szMax = 0;
18723 /* Check for command-line arguments */
18724 for(iName=1; iName<nArg && azArg[iName][0]=='-'; iName++){
18725 const char *z = azArg[iName];
18726 if( optionMatch(z,"new") ){
18727 newFlag = 1;
18728 #ifdef SQLITE_HAVE_ZLIB
18729 }else if( optionMatch(z, "zip") ){
@@ -18745,14 +18747,19 @@
18745 #endif /* SQLITE_ENABLE_DESERIALIZE */
18746 }else if( z[0]=='-' ){
18747 utf8_printf(stderr, "unknown option: %s\n", z);
18748 rc = 1;
18749 goto meta_command_exit;
 
 
 
 
 
 
18750 }
18751 }
18752 /* If a filename is specified, try to open it first */
18753 zNewFilename = nArg>iName ? sqlite3_mprintf("%s", azArg[iName]) : 0;
18754 if( zNewFilename || p->openMode==SHELL_OPEN_HEXDB ){
18755 if( newFlag ) shellDeleteFile(zNewFilename);
18756 p->zDbFilename = zNewFilename;
18757 open_db(p, OPEN_DB_KEEPALIVE);
18758 if( p->db==0 ){
@@ -19271,15 +19278,14 @@
19271 }else{
19272 rc = 0;
19273 }
19274 }else
19275
19276 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_SELECTTRACE)
19277 if( c=='s' && n==11 && strncmp(azArg[0], "selecttrace", n)==0 ){
19278 sqlite3_unsupported_selecttrace = nArg>=2 ? (int)integerValue(azArg[1]) : 0xffff;
 
19279 }else
19280 #endif
19281
19282 #if defined(SQLITE_ENABLE_SESSION)
19283 if( c=='s' && strncmp(azArg[0],"session",n)==0 && n>=3 ){
19284 OpenSession *pSession = &p->aSession[0];
19285 char **azCmd = &azArg[1];
@@ -20330,15 +20336,14 @@
20330 sqlite3_free(zVfsName);
20331 }
20332 }
20333 }else
20334
20335 #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
20336 if( c=='w' && strncmp(azArg[0], "wheretrace", n)==0 ){
20337 sqlite3WhereTrace = nArg>=2 ? booleanValue(azArg[1]) : 0xff;
 
20338 }else
20339 #endif
20340
20341 if( c=='w' && strncmp(azArg[0], "width", n)==0 ){
20342 int j;
20343 assert( nArg<=ArraySize(azArg) );
20344 p->nWidth = nArg-1;
20345
--- src/shell.c
+++ src/shell.c
@@ -1422,11 +1422,14 @@
1422 /* #include "sqlite3ext.h" */
1423 SQLITE_EXTENSION_INIT1
1424 #include <assert.h>
1425 #include <string.h>
1426 #include <stdarg.h>
1427
1428 #ifndef SQLITE_AMALGAMATION
1429 /* typedef sqlite3_uint64 u64; */
1430 #endif /* SQLITE_AMALGAMATION */
1431
1432 /******************************************************************************
1433 ** The Hash Engine
1434 */
1435 /*
@@ -5561,11 +5564,12 @@
5564 ** 1: start=VALUE
5565 ** 2: stop=VALUE
5566 ** 4: step=VALUE
5567 **
5568 ** Also, if bit 8 is set, that means that the series should be output
5569 ** in descending order rather than in ascending order. If bit 16 is
5570 ** set, then output must appear in ascending order.
5571 **
5572 ** This routine should initialize the cursor and position it so that it
5573 ** is pointing at the first row, or pointing off the end of the table
5574 ** (so that seriesEof() will return true) if the table is empty.
5575 */
@@ -5587,11 +5591,16 @@
5591 }else{
5592 pCur->mxValue = 0xffffffff;
5593 }
5594 if( idxNum & 4 ){
5595 pCur->iStep = sqlite3_value_int64(argv[i++]);
5596 if( pCur->iStep==0 ){
5597 pCur->iStep = 1;
5598 }else if( pCur->iStep<0 ){
5599 pCur->iStep = -pCur->iStep;
5600 if( (idxNum & 16)==0 ) idxNum |= 8;
5601 }
5602 }else{
5603 pCur->iStep = 1;
5604 }
5605 for(i=0; i<argc; i++){
5606 if( sqlite3_value_type(argv[i])==SQLITE_NULL ){
@@ -5681,11 +5690,15 @@
5690 /* Both start= and stop= boundaries are available. This is the
5691 ** the preferred case */
5692 pIdxInfo->estimatedCost = (double)(2 - ((idxNum&4)!=0));
5693 pIdxInfo->estimatedRows = 1000;
5694 if( pIdxInfo->nOrderBy==1 ){
5695 if( pIdxInfo->aOrderBy[0].desc ){
5696 idxNum |= 8;
5697 }else{
5698 idxNum |= 16;
5699 }
5700 pIdxInfo->orderByConsumed = 1;
5701 }
5702 }else{
5703 /* If either boundary is missing, we have to generate a huge span
5704 ** of numbers. Make this case very expensive so that the query
@@ -8932,11 +8945,11 @@
8945 IdxTable *pNew = 0;
8946 int rc, rc2;
8947 char *pCsr = 0;
8948 int nPk = 0;
8949
8950 rc = idxPrintfPrepareStmt(db, &p1, pzErrmsg, "PRAGMA table_xinfo=%Q", zTab);
8951 while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(p1) ){
8952 const char *zCol = (const char*)sqlite3_column_text(p1, 1);
8953 nByte += 1 + STRLEN(zCol);
8954 rc = sqlite3_table_column_metadata(
8955 db, "main", zTab, zCol, 0, &zCol, 0, 0, 0
@@ -9966,14 +9979,16 @@
9979
9980 idxFinalize(&rc, pAllIndex);
9981 idxFinalize(&rc, pIndexXInfo);
9982 idxFinalize(&rc, pWrite);
9983
9984 if( pCtx ){
9985 for(i=0; i<pCtx->nSlot; i++){
9986 sqlite3_free(pCtx->aSlot[i].z);
9987 }
9988 sqlite3_free(pCtx);
9989 }
 
9990
9991 if( rc==SQLITE_OK ){
9992 rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0);
9993 }
9994
@@ -12906,35 +12921,22 @@
12921 }
12922
12923 /*
12924 ** Disable and restore .wheretrace and .selecttrace settings.
12925 */
12926 static unsigned int savedSelectTrace;
12927 static unsigned int savedWhereTrace;
 
 
 
 
 
 
12928 static void disable_debug_trace_modes(void){
12929 unsigned int zero = 0;
12930 sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 0, &savedSelectTrace);
12931 sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 1, &zero);
12932 sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 2, &savedWhereTrace);
12933 sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 3, &zero);
 
 
 
12934 }
12935 static void restore_debug_trace_modes(void){
12936 sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 1, &savedSelectTrace);
12937 sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 3, &savedWhereTrace);
 
 
 
 
12938 }
12939
12940 /* Create the TEMP table used to store parameter bindings */
12941 static void bind_table_init(ShellState *p){
12942 int wrSchema = 0;
@@ -18705,13 +18707,13 @@
18707 }
18708 }else
18709 #endif /* SQLITE_DEBUG */
18710
18711 if( c=='o' && strncmp(azArg[0], "open", n)==0 && n>=2 ){
18712 char *zNewFilename = 0; /* Name of the database file to open */
18713 int iName = 1; /* Index in azArg[] of the filename */
18714 int newFlag = 0; /* True to delete file before opening */
18715 /* Close the existing database */
18716 session_close_all(p);
18717 close_db(p->db);
18718 p->db = 0;
18719 p->zDbFilename = 0;
@@ -18719,11 +18721,11 @@
18721 p->zFreeOnClose = 0;
18722 p->openMode = SHELL_OPEN_UNSPEC;
18723 p->openFlags = 0;
18724 p->szMax = 0;
18725 /* Check for command-line arguments */
18726 for(iName=1; iName<nArg; iName++){
18727 const char *z = azArg[iName];
18728 if( optionMatch(z,"new") ){
18729 newFlag = 1;
18730 #ifdef SQLITE_HAVE_ZLIB
18731 }else if( optionMatch(z, "zip") ){
@@ -18745,14 +18747,19 @@
18747 #endif /* SQLITE_ENABLE_DESERIALIZE */
18748 }else if( z[0]=='-' ){
18749 utf8_printf(stderr, "unknown option: %s\n", z);
18750 rc = 1;
18751 goto meta_command_exit;
18752 }else if( zNewFilename ){
18753 utf8_printf(stderr, "extra argument: \"%s\"\n", z);
18754 rc = 1;
18755 goto meta_command_exit;
18756 }else{
18757 zNewFilename = sqlite3_mprintf("%s", z);
18758 }
18759 }
18760 /* If a filename is specified, try to open it first */
 
18761 if( zNewFilename || p->openMode==SHELL_OPEN_HEXDB ){
18762 if( newFlag ) shellDeleteFile(zNewFilename);
18763 p->zDbFilename = zNewFilename;
18764 open_db(p, OPEN_DB_KEEPALIVE);
18765 if( p->db==0 ){
@@ -19271,15 +19278,14 @@
19278 }else{
19279 rc = 0;
19280 }
19281 }else
19282
 
19283 if( c=='s' && n==11 && strncmp(azArg[0], "selecttrace", n)==0 ){
19284 unsigned int x = nArg>=2 ? (unsigned int)integerValue(azArg[1]) : 0xffffffff;
19285 sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 1, &x);
19286 }else
 
19287
19288 #if defined(SQLITE_ENABLE_SESSION)
19289 if( c=='s' && strncmp(azArg[0],"session",n)==0 && n>=3 ){
19290 OpenSession *pSession = &p->aSession[0];
19291 char **azCmd = &azArg[1];
@@ -20330,15 +20336,14 @@
20336 sqlite3_free(zVfsName);
20337 }
20338 }
20339 }else
20340
 
20341 if( c=='w' && strncmp(azArg[0], "wheretrace", n)==0 ){
20342 unsigned int x = nArg>=2 ? (unsigned int)integerValue(azArg[1]) : 0xffffffff;
20343 sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, 3, &x);
20344 }else
 
20345
20346 if( c=='w' && strncmp(azArg[0], "width", n)==0 ){
20347 int j;
20348 assert( nArg<=ArraySize(azArg) );
20349 p->nWidth = nArg-1;
20350
+2641 -1906
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3
-** version 3.34.0. By combining all the individual C code files into this
3
+** version 3.35.0. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% or more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -281,10 +281,13 @@
281281
#if SQLITE_ENABLE_LOAD_EXTENSION
282282
"ENABLE_LOAD_EXTENSION",
283283
#endif
284284
#ifdef SQLITE_ENABLE_LOCKING_STYLE
285285
"ENABLE_LOCKING_STYLE=" CTIMEOPT_VAL(SQLITE_ENABLE_LOCKING_STYLE),
286
+#endif
287
+#if SQLITE_ENABLE_MATH_FUNCTIONS
288
+ "ENABLE_MATH_FUNCTIONS"
286289
#endif
287290
#if SQLITE_ENABLE_MEMORY_MANAGEMENT
288291
"ENABLE_MEMORY_MANAGEMENT",
289292
#endif
290293
#if SQLITE_ENABLE_MEMSYS3
@@ -988,10 +991,22 @@
988991
# define MSVC_VERSION _MSC_VER
989992
#else
990993
# define MSVC_VERSION 0
991994
#endif
992995
996
+/*
997
+** Some C99 functions in "math.h" are only present for MSVC when its version
998
+** is associated with Visual Studio 2013 or higher.
999
+*/
1000
+#ifndef SQLITE_HAVE_C99_MATH_FUNCS
1001
+# if MSVC_VERSION==0 || MSVC_VERSION>=1800
1002
+# define SQLITE_HAVE_C99_MATH_FUNCS (1)
1003
+# else
1004
+# define SQLITE_HAVE_C99_MATH_FUNCS (0)
1005
+# endif
1006
+#endif
1007
+
9931008
/* Needed for various definitions... */
9941009
#if defined(__GNUC__) && !defined(_GNU_SOURCE)
9951010
# define _GNU_SOURCE
9961011
#endif
9971012
@@ -1169,13 +1184,13 @@
11691184
**
11701185
** See also: [sqlite3_libversion()],
11711186
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11721187
** [sqlite_version()] and [sqlite_source_id()].
11731188
*/
1174
-#define SQLITE_VERSION "3.34.0"
1175
-#define SQLITE_VERSION_NUMBER 3034000
1176
-#define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b"
1189
+#define SQLITE_VERSION "3.35.0"
1190
+#define SQLITE_VERSION_NUMBER 3035000
1191
+#define SQLITE_SOURCE_ID "2020-12-15 13:55:38 ea0a7f103a6f6a9e57d7377140ff9f372bf2b156f86f148291fb05a7030f2b36"
11771192
11781193
/*
11791194
** CAPI3REF: Run-Time Library Version Numbers
11801195
** KEYWORDS: sqlite3_version sqlite3_sourceid
11811196
**
@@ -8811,11 +8826,12 @@
88118826
#define SQLITE_TESTCTRL_PARSER_COVERAGE 26
88128827
#define SQLITE_TESTCTRL_RESULT_INTREAL 27
88138828
#define SQLITE_TESTCTRL_PRNG_SEED 28
88148829
#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
88158830
#define SQLITE_TESTCTRL_SEEK_COUNT 30
8816
-#define SQLITE_TESTCTRL_LAST 30 /* Largest TESTCTRL */
8831
+#define SQLITE_TESTCTRL_TRACEFLAGS 31
8832
+#define SQLITE_TESTCTRL_LAST 31 /* Largest TESTCTRL */
88178833
88188834
/*
88198835
** CAPI3REF: SQL Keyword Checking
88208836
**
88218837
** These routines provide access to the set of SQL language keywords
@@ -14592,25 +14608,39 @@
1459214608
1459314609
/*
1459414610
** SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not
1459514611
** the Select query generator tracing logic is turned on.
1459614612
*/
14597
-#if defined(SQLITE_ENABLE_SELECTTRACE)
14598
-# define SELECTTRACE_ENABLED 1
14599
-#else
14600
-# define SELECTTRACE_ENABLED 0
14613
+#if !defined(SQLITE_AMALGAMATION)
14614
+SQLITE_PRIVATE u32 sqlite3SelectTrace;
1460114615
#endif
14602
-#if defined(SQLITE_ENABLE_SELECTTRACE)
14616
+#if defined(SQLITE_DEBUG) \
14617
+ && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_SELECTTRACE))
1460314618
# define SELECTTRACE_ENABLED 1
1460414619
# define SELECTTRACE(K,P,S,X) \
14605
- if(sqlite3_unsupported_selecttrace&(K)) \
14620
+ if(sqlite3SelectTrace&(K)) \
1460614621
sqlite3DebugPrintf("%u/%d/%p: ",(S)->selId,(P)->addrExplain,(S)),\
1460714622
sqlite3DebugPrintf X
1460814623
#else
1460914624
# define SELECTTRACE(K,P,S,X)
1461014625
# define SELECTTRACE_ENABLED 0
1461114626
#endif
14627
+
14628
+/*
14629
+** Macros for "wheretrace"
14630
+*/
14631
+#if !defined(SQLITE_AMAGAMATION)
14632
+SQLITE_PRIVATE u32 sqlite3WhereTrace;
14633
+#endif
14634
+#if defined(SQLITE_DEBUG) \
14635
+ && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_WHERETRACE))
14636
+# define WHERETRACE(K,X) if(sqlite3WhereTrace&(K)) sqlite3DebugPrintf X
14637
+# define WHERETRACE_ENABLED 1
14638
+#else
14639
+# define WHERETRACE(K,X)
14640
+#endif
14641
+
1461214642
1461314643
/*
1461414644
** An instance of the following structure is used to store the busy-handler
1461514645
** callback for a given sqlite handle.
1461614646
**
@@ -15316,10 +15346,11 @@
1531615346
1531715347
/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */
1531815348
#define BTREE_SAVEPOSITION 0x02 /* Leave cursor pointing at NEXT or PREV */
1531915349
#define BTREE_AUXDELETE 0x04 /* not the primary delete operation */
1532015350
#define BTREE_APPEND 0x08 /* Insert is likely an append */
15351
+#define BTREE_PREFORMAT 0x80 /* Insert is likely an append */
1532115352
1532215353
/* An instance of the BtreePayload object describes the content of a single
1532315354
** entry in either an index or table btree.
1532415355
**
1532515356
** Index btrees (used for indexes and also WITHOUT ROWID tables) contain
@@ -15414,10 +15445,12 @@
1541415445
#endif
1541515446
1541615447
#ifndef SQLITE_OMIT_WAL
1541715448
SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree*, int, int *, int *);
1541815449
#endif
15450
+
15451
+SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor*, BtCursor*, i64);
1541915452
1542015453
/*
1542115454
** If we are not using shared cache, then there is no need to
1542215455
** use mutexes to access the BtShared structures. So make the
1542315456
** Enter and Leave procedures no-ops.
@@ -15757,64 +15790,65 @@
1575715790
#define OP_SeekScan 118 /* synopsis: Scan-ahead up to P1 rows */
1575815791
#define OP_SeekHit 119 /* synopsis: set P2<=seekHit<=P3 */
1575915792
#define OP_Sequence 120 /* synopsis: r[P2]=cursor[P1].ctr++ */
1576015793
#define OP_NewRowid 121 /* synopsis: r[P2]=rowid */
1576115794
#define OP_Insert 122 /* synopsis: intkey=r[P3] data=r[P2] */
15762
-#define OP_Delete 123
15763
-#define OP_ResetCount 124
15764
-#define OP_SorterCompare 125 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
15765
-#define OP_SorterData 126 /* synopsis: r[P2]=data */
15766
-#define OP_RowData 127 /* synopsis: r[P2]=data */
15767
-#define OP_Rowid 128 /* synopsis: r[P2]=rowid */
15768
-#define OP_NullRow 129
15769
-#define OP_SeekEnd 130
15770
-#define OP_IdxInsert 131 /* synopsis: key=r[P2] */
15771
-#define OP_SorterInsert 132 /* synopsis: key=r[P2] */
15772
-#define OP_IdxDelete 133 /* synopsis: key=r[P2@P3] */
15773
-#define OP_DeferredSeek 134 /* synopsis: Move P3 to P1.rowid if needed */
15774
-#define OP_IdxRowid 135 /* synopsis: r[P2]=rowid */
15775
-#define OP_FinishSeek 136
15776
-#define OP_Destroy 137
15777
-#define OP_Clear 138
15778
-#define OP_ResetSorter 139
15779
-#define OP_CreateBtree 140 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
15780
-#define OP_SqlExec 141
15781
-#define OP_ParseSchema 142
15782
-#define OP_LoadAnalysis 143
15783
-#define OP_DropTable 144
15784
-#define OP_DropIndex 145
15785
-#define OP_DropTrigger 146
15786
-#define OP_IntegrityCk 147
15787
-#define OP_RowSetAdd 148 /* synopsis: rowset(P1)=r[P2] */
15788
-#define OP_Param 149
15795
+#define OP_RowCell 123
15796
+#define OP_Delete 124
15797
+#define OP_ResetCount 125
15798
+#define OP_SorterCompare 126 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
15799
+#define OP_SorterData 127 /* synopsis: r[P2]=data */
15800
+#define OP_RowData 128 /* synopsis: r[P2]=data */
15801
+#define OP_Rowid 129 /* synopsis: r[P2]=rowid */
15802
+#define OP_NullRow 130
15803
+#define OP_SeekEnd 131
15804
+#define OP_IdxInsert 132 /* synopsis: key=r[P2] */
15805
+#define OP_SorterInsert 133 /* synopsis: key=r[P2] */
15806
+#define OP_IdxDelete 134 /* synopsis: key=r[P2@P3] */
15807
+#define OP_DeferredSeek 135 /* synopsis: Move P3 to P1.rowid if needed */
15808
+#define OP_IdxRowid 136 /* synopsis: r[P2]=rowid */
15809
+#define OP_FinishSeek 137
15810
+#define OP_Destroy 138
15811
+#define OP_Clear 139
15812
+#define OP_ResetSorter 140
15813
+#define OP_CreateBtree 141 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
15814
+#define OP_SqlExec 142
15815
+#define OP_ParseSchema 143
15816
+#define OP_LoadAnalysis 144
15817
+#define OP_DropTable 145
15818
+#define OP_DropIndex 146
15819
+#define OP_DropTrigger 147
15820
+#define OP_IntegrityCk 148
15821
+#define OP_RowSetAdd 149 /* synopsis: rowset(P1)=r[P2] */
1578915822
#define OP_Real 150 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
15790
-#define OP_FkCounter 151 /* synopsis: fkctr[P1]+=P2 */
15791
-#define OP_MemMax 152 /* synopsis: r[P1]=max(r[P1],r[P2]) */
15792
-#define OP_OffsetLimit 153 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
15793
-#define OP_AggInverse 154 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
15794
-#define OP_AggStep 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */
15795
-#define OP_AggStep1 156 /* synopsis: accum=r[P3] step(r[P2@P5]) */
15796
-#define OP_AggValue 157 /* synopsis: r[P3]=value N=P2 */
15797
-#define OP_AggFinal 158 /* synopsis: accum=r[P1] N=P2 */
15798
-#define OP_Expire 159
15799
-#define OP_CursorLock 160
15800
-#define OP_CursorUnlock 161
15801
-#define OP_TableLock 162 /* synopsis: iDb=P1 root=P2 write=P3 */
15802
-#define OP_VBegin 163
15803
-#define OP_VCreate 164
15804
-#define OP_VDestroy 165
15805
-#define OP_VOpen 166
15806
-#define OP_VColumn 167 /* synopsis: r[P3]=vcolumn(P2) */
15807
-#define OP_VRename 168
15808
-#define OP_Pagecount 169
15809
-#define OP_MaxPgcnt 170
15810
-#define OP_Trace 171
15811
-#define OP_CursorHint 172
15812
-#define OP_ReleaseReg 173 /* synopsis: release r[P1@P2] mask P3 */
15813
-#define OP_Noop 174
15814
-#define OP_Explain 175
15815
-#define OP_Abortable 176
15823
+#define OP_Param 151
15824
+#define OP_FkCounter 152 /* synopsis: fkctr[P1]+=P2 */
15825
+#define OP_MemMax 153 /* synopsis: r[P1]=max(r[P1],r[P2]) */
15826
+#define OP_OffsetLimit 154 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
15827
+#define OP_AggInverse 155 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
15828
+#define OP_AggStep 156 /* synopsis: accum=r[P3] step(r[P2@P5]) */
15829
+#define OP_AggStep1 157 /* synopsis: accum=r[P3] step(r[P2@P5]) */
15830
+#define OP_AggValue 158 /* synopsis: r[P3]=value N=P2 */
15831
+#define OP_AggFinal 159 /* synopsis: accum=r[P1] N=P2 */
15832
+#define OP_Expire 160
15833
+#define OP_CursorLock 161
15834
+#define OP_CursorUnlock 162
15835
+#define OP_TableLock 163 /* synopsis: iDb=P1 root=P2 write=P3 */
15836
+#define OP_VBegin 164
15837
+#define OP_VCreate 165
15838
+#define OP_VDestroy 166
15839
+#define OP_VOpen 167
15840
+#define OP_VColumn 168 /* synopsis: r[P3]=vcolumn(P2) */
15841
+#define OP_VRename 169
15842
+#define OP_Pagecount 170
15843
+#define OP_MaxPgcnt 171
15844
+#define OP_Trace 172
15845
+#define OP_CursorHint 173
15846
+#define OP_ReleaseReg 174 /* synopsis: release r[P1@P2] mask P3 */
15847
+#define OP_Noop 175
15848
+#define OP_Explain 176
15849
+#define OP_Abortable 177
1581615850
1581715851
/* Properties such as "out2" or "jump" that are specified in
1581815852
** comments following the "case" for each opcode in the vdbe.c
1581915853
** are encoded into bitvectors as follows:
1582015854
*/
@@ -15839,17 +15873,17 @@
1583915873
/* 88 */ 0x20, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\
1584015874
/* 96 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x26, 0x26,\
1584115875
/* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x00,\
1584215876
/* 112 */ 0x12, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\
1584315877
/* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15844
-/* 128 */ 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x10,\
15845
-/* 136 */ 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,\
15846
-/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00,\
15847
-/* 152 */ 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15878
+/* 128 */ 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,\
15879
+/* 136 */ 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00,\
15880
+/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10,\
15881
+/* 152 */ 0x00, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,\
1584815882
/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15849
-/* 168 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
15850
-/* 176 */ 0x00,}
15883
+/* 168 */ 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00,\
15884
+/* 176 */ 0x00, 0x00,}
1585115885
1585215886
/* The sqlite3P2Values() routine is able to run faster if it knows
1585315887
** the value of the largest JUMP opcode. The smaller the maximum
1585415888
** JUMP opcode the better, so the mkopcodeh.tcl script that
1585515889
** generated this include file strives to group all JUMP opcodes
@@ -17285,10 +17319,13 @@
1728517319
** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions
1728617320
** and functions like sqlite_version() that can change, but not during
1728717321
** a single query. The iArg is ignored. The user-data is always set
1728817322
** to a NULL pointer. The bNC parameter is not used.
1728917323
**
17324
+** MFUNCTION(zName, nArg, xPtr, xFunc)
17325
+** For math-library functions. xPtr is an arbitrary pointer.
17326
+**
1729017327
** PURE_DATE(zName, nArg, iArg, bNC, xFunc)
1729117328
** Used for "pure" date/time functions, this macro is like DFUNCTION
1729217329
** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is
1729317330
** ignored and the user-data for these functions is set to an
1729417331
** arbitrary non-NULL pointer. The bNC parameter is not used.
@@ -17320,10 +17357,13 @@
1732017357
{nArg, SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
1732117358
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, 0, #zName, {0} }
1732217359
#define SFUNCTION(zName, nArg, iArg, bNC, xFunc) \
1732317360
{nArg, SQLITE_UTF8|SQLITE_DIRECTONLY|SQLITE_FUNC_UNSAFE, \
1732417361
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, 0, #zName, {0} }
17362
+#define MFUNCTION(zName, nArg, xPtr, xFunc) \
17363
+ {nArg, SQLITE_FUNC_CONSTANT|SQLITE_UTF8, \
17364
+ xPtr, 0, xFunc, 0, 0, 0, #zName, {0} }
1732517365
#define INLINE_FUNC(zName, nArg, iArg, mFlags) \
1732617366
{nArg, SQLITE_UTF8|SQLITE_FUNC_INLINE|SQLITE_FUNC_CONSTANT|(mFlags), \
1732717367
SQLITE_INT_TO_PTR(iArg), 0, noopFunc, 0, 0, 0, #zName, {0} }
1732817368
#define TEST_FUNC(zName, nArg, iArg, mFlags) \
1732917369
{nArg, SQLITE_UTF8|SQLITE_FUNC_INTERNAL|SQLITE_FUNC_TEST| \
@@ -17719,20 +17759,26 @@
1771917759
** occurs. IGNORE means that the particular row that caused the constraint
1772017760
** error is not inserted or updated. Processing continues and no error
1772117761
** is returned. REPLACE means that preexisting database rows that caused
1772217762
** a UNIQUE constraint violation are removed so that the new insert or
1772317763
** update can proceed. Processing continues and no error is reported.
17764
+** UPDATE applies to insert operations only and means that the insert
17765
+** is omitted and the DO UPDATE clause of an upsert is run instead.
1772417766
**
17725
-** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
17767
+** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys.
1772617768
** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the
1772717769
** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign
17728
-** key is set to NULL. CASCADE means that a DELETE or UPDATE of the
17770
+** key is set to NULL. SETDFLT means that the foreign key is set
17771
+** to its default value. CASCADE means that a DELETE or UPDATE of the
1772917772
** referenced table row is propagated into the row that holds the
1773017773
** foreign key.
17774
+**
17775
+** The OE_Default value is a place holder that means to use whatever
17776
+** conflict resolution algorthm is required from context.
1773117777
**
1773217778
** The following symbolic values are used to record which type
17733
-** of action to take.
17779
+** of conflict resolution action to take.
1773417780
*/
1773517781
#define OE_None 0 /* There is no constraint to check */
1773617782
#define OE_Rollback 1 /* Fail the operation and rollback the transaction */
1773717783
#define OE_Abort 2 /* Back out changes but do no rollback transaction */
1773817784
#define OE_Fail 3 /* Stop the operation but leave all prior changes */
@@ -18482,19 +18528,25 @@
1848218528
** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The
1848318529
** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the
1848418530
** WHERE clause is omitted.
1848518531
*/
1848618532
struct Upsert {
18487
- ExprList *pUpsertTarget; /* Optional description of conflicting index */
18533
+ ExprList *pUpsertTarget; /* Optional description of conflict target */
1848818534
Expr *pUpsertTargetWhere; /* WHERE clause for partial index targets */
1848918535
ExprList *pUpsertSet; /* The SET clause from an ON CONFLICT UPDATE */
1849018536
Expr *pUpsertWhere; /* WHERE clause for the ON CONFLICT UPDATE */
18491
- /* The fields above comprise the parse tree for the upsert clause.
18492
- ** The fields below are used to transfer information from the INSERT
18493
- ** processing down into the UPDATE processing while generating code.
18494
- ** Upsert owns the memory allocated above, but not the memory below. */
18495
- Index *pUpsertIdx; /* Constraint that pUpsertTarget identifies */
18537
+ Upsert *pNextUpsert; /* Next ON CONFLICT clause in the list */
18538
+ u8 isDoUpdate; /* True for DO UPDATE. False for DO NOTHING */
18539
+ /* Above this point is the parse tree for the ON CONFLICT clauses.
18540
+ ** The next group of fields stores intermediate data. */
18541
+ void *pToFree; /* Free memory when deleting the Upsert object */
18542
+ /* All fields above are owned by the Upsert object and must be freed
18543
+ ** when the Upsert is destroyed. The fields below are used to transfer
18544
+ ** information from the INSERT processing down into the UPDATE processing
18545
+ ** while generating code. The fields below are owned by the INSERT
18546
+ ** statement and will be freed by INSERT processing. */
18547
+ Index *pUpsertIdx; /* UNIQUE constraint specified by pUpsertTarget */
1849618548
SrcList *pUpsertSrc; /* Table to be updated */
1849718549
int regData; /* First register holding array of VALUES */
1849818550
int iDataCur; /* Index of the data cursor */
1849918551
int iIdxCur; /* Index of the first index cursor */
1850018552
};
@@ -18932,10 +18984,11 @@
1893218984
#define OPFLAG_P2ISREG 0x10 /* P2 to OP_Open** is a register number */
1893318985
#define OPFLAG_PERMUTE 0x01 /* OP_Compare: use the permutation */
1893418986
#define OPFLAG_SAVEPOSITION 0x02 /* OP_Delete/Insert: save cursor pos */
1893518987
#define OPFLAG_AUXDELETE 0x04 /* OP_Delete: index in a DELETE op */
1893618988
#define OPFLAG_NOCHNG_MAGIC 0x6d /* OP_MakeRecord: serialtype 10 is ok */
18989
+#define OPFLAG_PREFORMAT 0x80 /* OP_Insert uses preformatted cell */
1893718990
1893818991
/*
1893918992
* Each trigger present in the database schema is stored as an instance of
1894018993
* struct Trigger.
1894118994
*
@@ -20029,11 +20082,10 @@
2002920082
SQLITE_PRIVATE const char sqlite3StrBINARY[];
2003020083
SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[];
2003120084
SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[];
2003220085
SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config;
2003320086
SQLITE_PRIVATE FuncDefHash sqlite3BuiltinFunctions;
20034
-SQLITE_API extern u32 sqlite3_unsupported_selecttrace;
2003520087
#ifndef SQLITE_OMIT_WSD
2003620088
SQLITE_PRIVATE int sqlite3PendingByte;
2003720089
#endif
2003820090
#endif /* SQLITE_AMALGAMATION */
2003920091
#ifdef VDBE_PROFILE
@@ -20240,19 +20292,23 @@
2024020292
#else
2024120293
#define sqlite3WithPush(x,y,z)
2024220294
#define sqlite3WithDelete(x,y)
2024320295
#endif
2024420296
#ifndef SQLITE_OMIT_UPSERT
20245
-SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*);
20297
+SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
2024620298
SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
2024720299
SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
2024820300
SQLITE_PRIVATE int sqlite3UpsertAnalyzeTarget(Parse*,SrcList*,Upsert*);
2024920301
SQLITE_PRIVATE void sqlite3UpsertDoUpdate(Parse*,Upsert*,Table*,Index*,int);
20302
+SQLITE_PRIVATE Upsert *sqlite3UpsertOfIndex(Upsert*,Index*);
20303
+SQLITE_PRIVATE int sqlite3UpsertNextIsIPK(Upsert*);
2025020304
#else
20251
-#define sqlite3UpsertNew(v,w,x,y,z) ((Upsert*)0)
20305
+#define sqlite3UpsertNew(u,v,w,x,y,z) ((Upsert*)0)
2025220306
#define sqlite3UpsertDelete(x,y)
20253
-#define sqlite3UpsertDup(x,y) ((Upsert*)0)
20307
+#define sqlite3UpsertDup(x,y) ((Upsert*)0)
20308
+#define sqlite3UpsertOfIndex(x,y) ((Upsert*)0)
20309
+#define sqlite3UpsertNextIsIPK(x) 0
2025420310
#endif
2025520311
2025620312
2025720313
/* Declarations for functions in fkey.c. All of these are replaced by
2025820314
** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
@@ -20744,13 +20800,14 @@
2074420800
#ifndef SQLITE_OMIT_WSD
2074520801
SQLITE_PRIVATE int sqlite3PendingByte = 0x40000000;
2074620802
#endif
2074720803
2074820804
/*
20749
-** Flags for select tracing and the ".selecttrace" macro of the CLI
20805
+** Tracing flags set by SQLITE_TESTCTRL_TRACEFLAGS.
2075020806
*/
20751
-SQLITE_API u32 sqlite3_unsupported_selecttrace = 0;
20807
+SQLITE_PRIVATE u32 sqlite3SelectTrace = 0;
20808
+SQLITE_PRIVATE u32 sqlite3WhereTrace = 0;
2075220809
2075320810
/* #include "opcodes.h" */
2075420811
/*
2075520812
** Properties of opcodes. The OPFLG_INITIALIZER macro is
2075620813
** created by mkopcodeh.awk during compilation. Data is obtained
@@ -23170,10 +23227,12 @@
2317023227
SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
2317123228
if( id->pMethods==0 ) return SQLITE_NOTFOUND;
2317223229
#ifdef SQLITE_TEST
2317323230
if( op!=SQLITE_FCNTL_COMMIT_PHASETWO
2317423231
&& op!=SQLITE_FCNTL_LOCK_TIMEOUT
23232
+ && op!=SQLITE_FCNTL_CKPT_DONE
23233
+ && op!=SQLITE_FCNTL_CKPT_START
2317523234
){
2317623235
/* Faults are not injected into COMMIT_PHASETWO because, assuming SQLite
2317723236
** is using a regular VFS, it is called after the corresponding
2317823237
** transaction has been committed. Injecting a fault at this point
2317923238
** confuses the test scripts - the COMMIT comand returns SQLITE_NOMEM
@@ -23180,11 +23239,16 @@
2318023239
** but the transaction is committed anyway.
2318123240
**
2318223241
** The core must call OsFileControl() though, not OsFileControlHint(),
2318323242
** as if a custom VFS (e.g. zipvfs) returns an error here, it probably
2318423243
** means the commit really has failed and an error should be returned
23185
- ** to the user. */
23244
+ ** to the user.
23245
+ **
23246
+ ** The CKPT_DONE and CKPT_START file-controls are write-only signals
23247
+ ** to the cksumvfs. Their return code is meaningless and is ignored
23248
+ ** by the SQLite core, so there is no point in simulating OOMs for them.
23249
+ */
2318623250
DO_OS_MALLOC_TEST(id);
2318723251
}
2318823252
#endif
2318923253
return id->pMethods->xFileControl(id, op, pArg);
2319023254
}
@@ -33371,64 +33435,65 @@
3337133435
/* 118 */ "SeekScan" OpHelp("Scan-ahead up to P1 rows"),
3337233436
/* 119 */ "SeekHit" OpHelp("set P2<=seekHit<=P3"),
3337333437
/* 120 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"),
3337433438
/* 121 */ "NewRowid" OpHelp("r[P2]=rowid"),
3337533439
/* 122 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
33376
- /* 123 */ "Delete" OpHelp(""),
33377
- /* 124 */ "ResetCount" OpHelp(""),
33378
- /* 125 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
33379
- /* 126 */ "SorterData" OpHelp("r[P2]=data"),
33380
- /* 127 */ "RowData" OpHelp("r[P2]=data"),
33381
- /* 128 */ "Rowid" OpHelp("r[P2]=rowid"),
33382
- /* 129 */ "NullRow" OpHelp(""),
33383
- /* 130 */ "SeekEnd" OpHelp(""),
33384
- /* 131 */ "IdxInsert" OpHelp("key=r[P2]"),
33385
- /* 132 */ "SorterInsert" OpHelp("key=r[P2]"),
33386
- /* 133 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
33387
- /* 134 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
33388
- /* 135 */ "IdxRowid" OpHelp("r[P2]=rowid"),
33389
- /* 136 */ "FinishSeek" OpHelp(""),
33390
- /* 137 */ "Destroy" OpHelp(""),
33391
- /* 138 */ "Clear" OpHelp(""),
33392
- /* 139 */ "ResetSorter" OpHelp(""),
33393
- /* 140 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"),
33394
- /* 141 */ "SqlExec" OpHelp(""),
33395
- /* 142 */ "ParseSchema" OpHelp(""),
33396
- /* 143 */ "LoadAnalysis" OpHelp(""),
33397
- /* 144 */ "DropTable" OpHelp(""),
33398
- /* 145 */ "DropIndex" OpHelp(""),
33399
- /* 146 */ "DropTrigger" OpHelp(""),
33400
- /* 147 */ "IntegrityCk" OpHelp(""),
33401
- /* 148 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
33402
- /* 149 */ "Param" OpHelp(""),
33440
+ /* 123 */ "RowCell" OpHelp(""),
33441
+ /* 124 */ "Delete" OpHelp(""),
33442
+ /* 125 */ "ResetCount" OpHelp(""),
33443
+ /* 126 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
33444
+ /* 127 */ "SorterData" OpHelp("r[P2]=data"),
33445
+ /* 128 */ "RowData" OpHelp("r[P2]=data"),
33446
+ /* 129 */ "Rowid" OpHelp("r[P2]=rowid"),
33447
+ /* 130 */ "NullRow" OpHelp(""),
33448
+ /* 131 */ "SeekEnd" OpHelp(""),
33449
+ /* 132 */ "IdxInsert" OpHelp("key=r[P2]"),
33450
+ /* 133 */ "SorterInsert" OpHelp("key=r[P2]"),
33451
+ /* 134 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
33452
+ /* 135 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
33453
+ /* 136 */ "IdxRowid" OpHelp("r[P2]=rowid"),
33454
+ /* 137 */ "FinishSeek" OpHelp(""),
33455
+ /* 138 */ "Destroy" OpHelp(""),
33456
+ /* 139 */ "Clear" OpHelp(""),
33457
+ /* 140 */ "ResetSorter" OpHelp(""),
33458
+ /* 141 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"),
33459
+ /* 142 */ "SqlExec" OpHelp(""),
33460
+ /* 143 */ "ParseSchema" OpHelp(""),
33461
+ /* 144 */ "LoadAnalysis" OpHelp(""),
33462
+ /* 145 */ "DropTable" OpHelp(""),
33463
+ /* 146 */ "DropIndex" OpHelp(""),
33464
+ /* 147 */ "DropTrigger" OpHelp(""),
33465
+ /* 148 */ "IntegrityCk" OpHelp(""),
33466
+ /* 149 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
3340333467
/* 150 */ "Real" OpHelp("r[P2]=P4"),
33404
- /* 151 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
33405
- /* 152 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
33406
- /* 153 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
33407
- /* 154 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
33408
- /* 155 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
33409
- /* 156 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"),
33410
- /* 157 */ "AggValue" OpHelp("r[P3]=value N=P2"),
33411
- /* 158 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
33412
- /* 159 */ "Expire" OpHelp(""),
33413
- /* 160 */ "CursorLock" OpHelp(""),
33414
- /* 161 */ "CursorUnlock" OpHelp(""),
33415
- /* 162 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
33416
- /* 163 */ "VBegin" OpHelp(""),
33417
- /* 164 */ "VCreate" OpHelp(""),
33418
- /* 165 */ "VDestroy" OpHelp(""),
33419
- /* 166 */ "VOpen" OpHelp(""),
33420
- /* 167 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
33421
- /* 168 */ "VRename" OpHelp(""),
33422
- /* 169 */ "Pagecount" OpHelp(""),
33423
- /* 170 */ "MaxPgcnt" OpHelp(""),
33424
- /* 171 */ "Trace" OpHelp(""),
33425
- /* 172 */ "CursorHint" OpHelp(""),
33426
- /* 173 */ "ReleaseReg" OpHelp("release r[P1@P2] mask P3"),
33427
- /* 174 */ "Noop" OpHelp(""),
33428
- /* 175 */ "Explain" OpHelp(""),
33429
- /* 176 */ "Abortable" OpHelp(""),
33468
+ /* 151 */ "Param" OpHelp(""),
33469
+ /* 152 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
33470
+ /* 153 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
33471
+ /* 154 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
33472
+ /* 155 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
33473
+ /* 156 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
33474
+ /* 157 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"),
33475
+ /* 158 */ "AggValue" OpHelp("r[P3]=value N=P2"),
33476
+ /* 159 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
33477
+ /* 160 */ "Expire" OpHelp(""),
33478
+ /* 161 */ "CursorLock" OpHelp(""),
33479
+ /* 162 */ "CursorUnlock" OpHelp(""),
33480
+ /* 163 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
33481
+ /* 164 */ "VBegin" OpHelp(""),
33482
+ /* 165 */ "VCreate" OpHelp(""),
33483
+ /* 166 */ "VDestroy" OpHelp(""),
33484
+ /* 167 */ "VOpen" OpHelp(""),
33485
+ /* 168 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
33486
+ /* 169 */ "VRename" OpHelp(""),
33487
+ /* 170 */ "Pagecount" OpHelp(""),
33488
+ /* 171 */ "MaxPgcnt" OpHelp(""),
33489
+ /* 172 */ "Trace" OpHelp(""),
33490
+ /* 173 */ "CursorHint" OpHelp(""),
33491
+ /* 174 */ "ReleaseReg" OpHelp("release r[P1@P2] mask P3"),
33492
+ /* 175 */ "Noop" OpHelp(""),
33493
+ /* 176 */ "Explain" OpHelp(""),
33494
+ /* 177 */ "Abortable" OpHelp(""),
3343033495
};
3343133496
return azName[i];
3343233497
}
3343333498
#endif
3343433499
@@ -64147,10 +64212,11 @@
6414764212
BtShared *pNext; /* Next on a list of sharable BtShared structs */
6414864213
BtLock *pLock; /* List of locks held on this shared-btree struct */
6414964214
Btree *pWriter; /* Btree with currently open write transaction */
6415064215
#endif
6415164216
u8 *pTmpSpace; /* Temp space sufficient to hold a single cell */
64217
+ int nPreformatSize; /* Size of last cell written by TransferRow() */
6415264218
};
6415364219
6415464220
/*
6415564221
** Allowed values for BtShared.btsFlags
6415664222
*/
@@ -65859,10 +65925,28 @@
6585965925
}else{
6586065926
pInfo->nLocal = (u16)minLocal;
6586165927
}
6586265928
pInfo->nSize = (u16)(&pInfo->pPayload[pInfo->nLocal] - pCell) + 4;
6586365929
}
65930
+
65931
+/*
65932
+** Given a record with nPayload bytes of payload stored within btree
65933
+** page pPage, return the number of bytes of payload stored locally.
65934
+*/
65935
+static int btreePayloadToLocal(MemPage *pPage, i64 nPayload){
65936
+ int maxLocal; /* Maximum amount of payload held locally */
65937
+ maxLocal = pPage->maxLocal;
65938
+ if( nPayload<=maxLocal ){
65939
+ return nPayload;
65940
+ }else{
65941
+ int minLocal; /* Minimum amount of payload held locally */
65942
+ int surplus; /* Overflow payload available for local storage */
65943
+ minLocal = pPage->minLocal;
65944
+ surplus = minLocal + (nPayload - minLocal)%(pPage->pBt->usableSize-4);
65945
+ return ( surplus <= maxLocal ) ? surplus : minLocal;
65946
+ }
65947
+}
6586465948
6586565949
/*
6586665950
** The following routines are implementations of the MemPage.xParseCell()
6586765951
** method.
6586865952
**
@@ -73377,11 +73461,12 @@
7337773461
Btree *p = pCur->pBtree;
7337873462
BtShared *pBt = p->pBt;
7337973463
unsigned char *oldCell;
7338073464
unsigned char *newCell = 0;
7338173465
73382
- assert( (flags & (BTREE_SAVEPOSITION|BTREE_APPEND))==flags );
73466
+ assert( (flags & (BTREE_SAVEPOSITION|BTREE_APPEND|BTREE_PREFORMAT))==flags );
73467
+ assert( (flags & BTREE_PREFORMAT)==0 || seekResult || pCur->pKeyInfo==0 );
7338373468
7338473469
if( pCur->eState==CURSOR_FAULT ){
7338573470
assert( pCur->skipNext!=SQLITE_OK );
7338673471
return pCur->skipNext;
7338773472
}
@@ -73395,11 +73480,11 @@
7339573480
/* Assert that the caller has been consistent. If this cursor was opened
7339673481
** expecting an index b-tree, then the caller should be inserting blob
7339773482
** keys with no associated data. If the cursor was opened expecting an
7339873483
** intkey table, the caller should be inserting integer keys with a
7339973484
** blob of associated data. */
73400
- assert( (pX->pKey==0)==(pCur->pKeyInfo==0) );
73485
+ assert( (flags & BTREE_PREFORMAT) || (pX->pKey==0)==(pCur->pKeyInfo==0) );
7340173486
7340273487
/* Save the positions of any other cursors open on this table.
7340373488
**
7340473489
** In some cases, the call to btreeMoveto() below is a no-op. For
7340573490
** example, when inserting data into a table with auto-generated integer
@@ -73505,11 +73590,11 @@
7350573590
assert( pCur->eState==CURSOR_VALID
7350673591
|| (pCur->eState==CURSOR_INVALID && loc)
7350773592
|| CORRUPT_DB );
7350873593
7350973594
pPage = pCur->pPage;
73510
- assert( pPage->intKey || pX->nKey>=0 );
73595
+ assert( pPage->intKey || pX->nKey>=0 || (flags & BTREE_PREFORMAT) );
7351173596
assert( pPage->leaf || !pPage->intKey );
7351273597
if( pPage->nFree<0 ){
7351373598
if( pCur->eState>CURSOR_INVALID ){
7351473599
rc = SQLITE_CORRUPT_BKPT;
7351573600
}else{
@@ -73522,11 +73607,25 @@
7352273607
pCur->pgnoRoot, pX->nKey, pX->nData, pPage->pgno,
7352373608
loc==0 ? "overwrite" : "new entry"));
7352473609
assert( pPage->isInit );
7352573610
newCell = pBt->pTmpSpace;
7352673611
assert( newCell!=0 );
73527
- rc = fillInCell(pPage, newCell, pX, &szNew);
73612
+ if( flags & BTREE_PREFORMAT ){
73613
+ rc = SQLITE_OK;
73614
+ szNew = pBt->nPreformatSize;
73615
+ if( szNew<4 ) szNew = 4;
73616
+ if( ISAUTOVACUUM && szNew>pPage->maxLocal ){
73617
+ CellInfo info;
73618
+ pPage->xParseCell(pPage, newCell, &info);
73619
+ if( info.nPayload!=info.nLocal ){
73620
+ Pgno ovfl = get4byte(&newCell[szNew-4]);
73621
+ ptrmapPut(pBt, ovfl, PTRMAP_OVERFLOW1, pPage->pgno, &rc);
73622
+ }
73623
+ }
73624
+ }else{
73625
+ rc = fillInCell(pPage, newCell, pX, &szNew);
73626
+ }
7352873627
if( rc ) goto end_insert;
7352973628
assert( szNew==pPage->xCellSize(pPage, newCell) );
7353073629
assert( szNew <= MX_CELL_SIZE(pBt) );
7353173630
idx = pCur->ix;
7353273631
if( loc==0 ){
@@ -73626,10 +73725,112 @@
7362673725
}
7362773726
}
7362873727
assert( pCur->iPage<0 || pCur->pPage->nOverflow==0 );
7362973728
7363073729
end_insert:
73730
+ return rc;
73731
+}
73732
+
73733
+/*
73734
+** This function is used as part of copying the current row from cursor
73735
+** pSrc into cursor pDest. If the cursors are open on intkey tables, then
73736
+** parameter iKey is used as the rowid value when the record is copied
73737
+** into pDest. Otherwise, the record is copied verbatim.
73738
+**
73739
+** This function does not actually write the new value to cursor pDest.
73740
+** Instead, it creates and populates any required overflow pages and
73741
+** writes the data for the new cell into the BtShared.pTmpSpace buffer
73742
+** for the destination database. The size of the cell, in bytes, is left
73743
+** in BtShared.nPreformatSize. The caller completes the insertion by
73744
+** calling sqlite3BtreeInsert() with the BTREE_PREFORMAT flag specified.
73745
+**
73746
+** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
73747
+*/
73748
+SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor *pDest, BtCursor *pSrc, i64 iKey){
73749
+ int rc = SQLITE_OK;
73750
+ BtShared *pBt = pDest->pBt;
73751
+ u8 *aOut = pBt->pTmpSpace; /* Pointer to next output buffer */
73752
+ const u8 *aIn; /* Pointer to next input buffer */
73753
+ int nIn; /* Size of input buffer aIn[] */
73754
+ int nRem; /* Bytes of data still to copy */
73755
+
73756
+ getCellInfo(pSrc);
73757
+ aOut += putVarint32(aOut, pSrc->info.nPayload);
73758
+ if( pDest->pKeyInfo==0 ) aOut += putVarint(aOut, iKey);
73759
+ nIn = pSrc->info.nLocal;
73760
+ aIn = pSrc->info.pPayload;
73761
+ nRem = pSrc->info.nPayload;
73762
+ if( nIn==nRem && nIn<pDest->pPage->maxLocal ){
73763
+ memcpy(aOut, aIn, nIn);
73764
+ pBt->nPreformatSize = nIn + (aOut - pBt->pTmpSpace);
73765
+ }else{
73766
+ Pager *pSrcPager = pSrc->pBt->pPager;
73767
+ u8 *pPgnoOut = 0;
73768
+ Pgno ovflIn = 0;
73769
+ DbPage *pPageIn = 0;
73770
+ MemPage *pPageOut = 0;
73771
+ int nOut; /* Size of output buffer aOut[] */
73772
+
73773
+ nOut = btreePayloadToLocal(pDest->pPage, pSrc->info.nPayload);
73774
+ pBt->nPreformatSize = nOut + (aOut - pBt->pTmpSpace);
73775
+ if( nOut<pSrc->info.nPayload ){
73776
+ pPgnoOut = &aOut[nOut];
73777
+ pBt->nPreformatSize += 4;
73778
+ }
73779
+
73780
+ if( nRem>nIn ){
73781
+ ovflIn = get4byte(&pSrc->info.pPayload[nIn]);
73782
+ }
73783
+
73784
+ do {
73785
+ nRem -= nOut;
73786
+ do{
73787
+ assert( nOut>0 );
73788
+ if( nIn>0 ){
73789
+ int nCopy = MIN(nOut, nIn);
73790
+ memcpy(aOut, aIn, nCopy);
73791
+ nOut -= nCopy;
73792
+ nIn -= nCopy;
73793
+ aOut += nCopy;
73794
+ aIn += nCopy;
73795
+ }
73796
+ if( nOut>0 ){
73797
+ sqlite3PagerUnref(pPageIn);
73798
+ pPageIn = 0;
73799
+ rc = sqlite3PagerGet(pSrcPager, ovflIn, &pPageIn, PAGER_GET_READONLY);
73800
+ if( rc==SQLITE_OK ){
73801
+ aIn = (const u8*)sqlite3PagerGetData(pPageIn);
73802
+ ovflIn = get4byte(aIn);
73803
+ aIn += 4;
73804
+ nIn = pSrc->pBt->usableSize - 4;
73805
+ }
73806
+ }
73807
+ }while( rc==SQLITE_OK && nOut>0 );
73808
+
73809
+ if( rc==SQLITE_OK && nRem>0 ){
73810
+ Pgno pgnoNew;
73811
+ MemPage *pNew = 0;
73812
+ rc = allocateBtreePage(pBt, &pNew, &pgnoNew, 0, 0);
73813
+ put4byte(pPgnoOut, pgnoNew);
73814
+ if( ISAUTOVACUUM && pPageOut ){
73815
+ ptrmapPut(pBt, pgnoNew, PTRMAP_OVERFLOW2, pPageOut->pgno, &rc);
73816
+ }
73817
+ releasePage(pPageOut);
73818
+ pPageOut = pNew;
73819
+ if( pPageOut ){
73820
+ pPgnoOut = pPageOut->aData;
73821
+ put4byte(pPgnoOut, 0);
73822
+ aOut = &pPgnoOut[4];
73823
+ nOut = MIN(pBt->usableSize - 4, nRem);
73824
+ }
73825
+ }
73826
+ }while( nRem>0 && rc==SQLITE_OK );
73827
+
73828
+ releasePage(pPageOut);
73829
+ sqlite3PagerUnref(pPageIn);
73830
+ }
73831
+
7363173832
return rc;
7363273833
}
7363373834
7363473835
/*
7363573836
** Delete the entry that the cursor is pointing to.
@@ -90701,11 +90902,12 @@
9070190902
}else{
9070290903
x.nZero = 0;
9070390904
}
9070490905
x.pKey = 0;
9070590906
rc = sqlite3BtreeInsert(pC->uc.pCursor, &x,
90706
- (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION)), seekResult
90907
+ (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION|OPFLAG_PREFORMAT)),
90908
+ seekResult
9070790909
);
9070890910
pC->deferredMoveto = 0;
9070990911
pC->cacheStatus = CACHE_STALE;
9071090912
9071190913
/* Invoke the update-hook if required. */
@@ -90717,10 +90919,35 @@
9071790919
(pOp->p5 & OPFLAG_ISUPDATE) ? SQLITE_UPDATE : SQLITE_INSERT,
9071890920
zDb, pTab->zName, x.nKey);
9071990921
}
9072090922
break;
9072190923
}
90924
+
90925
+/* Opcode: RowCell P1 P2 P3 * *
90926
+**
90927
+** P1 and P2 are both open cursors. Both must be opened on the same type
90928
+** of table - intkey or index. This opcode is used as part of copying
90929
+** the current row from P2 into P1. If the cursors are opened on intkey
90930
+** tables, register P3 contains the rowid to use with the new record in
90931
+** P1. If they are opened on index tables, P3 is not used.
90932
+**
90933
+** This opcode must be followed by either an Insert or InsertIdx opcode
90934
+** with the OPFLAG_PREFORMAT flag set to complete the insert operation.
90935
+*/
90936
+case OP_RowCell: {
90937
+ VdbeCursor *pDest; /* Cursor to write to */
90938
+ VdbeCursor *pSrc; /* Cursor to read from */
90939
+ i64 iKey; /* Rowid value to insert with */
90940
+ assert( pOp[1].opcode==OP_Insert || pOp[1].opcode==OP_IdxInsert );
90941
+ assert( pOp[1].p5 & OPFLAG_PREFORMAT );
90942
+ pDest = p->apCsr[pOp->p1];
90943
+ pSrc = p->apCsr[pOp->p2];
90944
+ iKey = pOp->p3 ? aMem[pOp->p3].u.i : 0;
90945
+ rc = sqlite3BtreeTransferRow(pDest->uc.pCursor, pSrc->uc.pCursor, iKey);
90946
+ if( rc!=SQLITE_OK ) goto abort_due_to_error;
90947
+ break;
90948
+};
9072290949
9072390950
/* Opcode: Delete P1 P2 P3 P4 P5
9072490951
**
9072590952
** Delete the record at which the P1 cursor is currently pointing.
9072690953
**
@@ -91373,11 +91600,11 @@
9137391600
pC = p->apCsr[pOp->p1];
9137491601
sqlite3VdbeIncrWriteCounter(p, pC);
9137591602
assert( pC!=0 );
9137691603
assert( !isSorter(pC) );
9137791604
pIn2 = &aMem[pOp->p2];
91378
- assert( pIn2->flags & MEM_Blob );
91605
+ assert( (pIn2->flags & MEM_Blob) || (pOp->p5 & OPFLAG_PREFORMAT) );
9137991606
if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++;
9138091607
assert( pC->eCurType==CURTYPE_BTREE );
9138191608
assert( pC->isTable==0 );
9138291609
rc = ExpandBlob(pIn2);
9138391610
if( rc ) goto abort_due_to_error;
@@ -91384,11 +91611,11 @@
9138491611
x.nKey = pIn2->n;
9138591612
x.pKey = pIn2->z;
9138691613
x.aMem = aMem + pOp->p3;
9138791614
x.nMem = (u16)pOp->p4.i;
9138891615
rc = sqlite3BtreeInsert(pC->uc.pCursor, &x,
91389
- (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION)),
91616
+ (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION|OPFLAG_PREFORMAT)),
9139091617
((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0)
9139191618
);
9139291619
assert( pC->deferredMoveto==0 );
9139391620
pC->cacheStatus = CACHE_STALE;
9139491621
if( rc) goto abort_due_to_error;
@@ -119441,10 +119668,197 @@
119441119668
}
119442119669
119443119670
*pIsNocase = (pDef->funcFlags & SQLITE_FUNC_CASE)==0;
119444119671
return 1;
119445119672
}
119673
+
119674
+/* Mathematical Constants */
119675
+#ifndef M_PI
119676
+# define M_PI 3.141592653589793238462643383279502884
119677
+#endif
119678
+#ifndef M_LN10
119679
+# define M_LN10 2.302585092994045684017991454684364208
119680
+#endif
119681
+#ifndef M_LN2
119682
+# define M_LN2 0.693147180559945309417232121458176568
119683
+#endif
119684
+
119685
+
119686
+/* Extra math functions that require linking with -lm
119687
+*/
119688
+#ifdef SQLITE_ENABLE_MATH_FUNCTIONS
119689
+/*
119690
+** Implementation SQL functions:
119691
+**
119692
+** ceil(X)
119693
+** ceiling(X)
119694
+** floor(X)
119695
+**
119696
+** The sqlite3_user_data() pointer is a pointer to the libm implementation
119697
+** of the underlying C function.
119698
+*/
119699
+static void ceilingFunc(
119700
+ sqlite3_context *context,
119701
+ int argc,
119702
+ sqlite3_value **argv
119703
+){
119704
+ assert( argc==1 );
119705
+ switch( sqlite3_value_numeric_type(argv[0]) ){
119706
+ case SQLITE_INTEGER: {
119707
+ sqlite3_result_int64(context, sqlite3_value_int64(argv[0]));
119708
+ break;
119709
+ }
119710
+ case SQLITE_FLOAT: {
119711
+ double (*x)(double) = (double(*)(double))sqlite3_user_data(context);
119712
+ sqlite3_result_double(context, x(sqlite3_value_double(argv[0])));
119713
+ break;
119714
+ }
119715
+ default: {
119716
+ break;
119717
+ }
119718
+ }
119719
+}
119720
+
119721
+/*
119722
+** Implementation of SQL functions:
119723
+**
119724
+** ln(X) - natural logarithm
119725
+** log(X) - log X base 10
119726
+** log10(X) - log X base 10
119727
+** log(B,X) - log X base B
119728
+*/
119729
+static void logFunc(
119730
+ sqlite3_context *context,
119731
+ int argc,
119732
+ sqlite3_value **argv
119733
+){
119734
+ double x, b, ans;
119735
+ assert( argc==1 || argc==2 );
119736
+ switch( sqlite3_value_numeric_type(argv[0]) ){
119737
+ case SQLITE_INTEGER:
119738
+ case SQLITE_FLOAT:
119739
+ x = sqlite3_value_double(argv[0]);
119740
+ if( x<0.0 ) return;
119741
+ break;
119742
+ default:
119743
+ return;
119744
+ }
119745
+ if( argc==2 ){
119746
+ switch( sqlite3_value_numeric_type(argv[0]) ){
119747
+ case SQLITE_INTEGER:
119748
+ case SQLITE_FLOAT:
119749
+ b = x;
119750
+ x = sqlite3_value_double(argv[1]);
119751
+ if( x<0.0 ) return;
119752
+ break;
119753
+ default:
119754
+ return;
119755
+ }
119756
+ ans = log(x)/log(b);
119757
+ }else{
119758
+ ans = log(x);
119759
+ switch( SQLITE_PTR_TO_INT(sqlite3_user_data(context)) ){
119760
+ case 1:
119761
+ /* Convert from natural logarithm to log base 10 */
119762
+ ans *= 1.0/M_LN10;
119763
+ break;
119764
+ case 2:
119765
+ /* Convert from natural logarithm to log base 2 */
119766
+ ans *= 1.0/M_LN2;
119767
+ break;
119768
+ default:
119769
+ break;
119770
+ }
119771
+ }
119772
+ sqlite3_result_double(context, ans);
119773
+}
119774
+
119775
+/*
119776
+** Functions to converts degrees to radians and radians to degrees.
119777
+*/
119778
+static double degToRad(double x){ return x*(M_PI/180.0); }
119779
+static double radToDeg(double x){ return x*(180.0/M_PI); }
119780
+
119781
+/*
119782
+** Implementation of 1-argument SQL math functions:
119783
+**
119784
+** exp(X) - Compute e to the X-th power
119785
+*/
119786
+static void math1Func(
119787
+ sqlite3_context *context,
119788
+ int argc,
119789
+ sqlite3_value **argv
119790
+){
119791
+ int type0;
119792
+ double v0, ans;
119793
+ double (*x)(double);
119794
+ assert( argc==1 );
119795
+ type0 = sqlite3_value_numeric_type(argv[0]);
119796
+ if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
119797
+ v0 = sqlite3_value_double(argv[0]);
119798
+ x = (double(*)(double))sqlite3_user_data(context);
119799
+ ans = x(v0);
119800
+ sqlite3_result_double(context, ans);
119801
+}
119802
+
119803
+/*
119804
+** Implementation of 2-argument SQL math functions:
119805
+**
119806
+** power(X,Y) - Compute X to the Y-th power
119807
+*/
119808
+static void math2Func(
119809
+ sqlite3_context *context,
119810
+ int argc,
119811
+ sqlite3_value **argv
119812
+){
119813
+ int type0, type1;
119814
+ double v0, v1, ans;
119815
+ double (*x)(double,double);
119816
+ assert( argc==2 );
119817
+ type0 = sqlite3_value_numeric_type(argv[0]);
119818
+ if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
119819
+ type1 = sqlite3_value_numeric_type(argv[1]);
119820
+ if( type1!=SQLITE_INTEGER && type1!=SQLITE_FLOAT ) return;
119821
+ v0 = sqlite3_value_double(argv[0]);
119822
+ v1 = sqlite3_value_double(argv[1]);
119823
+ x = (double(*)(double,double))sqlite3_user_data(context);
119824
+ ans = x(v0, v1);
119825
+ sqlite3_result_double(context, ans);
119826
+}
119827
+
119828
+/*
119829
+** Implementation of 2-argument SQL math functions:
119830
+**
119831
+** power(X,Y) - Compute X to the Y-th power
119832
+*/
119833
+static void piFunc(
119834
+ sqlite3_context *context,
119835
+ int argc,
119836
+ sqlite3_value **argv
119837
+){
119838
+ assert( argc==0 );
119839
+ sqlite3_result_double(context, M_PI);
119840
+}
119841
+
119842
+#endif /* SQLITE_ENABLE_MATH_FUNCTIONS */
119843
+
119844
+/*
119845
+** Implementation of sign(X) function.
119846
+*/
119847
+static void signFunc(
119848
+ sqlite3_context *context,
119849
+ int argc,
119850
+ sqlite3_value **argv
119851
+){
119852
+ int type0;
119853
+ double x;
119854
+ assert( argc==1 );
119855
+ type0 = sqlite3_value_numeric_type(argv[0]);
119856
+ if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
119857
+ x = sqlite3_value_double(argv[0]);
119858
+ sqlite3_result_int(context, x<0.0 ? -1 : x>0.0 ? +1 : 0);
119859
+}
119446119860
119447119861
/*
119448119862
** All of the FuncDef structures in the aBuiltinFunc[] array above
119449119863
** to the global function hash table. This occurs at start-time (as
119450119864
** a consequence of calling sqlite3_initialize()).
@@ -119560,10 +119974,47 @@
119560119974
#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
119561119975
FUNCTION(unknown, -1, 0, 0, unknownFunc ),
119562119976
#endif
119563119977
FUNCTION(coalesce, 1, 0, 0, 0 ),
119564119978
FUNCTION(coalesce, 0, 0, 0, 0 ),
119979
+#ifdef SQLITE_ENABLE_MATH_FUNCTIONS
119980
+ MFUNCTION(ceil, 1, ceil, ceilingFunc ),
119981
+ MFUNCTION(ceiling, 1, ceil, ceilingFunc ),
119982
+ MFUNCTION(floor, 1, floor, ceilingFunc ),
119983
+#if SQLITE_HAVE_C99_MATH_FUNCS
119984
+ MFUNCTION(trunc, 1, trunc, ceilingFunc ),
119985
+#endif
119986
+ FUNCTION(ln, 1, 0, 0, logFunc ),
119987
+ FUNCTION(log, 1, 1, 0, logFunc ),
119988
+ FUNCTION(log10, 1, 1, 0, logFunc ),
119989
+ FUNCTION(log2, 1, 2, 0, logFunc ),
119990
+ FUNCTION(log, 2, 0, 0, logFunc ),
119991
+ MFUNCTION(exp, 1, exp, math1Func ),
119992
+ MFUNCTION(pow, 2, pow, math2Func ),
119993
+ MFUNCTION(power, 2, pow, math2Func ),
119994
+ MFUNCTION(mod, 2, fmod, math2Func ),
119995
+ MFUNCTION(acos, 1, acos, math1Func ),
119996
+ MFUNCTION(asin, 1, asin, math1Func ),
119997
+ MFUNCTION(atan, 1, atan, math1Func ),
119998
+ MFUNCTION(atan2, 2, atan2, math2Func ),
119999
+ MFUNCTION(cos, 1, cos, math1Func ),
120000
+ MFUNCTION(sin, 1, sin, math1Func ),
120001
+ MFUNCTION(tan, 1, tan, math1Func ),
120002
+ MFUNCTION(cosh, 1, cosh, math1Func ),
120003
+ MFUNCTION(sinh, 1, sinh, math1Func ),
120004
+ MFUNCTION(tanh, 1, tanh, math1Func ),
120005
+#if SQLITE_HAVE_C99_MATH_FUNCS
120006
+ MFUNCTION(acosh, 1, acosh, math1Func ),
120007
+ MFUNCTION(asinh, 1, asinh, math1Func ),
120008
+ MFUNCTION(atanh, 1, atanh, math1Func ),
120009
+#endif
120010
+ MFUNCTION(sqrt, 1, sqrt, math1Func ),
120011
+ MFUNCTION(radians, 1, degToRad, math1Func ),
120012
+ MFUNCTION(degrees, 1, radToDeg, math1Func ),
120013
+ FUNCTION(pi, 0, 0, 0, piFunc ),
120014
+#endif /* SQLITE_ENABLE_MATH_FUNCTIONS */
120015
+ FUNCTION(sign, 1, 0, 0, signFunc ),
119565120016
INLINE_FUNC(coalesce, -1, INLINEFUNC_coalesce, 0 ),
119566120017
INLINE_FUNC(iif, 3, INLINEFUNC_iif, 0 ),
119567120018
};
119568120019
#ifndef SQLITE_OMIT_ALTERTABLE
119569120020
sqlite3AlterFunctions();
@@ -122018,10 +122469,11 @@
122018122469
}
122019122470
aRegIdx[i] = ++pParse->nMem; /* Register to store the table record */
122020122471
}
122021122472
#ifndef SQLITE_OMIT_UPSERT
122022122473
if( pUpsert ){
122474
+ Upsert *pNx;
122023122475
if( IsVirtual(pTab) ){
122024122476
sqlite3ErrorMsg(pParse, "UPSERT not implemented for virtual table \"%s\"",
122025122477
pTab->zName);
122026122478
goto insert_cleanup;
122027122479
}
@@ -122031,17 +122483,21 @@
122031122483
}
122032122484
if( sqlite3HasExplicitNulls(pParse, pUpsert->pUpsertTarget) ){
122033122485
goto insert_cleanup;
122034122486
}
122035122487
pTabList->a[0].iCursor = iDataCur;
122036
- pUpsert->pUpsertSrc = pTabList;
122037
- pUpsert->regData = regData;
122038
- pUpsert->iDataCur = iDataCur;
122039
- pUpsert->iIdxCur = iIdxCur;
122040
- if( pUpsert->pUpsertTarget ){
122041
- sqlite3UpsertAnalyzeTarget(pParse, pTabList, pUpsert);
122042
- }
122488
+ pNx = pUpsert;
122489
+ do{
122490
+ pNx->pUpsertSrc = pTabList;
122491
+ pNx->regData = regData;
122492
+ pNx->iDataCur = iDataCur;
122493
+ pNx->iIdxCur = iIdxCur;
122494
+ if( pNx->pUpsertTarget ){
122495
+ sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx);
122496
+ }
122497
+ pNx = pNx->pNextUpsert;
122498
+ }while( pNx!=0 );
122043122499
}
122044122500
#endif
122045122501
122046122502
122047122503
/* This is the top of the main insertion loop */
@@ -122441,10 +122897,74 @@
122441122897
testcase( w.eCode==CKCNSTRNT_COLUMN );
122442122898
testcase( w.eCode==CKCNSTRNT_ROWID );
122443122899
testcase( w.eCode==(CKCNSTRNT_ROWID|CKCNSTRNT_COLUMN) );
122444122900
return w.eCode!=0;
122445122901
}
122902
+
122903
+/*
122904
+** The sqlite3GenerateConstraintChecks() routine usually wants to visit
122905
+** the indexes of a table in the order provided in the Table->pIndex list.
122906
+** However, sometimes (rarely - when there is an upsert) it wants to visit
122907
+** the indexes in a different order. The following data structures accomplish
122908
+** this.
122909
+**
122910
+** The IndexIterator object is used to walk through all of the indexes
122911
+** of a table in either Index.pNext order, or in some other order established
122912
+** by an array of IndexListTerm objects.
122913
+*/
122914
+typedef struct IndexListTerm IndexListTerm;
122915
+typedef struct IndexIterator IndexIterator;
122916
+struct IndexIterator {
122917
+ int eType; /* 0 for Index.pNext list. 1 for an array of IndexListTerm */
122918
+ int i; /* Index of the current item from the list */
122919
+ union {
122920
+ struct { /* Use this object for eType==0: A Index.pNext list */
122921
+ Index *pIdx; /* The current Index */
122922
+ } lx;
122923
+ struct { /* Use this object for eType==1; Array of IndexListTerm */
122924
+ int nIdx; /* Size of the array */
122925
+ IndexListTerm *aIdx; /* Array of IndexListTerms */
122926
+ } ax;
122927
+ } u;
122928
+};
122929
+
122930
+/* When IndexIterator.eType==1, then each index is an array of instances
122931
+** of the following object
122932
+*/
122933
+struct IndexListTerm {
122934
+ Index *p; /* The index */
122935
+ int ix; /* Which entry in the original Table.pIndex list is this index*/
122936
+};
122937
+
122938
+/* Return the first index on the list */
122939
+static Index *indexIteratorFirst(IndexIterator *pIter, int *pIx){
122940
+ assert( pIter->i==0 );
122941
+ if( pIter->eType ){
122942
+ *pIx = pIter->u.ax.aIdx[0].ix;
122943
+ return pIter->u.ax.aIdx[0].p;
122944
+ }else{
122945
+ *pIx = 0;
122946
+ return pIter->u.lx.pIdx;
122947
+ }
122948
+}
122949
+
122950
+/* Return the next index from the list. Return NULL when out of indexes */
122951
+static Index *indexIteratorNext(IndexIterator *pIter, int *pIx){
122952
+ if( pIter->eType ){
122953
+ int i = ++pIter->i;
122954
+ if( i>=pIter->u.ax.nIdx ){
122955
+ *pIx = i;
122956
+ return 0;
122957
+ }
122958
+ *pIx = pIter->u.ax.aIdx[i].ix;
122959
+ return pIter->u.ax.aIdx[i].p;
122960
+ }else{
122961
+ ++(*pIx);
122962
+ pIter->u.lx.pIdx = pIter->u.lx.pIdx->pNext;
122963
+ return pIter->u.lx.pIdx;
122964
+ }
122965
+}
122446122966
122447122967
/*
122448122968
** Generate code to do constraint checks prior to an INSERT or an UPDATE
122449122969
** on table pTab.
122450122970
**
@@ -122550,32 +123070,33 @@
122550123070
int *aiChng, /* column i is unchanged if aiChng[i]<0 */
122551123071
Upsert *pUpsert /* ON CONFLICT clauses, if any. NULL otherwise */
122552123072
){
122553123073
Vdbe *v; /* VDBE under constrution */
122554123074
Index *pIdx; /* Pointer to one of the indices */
122555
- Index *pPk = 0; /* The PRIMARY KEY index */
123075
+ Index *pPk = 0; /* The PRIMARY KEY index for WITHOUT ROWID tables */
122556123076
sqlite3 *db; /* Database connection */
122557123077
int i; /* loop counter */
122558123078
int ix; /* Index loop counter */
122559123079
int nCol; /* Number of columns */
122560123080
int onError; /* Conflict resolution strategy */
122561123081
int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */
122562123082
int nPkField; /* Number of fields in PRIMARY KEY. 1 for ROWID tables */
122563
- Index *pUpIdx = 0; /* Index to which to apply the upsert */
122564
- u8 isUpdate; /* True if this is an UPDATE operation */
123083
+ Upsert *pUpsertClause = 0; /* The specific ON CONFLICT clause for pIdx */
123084
+ u8 isUpdate; /* True if this is an UPDATE operation */
122565123085
u8 bAffinityDone = 0; /* True if the OP_Affinity operation has been run */
122566
- int upsertBypass = 0; /* Address of Goto to bypass upsert subroutine */
122567
- int upsertJump = 0; /* Address of Goto that jumps into upsert subroutine */
123086
+ int upsertIpkReturn = 0; /* Address of Goto at end of IPK uniqueness check */
123087
+ int upsertIpkDelay = 0; /* Address of Goto to bypass initial IPK check */
122568123088
int ipkTop = 0; /* Top of the IPK uniqueness check */
122569123089
int ipkBottom = 0; /* OP_Goto at the end of the IPK uniqueness check */
122570123090
/* Variables associated with retesting uniqueness constraints after
122571123091
** replace triggers fire have run */
122572123092
int regTrigCnt; /* Register used to count replace trigger invocations */
122573123093
int addrRecheck = 0; /* Jump here to recheck all uniqueness constraints */
122574123094
int lblRecheckOk = 0; /* Each recheck jumps to this label if it passes */
122575123095
Trigger *pTrigger; /* List of DELETE triggers on the table pTab */
122576123096
int nReplaceTrig = 0; /* Number of replace triggers coded */
123097
+ IndexIterator sIdxIter; /* Index iterator */
122577123098
122578123099
isUpdate = regOldData!=0;
122579123100
db = pParse->db;
122580123101
v = pParse->pVdbe;
122581123102
assert( v!=0 );
@@ -122769,23 +123290,67 @@
122769123290
**
122770123291
** The ordering of (2) and (3) is accomplished by making sure the linked
122771123292
** list of indexes attached to a table puts all OE_Replace indexes last
122772123293
** in the list. See sqlite3CreateIndex() for where that happens.
122773123294
*/
122774
-
123295
+ sIdxIter.eType = 0;
123296
+ sIdxIter.i = 0;
123297
+ sIdxIter.u.ax.aIdx = 0; /* Silence harmless compiler warning */
123298
+ sIdxIter.u.lx.pIdx = pTab->pIndex;
122775123299
if( pUpsert ){
122776123300
if( pUpsert->pUpsertTarget==0 ){
122777
- /* An ON CONFLICT DO NOTHING clause, without a constraint-target.
122778
- ** Make all unique constraint resolution be OE_Ignore */
122779
- assert( pUpsert->pUpsertSet==0 );
122780
- overrideError = OE_Ignore;
122781
- pUpsert = 0;
122782
- }else if( (pUpIdx = pUpsert->pUpsertIdx)!=0 ){
122783
- /* If the constraint-target uniqueness check must be run first.
122784
- ** Jump to that uniqueness check now */
122785
- upsertJump = sqlite3VdbeAddOp0(v, OP_Goto);
122786
- VdbeComment((v, "UPSERT constraint goes first"));
123301
+ /* There is just on ON CONFLICT clause and it has no constraint-target */
123302
+ assert( pUpsert->pNextUpsert==0 );
123303
+ if( pUpsert->isDoUpdate==0 ){
123304
+ /* A single ON CONFLICT DO NOTHING clause, without a constraint-target.
123305
+ ** Make all unique constraint resolution be OE_Ignore */
123306
+ overrideError = OE_Ignore;
123307
+ pUpsert = 0;
123308
+ }else{
123309
+ /* A single ON CONFLICT DO UPDATE. Make all resolutions OE_Update */
123310
+ overrideError = OE_Update;
123311
+ }
123312
+ }else if( pTab->pIndex!=0 ){
123313
+ /* Otherwise, we'll need to run the IndexListTerm array version of the
123314
+ ** iterator to ensure that all of the ON CONFLICT conditions are
123315
+ ** checked first and in order. */
123316
+ int nIdx, jj;
123317
+ u64 nByte;
123318
+ Upsert *pTerm;
123319
+ u8 *bUsed;
123320
+ for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){
123321
+ assert( aRegIdx[nIdx]>0 );
123322
+ }
123323
+ sIdxIter.eType = 1;
123324
+ sIdxIter.u.ax.nIdx = nIdx;
123325
+ nByte = (sizeof(IndexListTerm)+1)*nIdx + nIdx;
123326
+ sIdxIter.u.ax.aIdx = sqlite3DbMallocZero(db, nByte);
123327
+ if( sIdxIter.u.ax.aIdx==0 ) return; /* OOM */
123328
+ bUsed = (u8*)&sIdxIter.u.ax.aIdx[nIdx];
123329
+ pUpsert->pToFree = sIdxIter.u.ax.aIdx;
123330
+ for(i=0, pTerm=pUpsert; pTerm; pTerm=pTerm->pNextUpsert){
123331
+ if( pTerm->pUpsertTarget==0 ) break;
123332
+ if( pTerm->pUpsertIdx==0 ) continue; /* Skip ON CONFLICT for the IPK */
123333
+ jj = 0;
123334
+ pIdx = pTab->pIndex;
123335
+ while( ALWAYS(pIdx!=0) && pIdx!=pTerm->pUpsertIdx ){
123336
+ pIdx = pIdx->pNext;
123337
+ jj++;
123338
+ }
123339
+ if( bUsed[jj] ) continue; /* Duplicate ON CONFLICT clause ignored */
123340
+ bUsed[jj] = 1;
123341
+ sIdxIter.u.ax.aIdx[i].p = pIdx;
123342
+ sIdxIter.u.ax.aIdx[i].ix = jj;
123343
+ i++;
123344
+ }
123345
+ for(jj=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, jj++){
123346
+ if( bUsed[jj] ) continue;
123347
+ sIdxIter.u.ax.aIdx[i].p = pIdx;
123348
+ sIdxIter.u.ax.aIdx[i].ix = jj;
123349
+ i++;
123350
+ }
123351
+ assert( i==nIdx );
122787123352
}
122788123353
}
122789123354
122790123355
/* Determine if it is possible that triggers (either explicitly coded
122791123356
** triggers or FK resolution actions) might run as a result of deletes
@@ -122844,15 +123409,24 @@
122844123409
}else if( onError==OE_Default ){
122845123410
onError = OE_Abort;
122846123411
}
122847123412
122848123413
/* figure out whether or not upsert applies in this case */
122849
- if( pUpsert && pUpsert->pUpsertIdx==0 ){
122850
- if( pUpsert->pUpsertSet==0 ){
122851
- onError = OE_Ignore; /* DO NOTHING is the same as INSERT OR IGNORE */
122852
- }else{
122853
- onError = OE_Update; /* DO UPDATE */
123414
+ if( pUpsert ){
123415
+ pUpsertClause = sqlite3UpsertOfIndex(pUpsert,0);
123416
+ if( pUpsertClause!=0 ){
123417
+ if( pUpsertClause->isDoUpdate==0 ){
123418
+ onError = OE_Ignore; /* DO NOTHING is the same as INSERT OR IGNORE */
123419
+ }else{
123420
+ onError = OE_Update; /* DO UPDATE */
123421
+ }
123422
+ }
123423
+ if( pUpsertClause!=pUpsert ){
123424
+ /* The first ON CONFLICT clause has a conflict target other than
123425
+ ** the IPK. We have to jump ahead to that first ON CONFLICT clause
123426
+ ** and then come back here and deal with the IPK afterwards */
123427
+ upsertIpkDelay = sqlite3VdbeAddOp0(v, OP_Goto);
122854123428
}
122855123429
}
122856123430
122857123431
/* If the response to a rowid conflict is REPLACE but the response
122858123432
** to some other UNIQUE constraint is FAIL or IGNORE, then we need
@@ -122955,11 +123529,13 @@
122955123529
sqlite3VdbeGoto(v, ignoreDest);
122956123530
break;
122957123531
}
122958123532
}
122959123533
sqlite3VdbeResolveLabel(v, addrRowidOk);
122960
- if( ipkTop ){
123534
+ if( pUpsert && pUpsertClause!=pUpsert ){
123535
+ upsertIpkReturn = sqlite3VdbeAddOp0(v, OP_Goto);
123536
+ }else if( ipkTop ){
122961123537
ipkBottom = sqlite3VdbeAddOp0(v, OP_Goto);
122962123538
sqlite3VdbeJumpHere(v, ipkTop-1);
122963123539
}
122964123540
}
122965123541
@@ -122968,27 +123544,29 @@
122968123544
** Compute the revised record entries for indices as we go.
122969123545
**
122970123546
** This loop also handles the case of the PRIMARY KEY index for a
122971123547
** WITHOUT ROWID table.
122972123548
*/
122973
- for(ix=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, ix++){
123549
+ for(pIdx = indexIteratorFirst(&sIdxIter, &ix);
123550
+ pIdx;
123551
+ pIdx = indexIteratorNext(&sIdxIter, &ix)
123552
+ ){
122974123553
int regIdx; /* Range of registers hold conent for pIdx */
122975123554
int regR; /* Range of registers holding conflicting PK */
122976123555
int iThisCur; /* Cursor for this UNIQUE index */
122977123556
int addrUniqueOk; /* Jump here if the UNIQUE constraint is satisfied */
122978123557
int addrConflictCk; /* First opcode in the conflict check logic */
122979123558
122980123559
if( aRegIdx[ix]==0 ) continue; /* Skip indices that do not change */
122981
- if( pUpIdx==pIdx ){
122982
- addrUniqueOk = upsertJump+1;
122983
- upsertBypass = sqlite3VdbeGoto(v, 0);
122984
- VdbeComment((v, "Skip upsert subroutine"));
122985
- sqlite3VdbeJumpHere(v, upsertJump);
122986
- }else{
122987
- addrUniqueOk = sqlite3VdbeMakeLabel(pParse);
122988
- }
122989
- if( bAffinityDone==0 && (pUpIdx==0 || pUpIdx==pIdx) ){
123560
+ if( pUpsert ){
123561
+ pUpsertClause = sqlite3UpsertOfIndex(pUpsert, pIdx);
123562
+ if( upsertIpkDelay && pUpsertClause==pUpsert ){
123563
+ sqlite3VdbeJumpHere(v, upsertIpkDelay);
123564
+ }
123565
+ }
123566
+ addrUniqueOk = sqlite3VdbeMakeLabel(pParse);
123567
+ if( bAffinityDone==0 ){
122990123568
sqlite3TableAffinity(v, pTab, regNewData+1);
122991123569
bAffinityDone = 1;
122992123570
}
122993123571
VdbeNoopComment((v, "prep index %s", pIdx->zName));
122994123572
iThisCur = iIdxCur+ix;
@@ -123055,12 +123633,12 @@
123055123633
}else if( onError==OE_Default ){
123056123634
onError = OE_Abort;
123057123635
}
123058123636
123059123637
/* Figure out if the upsert clause applies to this index */
123060
- if( pUpIdx==pIdx ){
123061
- if( pUpsert->pUpsertSet==0 ){
123638
+ if( pUpsertClause ){
123639
+ if( pUpsertClause->isDoUpdate==0 ){
123062123640
onError = OE_Ignore; /* DO NOTHING is the same as INSERT OR IGNORE */
123063123641
}else{
123064123642
onError = OE_Update; /* DO UPDATE */
123065123643
}
123066123644
}
@@ -123094,11 +123672,11 @@
123094123672
addrConflictCk =
123095123673
sqlite3VdbeAddOp4Int(v, OP_NoConflict, iThisCur, addrUniqueOk,
123096123674
regIdx, pIdx->nKeyCol); VdbeCoverage(v);
123097123675
123098123676
/* Generate code to handle collisions */
123099
- regR = (pIdx==pPk) ? regIdx : sqlite3GetTempRange(pParse, nPkField);
123677
+ regR = pIdx==pPk ? regIdx : sqlite3GetTempRange(pParse, nPkField);
123100123678
if( isUpdate || onError==OE_Replace ){
123101123679
if( HasRowid(pTab) ){
123102123680
sqlite3VdbeAddOp2(v, OP_IdxRowid, iThisCur, regR);
123103123681
/* Conflict only if the rowid of the existing index entry
123104123682
** is different from old-rowid */
@@ -123246,17 +123824,20 @@
123246123824
}
123247123825
seenReplace = 1;
123248123826
break;
123249123827
}
123250123828
}
123251
- if( pUpIdx==pIdx ){
123252
- sqlite3VdbeGoto(v, upsertJump+1);
123253
- sqlite3VdbeJumpHere(v, upsertBypass);
123254
- }else{
123255
- sqlite3VdbeResolveLabel(v, addrUniqueOk);
123256
- }
123829
+ sqlite3VdbeResolveLabel(v, addrUniqueOk);
123257123830
if( regR!=regIdx ) sqlite3ReleaseTempRange(pParse, regR, nPkField);
123831
+ if( pUpsertClause
123832
+ && upsertIpkReturn
123833
+ && sqlite3UpsertNextIsIPK(pUpsertClause)
123834
+ ){
123835
+ sqlite3VdbeGoto(v, upsertIpkDelay+1);
123836
+ sqlite3VdbeJumpHere(v, upsertIpkReturn);
123837
+ upsertIpkReturn = 0;
123838
+ }
123258123839
}
123259123840
123260123841
/* If the IPK constraint is a REPLACE, run it last */
123261123842
if( ipkTop ){
123262123843
sqlite3VdbeGoto(v, ipkTop);
@@ -123791,10 +124372,11 @@
123791124372
sqlite3CodeVerifySchema(pParse, iDbSrc);
123792124373
iSrc = pParse->nTab++;
123793124374
iDest = pParse->nTab++;
123794124375
regAutoinc = autoIncBegin(pParse, iDbDest, pDest);
123795124376
regData = sqlite3GetTempReg(pParse);
124377
+ sqlite3VdbeAddOp2(v, OP_Null, 0, regData);
123796124378
regRowid = sqlite3GetTempReg(pParse);
123797124379
sqlite3OpenTable(pParse, iDest, iDbDest, pDest, OP_OpenWrite);
123798124380
assert( HasRowid(pDest) || destHasUniqueIdx );
123799124381
if( (db->mDbFlags & DBFLAG_Vacuum)==0 && (
123800124382
(pDest->iPKey<0 && pDest->pIndex!=0) /* (1) */
@@ -123826,32 +124408,44 @@
123826124408
u8 insFlags;
123827124409
sqlite3OpenTable(pParse, iSrc, iDbSrc, pSrc, OP_OpenRead);
123828124410
emptySrcTest = sqlite3VdbeAddOp2(v, OP_Rewind, iSrc, 0); VdbeCoverage(v);
123829124411
if( pDest->iPKey>=0 ){
123830124412
addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
123831
- sqlite3VdbeVerifyAbortable(v, onError);
123832
- addr2 = sqlite3VdbeAddOp3(v, OP_NotExists, iDest, 0, regRowid);
123833
- VdbeCoverage(v);
123834
- sqlite3RowidConstraint(pParse, onError, pDest);
123835
- sqlite3VdbeJumpHere(v, addr2);
124413
+ if( (db->mDbFlags & DBFLAG_Vacuum)==0 ){
124414
+ sqlite3VdbeVerifyAbortable(v, onError);
124415
+ addr2 = sqlite3VdbeAddOp3(v, OP_NotExists, iDest, 0, regRowid);
124416
+ VdbeCoverage(v);
124417
+ sqlite3RowidConstraint(pParse, onError, pDest);
124418
+ sqlite3VdbeJumpHere(v, addr2);
124419
+ }
123836124420
autoIncStep(pParse, regAutoinc, regRowid);
123837124421
}else if( pDest->pIndex==0 && !(db->mDbFlags & DBFLAG_VacuumInto) ){
123838124422
addr1 = sqlite3VdbeAddOp2(v, OP_NewRowid, iDest, regRowid);
123839124423
}else{
123840124424
addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
123841124425
assert( (pDest->tabFlags & TF_Autoincrement)==0 );
123842124426
}
124427
+
123843124428
if( db->mDbFlags & DBFLAG_Vacuum ){
123844124429
sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest);
123845
- insFlags = OPFLAG_APPEND|OPFLAG_USESEEKRESULT;
124430
+ insFlags = OPFLAG_APPEND|OPFLAG_USESEEKRESULT|OPFLAG_PREFORMAT;
123846124431
}else{
123847
- insFlags = OPFLAG_NCHANGE|OPFLAG_LASTROWID|OPFLAG_APPEND;
124432
+ insFlags = OPFLAG_NCHANGE|OPFLAG_LASTROWID|OPFLAG_APPEND|OPFLAG_PREFORMAT;
123848124433
}
123849
- sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
124434
+#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
124435
+ if( db->xPreUpdateCallback ){
124436
+ sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
124437
+ insFlags &= ~OPFLAG_PREFORMAT;
124438
+ }else
124439
+#endif
124440
+ {
124441
+ sqlite3VdbeAddOp3(v, OP_RowCell, iDest, iSrc, regRowid);
124442
+ }
123850124443
sqlite3VdbeAddOp4(v, OP_Insert, iDest, regData, regRowid,
123851
- (char*)pDest, P4_TABLE);
124444
+ (char*)pDest, P4_TABLE);
123852124445
sqlite3VdbeChangeP5(v, insFlags);
124446
+
123853124447
sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1); VdbeCoverage(v);
123854124448
sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
123855124449
sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
123856124450
}else{
123857124451
sqlite3TableLock(pParse, iDbDest, pDest->tnum, 1, pDest->zName);
@@ -123889,17 +124483,20 @@
123889124483
for(i=0; i<pSrcIdx->nColumn; i++){
123890124484
const char *zColl = pSrcIdx->azColl[i];
123891124485
if( sqlite3_stricmp(sqlite3StrBINARY, zColl) ) break;
123892124486
}
123893124487
if( i==pSrcIdx->nColumn ){
123894
- idxInsFlags = OPFLAG_USESEEKRESULT;
124488
+ idxInsFlags = OPFLAG_USESEEKRESULT|OPFLAG_PREFORMAT;
123895124489
sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest);
124490
+ sqlite3VdbeAddOp3(v, OP_RowCell, iDest, iSrc, regData);
123896124491
}
123897124492
}else if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){
123898124493
idxInsFlags |= OPFLAG_NCHANGE;
123899124494
}
123900
- sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
124495
+ if( idxInsFlags!=(OPFLAG_USESEEKRESULT|OPFLAG_PREFORMAT) ){
124496
+ sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
124497
+ }
123901124498
sqlite3VdbeAddOp2(v, OP_IdxInsert, iDest, regData);
123902124499
sqlite3VdbeChangeP5(v, idxInsFlags|OPFLAG_APPEND);
123903124500
sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1+1); VdbeCoverage(v);
123904124501
sqlite3VdbeJumpHere(v, addr1);
123905124502
sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
@@ -134009,11 +134606,11 @@
134009134606
sqlite3AggInfoPersistWalkerInit(&w, pParse);
134010134607
sqlite3WalkSelect(&w,pSub1);
134011134608
sqlite3SelectDelete(db, pSub1);
134012134609
134013134610
#if SELECTTRACE_ENABLED
134014
- if( sqlite3_unsupported_selecttrace & 0x100 ){
134611
+ if( sqlite3SelectTrace & 0x100 ){
134015134612
SELECTTRACE(0x100,pParse,p,("After flattening:\n"));
134016134613
sqlite3TreeViewSelect(0, p, 0);
134017134614
}
134018134615
#endif
134019134616
@@ -135453,11 +136050,11 @@
135453136050
sWalker.pParse = pParse;
135454136051
sWalker.xExprCallback = havingToWhereExprCb;
135455136052
sWalker.u.pSelect = p;
135456136053
sqlite3WalkExpr(&sWalker, p->pHaving);
135457136054
#if SELECTTRACE_ENABLED
135458
- if( sWalker.eCode && (sqlite3_unsupported_selecttrace & 0x100)!=0 ){
136055
+ if( sWalker.eCode && (sqlite3SelectTrace & 0x100)!=0 ){
135459136056
SELECTTRACE(0x100,pParse,p,("Move HAVING terms into WHERE:\n"));
135460136057
sqlite3TreeViewSelect(0, p, 0);
135461136058
}
135462136059
#endif
135463136060
}
@@ -135575,11 +136172,11 @@
135575136172
}
135576136173
p->pEList->a[0].pExpr = pExpr;
135577136174
p->selFlags &= ~SF_Aggregate;
135578136175
135579136176
#if SELECTTRACE_ENABLED
135580
- if( sqlite3_unsupported_selecttrace & 0x400 ){
136177
+ if( sqlite3SelectTrace & 0x400 ){
135581136178
SELECTTRACE(0x400,pParse,p,("After count-of-view optimization:\n"));
135582136179
sqlite3TreeViewSelect(0, p, 0);
135583136180
}
135584136181
#endif
135585136182
return 1;
@@ -135628,11 +136225,11 @@
135628136225
return 1;
135629136226
}
135630136227
if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
135631136228
#if SELECTTRACE_ENABLED
135632136229
SELECTTRACE(1,pParse,p, ("begin processing:\n", pParse->addrExplain));
135633
- if( sqlite3_unsupported_selecttrace & 0x100 ){
136230
+ if( sqlite3SelectTrace & 0x100 ){
135634136231
sqlite3TreeViewSelect(0, p, 0);
135635136232
}
135636136233
#endif
135637136234
135638136235
assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistFifo );
@@ -135653,11 +136250,11 @@
135653136250
if( pParse->nErr || db->mallocFailed ){
135654136251
goto select_end;
135655136252
}
135656136253
assert( p->pEList!=0 );
135657136254
#if SELECTTRACE_ENABLED
135658
- if( sqlite3_unsupported_selecttrace & 0x104 ){
136255
+ if( sqlite3SelectTrace & 0x104 ){
135659136256
SELECTTRACE(0x104,pParse,p, ("after name resolution:\n"));
135660136257
sqlite3TreeViewSelect(0, p, 0);
135661136258
}
135662136259
#endif
135663136260
@@ -135688,11 +136285,11 @@
135688136285
if( rc ){
135689136286
assert( db->mallocFailed || pParse->nErr>0 );
135690136287
goto select_end;
135691136288
}
135692136289
#if SELECTTRACE_ENABLED
135693
- if( p->pWin && (sqlite3_unsupported_selecttrace & 0x108)!=0 ){
136290
+ if( p->pWin && (sqlite3SelectTrace & 0x108)!=0 ){
135694136291
SELECTTRACE(0x104,pParse,p, ("after window rewrite:\n"));
135695136292
sqlite3TreeViewSelect(0, p, 0);
135696136293
}
135697136294
#endif
135698136295
#endif /* SQLITE_OMIT_WINDOWFUNC */
@@ -135795,11 +136392,11 @@
135795136392
*/
135796136393
if( p->pPrior ){
135797136394
rc = multiSelect(pParse, p, pDest);
135798136395
#if SELECTTRACE_ENABLED
135799136396
SELECTTRACE(0x1,pParse,p,("end compound-select processing\n"));
135800
- if( (sqlite3_unsupported_selecttrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
136397
+ if( (sqlite3SelectTrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
135801136398
sqlite3TreeViewSelect(0, p, 0);
135802136399
}
135803136400
#endif
135804136401
if( p->pNext==0 ) ExplainQueryPlanPop(pParse);
135805136402
return rc;
@@ -135814,11 +136411,11 @@
135814136411
if( pTabList->nSrc>1
135815136412
&& OptimizationEnabled(db, SQLITE_PropagateConst)
135816136413
&& propagateConstants(pParse, p)
135817136414
){
135818136415
#if SELECTTRACE_ENABLED
135819
- if( sqlite3_unsupported_selecttrace & 0x100 ){
136416
+ if( sqlite3SelectTrace & 0x100 ){
135820136417
SELECTTRACE(0x100,pParse,p,("After constant propagation:\n"));
135821136418
sqlite3TreeViewSelect(0, p, 0);
135822136419
}
135823136420
#endif
135824136421
}else{
@@ -135902,11 +136499,11 @@
135902136499
if( OptimizationEnabled(db, SQLITE_PushDown)
135903136500
&& pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
135904136501
(pItem->fg.jointype & JT_OUTER)!=0)
135905136502
){
135906136503
#if SELECTTRACE_ENABLED
135907
- if( sqlite3_unsupported_selecttrace & 0x100 ){
136504
+ if( sqlite3SelectTrace & 0x100 ){
135908136505
SELECTTRACE(0x100,pParse,p,
135909136506
("After WHERE-clause push-down into subquery %d:\n", pSub->selId));
135910136507
sqlite3TreeViewSelect(0, p, 0);
135911136508
}
135912136509
#endif
@@ -136002,11 +136599,11 @@
136002136599
pGroupBy = p->pGroupBy;
136003136600
pHaving = p->pHaving;
136004136601
sDistinct.isTnct = (p->selFlags & SF_Distinct)!=0;
136005136602
136006136603
#if SELECTTRACE_ENABLED
136007
- if( sqlite3_unsupported_selecttrace & 0x400 ){
136604
+ if( sqlite3SelectTrace & 0x400 ){
136008136605
SELECTTRACE(0x400,pParse,p,("After all FROM-clause analysis:\n"));
136009136606
sqlite3TreeViewSelect(0, p, 0);
136010136607
}
136011136608
#endif
136012136609
@@ -136038,11 +136635,11 @@
136038136635
** the sDistinct.isTnct is still set. Hence, isTnct represents the
136039136636
** original setting of the SF_Distinct flag, not the current setting */
136040136637
assert( sDistinct.isTnct );
136041136638
136042136639
#if SELECTTRACE_ENABLED
136043
- if( sqlite3_unsupported_selecttrace & 0x400 ){
136640
+ if( sqlite3SelectTrace & 0x400 ){
136044136641
SELECTTRACE(0x400,pParse,p,("Transform DISTINCT into GROUP BY:\n"));
136045136642
sqlite3TreeViewSelect(0, p, 0);
136046136643
}
136047136644
#endif
136048136645
}
@@ -136286,11 +136883,11 @@
136286136883
sNC.ncFlags &= ~NC_InAggFunc;
136287136884
}
136288136885
pAggInfo->mxReg = pParse->nMem;
136289136886
if( db->mallocFailed ) goto select_end;
136290136887
#if SELECTTRACE_ENABLED
136291
- if( sqlite3_unsupported_selecttrace & 0x400 ){
136888
+ if( sqlite3SelectTrace & 0x400 ){
136292136889
int ii;
136293136890
SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", pAggInfo));
136294136891
sqlite3TreeViewSelect(0, p, 0);
136295136892
for(ii=0; ii<pAggInfo->nColumn; ii++){
136296136893
sqlite3DebugPrintf("agg-column[%d] iMem=%d\n",
@@ -136705,11 +137302,11 @@
136705137302
}
136706137303
#endif
136707137304
136708137305
#if SELECTTRACE_ENABLED
136709137306
SELECTTRACE(0x1,pParse,p,("end processing\n"));
136710
- if( (sqlite3_unsupported_selecttrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
137307
+ if( (sqlite3SelectTrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
136711137308
sqlite3TreeViewSelect(0, p, 0);
136712137309
}
136713137310
#endif
136714137311
ExplainQueryPlanPop(pParse);
136715137312
return rc;
@@ -139476,19 +140073,26 @@
139476140073
139477140074
#ifndef SQLITE_OMIT_UPSERT
139478140075
/*
139479140076
** Free a list of Upsert objects
139480140077
*/
139481
-SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3 *db, Upsert *p){
139482
- if( p ){
140078
+static void SQLITE_NOINLINE upsertDelete(sqlite3 *db, Upsert *p){
140079
+ do{
140080
+ Upsert *pNext = p->pNextUpsert;
139483140081
sqlite3ExprListDelete(db, p->pUpsertTarget);
139484140082
sqlite3ExprDelete(db, p->pUpsertTargetWhere);
139485140083
sqlite3ExprListDelete(db, p->pUpsertSet);
139486140084
sqlite3ExprDelete(db, p->pUpsertWhere);
140085
+ sqlite3DbFree(db, p->pToFree);
139487140086
sqlite3DbFree(db, p);
139488
- }
140087
+ p = pNext;
140088
+ }while( p );
139489140089
}
140090
+SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3 *db, Upsert *p){
140091
+ if( p ) upsertDelete(db, p);
140092
+}
140093
+
139490140094
139491140095
/*
139492140096
** Duplicate an Upsert object.
139493140097
*/
139494140098
SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3 *db, Upsert *p){
@@ -139495,11 +140099,12 @@
139495140099
if( p==0 ) return 0;
139496140100
return sqlite3UpsertNew(db,
139497140101
sqlite3ExprListDup(db, p->pUpsertTarget, 0),
139498140102
sqlite3ExprDup(db, p->pUpsertTargetWhere, 0),
139499140103
sqlite3ExprListDup(db, p->pUpsertSet, 0),
139500
- sqlite3ExprDup(db, p->pUpsertWhere, 0)
140104
+ sqlite3ExprDup(db, p->pUpsertWhere, 0),
140105
+ sqlite3UpsertDup(db, p->pNextUpsert)
139501140106
);
139502140107
}
139503140108
139504140109
/*
139505140110
** Create a new Upsert object.
@@ -139507,26 +140112,29 @@
139507140112
SQLITE_PRIVATE Upsert *sqlite3UpsertNew(
139508140113
sqlite3 *db, /* Determines which memory allocator to use */
139509140114
ExprList *pTarget, /* Target argument to ON CONFLICT, or NULL */
139510140115
Expr *pTargetWhere, /* Optional WHERE clause on the target */
139511140116
ExprList *pSet, /* UPDATE columns, or NULL for a DO NOTHING */
139512
- Expr *pWhere /* WHERE clause for the ON CONFLICT UPDATE */
140117
+ Expr *pWhere, /* WHERE clause for the ON CONFLICT UPDATE */
140118
+ Upsert *pNext /* Next ON CONFLICT clause in the list */
139513140119
){
139514140120
Upsert *pNew;
139515
- pNew = sqlite3DbMallocRaw(db, sizeof(Upsert));
140121
+ pNew = sqlite3DbMallocZero(db, sizeof(Upsert));
139516140122
if( pNew==0 ){
139517140123
sqlite3ExprListDelete(db, pTarget);
139518140124
sqlite3ExprDelete(db, pTargetWhere);
139519140125
sqlite3ExprListDelete(db, pSet);
139520140126
sqlite3ExprDelete(db, pWhere);
140127
+ sqlite3UpsertDelete(db, pNext);
139521140128
return 0;
139522140129
}else{
139523140130
pNew->pUpsertTarget = pTarget;
139524140131
pNew->pUpsertTargetWhere = pTargetWhere;
139525140132
pNew->pUpsertSet = pSet;
139526140133
pNew->pUpsertWhere = pWhere;
139527
- pNew->pUpsertIdx = 0;
140134
+ pNew->isDoUpdate = pSet!=0;
140135
+ pNew->pNextUpsert = pNext;
139528140136
}
139529140137
return pNew;
139530140138
}
139531140139
139532140140
/*
@@ -139547,10 +140155,11 @@
139547140155
Index *pIdx; /* One of the indexes of pTab */
139548140156
ExprList *pTarget; /* The conflict-target clause */
139549140157
Expr *pTerm; /* One term of the conflict-target clause */
139550140158
NameContext sNC; /* Context for resolving symbolic names */
139551140159
Expr sCol[2]; /* Index column converted into an Expr */
140160
+ int nClause = 0; /* Counter of ON CONFLICT clauses */
139552140161
139553140162
assert( pTabList->nSrc==1 );
139554140163
assert( pTabList->a[0].pTab!=0 );
139555140164
assert( pUpsert!=0 );
139556140165
assert( pUpsert->pUpsertTarget!=0 );
@@ -139560,91 +140169,135 @@
139560140169
** WHERE clause.
139561140170
*/
139562140171
memset(&sNC, 0, sizeof(sNC));
139563140172
sNC.pParse = pParse;
139564140173
sNC.pSrcList = pTabList;
139565
- rc = sqlite3ResolveExprListNames(&sNC, pUpsert->pUpsertTarget);
139566
- if( rc ) return rc;
139567
- rc = sqlite3ResolveExprNames(&sNC, pUpsert->pUpsertTargetWhere);
139568
- if( rc ) return rc;
139569
-
139570
- /* Check to see if the conflict target matches the rowid. */
139571
- pTab = pTabList->a[0].pTab;
139572
- pTarget = pUpsert->pUpsertTarget;
139573
- iCursor = pTabList->a[0].iCursor;
139574
- if( HasRowid(pTab)
139575
- && pTarget->nExpr==1
139576
- && (pTerm = pTarget->a[0].pExpr)->op==TK_COLUMN
139577
- && pTerm->iColumn==XN_ROWID
139578
- ){
139579
- /* The conflict-target is the rowid of the primary table */
139580
- assert( pUpsert->pUpsertIdx==0 );
139581
- return SQLITE_OK;
139582
- }
139583
-
139584
- /* Initialize sCol[0..1] to be an expression parse tree for a
139585
- ** single column of an index. The sCol[0] node will be the TK_COLLATE
139586
- ** operator and sCol[1] will be the TK_COLUMN operator. Code below
139587
- ** will populate the specific collation and column number values
139588
- ** prior to comparing against the conflict-target expression.
139589
- */
139590
- memset(sCol, 0, sizeof(sCol));
139591
- sCol[0].op = TK_COLLATE;
139592
- sCol[0].pLeft = &sCol[1];
139593
- sCol[1].op = TK_COLUMN;
139594
- sCol[1].iTable = pTabList->a[0].iCursor;
139595
-
139596
- /* Check for matches against other indexes */
139597
- for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
139598
- int ii, jj, nn;
139599
- if( !IsUniqueIndex(pIdx) ) continue;
139600
- if( pTarget->nExpr!=pIdx->nKeyCol ) continue;
139601
- if( pIdx->pPartIdxWhere ){
139602
- if( pUpsert->pUpsertTargetWhere==0 ) continue;
139603
- if( sqlite3ExprCompare(pParse, pUpsert->pUpsertTargetWhere,
139604
- pIdx->pPartIdxWhere, iCursor)!=0 ){
139605
- continue;
139606
- }
139607
- }
139608
- nn = pIdx->nKeyCol;
139609
- for(ii=0; ii<nn; ii++){
139610
- Expr *pExpr;
139611
- sCol[0].u.zToken = (char*)pIdx->azColl[ii];
139612
- if( pIdx->aiColumn[ii]==XN_EXPR ){
139613
- assert( pIdx->aColExpr!=0 );
139614
- assert( pIdx->aColExpr->nExpr>ii );
139615
- pExpr = pIdx->aColExpr->a[ii].pExpr;
139616
- if( pExpr->op!=TK_COLLATE ){
139617
- sCol[0].pLeft = pExpr;
139618
- pExpr = &sCol[0];
139619
- }
139620
- }else{
139621
- sCol[0].pLeft = &sCol[1];
139622
- sCol[1].iColumn = pIdx->aiColumn[ii];
139623
- pExpr = &sCol[0];
139624
- }
139625
- for(jj=0; jj<nn; jj++){
139626
- if( sqlite3ExprCompare(pParse, pTarget->a[jj].pExpr, pExpr,iCursor)<2 ){
139627
- break; /* Column ii of the index matches column jj of target */
139628
- }
139629
- }
139630
- if( jj>=nn ){
139631
- /* The target contains no match for column jj of the index */
139632
- break;
139633
- }
139634
- }
139635
- if( ii<nn ){
139636
- /* Column ii of the index did not match any term of the conflict target.
139637
- ** Continue the search with the next index. */
139638
- continue;
139639
- }
139640
- pUpsert->pUpsertIdx = pIdx;
139641
- return SQLITE_OK;
139642
- }
139643
- sqlite3ErrorMsg(pParse, "ON CONFLICT clause does not match any "
139644
- "PRIMARY KEY or UNIQUE constraint");
139645
- return SQLITE_ERROR;
140174
+ for(; pUpsert && pUpsert->pUpsertTarget;
140175
+ pUpsert=pUpsert->pNextUpsert, nClause++){
140176
+ rc = sqlite3ResolveExprListNames(&sNC, pUpsert->pUpsertTarget);
140177
+ if( rc ) return rc;
140178
+ rc = sqlite3ResolveExprNames(&sNC, pUpsert->pUpsertTargetWhere);
140179
+ if( rc ) return rc;
140180
+
140181
+ /* Check to see if the conflict target matches the rowid. */
140182
+ pTab = pTabList->a[0].pTab;
140183
+ pTarget = pUpsert->pUpsertTarget;
140184
+ iCursor = pTabList->a[0].iCursor;
140185
+ if( HasRowid(pTab)
140186
+ && pTarget->nExpr==1
140187
+ && (pTerm = pTarget->a[0].pExpr)->op==TK_COLUMN
140188
+ && pTerm->iColumn==XN_ROWID
140189
+ ){
140190
+ /* The conflict-target is the rowid of the primary table */
140191
+ assert( pUpsert->pUpsertIdx==0 );
140192
+ continue;
140193
+ }
140194
+
140195
+ /* Initialize sCol[0..1] to be an expression parse tree for a
140196
+ ** single column of an index. The sCol[0] node will be the TK_COLLATE
140197
+ ** operator and sCol[1] will be the TK_COLUMN operator. Code below
140198
+ ** will populate the specific collation and column number values
140199
+ ** prior to comparing against the conflict-target expression.
140200
+ */
140201
+ memset(sCol, 0, sizeof(sCol));
140202
+ sCol[0].op = TK_COLLATE;
140203
+ sCol[0].pLeft = &sCol[1];
140204
+ sCol[1].op = TK_COLUMN;
140205
+ sCol[1].iTable = pTabList->a[0].iCursor;
140206
+
140207
+ /* Check for matches against other indexes */
140208
+ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
140209
+ int ii, jj, nn;
140210
+ if( !IsUniqueIndex(pIdx) ) continue;
140211
+ if( pTarget->nExpr!=pIdx->nKeyCol ) continue;
140212
+ if( pIdx->pPartIdxWhere ){
140213
+ if( pUpsert->pUpsertTargetWhere==0 ) continue;
140214
+ if( sqlite3ExprCompare(pParse, pUpsert->pUpsertTargetWhere,
140215
+ pIdx->pPartIdxWhere, iCursor)!=0 ){
140216
+ continue;
140217
+ }
140218
+ }
140219
+ nn = pIdx->nKeyCol;
140220
+ for(ii=0; ii<nn; ii++){
140221
+ Expr *pExpr;
140222
+ sCol[0].u.zToken = (char*)pIdx->azColl[ii];
140223
+ if( pIdx->aiColumn[ii]==XN_EXPR ){
140224
+ assert( pIdx->aColExpr!=0 );
140225
+ assert( pIdx->aColExpr->nExpr>ii );
140226
+ pExpr = pIdx->aColExpr->a[ii].pExpr;
140227
+ if( pExpr->op!=TK_COLLATE ){
140228
+ sCol[0].pLeft = pExpr;
140229
+ pExpr = &sCol[0];
140230
+ }
140231
+ }else{
140232
+ sCol[0].pLeft = &sCol[1];
140233
+ sCol[1].iColumn = pIdx->aiColumn[ii];
140234
+ pExpr = &sCol[0];
140235
+ }
140236
+ for(jj=0; jj<nn; jj++){
140237
+ if( sqlite3ExprCompare(pParse,pTarget->a[jj].pExpr,pExpr,iCursor)<2 ){
140238
+ break; /* Column ii of the index matches column jj of target */
140239
+ }
140240
+ }
140241
+ if( jj>=nn ){
140242
+ /* The target contains no match for column jj of the index */
140243
+ break;
140244
+ }
140245
+ }
140246
+ if( ii<nn ){
140247
+ /* Column ii of the index did not match any term of the conflict target.
140248
+ ** Continue the search with the next index. */
140249
+ continue;
140250
+ }
140251
+ pUpsert->pUpsertIdx = pIdx;
140252
+ break;
140253
+ }
140254
+ if( pUpsert->pUpsertIdx==0 ){
140255
+ char zWhich[16];
140256
+ if( nClause==0 && pUpsert->pNextUpsert==0 ){
140257
+ zWhich[0] = 0;
140258
+ }else{
140259
+ sqlite3_snprintf(sizeof(zWhich),zWhich,"%r ", nClause+1);
140260
+ }
140261
+ sqlite3ErrorMsg(pParse, "%sON CONFLICT clause does not match any "
140262
+ "PRIMARY KEY or UNIQUE constraint", zWhich);
140263
+ return SQLITE_ERROR;
140264
+ }
140265
+ }
140266
+ return SQLITE_OK;
140267
+}
140268
+
140269
+/*
140270
+** Return true if pUpsert is the last ON CONFLICT clause with a
140271
+** conflict target, or if pUpsert is followed by another ON CONFLICT
140272
+** clause that targets the INTEGER PRIMARY KEY.
140273
+*/
140274
+SQLITE_PRIVATE int sqlite3UpsertNextIsIPK(Upsert *pUpsert){
140275
+ Upsert *pNext;
140276
+ if( NEVER(pUpsert==0) ) return 0;
140277
+ pNext = pUpsert->pNextUpsert;
140278
+ if( pNext==0 ) return 1;
140279
+ if( pNext->pUpsertTarget==0 ) return 1;
140280
+ if( pNext->pUpsertIdx==0 ) return 1;
140281
+ return 0;
140282
+}
140283
+
140284
+/*
140285
+** Given the list of ON CONFLICT clauses described by pUpsert, and
140286
+** a particular index pIdx, return a pointer to the particular ON CONFLICT
140287
+** clause that applies to the index. Or, if the index is not subject to
140288
+** any ON CONFLICT clause, return NULL.
140289
+*/
140290
+SQLITE_PRIVATE Upsert *sqlite3UpsertOfIndex(Upsert *pUpsert, Index *pIdx){
140291
+ while(
140292
+ pUpsert
140293
+ && pUpsert->pUpsertTarget!=0
140294
+ && pUpsert->pUpsertIdx!=pIdx
140295
+ ){
140296
+ pUpsert = pUpsert->pNextUpsert;
140297
+ }
140298
+ return pUpsert;
139646140299
}
139647140300
139648140301
/*
139649140302
** Generate bytecode that does an UPDATE as part of an upsert.
139650140303
**
@@ -139664,15 +140317,17 @@
139664140317
Vdbe *v = pParse->pVdbe;
139665140318
sqlite3 *db = pParse->db;
139666140319
SrcList *pSrc; /* FROM clause for the UPDATE */
139667140320
int iDataCur;
139668140321
int i;
140322
+ Upsert *pTop = pUpsert;
139669140323
139670140324
assert( v!=0 );
139671140325
assert( pUpsert!=0 );
139672
- VdbeNoopComment((v, "Begin DO UPDATE of UPSERT"));
139673140326
iDataCur = pUpsert->iDataCur;
140327
+ pUpsert = sqlite3UpsertOfIndex(pTop, pIdx);
140328
+ VdbeNoopComment((v, "Begin DO UPDATE of UPSERT"));
139674140329
if( pIdx && iCur!=iDataCur ){
139675140330
if( HasRowid(pTab) ){
139676140331
int regRowid = sqlite3GetTempReg(pParse);
139677140332
sqlite3VdbeAddOp2(v, OP_IdxRowid, iCur, regRowid);
139678140333
sqlite3VdbeAddOp3(v, OP_SeekRowid, iDataCur, 0, regRowid);
@@ -139698,23 +140353,21 @@
139698140353
"corrupt database", P4_STATIC);
139699140354
sqlite3MayAbort(pParse);
139700140355
sqlite3VdbeJumpHere(v, i);
139701140356
}
139702140357
}
139703
- /* pUpsert does not own pUpsertSrc - the outer INSERT statement does. So
139704
- ** we have to make a copy before passing it down into sqlite3Update() */
139705
- pSrc = sqlite3SrcListDup(db, pUpsert->pUpsertSrc, 0);
140358
+ /* pUpsert does not own pTop->pUpsertSrc - the outer INSERT statement does.
140359
+ ** So we have to make a copy before passing it down into sqlite3Update() */
140360
+ pSrc = sqlite3SrcListDup(db, pTop->pUpsertSrc, 0);
139706140361
/* excluded.* columns of type REAL need to be converted to a hard real */
139707140362
for(i=0; i<pTab->nCol; i++){
139708140363
if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){
139709
- sqlite3VdbeAddOp1(v, OP_RealAffinity, pUpsert->regData+i);
140364
+ sqlite3VdbeAddOp1(v, OP_RealAffinity, pTop->regData+i);
139710140365
}
139711140366
}
139712
- sqlite3Update(pParse, pSrc, pUpsert->pUpsertSet,
139713
- pUpsert->pUpsertWhere, OE_Abort, 0, 0, pUpsert);
139714
- pUpsert->pUpsertSet = 0; /* Will have been deleted by sqlite3Update() */
139715
- pUpsert->pUpsertWhere = 0; /* Will have been deleted by sqlite3Update() */
140367
+ sqlite3Update(pParse, pSrc, sqlite3ExprListDup(db,pUpsert->pUpsertSet,0),
140368
+ sqlite3ExprDup(db,pUpsert->pUpsertWhere,0), OE_Abort, 0, 0, pUpsert);
139716140369
VdbeNoopComment((v, "End DO UPDATE of UPSERT"));
139717140370
}
139718140371
139719140372
#endif /* SQLITE_OMIT_UPSERT */
139720140373
@@ -141487,23 +142140,10 @@
141487142140
** a separate source file for easier editing.
141488142141
*/
141489142142
#ifndef SQLITE_WHEREINT_H
141490142143
#define SQLITE_WHEREINT_H
141491142144
141492
-/*
141493
-** Trace output macros
141494
-*/
141495
-#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
141496
-/***/ extern int sqlite3WhereTrace;
141497
-#endif
141498
-#if defined(SQLITE_DEBUG) \
141499
- && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_WHERETRACE))
141500
-# define WHERETRACE(K,X) if(sqlite3WhereTrace&(K)) sqlite3DebugPrintf X
141501
-# define WHERETRACE_ENABLED 1
141502
-#else
141503
-# define WHERETRACE(K,X)
141504
-#endif
141505142145
141506142146
/* Forward references
141507142147
*/
141508142148
typedef struct WhereClause WhereClause;
141509142149
typedef struct WhereMaskSet WhereMaskSet;
@@ -146219,16 +146859,10 @@
146219146859
Parse *pParse; /* The parsing context */
146220146860
};
146221146861
146222146862
/* Forward declaration of methods */
146223146863
static int whereLoopResize(sqlite3*, WhereLoop*, int);
146224
-
146225
-/* Test variable that can be set to enable WHERE tracing */
146226
-#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
146227
-/***/ int sqlite3WhereTrace = 0;
146228
-#endif
146229
-
146230146864
146231146865
/*
146232146866
** Return the estimated number of output rows from a WHERE clause
146233146867
*/
146234146868
SQLITE_PRIVATE LogEst sqlite3WhereOutputRowCount(WhereInfo *pWInfo){
@@ -155319,22 +155953,22 @@
155319155953
#define sqlite3ParserCTX_PDECL ,Parse *pParse
155320155954
#define sqlite3ParserCTX_PARAM ,pParse
155321155955
#define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
155322155956
#define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
155323155957
#define YYFALLBACK 1
155324
-#define YYNSTATE 553
155325
-#define YYNRULE 385
155326
-#define YYNRULE_WITH_ACTION 325
155958
+#define YYNSTATE 558
155959
+#define YYNRULE 386
155960
+#define YYNRULE_WITH_ACTION 326
155327155961
#define YYNTOKEN 181
155328
-#define YY_MAX_SHIFT 552
155329
-#define YY_MIN_SHIFTREDUCE 803
155330
-#define YY_MAX_SHIFTREDUCE 1187
155331
-#define YY_ERROR_ACTION 1188
155332
-#define YY_ACCEPT_ACTION 1189
155333
-#define YY_NO_ACTION 1190
155334
-#define YY_MIN_REDUCE 1191
155335
-#define YY_MAX_REDUCE 1575
155962
+#define YY_MAX_SHIFT 557
155963
+#define YY_MIN_SHIFTREDUCE 809
155964
+#define YY_MAX_SHIFTREDUCE 1194
155965
+#define YY_ERROR_ACTION 1195
155966
+#define YY_ACCEPT_ACTION 1196
155967
+#define YY_NO_ACTION 1197
155968
+#define YY_MIN_REDUCE 1198
155969
+#define YY_MAX_REDUCE 1583
155336155970
/************* End control #defines *******************************************/
155337155971
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
155338155972
155339155973
/* Define the yytestcase() macro to be a no-op if is not already defined
155340155974
** otherwise.
@@ -155397,209 +156031,209 @@
155397156031
** yy_reduce_ofst[] For each state, the offset into yy_action for
155398156032
** shifting non-terminals after a reduce.
155399156033
** yy_default[] Default action for each state.
155400156034
**
155401156035
*********** Begin parsing tables **********************************************/
155402
-#define YY_ACTTAB_COUNT (1962)
156036
+#define YY_ACTTAB_COUNT (1968)
155403156037
static const YYACTIONTYPE yy_action[] = {
155404
- /* 0 */ 546, 1222, 546, 451, 1260, 546, 1239, 546, 114, 111,
155405
- /* 10 */ 211, 546, 1537, 546, 1260, 523, 114, 111, 211, 392,
155406
- /* 20 */ 1232, 344, 42, 42, 42, 42, 1225, 42, 42, 71,
155407
- /* 30 */ 71, 937, 1224, 71, 71, 71, 71, 1462, 1493, 938,
155408
- /* 40 */ 820, 453, 6, 121, 122, 112, 1165, 1165, 1006, 1009,
155409
- /* 50 */ 999, 999, 119, 119, 120, 120, 120, 120, 1543, 392,
155410
- /* 60 */ 1358, 1517, 552, 2, 1193, 194, 528, 436, 143, 291,
155411
- /* 70 */ 528, 136, 528, 371, 261, 504, 272, 385, 1273, 527,
155412
- /* 80 */ 503, 493, 164, 121, 122, 112, 1165, 1165, 1006, 1009,
155413
- /* 90 */ 999, 999, 119, 119, 120, 120, 120, 120, 1358, 442,
155414
- /* 100 */ 1514, 118, 118, 118, 118, 117, 117, 116, 116, 116,
155415
- /* 110 */ 115, 424, 266, 266, 266, 266, 1498, 358, 1500, 435,
155416
- /* 120 */ 357, 1498, 517, 524, 1485, 543, 1114, 543, 1114, 392,
155417
- /* 130 */ 405, 241, 208, 114, 111, 211, 98, 290, 537, 221,
155418
- /* 140 */ 1029, 118, 118, 118, 118, 117, 117, 116, 116, 116,
155419
- /* 150 */ 115, 424, 1142, 121, 122, 112, 1165, 1165, 1006, 1009,
155420
- /* 160 */ 999, 999, 119, 119, 120, 120, 120, 120, 406, 428,
155421
- /* 170 */ 117, 117, 116, 116, 116, 115, 424, 1418, 468, 123,
156038
+ /* 0 */ 551, 1229, 551, 456, 1267, 551, 1246, 551, 114, 111,
156039
+ /* 10 */ 212, 551, 1545, 551, 1267, 528, 114, 111, 212, 396,
156040
+ /* 20 */ 1239, 348, 42, 42, 42, 42, 1232, 42, 42, 71,
156041
+ /* 30 */ 71, 943, 1231, 71, 71, 71, 71, 1470, 1501, 944,
156042
+ /* 40 */ 826, 458, 6, 121, 122, 112, 1172, 1172, 1013, 1016,
156043
+ /* 50 */ 1006, 1006, 119, 119, 120, 120, 120, 120, 1551, 396,
156044
+ /* 60 */ 1366, 1525, 557, 2, 1200, 195, 533, 441, 143, 293,
156045
+ /* 70 */ 533, 136, 533, 375, 262, 509, 273, 389, 1280, 532,
156046
+ /* 80 */ 508, 498, 165, 121, 122, 112, 1172, 1172, 1013, 1016,
156047
+ /* 90 */ 1006, 1006, 119, 119, 120, 120, 120, 120, 1366, 447,
156048
+ /* 100 */ 1522, 118, 118, 118, 118, 117, 117, 116, 116, 116,
156049
+ /* 110 */ 115, 429, 267, 267, 267, 267, 1506, 362, 1508, 440,
156050
+ /* 120 */ 361, 1506, 522, 529, 1493, 548, 1121, 548, 1121, 396,
156051
+ /* 130 */ 410, 242, 209, 114, 111, 212, 98, 292, 542, 222,
156052
+ /* 140 */ 1036, 118, 118, 118, 118, 117, 117, 116, 116, 116,
156053
+ /* 150 */ 115, 429, 1149, 121, 122, 112, 1172, 1172, 1013, 1016,
156054
+ /* 160 */ 1006, 1006, 119, 119, 120, 120, 120, 120, 411, 433,
156055
+ /* 170 */ 117, 117, 116, 116, 116, 115, 429, 1426, 473, 123,
155422156056
/* 180 */ 118, 118, 118, 118, 117, 117, 116, 116, 116, 115,
155423
- /* 190 */ 424, 116, 116, 116, 115, 424, 540, 540, 540, 392,
155424
- /* 200 */ 505, 120, 120, 120, 120, 113, 1051, 1142, 1143, 1144,
155425
- /* 210 */ 1051, 118, 118, 118, 118, 117, 117, 116, 116, 116,
155426
- /* 220 */ 115, 424, 1461, 121, 122, 112, 1165, 1165, 1006, 1009,
155427
- /* 230 */ 999, 999, 119, 119, 120, 120, 120, 120, 392, 444,
155428
- /* 240 */ 316, 83, 463, 81, 359, 382, 1142, 80, 118, 118,
155429
- /* 250 */ 118, 118, 117, 117, 116, 116, 116, 115, 424, 179,
155430
- /* 260 */ 434, 424, 121, 122, 112, 1165, 1165, 1006, 1009, 999,
155431
- /* 270 */ 999, 119, 119, 120, 120, 120, 120, 434, 433, 266,
155432
- /* 280 */ 266, 118, 118, 118, 118, 117, 117, 116, 116, 116,
155433
- /* 290 */ 115, 424, 543, 1109, 903, 506, 1142, 114, 111, 211,
155434
- /* 300 */ 1431, 1142, 1143, 1144, 206, 491, 1109, 392, 449, 1109,
155435
- /* 310 */ 545, 330, 120, 120, 120, 120, 298, 1431, 1433, 17,
156057
+ /* 190 */ 429, 116, 116, 116, 115, 429, 545, 545, 545, 396,
156058
+ /* 200 */ 510, 120, 120, 120, 120, 113, 1058, 1149, 1150, 1151,
156059
+ /* 210 */ 1058, 118, 118, 118, 118, 117, 117, 116, 116, 116,
156060
+ /* 220 */ 115, 429, 1469, 121, 122, 112, 1172, 1172, 1013, 1016,
156061
+ /* 230 */ 1006, 1006, 119, 119, 120, 120, 120, 120, 396, 449,
156062
+ /* 240 */ 320, 83, 468, 81, 363, 386, 1149, 80, 118, 118,
156063
+ /* 250 */ 118, 118, 117, 117, 116, 116, 116, 115, 429, 180,
156064
+ /* 260 */ 439, 429, 121, 122, 112, 1172, 1172, 1013, 1016, 1006,
156065
+ /* 270 */ 1006, 119, 119, 120, 120, 120, 120, 439, 438, 267,
156066
+ /* 280 */ 267, 118, 118, 118, 118, 117, 117, 116, 116, 116,
156067
+ /* 290 */ 115, 429, 548, 1116, 909, 511, 1149, 114, 111, 212,
156068
+ /* 300 */ 1439, 1149, 1150, 1151, 207, 496, 1116, 396, 454, 1116,
156069
+ /* 310 */ 550, 334, 120, 120, 120, 120, 300, 1439, 1441, 17,
155436156070
/* 320 */ 118, 118, 118, 118, 117, 117, 116, 116, 116, 115,
155437
- /* 330 */ 424, 121, 122, 112, 1165, 1165, 1006, 1009, 999, 999,
155438
- /* 340 */ 119, 119, 120, 120, 120, 120, 392, 1358, 434, 1142,
155439
- /* 350 */ 482, 1142, 1143, 1144, 996, 996, 1007, 1010, 445, 118,
155440
- /* 360 */ 118, 118, 118, 117, 117, 116, 116, 116, 115, 424,
155441
- /* 370 */ 121, 122, 112, 1165, 1165, 1006, 1009, 999, 999, 119,
155442
- /* 380 */ 119, 120, 120, 120, 120, 1054, 1054, 465, 1431, 118,
155443
- /* 390 */ 118, 118, 118, 117, 117, 116, 116, 116, 115, 424,
155444
- /* 400 */ 1142, 451, 546, 1426, 1142, 1143, 1144, 233, 966, 1142,
155445
- /* 410 */ 481, 478, 477, 171, 360, 392, 164, 407, 414, 842,
155446
- /* 420 */ 476, 164, 185, 334, 71, 71, 1243, 1000, 118, 118,
155447
- /* 430 */ 118, 118, 117, 117, 116, 116, 116, 115, 424, 121,
155448
- /* 440 */ 122, 112, 1165, 1165, 1006, 1009, 999, 999, 119, 119,
155449
- /* 450 */ 120, 120, 120, 120, 392, 1142, 1143, 1144, 835, 12,
155450
- /* 460 */ 314, 509, 163, 356, 1142, 1143, 1144, 114, 111, 211,
155451
- /* 470 */ 508, 290, 537, 546, 276, 180, 290, 537, 121, 122,
155452
- /* 480 */ 112, 1165, 1165, 1006, 1009, 999, 999, 119, 119, 120,
155453
- /* 490 */ 120, 120, 120, 345, 484, 71, 71, 118, 118, 118,
155454
- /* 500 */ 118, 117, 117, 116, 116, 116, 115, 424, 1142, 209,
155455
- /* 510 */ 411, 523, 1142, 1109, 1571, 378, 252, 269, 342, 487,
155456
- /* 520 */ 337, 486, 238, 392, 513, 364, 1109, 1127, 333, 1109,
155457
- /* 530 */ 191, 409, 286, 32, 457, 443, 118, 118, 118, 118,
155458
- /* 540 */ 117, 117, 116, 116, 116, 115, 424, 121, 122, 112,
155459
- /* 550 */ 1165, 1165, 1006, 1009, 999, 999, 119, 119, 120, 120,
155460
- /* 560 */ 120, 120, 392, 1142, 1143, 1144, 987, 1142, 1143, 1144,
155461
- /* 570 */ 1142, 233, 492, 1492, 481, 478, 477, 6, 163, 546,
155462
- /* 580 */ 512, 546, 115, 424, 476, 5, 121, 122, 112, 1165,
155463
- /* 590 */ 1165, 1006, 1009, 999, 999, 119, 119, 120, 120, 120,
156071
+ /* 330 */ 429, 121, 122, 112, 1172, 1172, 1013, 1016, 1006, 1006,
156072
+ /* 340 */ 119, 119, 120, 120, 120, 120, 396, 1366, 439, 1149,
156073
+ /* 350 */ 487, 1149, 1150, 1151, 1003, 1003, 1014, 1017, 406, 118,
156074
+ /* 360 */ 118, 118, 118, 117, 117, 116, 116, 116, 115, 429,
156075
+ /* 370 */ 121, 122, 112, 1172, 1172, 1013, 1016, 1006, 1006, 119,
156076
+ /* 380 */ 119, 120, 120, 120, 120, 1061, 1061, 470, 1439, 118,
156077
+ /* 390 */ 118, 118, 118, 117, 117, 116, 116, 116, 115, 429,
156078
+ /* 400 */ 1149, 456, 551, 1434, 1149, 1150, 1151, 234, 973, 1149,
156079
+ /* 410 */ 486, 483, 482, 172, 364, 396, 165, 412, 419, 848,
156080
+ /* 420 */ 481, 165, 186, 338, 71, 71, 1250, 1007, 118, 118,
156081
+ /* 430 */ 118, 118, 117, 117, 116, 116, 116, 115, 429, 121,
156082
+ /* 440 */ 122, 112, 1172, 1172, 1013, 1016, 1006, 1006, 119, 119,
156083
+ /* 450 */ 120, 120, 120, 120, 396, 1149, 1150, 1151, 841, 12,
156084
+ /* 460 */ 318, 514, 164, 360, 1149, 1150, 1151, 114, 111, 212,
156085
+ /* 470 */ 513, 292, 542, 551, 277, 181, 292, 542, 121, 122,
156086
+ /* 480 */ 112, 1172, 1172, 1013, 1016, 1006, 1006, 119, 119, 120,
156087
+ /* 490 */ 120, 120, 120, 349, 489, 71, 71, 118, 118, 118,
156088
+ /* 500 */ 118, 117, 117, 116, 116, 116, 115, 429, 1149, 210,
156089
+ /* 510 */ 416, 528, 1149, 1116, 1579, 382, 253, 270, 346, 492,
156090
+ /* 520 */ 341, 491, 239, 396, 518, 368, 1116, 1134, 337, 1116,
156091
+ /* 530 */ 192, 414, 288, 32, 462, 448, 118, 118, 118, 118,
156092
+ /* 540 */ 117, 117, 116, 116, 116, 115, 429, 121, 122, 112,
156093
+ /* 550 */ 1172, 1172, 1013, 1016, 1006, 1006, 119, 119, 120, 120,
156094
+ /* 560 */ 120, 120, 396, 1149, 1150, 1151, 994, 1149, 1150, 1151,
156095
+ /* 570 */ 1149, 234, 497, 1500, 486, 483, 482, 6, 164, 551,
156096
+ /* 580 */ 517, 551, 115, 429, 481, 5, 121, 122, 112, 1172,
156097
+ /* 590 */ 1172, 1013, 1016, 1006, 1006, 119, 119, 120, 120, 120,
155464156098
/* 600 */ 120, 13, 13, 13, 13, 118, 118, 118, 118, 117,
155465
- /* 610 */ 117, 116, 116, 116, 115, 424, 403, 502, 408, 546,
155466
- /* 620 */ 1486, 544, 1142, 892, 892, 1142, 1143, 1144, 1473, 1142,
155467
- /* 630 */ 275, 392, 808, 809, 810, 971, 422, 422, 422, 16,
155468
- /* 640 */ 16, 55, 55, 1242, 118, 118, 118, 118, 117, 117,
155469
- /* 650 */ 116, 116, 116, 115, 424, 121, 122, 112, 1165, 1165,
155470
- /* 660 */ 1006, 1009, 999, 999, 119, 119, 120, 120, 120, 120,
155471
- /* 670 */ 392, 1189, 1, 1, 552, 2, 1193, 1142, 1143, 1144,
155472
- /* 680 */ 194, 291, 898, 136, 1142, 1143, 1144, 897, 521, 1492,
155473
- /* 690 */ 1273, 3, 380, 6, 121, 122, 112, 1165, 1165, 1006,
155474
- /* 700 */ 1009, 999, 999, 119, 119, 120, 120, 120, 120, 858,
155475
- /* 710 */ 546, 924, 546, 118, 118, 118, 118, 117, 117, 116,
155476
- /* 720 */ 116, 116, 115, 424, 266, 266, 1092, 1569, 1142, 551,
155477
- /* 730 */ 1569, 1193, 13, 13, 13, 13, 291, 543, 136, 392,
155478
- /* 740 */ 485, 421, 420, 966, 344, 1273, 468, 410, 859, 279,
155479
- /* 750 */ 140, 221, 118, 118, 118, 118, 117, 117, 116, 116,
155480
- /* 760 */ 116, 115, 424, 121, 122, 112, 1165, 1165, 1006, 1009,
155481
- /* 770 */ 999, 999, 119, 119, 120, 120, 120, 120, 546, 266,
155482
- /* 780 */ 266, 428, 392, 1142, 1143, 1144, 1172, 830, 1172, 468,
155483
- /* 790 */ 431, 145, 543, 1146, 401, 314, 439, 302, 838, 1490,
155484
- /* 800 */ 71, 71, 412, 6, 1090, 473, 221, 100, 112, 1165,
155485
- /* 810 */ 1165, 1006, 1009, 999, 999, 119, 119, 120, 120, 120,
156099
+ /* 610 */ 117, 116, 116, 116, 115, 429, 408, 507, 413, 551,
156100
+ /* 620 */ 1494, 549, 1149, 898, 898, 1149, 1150, 1151, 1481, 1149,
156101
+ /* 630 */ 276, 396, 814, 815, 816, 978, 427, 427, 427, 16,
156102
+ /* 640 */ 16, 55, 55, 1249, 118, 118, 118, 118, 117, 117,
156103
+ /* 650 */ 116, 116, 116, 115, 429, 121, 122, 112, 1172, 1172,
156104
+ /* 660 */ 1013, 1016, 1006, 1006, 119, 119, 120, 120, 120, 120,
156105
+ /* 670 */ 396, 1196, 1, 1, 557, 2, 1200, 1149, 1150, 1151,
156106
+ /* 680 */ 195, 293, 904, 136, 1149, 1150, 1151, 903, 526, 1500,
156107
+ /* 690 */ 1280, 3, 384, 6, 121, 122, 112, 1172, 1172, 1013,
156108
+ /* 700 */ 1016, 1006, 1006, 119, 119, 120, 120, 120, 120, 864,
156109
+ /* 710 */ 551, 930, 551, 118, 118, 118, 118, 117, 117, 116,
156110
+ /* 720 */ 116, 116, 115, 429, 267, 267, 1099, 1577, 1149, 556,
156111
+ /* 730 */ 1577, 1200, 13, 13, 13, 13, 293, 548, 136, 396,
156112
+ /* 740 */ 490, 426, 425, 973, 348, 1280, 473, 415, 865, 281,
156113
+ /* 750 */ 140, 222, 118, 118, 118, 118, 117, 117, 116, 116,
156114
+ /* 760 */ 116, 115, 429, 121, 122, 112, 1172, 1172, 1013, 1016,
156115
+ /* 770 */ 1006, 1006, 119, 119, 120, 120, 120, 120, 551, 267,
156116
+ /* 780 */ 267, 433, 396, 1149, 1150, 1151, 1179, 836, 1179, 473,
156117
+ /* 790 */ 436, 145, 548, 1153, 405, 318, 444, 304, 844, 1498,
156118
+ /* 800 */ 71, 71, 417, 6, 1097, 478, 222, 100, 112, 1172,
156119
+ /* 810 */ 1172, 1013, 1016, 1006, 1006, 119, 119, 120, 120, 120,
155486156120
/* 820 */ 120, 118, 118, 118, 118, 117, 117, 116, 116, 116,
155487
- /* 830 */ 115, 424, 237, 1425, 546, 451, 428, 287, 986, 546,
155488
- /* 840 */ 236, 235, 234, 830, 97, 529, 429, 1265, 1265, 1146,
155489
- /* 850 */ 494, 307, 430, 838, 977, 546, 71, 71, 976, 1241,
155490
- /* 860 */ 546, 51, 51, 300, 118, 118, 118, 118, 117, 117,
155491
- /* 870 */ 116, 116, 116, 115, 424, 194, 103, 70, 70, 266,
155492
- /* 880 */ 266, 546, 71, 71, 266, 266, 30, 391, 344, 976,
155493
- /* 890 */ 976, 978, 543, 528, 1109, 328, 392, 543, 495, 397,
155494
- /* 900 */ 1470, 195, 530, 13, 13, 1358, 240, 1109, 277, 280,
155495
- /* 910 */ 1109, 280, 304, 457, 306, 333, 392, 31, 188, 419,
155496
- /* 920 */ 121, 122, 112, 1165, 1165, 1006, 1009, 999, 999, 119,
155497
- /* 930 */ 119, 120, 120, 120, 120, 142, 392, 365, 457, 986,
155498
- /* 940 */ 121, 122, 112, 1165, 1165, 1006, 1009, 999, 999, 119,
155499
- /* 950 */ 119, 120, 120, 120, 120, 977, 323, 1142, 326, 976,
155500
- /* 960 */ 121, 110, 112, 1165, 1165, 1006, 1009, 999, 999, 119,
155501
- /* 970 */ 119, 120, 120, 120, 120, 464, 377, 1185, 118, 118,
155502
- /* 980 */ 118, 118, 117, 117, 116, 116, 116, 115, 424, 1142,
155503
- /* 990 */ 976, 976, 978, 305, 9, 366, 244, 362, 118, 118,
155504
- /* 1000 */ 118, 118, 117, 117, 116, 116, 116, 115, 424, 313,
155505
- /* 1010 */ 546, 344, 1142, 1143, 1144, 299, 290, 537, 118, 118,
155506
- /* 1020 */ 118, 118, 117, 117, 116, 116, 116, 115, 424, 1263,
155507
- /* 1030 */ 1263, 1163, 13, 13, 278, 421, 420, 468, 392, 923,
155508
- /* 1040 */ 260, 260, 289, 1169, 1142, 1143, 1144, 189, 1171, 266,
155509
- /* 1050 */ 266, 468, 390, 543, 1186, 546, 1170, 263, 144, 489,
155510
- /* 1060 */ 922, 546, 543, 122, 112, 1165, 1165, 1006, 1009, 999,
155511
- /* 1070 */ 999, 119, 119, 120, 120, 120, 120, 71, 71, 1142,
155512
- /* 1080 */ 1172, 1272, 1172, 13, 13, 898, 1070, 1163, 546, 468,
155513
- /* 1090 */ 897, 107, 538, 1491, 4, 1268, 1109, 6, 525, 1049,
155514
- /* 1100 */ 12, 1071, 1092, 1570, 312, 455, 1570, 520, 541, 1109,
155515
- /* 1110 */ 56, 56, 1109, 1489, 423, 1358, 1072, 6, 345, 285,
156121
+ /* 830 */ 115, 429, 238, 1433, 551, 456, 433, 289, 993, 551,
156122
+ /* 840 */ 237, 236, 235, 836, 97, 534, 434, 1272, 1272, 1153,
156123
+ /* 850 */ 499, 309, 435, 844, 984, 551, 71, 71, 983, 1248,
156124
+ /* 860 */ 551, 51, 51, 302, 118, 118, 118, 118, 117, 117,
156125
+ /* 870 */ 116, 116, 116, 115, 429, 195, 103, 70, 70, 267,
156126
+ /* 880 */ 267, 551, 71, 71, 267, 267, 30, 395, 348, 983,
156127
+ /* 890 */ 983, 985, 548, 533, 1116, 332, 396, 548, 500, 401,
156128
+ /* 900 */ 460, 196, 535, 13, 13, 1366, 241, 1116, 278, 282,
156129
+ /* 910 */ 1116, 282, 306, 462, 308, 337, 396, 31, 189, 424,
156130
+ /* 920 */ 121, 122, 112, 1172, 1172, 1013, 1016, 1006, 1006, 119,
156131
+ /* 930 */ 119, 120, 120, 120, 120, 142, 396, 369, 456, 993,
156132
+ /* 940 */ 121, 122, 112, 1172, 1172, 1013, 1016, 1006, 1006, 119,
156133
+ /* 950 */ 119, 120, 120, 120, 120, 984, 327, 1149, 330, 983,
156134
+ /* 960 */ 121, 110, 112, 1172, 1172, 1013, 1016, 1006, 1006, 119,
156135
+ /* 970 */ 119, 120, 120, 120, 120, 469, 381, 1192, 118, 118,
156136
+ /* 980 */ 118, 118, 117, 117, 116, 116, 116, 115, 429, 1149,
156137
+ /* 990 */ 983, 983, 985, 307, 9, 461, 245, 462, 118, 118,
156138
+ /* 1000 */ 118, 118, 117, 117, 116, 116, 116, 115, 429, 317,
156139
+ /* 1010 */ 551, 279, 1149, 1150, 1151, 301, 292, 542, 118, 118,
156140
+ /* 1020 */ 118, 118, 117, 117, 116, 116, 116, 115, 429, 1270,
156141
+ /* 1030 */ 1270, 1170, 13, 13, 531, 426, 425, 473, 396, 929,
156142
+ /* 1040 */ 261, 261, 97, 1176, 1149, 1150, 1151, 190, 1178, 267,
156143
+ /* 1050 */ 267, 473, 138, 548, 1193, 551, 1177, 264, 348, 494,
156144
+ /* 1060 */ 928, 551, 548, 122, 112, 1172, 1172, 1013, 1016, 1006,
156145
+ /* 1070 */ 1006, 119, 119, 120, 120, 120, 120, 71, 71, 1149,
156146
+ /* 1080 */ 1179, 1279, 1179, 13, 13, 904, 1077, 1170, 551, 473,
156147
+ /* 1090 */ 903, 107, 543, 280, 4, 1275, 1116, 450, 530, 1056,
156148
+ /* 1100 */ 12, 1078, 1099, 1578, 316, 144, 1578, 525, 546, 1116,
156149
+ /* 1110 */ 56, 56, 1116, 1499, 428, 1366, 1079, 6, 349, 970,
155516156150
/* 1120 */ 118, 118, 118, 118, 117, 117, 116, 116, 116, 115,
155517
- /* 1130 */ 424, 425, 1271, 321, 1142, 1143, 1144, 878, 266, 266,
155518
- /* 1140 */ 1277, 107, 538, 535, 4, 1488, 293, 879, 1211, 6,
155519
- /* 1150 */ 210, 543, 543, 164, 294, 496, 416, 204, 541, 267,
155520
- /* 1160 */ 267, 1214, 398, 511, 499, 204, 266, 266, 396, 531,
155521
- /* 1170 */ 8, 986, 543, 519, 546, 922, 458, 105, 105, 543,
155522
- /* 1180 */ 1090, 425, 266, 266, 106, 417, 425, 548, 547, 266,
155523
- /* 1190 */ 266, 976, 518, 535, 1373, 543, 15, 15, 266, 266,
155524
- /* 1200 */ 456, 1120, 543, 266, 266, 1070, 1372, 515, 290, 537,
155525
- /* 1210 */ 546, 543, 514, 97, 444, 316, 543, 546, 922, 125,
155526
- /* 1220 */ 1071, 986, 976, 976, 978, 979, 27, 105, 105, 401,
155527
- /* 1230 */ 343, 1511, 44, 44, 106, 1072, 425, 548, 547, 57,
155528
- /* 1240 */ 57, 976, 343, 1511, 107, 538, 546, 4, 462, 401,
155529
- /* 1250 */ 214, 1120, 459, 297, 377, 1091, 534, 1309, 546, 539,
155530
- /* 1260 */ 398, 541, 290, 537, 104, 244, 102, 526, 58, 58,
155531
- /* 1270 */ 546, 199, 976, 976, 978, 979, 27, 1516, 1131, 427,
155532
- /* 1280 */ 59, 59, 270, 237, 425, 138, 95, 375, 375, 374,
155533
- /* 1290 */ 255, 372, 60, 60, 817, 1180, 535, 546, 273, 546,
155534
- /* 1300 */ 1163, 1308, 389, 388, 546, 438, 546, 215, 210, 296,
155535
- /* 1310 */ 515, 849, 546, 265, 208, 516, 1476, 295, 274, 61,
155536
- /* 1320 */ 61, 62, 62, 308, 986, 109, 45, 45, 46, 46,
155537
- /* 1330 */ 105, 105, 1186, 922, 47, 47, 341, 106, 546, 425,
155538
- /* 1340 */ 548, 547, 1542, 546, 976, 867, 340, 217, 546, 937,
155539
- /* 1350 */ 397, 107, 538, 218, 4, 156, 1163, 938, 158, 546,
155540
- /* 1360 */ 49, 49, 1162, 546, 268, 50, 50, 546, 541, 1450,
155541
- /* 1370 */ 63, 63, 546, 1449, 216, 976, 976, 978, 979, 27,
155542
- /* 1380 */ 446, 64, 64, 546, 460, 65, 65, 546, 318, 14,
155543
- /* 1390 */ 14, 425, 1305, 546, 66, 66, 1087, 546, 141, 379,
155544
- /* 1400 */ 38, 546, 963, 535, 322, 127, 127, 546, 393, 67,
155545
- /* 1410 */ 67, 546, 325, 290, 537, 52, 52, 515, 546, 68,
155546
- /* 1420 */ 68, 845, 514, 69, 69, 399, 165, 857, 856, 53,
155547
- /* 1430 */ 53, 986, 311, 151, 151, 97, 432, 105, 105, 327,
155548
- /* 1440 */ 152, 152, 526, 1048, 106, 1048, 425, 548, 547, 1131,
155549
- /* 1450 */ 427, 976, 1032, 270, 968, 239, 329, 243, 375, 375,
155550
- /* 1460 */ 374, 255, 372, 940, 941, 817, 1296, 546, 220, 546,
155551
- /* 1470 */ 107, 538, 546, 4, 546, 1256, 199, 845, 215, 1036,
155552
- /* 1480 */ 296, 1530, 976, 976, 978, 979, 27, 541, 295, 76,
155553
- /* 1490 */ 76, 54, 54, 980, 72, 72, 128, 128, 864, 865,
155554
- /* 1500 */ 107, 538, 546, 4, 1047, 546, 1047, 533, 469, 546,
155555
- /* 1510 */ 425, 546, 450, 1240, 546, 243, 546, 541, 217, 546,
155556
- /* 1520 */ 452, 197, 535, 243, 73, 73, 156, 129, 129, 158,
155557
- /* 1530 */ 336, 130, 130, 126, 126, 1036, 150, 150, 149, 149,
155558
- /* 1540 */ 425, 134, 134, 317, 474, 216, 97, 239, 331, 980,
155559
- /* 1550 */ 986, 97, 535, 346, 347, 546, 105, 105, 902, 931,
155560
- /* 1560 */ 546, 895, 243, 106, 109, 425, 548, 547, 546, 1505,
155561
- /* 1570 */ 976, 828, 99, 538, 139, 4, 546, 133, 133, 393,
155562
- /* 1580 */ 986, 1317, 131, 131, 290, 537, 105, 105, 1357, 541,
155563
- /* 1590 */ 132, 132, 1292, 106, 1303, 425, 548, 547, 75, 75,
155564
- /* 1600 */ 976, 976, 976, 978, 979, 27, 546, 432, 896, 1289,
155565
- /* 1610 */ 532, 109, 425, 1363, 546, 1221, 1213, 1202, 258, 546,
155566
- /* 1620 */ 349, 546, 1201, 11, 535, 1203, 1524, 351, 77, 77,
155567
- /* 1630 */ 376, 976, 976, 978, 979, 27, 74, 74, 353, 213,
155568
- /* 1640 */ 301, 43, 43, 48, 48, 437, 310, 201, 303, 1350,
155569
- /* 1650 */ 315, 355, 986, 454, 479, 1239, 339, 192, 105, 105,
155570
- /* 1660 */ 1422, 1421, 193, 536, 205, 106, 1527, 425, 548, 547,
155571
- /* 1670 */ 1180, 167, 976, 270, 247, 1469, 1467, 1177, 375, 375,
155572
- /* 1680 */ 374, 255, 372, 200, 369, 817, 400, 83, 79, 82,
155573
- /* 1690 */ 1427, 448, 177, 95, 1342, 161, 169, 1339, 215, 440,
155574
- /* 1700 */ 296, 172, 173, 976, 976, 978, 979, 27, 295, 174,
155575
- /* 1710 */ 175, 441, 472, 223, 1347, 383, 35, 381, 36, 461,
155576
- /* 1720 */ 88, 1353, 181, 447, 384, 1416, 227, 467, 259, 229,
155577
- /* 1730 */ 186, 488, 470, 324, 1250, 230, 231, 320, 217, 1204,
155578
- /* 1740 */ 1438, 1259, 386, 1258, 413, 90, 156, 849, 1541, 158,
155579
- /* 1750 */ 206, 415, 1540, 507, 1300, 1257, 94, 348, 1229, 1301,
155580
- /* 1760 */ 387, 1510, 1228, 338, 1227, 216, 350, 1539, 498, 283,
155581
- /* 1770 */ 284, 1249, 501, 1299, 352, 245, 246, 418, 1298, 354,
155582
- /* 1780 */ 1496, 1495, 124, 10, 526, 363, 101, 1324, 253, 96,
155583
- /* 1790 */ 510, 1210, 34, 549, 1137, 254, 256, 257, 166, 393,
155584
- /* 1800 */ 550, 1199, 1282, 361, 290, 537, 1281, 196, 367, 368,
155585
- /* 1810 */ 1194, 153, 1454, 137, 281, 1323, 1455, 804, 154, 426,
155586
- /* 1820 */ 198, 155, 1453, 1452, 292, 212, 202, 432, 1402, 203,
155587
- /* 1830 */ 271, 135, 288, 78, 1046, 1044, 960, 168, 157, 881,
155588
- /* 1840 */ 170, 219, 309, 222, 1060, 176, 964, 159, 402, 84,
155589
- /* 1850 */ 178, 404, 85, 86, 87, 160, 1063, 224, 394, 395,
155590
- /* 1860 */ 225, 1059, 146, 18, 226, 319, 243, 1174, 466, 228,
155591
- /* 1870 */ 1052, 182, 183, 37, 819, 471, 340, 232, 332, 483,
155592
- /* 1880 */ 184, 89, 162, 19, 20, 475, 91, 480, 847, 335,
155593
- /* 1890 */ 147, 860, 282, 92, 490, 93, 1125, 148, 1012, 1095,
155594
- /* 1900 */ 39, 497, 1096, 40, 500, 262, 207, 264, 930, 187,
155595
- /* 1910 */ 925, 109, 1111, 1115, 1113, 7, 1099, 242, 33, 1119,
155596
- /* 1920 */ 21, 522, 22, 23, 24, 1118, 25, 190, 97, 26,
155597
- /* 1930 */ 1027, 1013, 1011, 1015, 1069, 1016, 1068, 249, 248, 28,
155598
- /* 1940 */ 41, 891, 981, 829, 108, 29, 250, 542, 251, 370,
155599
- /* 1950 */ 373, 1133, 1132, 1190, 1190, 1190, 1190, 1190, 1190, 1190,
155600
- /* 1960 */ 1532, 1531,
156151
+ /* 1130 */ 429, 430, 1278, 325, 1149, 1150, 1151, 884, 267, 267,
156152
+ /* 1140 */ 855, 107, 543, 540, 4, 1497, 238, 885, 1218, 6,
156153
+ /* 1150 */ 211, 548, 370, 165, 366, 501, 421, 1496, 546, 268,
156154
+ /* 1160 */ 268, 6, 1550, 516, 504, 873, 267, 267, 400, 536,
156155
+ /* 1170 */ 8, 993, 548, 524, 551, 928, 463, 105, 105, 548,
156156
+ /* 1180 */ 1097, 430, 267, 267, 106, 422, 430, 553, 552, 267,
156157
+ /* 1190 */ 267, 983, 523, 540, 1381, 548, 15, 15, 267, 267,
156158
+ /* 1200 */ 1478, 1127, 548, 267, 267, 1077, 1380, 520, 292, 542,
156159
+ /* 1210 */ 551, 548, 519, 401, 449, 320, 548, 551, 928, 125,
156160
+ /* 1220 */ 1078, 993, 983, 983, 985, 986, 27, 105, 105, 405,
156161
+ /* 1230 */ 347, 1519, 44, 44, 106, 1079, 430, 553, 552, 57,
156162
+ /* 1240 */ 57, 983, 347, 1519, 107, 543, 551, 4, 467, 405,
156163
+ /* 1250 */ 215, 1127, 464, 295, 381, 1098, 539, 296, 551, 1221,
156164
+ /* 1260 */ 402, 546, 544, 402, 299, 245, 292, 542, 58, 58,
156165
+ /* 1270 */ 551, 1284, 983, 983, 985, 986, 27, 1524, 1138, 432,
156166
+ /* 1280 */ 59, 59, 271, 548, 430, 403, 166, 379, 379, 378,
156167
+ /* 1290 */ 256, 376, 60, 60, 823, 1187, 540, 551, 274, 551,
156168
+ /* 1300 */ 1170, 851, 393, 392, 551, 205, 551, 216, 211, 298,
156169
+ /* 1310 */ 520, 1303, 551, 266, 209, 521, 1316, 297, 275, 61,
156170
+ /* 1320 */ 61, 62, 62, 451, 993, 205, 45, 45, 46, 46,
156171
+ /* 1330 */ 105, 105, 1193, 928, 47, 47, 291, 106, 551, 430,
156172
+ /* 1340 */ 553, 552, 943, 551, 983, 313, 394, 218, 551, 109,
156173
+ /* 1350 */ 944, 107, 543, 219, 4, 156, 1170, 851, 158, 551,
156174
+ /* 1360 */ 49, 49, 104, 551, 102, 50, 50, 551, 546, 1315,
156175
+ /* 1370 */ 63, 63, 551, 443, 217, 983, 983, 985, 986, 27,
156176
+ /* 1380 */ 1484, 64, 64, 551, 310, 65, 65, 551, 1458, 14,
156177
+ /* 1390 */ 14, 430, 1457, 551, 66, 66, 1094, 551, 1169, 383,
156178
+ /* 1400 */ 141, 551, 38, 540, 269, 127, 127, 551, 397, 67,
156179
+ /* 1410 */ 67, 551, 465, 292, 542, 52, 52, 520, 551, 68,
156180
+ /* 1420 */ 68, 1043, 519, 69, 69, 315, 95, 322, 97, 53,
156181
+ /* 1430 */ 53, 993, 975, 151, 151, 244, 437, 105, 105, 200,
156182
+ /* 1440 */ 152, 152, 455, 1312, 106, 244, 430, 553, 552, 1138,
156183
+ /* 1450 */ 432, 983, 457, 271, 321, 244, 326, 97, 379, 379,
156184
+ /* 1460 */ 378, 256, 376, 863, 862, 823, 531, 551, 221, 551,
156185
+ /* 1470 */ 107, 543, 551, 4, 551, 329, 479, 1043, 216, 240,
156186
+ /* 1480 */ 298, 331, 983, 983, 985, 986, 27, 546, 297, 76,
156187
+ /* 1490 */ 76, 54, 54, 333, 72, 72, 128, 128, 870, 871,
156188
+ /* 1500 */ 107, 543, 551, 4, 1263, 551, 946, 947, 1247, 551,
156189
+ /* 1510 */ 430, 551, 200, 1055, 551, 1055, 551, 546, 218, 551,
156190
+ /* 1520 */ 335, 1538, 540, 97, 73, 73, 156, 129, 129, 158,
156191
+ /* 1530 */ 340, 130, 130, 126, 126, 350, 150, 150, 149, 149,
156192
+ /* 1540 */ 430, 134, 134, 345, 1039, 217, 937, 240, 901, 244,
156193
+ /* 1550 */ 993, 109, 540, 344, 987, 551, 105, 105, 908, 351,
156194
+ /* 1560 */ 551, 1513, 1054, 106, 1054, 430, 553, 552, 551, 1324,
156195
+ /* 1570 */ 983, 834, 99, 543, 139, 4, 551, 133, 133, 397,
156196
+ /* 1580 */ 993, 1365, 131, 131, 292, 542, 105, 105, 1299, 546,
156197
+ /* 1590 */ 132, 132, 287, 106, 1310, 430, 553, 552, 75, 75,
156198
+ /* 1600 */ 983, 983, 983, 985, 986, 27, 551, 437, 902, 537,
156199
+ /* 1610 */ 987, 109, 430, 259, 551, 538, 1371, 1228, 474, 551,
156200
+ /* 1620 */ 198, 551, 1220, 1209, 540, 1208, 1210, 1532, 77, 77,
156201
+ /* 1630 */ 202, 983, 983, 985, 986, 27, 74, 74, 1296, 353,
156202
+ /* 1640 */ 355, 43, 43, 48, 48, 357, 11, 380, 214, 343,
156203
+ /* 1650 */ 303, 442, 993, 312, 305, 1360, 314, 484, 105, 105,
156204
+ /* 1660 */ 459, 1246, 319, 206, 1430, 106, 1429, 430, 553, 552,
156205
+ /* 1670 */ 359, 541, 983, 271, 1535, 1187, 168, 248, 379, 379,
156206
+ /* 1680 */ 378, 256, 376, 201, 193, 823, 373, 194, 1477, 1475,
156207
+ /* 1690 */ 1184, 79, 404, 82, 83, 453, 178, 95, 216, 1349,
156208
+ /* 1700 */ 298, 162, 1435, 983, 983, 985, 986, 27, 297, 1354,
156209
+ /* 1710 */ 1346, 35, 170, 445, 446, 477, 173, 174, 175, 176,
156210
+ /* 1720 */ 385, 224, 1358, 1361, 1357, 466, 387, 36, 182, 452,
156211
+ /* 1730 */ 388, 1424, 228, 88, 472, 260, 230, 1446, 218, 187,
156212
+ /* 1740 */ 475, 328, 231, 390, 324, 1211, 156, 232, 493, 158,
156213
+ /* 1750 */ 418, 90, 1257, 1266, 1549, 1265, 1264, 855, 1256, 207,
156214
+ /* 1760 */ 420, 512, 1307, 1548, 94, 217, 352, 391, 1236, 1235,
156215
+ /* 1770 */ 342, 1234, 1547, 1518, 354, 285, 503, 286, 506, 246,
156216
+ /* 1780 */ 247, 1504, 1503, 423, 1308, 124, 531, 1306, 356, 10,
156217
+ /* 1790 */ 1305, 367, 1331, 101, 290, 96, 254, 515, 1217, 397,
156218
+ /* 1800 */ 34, 554, 1144, 255, 292, 542, 257, 372, 1289, 365,
156219
+ /* 1810 */ 371, 358, 1288, 197, 258, 555, 1206, 1201, 1462, 153,
156220
+ /* 1820 */ 1463, 1330, 1461, 154, 137, 283, 1460, 437, 155, 203,
156221
+ /* 1830 */ 810, 204, 78, 431, 1410, 199, 294, 213, 272, 135,
156222
+ /* 1840 */ 1053, 1051, 966, 157, 169, 220, 171, 887, 311, 223,
156223
+ /* 1850 */ 1067, 177, 159, 160, 407, 84, 409, 179, 85, 86,
156224
+ /* 1860 */ 87, 161, 1070, 225, 1066, 398, 167, 399, 18, 226,
156225
+ /* 1870 */ 146, 227, 323, 244, 1181, 471, 229, 1059, 183, 184,
156226
+ /* 1880 */ 37, 825, 344, 476, 233, 336, 488, 480, 185, 89,
156227
+ /* 1890 */ 19, 20, 485, 92, 853, 339, 91, 163, 866, 147,
156228
+ /* 1900 */ 284, 495, 502, 1132, 148, 1019, 936, 1102, 39, 93,
156229
+ /* 1910 */ 1103, 40, 505, 263, 208, 265, 188, 931, 1122, 243,
156230
+ /* 1920 */ 1126, 109, 33, 1120, 1118, 21, 1106, 22, 527, 1034,
156231
+ /* 1930 */ 23, 24, 1125, 25, 191, 97, 26, 1020, 1018, 1022,
156232
+ /* 1940 */ 1076, 250, 7, 1075, 249, 1023, 28, 41, 547, 988,
156233
+ /* 1950 */ 835, 108, 29, 251, 252, 1540, 374, 897, 377, 1140,
156234
+ /* 1960 */ 1139, 1197, 1197, 1197, 1197, 1197, 1197, 1539,
155601156235
};
155602156236
static const YYCODETYPE yy_lookahead[] = {
155603156237
/* 0 */ 189, 211, 189, 189, 218, 189, 220, 189, 267, 268,
155604156238
/* 10 */ 269, 189, 210, 189, 228, 189, 267, 268, 269, 19,
155605156239
/* 20 */ 218, 189, 211, 212, 211, 212, 211, 211, 212, 211,
@@ -155688,117 +156322,117 @@
155688156322
/* 850 */ 200, 16, 189, 114, 115, 189, 211, 212, 119, 221,
155689156323
/* 860 */ 189, 211, 212, 258, 101, 102, 103, 104, 105, 106,
155690156324
/* 870 */ 107, 108, 109, 110, 111, 189, 156, 211, 212, 234,
155691156325
/* 880 */ 235, 189, 211, 212, 234, 235, 22, 201, 189, 150,
155692156326
/* 890 */ 151, 152, 247, 248, 76, 16, 19, 247, 248, 113,
155693
- /* 900 */ 189, 24, 257, 211, 212, 189, 26, 89, 262, 223,
156327
+ /* 900 */ 19, 24, 257, 211, 212, 189, 26, 89, 262, 223,
155694156328
/* 910 */ 92, 225, 77, 189, 79, 129, 19, 53, 226, 248,
155695156329
/* 920 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
155696156330
/* 930 */ 53, 54, 55, 56, 57, 236, 19, 271, 189, 99,
155697156331
/* 940 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
155698156332
/* 950 */ 53, 54, 55, 56, 57, 115, 77, 59, 79, 119,
155699156333
/* 960 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
155700156334
/* 970 */ 53, 54, 55, 56, 57, 259, 22, 23, 101, 102,
155701156335
/* 980 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 59,
155702
- /* 990 */ 150, 151, 152, 158, 22, 244, 24, 246, 101, 102,
156336
+ /* 990 */ 150, 151, 152, 158, 22, 114, 24, 189, 101, 102,
155703156337
/* 1000 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 285,
155704
- /* 1010 */ 189, 189, 114, 115, 116, 200, 136, 137, 101, 102,
156338
+ /* 1010 */ 189, 262, 114, 115, 116, 200, 136, 137, 101, 102,
155705156339
/* 1020 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 230,
155706
- /* 1030 */ 231, 59, 211, 212, 285, 105, 106, 189, 19, 141,
155707
- /* 1040 */ 234, 235, 239, 113, 114, 115, 116, 226, 118, 234,
155708
- /* 1050 */ 235, 189, 249, 247, 100, 189, 126, 23, 236, 107,
156340
+ /* 1030 */ 231, 59, 211, 212, 143, 105, 106, 189, 19, 141,
156341
+ /* 1040 */ 234, 235, 26, 113, 114, 115, 116, 226, 118, 234,
156342
+ /* 1050 */ 235, 189, 161, 247, 100, 189, 126, 23, 189, 107,
155709156343
/* 1060 */ 26, 189, 247, 44, 45, 46, 47, 48, 49, 50,
155710156344
/* 1070 */ 51, 52, 53, 54, 55, 56, 57, 211, 212, 59,
155711156345
/* 1080 */ 150, 233, 152, 211, 212, 133, 12, 115, 189, 189,
155712
- /* 1090 */ 138, 19, 20, 300, 22, 233, 76, 304, 226, 11,
155713
- /* 1100 */ 208, 27, 22, 23, 200, 19, 26, 87, 36, 89,
155714
- /* 1110 */ 211, 212, 92, 300, 248, 189, 42, 304, 189, 250,
156346
+ /* 1090 */ 138, 19, 20, 285, 22, 233, 76, 127, 226, 11,
156347
+ /* 1100 */ 208, 27, 22, 23, 200, 236, 26, 87, 36, 89,
156348
+ /* 1110 */ 211, 212, 92, 300, 248, 189, 42, 304, 189, 149,
155715156349
/* 1120 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
155716156350
/* 1130 */ 111, 59, 200, 233, 114, 115, 116, 63, 234, 235,
155717
- /* 1140 */ 235, 19, 20, 71, 22, 300, 189, 73, 200, 304,
155718
- /* 1150 */ 116, 247, 247, 81, 189, 200, 227, 26, 36, 234,
155719
- /* 1160 */ 235, 203, 204, 143, 200, 26, 234, 235, 194, 200,
156351
+ /* 1140 */ 124, 19, 20, 71, 22, 300, 46, 73, 200, 304,
156352
+ /* 1150 */ 116, 247, 244, 81, 246, 200, 227, 300, 36, 234,
156353
+ /* 1160 */ 235, 304, 23, 143, 200, 26, 234, 235, 194, 200,
155720156354
/* 1170 */ 48, 99, 247, 66, 189, 141, 284, 105, 106, 247,
155721156355
/* 1180 */ 100, 59, 234, 235, 112, 259, 114, 115, 116, 234,
155722156356
/* 1190 */ 235, 119, 85, 71, 266, 247, 211, 212, 234, 235,
155723
- /* 1200 */ 114, 94, 247, 234, 235, 12, 266, 85, 136, 137,
155724
- /* 1210 */ 189, 247, 90, 26, 126, 127, 247, 189, 26, 22,
156357
+ /* 1200 */ 189, 94, 247, 234, 235, 12, 266, 85, 136, 137,
156358
+ /* 1210 */ 189, 247, 90, 113, 126, 127, 247, 189, 26, 22,
155725156359
/* 1220 */ 27, 99, 150, 151, 152, 153, 154, 105, 106, 189,
155726156360
/* 1230 */ 302, 303, 211, 212, 112, 42, 114, 115, 116, 211,
155727156361
/* 1240 */ 212, 119, 302, 303, 19, 20, 189, 22, 274, 189,
155728156362
/* 1250 */ 15, 144, 278, 189, 22, 23, 63, 189, 189, 203,
155729
- /* 1260 */ 204, 36, 136, 137, 155, 24, 157, 143, 211, 212,
155730
- /* 1270 */ 189, 140, 150, 151, 152, 153, 154, 0, 1, 2,
155731
- /* 1280 */ 211, 212, 5, 46, 59, 161, 147, 10, 11, 12,
156363
+ /* 1260 */ 204, 36, 203, 204, 189, 24, 136, 137, 211, 212,
156364
+ /* 1270 */ 189, 235, 150, 151, 152, 153, 154, 0, 1, 2,
156365
+ /* 1280 */ 211, 212, 5, 247, 59, 292, 293, 10, 11, 12,
155732156366
/* 1290 */ 13, 14, 211, 212, 17, 60, 71, 189, 258, 189,
155733
- /* 1300 */ 59, 189, 105, 106, 189, 189, 189, 30, 116, 32,
155734
- /* 1310 */ 85, 124, 189, 251, 252, 90, 189, 40, 258, 211,
155735
- /* 1320 */ 212, 211, 212, 189, 99, 26, 211, 212, 211, 212,
155736
- /* 1330 */ 105, 106, 100, 141, 211, 212, 119, 112, 189, 114,
155737
- /* 1340 */ 115, 116, 23, 189, 119, 26, 129, 70, 189, 31,
155738
- /* 1350 */ 113, 19, 20, 24, 22, 78, 115, 39, 81, 189,
155739
- /* 1360 */ 211, 212, 26, 189, 22, 211, 212, 189, 36, 189,
156367
+ /* 1300 */ 59, 59, 105, 106, 189, 26, 189, 30, 116, 32,
156368
+ /* 1310 */ 85, 253, 189, 251, 252, 90, 189, 40, 258, 211,
156369
+ /* 1320 */ 212, 211, 212, 127, 99, 26, 211, 212, 211, 212,
156370
+ /* 1330 */ 105, 106, 100, 141, 211, 212, 239, 112, 189, 114,
156371
+ /* 1340 */ 115, 116, 31, 189, 119, 149, 249, 70, 189, 26,
156372
+ /* 1350 */ 39, 19, 20, 24, 22, 78, 115, 115, 81, 189,
156373
+ /* 1360 */ 211, 212, 155, 189, 157, 211, 212, 189, 36, 189,
155740156374
/* 1370 */ 211, 212, 189, 189, 97, 150, 151, 152, 153, 154,
155741
- /* 1380 */ 127, 211, 212, 189, 189, 211, 212, 189, 189, 211,
155742
- /* 1390 */ 212, 59, 189, 189, 211, 212, 23, 189, 22, 26,
155743
- /* 1400 */ 24, 189, 149, 71, 189, 211, 212, 189, 131, 211,
156375
+ /* 1380 */ 189, 211, 212, 189, 189, 211, 212, 189, 189, 211,
156376
+ /* 1390 */ 212, 59, 189, 189, 211, 212, 23, 189, 26, 26,
156377
+ /* 1400 */ 22, 189, 24, 71, 22, 211, 212, 189, 131, 211,
155744156378
/* 1410 */ 212, 189, 189, 136, 137, 211, 212, 85, 189, 211,
155745
- /* 1420 */ 212, 59, 90, 211, 212, 292, 293, 118, 119, 211,
155746
- /* 1430 */ 212, 99, 23, 211, 212, 26, 159, 105, 106, 189,
155747
- /* 1440 */ 211, 212, 143, 150, 112, 152, 114, 115, 116, 1,
156379
+ /* 1420 */ 212, 59, 90, 211, 212, 23, 147, 189, 26, 211,
156380
+ /* 1430 */ 212, 99, 23, 211, 212, 26, 159, 105, 106, 140,
156381
+ /* 1440 */ 211, 212, 23, 189, 112, 26, 114, 115, 116, 1,
155748156382
/* 1450 */ 2, 119, 23, 5, 23, 26, 189, 26, 10, 11,
155749
- /* 1460 */ 12, 13, 14, 83, 84, 17, 253, 189, 139, 189,
155750
- /* 1470 */ 19, 20, 189, 22, 189, 189, 140, 115, 30, 59,
155751
- /* 1480 */ 32, 139, 150, 151, 152, 153, 154, 36, 40, 211,
155752
- /* 1490 */ 212, 211, 212, 59, 211, 212, 211, 212, 7, 8,
155753
- /* 1500 */ 19, 20, 189, 22, 150, 189, 152, 231, 281, 189,
155754
- /* 1510 */ 59, 189, 23, 189, 189, 26, 189, 36, 70, 189,
155755
- /* 1520 */ 23, 237, 71, 26, 211, 212, 78, 211, 212, 81,
155756
- /* 1530 */ 189, 211, 212, 211, 212, 115, 211, 212, 211, 212,
155757
- /* 1540 */ 59, 211, 212, 23, 23, 97, 26, 26, 23, 115,
155758
- /* 1550 */ 99, 26, 71, 189, 189, 189, 105, 106, 107, 23,
155759
- /* 1560 */ 189, 23, 26, 112, 26, 114, 115, 116, 189, 309,
156383
+ /* 1460 */ 12, 13, 14, 118, 119, 17, 143, 189, 139, 189,
156384
+ /* 1470 */ 19, 20, 189, 22, 189, 189, 23, 115, 30, 26,
156385
+ /* 1480 */ 32, 189, 150, 151, 152, 153, 154, 36, 40, 211,
156386
+ /* 1490 */ 212, 211, 212, 189, 211, 212, 211, 212, 7, 8,
156387
+ /* 1500 */ 19, 20, 189, 22, 189, 189, 83, 84, 189, 189,
156388
+ /* 1510 */ 59, 189, 140, 150, 189, 152, 189, 36, 70, 189,
156389
+ /* 1520 */ 23, 139, 71, 26, 211, 212, 78, 211, 212, 81,
156390
+ /* 1530 */ 189, 211, 212, 211, 212, 189, 211, 212, 211, 212,
156391
+ /* 1540 */ 59, 211, 212, 119, 23, 97, 23, 26, 23, 26,
156392
+ /* 1550 */ 99, 26, 71, 129, 59, 189, 105, 106, 107, 189,
156393
+ /* 1560 */ 189, 309, 150, 112, 152, 114, 115, 116, 189, 189,
155760156394
/* 1570 */ 119, 23, 19, 20, 26, 22, 189, 211, 212, 131,
155761156395
/* 1580 */ 99, 189, 211, 212, 136, 137, 105, 106, 189, 36,
155762
- /* 1590 */ 211, 212, 189, 112, 189, 114, 115, 116, 211, 212,
155763
- /* 1600 */ 119, 150, 151, 152, 153, 154, 189, 159, 23, 250,
155764
- /* 1610 */ 189, 26, 59, 189, 189, 189, 189, 189, 280, 189,
155765
- /* 1620 */ 250, 189, 189, 238, 71, 189, 189, 250, 211, 212,
155766
- /* 1630 */ 187, 150, 151, 152, 153, 154, 211, 212, 250, 290,
155767
- /* 1640 */ 240, 211, 212, 211, 212, 254, 286, 209, 254, 241,
155768
- /* 1650 */ 240, 254, 99, 286, 215, 220, 214, 244, 105, 106,
155769
- /* 1660 */ 214, 214, 244, 273, 224, 112, 192, 114, 115, 116,
155770
- /* 1670 */ 60, 290, 119, 5, 139, 196, 196, 38, 10, 11,
155771
- /* 1680 */ 12, 13, 14, 238, 240, 17, 196, 148, 287, 287,
155772
- /* 1690 */ 276, 113, 22, 147, 241, 43, 229, 241, 30, 18,
155773
- /* 1700 */ 32, 232, 232, 150, 151, 152, 153, 154, 40, 232,
155774
- /* 1710 */ 232, 196, 18, 195, 265, 265, 264, 241, 264, 196,
155775
- /* 1720 */ 155, 229, 229, 241, 241, 241, 195, 62, 196, 195,
155776
- /* 1730 */ 22, 113, 216, 196, 222, 195, 195, 282, 70, 196,
155777
- /* 1740 */ 283, 213, 216, 213, 64, 22, 78, 124, 219, 81,
155778
- /* 1750 */ 162, 111, 219, 142, 256, 213, 113, 255, 213, 256,
155779
- /* 1760 */ 216, 303, 215, 213, 213, 97, 255, 213, 216, 275,
155780
- /* 1770 */ 275, 222, 216, 256, 255, 196, 91, 82, 256, 255,
155781
- /* 1780 */ 308, 308, 146, 22, 143, 196, 155, 260, 25, 145,
155782
- /* 1790 */ 144, 199, 26, 198, 13, 190, 190, 6, 293, 131,
155783
- /* 1800 */ 188, 188, 245, 244, 136, 137, 245, 243, 242, 241,
155784
- /* 1810 */ 188, 202, 208, 217, 217, 260, 208, 4, 202, 3,
155785
- /* 1820 */ 22, 202, 208, 208, 160, 15, 209, 159, 270, 209,
155786
- /* 1830 */ 98, 16, 272, 208, 23, 23, 137, 148, 128, 20,
155787
- /* 1840 */ 140, 24, 16, 142, 1, 140, 149, 128, 61, 53,
155788
- /* 1850 */ 148, 37, 53, 53, 53, 128, 114, 34, 296, 296,
155789
- /* 1860 */ 139, 1, 5, 22, 113, 158, 26, 75, 41, 139,
155790
- /* 1870 */ 68, 68, 113, 24, 20, 19, 129, 123, 23, 96,
155791
- /* 1880 */ 22, 22, 37, 22, 22, 67, 22, 67, 59, 24,
155792
- /* 1890 */ 23, 28, 67, 147, 22, 26, 23, 23, 23, 23,
155793
- /* 1900 */ 22, 24, 23, 22, 24, 23, 139, 23, 114, 22,
155794
- /* 1910 */ 141, 26, 88, 75, 86, 44, 23, 34, 22, 75,
155795
- /* 1920 */ 34, 24, 34, 34, 34, 93, 34, 26, 26, 34,
155796
- /* 1930 */ 23, 23, 23, 23, 23, 11, 23, 22, 26, 22,
155797
- /* 1940 */ 22, 133, 23, 23, 22, 22, 139, 26, 139, 23,
155798
- /* 1950 */ 15, 1, 1, 310, 310, 310, 310, 310, 310, 310,
155799
- /* 1960 */ 139, 139, 310, 310, 310, 310, 310, 310, 310, 310,
156396
+ /* 1590 */ 211, 212, 250, 112, 189, 114, 115, 116, 211, 212,
156397
+ /* 1600 */ 119, 150, 151, 152, 153, 154, 189, 159, 23, 189,
156398
+ /* 1610 */ 115, 26, 59, 280, 189, 231, 189, 189, 281, 189,
156399
+ /* 1620 */ 237, 189, 189, 189, 71, 189, 189, 189, 211, 212,
156400
+ /* 1630 */ 209, 150, 151, 152, 153, 154, 211, 212, 250, 250,
156401
+ /* 1640 */ 250, 211, 212, 211, 212, 250, 238, 187, 290, 214,
156402
+ /* 1650 */ 240, 254, 99, 286, 254, 241, 241, 215, 105, 106,
156403
+ /* 1660 */ 286, 220, 240, 224, 214, 112, 214, 114, 115, 116,
156404
+ /* 1670 */ 254, 273, 119, 5, 192, 60, 290, 139, 10, 11,
156405
+ /* 1680 */ 12, 13, 14, 238, 244, 17, 240, 244, 196, 196,
156406
+ /* 1690 */ 38, 287, 196, 287, 148, 113, 22, 147, 30, 241,
156407
+ /* 1700 */ 32, 43, 276, 150, 151, 152, 153, 154, 40, 265,
156408
+ /* 1710 */ 241, 264, 229, 18, 196, 18, 232, 232, 232, 232,
156409
+ /* 1720 */ 241, 195, 265, 229, 265, 196, 265, 264, 229, 241,
156410
+ /* 1730 */ 241, 241, 195, 155, 62, 196, 195, 283, 70, 22,
156411
+ /* 1740 */ 216, 196, 195, 216, 282, 196, 78, 195, 113, 81,
156412
+ /* 1750 */ 64, 22, 222, 213, 219, 213, 213, 124, 222, 162,
156413
+ /* 1760 */ 111, 142, 256, 219, 113, 97, 255, 216, 213, 215,
156414
+ /* 1770 */ 213, 213, 213, 303, 255, 275, 216, 275, 216, 196,
156415
+ /* 1780 */ 91, 308, 308, 82, 256, 146, 143, 256, 255, 22,
156416
+ /* 1790 */ 256, 196, 260, 155, 272, 145, 25, 144, 199, 131,
156417
+ /* 1800 */ 26, 198, 13, 190, 136, 137, 190, 241, 245, 244,
156418
+ /* 1810 */ 242, 255, 245, 243, 6, 188, 188, 188, 208, 202,
156419
+ /* 1820 */ 208, 260, 208, 202, 217, 217, 208, 159, 202, 209,
156420
+ /* 1830 */ 4, 209, 208, 3, 270, 22, 160, 15, 98, 16,
156421
+ /* 1840 */ 23, 23, 137, 128, 148, 24, 140, 20, 16, 142,
156422
+ /* 1850 */ 1, 140, 128, 128, 61, 53, 37, 148, 53, 53,
156423
+ /* 1860 */ 53, 128, 114, 34, 1, 296, 293, 296, 22, 139,
156424
+ /* 1870 */ 5, 113, 158, 26, 75, 41, 139, 68, 68, 113,
156425
+ /* 1880 */ 24, 20, 129, 19, 123, 23, 96, 67, 22, 22,
156426
+ /* 1890 */ 22, 22, 67, 147, 59, 24, 22, 37, 28, 23,
156427
+ /* 1900 */ 67, 22, 24, 23, 23, 23, 114, 23, 22, 26,
156428
+ /* 1910 */ 23, 22, 24, 23, 139, 23, 22, 141, 75, 34,
156429
+ /* 1920 */ 75, 26, 22, 86, 88, 34, 23, 34, 24, 23,
156430
+ /* 1930 */ 34, 34, 93, 34, 26, 26, 34, 23, 23, 23,
156431
+ /* 1940 */ 23, 22, 44, 23, 26, 11, 22, 22, 26, 23,
156432
+ /* 1950 */ 23, 22, 22, 139, 139, 139, 23, 133, 15, 1,
156433
+ /* 1960 */ 1, 310, 310, 310, 310, 310, 310, 139, 310, 310,
155800156434
/* 1970 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155801156435
/* 1980 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155802156436
/* 1990 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155803156437
/* 2000 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155804156438
/* 2010 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
@@ -155812,15 +156446,15 @@
155812156446
/* 2090 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155813156447
/* 2100 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155814156448
/* 2110 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155815156449
/* 2120 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155816156450
/* 2130 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155817
- /* 2140 */ 310, 310, 310,
156451
+ /* 2140 */ 310, 310, 310, 310, 310, 310, 310, 310, 310,
155818156452
};
155819
-#define YY_SHIFT_COUNT (552)
156453
+#define YY_SHIFT_COUNT (557)
155820156454
#define YY_SHIFT_MIN (0)
155821
-#define YY_SHIFT_MAX (1951)
156455
+#define YY_SHIFT_MAX (1959)
155822156456
static const unsigned short int yy_shift_ofst[] = {
155823156457
/* 0 */ 1448, 1277, 1668, 1072, 1072, 340, 1122, 1225, 1332, 1481,
155824156458
/* 10 */ 1481, 1481, 335, 0, 0, 180, 897, 1481, 1481, 1481,
155825156459
/* 20 */ 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481,
155826156460
/* 30 */ 930, 930, 1020, 1020, 290, 1, 340, 340, 340, 340,
@@ -155833,55 +156467,55 @@
155833156467
/* 100 */ 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481,
155834156468
/* 110 */ 1481, 1481, 1553, 1481, 1481, 1481, 1481, 1481, 1481, 1481,
155835156469
/* 120 */ 1481, 1481, 1481, 1481, 1481, 1481, 147, 258, 258, 258,
155836156470
/* 130 */ 258, 258, 79, 65, 84, 449, 19, 786, 449, 636,
155837156471
/* 140 */ 636, 449, 880, 880, 880, 880, 113, 142, 142, 472,
155838
- /* 150 */ 150, 1962, 1962, 399, 399, 399, 93, 237, 341, 237,
155839
- /* 160 */ 237, 1074, 1074, 437, 350, 704, 1080, 449, 449, 449,
156472
+ /* 150 */ 150, 1968, 1968, 399, 399, 399, 93, 237, 341, 237,
156473
+ /* 160 */ 237, 237, 1074, 1074, 437, 350, 704, 1080, 449, 449,
155840156474
/* 170 */ 449, 449, 449, 449, 449, 449, 449, 449, 449, 449,
155841
- /* 180 */ 449, 449, 449, 449, 449, 449, 449, 449, 818, 818,
155842
- /* 190 */ 449, 1088, 217, 217, 734, 734, 1124, 1126, 1962, 1962,
155843
- /* 200 */ 1962, 739, 840, 840, 453, 454, 511, 187, 563, 570,
155844
- /* 210 */ 898, 669, 449, 449, 449, 449, 449, 449, 449, 449,
155845
- /* 220 */ 449, 670, 449, 449, 449, 449, 449, 449, 449, 449,
155846
- /* 230 */ 449, 449, 449, 449, 674, 674, 674, 449, 449, 449,
155847
- /* 240 */ 449, 1034, 449, 449, 449, 972, 1107, 449, 449, 1193,
155848
- /* 250 */ 449, 449, 449, 449, 449, 449, 449, 449, 260, 177,
155849
- /* 260 */ 489, 1241, 1241, 1241, 1241, 1192, 489, 489, 952, 1197,
155850
- /* 270 */ 625, 1235, 1131, 181, 181, 1086, 1139, 1131, 1086, 1187,
155851
- /* 280 */ 1319, 1237, 1318, 1318, 1318, 181, 1299, 1299, 1109, 1336,
155852
- /* 290 */ 549, 1376, 1610, 1535, 1535, 1639, 1639, 1535, 1539, 1578,
155853
- /* 300 */ 1670, 1546, 1652, 1546, 1681, 1681, 1681, 1681, 1535, 1694,
155854
- /* 310 */ 1546, 1546, 1578, 1670, 1652, 1546, 1652, 1546, 1535, 1694,
155855
- /* 320 */ 1565, 1665, 1535, 1694, 1708, 1535, 1694, 1535, 1694, 1708,
155856
- /* 330 */ 1618, 1618, 1618, 1680, 1723, 1723, 1708, 1618, 1623, 1618,
155857
- /* 340 */ 1680, 1618, 1618, 1588, 1708, 1640, 1640, 1708, 1611, 1643,
155858
- /* 350 */ 1611, 1643, 1611, 1643, 1611, 1643, 1535, 1685, 1685, 1695,
155859
- /* 360 */ 1695, 1636, 1641, 1761, 1535, 1631, 1636, 1644, 1646, 1546,
155860
- /* 370 */ 1763, 1766, 1781, 1781, 1791, 1791, 1791, 1962, 1962, 1962,
155861
- /* 380 */ 1962, 1962, 1962, 1962, 1962, 1962, 1962, 1962, 1962, 1962,
155862
- /* 390 */ 1962, 1962, 308, 835, 954, 1232, 879, 715, 728, 1373,
155863
- /* 400 */ 864, 1329, 1253, 1409, 297, 1431, 1489, 1497, 1520, 1521,
155864
- /* 410 */ 1525, 1362, 1309, 1491, 1217, 1420, 1429, 1536, 1380, 1538,
155865
- /* 420 */ 1293, 1354, 1548, 1585, 1434, 1342, 1813, 1816, 1798, 1664,
155866
- /* 430 */ 1810, 1732, 1815, 1811, 1812, 1699, 1689, 1710, 1817, 1700,
155867
- /* 440 */ 1819, 1701, 1826, 1843, 1705, 1697, 1719, 1787, 1814, 1702,
155868
- /* 450 */ 1796, 1799, 1800, 1801, 1727, 1742, 1823, 1721, 1860, 1857,
155869
- /* 460 */ 1841, 1751, 1707, 1802, 1840, 1803, 1792, 1827, 1730, 1759,
155870
- /* 470 */ 1849, 1854, 1856, 1747, 1754, 1858, 1818, 1859, 1861, 1855,
155871
- /* 480 */ 1862, 1820, 1829, 1865, 1783, 1863, 1864, 1825, 1845, 1867,
155872
- /* 490 */ 1746, 1872, 1873, 1874, 1875, 1869, 1876, 1878, 1877, 1879,
155873
- /* 500 */ 1881, 1880, 1767, 1882, 1884, 1794, 1883, 1887, 1769, 1885,
155874
- /* 510 */ 1886, 1888, 1889, 1890, 1824, 1838, 1828, 1871, 1844, 1832,
155875
- /* 520 */ 1892, 1893, 1896, 1897, 1901, 1902, 1895, 1907, 1885, 1908,
155876
- /* 530 */ 1909, 1910, 1911, 1912, 1913, 1915, 1924, 1917, 1918, 1919,
155877
- /* 540 */ 1920, 1922, 1923, 1921, 1808, 1807, 1809, 1821, 1822, 1926,
155878
- /* 550 */ 1935, 1950, 1951,
156475
+ /* 180 */ 449, 449, 449, 449, 449, 449, 449, 449, 449, 818,
156476
+ /* 190 */ 818, 449, 1088, 217, 217, 734, 734, 891, 1130, 1968,
156477
+ /* 200 */ 1968, 1968, 739, 840, 840, 453, 454, 511, 187, 563,
156478
+ /* 210 */ 570, 898, 669, 449, 449, 449, 449, 449, 449, 449,
156479
+ /* 220 */ 449, 449, 670, 449, 449, 449, 449, 449, 449, 449,
156480
+ /* 230 */ 449, 449, 449, 449, 449, 674, 674, 674, 449, 449,
156481
+ /* 240 */ 449, 449, 1034, 449, 449, 449, 972, 1107, 449, 449,
156482
+ /* 250 */ 1193, 449, 449, 449, 449, 449, 449, 449, 449, 260,
156483
+ /* 260 */ 177, 489, 1241, 1241, 1241, 1241, 1192, 489, 489, 952,
156484
+ /* 270 */ 1197, 625, 1235, 1299, 181, 181, 881, 1279, 1279, 1299,
156485
+ /* 280 */ 881, 1016, 1139, 1100, 1311, 1311, 1311, 181, 1323, 1323,
156486
+ /* 290 */ 1207, 1372, 549, 1378, 1615, 1538, 1538, 1652, 1652, 1538,
156487
+ /* 300 */ 1546, 1582, 1674, 1550, 1658, 1550, 1695, 1695, 1695, 1695,
156488
+ /* 310 */ 1538, 1697, 1550, 1582, 1582, 1550, 1582, 1674, 1658, 1550,
156489
+ /* 320 */ 1658, 1550, 1538, 1697, 1578, 1672, 1538, 1697, 1717, 1538,
156490
+ /* 330 */ 1697, 1538, 1697, 1717, 1635, 1635, 1635, 1686, 1729, 1729,
156491
+ /* 340 */ 1717, 1635, 1633, 1635, 1686, 1635, 1635, 1597, 1717, 1649,
156492
+ /* 350 */ 1649, 1717, 1619, 1651, 1619, 1651, 1619, 1651, 1619, 1651,
156493
+ /* 360 */ 1538, 1689, 1689, 1701, 1701, 1639, 1643, 1767, 1538, 1638,
156494
+ /* 370 */ 1639, 1650, 1653, 1550, 1771, 1774, 1789, 1789, 1808, 1808,
156495
+ /* 380 */ 1808, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968,
156496
+ /* 390 */ 1968, 1968, 1968, 1968, 1968, 1968, 308, 835, 954, 1232,
156497
+ /* 400 */ 879, 715, 728, 1373, 864, 1329, 970, 1196, 1402, 297,
156498
+ /* 410 */ 1409, 1419, 1429, 1431, 1453, 1497, 1242, 1345, 1491, 1424,
156499
+ /* 420 */ 1362, 1521, 1523, 1423, 1525, 1363, 1412, 1548, 1585, 1495,
156500
+ /* 430 */ 1382, 1826, 1830, 1813, 1676, 1822, 1740, 1823, 1817, 1818,
156501
+ /* 440 */ 1705, 1696, 1715, 1821, 1706, 1827, 1707, 1832, 1849, 1711,
156502
+ /* 450 */ 1724, 1725, 1793, 1819, 1709, 1802, 1805, 1806, 1807, 1733,
156503
+ /* 460 */ 1748, 1829, 1730, 1863, 1865, 1846, 1758, 1714, 1809, 1847,
156504
+ /* 470 */ 1810, 1799, 1834, 1737, 1766, 1856, 1861, 1864, 1753, 1761,
156505
+ /* 480 */ 1866, 1820, 1867, 1868, 1862, 1869, 1825, 1835, 1871, 1790,
156506
+ /* 490 */ 1870, 1874, 1833, 1860, 1876, 1746, 1879, 1880, 1881, 1882,
156507
+ /* 500 */ 1883, 1884, 1886, 1878, 1887, 1889, 1888, 1775, 1890, 1892,
156508
+ /* 510 */ 1792, 1885, 1894, 1776, 1895, 1891, 1893, 1896, 1897, 1836,
156509
+ /* 520 */ 1843, 1837, 1898, 1845, 1839, 1899, 1903, 1900, 1904, 1908,
156510
+ /* 530 */ 1909, 1902, 1906, 1895, 1914, 1915, 1916, 1917, 1918, 1920,
156511
+ /* 540 */ 1919, 1934, 1924, 1925, 1926, 1927, 1929, 1930, 1922, 1824,
156512
+ /* 550 */ 1814, 1815, 1816, 1828, 1933, 1943, 1958, 1959,
155879156513
};
155880
-#define YY_REDUCE_COUNT (391)
156514
+#define YY_REDUCE_COUNT (395)
155881156515
#define YY_REDUCE_MIN (-262)
155882
-#define YY_REDUCE_MAX (1625)
156516
+#define YY_REDUCE_MAX (1629)
155883156517
static const short yy_reduce_ofst[] = {
155884156518
/* 0 */ 490, -122, 545, 645, 650, -120, -189, -187, -184, -182,
155885156519
/* 10 */ -178, -176, 45, 30, 200, -251, -134, 390, 392, 521,
155886156520
/* 20 */ 523, 213, 692, 821, 284, 589, 872, 666, 671, 866,
155887156521
/* 30 */ 71, 111, 273, 389, 686, 815, 904, 932, 948, 955,
@@ -155895,92 +156529,92 @@
155895156529
/* 110 */ 1285, 1313, 1316, 1320, 1322, 1325, 1327, 1330, 1366, 1371,
155896156530
/* 120 */ 1379, 1387, 1417, 1425, 1430, 1432, -259, -259, -259, -259,
155897156531
/* 130 */ -259, -259, -259, -259, -259, 557, 974, -214, -174, -9,
155898156532
/* 140 */ 431, -124, 806, 925, 806, 925, 251, 928, 940, -259,
155899156533
/* 150 */ -259, -259, -259, -198, -198, -198, 127, -186, -168, 212,
155900
- /* 160 */ 646, 617, 799, -262, 555, 220, 220, 491, 605, 1040,
155901
- /* 170 */ 1060, 699, -11, 600, 848, 862, 345, -129, 724, -91,
155902
- /* 180 */ 158, 749, 716, 900, 304, 822, 929, 926, 499, 793,
155903
- /* 190 */ 322, 892, 813, 845, 958, 1056, 751, 905, 1133, 1062,
155904
- /* 200 */ 803, -210, -185, -179, -148, -167, -89, 121, 274, 281,
155905
- /* 210 */ 320, 336, 439, 663, 711, 957, 965, 1064, 1068, 1112,
155906
- /* 220 */ 1116, -196, 1127, 1134, 1180, 1184, 1195, 1199, 1203, 1215,
155907
- /* 230 */ 1223, 1250, 1267, 1286, 205, 422, 638, 1324, 1341, 1364,
155908
- /* 240 */ 1365, 1213, 1392, 1399, 1403, 869, 1260, 1405, 1421, 1276,
155909
- /* 250 */ 1424, 121, 1426, 1427, 1428, 1433, 1436, 1437, 1227, 1338,
155910
- /* 260 */ 1284, 1359, 1370, 1377, 1388, 1213, 1284, 1284, 1385, 1438,
155911
- /* 270 */ 1443, 1349, 1400, 1391, 1394, 1360, 1408, 1410, 1367, 1439,
155912
- /* 280 */ 1440, 1435, 1442, 1446, 1447, 1397, 1413, 1418, 1390, 1444,
155913
- /* 290 */ 1445, 1474, 1381, 1479, 1480, 1401, 1402, 1490, 1414, 1449,
155914
- /* 300 */ 1452, 1453, 1467, 1456, 1469, 1470, 1477, 1478, 1515, 1518,
155915
- /* 310 */ 1476, 1482, 1450, 1454, 1492, 1483, 1493, 1484, 1523, 1531,
155916
- /* 320 */ 1457, 1455, 1532, 1534, 1516, 1537, 1540, 1543, 1541, 1526,
155917
- /* 330 */ 1528, 1530, 1542, 1512, 1529, 1533, 1544, 1545, 1547, 1550,
155918
- /* 340 */ 1549, 1551, 1554, 1458, 1552, 1494, 1495, 1556, 1498, 1502,
155919
- /* 350 */ 1503, 1511, 1517, 1519, 1522, 1524, 1579, 1472, 1473, 1527,
155920
- /* 360 */ 1555, 1557, 1559, 1558, 1589, 1560, 1561, 1564, 1566, 1568,
155921
- /* 370 */ 1592, 1595, 1605, 1606, 1612, 1613, 1622, 1562, 1563, 1505,
155922
- /* 380 */ 1609, 1604, 1608, 1614, 1615, 1616, 1596, 1597, 1617, 1620,
155923
- /* 390 */ 1625, 1619,
156534
+ /* 160 */ 646, 749, 617, 799, -262, 555, 220, 220, 491, 605,
156535
+ /* 170 */ 1040, 1060, 699, -11, 600, 848, 862, 345, -129, 724,
156536
+ /* 180 */ -91, 158, 808, 716, 900, 304, 869, 929, 926, 499,
156537
+ /* 190 */ 813, 322, 892, 845, 857, 1056, 1059, 908, 1036, 993,
156538
+ /* 200 */ 1062, 1097, -210, -185, -179, -148, -167, -89, 121, 274,
156539
+ /* 210 */ 281, 320, 336, 439, 663, 1011, 1064, 1068, 1075, 1127,
156540
+ /* 220 */ 1180, 1184, -196, 1191, 1195, 1199, 1203, 1223, 1238, 1254,
156541
+ /* 230 */ 1267, 1286, 1292, 1304, 1315, 205, 422, 638, 1319, 1341,
156542
+ /* 240 */ 1346, 1370, 1058, 1380, 1392, 1399, 1342, 1252, 1405, 1420,
156543
+ /* 250 */ 1384, 1427, 121, 1428, 1433, 1434, 1436, 1437, 1438, 1337,
156544
+ /* 260 */ 1333, 1383, 1388, 1389, 1390, 1395, 1058, 1383, 1383, 1408,
156545
+ /* 270 */ 1421, 1460, 1358, 1410, 1397, 1400, 1367, 1414, 1415, 1422,
156546
+ /* 280 */ 1374, 1442, 1439, 1441, 1435, 1450, 1452, 1416, 1440, 1443,
156547
+ /* 290 */ 1398, 1446, 1445, 1482, 1386, 1492, 1493, 1404, 1406, 1496,
156548
+ /* 300 */ 1426, 1444, 1447, 1458, 1483, 1469, 1484, 1485, 1486, 1487,
156549
+ /* 310 */ 1518, 1526, 1479, 1457, 1459, 1488, 1461, 1463, 1494, 1489,
156550
+ /* 320 */ 1499, 1490, 1529, 1537, 1454, 1462, 1539, 1541, 1524, 1545,
156551
+ /* 330 */ 1547, 1549, 1552, 1527, 1540, 1542, 1543, 1530, 1535, 1544,
156552
+ /* 340 */ 1551, 1555, 1554, 1557, 1536, 1558, 1559, 1470, 1560, 1500,
156553
+ /* 350 */ 1502, 1562, 1506, 1511, 1528, 1519, 1531, 1533, 1534, 1556,
156554
+ /* 360 */ 1583, 1473, 1474, 1532, 1561, 1563, 1565, 1564, 1595, 1522,
156555
+ /* 370 */ 1567, 1570, 1568, 1566, 1599, 1603, 1613, 1616, 1627, 1628,
156556
+ /* 380 */ 1629, 1569, 1571, 1573, 1617, 1610, 1612, 1614, 1618, 1621,
156557
+ /* 390 */ 1607, 1608, 1620, 1622, 1624, 1626,
155924156558
};
155925156559
static const YYACTIONTYPE yy_default[] = {
155926
- /* 0 */ 1575, 1575, 1575, 1411, 1188, 1297, 1188, 1188, 1188, 1411,
155927
- /* 10 */ 1411, 1411, 1188, 1327, 1327, 1464, 1219, 1188, 1188, 1188,
155928
- /* 20 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1410, 1188, 1188,
155929
- /* 30 */ 1188, 1188, 1494, 1494, 1188, 1188, 1188, 1188, 1188, 1188,
155930
- /* 40 */ 1188, 1188, 1188, 1336, 1188, 1188, 1188, 1188, 1188, 1188,
155931
- /* 50 */ 1412, 1413, 1188, 1188, 1188, 1463, 1465, 1428, 1346, 1345,
155932
- /* 60 */ 1344, 1343, 1446, 1314, 1341, 1334, 1338, 1406, 1407, 1405,
155933
- /* 70 */ 1409, 1413, 1412, 1188, 1337, 1377, 1391, 1376, 1188, 1188,
155934
- /* 80 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155935
- /* 90 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155936
- /* 100 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155937
- /* 110 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155938
- /* 120 */ 1188, 1188, 1188, 1188, 1188, 1188, 1385, 1390, 1396, 1389,
155939
- /* 130 */ 1386, 1379, 1378, 1380, 1381, 1188, 1209, 1261, 1188, 1188,
155940
- /* 140 */ 1188, 1188, 1482, 1481, 1188, 1188, 1219, 1371, 1370, 1382,
155941
- /* 150 */ 1383, 1393, 1392, 1471, 1529, 1528, 1429, 1188, 1188, 1188,
155942
- /* 160 */ 1188, 1188, 1188, 1494, 1188, 1188, 1188, 1188, 1188, 1188,
155943
- /* 170 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155944
- /* 180 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1494, 1494,
155945
- /* 190 */ 1188, 1219, 1494, 1494, 1215, 1215, 1321, 1188, 1477, 1297,
155946
- /* 200 */ 1288, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155947
- /* 210 */ 1188, 1188, 1188, 1188, 1188, 1468, 1466, 1188, 1188, 1188,
155948
- /* 220 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155949
- /* 230 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155950
- /* 240 */ 1188, 1188, 1188, 1188, 1188, 1293, 1188, 1188, 1188, 1188,
155951
- /* 250 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1523, 1188, 1441,
155952
- /* 260 */ 1275, 1293, 1293, 1293, 1293, 1295, 1276, 1274, 1287, 1220,
155953
- /* 270 */ 1195, 1567, 1294, 1316, 1316, 1564, 1340, 1294, 1564, 1236,
155954
- /* 280 */ 1545, 1231, 1327, 1327, 1327, 1316, 1321, 1321, 1408, 1294,
155955
- /* 290 */ 1287, 1188, 1567, 1302, 1302, 1566, 1566, 1302, 1429, 1349,
155956
- /* 300 */ 1355, 1340, 1264, 1340, 1270, 1270, 1270, 1270, 1302, 1206,
155957
- /* 310 */ 1340, 1340, 1349, 1355, 1264, 1340, 1264, 1340, 1302, 1206,
155958
- /* 320 */ 1445, 1561, 1302, 1206, 1419, 1302, 1206, 1302, 1206, 1419,
155959
- /* 330 */ 1262, 1262, 1262, 1251, 1188, 1188, 1419, 1262, 1236, 1262,
155960
- /* 340 */ 1251, 1262, 1262, 1512, 1419, 1423, 1423, 1419, 1320, 1315,
155961
- /* 350 */ 1320, 1315, 1320, 1315, 1320, 1315, 1302, 1504, 1504, 1330,
155962
- /* 360 */ 1330, 1335, 1321, 1414, 1302, 1188, 1335, 1333, 1331, 1340,
155963
- /* 370 */ 1212, 1254, 1526, 1526, 1522, 1522, 1522, 1572, 1572, 1477,
155964
- /* 380 */ 1538, 1219, 1219, 1219, 1219, 1538, 1238, 1238, 1220, 1220,
155965
- /* 390 */ 1219, 1538, 1188, 1188, 1188, 1188, 1188, 1188, 1533, 1188,
155966
- /* 400 */ 1430, 1306, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155967
- /* 410 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155968
- /* 420 */ 1188, 1188, 1188, 1188, 1188, 1360, 1188, 1191, 1474, 1188,
155969
- /* 430 */ 1188, 1472, 1188, 1188, 1188, 1188, 1188, 1188, 1307, 1188,
155970
- /* 440 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155971
- /* 450 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1563, 1188, 1188,
155972
- /* 460 */ 1188, 1188, 1188, 1188, 1444, 1443, 1188, 1188, 1304, 1188,
155973
- /* 470 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155974
- /* 480 */ 1188, 1188, 1234, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155975
- /* 490 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155976
- /* 500 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1332,
155977
- /* 510 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155978
- /* 520 */ 1188, 1188, 1188, 1188, 1509, 1322, 1188, 1188, 1554, 1188,
155979
- /* 530 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155980
- /* 540 */ 1188, 1188, 1188, 1549, 1278, 1362, 1188, 1361, 1365, 1188,
155981
- /* 550 */ 1200, 1188, 1188,
156560
+ /* 0 */ 1583, 1583, 1583, 1419, 1195, 1304, 1195, 1195, 1195, 1419,
156561
+ /* 10 */ 1419, 1419, 1195, 1334, 1334, 1472, 1226, 1195, 1195, 1195,
156562
+ /* 20 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1418, 1195, 1195,
156563
+ /* 30 */ 1195, 1195, 1502, 1502, 1195, 1195, 1195, 1195, 1195, 1195,
156564
+ /* 40 */ 1195, 1195, 1195, 1343, 1195, 1195, 1195, 1195, 1195, 1195,
156565
+ /* 50 */ 1420, 1421, 1195, 1195, 1195, 1471, 1473, 1436, 1353, 1352,
156566
+ /* 60 */ 1351, 1350, 1454, 1321, 1348, 1341, 1345, 1414, 1415, 1413,
156567
+ /* 70 */ 1417, 1421, 1420, 1195, 1344, 1385, 1399, 1384, 1195, 1195,
156568
+ /* 80 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156569
+ /* 90 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156570
+ /* 100 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156571
+ /* 110 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156572
+ /* 120 */ 1195, 1195, 1195, 1195, 1195, 1195, 1393, 1398, 1404, 1397,
156573
+ /* 130 */ 1394, 1387, 1386, 1388, 1389, 1195, 1216, 1268, 1195, 1195,
156574
+ /* 140 */ 1195, 1195, 1490, 1489, 1195, 1195, 1226, 1379, 1378, 1390,
156575
+ /* 150 */ 1391, 1401, 1400, 1479, 1537, 1536, 1437, 1195, 1195, 1195,
156576
+ /* 160 */ 1195, 1195, 1195, 1195, 1502, 1195, 1195, 1195, 1195, 1195,
156577
+ /* 170 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156578
+ /* 180 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1502,
156579
+ /* 190 */ 1502, 1195, 1226, 1502, 1502, 1222, 1222, 1328, 1195, 1485,
156580
+ /* 200 */ 1304, 1295, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156581
+ /* 210 */ 1195, 1195, 1195, 1195, 1195, 1195, 1476, 1474, 1195, 1195,
156582
+ /* 220 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156583
+ /* 230 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156584
+ /* 240 */ 1195, 1195, 1195, 1195, 1195, 1195, 1300, 1195, 1195, 1195,
156585
+ /* 250 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1531, 1195,
156586
+ /* 260 */ 1449, 1282, 1300, 1300, 1300, 1300, 1302, 1283, 1281, 1294,
156587
+ /* 270 */ 1227, 1202, 1575, 1301, 1323, 1323, 1572, 1347, 1347, 1301,
156588
+ /* 280 */ 1572, 1243, 1553, 1238, 1334, 1334, 1334, 1323, 1328, 1328,
156589
+ /* 290 */ 1416, 1301, 1294, 1195, 1575, 1309, 1309, 1574, 1574, 1309,
156590
+ /* 300 */ 1437, 1356, 1363, 1347, 1271, 1347, 1277, 1277, 1277, 1277,
156591
+ /* 310 */ 1309, 1213, 1347, 1356, 1356, 1347, 1356, 1363, 1271, 1347,
156592
+ /* 320 */ 1271, 1347, 1309, 1213, 1453, 1569, 1309, 1213, 1427, 1309,
156593
+ /* 330 */ 1213, 1309, 1213, 1427, 1269, 1269, 1269, 1258, 1195, 1195,
156594
+ /* 340 */ 1427, 1269, 1243, 1269, 1258, 1269, 1269, 1520, 1427, 1431,
156595
+ /* 350 */ 1431, 1427, 1327, 1322, 1327, 1322, 1327, 1322, 1327, 1322,
156596
+ /* 360 */ 1309, 1512, 1512, 1337, 1337, 1342, 1328, 1422, 1309, 1195,
156597
+ /* 370 */ 1342, 1340, 1338, 1347, 1219, 1261, 1534, 1534, 1530, 1530,
156598
+ /* 380 */ 1530, 1580, 1580, 1485, 1546, 1226, 1226, 1226, 1226, 1546,
156599
+ /* 390 */ 1245, 1245, 1227, 1227, 1226, 1546, 1195, 1195, 1195, 1195,
156600
+ /* 400 */ 1195, 1195, 1541, 1195, 1438, 1313, 1195, 1195, 1195, 1195,
156601
+ /* 410 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156602
+ /* 420 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156603
+ /* 430 */ 1368, 1195, 1198, 1482, 1195, 1195, 1480, 1195, 1195, 1195,
156604
+ /* 440 */ 1195, 1195, 1195, 1314, 1195, 1195, 1195, 1195, 1195, 1195,
156605
+ /* 450 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156606
+ /* 460 */ 1195, 1195, 1571, 1195, 1195, 1195, 1195, 1195, 1195, 1452,
156607
+ /* 470 */ 1451, 1195, 1195, 1311, 1195, 1195, 1195, 1195, 1195, 1195,
156608
+ /* 480 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1241, 1195, 1195,
156609
+ /* 490 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156610
+ /* 500 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156611
+ /* 510 */ 1195, 1195, 1195, 1195, 1339, 1195, 1195, 1195, 1195, 1195,
156612
+ /* 520 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1517,
156613
+ /* 530 */ 1329, 1195, 1195, 1562, 1195, 1195, 1195, 1195, 1195, 1195,
156614
+ /* 540 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1557, 1285,
156615
+ /* 550 */ 1370, 1195, 1369, 1373, 1195, 1207, 1195, 1195,
155982156616
};
155983156617
/********** End of lemon-generated parsing tables *****************************/
155984156618
155985156619
/* The next table maps tokens (terminal symbols) into fallback tokens.
155986156620
** If a construct like the following:
@@ -156741,236 +157375,237 @@
156741157375
/* 154 */ "setlist ::= nm EQ expr",
156742157376
/* 155 */ "setlist ::= LP idlist RP EQ expr",
156743157377
/* 156 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert",
156744157378
/* 157 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES",
156745157379
/* 158 */ "upsert ::=",
156746
- /* 159 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt",
156747
- /* 160 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING",
157380
+ /* 159 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert",
157381
+ /* 160 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert",
156748157382
/* 161 */ "upsert ::= ON CONFLICT DO NOTHING",
156749
- /* 162 */ "insert_cmd ::= INSERT orconf",
156750
- /* 163 */ "insert_cmd ::= REPLACE",
156751
- /* 164 */ "idlist_opt ::=",
156752
- /* 165 */ "idlist_opt ::= LP idlist RP",
156753
- /* 166 */ "idlist ::= idlist COMMA nm",
156754
- /* 167 */ "idlist ::= nm",
156755
- /* 168 */ "expr ::= LP expr RP",
156756
- /* 169 */ "expr ::= ID|INDEXED",
156757
- /* 170 */ "expr ::= JOIN_KW",
156758
- /* 171 */ "expr ::= nm DOT nm",
156759
- /* 172 */ "expr ::= nm DOT nm DOT nm",
156760
- /* 173 */ "term ::= NULL|FLOAT|BLOB",
156761
- /* 174 */ "term ::= STRING",
156762
- /* 175 */ "term ::= INTEGER",
156763
- /* 176 */ "expr ::= VARIABLE",
156764
- /* 177 */ "expr ::= expr COLLATE ID|STRING",
156765
- /* 178 */ "expr ::= CAST LP expr AS typetoken RP",
156766
- /* 179 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
156767
- /* 180 */ "expr ::= ID|INDEXED LP STAR RP",
156768
- /* 181 */ "expr ::= ID|INDEXED LP distinct exprlist RP filter_over",
156769
- /* 182 */ "expr ::= ID|INDEXED LP STAR RP filter_over",
156770
- /* 183 */ "term ::= CTIME_KW",
156771
- /* 184 */ "expr ::= LP nexprlist COMMA expr RP",
156772
- /* 185 */ "expr ::= expr AND expr",
156773
- /* 186 */ "expr ::= expr OR expr",
156774
- /* 187 */ "expr ::= expr LT|GT|GE|LE expr",
156775
- /* 188 */ "expr ::= expr EQ|NE expr",
156776
- /* 189 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
156777
- /* 190 */ "expr ::= expr PLUS|MINUS expr",
156778
- /* 191 */ "expr ::= expr STAR|SLASH|REM expr",
156779
- /* 192 */ "expr ::= expr CONCAT expr",
156780
- /* 193 */ "likeop ::= NOT LIKE_KW|MATCH",
156781
- /* 194 */ "expr ::= expr likeop expr",
156782
- /* 195 */ "expr ::= expr likeop expr ESCAPE expr",
156783
- /* 196 */ "expr ::= expr ISNULL|NOTNULL",
156784
- /* 197 */ "expr ::= expr NOT NULL",
156785
- /* 198 */ "expr ::= expr IS expr",
156786
- /* 199 */ "expr ::= expr IS NOT expr",
156787
- /* 200 */ "expr ::= NOT expr",
156788
- /* 201 */ "expr ::= BITNOT expr",
156789
- /* 202 */ "expr ::= PLUS|MINUS expr",
156790
- /* 203 */ "between_op ::= BETWEEN",
156791
- /* 204 */ "between_op ::= NOT BETWEEN",
156792
- /* 205 */ "expr ::= expr between_op expr AND expr",
156793
- /* 206 */ "in_op ::= IN",
156794
- /* 207 */ "in_op ::= NOT IN",
156795
- /* 208 */ "expr ::= expr in_op LP exprlist RP",
156796
- /* 209 */ "expr ::= LP select RP",
156797
- /* 210 */ "expr ::= expr in_op LP select RP",
156798
- /* 211 */ "expr ::= expr in_op nm dbnm paren_exprlist",
156799
- /* 212 */ "expr ::= EXISTS LP select RP",
156800
- /* 213 */ "expr ::= CASE case_operand case_exprlist case_else END",
156801
- /* 214 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
156802
- /* 215 */ "case_exprlist ::= WHEN expr THEN expr",
156803
- /* 216 */ "case_else ::= ELSE expr",
156804
- /* 217 */ "case_else ::=",
156805
- /* 218 */ "case_operand ::= expr",
156806
- /* 219 */ "case_operand ::=",
156807
- /* 220 */ "exprlist ::=",
156808
- /* 221 */ "nexprlist ::= nexprlist COMMA expr",
156809
- /* 222 */ "nexprlist ::= expr",
156810
- /* 223 */ "paren_exprlist ::=",
156811
- /* 224 */ "paren_exprlist ::= LP exprlist RP",
156812
- /* 225 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
156813
- /* 226 */ "uniqueflag ::= UNIQUE",
156814
- /* 227 */ "uniqueflag ::=",
156815
- /* 228 */ "eidlist_opt ::=",
156816
- /* 229 */ "eidlist_opt ::= LP eidlist RP",
156817
- /* 230 */ "eidlist ::= eidlist COMMA nm collate sortorder",
156818
- /* 231 */ "eidlist ::= nm collate sortorder",
156819
- /* 232 */ "collate ::=",
156820
- /* 233 */ "collate ::= COLLATE ID|STRING",
156821
- /* 234 */ "cmd ::= DROP INDEX ifexists fullname",
156822
- /* 235 */ "cmd ::= VACUUM vinto",
156823
- /* 236 */ "cmd ::= VACUUM nm vinto",
156824
- /* 237 */ "vinto ::= INTO expr",
156825
- /* 238 */ "vinto ::=",
156826
- /* 239 */ "cmd ::= PRAGMA nm dbnm",
156827
- /* 240 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
156828
- /* 241 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
156829
- /* 242 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
156830
- /* 243 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
156831
- /* 244 */ "plus_num ::= PLUS INTEGER|FLOAT",
156832
- /* 245 */ "minus_num ::= MINUS INTEGER|FLOAT",
156833
- /* 246 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
156834
- /* 247 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
156835
- /* 248 */ "trigger_time ::= BEFORE|AFTER",
156836
- /* 249 */ "trigger_time ::= INSTEAD OF",
156837
- /* 250 */ "trigger_time ::=",
156838
- /* 251 */ "trigger_event ::= DELETE|INSERT",
156839
- /* 252 */ "trigger_event ::= UPDATE",
156840
- /* 253 */ "trigger_event ::= UPDATE OF idlist",
156841
- /* 254 */ "when_clause ::=",
156842
- /* 255 */ "when_clause ::= WHEN expr",
156843
- /* 256 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
156844
- /* 257 */ "trigger_cmd_list ::= trigger_cmd SEMI",
156845
- /* 258 */ "trnm ::= nm DOT nm",
156846
- /* 259 */ "tridxby ::= INDEXED BY nm",
156847
- /* 260 */ "tridxby ::= NOT INDEXED",
156848
- /* 261 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt",
156849
- /* 262 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt",
156850
- /* 263 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
156851
- /* 264 */ "trigger_cmd ::= scanpt select scanpt",
156852
- /* 265 */ "expr ::= RAISE LP IGNORE RP",
156853
- /* 266 */ "expr ::= RAISE LP raisetype COMMA nm RP",
156854
- /* 267 */ "raisetype ::= ROLLBACK",
156855
- /* 268 */ "raisetype ::= ABORT",
156856
- /* 269 */ "raisetype ::= FAIL",
156857
- /* 270 */ "cmd ::= DROP TRIGGER ifexists fullname",
156858
- /* 271 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
156859
- /* 272 */ "cmd ::= DETACH database_kw_opt expr",
156860
- /* 273 */ "key_opt ::=",
156861
- /* 274 */ "key_opt ::= KEY expr",
156862
- /* 275 */ "cmd ::= REINDEX",
156863
- /* 276 */ "cmd ::= REINDEX nm dbnm",
156864
- /* 277 */ "cmd ::= ANALYZE",
156865
- /* 278 */ "cmd ::= ANALYZE nm dbnm",
156866
- /* 279 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
156867
- /* 280 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
156868
- /* 281 */ "add_column_fullname ::= fullname",
156869
- /* 282 */ "cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm",
156870
- /* 283 */ "cmd ::= create_vtab",
156871
- /* 284 */ "cmd ::= create_vtab LP vtabarglist RP",
156872
- /* 285 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
156873
- /* 286 */ "vtabarg ::=",
156874
- /* 287 */ "vtabargtoken ::= ANY",
156875
- /* 288 */ "vtabargtoken ::= lp anylist RP",
156876
- /* 289 */ "lp ::= LP",
156877
- /* 290 */ "with ::= WITH wqlist",
156878
- /* 291 */ "with ::= WITH RECURSIVE wqlist",
156879
- /* 292 */ "wqlist ::= nm eidlist_opt AS LP select RP",
156880
- /* 293 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
156881
- /* 294 */ "windowdefn_list ::= windowdefn",
156882
- /* 295 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
156883
- /* 296 */ "windowdefn ::= nm AS LP window RP",
156884
- /* 297 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
156885
- /* 298 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
156886
- /* 299 */ "window ::= ORDER BY sortlist frame_opt",
156887
- /* 300 */ "window ::= nm ORDER BY sortlist frame_opt",
156888
- /* 301 */ "window ::= frame_opt",
156889
- /* 302 */ "window ::= nm frame_opt",
156890
- /* 303 */ "frame_opt ::=",
156891
- /* 304 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
156892
- /* 305 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
156893
- /* 306 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
156894
- /* 307 */ "frame_bound_s ::= frame_bound",
156895
- /* 308 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
156896
- /* 309 */ "frame_bound_e ::= frame_bound",
156897
- /* 310 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
156898
- /* 311 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
156899
- /* 312 */ "frame_bound ::= CURRENT ROW",
156900
- /* 313 */ "frame_exclude_opt ::=",
156901
- /* 314 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
156902
- /* 315 */ "frame_exclude ::= NO OTHERS",
156903
- /* 316 */ "frame_exclude ::= CURRENT ROW",
156904
- /* 317 */ "frame_exclude ::= GROUP|TIES",
156905
- /* 318 */ "window_clause ::= WINDOW windowdefn_list",
156906
- /* 319 */ "filter_over ::= filter_clause over_clause",
156907
- /* 320 */ "filter_over ::= over_clause",
156908
- /* 321 */ "filter_over ::= filter_clause",
156909
- /* 322 */ "over_clause ::= OVER LP window RP",
156910
- /* 323 */ "over_clause ::= OVER nm",
156911
- /* 324 */ "filter_clause ::= FILTER LP WHERE expr RP",
156912
- /* 325 */ "input ::= cmdlist",
156913
- /* 326 */ "cmdlist ::= cmdlist ecmd",
156914
- /* 327 */ "cmdlist ::= ecmd",
156915
- /* 328 */ "ecmd ::= SEMI",
156916
- /* 329 */ "ecmd ::= cmdx SEMI",
156917
- /* 330 */ "ecmd ::= explain cmdx SEMI",
156918
- /* 331 */ "trans_opt ::=",
156919
- /* 332 */ "trans_opt ::= TRANSACTION",
156920
- /* 333 */ "trans_opt ::= TRANSACTION nm",
156921
- /* 334 */ "savepoint_opt ::= SAVEPOINT",
156922
- /* 335 */ "savepoint_opt ::=",
156923
- /* 336 */ "cmd ::= create_table create_table_args",
156924
- /* 337 */ "columnlist ::= columnlist COMMA columnname carglist",
156925
- /* 338 */ "columnlist ::= columnname carglist",
156926
- /* 339 */ "nm ::= ID|INDEXED",
156927
- /* 340 */ "nm ::= STRING",
156928
- /* 341 */ "nm ::= JOIN_KW",
156929
- /* 342 */ "typetoken ::= typename",
156930
- /* 343 */ "typename ::= ID|STRING",
156931
- /* 344 */ "signed ::= plus_num",
156932
- /* 345 */ "signed ::= minus_num",
156933
- /* 346 */ "carglist ::= carglist ccons",
156934
- /* 347 */ "carglist ::=",
156935
- /* 348 */ "ccons ::= NULL onconf",
156936
- /* 349 */ "ccons ::= GENERATED ALWAYS AS generated",
156937
- /* 350 */ "ccons ::= AS generated",
156938
- /* 351 */ "conslist_opt ::= COMMA conslist",
156939
- /* 352 */ "conslist ::= conslist tconscomma tcons",
156940
- /* 353 */ "conslist ::= tcons",
156941
- /* 354 */ "tconscomma ::=",
156942
- /* 355 */ "defer_subclause_opt ::= defer_subclause",
156943
- /* 356 */ "resolvetype ::= raisetype",
156944
- /* 357 */ "selectnowith ::= oneselect",
156945
- /* 358 */ "oneselect ::= values",
156946
- /* 359 */ "sclp ::= selcollist COMMA",
156947
- /* 360 */ "as ::= ID|STRING",
156948
- /* 361 */ "expr ::= term",
156949
- /* 362 */ "likeop ::= LIKE_KW|MATCH",
156950
- /* 363 */ "exprlist ::= nexprlist",
156951
- /* 364 */ "nmnum ::= plus_num",
156952
- /* 365 */ "nmnum ::= nm",
156953
- /* 366 */ "nmnum ::= ON",
156954
- /* 367 */ "nmnum ::= DELETE",
156955
- /* 368 */ "nmnum ::= DEFAULT",
156956
- /* 369 */ "plus_num ::= INTEGER|FLOAT",
156957
- /* 370 */ "foreach_clause ::=",
156958
- /* 371 */ "foreach_clause ::= FOR EACH ROW",
156959
- /* 372 */ "trnm ::= nm",
156960
- /* 373 */ "tridxby ::=",
156961
- /* 374 */ "database_kw_opt ::= DATABASE",
156962
- /* 375 */ "database_kw_opt ::=",
156963
- /* 376 */ "kwcolumn_opt ::=",
156964
- /* 377 */ "kwcolumn_opt ::= COLUMNKW",
156965
- /* 378 */ "vtabarglist ::= vtabarg",
156966
- /* 379 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
156967
- /* 380 */ "vtabarg ::= vtabarg vtabargtoken",
156968
- /* 381 */ "anylist ::=",
156969
- /* 382 */ "anylist ::= anylist LP anylist RP",
156970
- /* 383 */ "anylist ::= anylist ANY",
156971
- /* 384 */ "with ::=",
157383
+ /* 162 */ "upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt",
157384
+ /* 163 */ "insert_cmd ::= INSERT orconf",
157385
+ /* 164 */ "insert_cmd ::= REPLACE",
157386
+ /* 165 */ "idlist_opt ::=",
157387
+ /* 166 */ "idlist_opt ::= LP idlist RP",
157388
+ /* 167 */ "idlist ::= idlist COMMA nm",
157389
+ /* 168 */ "idlist ::= nm",
157390
+ /* 169 */ "expr ::= LP expr RP",
157391
+ /* 170 */ "expr ::= ID|INDEXED",
157392
+ /* 171 */ "expr ::= JOIN_KW",
157393
+ /* 172 */ "expr ::= nm DOT nm",
157394
+ /* 173 */ "expr ::= nm DOT nm DOT nm",
157395
+ /* 174 */ "term ::= NULL|FLOAT|BLOB",
157396
+ /* 175 */ "term ::= STRING",
157397
+ /* 176 */ "term ::= INTEGER",
157398
+ /* 177 */ "expr ::= VARIABLE",
157399
+ /* 178 */ "expr ::= expr COLLATE ID|STRING",
157400
+ /* 179 */ "expr ::= CAST LP expr AS typetoken RP",
157401
+ /* 180 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
157402
+ /* 181 */ "expr ::= ID|INDEXED LP STAR RP",
157403
+ /* 182 */ "expr ::= ID|INDEXED LP distinct exprlist RP filter_over",
157404
+ /* 183 */ "expr ::= ID|INDEXED LP STAR RP filter_over",
157405
+ /* 184 */ "term ::= CTIME_KW",
157406
+ /* 185 */ "expr ::= LP nexprlist COMMA expr RP",
157407
+ /* 186 */ "expr ::= expr AND expr",
157408
+ /* 187 */ "expr ::= expr OR expr",
157409
+ /* 188 */ "expr ::= expr LT|GT|GE|LE expr",
157410
+ /* 189 */ "expr ::= expr EQ|NE expr",
157411
+ /* 190 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
157412
+ /* 191 */ "expr ::= expr PLUS|MINUS expr",
157413
+ /* 192 */ "expr ::= expr STAR|SLASH|REM expr",
157414
+ /* 193 */ "expr ::= expr CONCAT expr",
157415
+ /* 194 */ "likeop ::= NOT LIKE_KW|MATCH",
157416
+ /* 195 */ "expr ::= expr likeop expr",
157417
+ /* 196 */ "expr ::= expr likeop expr ESCAPE expr",
157418
+ /* 197 */ "expr ::= expr ISNULL|NOTNULL",
157419
+ /* 198 */ "expr ::= expr NOT NULL",
157420
+ /* 199 */ "expr ::= expr IS expr",
157421
+ /* 200 */ "expr ::= expr IS NOT expr",
157422
+ /* 201 */ "expr ::= NOT expr",
157423
+ /* 202 */ "expr ::= BITNOT expr",
157424
+ /* 203 */ "expr ::= PLUS|MINUS expr",
157425
+ /* 204 */ "between_op ::= BETWEEN",
157426
+ /* 205 */ "between_op ::= NOT BETWEEN",
157427
+ /* 206 */ "expr ::= expr between_op expr AND expr",
157428
+ /* 207 */ "in_op ::= IN",
157429
+ /* 208 */ "in_op ::= NOT IN",
157430
+ /* 209 */ "expr ::= expr in_op LP exprlist RP",
157431
+ /* 210 */ "expr ::= LP select RP",
157432
+ /* 211 */ "expr ::= expr in_op LP select RP",
157433
+ /* 212 */ "expr ::= expr in_op nm dbnm paren_exprlist",
157434
+ /* 213 */ "expr ::= EXISTS LP select RP",
157435
+ /* 214 */ "expr ::= CASE case_operand case_exprlist case_else END",
157436
+ /* 215 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
157437
+ /* 216 */ "case_exprlist ::= WHEN expr THEN expr",
157438
+ /* 217 */ "case_else ::= ELSE expr",
157439
+ /* 218 */ "case_else ::=",
157440
+ /* 219 */ "case_operand ::= expr",
157441
+ /* 220 */ "case_operand ::=",
157442
+ /* 221 */ "exprlist ::=",
157443
+ /* 222 */ "nexprlist ::= nexprlist COMMA expr",
157444
+ /* 223 */ "nexprlist ::= expr",
157445
+ /* 224 */ "paren_exprlist ::=",
157446
+ /* 225 */ "paren_exprlist ::= LP exprlist RP",
157447
+ /* 226 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
157448
+ /* 227 */ "uniqueflag ::= UNIQUE",
157449
+ /* 228 */ "uniqueflag ::=",
157450
+ /* 229 */ "eidlist_opt ::=",
157451
+ /* 230 */ "eidlist_opt ::= LP eidlist RP",
157452
+ /* 231 */ "eidlist ::= eidlist COMMA nm collate sortorder",
157453
+ /* 232 */ "eidlist ::= nm collate sortorder",
157454
+ /* 233 */ "collate ::=",
157455
+ /* 234 */ "collate ::= COLLATE ID|STRING",
157456
+ /* 235 */ "cmd ::= DROP INDEX ifexists fullname",
157457
+ /* 236 */ "cmd ::= VACUUM vinto",
157458
+ /* 237 */ "cmd ::= VACUUM nm vinto",
157459
+ /* 238 */ "vinto ::= INTO expr",
157460
+ /* 239 */ "vinto ::=",
157461
+ /* 240 */ "cmd ::= PRAGMA nm dbnm",
157462
+ /* 241 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
157463
+ /* 242 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
157464
+ /* 243 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
157465
+ /* 244 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
157466
+ /* 245 */ "plus_num ::= PLUS INTEGER|FLOAT",
157467
+ /* 246 */ "minus_num ::= MINUS INTEGER|FLOAT",
157468
+ /* 247 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
157469
+ /* 248 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
157470
+ /* 249 */ "trigger_time ::= BEFORE|AFTER",
157471
+ /* 250 */ "trigger_time ::= INSTEAD OF",
157472
+ /* 251 */ "trigger_time ::=",
157473
+ /* 252 */ "trigger_event ::= DELETE|INSERT",
157474
+ /* 253 */ "trigger_event ::= UPDATE",
157475
+ /* 254 */ "trigger_event ::= UPDATE OF idlist",
157476
+ /* 255 */ "when_clause ::=",
157477
+ /* 256 */ "when_clause ::= WHEN expr",
157478
+ /* 257 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
157479
+ /* 258 */ "trigger_cmd_list ::= trigger_cmd SEMI",
157480
+ /* 259 */ "trnm ::= nm DOT nm",
157481
+ /* 260 */ "tridxby ::= INDEXED BY nm",
157482
+ /* 261 */ "tridxby ::= NOT INDEXED",
157483
+ /* 262 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt",
157484
+ /* 263 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt",
157485
+ /* 264 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
157486
+ /* 265 */ "trigger_cmd ::= scanpt select scanpt",
157487
+ /* 266 */ "expr ::= RAISE LP IGNORE RP",
157488
+ /* 267 */ "expr ::= RAISE LP raisetype COMMA nm RP",
157489
+ /* 268 */ "raisetype ::= ROLLBACK",
157490
+ /* 269 */ "raisetype ::= ABORT",
157491
+ /* 270 */ "raisetype ::= FAIL",
157492
+ /* 271 */ "cmd ::= DROP TRIGGER ifexists fullname",
157493
+ /* 272 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
157494
+ /* 273 */ "cmd ::= DETACH database_kw_opt expr",
157495
+ /* 274 */ "key_opt ::=",
157496
+ /* 275 */ "key_opt ::= KEY expr",
157497
+ /* 276 */ "cmd ::= REINDEX",
157498
+ /* 277 */ "cmd ::= REINDEX nm dbnm",
157499
+ /* 278 */ "cmd ::= ANALYZE",
157500
+ /* 279 */ "cmd ::= ANALYZE nm dbnm",
157501
+ /* 280 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
157502
+ /* 281 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
157503
+ /* 282 */ "add_column_fullname ::= fullname",
157504
+ /* 283 */ "cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm",
157505
+ /* 284 */ "cmd ::= create_vtab",
157506
+ /* 285 */ "cmd ::= create_vtab LP vtabarglist RP",
157507
+ /* 286 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
157508
+ /* 287 */ "vtabarg ::=",
157509
+ /* 288 */ "vtabargtoken ::= ANY",
157510
+ /* 289 */ "vtabargtoken ::= lp anylist RP",
157511
+ /* 290 */ "lp ::= LP",
157512
+ /* 291 */ "with ::= WITH wqlist",
157513
+ /* 292 */ "with ::= WITH RECURSIVE wqlist",
157514
+ /* 293 */ "wqlist ::= nm eidlist_opt AS LP select RP",
157515
+ /* 294 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
157516
+ /* 295 */ "windowdefn_list ::= windowdefn",
157517
+ /* 296 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
157518
+ /* 297 */ "windowdefn ::= nm AS LP window RP",
157519
+ /* 298 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
157520
+ /* 299 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
157521
+ /* 300 */ "window ::= ORDER BY sortlist frame_opt",
157522
+ /* 301 */ "window ::= nm ORDER BY sortlist frame_opt",
157523
+ /* 302 */ "window ::= frame_opt",
157524
+ /* 303 */ "window ::= nm frame_opt",
157525
+ /* 304 */ "frame_opt ::=",
157526
+ /* 305 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
157527
+ /* 306 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
157528
+ /* 307 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
157529
+ /* 308 */ "frame_bound_s ::= frame_bound",
157530
+ /* 309 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
157531
+ /* 310 */ "frame_bound_e ::= frame_bound",
157532
+ /* 311 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
157533
+ /* 312 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
157534
+ /* 313 */ "frame_bound ::= CURRENT ROW",
157535
+ /* 314 */ "frame_exclude_opt ::=",
157536
+ /* 315 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
157537
+ /* 316 */ "frame_exclude ::= NO OTHERS",
157538
+ /* 317 */ "frame_exclude ::= CURRENT ROW",
157539
+ /* 318 */ "frame_exclude ::= GROUP|TIES",
157540
+ /* 319 */ "window_clause ::= WINDOW windowdefn_list",
157541
+ /* 320 */ "filter_over ::= filter_clause over_clause",
157542
+ /* 321 */ "filter_over ::= over_clause",
157543
+ /* 322 */ "filter_over ::= filter_clause",
157544
+ /* 323 */ "over_clause ::= OVER LP window RP",
157545
+ /* 324 */ "over_clause ::= OVER nm",
157546
+ /* 325 */ "filter_clause ::= FILTER LP WHERE expr RP",
157547
+ /* 326 */ "input ::= cmdlist",
157548
+ /* 327 */ "cmdlist ::= cmdlist ecmd",
157549
+ /* 328 */ "cmdlist ::= ecmd",
157550
+ /* 329 */ "ecmd ::= SEMI",
157551
+ /* 330 */ "ecmd ::= cmdx SEMI",
157552
+ /* 331 */ "ecmd ::= explain cmdx SEMI",
157553
+ /* 332 */ "trans_opt ::=",
157554
+ /* 333 */ "trans_opt ::= TRANSACTION",
157555
+ /* 334 */ "trans_opt ::= TRANSACTION nm",
157556
+ /* 335 */ "savepoint_opt ::= SAVEPOINT",
157557
+ /* 336 */ "savepoint_opt ::=",
157558
+ /* 337 */ "cmd ::= create_table create_table_args",
157559
+ /* 338 */ "columnlist ::= columnlist COMMA columnname carglist",
157560
+ /* 339 */ "columnlist ::= columnname carglist",
157561
+ /* 340 */ "nm ::= ID|INDEXED",
157562
+ /* 341 */ "nm ::= STRING",
157563
+ /* 342 */ "nm ::= JOIN_KW",
157564
+ /* 343 */ "typetoken ::= typename",
157565
+ /* 344 */ "typename ::= ID|STRING",
157566
+ /* 345 */ "signed ::= plus_num",
157567
+ /* 346 */ "signed ::= minus_num",
157568
+ /* 347 */ "carglist ::= carglist ccons",
157569
+ /* 348 */ "carglist ::=",
157570
+ /* 349 */ "ccons ::= NULL onconf",
157571
+ /* 350 */ "ccons ::= GENERATED ALWAYS AS generated",
157572
+ /* 351 */ "ccons ::= AS generated",
157573
+ /* 352 */ "conslist_opt ::= COMMA conslist",
157574
+ /* 353 */ "conslist ::= conslist tconscomma tcons",
157575
+ /* 354 */ "conslist ::= tcons",
157576
+ /* 355 */ "tconscomma ::=",
157577
+ /* 356 */ "defer_subclause_opt ::= defer_subclause",
157578
+ /* 357 */ "resolvetype ::= raisetype",
157579
+ /* 358 */ "selectnowith ::= oneselect",
157580
+ /* 359 */ "oneselect ::= values",
157581
+ /* 360 */ "sclp ::= selcollist COMMA",
157582
+ /* 361 */ "as ::= ID|STRING",
157583
+ /* 362 */ "expr ::= term",
157584
+ /* 363 */ "likeop ::= LIKE_KW|MATCH",
157585
+ /* 364 */ "exprlist ::= nexprlist",
157586
+ /* 365 */ "nmnum ::= plus_num",
157587
+ /* 366 */ "nmnum ::= nm",
157588
+ /* 367 */ "nmnum ::= ON",
157589
+ /* 368 */ "nmnum ::= DELETE",
157590
+ /* 369 */ "nmnum ::= DEFAULT",
157591
+ /* 370 */ "plus_num ::= INTEGER|FLOAT",
157592
+ /* 371 */ "foreach_clause ::=",
157593
+ /* 372 */ "foreach_clause ::= FOR EACH ROW",
157594
+ /* 373 */ "trnm ::= nm",
157595
+ /* 374 */ "tridxby ::=",
157596
+ /* 375 */ "database_kw_opt ::= DATABASE",
157597
+ /* 376 */ "database_kw_opt ::=",
157598
+ /* 377 */ "kwcolumn_opt ::=",
157599
+ /* 378 */ "kwcolumn_opt ::= COLUMNKW",
157600
+ /* 379 */ "vtabarglist ::= vtabarg",
157601
+ /* 380 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
157602
+ /* 381 */ "vtabarg ::= vtabarg vtabargtoken",
157603
+ /* 382 */ "anylist ::=",
157604
+ /* 383 */ "anylist ::= anylist LP anylist RP",
157605
+ /* 384 */ "anylist ::= anylist ANY",
157606
+ /* 385 */ "with ::=",
156972157607
};
156973157608
#endif /* NDEBUG */
156974157609
156975157610
156976157611
#if YYSTACKDEPTH<=0
@@ -157633,236 +158268,237 @@
157633158268
262, /* (154) setlist ::= nm EQ expr */
157634158269
262, /* (155) setlist ::= LP idlist RP EQ expr */
157635158270
186, /* (156) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
157636158271
186, /* (157) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
157637158272
265, /* (158) upsert ::= */
157638
- 265, /* (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
157639
- 265, /* (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
158273
+ 265, /* (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
158274
+ 265, /* (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
157640158275
265, /* (161) upsert ::= ON CONFLICT DO NOTHING */
157641
- 263, /* (162) insert_cmd ::= INSERT orconf */
157642
- 263, /* (163) insert_cmd ::= REPLACE */
157643
- 264, /* (164) idlist_opt ::= */
157644
- 264, /* (165) idlist_opt ::= LP idlist RP */
157645
- 259, /* (166) idlist ::= idlist COMMA nm */
157646
- 259, /* (167) idlist ::= nm */
157647
- 212, /* (168) expr ::= LP expr RP */
157648
- 212, /* (169) expr ::= ID|INDEXED */
157649
- 212, /* (170) expr ::= JOIN_KW */
157650
- 212, /* (171) expr ::= nm DOT nm */
157651
- 212, /* (172) expr ::= nm DOT nm DOT nm */
157652
- 211, /* (173) term ::= NULL|FLOAT|BLOB */
157653
- 211, /* (174) term ::= STRING */
157654
- 211, /* (175) term ::= INTEGER */
157655
- 212, /* (176) expr ::= VARIABLE */
157656
- 212, /* (177) expr ::= expr COLLATE ID|STRING */
157657
- 212, /* (178) expr ::= CAST LP expr AS typetoken RP */
157658
- 212, /* (179) expr ::= ID|INDEXED LP distinct exprlist RP */
157659
- 212, /* (180) expr ::= ID|INDEXED LP STAR RP */
157660
- 212, /* (181) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
157661
- 212, /* (182) expr ::= ID|INDEXED LP STAR RP filter_over */
157662
- 211, /* (183) term ::= CTIME_KW */
157663
- 212, /* (184) expr ::= LP nexprlist COMMA expr RP */
157664
- 212, /* (185) expr ::= expr AND expr */
157665
- 212, /* (186) expr ::= expr OR expr */
157666
- 212, /* (187) expr ::= expr LT|GT|GE|LE expr */
157667
- 212, /* (188) expr ::= expr EQ|NE expr */
157668
- 212, /* (189) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
157669
- 212, /* (190) expr ::= expr PLUS|MINUS expr */
157670
- 212, /* (191) expr ::= expr STAR|SLASH|REM expr */
157671
- 212, /* (192) expr ::= expr CONCAT expr */
157672
- 267, /* (193) likeop ::= NOT LIKE_KW|MATCH */
157673
- 212, /* (194) expr ::= expr likeop expr */
157674
- 212, /* (195) expr ::= expr likeop expr ESCAPE expr */
157675
- 212, /* (196) expr ::= expr ISNULL|NOTNULL */
157676
- 212, /* (197) expr ::= expr NOT NULL */
157677
- 212, /* (198) expr ::= expr IS expr */
157678
- 212, /* (199) expr ::= expr IS NOT expr */
157679
- 212, /* (200) expr ::= NOT expr */
157680
- 212, /* (201) expr ::= BITNOT expr */
157681
- 212, /* (202) expr ::= PLUS|MINUS expr */
157682
- 268, /* (203) between_op ::= BETWEEN */
157683
- 268, /* (204) between_op ::= NOT BETWEEN */
157684
- 212, /* (205) expr ::= expr between_op expr AND expr */
157685
- 269, /* (206) in_op ::= IN */
157686
- 269, /* (207) in_op ::= NOT IN */
157687
- 212, /* (208) expr ::= expr in_op LP exprlist RP */
157688
- 212, /* (209) expr ::= LP select RP */
157689
- 212, /* (210) expr ::= expr in_op LP select RP */
157690
- 212, /* (211) expr ::= expr in_op nm dbnm paren_exprlist */
157691
- 212, /* (212) expr ::= EXISTS LP select RP */
157692
- 212, /* (213) expr ::= CASE case_operand case_exprlist case_else END */
157693
- 272, /* (214) case_exprlist ::= case_exprlist WHEN expr THEN expr */
157694
- 272, /* (215) case_exprlist ::= WHEN expr THEN expr */
157695
- 273, /* (216) case_else ::= ELSE expr */
157696
- 273, /* (217) case_else ::= */
157697
- 271, /* (218) case_operand ::= expr */
157698
- 271, /* (219) case_operand ::= */
157699
- 257, /* (220) exprlist ::= */
157700
- 248, /* (221) nexprlist ::= nexprlist COMMA expr */
157701
- 248, /* (222) nexprlist ::= expr */
157702
- 270, /* (223) paren_exprlist ::= */
157703
- 270, /* (224) paren_exprlist ::= LP exprlist RP */
157704
- 186, /* (225) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
157705
- 274, /* (226) uniqueflag ::= UNIQUE */
157706
- 274, /* (227) uniqueflag ::= */
157707
- 216, /* (228) eidlist_opt ::= */
157708
- 216, /* (229) eidlist_opt ::= LP eidlist RP */
157709
- 227, /* (230) eidlist ::= eidlist COMMA nm collate sortorder */
157710
- 227, /* (231) eidlist ::= nm collate sortorder */
157711
- 275, /* (232) collate ::= */
157712
- 275, /* (233) collate ::= COLLATE ID|STRING */
157713
- 186, /* (234) cmd ::= DROP INDEX ifexists fullname */
157714
- 186, /* (235) cmd ::= VACUUM vinto */
157715
- 186, /* (236) cmd ::= VACUUM nm vinto */
157716
- 276, /* (237) vinto ::= INTO expr */
157717
- 276, /* (238) vinto ::= */
157718
- 186, /* (239) cmd ::= PRAGMA nm dbnm */
157719
- 186, /* (240) cmd ::= PRAGMA nm dbnm EQ nmnum */
157720
- 186, /* (241) cmd ::= PRAGMA nm dbnm LP nmnum RP */
157721
- 186, /* (242) cmd ::= PRAGMA nm dbnm EQ minus_num */
157722
- 186, /* (243) cmd ::= PRAGMA nm dbnm LP minus_num RP */
157723
- 206, /* (244) plus_num ::= PLUS INTEGER|FLOAT */
157724
- 207, /* (245) minus_num ::= MINUS INTEGER|FLOAT */
157725
- 186, /* (246) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
157726
- 278, /* (247) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
157727
- 280, /* (248) trigger_time ::= BEFORE|AFTER */
157728
- 280, /* (249) trigger_time ::= INSTEAD OF */
157729
- 280, /* (250) trigger_time ::= */
157730
- 281, /* (251) trigger_event ::= DELETE|INSERT */
157731
- 281, /* (252) trigger_event ::= UPDATE */
157732
- 281, /* (253) trigger_event ::= UPDATE OF idlist */
157733
- 283, /* (254) when_clause ::= */
157734
- 283, /* (255) when_clause ::= WHEN expr */
157735
- 279, /* (256) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
157736
- 279, /* (257) trigger_cmd_list ::= trigger_cmd SEMI */
157737
- 285, /* (258) trnm ::= nm DOT nm */
157738
- 286, /* (259) tridxby ::= INDEXED BY nm */
157739
- 286, /* (260) tridxby ::= NOT INDEXED */
157740
- 284, /* (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
157741
- 284, /* (262) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
157742
- 284, /* (263) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
157743
- 284, /* (264) trigger_cmd ::= scanpt select scanpt */
157744
- 212, /* (265) expr ::= RAISE LP IGNORE RP */
157745
- 212, /* (266) expr ::= RAISE LP raisetype COMMA nm RP */
157746
- 231, /* (267) raisetype ::= ROLLBACK */
157747
- 231, /* (268) raisetype ::= ABORT */
157748
- 231, /* (269) raisetype ::= FAIL */
157749
- 186, /* (270) cmd ::= DROP TRIGGER ifexists fullname */
157750
- 186, /* (271) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
157751
- 186, /* (272) cmd ::= DETACH database_kw_opt expr */
157752
- 288, /* (273) key_opt ::= */
157753
- 288, /* (274) key_opt ::= KEY expr */
157754
- 186, /* (275) cmd ::= REINDEX */
157755
- 186, /* (276) cmd ::= REINDEX nm dbnm */
157756
- 186, /* (277) cmd ::= ANALYZE */
157757
- 186, /* (278) cmd ::= ANALYZE nm dbnm */
157758
- 186, /* (279) cmd ::= ALTER TABLE fullname RENAME TO nm */
157759
- 186, /* (280) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
157760
- 289, /* (281) add_column_fullname ::= fullname */
157761
- 186, /* (282) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
157762
- 186, /* (283) cmd ::= create_vtab */
157763
- 186, /* (284) cmd ::= create_vtab LP vtabarglist RP */
157764
- 291, /* (285) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
157765
- 293, /* (286) vtabarg ::= */
157766
- 294, /* (287) vtabargtoken ::= ANY */
157767
- 294, /* (288) vtabargtoken ::= lp anylist RP */
157768
- 295, /* (289) lp ::= LP */
157769
- 261, /* (290) with ::= WITH wqlist */
157770
- 261, /* (291) with ::= WITH RECURSIVE wqlist */
157771
- 236, /* (292) wqlist ::= nm eidlist_opt AS LP select RP */
157772
- 236, /* (293) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
157773
- 297, /* (294) windowdefn_list ::= windowdefn */
157774
- 297, /* (295) windowdefn_list ::= windowdefn_list COMMA windowdefn */
157775
- 298, /* (296) windowdefn ::= nm AS LP window RP */
157776
- 299, /* (297) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
157777
- 299, /* (298) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
157778
- 299, /* (299) window ::= ORDER BY sortlist frame_opt */
157779
- 299, /* (300) window ::= nm ORDER BY sortlist frame_opt */
157780
- 299, /* (301) window ::= frame_opt */
157781
- 299, /* (302) window ::= nm frame_opt */
157782
- 300, /* (303) frame_opt ::= */
157783
- 300, /* (304) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
157784
- 300, /* (305) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
157785
- 304, /* (306) range_or_rows ::= RANGE|ROWS|GROUPS */
157786
- 306, /* (307) frame_bound_s ::= frame_bound */
157787
- 306, /* (308) frame_bound_s ::= UNBOUNDED PRECEDING */
157788
- 307, /* (309) frame_bound_e ::= frame_bound */
157789
- 307, /* (310) frame_bound_e ::= UNBOUNDED FOLLOWING */
157790
- 305, /* (311) frame_bound ::= expr PRECEDING|FOLLOWING */
157791
- 305, /* (312) frame_bound ::= CURRENT ROW */
157792
- 308, /* (313) frame_exclude_opt ::= */
157793
- 308, /* (314) frame_exclude_opt ::= EXCLUDE frame_exclude */
157794
- 309, /* (315) frame_exclude ::= NO OTHERS */
157795
- 309, /* (316) frame_exclude ::= CURRENT ROW */
157796
- 309, /* (317) frame_exclude ::= GROUP|TIES */
157797
- 246, /* (318) window_clause ::= WINDOW windowdefn_list */
157798
- 266, /* (319) filter_over ::= filter_clause over_clause */
157799
- 266, /* (320) filter_over ::= over_clause */
157800
- 266, /* (321) filter_over ::= filter_clause */
157801
- 303, /* (322) over_clause ::= OVER LP window RP */
157802
- 303, /* (323) over_clause ::= OVER nm */
157803
- 302, /* (324) filter_clause ::= FILTER LP WHERE expr RP */
157804
- 181, /* (325) input ::= cmdlist */
157805
- 182, /* (326) cmdlist ::= cmdlist ecmd */
157806
- 182, /* (327) cmdlist ::= ecmd */
157807
- 183, /* (328) ecmd ::= SEMI */
157808
- 183, /* (329) ecmd ::= cmdx SEMI */
157809
- 183, /* (330) ecmd ::= explain cmdx SEMI */
157810
- 188, /* (331) trans_opt ::= */
157811
- 188, /* (332) trans_opt ::= TRANSACTION */
157812
- 188, /* (333) trans_opt ::= TRANSACTION nm */
157813
- 190, /* (334) savepoint_opt ::= SAVEPOINT */
157814
- 190, /* (335) savepoint_opt ::= */
157815
- 186, /* (336) cmd ::= create_table create_table_args */
157816
- 197, /* (337) columnlist ::= columnlist COMMA columnname carglist */
157817
- 197, /* (338) columnlist ::= columnname carglist */
157818
- 189, /* (339) nm ::= ID|INDEXED */
157819
- 189, /* (340) nm ::= STRING */
157820
- 189, /* (341) nm ::= JOIN_KW */
157821
- 203, /* (342) typetoken ::= typename */
157822
- 204, /* (343) typename ::= ID|STRING */
157823
- 205, /* (344) signed ::= plus_num */
157824
- 205, /* (345) signed ::= minus_num */
157825
- 202, /* (346) carglist ::= carglist ccons */
157826
- 202, /* (347) carglist ::= */
157827
- 210, /* (348) ccons ::= NULL onconf */
157828
- 210, /* (349) ccons ::= GENERATED ALWAYS AS generated */
157829
- 210, /* (350) ccons ::= AS generated */
157830
- 198, /* (351) conslist_opt ::= COMMA conslist */
157831
- 223, /* (352) conslist ::= conslist tconscomma tcons */
157832
- 223, /* (353) conslist ::= tcons */
157833
- 224, /* (354) tconscomma ::= */
157834
- 228, /* (355) defer_subclause_opt ::= defer_subclause */
157835
- 230, /* (356) resolvetype ::= raisetype */
157836
- 234, /* (357) selectnowith ::= oneselect */
157837
- 235, /* (358) oneselect ::= values */
157838
- 249, /* (359) sclp ::= selcollist COMMA */
157839
- 250, /* (360) as ::= ID|STRING */
157840
- 212, /* (361) expr ::= term */
157841
- 267, /* (362) likeop ::= LIKE_KW|MATCH */
157842
- 257, /* (363) exprlist ::= nexprlist */
157843
- 277, /* (364) nmnum ::= plus_num */
157844
- 277, /* (365) nmnum ::= nm */
157845
- 277, /* (366) nmnum ::= ON */
157846
- 277, /* (367) nmnum ::= DELETE */
157847
- 277, /* (368) nmnum ::= DEFAULT */
157848
- 206, /* (369) plus_num ::= INTEGER|FLOAT */
157849
- 282, /* (370) foreach_clause ::= */
157850
- 282, /* (371) foreach_clause ::= FOR EACH ROW */
157851
- 285, /* (372) trnm ::= nm */
157852
- 286, /* (373) tridxby ::= */
157853
- 287, /* (374) database_kw_opt ::= DATABASE */
157854
- 287, /* (375) database_kw_opt ::= */
157855
- 290, /* (376) kwcolumn_opt ::= */
157856
- 290, /* (377) kwcolumn_opt ::= COLUMNKW */
157857
- 292, /* (378) vtabarglist ::= vtabarg */
157858
- 292, /* (379) vtabarglist ::= vtabarglist COMMA vtabarg */
157859
- 293, /* (380) vtabarg ::= vtabarg vtabargtoken */
157860
- 296, /* (381) anylist ::= */
157861
- 296, /* (382) anylist ::= anylist LP anylist RP */
157862
- 296, /* (383) anylist ::= anylist ANY */
157863
- 261, /* (384) with ::= */
158276
+ 265, /* (162) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt */
158277
+ 263, /* (163) insert_cmd ::= INSERT orconf */
158278
+ 263, /* (164) insert_cmd ::= REPLACE */
158279
+ 264, /* (165) idlist_opt ::= */
158280
+ 264, /* (166) idlist_opt ::= LP idlist RP */
158281
+ 259, /* (167) idlist ::= idlist COMMA nm */
158282
+ 259, /* (168) idlist ::= nm */
158283
+ 212, /* (169) expr ::= LP expr RP */
158284
+ 212, /* (170) expr ::= ID|INDEXED */
158285
+ 212, /* (171) expr ::= JOIN_KW */
158286
+ 212, /* (172) expr ::= nm DOT nm */
158287
+ 212, /* (173) expr ::= nm DOT nm DOT nm */
158288
+ 211, /* (174) term ::= NULL|FLOAT|BLOB */
158289
+ 211, /* (175) term ::= STRING */
158290
+ 211, /* (176) term ::= INTEGER */
158291
+ 212, /* (177) expr ::= VARIABLE */
158292
+ 212, /* (178) expr ::= expr COLLATE ID|STRING */
158293
+ 212, /* (179) expr ::= CAST LP expr AS typetoken RP */
158294
+ 212, /* (180) expr ::= ID|INDEXED LP distinct exprlist RP */
158295
+ 212, /* (181) expr ::= ID|INDEXED LP STAR RP */
158296
+ 212, /* (182) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
158297
+ 212, /* (183) expr ::= ID|INDEXED LP STAR RP filter_over */
158298
+ 211, /* (184) term ::= CTIME_KW */
158299
+ 212, /* (185) expr ::= LP nexprlist COMMA expr RP */
158300
+ 212, /* (186) expr ::= expr AND expr */
158301
+ 212, /* (187) expr ::= expr OR expr */
158302
+ 212, /* (188) expr ::= expr LT|GT|GE|LE expr */
158303
+ 212, /* (189) expr ::= expr EQ|NE expr */
158304
+ 212, /* (190) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
158305
+ 212, /* (191) expr ::= expr PLUS|MINUS expr */
158306
+ 212, /* (192) expr ::= expr STAR|SLASH|REM expr */
158307
+ 212, /* (193) expr ::= expr CONCAT expr */
158308
+ 267, /* (194) likeop ::= NOT LIKE_KW|MATCH */
158309
+ 212, /* (195) expr ::= expr likeop expr */
158310
+ 212, /* (196) expr ::= expr likeop expr ESCAPE expr */
158311
+ 212, /* (197) expr ::= expr ISNULL|NOTNULL */
158312
+ 212, /* (198) expr ::= expr NOT NULL */
158313
+ 212, /* (199) expr ::= expr IS expr */
158314
+ 212, /* (200) expr ::= expr IS NOT expr */
158315
+ 212, /* (201) expr ::= NOT expr */
158316
+ 212, /* (202) expr ::= BITNOT expr */
158317
+ 212, /* (203) expr ::= PLUS|MINUS expr */
158318
+ 268, /* (204) between_op ::= BETWEEN */
158319
+ 268, /* (205) between_op ::= NOT BETWEEN */
158320
+ 212, /* (206) expr ::= expr between_op expr AND expr */
158321
+ 269, /* (207) in_op ::= IN */
158322
+ 269, /* (208) in_op ::= NOT IN */
158323
+ 212, /* (209) expr ::= expr in_op LP exprlist RP */
158324
+ 212, /* (210) expr ::= LP select RP */
158325
+ 212, /* (211) expr ::= expr in_op LP select RP */
158326
+ 212, /* (212) expr ::= expr in_op nm dbnm paren_exprlist */
158327
+ 212, /* (213) expr ::= EXISTS LP select RP */
158328
+ 212, /* (214) expr ::= CASE case_operand case_exprlist case_else END */
158329
+ 272, /* (215) case_exprlist ::= case_exprlist WHEN expr THEN expr */
158330
+ 272, /* (216) case_exprlist ::= WHEN expr THEN expr */
158331
+ 273, /* (217) case_else ::= ELSE expr */
158332
+ 273, /* (218) case_else ::= */
158333
+ 271, /* (219) case_operand ::= expr */
158334
+ 271, /* (220) case_operand ::= */
158335
+ 257, /* (221) exprlist ::= */
158336
+ 248, /* (222) nexprlist ::= nexprlist COMMA expr */
158337
+ 248, /* (223) nexprlist ::= expr */
158338
+ 270, /* (224) paren_exprlist ::= */
158339
+ 270, /* (225) paren_exprlist ::= LP exprlist RP */
158340
+ 186, /* (226) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
158341
+ 274, /* (227) uniqueflag ::= UNIQUE */
158342
+ 274, /* (228) uniqueflag ::= */
158343
+ 216, /* (229) eidlist_opt ::= */
158344
+ 216, /* (230) eidlist_opt ::= LP eidlist RP */
158345
+ 227, /* (231) eidlist ::= eidlist COMMA nm collate sortorder */
158346
+ 227, /* (232) eidlist ::= nm collate sortorder */
158347
+ 275, /* (233) collate ::= */
158348
+ 275, /* (234) collate ::= COLLATE ID|STRING */
158349
+ 186, /* (235) cmd ::= DROP INDEX ifexists fullname */
158350
+ 186, /* (236) cmd ::= VACUUM vinto */
158351
+ 186, /* (237) cmd ::= VACUUM nm vinto */
158352
+ 276, /* (238) vinto ::= INTO expr */
158353
+ 276, /* (239) vinto ::= */
158354
+ 186, /* (240) cmd ::= PRAGMA nm dbnm */
158355
+ 186, /* (241) cmd ::= PRAGMA nm dbnm EQ nmnum */
158356
+ 186, /* (242) cmd ::= PRAGMA nm dbnm LP nmnum RP */
158357
+ 186, /* (243) cmd ::= PRAGMA nm dbnm EQ minus_num */
158358
+ 186, /* (244) cmd ::= PRAGMA nm dbnm LP minus_num RP */
158359
+ 206, /* (245) plus_num ::= PLUS INTEGER|FLOAT */
158360
+ 207, /* (246) minus_num ::= MINUS INTEGER|FLOAT */
158361
+ 186, /* (247) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
158362
+ 278, /* (248) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
158363
+ 280, /* (249) trigger_time ::= BEFORE|AFTER */
158364
+ 280, /* (250) trigger_time ::= INSTEAD OF */
158365
+ 280, /* (251) trigger_time ::= */
158366
+ 281, /* (252) trigger_event ::= DELETE|INSERT */
158367
+ 281, /* (253) trigger_event ::= UPDATE */
158368
+ 281, /* (254) trigger_event ::= UPDATE OF idlist */
158369
+ 283, /* (255) when_clause ::= */
158370
+ 283, /* (256) when_clause ::= WHEN expr */
158371
+ 279, /* (257) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
158372
+ 279, /* (258) trigger_cmd_list ::= trigger_cmd SEMI */
158373
+ 285, /* (259) trnm ::= nm DOT nm */
158374
+ 286, /* (260) tridxby ::= INDEXED BY nm */
158375
+ 286, /* (261) tridxby ::= NOT INDEXED */
158376
+ 284, /* (262) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
158377
+ 284, /* (263) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
158378
+ 284, /* (264) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
158379
+ 284, /* (265) trigger_cmd ::= scanpt select scanpt */
158380
+ 212, /* (266) expr ::= RAISE LP IGNORE RP */
158381
+ 212, /* (267) expr ::= RAISE LP raisetype COMMA nm RP */
158382
+ 231, /* (268) raisetype ::= ROLLBACK */
158383
+ 231, /* (269) raisetype ::= ABORT */
158384
+ 231, /* (270) raisetype ::= FAIL */
158385
+ 186, /* (271) cmd ::= DROP TRIGGER ifexists fullname */
158386
+ 186, /* (272) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
158387
+ 186, /* (273) cmd ::= DETACH database_kw_opt expr */
158388
+ 288, /* (274) key_opt ::= */
158389
+ 288, /* (275) key_opt ::= KEY expr */
158390
+ 186, /* (276) cmd ::= REINDEX */
158391
+ 186, /* (277) cmd ::= REINDEX nm dbnm */
158392
+ 186, /* (278) cmd ::= ANALYZE */
158393
+ 186, /* (279) cmd ::= ANALYZE nm dbnm */
158394
+ 186, /* (280) cmd ::= ALTER TABLE fullname RENAME TO nm */
158395
+ 186, /* (281) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
158396
+ 289, /* (282) add_column_fullname ::= fullname */
158397
+ 186, /* (283) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
158398
+ 186, /* (284) cmd ::= create_vtab */
158399
+ 186, /* (285) cmd ::= create_vtab LP vtabarglist RP */
158400
+ 291, /* (286) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
158401
+ 293, /* (287) vtabarg ::= */
158402
+ 294, /* (288) vtabargtoken ::= ANY */
158403
+ 294, /* (289) vtabargtoken ::= lp anylist RP */
158404
+ 295, /* (290) lp ::= LP */
158405
+ 261, /* (291) with ::= WITH wqlist */
158406
+ 261, /* (292) with ::= WITH RECURSIVE wqlist */
158407
+ 236, /* (293) wqlist ::= nm eidlist_opt AS LP select RP */
158408
+ 236, /* (294) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
158409
+ 297, /* (295) windowdefn_list ::= windowdefn */
158410
+ 297, /* (296) windowdefn_list ::= windowdefn_list COMMA windowdefn */
158411
+ 298, /* (297) windowdefn ::= nm AS LP window RP */
158412
+ 299, /* (298) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
158413
+ 299, /* (299) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
158414
+ 299, /* (300) window ::= ORDER BY sortlist frame_opt */
158415
+ 299, /* (301) window ::= nm ORDER BY sortlist frame_opt */
158416
+ 299, /* (302) window ::= frame_opt */
158417
+ 299, /* (303) window ::= nm frame_opt */
158418
+ 300, /* (304) frame_opt ::= */
158419
+ 300, /* (305) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
158420
+ 300, /* (306) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
158421
+ 304, /* (307) range_or_rows ::= RANGE|ROWS|GROUPS */
158422
+ 306, /* (308) frame_bound_s ::= frame_bound */
158423
+ 306, /* (309) frame_bound_s ::= UNBOUNDED PRECEDING */
158424
+ 307, /* (310) frame_bound_e ::= frame_bound */
158425
+ 307, /* (311) frame_bound_e ::= UNBOUNDED FOLLOWING */
158426
+ 305, /* (312) frame_bound ::= expr PRECEDING|FOLLOWING */
158427
+ 305, /* (313) frame_bound ::= CURRENT ROW */
158428
+ 308, /* (314) frame_exclude_opt ::= */
158429
+ 308, /* (315) frame_exclude_opt ::= EXCLUDE frame_exclude */
158430
+ 309, /* (316) frame_exclude ::= NO OTHERS */
158431
+ 309, /* (317) frame_exclude ::= CURRENT ROW */
158432
+ 309, /* (318) frame_exclude ::= GROUP|TIES */
158433
+ 246, /* (319) window_clause ::= WINDOW windowdefn_list */
158434
+ 266, /* (320) filter_over ::= filter_clause over_clause */
158435
+ 266, /* (321) filter_over ::= over_clause */
158436
+ 266, /* (322) filter_over ::= filter_clause */
158437
+ 303, /* (323) over_clause ::= OVER LP window RP */
158438
+ 303, /* (324) over_clause ::= OVER nm */
158439
+ 302, /* (325) filter_clause ::= FILTER LP WHERE expr RP */
158440
+ 181, /* (326) input ::= cmdlist */
158441
+ 182, /* (327) cmdlist ::= cmdlist ecmd */
158442
+ 182, /* (328) cmdlist ::= ecmd */
158443
+ 183, /* (329) ecmd ::= SEMI */
158444
+ 183, /* (330) ecmd ::= cmdx SEMI */
158445
+ 183, /* (331) ecmd ::= explain cmdx SEMI */
158446
+ 188, /* (332) trans_opt ::= */
158447
+ 188, /* (333) trans_opt ::= TRANSACTION */
158448
+ 188, /* (334) trans_opt ::= TRANSACTION nm */
158449
+ 190, /* (335) savepoint_opt ::= SAVEPOINT */
158450
+ 190, /* (336) savepoint_opt ::= */
158451
+ 186, /* (337) cmd ::= create_table create_table_args */
158452
+ 197, /* (338) columnlist ::= columnlist COMMA columnname carglist */
158453
+ 197, /* (339) columnlist ::= columnname carglist */
158454
+ 189, /* (340) nm ::= ID|INDEXED */
158455
+ 189, /* (341) nm ::= STRING */
158456
+ 189, /* (342) nm ::= JOIN_KW */
158457
+ 203, /* (343) typetoken ::= typename */
158458
+ 204, /* (344) typename ::= ID|STRING */
158459
+ 205, /* (345) signed ::= plus_num */
158460
+ 205, /* (346) signed ::= minus_num */
158461
+ 202, /* (347) carglist ::= carglist ccons */
158462
+ 202, /* (348) carglist ::= */
158463
+ 210, /* (349) ccons ::= NULL onconf */
158464
+ 210, /* (350) ccons ::= GENERATED ALWAYS AS generated */
158465
+ 210, /* (351) ccons ::= AS generated */
158466
+ 198, /* (352) conslist_opt ::= COMMA conslist */
158467
+ 223, /* (353) conslist ::= conslist tconscomma tcons */
158468
+ 223, /* (354) conslist ::= tcons */
158469
+ 224, /* (355) tconscomma ::= */
158470
+ 228, /* (356) defer_subclause_opt ::= defer_subclause */
158471
+ 230, /* (357) resolvetype ::= raisetype */
158472
+ 234, /* (358) selectnowith ::= oneselect */
158473
+ 235, /* (359) oneselect ::= values */
158474
+ 249, /* (360) sclp ::= selcollist COMMA */
158475
+ 250, /* (361) as ::= ID|STRING */
158476
+ 212, /* (362) expr ::= term */
158477
+ 267, /* (363) likeop ::= LIKE_KW|MATCH */
158478
+ 257, /* (364) exprlist ::= nexprlist */
158479
+ 277, /* (365) nmnum ::= plus_num */
158480
+ 277, /* (366) nmnum ::= nm */
158481
+ 277, /* (367) nmnum ::= ON */
158482
+ 277, /* (368) nmnum ::= DELETE */
158483
+ 277, /* (369) nmnum ::= DEFAULT */
158484
+ 206, /* (370) plus_num ::= INTEGER|FLOAT */
158485
+ 282, /* (371) foreach_clause ::= */
158486
+ 282, /* (372) foreach_clause ::= FOR EACH ROW */
158487
+ 285, /* (373) trnm ::= nm */
158488
+ 286, /* (374) tridxby ::= */
158489
+ 287, /* (375) database_kw_opt ::= DATABASE */
158490
+ 287, /* (376) database_kw_opt ::= */
158491
+ 290, /* (377) kwcolumn_opt ::= */
158492
+ 290, /* (378) kwcolumn_opt ::= COLUMNKW */
158493
+ 292, /* (379) vtabarglist ::= vtabarg */
158494
+ 292, /* (380) vtabarglist ::= vtabarglist COMMA vtabarg */
158495
+ 293, /* (381) vtabarg ::= vtabarg vtabargtoken */
158496
+ 296, /* (382) anylist ::= */
158497
+ 296, /* (383) anylist ::= anylist LP anylist RP */
158498
+ 296, /* (384) anylist ::= anylist ANY */
158499
+ 261, /* (385) with ::= */
157864158500
};
157865158501
157866158502
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
157867158503
** of symbols on the right-hand side of that rule. */
157868158504
static const signed char yyRuleInfoNRhs[] = {
@@ -158023,236 +158659,237 @@
158023158659
-3, /* (154) setlist ::= nm EQ expr */
158024158660
-5, /* (155) setlist ::= LP idlist RP EQ expr */
158025158661
-7, /* (156) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
158026158662
-7, /* (157) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
158027158663
0, /* (158) upsert ::= */
158028
- -11, /* (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
158029
- -8, /* (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
158664
+ -12, /* (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
158665
+ -9, /* (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
158030158666
-4, /* (161) upsert ::= ON CONFLICT DO NOTHING */
158031
- -2, /* (162) insert_cmd ::= INSERT orconf */
158032
- -1, /* (163) insert_cmd ::= REPLACE */
158033
- 0, /* (164) idlist_opt ::= */
158034
- -3, /* (165) idlist_opt ::= LP idlist RP */
158035
- -3, /* (166) idlist ::= idlist COMMA nm */
158036
- -1, /* (167) idlist ::= nm */
158037
- -3, /* (168) expr ::= LP expr RP */
158038
- -1, /* (169) expr ::= ID|INDEXED */
158039
- -1, /* (170) expr ::= JOIN_KW */
158040
- -3, /* (171) expr ::= nm DOT nm */
158041
- -5, /* (172) expr ::= nm DOT nm DOT nm */
158042
- -1, /* (173) term ::= NULL|FLOAT|BLOB */
158043
- -1, /* (174) term ::= STRING */
158044
- -1, /* (175) term ::= INTEGER */
158045
- -1, /* (176) expr ::= VARIABLE */
158046
- -3, /* (177) expr ::= expr COLLATE ID|STRING */
158047
- -6, /* (178) expr ::= CAST LP expr AS typetoken RP */
158048
- -5, /* (179) expr ::= ID|INDEXED LP distinct exprlist RP */
158049
- -4, /* (180) expr ::= ID|INDEXED LP STAR RP */
158050
- -6, /* (181) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
158051
- -5, /* (182) expr ::= ID|INDEXED LP STAR RP filter_over */
158052
- -1, /* (183) term ::= CTIME_KW */
158053
- -5, /* (184) expr ::= LP nexprlist COMMA expr RP */
158054
- -3, /* (185) expr ::= expr AND expr */
158055
- -3, /* (186) expr ::= expr OR expr */
158056
- -3, /* (187) expr ::= expr LT|GT|GE|LE expr */
158057
- -3, /* (188) expr ::= expr EQ|NE expr */
158058
- -3, /* (189) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
158059
- -3, /* (190) expr ::= expr PLUS|MINUS expr */
158060
- -3, /* (191) expr ::= expr STAR|SLASH|REM expr */
158061
- -3, /* (192) expr ::= expr CONCAT expr */
158062
- -2, /* (193) likeop ::= NOT LIKE_KW|MATCH */
158063
- -3, /* (194) expr ::= expr likeop expr */
158064
- -5, /* (195) expr ::= expr likeop expr ESCAPE expr */
158065
- -2, /* (196) expr ::= expr ISNULL|NOTNULL */
158066
- -3, /* (197) expr ::= expr NOT NULL */
158067
- -3, /* (198) expr ::= expr IS expr */
158068
- -4, /* (199) expr ::= expr IS NOT expr */
158069
- -2, /* (200) expr ::= NOT expr */
158070
- -2, /* (201) expr ::= BITNOT expr */
158071
- -2, /* (202) expr ::= PLUS|MINUS expr */
158072
- -1, /* (203) between_op ::= BETWEEN */
158073
- -2, /* (204) between_op ::= NOT BETWEEN */
158074
- -5, /* (205) expr ::= expr between_op expr AND expr */
158075
- -1, /* (206) in_op ::= IN */
158076
- -2, /* (207) in_op ::= NOT IN */
158077
- -5, /* (208) expr ::= expr in_op LP exprlist RP */
158078
- -3, /* (209) expr ::= LP select RP */
158079
- -5, /* (210) expr ::= expr in_op LP select RP */
158080
- -5, /* (211) expr ::= expr in_op nm dbnm paren_exprlist */
158081
- -4, /* (212) expr ::= EXISTS LP select RP */
158082
- -5, /* (213) expr ::= CASE case_operand case_exprlist case_else END */
158083
- -5, /* (214) case_exprlist ::= case_exprlist WHEN expr THEN expr */
158084
- -4, /* (215) case_exprlist ::= WHEN expr THEN expr */
158085
- -2, /* (216) case_else ::= ELSE expr */
158086
- 0, /* (217) case_else ::= */
158087
- -1, /* (218) case_operand ::= expr */
158088
- 0, /* (219) case_operand ::= */
158089
- 0, /* (220) exprlist ::= */
158090
- -3, /* (221) nexprlist ::= nexprlist COMMA expr */
158091
- -1, /* (222) nexprlist ::= expr */
158092
- 0, /* (223) paren_exprlist ::= */
158093
- -3, /* (224) paren_exprlist ::= LP exprlist RP */
158094
- -12, /* (225) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
158095
- -1, /* (226) uniqueflag ::= UNIQUE */
158096
- 0, /* (227) uniqueflag ::= */
158097
- 0, /* (228) eidlist_opt ::= */
158098
- -3, /* (229) eidlist_opt ::= LP eidlist RP */
158099
- -5, /* (230) eidlist ::= eidlist COMMA nm collate sortorder */
158100
- -3, /* (231) eidlist ::= nm collate sortorder */
158101
- 0, /* (232) collate ::= */
158102
- -2, /* (233) collate ::= COLLATE ID|STRING */
158103
- -4, /* (234) cmd ::= DROP INDEX ifexists fullname */
158104
- -2, /* (235) cmd ::= VACUUM vinto */
158105
- -3, /* (236) cmd ::= VACUUM nm vinto */
158106
- -2, /* (237) vinto ::= INTO expr */
158107
- 0, /* (238) vinto ::= */
158108
- -3, /* (239) cmd ::= PRAGMA nm dbnm */
158109
- -5, /* (240) cmd ::= PRAGMA nm dbnm EQ nmnum */
158110
- -6, /* (241) cmd ::= PRAGMA nm dbnm LP nmnum RP */
158111
- -5, /* (242) cmd ::= PRAGMA nm dbnm EQ minus_num */
158112
- -6, /* (243) cmd ::= PRAGMA nm dbnm LP minus_num RP */
158113
- -2, /* (244) plus_num ::= PLUS INTEGER|FLOAT */
158114
- -2, /* (245) minus_num ::= MINUS INTEGER|FLOAT */
158115
- -5, /* (246) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
158116
- -11, /* (247) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
158117
- -1, /* (248) trigger_time ::= BEFORE|AFTER */
158118
- -2, /* (249) trigger_time ::= INSTEAD OF */
158119
- 0, /* (250) trigger_time ::= */
158120
- -1, /* (251) trigger_event ::= DELETE|INSERT */
158121
- -1, /* (252) trigger_event ::= UPDATE */
158122
- -3, /* (253) trigger_event ::= UPDATE OF idlist */
158123
- 0, /* (254) when_clause ::= */
158124
- -2, /* (255) when_clause ::= WHEN expr */
158125
- -3, /* (256) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
158126
- -2, /* (257) trigger_cmd_list ::= trigger_cmd SEMI */
158127
- -3, /* (258) trnm ::= nm DOT nm */
158128
- -3, /* (259) tridxby ::= INDEXED BY nm */
158129
- -2, /* (260) tridxby ::= NOT INDEXED */
158130
- -9, /* (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
158131
- -8, /* (262) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
158132
- -6, /* (263) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
158133
- -3, /* (264) trigger_cmd ::= scanpt select scanpt */
158134
- -4, /* (265) expr ::= RAISE LP IGNORE RP */
158135
- -6, /* (266) expr ::= RAISE LP raisetype COMMA nm RP */
158136
- -1, /* (267) raisetype ::= ROLLBACK */
158137
- -1, /* (268) raisetype ::= ABORT */
158138
- -1, /* (269) raisetype ::= FAIL */
158139
- -4, /* (270) cmd ::= DROP TRIGGER ifexists fullname */
158140
- -6, /* (271) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
158141
- -3, /* (272) cmd ::= DETACH database_kw_opt expr */
158142
- 0, /* (273) key_opt ::= */
158143
- -2, /* (274) key_opt ::= KEY expr */
158144
- -1, /* (275) cmd ::= REINDEX */
158145
- -3, /* (276) cmd ::= REINDEX nm dbnm */
158146
- -1, /* (277) cmd ::= ANALYZE */
158147
- -3, /* (278) cmd ::= ANALYZE nm dbnm */
158148
- -6, /* (279) cmd ::= ALTER TABLE fullname RENAME TO nm */
158149
- -7, /* (280) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
158150
- -1, /* (281) add_column_fullname ::= fullname */
158151
- -8, /* (282) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
158152
- -1, /* (283) cmd ::= create_vtab */
158153
- -4, /* (284) cmd ::= create_vtab LP vtabarglist RP */
158154
- -8, /* (285) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
158155
- 0, /* (286) vtabarg ::= */
158156
- -1, /* (287) vtabargtoken ::= ANY */
158157
- -3, /* (288) vtabargtoken ::= lp anylist RP */
158158
- -1, /* (289) lp ::= LP */
158159
- -2, /* (290) with ::= WITH wqlist */
158160
- -3, /* (291) with ::= WITH RECURSIVE wqlist */
158161
- -6, /* (292) wqlist ::= nm eidlist_opt AS LP select RP */
158162
- -8, /* (293) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
158163
- -1, /* (294) windowdefn_list ::= windowdefn */
158164
- -3, /* (295) windowdefn_list ::= windowdefn_list COMMA windowdefn */
158165
- -5, /* (296) windowdefn ::= nm AS LP window RP */
158166
- -5, /* (297) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
158167
- -6, /* (298) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
158168
- -4, /* (299) window ::= ORDER BY sortlist frame_opt */
158169
- -5, /* (300) window ::= nm ORDER BY sortlist frame_opt */
158170
- -1, /* (301) window ::= frame_opt */
158171
- -2, /* (302) window ::= nm frame_opt */
158172
- 0, /* (303) frame_opt ::= */
158173
- -3, /* (304) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
158174
- -6, /* (305) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
158175
- -1, /* (306) range_or_rows ::= RANGE|ROWS|GROUPS */
158176
- -1, /* (307) frame_bound_s ::= frame_bound */
158177
- -2, /* (308) frame_bound_s ::= UNBOUNDED PRECEDING */
158178
- -1, /* (309) frame_bound_e ::= frame_bound */
158179
- -2, /* (310) frame_bound_e ::= UNBOUNDED FOLLOWING */
158180
- -2, /* (311) frame_bound ::= expr PRECEDING|FOLLOWING */
158181
- -2, /* (312) frame_bound ::= CURRENT ROW */
158182
- 0, /* (313) frame_exclude_opt ::= */
158183
- -2, /* (314) frame_exclude_opt ::= EXCLUDE frame_exclude */
158184
- -2, /* (315) frame_exclude ::= NO OTHERS */
158185
- -2, /* (316) frame_exclude ::= CURRENT ROW */
158186
- -1, /* (317) frame_exclude ::= GROUP|TIES */
158187
- -2, /* (318) window_clause ::= WINDOW windowdefn_list */
158188
- -2, /* (319) filter_over ::= filter_clause over_clause */
158189
- -1, /* (320) filter_over ::= over_clause */
158190
- -1, /* (321) filter_over ::= filter_clause */
158191
- -4, /* (322) over_clause ::= OVER LP window RP */
158192
- -2, /* (323) over_clause ::= OVER nm */
158193
- -5, /* (324) filter_clause ::= FILTER LP WHERE expr RP */
158194
- -1, /* (325) input ::= cmdlist */
158195
- -2, /* (326) cmdlist ::= cmdlist ecmd */
158196
- -1, /* (327) cmdlist ::= ecmd */
158197
- -1, /* (328) ecmd ::= SEMI */
158198
- -2, /* (329) ecmd ::= cmdx SEMI */
158199
- -3, /* (330) ecmd ::= explain cmdx SEMI */
158200
- 0, /* (331) trans_opt ::= */
158201
- -1, /* (332) trans_opt ::= TRANSACTION */
158202
- -2, /* (333) trans_opt ::= TRANSACTION nm */
158203
- -1, /* (334) savepoint_opt ::= SAVEPOINT */
158204
- 0, /* (335) savepoint_opt ::= */
158205
- -2, /* (336) cmd ::= create_table create_table_args */
158206
- -4, /* (337) columnlist ::= columnlist COMMA columnname carglist */
158207
- -2, /* (338) columnlist ::= columnname carglist */
158208
- -1, /* (339) nm ::= ID|INDEXED */
158209
- -1, /* (340) nm ::= STRING */
158210
- -1, /* (341) nm ::= JOIN_KW */
158211
- -1, /* (342) typetoken ::= typename */
158212
- -1, /* (343) typename ::= ID|STRING */
158213
- -1, /* (344) signed ::= plus_num */
158214
- -1, /* (345) signed ::= minus_num */
158215
- -2, /* (346) carglist ::= carglist ccons */
158216
- 0, /* (347) carglist ::= */
158217
- -2, /* (348) ccons ::= NULL onconf */
158218
- -4, /* (349) ccons ::= GENERATED ALWAYS AS generated */
158219
- -2, /* (350) ccons ::= AS generated */
158220
- -2, /* (351) conslist_opt ::= COMMA conslist */
158221
- -3, /* (352) conslist ::= conslist tconscomma tcons */
158222
- -1, /* (353) conslist ::= tcons */
158223
- 0, /* (354) tconscomma ::= */
158224
- -1, /* (355) defer_subclause_opt ::= defer_subclause */
158225
- -1, /* (356) resolvetype ::= raisetype */
158226
- -1, /* (357) selectnowith ::= oneselect */
158227
- -1, /* (358) oneselect ::= values */
158228
- -2, /* (359) sclp ::= selcollist COMMA */
158229
- -1, /* (360) as ::= ID|STRING */
158230
- -1, /* (361) expr ::= term */
158231
- -1, /* (362) likeop ::= LIKE_KW|MATCH */
158232
- -1, /* (363) exprlist ::= nexprlist */
158233
- -1, /* (364) nmnum ::= plus_num */
158234
- -1, /* (365) nmnum ::= nm */
158235
- -1, /* (366) nmnum ::= ON */
158236
- -1, /* (367) nmnum ::= DELETE */
158237
- -1, /* (368) nmnum ::= DEFAULT */
158238
- -1, /* (369) plus_num ::= INTEGER|FLOAT */
158239
- 0, /* (370) foreach_clause ::= */
158240
- -3, /* (371) foreach_clause ::= FOR EACH ROW */
158241
- -1, /* (372) trnm ::= nm */
158242
- 0, /* (373) tridxby ::= */
158243
- -1, /* (374) database_kw_opt ::= DATABASE */
158244
- 0, /* (375) database_kw_opt ::= */
158245
- 0, /* (376) kwcolumn_opt ::= */
158246
- -1, /* (377) kwcolumn_opt ::= COLUMNKW */
158247
- -1, /* (378) vtabarglist ::= vtabarg */
158248
- -3, /* (379) vtabarglist ::= vtabarglist COMMA vtabarg */
158249
- -2, /* (380) vtabarg ::= vtabarg vtabargtoken */
158250
- 0, /* (381) anylist ::= */
158251
- -4, /* (382) anylist ::= anylist LP anylist RP */
158252
- -2, /* (383) anylist ::= anylist ANY */
158253
- 0, /* (384) with ::= */
158667
+ -7, /* (162) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt */
158668
+ -2, /* (163) insert_cmd ::= INSERT orconf */
158669
+ -1, /* (164) insert_cmd ::= REPLACE */
158670
+ 0, /* (165) idlist_opt ::= */
158671
+ -3, /* (166) idlist_opt ::= LP idlist RP */
158672
+ -3, /* (167) idlist ::= idlist COMMA nm */
158673
+ -1, /* (168) idlist ::= nm */
158674
+ -3, /* (169) expr ::= LP expr RP */
158675
+ -1, /* (170) expr ::= ID|INDEXED */
158676
+ -1, /* (171) expr ::= JOIN_KW */
158677
+ -3, /* (172) expr ::= nm DOT nm */
158678
+ -5, /* (173) expr ::= nm DOT nm DOT nm */
158679
+ -1, /* (174) term ::= NULL|FLOAT|BLOB */
158680
+ -1, /* (175) term ::= STRING */
158681
+ -1, /* (176) term ::= INTEGER */
158682
+ -1, /* (177) expr ::= VARIABLE */
158683
+ -3, /* (178) expr ::= expr COLLATE ID|STRING */
158684
+ -6, /* (179) expr ::= CAST LP expr AS typetoken RP */
158685
+ -5, /* (180) expr ::= ID|INDEXED LP distinct exprlist RP */
158686
+ -4, /* (181) expr ::= ID|INDEXED LP STAR RP */
158687
+ -6, /* (182) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
158688
+ -5, /* (183) expr ::= ID|INDEXED LP STAR RP filter_over */
158689
+ -1, /* (184) term ::= CTIME_KW */
158690
+ -5, /* (185) expr ::= LP nexprlist COMMA expr RP */
158691
+ -3, /* (186) expr ::= expr AND expr */
158692
+ -3, /* (187) expr ::= expr OR expr */
158693
+ -3, /* (188) expr ::= expr LT|GT|GE|LE expr */
158694
+ -3, /* (189) expr ::= expr EQ|NE expr */
158695
+ -3, /* (190) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
158696
+ -3, /* (191) expr ::= expr PLUS|MINUS expr */
158697
+ -3, /* (192) expr ::= expr STAR|SLASH|REM expr */
158698
+ -3, /* (193) expr ::= expr CONCAT expr */
158699
+ -2, /* (194) likeop ::= NOT LIKE_KW|MATCH */
158700
+ -3, /* (195) expr ::= expr likeop expr */
158701
+ -5, /* (196) expr ::= expr likeop expr ESCAPE expr */
158702
+ -2, /* (197) expr ::= expr ISNULL|NOTNULL */
158703
+ -3, /* (198) expr ::= expr NOT NULL */
158704
+ -3, /* (199) expr ::= expr IS expr */
158705
+ -4, /* (200) expr ::= expr IS NOT expr */
158706
+ -2, /* (201) expr ::= NOT expr */
158707
+ -2, /* (202) expr ::= BITNOT expr */
158708
+ -2, /* (203) expr ::= PLUS|MINUS expr */
158709
+ -1, /* (204) between_op ::= BETWEEN */
158710
+ -2, /* (205) between_op ::= NOT BETWEEN */
158711
+ -5, /* (206) expr ::= expr between_op expr AND expr */
158712
+ -1, /* (207) in_op ::= IN */
158713
+ -2, /* (208) in_op ::= NOT IN */
158714
+ -5, /* (209) expr ::= expr in_op LP exprlist RP */
158715
+ -3, /* (210) expr ::= LP select RP */
158716
+ -5, /* (211) expr ::= expr in_op LP select RP */
158717
+ -5, /* (212) expr ::= expr in_op nm dbnm paren_exprlist */
158718
+ -4, /* (213) expr ::= EXISTS LP select RP */
158719
+ -5, /* (214) expr ::= CASE case_operand case_exprlist case_else END */
158720
+ -5, /* (215) case_exprlist ::= case_exprlist WHEN expr THEN expr */
158721
+ -4, /* (216) case_exprlist ::= WHEN expr THEN expr */
158722
+ -2, /* (217) case_else ::= ELSE expr */
158723
+ 0, /* (218) case_else ::= */
158724
+ -1, /* (219) case_operand ::= expr */
158725
+ 0, /* (220) case_operand ::= */
158726
+ 0, /* (221) exprlist ::= */
158727
+ -3, /* (222) nexprlist ::= nexprlist COMMA expr */
158728
+ -1, /* (223) nexprlist ::= expr */
158729
+ 0, /* (224) paren_exprlist ::= */
158730
+ -3, /* (225) paren_exprlist ::= LP exprlist RP */
158731
+ -12, /* (226) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
158732
+ -1, /* (227) uniqueflag ::= UNIQUE */
158733
+ 0, /* (228) uniqueflag ::= */
158734
+ 0, /* (229) eidlist_opt ::= */
158735
+ -3, /* (230) eidlist_opt ::= LP eidlist RP */
158736
+ -5, /* (231) eidlist ::= eidlist COMMA nm collate sortorder */
158737
+ -3, /* (232) eidlist ::= nm collate sortorder */
158738
+ 0, /* (233) collate ::= */
158739
+ -2, /* (234) collate ::= COLLATE ID|STRING */
158740
+ -4, /* (235) cmd ::= DROP INDEX ifexists fullname */
158741
+ -2, /* (236) cmd ::= VACUUM vinto */
158742
+ -3, /* (237) cmd ::= VACUUM nm vinto */
158743
+ -2, /* (238) vinto ::= INTO expr */
158744
+ 0, /* (239) vinto ::= */
158745
+ -3, /* (240) cmd ::= PRAGMA nm dbnm */
158746
+ -5, /* (241) cmd ::= PRAGMA nm dbnm EQ nmnum */
158747
+ -6, /* (242) cmd ::= PRAGMA nm dbnm LP nmnum RP */
158748
+ -5, /* (243) cmd ::= PRAGMA nm dbnm EQ minus_num */
158749
+ -6, /* (244) cmd ::= PRAGMA nm dbnm LP minus_num RP */
158750
+ -2, /* (245) plus_num ::= PLUS INTEGER|FLOAT */
158751
+ -2, /* (246) minus_num ::= MINUS INTEGER|FLOAT */
158752
+ -5, /* (247) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
158753
+ -11, /* (248) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
158754
+ -1, /* (249) trigger_time ::= BEFORE|AFTER */
158755
+ -2, /* (250) trigger_time ::= INSTEAD OF */
158756
+ 0, /* (251) trigger_time ::= */
158757
+ -1, /* (252) trigger_event ::= DELETE|INSERT */
158758
+ -1, /* (253) trigger_event ::= UPDATE */
158759
+ -3, /* (254) trigger_event ::= UPDATE OF idlist */
158760
+ 0, /* (255) when_clause ::= */
158761
+ -2, /* (256) when_clause ::= WHEN expr */
158762
+ -3, /* (257) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
158763
+ -2, /* (258) trigger_cmd_list ::= trigger_cmd SEMI */
158764
+ -3, /* (259) trnm ::= nm DOT nm */
158765
+ -3, /* (260) tridxby ::= INDEXED BY nm */
158766
+ -2, /* (261) tridxby ::= NOT INDEXED */
158767
+ -9, /* (262) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
158768
+ -8, /* (263) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
158769
+ -6, /* (264) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
158770
+ -3, /* (265) trigger_cmd ::= scanpt select scanpt */
158771
+ -4, /* (266) expr ::= RAISE LP IGNORE RP */
158772
+ -6, /* (267) expr ::= RAISE LP raisetype COMMA nm RP */
158773
+ -1, /* (268) raisetype ::= ROLLBACK */
158774
+ -1, /* (269) raisetype ::= ABORT */
158775
+ -1, /* (270) raisetype ::= FAIL */
158776
+ -4, /* (271) cmd ::= DROP TRIGGER ifexists fullname */
158777
+ -6, /* (272) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
158778
+ -3, /* (273) cmd ::= DETACH database_kw_opt expr */
158779
+ 0, /* (274) key_opt ::= */
158780
+ -2, /* (275) key_opt ::= KEY expr */
158781
+ -1, /* (276) cmd ::= REINDEX */
158782
+ -3, /* (277) cmd ::= REINDEX nm dbnm */
158783
+ -1, /* (278) cmd ::= ANALYZE */
158784
+ -3, /* (279) cmd ::= ANALYZE nm dbnm */
158785
+ -6, /* (280) cmd ::= ALTER TABLE fullname RENAME TO nm */
158786
+ -7, /* (281) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
158787
+ -1, /* (282) add_column_fullname ::= fullname */
158788
+ -8, /* (283) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
158789
+ -1, /* (284) cmd ::= create_vtab */
158790
+ -4, /* (285) cmd ::= create_vtab LP vtabarglist RP */
158791
+ -8, /* (286) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
158792
+ 0, /* (287) vtabarg ::= */
158793
+ -1, /* (288) vtabargtoken ::= ANY */
158794
+ -3, /* (289) vtabargtoken ::= lp anylist RP */
158795
+ -1, /* (290) lp ::= LP */
158796
+ -2, /* (291) with ::= WITH wqlist */
158797
+ -3, /* (292) with ::= WITH RECURSIVE wqlist */
158798
+ -6, /* (293) wqlist ::= nm eidlist_opt AS LP select RP */
158799
+ -8, /* (294) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
158800
+ -1, /* (295) windowdefn_list ::= windowdefn */
158801
+ -3, /* (296) windowdefn_list ::= windowdefn_list COMMA windowdefn */
158802
+ -5, /* (297) windowdefn ::= nm AS LP window RP */
158803
+ -5, /* (298) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
158804
+ -6, /* (299) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
158805
+ -4, /* (300) window ::= ORDER BY sortlist frame_opt */
158806
+ -5, /* (301) window ::= nm ORDER BY sortlist frame_opt */
158807
+ -1, /* (302) window ::= frame_opt */
158808
+ -2, /* (303) window ::= nm frame_opt */
158809
+ 0, /* (304) frame_opt ::= */
158810
+ -3, /* (305) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
158811
+ -6, /* (306) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
158812
+ -1, /* (307) range_or_rows ::= RANGE|ROWS|GROUPS */
158813
+ -1, /* (308) frame_bound_s ::= frame_bound */
158814
+ -2, /* (309) frame_bound_s ::= UNBOUNDED PRECEDING */
158815
+ -1, /* (310) frame_bound_e ::= frame_bound */
158816
+ -2, /* (311) frame_bound_e ::= UNBOUNDED FOLLOWING */
158817
+ -2, /* (312) frame_bound ::= expr PRECEDING|FOLLOWING */
158818
+ -2, /* (313) frame_bound ::= CURRENT ROW */
158819
+ 0, /* (314) frame_exclude_opt ::= */
158820
+ -2, /* (315) frame_exclude_opt ::= EXCLUDE frame_exclude */
158821
+ -2, /* (316) frame_exclude ::= NO OTHERS */
158822
+ -2, /* (317) frame_exclude ::= CURRENT ROW */
158823
+ -1, /* (318) frame_exclude ::= GROUP|TIES */
158824
+ -2, /* (319) window_clause ::= WINDOW windowdefn_list */
158825
+ -2, /* (320) filter_over ::= filter_clause over_clause */
158826
+ -1, /* (321) filter_over ::= over_clause */
158827
+ -1, /* (322) filter_over ::= filter_clause */
158828
+ -4, /* (323) over_clause ::= OVER LP window RP */
158829
+ -2, /* (324) over_clause ::= OVER nm */
158830
+ -5, /* (325) filter_clause ::= FILTER LP WHERE expr RP */
158831
+ -1, /* (326) input ::= cmdlist */
158832
+ -2, /* (327) cmdlist ::= cmdlist ecmd */
158833
+ -1, /* (328) cmdlist ::= ecmd */
158834
+ -1, /* (329) ecmd ::= SEMI */
158835
+ -2, /* (330) ecmd ::= cmdx SEMI */
158836
+ -3, /* (331) ecmd ::= explain cmdx SEMI */
158837
+ 0, /* (332) trans_opt ::= */
158838
+ -1, /* (333) trans_opt ::= TRANSACTION */
158839
+ -2, /* (334) trans_opt ::= TRANSACTION nm */
158840
+ -1, /* (335) savepoint_opt ::= SAVEPOINT */
158841
+ 0, /* (336) savepoint_opt ::= */
158842
+ -2, /* (337) cmd ::= create_table create_table_args */
158843
+ -4, /* (338) columnlist ::= columnlist COMMA columnname carglist */
158844
+ -2, /* (339) columnlist ::= columnname carglist */
158845
+ -1, /* (340) nm ::= ID|INDEXED */
158846
+ -1, /* (341) nm ::= STRING */
158847
+ -1, /* (342) nm ::= JOIN_KW */
158848
+ -1, /* (343) typetoken ::= typename */
158849
+ -1, /* (344) typename ::= ID|STRING */
158850
+ -1, /* (345) signed ::= plus_num */
158851
+ -1, /* (346) signed ::= minus_num */
158852
+ -2, /* (347) carglist ::= carglist ccons */
158853
+ 0, /* (348) carglist ::= */
158854
+ -2, /* (349) ccons ::= NULL onconf */
158855
+ -4, /* (350) ccons ::= GENERATED ALWAYS AS generated */
158856
+ -2, /* (351) ccons ::= AS generated */
158857
+ -2, /* (352) conslist_opt ::= COMMA conslist */
158858
+ -3, /* (353) conslist ::= conslist tconscomma tcons */
158859
+ -1, /* (354) conslist ::= tcons */
158860
+ 0, /* (355) tconscomma ::= */
158861
+ -1, /* (356) defer_subclause_opt ::= defer_subclause */
158862
+ -1, /* (357) resolvetype ::= raisetype */
158863
+ -1, /* (358) selectnowith ::= oneselect */
158864
+ -1, /* (359) oneselect ::= values */
158865
+ -2, /* (360) sclp ::= selcollist COMMA */
158866
+ -1, /* (361) as ::= ID|STRING */
158867
+ -1, /* (362) expr ::= term */
158868
+ -1, /* (363) likeop ::= LIKE_KW|MATCH */
158869
+ -1, /* (364) exprlist ::= nexprlist */
158870
+ -1, /* (365) nmnum ::= plus_num */
158871
+ -1, /* (366) nmnum ::= nm */
158872
+ -1, /* (367) nmnum ::= ON */
158873
+ -1, /* (368) nmnum ::= DELETE */
158874
+ -1, /* (369) nmnum ::= DEFAULT */
158875
+ -1, /* (370) plus_num ::= INTEGER|FLOAT */
158876
+ 0, /* (371) foreach_clause ::= */
158877
+ -3, /* (372) foreach_clause ::= FOR EACH ROW */
158878
+ -1, /* (373) trnm ::= nm */
158879
+ 0, /* (374) tridxby ::= */
158880
+ -1, /* (375) database_kw_opt ::= DATABASE */
158881
+ 0, /* (376) database_kw_opt ::= */
158882
+ 0, /* (377) kwcolumn_opt ::= */
158883
+ -1, /* (378) kwcolumn_opt ::= COLUMNKW */
158884
+ -1, /* (379) vtabarglist ::= vtabarg */
158885
+ -3, /* (380) vtabarglist ::= vtabarglist COMMA vtabarg */
158886
+ -2, /* (381) vtabarg ::= vtabarg vtabargtoken */
158887
+ 0, /* (382) anylist ::= */
158888
+ -4, /* (383) anylist ::= anylist LP anylist RP */
158889
+ -2, /* (384) anylist ::= anylist ANY */
158890
+ 0, /* (385) with ::= */
158254158891
};
158255158892
158256158893
static void yy_accept(yyParser*); /* Forward Declaration */
158257158894
158258158895
/*
@@ -158357,11 +158994,11 @@
158357158994
{yymsp[1].minor.yy192 = TK_DEFERRED;}
158358158995
break;
158359158996
case 5: /* transtype ::= DEFERRED */
158360158997
case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
158361158998
case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
158362
- case 306: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==306);
158999
+ case 307: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==307);
158363159000
{yymsp[0].minor.yy192 = yymsp[0].major; /*A-overwrites-X*/}
158364159001
break;
158365159002
case 8: /* cmd ::= COMMIT|END trans_opt */
158366159003
case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
158367159004
{sqlite3EndTransaction(pParse,yymsp[-1].major);}
@@ -158395,11 +159032,11 @@
158395159032
case 45: /* autoinc ::= */ yytestcase(yyruleno==45);
158396159033
case 60: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==60);
158397159034
case 70: /* defer_subclause_opt ::= */ yytestcase(yyruleno==70);
158398159035
case 79: /* ifexists ::= */ yytestcase(yyruleno==79);
158399159036
case 96: /* distinct ::= */ yytestcase(yyruleno==96);
158400
- case 232: /* collate ::= */ yytestcase(yyruleno==232);
159037
+ case 233: /* collate ::= */ yytestcase(yyruleno==233);
158401159038
{yymsp[1].minor.yy192 = 0;}
158402159039
break;
158403159040
case 16: /* ifnotexists ::= IF NOT EXISTS */
158404159041
{yymsp[-2].minor.yy192 = 1;}
158405159042
break;
@@ -158554,18 +159191,18 @@
158554159191
case 58: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
158555159192
{yymsp[-2].minor.yy192 = 0;}
158556159193
break;
158557159194
case 59: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
158558159195
case 74: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==74);
158559
- case 162: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==162);
159196
+ case 163: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==163);
158560159197
{yymsp[-1].minor.yy192 = yymsp[0].minor.yy192;}
158561159198
break;
158562159199
case 61: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
158563159200
case 78: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==78);
158564
- case 204: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==204);
158565
- case 207: /* in_op ::= NOT IN */ yytestcase(yyruleno==207);
158566
- case 233: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==233);
159201
+ case 205: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==205);
159202
+ case 208: /* in_op ::= NOT IN */ yytestcase(yyruleno==208);
159203
+ case 234: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==234);
158567159204
{yymsp[-1].minor.yy192 = 1;}
158568159205
break;
158569159206
case 62: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
158570159207
{yymsp[-1].minor.yy192 = 0;}
158571159208
break;
@@ -158597,11 +159234,11 @@
158597159234
break;
158598159235
case 75: /* resolvetype ::= IGNORE */
158599159236
{yymsp[0].minor.yy192 = OE_Ignore;}
158600159237
break;
158601159238
case 76: /* resolvetype ::= REPLACE */
158602
- case 163: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==163);
159239
+ case 164: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==164);
158603159240
{yymsp[0].minor.yy192 = OE_Replace;}
158604159241
break;
158605159242
case 77: /* cmd ::= DROP TABLE ifexists fullname */
158606159243
{
158607159244
sqlite3DropTable(pParse, yymsp[0].minor.yy47, 0, yymsp[-1].minor.yy192);
@@ -158729,13 +159366,13 @@
158729159366
{yymsp[0].minor.yy192 = SF_All;}
158730159367
break;
158731159368
case 97: /* sclp ::= */
158732159369
case 130: /* orderby_opt ::= */ yytestcase(yyruleno==130);
158733159370
case 140: /* groupby_opt ::= */ yytestcase(yyruleno==140);
158734
- case 220: /* exprlist ::= */ yytestcase(yyruleno==220);
158735
- case 223: /* paren_exprlist ::= */ yytestcase(yyruleno==223);
158736
- case 228: /* eidlist_opt ::= */ yytestcase(yyruleno==228);
159371
+ case 221: /* exprlist ::= */ yytestcase(yyruleno==221);
159372
+ case 224: /* paren_exprlist ::= */ yytestcase(yyruleno==224);
159373
+ case 229: /* eidlist_opt ::= */ yytestcase(yyruleno==229);
158737159374
{yymsp[1].minor.yy242 = 0;}
158738159375
break;
158739159376
case 98: /* selcollist ::= sclp scanpt expr scanpt as */
158740159377
{
158741159378
yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy242, yymsp[-2].minor.yy202);
@@ -158757,12 +159394,12 @@
158757159394
yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242, pDot);
158758159395
}
158759159396
break;
158760159397
case 101: /* as ::= AS nm */
158761159398
case 112: /* dbnm ::= DOT nm */ yytestcase(yyruleno==112);
158762
- case 244: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==244);
158763
- case 245: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==245);
159399
+ case 245: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==245);
159400
+ case 246: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==246);
158764159401
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
158765159402
break;
158766159403
case 103: /* from ::= */
158767159404
case 106: /* stl_prefix ::= */ yytestcase(yyruleno==106);
158768159405
{yymsp[1].minor.yy47 = 0;}
@@ -158874,21 +159511,21 @@
158874159511
{yymsp[-3].minor.yy192 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
158875159512
break;
158876159513
case 123: /* on_opt ::= ON expr */
158877159514
case 143: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==143);
158878159515
case 150: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==150);
158879
- case 216: /* case_else ::= ELSE expr */ yytestcase(yyruleno==216);
158880
- case 237: /* vinto ::= INTO expr */ yytestcase(yyruleno==237);
159516
+ case 217: /* case_else ::= ELSE expr */ yytestcase(yyruleno==217);
159517
+ case 238: /* vinto ::= INTO expr */ yytestcase(yyruleno==238);
158881159518
{yymsp[-1].minor.yy202 = yymsp[0].minor.yy202;}
158882159519
break;
158883159520
case 124: /* on_opt ::= */
158884159521
case 142: /* having_opt ::= */ yytestcase(yyruleno==142);
158885159522
case 144: /* limit_opt ::= */ yytestcase(yyruleno==144);
158886159523
case 149: /* where_opt ::= */ yytestcase(yyruleno==149);
158887
- case 217: /* case_else ::= */ yytestcase(yyruleno==217);
158888
- case 219: /* case_operand ::= */ yytestcase(yyruleno==219);
158889
- case 238: /* vinto ::= */ yytestcase(yyruleno==238);
159524
+ case 218: /* case_else ::= */ yytestcase(yyruleno==218);
159525
+ case 220: /* case_operand ::= */ yytestcase(yyruleno==220);
159526
+ case 239: /* vinto ::= */ yytestcase(yyruleno==239);
158890159527
{yymsp[1].minor.yy202 = 0;}
158891159528
break;
158892159529
case 126: /* indexed_opt ::= INDEXED BY nm */
158893159530
{yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
158894159531
break;
@@ -158897,11 +159534,11 @@
158897159534
break;
158898159535
case 128: /* using_opt ::= USING LP idlist RP */
158899159536
{yymsp[-3].minor.yy600 = yymsp[-1].minor.yy600;}
158900159537
break;
158901159538
case 129: /* using_opt ::= */
158902
- case 164: /* idlist_opt ::= */ yytestcase(yyruleno==164);
159539
+ case 165: /* idlist_opt ::= */ yytestcase(yyruleno==165);
158903159540
{yymsp[1].minor.yy600 = 0;}
158904159541
break;
158905159542
case 131: /* orderby_opt ::= ORDER BY sortlist */
158906159543
case 141: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==141);
158907159544
{yymsp[-2].minor.yy242 = yymsp[0].minor.yy242;}
@@ -158991,36 +159628,39 @@
158991159628
}
158992159629
break;
158993159630
case 158: /* upsert ::= */
158994159631
{ yymsp[1].minor.yy318 = 0; }
158995159632
break;
158996
- case 159: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
158997
-{ yymsp[-10].minor.yy318 = sqlite3UpsertNew(pParse->db,yymsp[-7].minor.yy242,yymsp[-5].minor.yy202,yymsp[-1].minor.yy242,yymsp[0].minor.yy202);}
159633
+ case 159: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
159634
+{ yymsp[-11].minor.yy318 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy242,yymsp[-6].minor.yy202,yymsp[-2].minor.yy242,yymsp[-1].minor.yy202,yymsp[0].minor.yy318);}
158998159635
break;
158999
- case 160: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
159000
-{ yymsp[-7].minor.yy318 = sqlite3UpsertNew(pParse->db,yymsp[-4].minor.yy242,yymsp[-2].minor.yy202,0,0); }
159636
+ case 160: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
159637
+{ yymsp[-8].minor.yy318 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy242,yymsp[-3].minor.yy202,0,0,yymsp[0].minor.yy318); }
159001159638
break;
159002159639
case 161: /* upsert ::= ON CONFLICT DO NOTHING */
159003
-{ yymsp[-3].minor.yy318 = sqlite3UpsertNew(pParse->db,0,0,0,0); }
159640
+{ yymsp[-3].minor.yy318 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
159004159641
break;
159005
- case 165: /* idlist_opt ::= LP idlist RP */
159642
+ case 162: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt */
159643
+{ yymsp[-6].minor.yy318 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-1].minor.yy242,yymsp[0].minor.yy202,0);}
159644
+ break;
159645
+ case 166: /* idlist_opt ::= LP idlist RP */
159006159646
{yymsp[-2].minor.yy600 = yymsp[-1].minor.yy600;}
159007159647
break;
159008
- case 166: /* idlist ::= idlist COMMA nm */
159648
+ case 167: /* idlist ::= idlist COMMA nm */
159009159649
{yymsp[-2].minor.yy600 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy600,&yymsp[0].minor.yy0);}
159010159650
break;
159011
- case 167: /* idlist ::= nm */
159651
+ case 168: /* idlist ::= nm */
159012159652
{yymsp[0].minor.yy600 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
159013159653
break;
159014
- case 168: /* expr ::= LP expr RP */
159654
+ case 169: /* expr ::= LP expr RP */
159015159655
{yymsp[-2].minor.yy202 = yymsp[-1].minor.yy202;}
159016159656
break;
159017
- case 169: /* expr ::= ID|INDEXED */
159018
- case 170: /* expr ::= JOIN_KW */ yytestcase(yyruleno==170);
159657
+ case 170: /* expr ::= ID|INDEXED */
159658
+ case 171: /* expr ::= JOIN_KW */ yytestcase(yyruleno==171);
159019159659
{yymsp[0].minor.yy202=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
159020159660
break;
159021
- case 171: /* expr ::= nm DOT nm */
159661
+ case 172: /* expr ::= nm DOT nm */
159022159662
{
159023159663
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
159024159664
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
159025159665
if( IN_RENAME_OBJECT ){
159026159666
sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[0].minor.yy0);
@@ -159028,11 +159668,11 @@
159028159668
}
159029159669
yylhsminor.yy202 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
159030159670
}
159031159671
yymsp[-2].minor.yy202 = yylhsminor.yy202;
159032159672
break;
159033
- case 172: /* expr ::= nm DOT nm DOT nm */
159673
+ case 173: /* expr ::= nm DOT nm DOT nm */
159034159674
{
159035159675
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
159036159676
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
159037159677
Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
159038159678
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
@@ -159042,21 +159682,21 @@
159042159682
}
159043159683
yylhsminor.yy202 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
159044159684
}
159045159685
yymsp[-4].minor.yy202 = yylhsminor.yy202;
159046159686
break;
159047
- case 173: /* term ::= NULL|FLOAT|BLOB */
159048
- case 174: /* term ::= STRING */ yytestcase(yyruleno==174);
159687
+ case 174: /* term ::= NULL|FLOAT|BLOB */
159688
+ case 175: /* term ::= STRING */ yytestcase(yyruleno==175);
159049159689
{yymsp[0].minor.yy202=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
159050159690
break;
159051
- case 175: /* term ::= INTEGER */
159691
+ case 176: /* term ::= INTEGER */
159052159692
{
159053159693
yylhsminor.yy202 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
159054159694
}
159055159695
yymsp[0].minor.yy202 = yylhsminor.yy202;
159056159696
break;
159057
- case 176: /* expr ::= VARIABLE */
159697
+ case 177: /* expr ::= VARIABLE */
159058159698
{
159059159699
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
159060159700
u32 n = yymsp[0].minor.yy0.n;
159061159701
yymsp[0].minor.yy202 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
159062159702
sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy202, n);
@@ -159074,54 +159714,54 @@
159074159714
if( yymsp[0].minor.yy202 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy202->iTable);
159075159715
}
159076159716
}
159077159717
}
159078159718
break;
159079
- case 177: /* expr ::= expr COLLATE ID|STRING */
159719
+ case 178: /* expr ::= expr COLLATE ID|STRING */
159080159720
{
159081159721
yymsp[-2].minor.yy202 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy202, &yymsp[0].minor.yy0, 1);
159082159722
}
159083159723
break;
159084
- case 178: /* expr ::= CAST LP expr AS typetoken RP */
159724
+ case 179: /* expr ::= CAST LP expr AS typetoken RP */
159085159725
{
159086159726
yymsp[-5].minor.yy202 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
159087159727
sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy202, yymsp[-3].minor.yy202, 0);
159088159728
}
159089159729
break;
159090
- case 179: /* expr ::= ID|INDEXED LP distinct exprlist RP */
159730
+ case 180: /* expr ::= ID|INDEXED LP distinct exprlist RP */
159091159731
{
159092159732
yylhsminor.yy202 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy242, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy192);
159093159733
}
159094159734
yymsp[-4].minor.yy202 = yylhsminor.yy202;
159095159735
break;
159096
- case 180: /* expr ::= ID|INDEXED LP STAR RP */
159736
+ case 181: /* expr ::= ID|INDEXED LP STAR RP */
159097159737
{
159098159738
yylhsminor.yy202 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
159099159739
}
159100159740
yymsp[-3].minor.yy202 = yylhsminor.yy202;
159101159741
break;
159102
- case 181: /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
159742
+ case 182: /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
159103159743
{
159104159744
yylhsminor.yy202 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy242, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy192);
159105159745
sqlite3WindowAttach(pParse, yylhsminor.yy202, yymsp[0].minor.yy303);
159106159746
}
159107159747
yymsp[-5].minor.yy202 = yylhsminor.yy202;
159108159748
break;
159109
- case 182: /* expr ::= ID|INDEXED LP STAR RP filter_over */
159749
+ case 183: /* expr ::= ID|INDEXED LP STAR RP filter_over */
159110159750
{
159111159751
yylhsminor.yy202 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
159112159752
sqlite3WindowAttach(pParse, yylhsminor.yy202, yymsp[0].minor.yy303);
159113159753
}
159114159754
yymsp[-4].minor.yy202 = yylhsminor.yy202;
159115159755
break;
159116
- case 183: /* term ::= CTIME_KW */
159756
+ case 184: /* term ::= CTIME_KW */
159117159757
{
159118159758
yylhsminor.yy202 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
159119159759
}
159120159760
yymsp[0].minor.yy202 = yylhsminor.yy202;
159121159761
break;
159122
- case 184: /* expr ::= LP nexprlist COMMA expr RP */
159762
+ case 185: /* expr ::= LP nexprlist COMMA expr RP */
159123159763
{
159124159764
ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy242, yymsp[-1].minor.yy202);
159125159765
yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
159126159766
if( yymsp[-4].minor.yy202 ){
159127159767
yymsp[-4].minor.yy202->x.pList = pList;
@@ -159131,26 +159771,26 @@
159131159771
}else{
159132159772
sqlite3ExprListDelete(pParse->db, pList);
159133159773
}
159134159774
}
159135159775
break;
159136
- case 185: /* expr ::= expr AND expr */
159776
+ case 186: /* expr ::= expr AND expr */
159137159777
{yymsp[-2].minor.yy202=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy202,yymsp[0].minor.yy202);}
159138159778
break;
159139
- case 186: /* expr ::= expr OR expr */
159140
- case 187: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==187);
159141
- case 188: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==188);
159142
- case 189: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==189);
159143
- case 190: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==190);
159144
- case 191: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==191);
159145
- case 192: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==192);
159779
+ case 187: /* expr ::= expr OR expr */
159780
+ case 188: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==188);
159781
+ case 189: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==189);
159782
+ case 190: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==190);
159783
+ case 191: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==191);
159784
+ case 192: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==192);
159785
+ case 193: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==193);
159146159786
{yymsp[-2].minor.yy202=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy202,yymsp[0].minor.yy202);}
159147159787
break;
159148
- case 193: /* likeop ::= NOT LIKE_KW|MATCH */
159788
+ case 194: /* likeop ::= NOT LIKE_KW|MATCH */
159149159789
{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
159150159790
break;
159151
- case 194: /* expr ::= expr likeop expr */
159791
+ case 195: /* expr ::= expr likeop expr */
159152159792
{
159153159793
ExprList *pList;
159154159794
int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
159155159795
yymsp[-1].minor.yy0.n &= 0x7fffffff;
159156159796
pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy202);
@@ -159158,11 +159798,11 @@
159158159798
yymsp[-2].minor.yy202 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
159159159799
if( bNot ) yymsp[-2].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy202, 0);
159160159800
if( yymsp[-2].minor.yy202 ) yymsp[-2].minor.yy202->flags |= EP_InfixFunc;
159161159801
}
159162159802
break;
159163
- case 195: /* expr ::= expr likeop expr ESCAPE expr */
159803
+ case 196: /* expr ::= expr likeop expr ESCAPE expr */
159164159804
{
159165159805
ExprList *pList;
159166159806
int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
159167159807
yymsp[-3].minor.yy0.n &= 0x7fffffff;
159168159808
pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy202);
@@ -159171,43 +159811,43 @@
159171159811
yymsp[-4].minor.yy202 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
159172159812
if( bNot ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159173159813
if( yymsp[-4].minor.yy202 ) yymsp[-4].minor.yy202->flags |= EP_InfixFunc;
159174159814
}
159175159815
break;
159176
- case 196: /* expr ::= expr ISNULL|NOTNULL */
159816
+ case 197: /* expr ::= expr ISNULL|NOTNULL */
159177159817
{yymsp[-1].minor.yy202 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy202,0);}
159178159818
break;
159179
- case 197: /* expr ::= expr NOT NULL */
159819
+ case 198: /* expr ::= expr NOT NULL */
159180159820
{yymsp[-2].minor.yy202 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy202,0);}
159181159821
break;
159182
- case 198: /* expr ::= expr IS expr */
159822
+ case 199: /* expr ::= expr IS expr */
159183159823
{
159184159824
yymsp[-2].minor.yy202 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy202,yymsp[0].minor.yy202);
159185159825
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy202, yymsp[-2].minor.yy202, TK_ISNULL);
159186159826
}
159187159827
break;
159188
- case 199: /* expr ::= expr IS NOT expr */
159828
+ case 200: /* expr ::= expr IS NOT expr */
159189159829
{
159190159830
yymsp[-3].minor.yy202 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy202,yymsp[0].minor.yy202);
159191159831
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy202, yymsp[-3].minor.yy202, TK_NOTNULL);
159192159832
}
159193159833
break;
159194
- case 200: /* expr ::= NOT expr */
159195
- case 201: /* expr ::= BITNOT expr */ yytestcase(yyruleno==201);
159834
+ case 201: /* expr ::= NOT expr */
159835
+ case 202: /* expr ::= BITNOT expr */ yytestcase(yyruleno==202);
159196159836
{yymsp[-1].minor.yy202 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy202, 0);/*A-overwrites-B*/}
159197159837
break;
159198
- case 202: /* expr ::= PLUS|MINUS expr */
159838
+ case 203: /* expr ::= PLUS|MINUS expr */
159199159839
{
159200159840
yymsp[-1].minor.yy202 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy202, 0);
159201159841
/*A-overwrites-B*/
159202159842
}
159203159843
break;
159204
- case 203: /* between_op ::= BETWEEN */
159205
- case 206: /* in_op ::= IN */ yytestcase(yyruleno==206);
159844
+ case 204: /* between_op ::= BETWEEN */
159845
+ case 207: /* in_op ::= IN */ yytestcase(yyruleno==207);
159206159846
{yymsp[0].minor.yy192 = 0;}
159207159847
break;
159208
- case 205: /* expr ::= expr between_op expr AND expr */
159848
+ case 206: /* expr ::= expr between_op expr AND expr */
159209159849
{
159210159850
ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy202);
159211159851
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy202);
159212159852
yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy202, 0);
159213159853
if( yymsp[-4].minor.yy202 ){
@@ -159216,11 +159856,11 @@
159216159856
sqlite3ExprListDelete(pParse->db, pList);
159217159857
}
159218159858
if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159219159859
}
159220159860
break;
159221
- case 208: /* expr ::= expr in_op LP exprlist RP */
159861
+ case 209: /* expr ::= expr in_op LP exprlist RP */
159222159862
{
159223159863
if( yymsp[-1].minor.yy242==0 ){
159224159864
/* Expressions of the form
159225159865
**
159226159866
** expr1 IN ()
@@ -159248,41 +159888,41 @@
159248159888
}
159249159889
if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159250159890
}
159251159891
}
159252159892
break;
159253
- case 209: /* expr ::= LP select RP */
159893
+ case 210: /* expr ::= LP select RP */
159254159894
{
159255159895
yymsp[-2].minor.yy202 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
159256159896
sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy202, yymsp[-1].minor.yy539);
159257159897
}
159258159898
break;
159259
- case 210: /* expr ::= expr in_op LP select RP */
159899
+ case 211: /* expr ::= expr in_op LP select RP */
159260159900
{
159261159901
yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy202, 0);
159262159902
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy202, yymsp[-1].minor.yy539);
159263159903
if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159264159904
}
159265159905
break;
159266
- case 211: /* expr ::= expr in_op nm dbnm paren_exprlist */
159906
+ case 212: /* expr ::= expr in_op nm dbnm paren_exprlist */
159267159907
{
159268159908
SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
159269159909
Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
159270159910
if( yymsp[0].minor.yy242 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy242);
159271159911
yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy202, 0);
159272159912
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy202, pSelect);
159273159913
if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159274159914
}
159275159915
break;
159276
- case 212: /* expr ::= EXISTS LP select RP */
159916
+ case 213: /* expr ::= EXISTS LP select RP */
159277159917
{
159278159918
Expr *p;
159279159919
p = yymsp[-3].minor.yy202 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
159280159920
sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy539);
159281159921
}
159282159922
break;
159283
- case 213: /* expr ::= CASE case_operand case_exprlist case_else END */
159923
+ case 214: /* expr ::= CASE case_operand case_exprlist case_else END */
159284159924
{
159285159925
yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy202, 0);
159286159926
if( yymsp[-4].minor.yy202 ){
159287159927
yymsp[-4].minor.yy202->x.pList = yymsp[-1].minor.yy202 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy242,yymsp[-1].minor.yy202) : yymsp[-2].minor.yy242;
159288159928
sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy202);
@@ -159290,394 +159930,394 @@
159290159930
sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy242);
159291159931
sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy202);
159292159932
}
159293159933
}
159294159934
break;
159295
- case 214: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
159935
+ case 215: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
159296159936
{
159297159937
yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242, yymsp[-2].minor.yy202);
159298159938
yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242, yymsp[0].minor.yy202);
159299159939
}
159300159940
break;
159301
- case 215: /* case_exprlist ::= WHEN expr THEN expr */
159941
+ case 216: /* case_exprlist ::= WHEN expr THEN expr */
159302159942
{
159303159943
yymsp[-3].minor.yy242 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy202);
159304159944
yymsp[-3].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy242, yymsp[0].minor.yy202);
159305159945
}
159306159946
break;
159307
- case 218: /* case_operand ::= expr */
159947
+ case 219: /* case_operand ::= expr */
159308159948
{yymsp[0].minor.yy202 = yymsp[0].minor.yy202; /*A-overwrites-X*/}
159309159949
break;
159310
- case 221: /* nexprlist ::= nexprlist COMMA expr */
159950
+ case 222: /* nexprlist ::= nexprlist COMMA expr */
159311159951
{yymsp[-2].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy242,yymsp[0].minor.yy202);}
159312159952
break;
159313
- case 222: /* nexprlist ::= expr */
159953
+ case 223: /* nexprlist ::= expr */
159314159954
{yymsp[0].minor.yy242 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy202); /*A-overwrites-Y*/}
159315159955
break;
159316
- case 224: /* paren_exprlist ::= LP exprlist RP */
159317
- case 229: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==229);
159956
+ case 225: /* paren_exprlist ::= LP exprlist RP */
159957
+ case 230: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==230);
159318159958
{yymsp[-2].minor.yy242 = yymsp[-1].minor.yy242;}
159319159959
break;
159320
- case 225: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
159960
+ case 226: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
159321159961
{
159322159962
sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
159323159963
sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy242, yymsp[-10].minor.yy192,
159324159964
&yymsp[-11].minor.yy0, yymsp[0].minor.yy202, SQLITE_SO_ASC, yymsp[-8].minor.yy192, SQLITE_IDXTYPE_APPDEF);
159325159965
if( IN_RENAME_OBJECT && pParse->pNewIndex ){
159326159966
sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
159327159967
}
159328159968
}
159329159969
break;
159330
- case 226: /* uniqueflag ::= UNIQUE */
159331
- case 268: /* raisetype ::= ABORT */ yytestcase(yyruleno==268);
159970
+ case 227: /* uniqueflag ::= UNIQUE */
159971
+ case 269: /* raisetype ::= ABORT */ yytestcase(yyruleno==269);
159332159972
{yymsp[0].minor.yy192 = OE_Abort;}
159333159973
break;
159334
- case 227: /* uniqueflag ::= */
159974
+ case 228: /* uniqueflag ::= */
159335159975
{yymsp[1].minor.yy192 = OE_None;}
159336159976
break;
159337
- case 230: /* eidlist ::= eidlist COMMA nm collate sortorder */
159977
+ case 231: /* eidlist ::= eidlist COMMA nm collate sortorder */
159338159978
{
159339159979
yymsp[-4].minor.yy242 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy242, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy192, yymsp[0].minor.yy192);
159340159980
}
159341159981
break;
159342
- case 231: /* eidlist ::= nm collate sortorder */
159982
+ case 232: /* eidlist ::= nm collate sortorder */
159343159983
{
159344159984
yymsp[-2].minor.yy242 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy192, yymsp[0].minor.yy192); /*A-overwrites-Y*/
159345159985
}
159346159986
break;
159347
- case 234: /* cmd ::= DROP INDEX ifexists fullname */
159987
+ case 235: /* cmd ::= DROP INDEX ifexists fullname */
159348159988
{sqlite3DropIndex(pParse, yymsp[0].minor.yy47, yymsp[-1].minor.yy192);}
159349159989
break;
159350
- case 235: /* cmd ::= VACUUM vinto */
159990
+ case 236: /* cmd ::= VACUUM vinto */
159351159991
{sqlite3Vacuum(pParse,0,yymsp[0].minor.yy202);}
159352159992
break;
159353
- case 236: /* cmd ::= VACUUM nm vinto */
159993
+ case 237: /* cmd ::= VACUUM nm vinto */
159354159994
{sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy202);}
159355159995
break;
159356
- case 239: /* cmd ::= PRAGMA nm dbnm */
159996
+ case 240: /* cmd ::= PRAGMA nm dbnm */
159357159997
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
159358159998
break;
159359
- case 240: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
159999
+ case 241: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
159360160000
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
159361160001
break;
159362
- case 241: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
160002
+ case 242: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
159363160003
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
159364160004
break;
159365
- case 242: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
160005
+ case 243: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
159366160006
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
159367160007
break;
159368
- case 243: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
160008
+ case 244: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
159369160009
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
159370160010
break;
159371
- case 246: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
160011
+ case 247: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
159372160012
{
159373160013
Token all;
159374160014
all.z = yymsp[-3].minor.yy0.z;
159375160015
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
159376160016
sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy447, &all);
159377160017
}
159378160018
break;
159379
- case 247: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
160019
+ case 248: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
159380160020
{
159381160021
sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy192, yymsp[-4].minor.yy230.a, yymsp[-4].minor.yy230.b, yymsp[-2].minor.yy47, yymsp[0].minor.yy202, yymsp[-10].minor.yy192, yymsp[-8].minor.yy192);
159382160022
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
159383160023
}
159384160024
break;
159385
- case 248: /* trigger_time ::= BEFORE|AFTER */
160025
+ case 249: /* trigger_time ::= BEFORE|AFTER */
159386160026
{ yymsp[0].minor.yy192 = yymsp[0].major; /*A-overwrites-X*/ }
159387160027
break;
159388
- case 249: /* trigger_time ::= INSTEAD OF */
160028
+ case 250: /* trigger_time ::= INSTEAD OF */
159389160029
{ yymsp[-1].minor.yy192 = TK_INSTEAD;}
159390160030
break;
159391
- case 250: /* trigger_time ::= */
160031
+ case 251: /* trigger_time ::= */
159392160032
{ yymsp[1].minor.yy192 = TK_BEFORE; }
159393160033
break;
159394
- case 251: /* trigger_event ::= DELETE|INSERT */
159395
- case 252: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==252);
160034
+ case 252: /* trigger_event ::= DELETE|INSERT */
160035
+ case 253: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==253);
159396160036
{yymsp[0].minor.yy230.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy230.b = 0;}
159397160037
break;
159398
- case 253: /* trigger_event ::= UPDATE OF idlist */
160038
+ case 254: /* trigger_event ::= UPDATE OF idlist */
159399160039
{yymsp[-2].minor.yy230.a = TK_UPDATE; yymsp[-2].minor.yy230.b = yymsp[0].minor.yy600;}
159400160040
break;
159401
- case 254: /* when_clause ::= */
159402
- case 273: /* key_opt ::= */ yytestcase(yyruleno==273);
160041
+ case 255: /* when_clause ::= */
160042
+ case 274: /* key_opt ::= */ yytestcase(yyruleno==274);
159403160043
{ yymsp[1].minor.yy202 = 0; }
159404160044
break;
159405
- case 255: /* when_clause ::= WHEN expr */
159406
- case 274: /* key_opt ::= KEY expr */ yytestcase(yyruleno==274);
160045
+ case 256: /* when_clause ::= WHEN expr */
160046
+ case 275: /* key_opt ::= KEY expr */ yytestcase(yyruleno==275);
159407160047
{ yymsp[-1].minor.yy202 = yymsp[0].minor.yy202; }
159408160048
break;
159409
- case 256: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
160049
+ case 257: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
159410160050
{
159411160051
assert( yymsp[-2].minor.yy447!=0 );
159412160052
yymsp[-2].minor.yy447->pLast->pNext = yymsp[-1].minor.yy447;
159413160053
yymsp[-2].minor.yy447->pLast = yymsp[-1].minor.yy447;
159414160054
}
159415160055
break;
159416
- case 257: /* trigger_cmd_list ::= trigger_cmd SEMI */
160056
+ case 258: /* trigger_cmd_list ::= trigger_cmd SEMI */
159417160057
{
159418160058
assert( yymsp[-1].minor.yy447!=0 );
159419160059
yymsp[-1].minor.yy447->pLast = yymsp[-1].minor.yy447;
159420160060
}
159421160061
break;
159422
- case 258: /* trnm ::= nm DOT nm */
160062
+ case 259: /* trnm ::= nm DOT nm */
159423160063
{
159424160064
yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
159425160065
sqlite3ErrorMsg(pParse,
159426160066
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
159427160067
"statements within triggers");
159428160068
}
159429160069
break;
159430
- case 259: /* tridxby ::= INDEXED BY nm */
160070
+ case 260: /* tridxby ::= INDEXED BY nm */
159431160071
{
159432160072
sqlite3ErrorMsg(pParse,
159433160073
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
159434160074
"within triggers");
159435160075
}
159436160076
break;
159437
- case 260: /* tridxby ::= NOT INDEXED */
160077
+ case 261: /* tridxby ::= NOT INDEXED */
159438160078
{
159439160079
sqlite3ErrorMsg(pParse,
159440160080
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
159441160081
"within triggers");
159442160082
}
159443160083
break;
159444
- case 261: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
160084
+ case 262: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
159445160085
{yylhsminor.yy447 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy47, yymsp[-3].minor.yy242, yymsp[-1].minor.yy202, yymsp[-7].minor.yy192, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy436);}
159446160086
yymsp[-8].minor.yy447 = yylhsminor.yy447;
159447160087
break;
159448
- case 262: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
160088
+ case 263: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
159449160089
{
159450160090
yylhsminor.yy447 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy600,yymsp[-2].minor.yy539,yymsp[-6].minor.yy192,yymsp[-1].minor.yy318,yymsp[-7].minor.yy436,yymsp[0].minor.yy436);/*yylhsminor.yy447-overwrites-yymsp[-6].minor.yy192*/
159451160091
}
159452160092
yymsp[-7].minor.yy447 = yylhsminor.yy447;
159453160093
break;
159454
- case 263: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
160094
+ case 264: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
159455160095
{yylhsminor.yy447 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy202, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy436);}
159456160096
yymsp[-5].minor.yy447 = yylhsminor.yy447;
159457160097
break;
159458
- case 264: /* trigger_cmd ::= scanpt select scanpt */
160098
+ case 265: /* trigger_cmd ::= scanpt select scanpt */
159459160099
{yylhsminor.yy447 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy539, yymsp[-2].minor.yy436, yymsp[0].minor.yy436); /*yylhsminor.yy447-overwrites-yymsp[-1].minor.yy539*/}
159460160100
yymsp[-2].minor.yy447 = yylhsminor.yy447;
159461160101
break;
159462
- case 265: /* expr ::= RAISE LP IGNORE RP */
160102
+ case 266: /* expr ::= RAISE LP IGNORE RP */
159463160103
{
159464160104
yymsp[-3].minor.yy202 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
159465160105
if( yymsp[-3].minor.yy202 ){
159466160106
yymsp[-3].minor.yy202->affExpr = OE_Ignore;
159467160107
}
159468160108
}
159469160109
break;
159470
- case 266: /* expr ::= RAISE LP raisetype COMMA nm RP */
160110
+ case 267: /* expr ::= RAISE LP raisetype COMMA nm RP */
159471160111
{
159472160112
yymsp[-5].minor.yy202 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
159473160113
if( yymsp[-5].minor.yy202 ) {
159474160114
yymsp[-5].minor.yy202->affExpr = (char)yymsp[-3].minor.yy192;
159475160115
}
159476160116
}
159477160117
break;
159478
- case 267: /* raisetype ::= ROLLBACK */
160118
+ case 268: /* raisetype ::= ROLLBACK */
159479160119
{yymsp[0].minor.yy192 = OE_Rollback;}
159480160120
break;
159481
- case 269: /* raisetype ::= FAIL */
160121
+ case 270: /* raisetype ::= FAIL */
159482160122
{yymsp[0].minor.yy192 = OE_Fail;}
159483160123
break;
159484
- case 270: /* cmd ::= DROP TRIGGER ifexists fullname */
160124
+ case 271: /* cmd ::= DROP TRIGGER ifexists fullname */
159485160125
{
159486160126
sqlite3DropTrigger(pParse,yymsp[0].minor.yy47,yymsp[-1].minor.yy192);
159487160127
}
159488160128
break;
159489
- case 271: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
160129
+ case 272: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
159490160130
{
159491160131
sqlite3Attach(pParse, yymsp[-3].minor.yy202, yymsp[-1].minor.yy202, yymsp[0].minor.yy202);
159492160132
}
159493160133
break;
159494
- case 272: /* cmd ::= DETACH database_kw_opt expr */
160134
+ case 273: /* cmd ::= DETACH database_kw_opt expr */
159495160135
{
159496160136
sqlite3Detach(pParse, yymsp[0].minor.yy202);
159497160137
}
159498160138
break;
159499
- case 275: /* cmd ::= REINDEX */
160139
+ case 276: /* cmd ::= REINDEX */
159500160140
{sqlite3Reindex(pParse, 0, 0);}
159501160141
break;
159502
- case 276: /* cmd ::= REINDEX nm dbnm */
160142
+ case 277: /* cmd ::= REINDEX nm dbnm */
159503160143
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
159504160144
break;
159505
- case 277: /* cmd ::= ANALYZE */
160145
+ case 278: /* cmd ::= ANALYZE */
159506160146
{sqlite3Analyze(pParse, 0, 0);}
159507160147
break;
159508
- case 278: /* cmd ::= ANALYZE nm dbnm */
160148
+ case 279: /* cmd ::= ANALYZE nm dbnm */
159509160149
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
159510160150
break;
159511
- case 279: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
160151
+ case 280: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
159512160152
{
159513160153
sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy47,&yymsp[0].minor.yy0);
159514160154
}
159515160155
break;
159516
- case 280: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
160156
+ case 281: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
159517160157
{
159518160158
yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
159519160159
sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
159520160160
}
159521160161
break;
159522
- case 281: /* add_column_fullname ::= fullname */
160162
+ case 282: /* add_column_fullname ::= fullname */
159523160163
{
159524160164
disableLookaside(pParse);
159525160165
sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy47);
159526160166
}
159527160167
break;
159528
- case 282: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
160168
+ case 283: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
159529160169
{
159530160170
sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy47, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
159531160171
}
159532160172
break;
159533
- case 283: /* cmd ::= create_vtab */
160173
+ case 284: /* cmd ::= create_vtab */
159534160174
{sqlite3VtabFinishParse(pParse,0);}
159535160175
break;
159536
- case 284: /* cmd ::= create_vtab LP vtabarglist RP */
160176
+ case 285: /* cmd ::= create_vtab LP vtabarglist RP */
159537160177
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
159538160178
break;
159539
- case 285: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
160179
+ case 286: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
159540160180
{
159541160181
sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy192);
159542160182
}
159543160183
break;
159544
- case 286: /* vtabarg ::= */
160184
+ case 287: /* vtabarg ::= */
159545160185
{sqlite3VtabArgInit(pParse);}
159546160186
break;
159547
- case 287: /* vtabargtoken ::= ANY */
159548
- case 288: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==288);
159549
- case 289: /* lp ::= LP */ yytestcase(yyruleno==289);
160187
+ case 288: /* vtabargtoken ::= ANY */
160188
+ case 289: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==289);
160189
+ case 290: /* lp ::= LP */ yytestcase(yyruleno==290);
159550160190
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
159551160191
break;
159552
- case 290: /* with ::= WITH wqlist */
159553
- case 291: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==291);
160192
+ case 291: /* with ::= WITH wqlist */
160193
+ case 292: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==292);
159554160194
{ sqlite3WithPush(pParse, yymsp[0].minor.yy131, 1); }
159555160195
break;
159556
- case 292: /* wqlist ::= nm eidlist_opt AS LP select RP */
160196
+ case 293: /* wqlist ::= nm eidlist_opt AS LP select RP */
159557160197
{
159558160198
yymsp[-5].minor.yy131 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy242, yymsp[-1].minor.yy539); /*A-overwrites-X*/
159559160199
}
159560160200
break;
159561
- case 293: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
160201
+ case 294: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
159562160202
{
159563160203
yymsp[-7].minor.yy131 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy131, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy242, yymsp[-1].minor.yy539);
159564160204
}
159565160205
break;
159566
- case 294: /* windowdefn_list ::= windowdefn */
160206
+ case 295: /* windowdefn_list ::= windowdefn */
159567160207
{ yylhsminor.yy303 = yymsp[0].minor.yy303; }
159568160208
yymsp[0].minor.yy303 = yylhsminor.yy303;
159569160209
break;
159570
- case 295: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
160210
+ case 296: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
159571160211
{
159572160212
assert( yymsp[0].minor.yy303!=0 );
159573160213
sqlite3WindowChain(pParse, yymsp[0].minor.yy303, yymsp[-2].minor.yy303);
159574160214
yymsp[0].minor.yy303->pNextWin = yymsp[-2].minor.yy303;
159575160215
yylhsminor.yy303 = yymsp[0].minor.yy303;
159576160216
}
159577160217
yymsp[-2].minor.yy303 = yylhsminor.yy303;
159578160218
break;
159579
- case 296: /* windowdefn ::= nm AS LP window RP */
160219
+ case 297: /* windowdefn ::= nm AS LP window RP */
159580160220
{
159581160221
if( ALWAYS(yymsp[-1].minor.yy303) ){
159582160222
yymsp[-1].minor.yy303->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
159583160223
}
159584160224
yylhsminor.yy303 = yymsp[-1].minor.yy303;
159585160225
}
159586160226
yymsp[-4].minor.yy303 = yylhsminor.yy303;
159587160227
break;
159588
- case 297: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
160228
+ case 298: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
159589160229
{
159590160230
yymsp[-4].minor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, yymsp[-2].minor.yy242, yymsp[-1].minor.yy242, 0);
159591160231
}
159592160232
break;
159593
- case 298: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
160233
+ case 299: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
159594160234
{
159595160235
yylhsminor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, yymsp[-2].minor.yy242, yymsp[-1].minor.yy242, &yymsp[-5].minor.yy0);
159596160236
}
159597160237
yymsp[-5].minor.yy303 = yylhsminor.yy303;
159598160238
break;
159599
- case 299: /* window ::= ORDER BY sortlist frame_opt */
160239
+ case 300: /* window ::= ORDER BY sortlist frame_opt */
159600160240
{
159601160241
yymsp[-3].minor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, 0, yymsp[-1].minor.yy242, 0);
159602160242
}
159603160243
break;
159604
- case 300: /* window ::= nm ORDER BY sortlist frame_opt */
160244
+ case 301: /* window ::= nm ORDER BY sortlist frame_opt */
159605160245
{
159606160246
yylhsminor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, 0, yymsp[-1].minor.yy242, &yymsp[-4].minor.yy0);
159607160247
}
159608160248
yymsp[-4].minor.yy303 = yylhsminor.yy303;
159609160249
break;
159610
- case 301: /* window ::= frame_opt */
159611
- case 320: /* filter_over ::= over_clause */ yytestcase(yyruleno==320);
160250
+ case 302: /* window ::= frame_opt */
160251
+ case 321: /* filter_over ::= over_clause */ yytestcase(yyruleno==321);
159612160252
{
159613160253
yylhsminor.yy303 = yymsp[0].minor.yy303;
159614160254
}
159615160255
yymsp[0].minor.yy303 = yylhsminor.yy303;
159616160256
break;
159617
- case 302: /* window ::= nm frame_opt */
160257
+ case 303: /* window ::= nm frame_opt */
159618160258
{
159619160259
yylhsminor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, 0, 0, &yymsp[-1].minor.yy0);
159620160260
}
159621160261
yymsp[-1].minor.yy303 = yylhsminor.yy303;
159622160262
break;
159623
- case 303: /* frame_opt ::= */
160263
+ case 304: /* frame_opt ::= */
159624160264
{
159625160265
yymsp[1].minor.yy303 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
159626160266
}
159627160267
break;
159628
- case 304: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
160268
+ case 305: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
159629160269
{
159630160270
yylhsminor.yy303 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy192, yymsp[-1].minor.yy77.eType, yymsp[-1].minor.yy77.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy58);
159631160271
}
159632160272
yymsp[-2].minor.yy303 = yylhsminor.yy303;
159633160273
break;
159634
- case 305: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
160274
+ case 306: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
159635160275
{
159636160276
yylhsminor.yy303 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy192, yymsp[-3].minor.yy77.eType, yymsp[-3].minor.yy77.pExpr, yymsp[-1].minor.yy77.eType, yymsp[-1].minor.yy77.pExpr, yymsp[0].minor.yy58);
159637160277
}
159638160278
yymsp[-5].minor.yy303 = yylhsminor.yy303;
159639160279
break;
159640
- case 307: /* frame_bound_s ::= frame_bound */
159641
- case 309: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==309);
160280
+ case 308: /* frame_bound_s ::= frame_bound */
160281
+ case 310: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==310);
159642160282
{yylhsminor.yy77 = yymsp[0].minor.yy77;}
159643160283
yymsp[0].minor.yy77 = yylhsminor.yy77;
159644160284
break;
159645
- case 308: /* frame_bound_s ::= UNBOUNDED PRECEDING */
159646
- case 310: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==310);
159647
- case 312: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==312);
160285
+ case 309: /* frame_bound_s ::= UNBOUNDED PRECEDING */
160286
+ case 311: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==311);
160287
+ case 313: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==313);
159648160288
{yylhsminor.yy77.eType = yymsp[-1].major; yylhsminor.yy77.pExpr = 0;}
159649160289
yymsp[-1].minor.yy77 = yylhsminor.yy77;
159650160290
break;
159651
- case 311: /* frame_bound ::= expr PRECEDING|FOLLOWING */
160291
+ case 312: /* frame_bound ::= expr PRECEDING|FOLLOWING */
159652160292
{yylhsminor.yy77.eType = yymsp[0].major; yylhsminor.yy77.pExpr = yymsp[-1].minor.yy202;}
159653160293
yymsp[-1].minor.yy77 = yylhsminor.yy77;
159654160294
break;
159655
- case 313: /* frame_exclude_opt ::= */
160295
+ case 314: /* frame_exclude_opt ::= */
159656160296
{yymsp[1].minor.yy58 = 0;}
159657160297
break;
159658
- case 314: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
160298
+ case 315: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
159659160299
{yymsp[-1].minor.yy58 = yymsp[0].minor.yy58;}
159660160300
break;
159661
- case 315: /* frame_exclude ::= NO OTHERS */
159662
- case 316: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==316);
160301
+ case 316: /* frame_exclude ::= NO OTHERS */
160302
+ case 317: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==317);
159663160303
{yymsp[-1].minor.yy58 = yymsp[-1].major; /*A-overwrites-X*/}
159664160304
break;
159665
- case 317: /* frame_exclude ::= GROUP|TIES */
160305
+ case 318: /* frame_exclude ::= GROUP|TIES */
159666160306
{yymsp[0].minor.yy58 = yymsp[0].major; /*A-overwrites-X*/}
159667160307
break;
159668
- case 318: /* window_clause ::= WINDOW windowdefn_list */
160308
+ case 319: /* window_clause ::= WINDOW windowdefn_list */
159669160309
{ yymsp[-1].minor.yy303 = yymsp[0].minor.yy303; }
159670160310
break;
159671
- case 319: /* filter_over ::= filter_clause over_clause */
160311
+ case 320: /* filter_over ::= filter_clause over_clause */
159672160312
{
159673160313
yymsp[0].minor.yy303->pFilter = yymsp[-1].minor.yy202;
159674160314
yylhsminor.yy303 = yymsp[0].minor.yy303;
159675160315
}
159676160316
yymsp[-1].minor.yy303 = yylhsminor.yy303;
159677160317
break;
159678
- case 321: /* filter_over ::= filter_clause */
160318
+ case 322: /* filter_over ::= filter_clause */
159679160319
{
159680160320
yylhsminor.yy303 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
159681160321
if( yylhsminor.yy303 ){
159682160322
yylhsminor.yy303->eFrmType = TK_FILTER;
159683160323
yylhsminor.yy303->pFilter = yymsp[0].minor.yy202;
@@ -159685,88 +160325,88 @@
159685160325
sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy202);
159686160326
}
159687160327
}
159688160328
yymsp[0].minor.yy303 = yylhsminor.yy303;
159689160329
break;
159690
- case 322: /* over_clause ::= OVER LP window RP */
160330
+ case 323: /* over_clause ::= OVER LP window RP */
159691160331
{
159692160332
yymsp[-3].minor.yy303 = yymsp[-1].minor.yy303;
159693160333
assert( yymsp[-3].minor.yy303!=0 );
159694160334
}
159695160335
break;
159696
- case 323: /* over_clause ::= OVER nm */
160336
+ case 324: /* over_clause ::= OVER nm */
159697160337
{
159698160338
yymsp[-1].minor.yy303 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
159699160339
if( yymsp[-1].minor.yy303 ){
159700160340
yymsp[-1].minor.yy303->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
159701160341
}
159702160342
}
159703160343
break;
159704
- case 324: /* filter_clause ::= FILTER LP WHERE expr RP */
160344
+ case 325: /* filter_clause ::= FILTER LP WHERE expr RP */
159705160345
{ yymsp[-4].minor.yy202 = yymsp[-1].minor.yy202; }
159706160346
break;
159707160347
default:
159708
- /* (325) input ::= cmdlist */ yytestcase(yyruleno==325);
159709
- /* (326) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==326);
159710
- /* (327) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=327);
159711
- /* (328) ecmd ::= SEMI */ yytestcase(yyruleno==328);
159712
- /* (329) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==329);
159713
- /* (330) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=330);
159714
- /* (331) trans_opt ::= */ yytestcase(yyruleno==331);
159715
- /* (332) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==332);
159716
- /* (333) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==333);
159717
- /* (334) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==334);
159718
- /* (335) savepoint_opt ::= */ yytestcase(yyruleno==335);
159719
- /* (336) cmd ::= create_table create_table_args */ yytestcase(yyruleno==336);
159720
- /* (337) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==337);
159721
- /* (338) columnlist ::= columnname carglist */ yytestcase(yyruleno==338);
159722
- /* (339) nm ::= ID|INDEXED */ yytestcase(yyruleno==339);
159723
- /* (340) nm ::= STRING */ yytestcase(yyruleno==340);
159724
- /* (341) nm ::= JOIN_KW */ yytestcase(yyruleno==341);
159725
- /* (342) typetoken ::= typename */ yytestcase(yyruleno==342);
159726
- /* (343) typename ::= ID|STRING */ yytestcase(yyruleno==343);
159727
- /* (344) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=344);
159728
- /* (345) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=345);
159729
- /* (346) carglist ::= carglist ccons */ yytestcase(yyruleno==346);
159730
- /* (347) carglist ::= */ yytestcase(yyruleno==347);
159731
- /* (348) ccons ::= NULL onconf */ yytestcase(yyruleno==348);
159732
- /* (349) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==349);
159733
- /* (350) ccons ::= AS generated */ yytestcase(yyruleno==350);
159734
- /* (351) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==351);
159735
- /* (352) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==352);
159736
- /* (353) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=353);
159737
- /* (354) tconscomma ::= */ yytestcase(yyruleno==354);
159738
- /* (355) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=355);
159739
- /* (356) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=356);
159740
- /* (357) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=357);
159741
- /* (358) oneselect ::= values */ yytestcase(yyruleno==358);
159742
- /* (359) sclp ::= selcollist COMMA */ yytestcase(yyruleno==359);
159743
- /* (360) as ::= ID|STRING */ yytestcase(yyruleno==360);
159744
- /* (361) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=361);
159745
- /* (362) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==362);
159746
- /* (363) exprlist ::= nexprlist */ yytestcase(yyruleno==363);
159747
- /* (364) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=364);
159748
- /* (365) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=365);
159749
- /* (366) nmnum ::= ON */ yytestcase(yyruleno==366);
159750
- /* (367) nmnum ::= DELETE */ yytestcase(yyruleno==367);
159751
- /* (368) nmnum ::= DEFAULT */ yytestcase(yyruleno==368);
159752
- /* (369) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==369);
159753
- /* (370) foreach_clause ::= */ yytestcase(yyruleno==370);
159754
- /* (371) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==371);
159755
- /* (372) trnm ::= nm */ yytestcase(yyruleno==372);
159756
- /* (373) tridxby ::= */ yytestcase(yyruleno==373);
159757
- /* (374) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==374);
159758
- /* (375) database_kw_opt ::= */ yytestcase(yyruleno==375);
159759
- /* (376) kwcolumn_opt ::= */ yytestcase(yyruleno==376);
159760
- /* (377) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==377);
159761
- /* (378) vtabarglist ::= vtabarg */ yytestcase(yyruleno==378);
159762
- /* (379) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==379);
159763
- /* (380) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==380);
159764
- /* (381) anylist ::= */ yytestcase(yyruleno==381);
159765
- /* (382) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==382);
159766
- /* (383) anylist ::= anylist ANY */ yytestcase(yyruleno==383);
159767
- /* (384) with ::= */ yytestcase(yyruleno==384);
160348
+ /* (326) input ::= cmdlist */ yytestcase(yyruleno==326);
160349
+ /* (327) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==327);
160350
+ /* (328) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=328);
160351
+ /* (329) ecmd ::= SEMI */ yytestcase(yyruleno==329);
160352
+ /* (330) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==330);
160353
+ /* (331) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=331);
160354
+ /* (332) trans_opt ::= */ yytestcase(yyruleno==332);
160355
+ /* (333) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==333);
160356
+ /* (334) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==334);
160357
+ /* (335) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==335);
160358
+ /* (336) savepoint_opt ::= */ yytestcase(yyruleno==336);
160359
+ /* (337) cmd ::= create_table create_table_args */ yytestcase(yyruleno==337);
160360
+ /* (338) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==338);
160361
+ /* (339) columnlist ::= columnname carglist */ yytestcase(yyruleno==339);
160362
+ /* (340) nm ::= ID|INDEXED */ yytestcase(yyruleno==340);
160363
+ /* (341) nm ::= STRING */ yytestcase(yyruleno==341);
160364
+ /* (342) nm ::= JOIN_KW */ yytestcase(yyruleno==342);
160365
+ /* (343) typetoken ::= typename */ yytestcase(yyruleno==343);
160366
+ /* (344) typename ::= ID|STRING */ yytestcase(yyruleno==344);
160367
+ /* (345) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=345);
160368
+ /* (346) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=346);
160369
+ /* (347) carglist ::= carglist ccons */ yytestcase(yyruleno==347);
160370
+ /* (348) carglist ::= */ yytestcase(yyruleno==348);
160371
+ /* (349) ccons ::= NULL onconf */ yytestcase(yyruleno==349);
160372
+ /* (350) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==350);
160373
+ /* (351) ccons ::= AS generated */ yytestcase(yyruleno==351);
160374
+ /* (352) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==352);
160375
+ /* (353) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==353);
160376
+ /* (354) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=354);
160377
+ /* (355) tconscomma ::= */ yytestcase(yyruleno==355);
160378
+ /* (356) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=356);
160379
+ /* (357) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=357);
160380
+ /* (358) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=358);
160381
+ /* (359) oneselect ::= values */ yytestcase(yyruleno==359);
160382
+ /* (360) sclp ::= selcollist COMMA */ yytestcase(yyruleno==360);
160383
+ /* (361) as ::= ID|STRING */ yytestcase(yyruleno==361);
160384
+ /* (362) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=362);
160385
+ /* (363) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==363);
160386
+ /* (364) exprlist ::= nexprlist */ yytestcase(yyruleno==364);
160387
+ /* (365) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=365);
160388
+ /* (366) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=366);
160389
+ /* (367) nmnum ::= ON */ yytestcase(yyruleno==367);
160390
+ /* (368) nmnum ::= DELETE */ yytestcase(yyruleno==368);
160391
+ /* (369) nmnum ::= DEFAULT */ yytestcase(yyruleno==369);
160392
+ /* (370) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==370);
160393
+ /* (371) foreach_clause ::= */ yytestcase(yyruleno==371);
160394
+ /* (372) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==372);
160395
+ /* (373) trnm ::= nm */ yytestcase(yyruleno==373);
160396
+ /* (374) tridxby ::= */ yytestcase(yyruleno==374);
160397
+ /* (375) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==375);
160398
+ /* (376) database_kw_opt ::= */ yytestcase(yyruleno==376);
160399
+ /* (377) kwcolumn_opt ::= */ yytestcase(yyruleno==377);
160400
+ /* (378) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==378);
160401
+ /* (379) vtabarglist ::= vtabarg */ yytestcase(yyruleno==379);
160402
+ /* (380) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==380);
160403
+ /* (381) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==381);
160404
+ /* (382) anylist ::= */ yytestcase(yyruleno==382);
160405
+ /* (383) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==383);
160406
+ /* (384) anylist ::= anylist ANY */ yytestcase(yyruleno==384);
160407
+ /* (385) with ::= */ yytestcase(yyruleno==385);
159768160408
break;
159769160409
/********** End reduce actions ************************************************/
159770160410
};
159771160411
assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
159772160412
yygoto = yyRuleInfoLhs[yyruleno];
@@ -160093,12 +160733,12 @@
160093160733
** The lookup table is much faster. To maximize speed, and to ensure that
160094160734
** a lookup table is used, all of the classes need to be small integers and
160095160735
** all of them need to be used within the switch.
160096160736
*/
160097160737
#define CC_X 0 /* The letter 'x', or start of BLOB literal */
160098
-#define CC_KYWD 1 /* Alphabetics or '_'. Usable in a keyword */
160099
-#define CC_ID 2 /* unicode characters usable in IDs */
160738
+#define CC_KYWD0 1 /* First letter of a keyword */
160739
+#define CC_KYWD 2 /* Alphabetics or '_'. Usable in a keyword */
160100160740
#define CC_DIGIT 3 /* Digits */
160101160741
#define CC_DOLLAR 4 /* '$' */
160102160742
#define CC_VARALPHA 5 /* '@', '#', ':'. Alphabetic SQL variables */
160103160743
#define CC_VARNUM 6 /* '?'. Numeric SQL variables */
160104160744
#define CC_SPACE 7 /* Space characters */
@@ -160119,24 +160759,25 @@
160119160759
#define CC_PERCENT 22 /* '%' */
160120160760
#define CC_COMMA 23 /* ',' */
160121160761
#define CC_AND 24 /* '&' */
160122160762
#define CC_TILDA 25 /* '~' */
160123160763
#define CC_DOT 26 /* '.' */
160124
-#define CC_ILLEGAL 27 /* Illegal character */
160125
-#define CC_NUL 28 /* 0x00 */
160764
+#define CC_ID 27 /* unicode characters usable in IDs */
160765
+#define CC_ILLEGAL 28 /* Illegal character */
160766
+#define CC_NUL 29 /* 0x00 */
160126160767
160127160768
static const unsigned char aiClass[] = {
160128160769
#ifdef SQLITE_ASCII
160129160770
/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
160130
-/* 0x */ 28, 27, 27, 27, 27, 27, 27, 27, 27, 7, 7, 27, 7, 7, 27, 27,
160131
-/* 1x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
160771
+/* 0x */ 29, 28, 28, 28, 28, 28, 28, 28, 28, 7, 7, 28, 7, 7, 28, 28,
160772
+/* 1x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
160132160773
/* 2x */ 7, 15, 8, 5, 4, 22, 24, 8, 17, 18, 21, 20, 23, 11, 26, 16,
160133160774
/* 3x */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 19, 12, 14, 13, 6,
160134160775
/* 4x */ 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
160135
-/* 5x */ 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 9, 27, 27, 27, 1,
160776
+/* 5x */ 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 9, 28, 28, 28, 2,
160136160777
/* 6x */ 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
160137
-/* 7x */ 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 27, 10, 27, 25, 27,
160778
+/* 7x */ 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 28, 10, 28, 25, 28,
160138160779
/* 8x */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160139160780
/* 9x */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160140160781
/* Ax */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160141160782
/* Bx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160142160783
/* Cx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -160144,26 +160785,26 @@
160144160785
/* Ex */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160145160786
/* Fx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
160146160787
#endif
160147160788
#ifdef SQLITE_EBCDIC
160148160789
/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
160149
-/* 0x */ 27, 27, 27, 27, 27, 7, 27, 27, 27, 27, 27, 27, 7, 7, 27, 27,
160150
-/* 1x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
160151
-/* 2x */ 27, 27, 27, 27, 27, 7, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
160152
-/* 3x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
160153
-/* 4x */ 7, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 26, 12, 17, 20, 10,
160154
-/* 5x */ 24, 27, 27, 27, 27, 27, 27, 27, 27, 27, 15, 4, 21, 18, 19, 27,
160155
-/* 6x */ 11, 16, 27, 27, 27, 27, 27, 27, 27, 27, 27, 23, 22, 1, 13, 6,
160156
-/* 7x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 8, 5, 5, 5, 8, 14, 8,
160157
-/* 8x */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27,
160158
-/* 9x */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27,
160159
-/* Ax */ 27, 25, 1, 1, 1, 1, 1, 0, 1, 1, 27, 27, 27, 27, 27, 27,
160160
-/* Bx */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 9, 27, 27, 27, 27, 27,
160161
-/* Cx */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27,
160162
-/* Dx */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27,
160163
-/* Ex */ 27, 27, 1, 1, 1, 1, 1, 0, 1, 1, 27, 27, 27, 27, 27, 27,
160164
-/* Fx */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 27, 27, 27, 27, 27, 27,
160790
+/* 0x */ 29, 28, 28, 28, 28, 7, 28, 28, 28, 28, 28, 28, 7, 7, 28, 28,
160791
+/* 1x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
160792
+/* 2x */ 28, 28, 28, 28, 28, 7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
160793
+/* 3x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
160794
+/* 4x */ 7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 26, 12, 17, 20, 10,
160795
+/* 5x */ 24, 28, 28, 28, 28, 28, 28, 28, 28, 28, 15, 4, 21, 18, 19, 28,
160796
+/* 6x */ 11, 16, 28, 28, 28, 28, 28, 28, 28, 28, 28, 23, 22, 2, 13, 6,
160797
+/* 7x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 8, 5, 5, 5, 8, 14, 8,
160798
+/* 8x */ 28, 1, 1, 1, 1, 1, 1, 1, 1, 1, 28, 28, 28, 28, 28, 28,
160799
+/* 9x */ 28, 1, 1, 1, 1, 1, 1, 1, 1, 1, 28, 28, 28, 28, 28, 28,
160800
+/* Ax */ 28, 25, 1, 1, 1, 1, 1, 0, 2, 2, 28, 28, 28, 28, 28, 28,
160801
+/* Bx */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 9, 28, 28, 28, 28, 28,
160802
+/* Cx */ 28, 1, 1, 1, 1, 1, 1, 1, 1, 1, 28, 28, 28, 28, 28, 28,
160803
+/* Dx */ 28, 1, 1, 1, 1, 1, 1, 1, 1, 1, 28, 28, 28, 28, 28, 28,
160804
+/* Ex */ 28, 28, 1, 1, 1, 1, 1, 0, 2, 2, 28, 28, 28, 28, 28, 28,
160805
+/* Fx */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 28, 28, 28, 28, 28, 28,
160165160806
#endif
160166160807
};
160167160808
160168160809
/*
160169160810
** The charMap() macro maps alphabetic characters (only) into their
@@ -160504,11 +161145,11 @@
160504161145
** return the integer n (the length of the token). */
160505161146
static int keywordCode(const char *z, int n, int *pType){
160506161147
int i, j;
160507161148
const char *zKW;
160508161149
if( n>=2 ){
160509
- i = ((charMap(z[0])*4) ^ (charMap(z[n-1])*3) ^ n) % 127;
161150
+ i = ((charMap(z[0])*4) ^ (charMap(z[n-1])*3) ^ n*1) % 127;
160510161151
for(i=((int)aKWHash[i])-1; i>=0; i=((int)aKWNext[i])-1){
160511161152
if( aKWLen[i]!=n ) continue;
160512161153
zKW = &zKWText[aKWOffset[i]];
160513161154
#ifdef SQLITE_ASCII
160514161155
if( (z[0]&~0x20)!=zKW[0] ) continue;
@@ -161046,11 +161687,11 @@
161046161687
}
161047161688
}
161048161689
if( n==0 ) *tokenType = TK_ILLEGAL;
161049161690
return i;
161050161691
}
161051
- case CC_KYWD: {
161692
+ case CC_KYWD0: {
161052161693
for(i=1; aiClass[z[i]]<=CC_KYWD; i++){}
161053161694
if( IdChar(z[i]) ){
161054161695
/* This token started out using characters that can appear in keywords,
161055161696
** but z[i] is a character not allowed within keywords, so this must
161056161697
** be an identifier instead */
@@ -161076,10 +161717,11 @@
161076161717
#endif
161077161718
/* If it is not a BLOB literal, then it must be an ID, since no
161078161719
** SQL keywords start with the letter 'x'. Fall through */
161079161720
/* no break */ deliberate_fall_through
161080161721
}
161722
+ case CC_KYWD:
161081161723
case CC_ID: {
161082161724
i = 1;
161083161725
break;
161084161726
}
161085161727
case CC_NUL: {
@@ -166058,11 +166700,30 @@
166058166700
*pn = sqlite3BtreeSeekCount(db->aDb->pBt);
166059166701
(void)db; /* Silence harmless unused variable warning */
166060166702
break;
166061166703
}
166062166704
166063
-
166705
+ /* sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, op, ptr)
166706
+ **
166707
+ ** "ptr" is a pointer to a u32.
166708
+ **
166709
+ ** op==0 Store the current sqlite3SelectTrace in *ptr
166710
+ ** op==1 Set sqlite3SelectTrace to the value *ptr
166711
+ ** op==3 Store the current sqlite3WhereTrace in *ptr
166712
+ ** op==3 Set sqlite3WhereTrace to the value *ptr
166713
+ */
166714
+ case SQLITE_TESTCTRL_TRACEFLAGS: {
166715
+ int opTrace = va_arg(ap, int);
166716
+ u32 *ptr = va_arg(ap, u32*);
166717
+ switch( opTrace ){
166718
+ case 0: *ptr = sqlite3SelectTrace; break;
166719
+ case 1: sqlite3SelectTrace = *ptr; break;
166720
+ case 2: *ptr = sqlite3WhereTrace; break;
166721
+ case 3: sqlite3WhereTrace = *ptr; break;
166722
+ }
166723
+ break;
166724
+ }
166064166725
}
166065166726
va_end(ap);
166066166727
#endif /* SQLITE_UNTESTABLE */
166067166728
return rc;
166068166729
}
@@ -215282,12 +215943,12 @@
215282215943
){
215283215944
rc = fts5ExprNodeNext(p, pRoot, 1, iFirst);
215284215945
}
215285215946
215286215947
/* If the iterator is not at a real match, skip forward until it is. */
215287
- while( pRoot->bNomatch ){
215288
- assert( pRoot->bEof==0 && rc==SQLITE_OK );
215948
+ while( pRoot->bNomatch && rc==SQLITE_OK ){
215949
+ assert( pRoot->bEof==0 );
215289215950
rc = fts5ExprNodeNext(p, pRoot, 0, 0);
215290215951
}
215291215952
return rc;
215292215953
}
215293215954
@@ -220467,11 +221128,11 @@
220467221128
u8 *pChunk = &pSeg->pLeaf->p[pSeg->iLeafOffset];
220468221129
int nChunk = MIN(nRem, pSeg->pLeaf->szLeaf - pSeg->iLeafOffset);
220469221130
int pgno = pSeg->iLeafPgno;
220470221131
int pgnoSave = 0;
220471221132
220472
- /* This function does notmwork with detail=none databases. */
221133
+ /* This function does not work with detail=none databases. */
220473221134
assert( p->pConfig->eDetail!=FTS5_DETAIL_NONE );
220474221135
220475221136
if( (pSeg->flags & FTS5_SEGITER_REVERSE)==0 ){
220476221137
pgnoSave = pgno+1;
220477221138
}
@@ -220480,10 +221141,13 @@
220480221141
xChunk(p, pCtx, pChunk, nChunk);
220481221142
nRem -= nChunk;
220482221143
fts5DataRelease(pData);
220483221144
if( nRem<=0 ){
220484221145
break;
221146
+ }else if( pSeg->pSeg==0 ){
221147
+ p->rc = FTS5_CORRUPT;
221148
+ return;
220485221149
}else{
220486221150
pgno++;
220487221151
pData = fts5LeafRead(p, FTS5_SEGMENT_ROWID(pSeg->pSeg->iSegid, pgno));
220488221152
if( pData==0 ) break;
220489221153
pChunk = &pData->p[4];
@@ -220531,70 +221195,76 @@
220531221195
}
220532221196
}
220533221197
}
220534221198
220535221199
/*
220536
-** IN/OUT parameter (*pa) points to a position list n bytes in size. If
220537
-** the position list contains entries for column iCol, then (*pa) is set
220538
-** to point to the sub-position-list for that column and the number of
220539
-** bytes in it returned. Or, if the argument position list does not
220540
-** contain any entries for column iCol, return 0.
221200
+** Parameter pPos points to a buffer containing a position list, size nPos.
221201
+** This function filters it according to pColset (which must be non-NULL)
221202
+** and sets pIter->base.pData/nData to point to the new position list.
221203
+** If memory is required for the new position list, use buffer pIter->poslist.
221204
+** Or, if the new position list is a contiguous subset of the input, set
221205
+** pIter->base.pData/nData to point directly to it.
221206
+**
221207
+** This function is a no-op if *pRc is other than SQLITE_OK when it is
221208
+** called. If an OOM error is encountered, *pRc is set to SQLITE_NOMEM
221209
+** before returning.
220541221210
*/
220542
-static int fts5IndexExtractCol(
220543
- const u8 **pa, /* IN/OUT: Pointer to poslist */
220544
- int n, /* IN: Size of poslist in bytes */
220545
- int iCol /* Column to extract from poslist */
220546
-){
220547
- int iCurrent = 0; /* Anything before the first 0x01 is col 0 */
220548
- const u8 *p = *pa;
220549
- const u8 *pEnd = &p[n]; /* One byte past end of position list */
220550
-
220551
- while( iCol>iCurrent ){
220552
- /* Advance pointer p until it points to pEnd or an 0x01 byte that is
220553
- ** not part of a varint. Note that it is not possible for a negative
220554
- ** or extremely large varint to occur within an uncorrupted position
220555
- ** list. So the last byte of each varint may be assumed to have a clear
220556
- ** 0x80 bit. */
220557
- while( *p!=0x01 ){
220558
- while( *p++ & 0x80 );
220559
- if( p>=pEnd ) return 0;
220560
- }
220561
- *pa = p++;
220562
- iCurrent = *p++;
220563
- if( iCurrent & 0x80 ){
220564
- p--;
220565
- p += fts5GetVarint32(p, iCurrent);
220566
- }
220567
- }
220568
- if( iCol!=iCurrent ) return 0;
220569
-
220570
- /* Advance pointer p until it points to pEnd or an 0x01 byte that is
220571
- ** not part of a varint */
220572
- while( p<pEnd && *p!=0x01 ){
220573
- while( *p++ & 0x80 );
220574
- }
220575
-
220576
- return p - (*pa);
220577
-}
220578
-
220579221211
static void fts5IndexExtractColset(
220580221212
int *pRc,
220581221213
Fts5Colset *pColset, /* Colset to filter on */
220582221214
const u8 *pPos, int nPos, /* Position list */
220583
- Fts5Buffer *pBuf /* Output buffer */
221215
+ Fts5Iter *pIter
220584221216
){
220585221217
if( *pRc==SQLITE_OK ){
220586
- int i;
220587
- fts5BufferZero(pBuf);
220588
- for(i=0; i<pColset->nCol; i++){
220589
- const u8 *pSub = pPos;
220590
- int nSub = fts5IndexExtractCol(&pSub, nPos, pColset->aiCol[i]);
220591
- if( nSub ){
220592
- fts5BufferAppendBlob(pRc, pBuf, nSub, pSub);
221218
+ const u8 *p = pPos;
221219
+ const u8 *aCopy = p;
221220
+ const u8 *pEnd = &p[nPos]; /* One byte past end of position list */
221221
+ int i = 0;
221222
+ int iCurrent = 0;
221223
+
221224
+ if( pColset->nCol>1 && sqlite3Fts5BufferSize(pRc, &pIter->poslist, nPos) ){
221225
+ return;
221226
+ }
221227
+
221228
+ while( 1 ){
221229
+ while( pColset->aiCol[i]<iCurrent ){
221230
+ i++;
221231
+ if( i==pColset->nCol ){
221232
+ pIter->base.pData = pIter->poslist.p;
221233
+ pIter->base.nData = pIter->poslist.n;
221234
+ return;
221235
+ }
221236
+ }
221237
+
221238
+ /* Advance pointer p until it points to pEnd or an 0x01 byte that is
221239
+ ** not part of a varint */
221240
+ while( p<pEnd && *p!=0x01 ){
221241
+ while( *p++ & 0x80 );
221242
+ }
221243
+
221244
+ if( pColset->aiCol[i]==iCurrent ){
221245
+ if( pColset->nCol==1 ){
221246
+ pIter->base.pData = aCopy;
221247
+ pIter->base.nData = p-aCopy;
221248
+ return;
221249
+ }
221250
+ fts5BufferSafeAppendBlob(&pIter->poslist, aCopy, p-aCopy);
221251
+ }
221252
+ if( p==pEnd ){
221253
+ pIter->base.pData = pIter->poslist.p;
221254
+ pIter->base.nData = pIter->poslist.n;
221255
+ return;
221256
+ }
221257
+ aCopy = p++;
221258
+ iCurrent = *p++;
221259
+ if( iCurrent & 0x80 ){
221260
+ p--;
221261
+ p += fts5GetVarint32(p, iCurrent);
220593221262
}
220594221263
}
220595221264
}
221265
+
220596221266
}
220597221267
220598221268
/*
220599221269
** xSetOutputs callback used by detail=none tables.
220600221270
*/
@@ -220710,20 +221380,13 @@
220710221380
220711221381
if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){
220712221382
/* All data is stored on the current page. Populate the output
220713221383
** variables to point into the body of the page object. */
220714221384
const u8 *a = &pSeg->pLeaf->p[pSeg->iLeafOffset];
220715
- if( pColset->nCol==1 ){
220716
- pIter->base.nData = fts5IndexExtractCol(&a, pSeg->nPos,pColset->aiCol[0]);
220717
- pIter->base.pData = a;
220718
- }else{
220719
- int *pRc = &pIter->pIndex->rc;
220720
- fts5BufferZero(&pIter->poslist);
220721
- fts5IndexExtractColset(pRc, pColset, a, pSeg->nPos, &pIter->poslist);
220722
- pIter->base.pData = pIter->poslist.p;
220723
- pIter->base.nData = pIter->poslist.n;
220724
- }
221385
+ int *pRc = &pIter->pIndex->rc;
221386
+ fts5BufferZero(&pIter->poslist);
221387
+ fts5IndexExtractColset(pRc, pColset, a, pSeg->nPos, pIter);
220725221388
}else{
220726221389
/* The data is distributed over two or more pages. Copy it into the
220727221390
** Fts5Iter.poslist buffer and then set the output pointer to point
220728221391
** to this buffer. */
220729221392
fts5BufferZero(&pIter->poslist);
@@ -222202,11 +222865,11 @@
222202222865
222203222866
222204222867
static void fts5DoclistIterNext(Fts5DoclistIter *pIter){
222205222868
u8 *p = pIter->aPoslist + pIter->nSize + pIter->nPoslist;
222206222869
222207
- assert( pIter->aPoslist );
222870
+ assert( pIter->aPoslist || (p==0 && pIter->aPoslist==0) );
222208222871
if( p>=pIter->aEof ){
222209222872
pIter->aPoslist = 0;
222210222873
}else{
222211222874
i64 iDelta;
222212222875
@@ -222286,20 +222949,24 @@
222286222949
** In this case the buffers consist of a delta-encoded list of rowids only.
222287222950
*/
222288222951
static void fts5MergeRowidLists(
222289222952
Fts5Index *p, /* FTS5 backend object */
222290222953
Fts5Buffer *p1, /* First list to merge */
222291
- Fts5Buffer *p2 /* Second list to merge */
222954
+ int nBuf, /* Number of entries in apBuf[] */
222955
+ Fts5Buffer *aBuf /* Array of other lists to merge into p1 */
222292222956
){
222293222957
int i1 = 0;
222294222958
int i2 = 0;
222295222959
i64 iRowid1 = 0;
222296222960
i64 iRowid2 = 0;
222297222961
i64 iOut = 0;
222298
-
222962
+ Fts5Buffer *p2 = &aBuf[0];
222299222963
Fts5Buffer out;
222964
+
222965
+ (void)nBuf;
222300222966
memset(&out, 0, sizeof(out));
222967
+ assert( nBuf==1 );
222301222968
sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n);
222302222969
if( p->rc ) return;
222303222970
222304222971
fts5NextRowid(p1, &i1, &iRowid1);
222305222972
fts5NextRowid(p2, &i2, &iRowid2);
@@ -222321,185 +222988,218 @@
222321222988
}
222322222989
222323222990
fts5BufferSwap(&out, p1);
222324222991
fts5BufferFree(&out);
222325222992
}
222993
+
222994
+typedef struct PrefixMerger PrefixMerger;
222995
+struct PrefixMerger {
222996
+ Fts5DoclistIter iter; /* Doclist iterator */
222997
+ i64 iPos; /* For iterating through a position list */
222998
+ int iOff;
222999
+ u8 *aPos;
223000
+ PrefixMerger *pNext; /* Next in docid/poslist order */
223001
+};
223002
+
223003
+static void fts5PrefixMergerInsertByRowid(
223004
+ PrefixMerger **ppHead,
223005
+ PrefixMerger *p
223006
+){
223007
+ if( p->iter.aPoslist ){
223008
+ PrefixMerger **pp = ppHead;
223009
+ while( *pp && p->iter.iRowid>(*pp)->iter.iRowid ){
223010
+ pp = &(*pp)->pNext;
223011
+ }
223012
+ p->pNext = *pp;
223013
+ *pp = p;
223014
+ }
223015
+}
223016
+
223017
+static void fts5PrefixMergerInsertByPosition(
223018
+ PrefixMerger **ppHead,
223019
+ PrefixMerger *p
223020
+){
223021
+ if( p->iPos>=0 ){
223022
+ PrefixMerger **pp = ppHead;
223023
+ while( *pp && p->iPos>(*pp)->iPos ){
223024
+ pp = &(*pp)->pNext;
223025
+ }
223026
+ p->pNext = *pp;
223027
+ *pp = p;
223028
+ }
223029
+}
223030
+
222326223031
222327223032
/*
222328
-** Buffers p1 and p2 contain doclists. This function merges the content
222329
-** of the two doclists together and sets buffer p1 to the result before
222330
-** returning.
222331
-**
222332
-** If an error occurs, an error code is left in p->rc. If an error has
222333
-** already occurred, this function is a no-op.
223033
+** Array aBuf[] contains nBuf doclists. These are all merged in with the
223034
+** doclist in buffer p1.
222334223035
*/
222335223036
static void fts5MergePrefixLists(
222336223037
Fts5Index *p, /* FTS5 backend object */
222337223038
Fts5Buffer *p1, /* First list to merge */
222338
- Fts5Buffer *p2 /* Second list to merge */
222339
-){
222340
- if( p2->n ){
222341
- i64 iLastRowid = 0;
222342
- Fts5DoclistIter i1;
222343
- Fts5DoclistIter i2;
222344
- Fts5Buffer out = {0, 0, 0};
222345
- Fts5Buffer tmp = {0, 0, 0};
222346
-
222347
- /* The maximum size of the output is equal to the sum of the two
222348
- ** input sizes + 1 varint (9 bytes). The extra varint is because if the
222349
- ** first rowid in one input is a large negative number, and the first in
222350
- ** the other a non-negative number, the delta for the non-negative
222351
- ** number will be larger on disk than the literal integer value
222352
- ** was.
222353
- **
222354
- ** Or, if the input position-lists are corrupt, then the output might
222355
- ** include up to 2 extra 10-byte positions created by interpreting -1
222356
- ** (the value PoslistNext64() uses for EOF) as a position and appending
222357
- ** it to the output. This can happen at most once for each input
222358
- ** position-list, hence two 10 byte paddings. */
222359
- if( sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n + 9+10+10) ) return;
222360
- fts5DoclistIterInit(p1, &i1);
222361
- fts5DoclistIterInit(p2, &i2);
222362
-
222363
- while( 1 ){
222364
- if( i1.iRowid<i2.iRowid ){
222365
- /* Copy entry from i1 */
222366
- fts5MergeAppendDocid(&out, iLastRowid, i1.iRowid);
222367
- fts5BufferSafeAppendBlob(&out, i1.aPoslist, i1.nPoslist+i1.nSize);
222368
- fts5DoclistIterNext(&i1);
222369
- if( i1.aPoslist==0 ) break;
222370
- assert( out.n<=((i1.aPoslist-p1->p) + (i2.aPoslist-p2->p)+9+10+10) );
222371
- }
222372
- else if( i2.iRowid!=i1.iRowid ){
222373
- /* Copy entry from i2 */
222374
- fts5MergeAppendDocid(&out, iLastRowid, i2.iRowid);
222375
- fts5BufferSafeAppendBlob(&out, i2.aPoslist, i2.nPoslist+i2.nSize);
222376
- fts5DoclistIterNext(&i2);
222377
- if( i2.aPoslist==0 ) break;
222378
- assert( out.n<=((i1.aPoslist-p1->p) + (i2.aPoslist-p2->p)+9+10+10) );
222379
- }
222380
- else{
222381
- /* Merge the two position lists. */
222382
- i64 iPos1 = 0;
222383
- i64 iPos2 = 0;
222384
- int iOff1 = 0;
222385
- int iOff2 = 0;
222386
- u8 *a1 = &i1.aPoslist[i1.nSize];
222387
- u8 *a2 = &i2.aPoslist[i2.nSize];
222388
- int nCopy;
222389
- u8 *aCopy;
222390
-
222391
- i64 iPrev = 0;
222392
- Fts5PoslistWriter writer;
222393
- memset(&writer, 0, sizeof(writer));
222394
-
222395
- /* See the earlier comment in this function for an explanation of why
222396
- ** corrupt input position lists might cause the output to consume
222397
- ** at most 20 bytes of unexpected space. */
222398
- fts5MergeAppendDocid(&out, iLastRowid, i2.iRowid);
222399
- fts5BufferZero(&tmp);
222400
- sqlite3Fts5BufferSize(&p->rc, &tmp,
222401
- i1.nPoslist + i2.nPoslist + 10 + 10 + FTS5_DATA_ZERO_PADDING
222402
- );
222403
- if( p->rc ) break;
222404
-
222405
- sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1);
222406
- sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2);
222407
- assert_nc( iPos1>=0 && iPos2>=0 );
222408
-
222409
- if( iPos1<iPos2 ){
222410
- sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1);
222411
- sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1);
222412
- }else{
222413
- sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2);
222414
- sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2);
222415
- }
222416
- if( iPos1>=0 && iPos2>=0 ){
222417
- while( 1 ){
222418
- if( iPos1<iPos2 ){
222419
- if( iPos1!=iPrev ){
222420
- sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1);
222421
- }
222422
- sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1);
222423
- if( iPos1<0 ) break;
222424
- }else{
222425
- assert_nc( iPos2!=iPrev );
222426
- sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2);
222427
- sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2);
222428
- if( iPos2<0 ) break;
222429
- }
222430
- }
222431
- }
222432
-
222433
- if( iPos1>=0 ){
222434
- if( iPos1!=iPrev ){
222435
- sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1);
222436
- }
222437
- aCopy = &a1[iOff1];
222438
- nCopy = i1.nPoslist - iOff1;
222439
- }else{
222440
- assert_nc( iPos2>=0 && iPos2!=iPrev );
222441
- sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2);
222442
- aCopy = &a2[iOff2];
222443
- nCopy = i2.nPoslist - iOff2;
222444
- }
222445
- if( nCopy>0 ){
222446
- fts5BufferSafeAppendBlob(&tmp, aCopy, nCopy);
222447
- }
222448
-
222449
- /* WRITEPOSLISTSIZE */
222450
- assert_nc( tmp.n<=i1.nPoslist+i2.nPoslist );
222451
- assert( tmp.n<=i1.nPoslist+i2.nPoslist+10+10 );
222452
- if( tmp.n>i1.nPoslist+i2.nPoslist ){
222453
- if( p->rc==SQLITE_OK ) p->rc = FTS5_CORRUPT;
222454
- break;
222455
- }
222456
- fts5BufferSafeAppendVarint(&out, tmp.n * 2);
222457
- fts5BufferSafeAppendBlob(&out, tmp.p, tmp.n);
222458
- fts5DoclistIterNext(&i1);
222459
- fts5DoclistIterNext(&i2);
222460
- assert_nc( out.n<=(p1->n+p2->n+9) );
222461
- if( i1.aPoslist==0 || i2.aPoslist==0 ) break;
222462
- assert( out.n<=((i1.aPoslist-p1->p) + (i2.aPoslist-p2->p)+9+10+10) );
222463
- }
222464
- }
222465
-
222466
- if( i1.aPoslist ){
222467
- fts5MergeAppendDocid(&out, iLastRowid, i1.iRowid);
222468
- fts5BufferSafeAppendBlob(&out, i1.aPoslist, i1.aEof - i1.aPoslist);
222469
- }
222470
- else if( i2.aPoslist ){
222471
- fts5MergeAppendDocid(&out, iLastRowid, i2.iRowid);
222472
- fts5BufferSafeAppendBlob(&out, i2.aPoslist, i2.aEof - i2.aPoslist);
222473
- }
222474
- assert_nc( out.n<=(p1->n+p2->n+9) );
222475
-
222476
- fts5BufferFree(p1);
222477
- fts5BufferFree(&tmp);
222478
- memset(&out.p[out.n], 0, FTS5_DATA_ZERO_PADDING);
222479
- *p1 = out;
222480
- }
223039
+ int nBuf, /* Number of buffers in array aBuf[] */
223040
+ Fts5Buffer *aBuf /* Other lists to merge in */
223041
+){
223042
+#define fts5PrefixMergerNextPosition(p) \
223043
+ sqlite3Fts5PoslistNext64((p)->aPos,(p)->iter.nPoslist,&(p)->iOff,&(p)->iPos);
223044
+#define FTS5_MERGE_NLIST 16
223045
+ PrefixMerger aMerger[FTS5_MERGE_NLIST];
223046
+ PrefixMerger *pHead = 0;
223047
+ int i;
223048
+ int nOut = 0;
223049
+ Fts5Buffer out = {0, 0, 0};
223050
+ Fts5Buffer tmp = {0, 0, 0};
223051
+ i64 iLastRowid = 0;
223052
+
223053
+ /* Initialize a doclist-iterator for each input buffer. Arrange them in
223054
+ ** a linked-list starting at pHead in ascending order of rowid. Avoid
223055
+ ** linking any iterators already at EOF into the linked list at all. */
223056
+ assert( nBuf+1<=sizeof(aMerger)/sizeof(aMerger[0]) );
223057
+ memset(aMerger, 0, sizeof(PrefixMerger)*(nBuf+1));
223058
+ pHead = &aMerger[nBuf];
223059
+ fts5DoclistIterInit(p1, &pHead->iter);
223060
+ for(i=0; i<nBuf; i++){
223061
+ fts5DoclistIterInit(&aBuf[i], &aMerger[i].iter);
223062
+ fts5PrefixMergerInsertByRowid(&pHead, &aMerger[i]);
223063
+ nOut += aBuf[i].n;
223064
+ }
223065
+ if( nOut==0 ) return;
223066
+ nOut += p1->n + 9 + 10*nBuf;
223067
+
223068
+ /* The maximum size of the output is equal to the sum of the
223069
+ ** input sizes + 1 varint (9 bytes). The extra varint is because if the
223070
+ ** first rowid in one input is a large negative number, and the first in
223071
+ ** the other a non-negative number, the delta for the non-negative
223072
+ ** number will be larger on disk than the literal integer value
223073
+ ** was.
223074
+ **
223075
+ ** Or, if the input position-lists are corrupt, then the output might
223076
+ ** include up to (nBuf+1) extra 10-byte positions created by interpreting -1
223077
+ ** (the value PoslistNext64() uses for EOF) as a position and appending
223078
+ ** it to the output. This can happen at most once for each input
223079
+ ** position-list, hence (nBuf+1) 10 byte paddings. */
223080
+ if( sqlite3Fts5BufferSize(&p->rc, &out, nOut) ) return;
223081
+
223082
+ while( pHead ){
223083
+ fts5MergeAppendDocid(&out, iLastRowid, pHead->iter.iRowid);
223084
+
223085
+ if( pHead->pNext && iLastRowid==pHead->pNext->iter.iRowid ){
223086
+ /* Merge data from two or more poslists */
223087
+ i64 iPrev = 0;
223088
+ int nTmp = FTS5_DATA_ZERO_PADDING;
223089
+ int nMerge = 0;
223090
+ PrefixMerger *pSave = pHead;
223091
+ PrefixMerger *pThis = 0;
223092
+ int nTail = 0;
223093
+
223094
+ pHead = 0;
223095
+ while( pSave && pSave->iter.iRowid==iLastRowid ){
223096
+ PrefixMerger *pNext = pSave->pNext;
223097
+ pSave->iOff = 0;
223098
+ pSave->iPos = 0;
223099
+ pSave->aPos = &pSave->iter.aPoslist[pSave->iter.nSize];
223100
+ fts5PrefixMergerNextPosition(pSave);
223101
+ nTmp += pSave->iter.nPoslist + 10;
223102
+ nMerge++;
223103
+ fts5PrefixMergerInsertByPosition(&pHead, pSave);
223104
+ pSave = pNext;
223105
+ }
223106
+
223107
+ if( pHead==0 || pHead->pNext==0 ){
223108
+ p->rc = FTS5_CORRUPT;
223109
+ break;
223110
+ }
223111
+
223112
+ /* See the earlier comment in this function for an explanation of why
223113
+ ** corrupt input position lists might cause the output to consume
223114
+ ** at most nMerge*10 bytes of unexpected space. */
223115
+ if( sqlite3Fts5BufferSize(&p->rc, &tmp, nTmp+nMerge*10) ){
223116
+ break;
223117
+ }
223118
+ fts5BufferZero(&tmp);
223119
+
223120
+ pThis = pHead;
223121
+ pHead = pThis->pNext;
223122
+ sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, pThis->iPos);
223123
+ fts5PrefixMergerNextPosition(pThis);
223124
+ fts5PrefixMergerInsertByPosition(&pHead, pThis);
223125
+
223126
+ while( pHead->pNext ){
223127
+ pThis = pHead;
223128
+ if( pThis->iPos!=iPrev ){
223129
+ sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, pThis->iPos);
223130
+ }
223131
+ fts5PrefixMergerNextPosition(pThis);
223132
+ pHead = pThis->pNext;
223133
+ fts5PrefixMergerInsertByPosition(&pHead, pThis);
223134
+ }
223135
+
223136
+ if( pHead->iPos!=iPrev ){
223137
+ sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, pHead->iPos);
223138
+ }
223139
+ nTail = pHead->iter.nPoslist - pHead->iOff;
223140
+
223141
+ /* WRITEPOSLISTSIZE */
223142
+ assert( tmp.n+nTail<=nTmp );
223143
+ if( tmp.n+nTail>nTmp-FTS5_DATA_ZERO_PADDING ){
223144
+ if( p->rc==SQLITE_OK ) p->rc = FTS5_CORRUPT;
223145
+ break;
223146
+ }
223147
+ fts5BufferSafeAppendVarint(&out, (tmp.n+nTail) * 2);
223148
+ fts5BufferSafeAppendBlob(&out, tmp.p, tmp.n);
223149
+ if( nTail>0 ){
223150
+ fts5BufferSafeAppendBlob(&out, &pHead->aPos[pHead->iOff], nTail);
223151
+ }
223152
+
223153
+ pHead = pSave;
223154
+ for(i=0; i<nBuf+1; i++){
223155
+ PrefixMerger *pX = &aMerger[i];
223156
+ if( pX->iter.aPoslist && pX->iter.iRowid==iLastRowid ){
223157
+ fts5DoclistIterNext(&pX->iter);
223158
+ fts5PrefixMergerInsertByRowid(&pHead, pX);
223159
+ }
223160
+ }
223161
+
223162
+ }else{
223163
+ /* Copy poslist from pHead to output */
223164
+ PrefixMerger *pThis = pHead;
223165
+ Fts5DoclistIter *pI = &pThis->iter;
223166
+ fts5BufferSafeAppendBlob(&out, pI->aPoslist, pI->nPoslist+pI->nSize);
223167
+ fts5DoclistIterNext(pI);
223168
+ pHead = pThis->pNext;
223169
+ fts5PrefixMergerInsertByRowid(&pHead, pThis);
223170
+ }
223171
+ }
223172
+
223173
+ fts5BufferFree(p1);
223174
+ fts5BufferFree(&tmp);
223175
+ memset(&out.p[out.n], 0, FTS5_DATA_ZERO_PADDING);
223176
+ *p1 = out;
222481223177
}
222482223178
222483223179
static void fts5SetupPrefixIter(
222484223180
Fts5Index *p, /* Index to read from */
222485223181
int bDesc, /* True for "ORDER BY rowid DESC" */
222486
- const u8 *pToken, /* Buffer containing prefix to match */
223182
+ int iIdx, /* Index to scan for data */
223183
+ u8 *pToken, /* Buffer containing prefix to match */
222487223184
int nToken, /* Size of buffer pToken in bytes */
222488223185
Fts5Colset *pColset, /* Restrict matches to these columns */
222489223186
Fts5Iter **ppIter /* OUT: New iterator */
222490223187
){
222491223188
Fts5Structure *pStruct;
222492223189
Fts5Buffer *aBuf;
222493
- const int nBuf = 32;
223190
+ int nBuf = 32;
223191
+ int nMerge = 1;
222494223192
222495
- void (*xMerge)(Fts5Index*, Fts5Buffer*, Fts5Buffer*);
223193
+ void (*xMerge)(Fts5Index*, Fts5Buffer*, int, Fts5Buffer*);
222496223194
void (*xAppend)(Fts5Index*, i64, Fts5Iter*, Fts5Buffer*);
222497223195
if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){
222498223196
xMerge = fts5MergeRowidLists;
222499223197
xAppend = fts5AppendRowid;
222500223198
}else{
223199
+ nMerge = FTS5_MERGE_NLIST-1;
223200
+ nBuf = nMerge*8; /* Sufficient to merge (16^8)==(2^32) lists */
222501223201
xMerge = fts5MergePrefixLists;
222502223202
xAppend = fts5AppendPoslist;
222503223203
}
222504223204
222505223205
aBuf = (Fts5Buffer*)fts5IdxMalloc(p, sizeof(Fts5Buffer)*nBuf);
@@ -222515,10 +223215,31 @@
222515223215
Fts5Data *pData;
222516223216
Fts5Buffer doclist;
222517223217
int bNewTerm = 1;
222518223218
222519223219
memset(&doclist, 0, sizeof(doclist));
223220
+ if( iIdx!=0 ){
223221
+ int dummy = 0;
223222
+ const int f2 = FTS5INDEX_QUERY_SKIPEMPTY|FTS5INDEX_QUERY_NOOUTPUT;
223223
+ pToken[0] = FTS5_MAIN_PREFIX;
223224
+ fts5MultiIterNew(p, pStruct, f2, pColset, pToken, nToken, -1, 0, &p1);
223225
+ fts5IterSetOutputCb(&p->rc, p1);
223226
+ for(;
223227
+ fts5MultiIterEof(p, p1)==0;
223228
+ fts5MultiIterNext2(p, p1, &dummy)
223229
+ ){
223230
+ Fts5SegIter *pSeg = &p1->aSeg[ p1->aFirst[1].iFirst ];
223231
+ p1->xSetOutputs(p1, pSeg);
223232
+ if( p1->base.nData ){
223233
+ xAppend(p, p1->base.iRowid-iLastRowid, p1, &doclist);
223234
+ iLastRowid = p1->base.iRowid;
223235
+ }
223236
+ }
223237
+ fts5MultiIterFree(p1);
223238
+ }
223239
+
223240
+ pToken[0] = FTS5_MAIN_PREFIX + iIdx;
222520223241
fts5MultiIterNew(p, pStruct, flags, pColset, pToken, nToken, -1, 0, &p1);
222521223242
fts5IterSetOutputCb(&p->rc, p1);
222522223243
for( /* no-op */ ;
222523223244
fts5MultiIterEof(p, p1)==0;
222524223245
fts5MultiIterNext2(p, p1, &bNewTerm)
@@ -222535,31 +223256,43 @@
222535223256
222536223257
if( p1->base.nData==0 ) continue;
222537223258
222538223259
if( p1->base.iRowid<=iLastRowid && doclist.n>0 ){
222539223260
for(i=0; p->rc==SQLITE_OK && doclist.n; i++){
222540
- assert( i<nBuf );
222541
- if( aBuf[i].n==0 ){
222542
- fts5BufferSwap(&doclist, &aBuf[i]);
222543
- fts5BufferZero(&doclist);
222544
- }else{
222545
- xMerge(p, &doclist, &aBuf[i]);
222546
- fts5BufferZero(&aBuf[i]);
223261
+ int i1 = i*nMerge;
223262
+ int iStore;
223263
+ assert( i1+nMerge<=nBuf );
223264
+ for(iStore=i1; iStore<i1+nMerge; iStore++){
223265
+ if( aBuf[iStore].n==0 ){
223266
+ fts5BufferSwap(&doclist, &aBuf[iStore]);
223267
+ fts5BufferZero(&doclist);
223268
+ break;
223269
+ }
223270
+ }
223271
+ if( iStore==i1+nMerge ){
223272
+ xMerge(p, &doclist, nMerge, &aBuf[i1]);
223273
+ for(iStore=i1; iStore<i1+nMerge; iStore++){
223274
+ fts5BufferZero(&aBuf[iStore]);
223275
+ }
222547223276
}
222548223277
}
222549223278
iLastRowid = 0;
222550223279
}
222551223280
222552223281
xAppend(p, p1->base.iRowid-iLastRowid, p1, &doclist);
222553223282
iLastRowid = p1->base.iRowid;
222554223283
}
222555223284
222556
- for(i=0; i<nBuf; i++){
223285
+ assert( (nBuf%nMerge)==0 );
223286
+ for(i=0; i<nBuf; i+=nMerge){
223287
+ int iFree;
222557223288
if( p->rc==SQLITE_OK ){
222558
- xMerge(p, &doclist, &aBuf[i]);
223289
+ xMerge(p, &doclist, nMerge, &aBuf[i]);
222559223290
}
222560
- fts5BufferFree(&aBuf[i]);
223291
+ for(iFree=i; iFree<i+nMerge; iFree++){
223292
+ fts5BufferFree(&aBuf[iFree]);
223293
+ }
222561223294
}
222562223295
fts5MultiIterFree(p1);
222563223296
222564223297
pData = fts5IdxMalloc(p, sizeof(Fts5Data)+doclist.n+FTS5_DATA_ZERO_PADDING);
222565223298
if( pData ){
@@ -222810,10 +223543,11 @@
222810223543
/* If the QUERY_SCAN flag is set, all other flags must be clear. */
222811223544
assert( (flags & FTS5INDEX_QUERY_SCAN)==0 || flags==FTS5INDEX_QUERY_SCAN );
222812223545
222813223546
if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){
222814223547
int iIdx = 0; /* Index to search */
223548
+ int iPrefixIdx = 0; /* +1 prefix index */
222815223549
if( nToken ) memcpy(&buf.p[1], pToken, nToken);
222816223550
222817223551
/* Figure out which index to search and set iIdx accordingly. If this
222818223552
** is a prefix query for which there is no prefix index, set iIdx to
222819223553
** greater than pConfig->nPrefix to indicate that the query will be
@@ -222831,11 +223565,13 @@
222831223565
}else
222832223566
#endif
222833223567
if( flags & FTS5INDEX_QUERY_PREFIX ){
222834223568
int nChar = fts5IndexCharlen(pToken, nToken);
222835223569
for(iIdx=1; iIdx<=pConfig->nPrefix; iIdx++){
222836
- if( pConfig->aPrefix[iIdx-1]==nChar ) break;
223570
+ int nIdxChar = pConfig->aPrefix[iIdx-1];
223571
+ if( nIdxChar==nChar ) break;
223572
+ if( nIdxChar==nChar+1 ) iPrefixIdx = iIdx;
222837223573
}
222838223574
}
222839223575
222840223576
if( iIdx<=pConfig->nPrefix ){
222841223577
/* Straight index lookup */
@@ -222848,12 +223584,11 @@
222848223584
fts5StructureRelease(pStruct);
222849223585
}
222850223586
}else{
222851223587
/* Scan multiple terms in the main index */
222852223588
int bDesc = (flags & FTS5INDEX_QUERY_DESC)!=0;
222853
- buf.p[0] = FTS5_MAIN_PREFIX;
222854
- fts5SetupPrefixIter(p, bDesc, buf.p, nToken+1, pColset, &pRet);
223589
+ fts5SetupPrefixIter(p, bDesc, iPrefixIdx, buf.p, nToken+1, pColset,&pRet);
222855223590
assert( p->rc!=SQLITE_OK || pRet->pColset==0 );
222856223591
fts5IterSetOutputCb(&p->rc, pRet);
222857223592
if( p->rc==SQLITE_OK ){
222858223593
Fts5SegIter *pSeg = &pRet->aSeg[pRet->aFirst[1].iFirst];
222859223594
if( pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg);
@@ -226817,11 +227552,11 @@
226817227552
int nArg, /* Number of args */
226818227553
sqlite3_value **apUnused /* Function arguments */
226819227554
){
226820227555
assert( nArg==0 );
226821227556
UNUSED_PARAM2(nArg, apUnused);
226822
- sqlite3_result_text(pCtx, "fts5: 2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b", -1, SQLITE_TRANSIENT);
227557
+ sqlite3_result_text(pCtx, "fts5: 2020-12-15 13:55:38 ea0a7f103a6f6a9e57d7377140ff9f372bf2b156f86f148291fb05a7030f2b36", -1, SQLITE_TRANSIENT);
226823227558
}
226824227559
226825227560
/*
226826227561
** Return true if zName is the extension on one of the shadow tables used
226827227562
** by this module.
@@ -231743,12 +232478,12 @@
231743232478
}
231744232479
#endif /* SQLITE_CORE */
231745232480
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
231746232481
231747232482
/************** End of stmt.c ************************************************/
231748
-#if __LINE__!=231748
232483
+#if __LINE__!=232483
231749232484
#undef SQLITE_SOURCE_ID
231750
-#define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089falt2"
232485
+#define SQLITE_SOURCE_ID "2020-12-15 13:55:38 ea0a7f103a6f6a9e57d7377140ff9f372bf2b156f86f148291fb05a7030falt2"
231751232486
#endif
231752232487
/* Return the source-id for this library */
231753232488
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
231754232489
/************************** End of sqlite3.c ******************************/
231755232490
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.34.0. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -281,10 +281,13 @@
281 #if SQLITE_ENABLE_LOAD_EXTENSION
282 "ENABLE_LOAD_EXTENSION",
283 #endif
284 #ifdef SQLITE_ENABLE_LOCKING_STYLE
285 "ENABLE_LOCKING_STYLE=" CTIMEOPT_VAL(SQLITE_ENABLE_LOCKING_STYLE),
 
 
 
286 #endif
287 #if SQLITE_ENABLE_MEMORY_MANAGEMENT
288 "ENABLE_MEMORY_MANAGEMENT",
289 #endif
290 #if SQLITE_ENABLE_MEMSYS3
@@ -988,10 +991,22 @@
988 # define MSVC_VERSION _MSC_VER
989 #else
990 # define MSVC_VERSION 0
991 #endif
992
 
 
 
 
 
 
 
 
 
 
 
 
993 /* Needed for various definitions... */
994 #if defined(__GNUC__) && !defined(_GNU_SOURCE)
995 # define _GNU_SOURCE
996 #endif
997
@@ -1169,13 +1184,13 @@
1169 **
1170 ** See also: [sqlite3_libversion()],
1171 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1172 ** [sqlite_version()] and [sqlite_source_id()].
1173 */
1174 #define SQLITE_VERSION "3.34.0"
1175 #define SQLITE_VERSION_NUMBER 3034000
1176 #define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b"
1177
1178 /*
1179 ** CAPI3REF: Run-Time Library Version Numbers
1180 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1181 **
@@ -8811,11 +8826,12 @@
8811 #define SQLITE_TESTCTRL_PARSER_COVERAGE 26
8812 #define SQLITE_TESTCTRL_RESULT_INTREAL 27
8813 #define SQLITE_TESTCTRL_PRNG_SEED 28
8814 #define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
8815 #define SQLITE_TESTCTRL_SEEK_COUNT 30
8816 #define SQLITE_TESTCTRL_LAST 30 /* Largest TESTCTRL */
 
8817
8818 /*
8819 ** CAPI3REF: SQL Keyword Checking
8820 **
8821 ** These routines provide access to the set of SQL language keywords
@@ -14592,25 +14608,39 @@
14592
14593 /*
14594 ** SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not
14595 ** the Select query generator tracing logic is turned on.
14596 */
14597 #if defined(SQLITE_ENABLE_SELECTTRACE)
14598 # define SELECTTRACE_ENABLED 1
14599 #else
14600 # define SELECTTRACE_ENABLED 0
14601 #endif
14602 #if defined(SQLITE_ENABLE_SELECTTRACE)
 
14603 # define SELECTTRACE_ENABLED 1
14604 # define SELECTTRACE(K,P,S,X) \
14605 if(sqlite3_unsupported_selecttrace&(K)) \
14606 sqlite3DebugPrintf("%u/%d/%p: ",(S)->selId,(P)->addrExplain,(S)),\
14607 sqlite3DebugPrintf X
14608 #else
14609 # define SELECTTRACE(K,P,S,X)
14610 # define SELECTTRACE_ENABLED 0
14611 #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14612
14613 /*
14614 ** An instance of the following structure is used to store the busy-handler
14615 ** callback for a given sqlite handle.
14616 **
@@ -15316,10 +15346,11 @@
15316
15317 /* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */
15318 #define BTREE_SAVEPOSITION 0x02 /* Leave cursor pointing at NEXT or PREV */
15319 #define BTREE_AUXDELETE 0x04 /* not the primary delete operation */
15320 #define BTREE_APPEND 0x08 /* Insert is likely an append */
 
15321
15322 /* An instance of the BtreePayload object describes the content of a single
15323 ** entry in either an index or table btree.
15324 **
15325 ** Index btrees (used for indexes and also WITHOUT ROWID tables) contain
@@ -15414,10 +15445,12 @@
15414 #endif
15415
15416 #ifndef SQLITE_OMIT_WAL
15417 SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree*, int, int *, int *);
15418 #endif
 
 
15419
15420 /*
15421 ** If we are not using shared cache, then there is no need to
15422 ** use mutexes to access the BtShared structures. So make the
15423 ** Enter and Leave procedures no-ops.
@@ -15757,64 +15790,65 @@
15757 #define OP_SeekScan 118 /* synopsis: Scan-ahead up to P1 rows */
15758 #define OP_SeekHit 119 /* synopsis: set P2<=seekHit<=P3 */
15759 #define OP_Sequence 120 /* synopsis: r[P2]=cursor[P1].ctr++ */
15760 #define OP_NewRowid 121 /* synopsis: r[P2]=rowid */
15761 #define OP_Insert 122 /* synopsis: intkey=r[P3] data=r[P2] */
15762 #define OP_Delete 123
15763 #define OP_ResetCount 124
15764 #define OP_SorterCompare 125 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
15765 #define OP_SorterData 126 /* synopsis: r[P2]=data */
15766 #define OP_RowData 127 /* synopsis: r[P2]=data */
15767 #define OP_Rowid 128 /* synopsis: r[P2]=rowid */
15768 #define OP_NullRow 129
15769 #define OP_SeekEnd 130
15770 #define OP_IdxInsert 131 /* synopsis: key=r[P2] */
15771 #define OP_SorterInsert 132 /* synopsis: key=r[P2] */
15772 #define OP_IdxDelete 133 /* synopsis: key=r[P2@P3] */
15773 #define OP_DeferredSeek 134 /* synopsis: Move P3 to P1.rowid if needed */
15774 #define OP_IdxRowid 135 /* synopsis: r[P2]=rowid */
15775 #define OP_FinishSeek 136
15776 #define OP_Destroy 137
15777 #define OP_Clear 138
15778 #define OP_ResetSorter 139
15779 #define OP_CreateBtree 140 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
15780 #define OP_SqlExec 141
15781 #define OP_ParseSchema 142
15782 #define OP_LoadAnalysis 143
15783 #define OP_DropTable 144
15784 #define OP_DropIndex 145
15785 #define OP_DropTrigger 146
15786 #define OP_IntegrityCk 147
15787 #define OP_RowSetAdd 148 /* synopsis: rowset(P1)=r[P2] */
15788 #define OP_Param 149
15789 #define OP_Real 150 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
15790 #define OP_FkCounter 151 /* synopsis: fkctr[P1]+=P2 */
15791 #define OP_MemMax 152 /* synopsis: r[P1]=max(r[P1],r[P2]) */
15792 #define OP_OffsetLimit 153 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
15793 #define OP_AggInverse 154 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
15794 #define OP_AggStep 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */
15795 #define OP_AggStep1 156 /* synopsis: accum=r[P3] step(r[P2@P5]) */
15796 #define OP_AggValue 157 /* synopsis: r[P3]=value N=P2 */
15797 #define OP_AggFinal 158 /* synopsis: accum=r[P1] N=P2 */
15798 #define OP_Expire 159
15799 #define OP_CursorLock 160
15800 #define OP_CursorUnlock 161
15801 #define OP_TableLock 162 /* synopsis: iDb=P1 root=P2 write=P3 */
15802 #define OP_VBegin 163
15803 #define OP_VCreate 164
15804 #define OP_VDestroy 165
15805 #define OP_VOpen 166
15806 #define OP_VColumn 167 /* synopsis: r[P3]=vcolumn(P2) */
15807 #define OP_VRename 168
15808 #define OP_Pagecount 169
15809 #define OP_MaxPgcnt 170
15810 #define OP_Trace 171
15811 #define OP_CursorHint 172
15812 #define OP_ReleaseReg 173 /* synopsis: release r[P1@P2] mask P3 */
15813 #define OP_Noop 174
15814 #define OP_Explain 175
15815 #define OP_Abortable 176
 
15816
15817 /* Properties such as "out2" or "jump" that are specified in
15818 ** comments following the "case" for each opcode in the vdbe.c
15819 ** are encoded into bitvectors as follows:
15820 */
@@ -15839,17 +15873,17 @@
15839 /* 88 */ 0x20, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\
15840 /* 96 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x26, 0x26,\
15841 /* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x00,\
15842 /* 112 */ 0x12, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\
15843 /* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15844 /* 128 */ 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x10,\
15845 /* 136 */ 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,\
15846 /* 144 */ 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00,\
15847 /* 152 */ 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15848 /* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15849 /* 168 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
15850 /* 176 */ 0x00,}
15851
15852 /* The sqlite3P2Values() routine is able to run faster if it knows
15853 ** the value of the largest JUMP opcode. The smaller the maximum
15854 ** JUMP opcode the better, so the mkopcodeh.tcl script that
15855 ** generated this include file strives to group all JUMP opcodes
@@ -17285,10 +17319,13 @@
17285 ** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions
17286 ** and functions like sqlite_version() that can change, but not during
17287 ** a single query. The iArg is ignored. The user-data is always set
17288 ** to a NULL pointer. The bNC parameter is not used.
17289 **
 
 
 
17290 ** PURE_DATE(zName, nArg, iArg, bNC, xFunc)
17291 ** Used for "pure" date/time functions, this macro is like DFUNCTION
17292 ** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is
17293 ** ignored and the user-data for these functions is set to an
17294 ** arbitrary non-NULL pointer. The bNC parameter is not used.
@@ -17320,10 +17357,13 @@
17320 {nArg, SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
17321 SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, 0, #zName, {0} }
17322 #define SFUNCTION(zName, nArg, iArg, bNC, xFunc) \
17323 {nArg, SQLITE_UTF8|SQLITE_DIRECTONLY|SQLITE_FUNC_UNSAFE, \
17324 SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, 0, #zName, {0} }
 
 
 
17325 #define INLINE_FUNC(zName, nArg, iArg, mFlags) \
17326 {nArg, SQLITE_UTF8|SQLITE_FUNC_INLINE|SQLITE_FUNC_CONSTANT|(mFlags), \
17327 SQLITE_INT_TO_PTR(iArg), 0, noopFunc, 0, 0, 0, #zName, {0} }
17328 #define TEST_FUNC(zName, nArg, iArg, mFlags) \
17329 {nArg, SQLITE_UTF8|SQLITE_FUNC_INTERNAL|SQLITE_FUNC_TEST| \
@@ -17719,20 +17759,26 @@
17719 ** occurs. IGNORE means that the particular row that caused the constraint
17720 ** error is not inserted or updated. Processing continues and no error
17721 ** is returned. REPLACE means that preexisting database rows that caused
17722 ** a UNIQUE constraint violation are removed so that the new insert or
17723 ** update can proceed. Processing continues and no error is reported.
 
 
17724 **
17725 ** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
17726 ** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the
17727 ** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign
17728 ** key is set to NULL. CASCADE means that a DELETE or UPDATE of the
 
17729 ** referenced table row is propagated into the row that holds the
17730 ** foreign key.
 
 
 
17731 **
17732 ** The following symbolic values are used to record which type
17733 ** of action to take.
17734 */
17735 #define OE_None 0 /* There is no constraint to check */
17736 #define OE_Rollback 1 /* Fail the operation and rollback the transaction */
17737 #define OE_Abort 2 /* Back out changes but do no rollback transaction */
17738 #define OE_Fail 3 /* Stop the operation but leave all prior changes */
@@ -18482,19 +18528,25 @@
18482 ** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The
18483 ** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the
18484 ** WHERE clause is omitted.
18485 */
18486 struct Upsert {
18487 ExprList *pUpsertTarget; /* Optional description of conflicting index */
18488 Expr *pUpsertTargetWhere; /* WHERE clause for partial index targets */
18489 ExprList *pUpsertSet; /* The SET clause from an ON CONFLICT UPDATE */
18490 Expr *pUpsertWhere; /* WHERE clause for the ON CONFLICT UPDATE */
18491 /* The fields above comprise the parse tree for the upsert clause.
18492 ** The fields below are used to transfer information from the INSERT
18493 ** processing down into the UPDATE processing while generating code.
18494 ** Upsert owns the memory allocated above, but not the memory below. */
18495 Index *pUpsertIdx; /* Constraint that pUpsertTarget identifies */
 
 
 
 
 
 
18496 SrcList *pUpsertSrc; /* Table to be updated */
18497 int regData; /* First register holding array of VALUES */
18498 int iDataCur; /* Index of the data cursor */
18499 int iIdxCur; /* Index of the first index cursor */
18500 };
@@ -18932,10 +18984,11 @@
18932 #define OPFLAG_P2ISREG 0x10 /* P2 to OP_Open** is a register number */
18933 #define OPFLAG_PERMUTE 0x01 /* OP_Compare: use the permutation */
18934 #define OPFLAG_SAVEPOSITION 0x02 /* OP_Delete/Insert: save cursor pos */
18935 #define OPFLAG_AUXDELETE 0x04 /* OP_Delete: index in a DELETE op */
18936 #define OPFLAG_NOCHNG_MAGIC 0x6d /* OP_MakeRecord: serialtype 10 is ok */
 
18937
18938 /*
18939 * Each trigger present in the database schema is stored as an instance of
18940 * struct Trigger.
18941 *
@@ -20029,11 +20082,10 @@
20029 SQLITE_PRIVATE const char sqlite3StrBINARY[];
20030 SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[];
20031 SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[];
20032 SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config;
20033 SQLITE_PRIVATE FuncDefHash sqlite3BuiltinFunctions;
20034 SQLITE_API extern u32 sqlite3_unsupported_selecttrace;
20035 #ifndef SQLITE_OMIT_WSD
20036 SQLITE_PRIVATE int sqlite3PendingByte;
20037 #endif
20038 #endif /* SQLITE_AMALGAMATION */
20039 #ifdef VDBE_PROFILE
@@ -20240,19 +20292,23 @@
20240 #else
20241 #define sqlite3WithPush(x,y,z)
20242 #define sqlite3WithDelete(x,y)
20243 #endif
20244 #ifndef SQLITE_OMIT_UPSERT
20245 SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*);
20246 SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
20247 SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
20248 SQLITE_PRIVATE int sqlite3UpsertAnalyzeTarget(Parse*,SrcList*,Upsert*);
20249 SQLITE_PRIVATE void sqlite3UpsertDoUpdate(Parse*,Upsert*,Table*,Index*,int);
 
 
20250 #else
20251 #define sqlite3UpsertNew(v,w,x,y,z) ((Upsert*)0)
20252 #define sqlite3UpsertDelete(x,y)
20253 #define sqlite3UpsertDup(x,y) ((Upsert*)0)
 
 
20254 #endif
20255
20256
20257 /* Declarations for functions in fkey.c. All of these are replaced by
20258 ** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
@@ -20744,13 +20800,14 @@
20744 #ifndef SQLITE_OMIT_WSD
20745 SQLITE_PRIVATE int sqlite3PendingByte = 0x40000000;
20746 #endif
20747
20748 /*
20749 ** Flags for select tracing and the ".selecttrace" macro of the CLI
20750 */
20751 SQLITE_API u32 sqlite3_unsupported_selecttrace = 0;
 
20752
20753 /* #include "opcodes.h" */
20754 /*
20755 ** Properties of opcodes. The OPFLG_INITIALIZER macro is
20756 ** created by mkopcodeh.awk during compilation. Data is obtained
@@ -23170,10 +23227,12 @@
23170 SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
23171 if( id->pMethods==0 ) return SQLITE_NOTFOUND;
23172 #ifdef SQLITE_TEST
23173 if( op!=SQLITE_FCNTL_COMMIT_PHASETWO
23174 && op!=SQLITE_FCNTL_LOCK_TIMEOUT
 
 
23175 ){
23176 /* Faults are not injected into COMMIT_PHASETWO because, assuming SQLite
23177 ** is using a regular VFS, it is called after the corresponding
23178 ** transaction has been committed. Injecting a fault at this point
23179 ** confuses the test scripts - the COMMIT comand returns SQLITE_NOMEM
@@ -23180,11 +23239,16 @@
23180 ** but the transaction is committed anyway.
23181 **
23182 ** The core must call OsFileControl() though, not OsFileControlHint(),
23183 ** as if a custom VFS (e.g. zipvfs) returns an error here, it probably
23184 ** means the commit really has failed and an error should be returned
23185 ** to the user. */
 
 
 
 
 
23186 DO_OS_MALLOC_TEST(id);
23187 }
23188 #endif
23189 return id->pMethods->xFileControl(id, op, pArg);
23190 }
@@ -33371,64 +33435,65 @@
33371 /* 118 */ "SeekScan" OpHelp("Scan-ahead up to P1 rows"),
33372 /* 119 */ "SeekHit" OpHelp("set P2<=seekHit<=P3"),
33373 /* 120 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"),
33374 /* 121 */ "NewRowid" OpHelp("r[P2]=rowid"),
33375 /* 122 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
33376 /* 123 */ "Delete" OpHelp(""),
33377 /* 124 */ "ResetCount" OpHelp(""),
33378 /* 125 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
33379 /* 126 */ "SorterData" OpHelp("r[P2]=data"),
33380 /* 127 */ "RowData" OpHelp("r[P2]=data"),
33381 /* 128 */ "Rowid" OpHelp("r[P2]=rowid"),
33382 /* 129 */ "NullRow" OpHelp(""),
33383 /* 130 */ "SeekEnd" OpHelp(""),
33384 /* 131 */ "IdxInsert" OpHelp("key=r[P2]"),
33385 /* 132 */ "SorterInsert" OpHelp("key=r[P2]"),
33386 /* 133 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
33387 /* 134 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
33388 /* 135 */ "IdxRowid" OpHelp("r[P2]=rowid"),
33389 /* 136 */ "FinishSeek" OpHelp(""),
33390 /* 137 */ "Destroy" OpHelp(""),
33391 /* 138 */ "Clear" OpHelp(""),
33392 /* 139 */ "ResetSorter" OpHelp(""),
33393 /* 140 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"),
33394 /* 141 */ "SqlExec" OpHelp(""),
33395 /* 142 */ "ParseSchema" OpHelp(""),
33396 /* 143 */ "LoadAnalysis" OpHelp(""),
33397 /* 144 */ "DropTable" OpHelp(""),
33398 /* 145 */ "DropIndex" OpHelp(""),
33399 /* 146 */ "DropTrigger" OpHelp(""),
33400 /* 147 */ "IntegrityCk" OpHelp(""),
33401 /* 148 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
33402 /* 149 */ "Param" OpHelp(""),
33403 /* 150 */ "Real" OpHelp("r[P2]=P4"),
33404 /* 151 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
33405 /* 152 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
33406 /* 153 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
33407 /* 154 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
33408 /* 155 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
33409 /* 156 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"),
33410 /* 157 */ "AggValue" OpHelp("r[P3]=value N=P2"),
33411 /* 158 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
33412 /* 159 */ "Expire" OpHelp(""),
33413 /* 160 */ "CursorLock" OpHelp(""),
33414 /* 161 */ "CursorUnlock" OpHelp(""),
33415 /* 162 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
33416 /* 163 */ "VBegin" OpHelp(""),
33417 /* 164 */ "VCreate" OpHelp(""),
33418 /* 165 */ "VDestroy" OpHelp(""),
33419 /* 166 */ "VOpen" OpHelp(""),
33420 /* 167 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
33421 /* 168 */ "VRename" OpHelp(""),
33422 /* 169 */ "Pagecount" OpHelp(""),
33423 /* 170 */ "MaxPgcnt" OpHelp(""),
33424 /* 171 */ "Trace" OpHelp(""),
33425 /* 172 */ "CursorHint" OpHelp(""),
33426 /* 173 */ "ReleaseReg" OpHelp("release r[P1@P2] mask P3"),
33427 /* 174 */ "Noop" OpHelp(""),
33428 /* 175 */ "Explain" OpHelp(""),
33429 /* 176 */ "Abortable" OpHelp(""),
 
33430 };
33431 return azName[i];
33432 }
33433 #endif
33434
@@ -64147,10 +64212,11 @@
64147 BtShared *pNext; /* Next on a list of sharable BtShared structs */
64148 BtLock *pLock; /* List of locks held on this shared-btree struct */
64149 Btree *pWriter; /* Btree with currently open write transaction */
64150 #endif
64151 u8 *pTmpSpace; /* Temp space sufficient to hold a single cell */
 
64152 };
64153
64154 /*
64155 ** Allowed values for BtShared.btsFlags
64156 */
@@ -65859,10 +65925,28 @@
65859 }else{
65860 pInfo->nLocal = (u16)minLocal;
65861 }
65862 pInfo->nSize = (u16)(&pInfo->pPayload[pInfo->nLocal] - pCell) + 4;
65863 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65864
65865 /*
65866 ** The following routines are implementations of the MemPage.xParseCell()
65867 ** method.
65868 **
@@ -73377,11 +73461,12 @@
73377 Btree *p = pCur->pBtree;
73378 BtShared *pBt = p->pBt;
73379 unsigned char *oldCell;
73380 unsigned char *newCell = 0;
73381
73382 assert( (flags & (BTREE_SAVEPOSITION|BTREE_APPEND))==flags );
 
73383
73384 if( pCur->eState==CURSOR_FAULT ){
73385 assert( pCur->skipNext!=SQLITE_OK );
73386 return pCur->skipNext;
73387 }
@@ -73395,11 +73480,11 @@
73395 /* Assert that the caller has been consistent. If this cursor was opened
73396 ** expecting an index b-tree, then the caller should be inserting blob
73397 ** keys with no associated data. If the cursor was opened expecting an
73398 ** intkey table, the caller should be inserting integer keys with a
73399 ** blob of associated data. */
73400 assert( (pX->pKey==0)==(pCur->pKeyInfo==0) );
73401
73402 /* Save the positions of any other cursors open on this table.
73403 **
73404 ** In some cases, the call to btreeMoveto() below is a no-op. For
73405 ** example, when inserting data into a table with auto-generated integer
@@ -73505,11 +73590,11 @@
73505 assert( pCur->eState==CURSOR_VALID
73506 || (pCur->eState==CURSOR_INVALID && loc)
73507 || CORRUPT_DB );
73508
73509 pPage = pCur->pPage;
73510 assert( pPage->intKey || pX->nKey>=0 );
73511 assert( pPage->leaf || !pPage->intKey );
73512 if( pPage->nFree<0 ){
73513 if( pCur->eState>CURSOR_INVALID ){
73514 rc = SQLITE_CORRUPT_BKPT;
73515 }else{
@@ -73522,11 +73607,25 @@
73522 pCur->pgnoRoot, pX->nKey, pX->nData, pPage->pgno,
73523 loc==0 ? "overwrite" : "new entry"));
73524 assert( pPage->isInit );
73525 newCell = pBt->pTmpSpace;
73526 assert( newCell!=0 );
73527 rc = fillInCell(pPage, newCell, pX, &szNew);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73528 if( rc ) goto end_insert;
73529 assert( szNew==pPage->xCellSize(pPage, newCell) );
73530 assert( szNew <= MX_CELL_SIZE(pBt) );
73531 idx = pCur->ix;
73532 if( loc==0 ){
@@ -73626,10 +73725,112 @@
73626 }
73627 }
73628 assert( pCur->iPage<0 || pCur->pPage->nOverflow==0 );
73629
73630 end_insert:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73631 return rc;
73632 }
73633
73634 /*
73635 ** Delete the entry that the cursor is pointing to.
@@ -90701,11 +90902,12 @@
90701 }else{
90702 x.nZero = 0;
90703 }
90704 x.pKey = 0;
90705 rc = sqlite3BtreeInsert(pC->uc.pCursor, &x,
90706 (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION)), seekResult
 
90707 );
90708 pC->deferredMoveto = 0;
90709 pC->cacheStatus = CACHE_STALE;
90710
90711 /* Invoke the update-hook if required. */
@@ -90717,10 +90919,35 @@
90717 (pOp->p5 & OPFLAG_ISUPDATE) ? SQLITE_UPDATE : SQLITE_INSERT,
90718 zDb, pTab->zName, x.nKey);
90719 }
90720 break;
90721 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90722
90723 /* Opcode: Delete P1 P2 P3 P4 P5
90724 **
90725 ** Delete the record at which the P1 cursor is currently pointing.
90726 **
@@ -91373,11 +91600,11 @@
91373 pC = p->apCsr[pOp->p1];
91374 sqlite3VdbeIncrWriteCounter(p, pC);
91375 assert( pC!=0 );
91376 assert( !isSorter(pC) );
91377 pIn2 = &aMem[pOp->p2];
91378 assert( pIn2->flags & MEM_Blob );
91379 if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++;
91380 assert( pC->eCurType==CURTYPE_BTREE );
91381 assert( pC->isTable==0 );
91382 rc = ExpandBlob(pIn2);
91383 if( rc ) goto abort_due_to_error;
@@ -91384,11 +91611,11 @@
91384 x.nKey = pIn2->n;
91385 x.pKey = pIn2->z;
91386 x.aMem = aMem + pOp->p3;
91387 x.nMem = (u16)pOp->p4.i;
91388 rc = sqlite3BtreeInsert(pC->uc.pCursor, &x,
91389 (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION)),
91390 ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0)
91391 );
91392 assert( pC->deferredMoveto==0 );
91393 pC->cacheStatus = CACHE_STALE;
91394 if( rc) goto abort_due_to_error;
@@ -119441,10 +119668,197 @@
119441 }
119442
119443 *pIsNocase = (pDef->funcFlags & SQLITE_FUNC_CASE)==0;
119444 return 1;
119445 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119446
119447 /*
119448 ** All of the FuncDef structures in the aBuiltinFunc[] array above
119449 ** to the global function hash table. This occurs at start-time (as
119450 ** a consequence of calling sqlite3_initialize()).
@@ -119560,10 +119974,47 @@
119560 #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
119561 FUNCTION(unknown, -1, 0, 0, unknownFunc ),
119562 #endif
119563 FUNCTION(coalesce, 1, 0, 0, 0 ),
119564 FUNCTION(coalesce, 0, 0, 0, 0 ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119565 INLINE_FUNC(coalesce, -1, INLINEFUNC_coalesce, 0 ),
119566 INLINE_FUNC(iif, 3, INLINEFUNC_iif, 0 ),
119567 };
119568 #ifndef SQLITE_OMIT_ALTERTABLE
119569 sqlite3AlterFunctions();
@@ -122018,10 +122469,11 @@
122018 }
122019 aRegIdx[i] = ++pParse->nMem; /* Register to store the table record */
122020 }
122021 #ifndef SQLITE_OMIT_UPSERT
122022 if( pUpsert ){
 
122023 if( IsVirtual(pTab) ){
122024 sqlite3ErrorMsg(pParse, "UPSERT not implemented for virtual table \"%s\"",
122025 pTab->zName);
122026 goto insert_cleanup;
122027 }
@@ -122031,17 +122483,21 @@
122031 }
122032 if( sqlite3HasExplicitNulls(pParse, pUpsert->pUpsertTarget) ){
122033 goto insert_cleanup;
122034 }
122035 pTabList->a[0].iCursor = iDataCur;
122036 pUpsert->pUpsertSrc = pTabList;
122037 pUpsert->regData = regData;
122038 pUpsert->iDataCur = iDataCur;
122039 pUpsert->iIdxCur = iIdxCur;
122040 if( pUpsert->pUpsertTarget ){
122041 sqlite3UpsertAnalyzeTarget(pParse, pTabList, pUpsert);
122042 }
 
 
 
 
122043 }
122044 #endif
122045
122046
122047 /* This is the top of the main insertion loop */
@@ -122441,10 +122897,74 @@
122441 testcase( w.eCode==CKCNSTRNT_COLUMN );
122442 testcase( w.eCode==CKCNSTRNT_ROWID );
122443 testcase( w.eCode==(CKCNSTRNT_ROWID|CKCNSTRNT_COLUMN) );
122444 return w.eCode!=0;
122445 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122446
122447 /*
122448 ** Generate code to do constraint checks prior to an INSERT or an UPDATE
122449 ** on table pTab.
122450 **
@@ -122550,32 +123070,33 @@
122550 int *aiChng, /* column i is unchanged if aiChng[i]<0 */
122551 Upsert *pUpsert /* ON CONFLICT clauses, if any. NULL otherwise */
122552 ){
122553 Vdbe *v; /* VDBE under constrution */
122554 Index *pIdx; /* Pointer to one of the indices */
122555 Index *pPk = 0; /* The PRIMARY KEY index */
122556 sqlite3 *db; /* Database connection */
122557 int i; /* loop counter */
122558 int ix; /* Index loop counter */
122559 int nCol; /* Number of columns */
122560 int onError; /* Conflict resolution strategy */
122561 int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */
122562 int nPkField; /* Number of fields in PRIMARY KEY. 1 for ROWID tables */
122563 Index *pUpIdx = 0; /* Index to which to apply the upsert */
122564 u8 isUpdate; /* True if this is an UPDATE operation */
122565 u8 bAffinityDone = 0; /* True if the OP_Affinity operation has been run */
122566 int upsertBypass = 0; /* Address of Goto to bypass upsert subroutine */
122567 int upsertJump = 0; /* Address of Goto that jumps into upsert subroutine */
122568 int ipkTop = 0; /* Top of the IPK uniqueness check */
122569 int ipkBottom = 0; /* OP_Goto at the end of the IPK uniqueness check */
122570 /* Variables associated with retesting uniqueness constraints after
122571 ** replace triggers fire have run */
122572 int regTrigCnt; /* Register used to count replace trigger invocations */
122573 int addrRecheck = 0; /* Jump here to recheck all uniqueness constraints */
122574 int lblRecheckOk = 0; /* Each recheck jumps to this label if it passes */
122575 Trigger *pTrigger; /* List of DELETE triggers on the table pTab */
122576 int nReplaceTrig = 0; /* Number of replace triggers coded */
 
122577
122578 isUpdate = regOldData!=0;
122579 db = pParse->db;
122580 v = pParse->pVdbe;
122581 assert( v!=0 );
@@ -122769,23 +123290,67 @@
122769 **
122770 ** The ordering of (2) and (3) is accomplished by making sure the linked
122771 ** list of indexes attached to a table puts all OE_Replace indexes last
122772 ** in the list. See sqlite3CreateIndex() for where that happens.
122773 */
122774
 
 
 
122775 if( pUpsert ){
122776 if( pUpsert->pUpsertTarget==0 ){
122777 /* An ON CONFLICT DO NOTHING clause, without a constraint-target.
122778 ** Make all unique constraint resolution be OE_Ignore */
122779 assert( pUpsert->pUpsertSet==0 );
122780 overrideError = OE_Ignore;
122781 pUpsert = 0;
122782 }else if( (pUpIdx = pUpsert->pUpsertIdx)!=0 ){
122783 /* If the constraint-target uniqueness check must be run first.
122784 ** Jump to that uniqueness check now */
122785 upsertJump = sqlite3VdbeAddOp0(v, OP_Goto);
122786 VdbeComment((v, "UPSERT constraint goes first"));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122787 }
122788 }
122789
122790 /* Determine if it is possible that triggers (either explicitly coded
122791 ** triggers or FK resolution actions) might run as a result of deletes
@@ -122844,15 +123409,24 @@
122844 }else if( onError==OE_Default ){
122845 onError = OE_Abort;
122846 }
122847
122848 /* figure out whether or not upsert applies in this case */
122849 if( pUpsert && pUpsert->pUpsertIdx==0 ){
122850 if( pUpsert->pUpsertSet==0 ){
122851 onError = OE_Ignore; /* DO NOTHING is the same as INSERT OR IGNORE */
122852 }else{
122853 onError = OE_Update; /* DO UPDATE */
 
 
 
 
 
 
 
 
 
122854 }
122855 }
122856
122857 /* If the response to a rowid conflict is REPLACE but the response
122858 ** to some other UNIQUE constraint is FAIL or IGNORE, then we need
@@ -122955,11 +123529,13 @@
122955 sqlite3VdbeGoto(v, ignoreDest);
122956 break;
122957 }
122958 }
122959 sqlite3VdbeResolveLabel(v, addrRowidOk);
122960 if( ipkTop ){
 
 
122961 ipkBottom = sqlite3VdbeAddOp0(v, OP_Goto);
122962 sqlite3VdbeJumpHere(v, ipkTop-1);
122963 }
122964 }
122965
@@ -122968,27 +123544,29 @@
122968 ** Compute the revised record entries for indices as we go.
122969 **
122970 ** This loop also handles the case of the PRIMARY KEY index for a
122971 ** WITHOUT ROWID table.
122972 */
122973 for(ix=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, ix++){
 
 
 
122974 int regIdx; /* Range of registers hold conent for pIdx */
122975 int regR; /* Range of registers holding conflicting PK */
122976 int iThisCur; /* Cursor for this UNIQUE index */
122977 int addrUniqueOk; /* Jump here if the UNIQUE constraint is satisfied */
122978 int addrConflictCk; /* First opcode in the conflict check logic */
122979
122980 if( aRegIdx[ix]==0 ) continue; /* Skip indices that do not change */
122981 if( pUpIdx==pIdx ){
122982 addrUniqueOk = upsertJump+1;
122983 upsertBypass = sqlite3VdbeGoto(v, 0);
122984 VdbeComment((v, "Skip upsert subroutine"));
122985 sqlite3VdbeJumpHere(v, upsertJump);
122986 }else{
122987 addrUniqueOk = sqlite3VdbeMakeLabel(pParse);
122988 }
122989 if( bAffinityDone==0 && (pUpIdx==0 || pUpIdx==pIdx) ){
122990 sqlite3TableAffinity(v, pTab, regNewData+1);
122991 bAffinityDone = 1;
122992 }
122993 VdbeNoopComment((v, "prep index %s", pIdx->zName));
122994 iThisCur = iIdxCur+ix;
@@ -123055,12 +123633,12 @@
123055 }else if( onError==OE_Default ){
123056 onError = OE_Abort;
123057 }
123058
123059 /* Figure out if the upsert clause applies to this index */
123060 if( pUpIdx==pIdx ){
123061 if( pUpsert->pUpsertSet==0 ){
123062 onError = OE_Ignore; /* DO NOTHING is the same as INSERT OR IGNORE */
123063 }else{
123064 onError = OE_Update; /* DO UPDATE */
123065 }
123066 }
@@ -123094,11 +123672,11 @@
123094 addrConflictCk =
123095 sqlite3VdbeAddOp4Int(v, OP_NoConflict, iThisCur, addrUniqueOk,
123096 regIdx, pIdx->nKeyCol); VdbeCoverage(v);
123097
123098 /* Generate code to handle collisions */
123099 regR = (pIdx==pPk) ? regIdx : sqlite3GetTempRange(pParse, nPkField);
123100 if( isUpdate || onError==OE_Replace ){
123101 if( HasRowid(pTab) ){
123102 sqlite3VdbeAddOp2(v, OP_IdxRowid, iThisCur, regR);
123103 /* Conflict only if the rowid of the existing index entry
123104 ** is different from old-rowid */
@@ -123246,17 +123824,20 @@
123246 }
123247 seenReplace = 1;
123248 break;
123249 }
123250 }
123251 if( pUpIdx==pIdx ){
123252 sqlite3VdbeGoto(v, upsertJump+1);
123253 sqlite3VdbeJumpHere(v, upsertBypass);
123254 }else{
123255 sqlite3VdbeResolveLabel(v, addrUniqueOk);
123256 }
123257 if( regR!=regIdx ) sqlite3ReleaseTempRange(pParse, regR, nPkField);
 
 
 
 
 
 
 
 
123258 }
123259
123260 /* If the IPK constraint is a REPLACE, run it last */
123261 if( ipkTop ){
123262 sqlite3VdbeGoto(v, ipkTop);
@@ -123791,10 +124372,11 @@
123791 sqlite3CodeVerifySchema(pParse, iDbSrc);
123792 iSrc = pParse->nTab++;
123793 iDest = pParse->nTab++;
123794 regAutoinc = autoIncBegin(pParse, iDbDest, pDest);
123795 regData = sqlite3GetTempReg(pParse);
 
123796 regRowid = sqlite3GetTempReg(pParse);
123797 sqlite3OpenTable(pParse, iDest, iDbDest, pDest, OP_OpenWrite);
123798 assert( HasRowid(pDest) || destHasUniqueIdx );
123799 if( (db->mDbFlags & DBFLAG_Vacuum)==0 && (
123800 (pDest->iPKey<0 && pDest->pIndex!=0) /* (1) */
@@ -123826,32 +124408,44 @@
123826 u8 insFlags;
123827 sqlite3OpenTable(pParse, iSrc, iDbSrc, pSrc, OP_OpenRead);
123828 emptySrcTest = sqlite3VdbeAddOp2(v, OP_Rewind, iSrc, 0); VdbeCoverage(v);
123829 if( pDest->iPKey>=0 ){
123830 addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
123831 sqlite3VdbeVerifyAbortable(v, onError);
123832 addr2 = sqlite3VdbeAddOp3(v, OP_NotExists, iDest, 0, regRowid);
123833 VdbeCoverage(v);
123834 sqlite3RowidConstraint(pParse, onError, pDest);
123835 sqlite3VdbeJumpHere(v, addr2);
 
 
123836 autoIncStep(pParse, regAutoinc, regRowid);
123837 }else if( pDest->pIndex==0 && !(db->mDbFlags & DBFLAG_VacuumInto) ){
123838 addr1 = sqlite3VdbeAddOp2(v, OP_NewRowid, iDest, regRowid);
123839 }else{
123840 addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
123841 assert( (pDest->tabFlags & TF_Autoincrement)==0 );
123842 }
 
123843 if( db->mDbFlags & DBFLAG_Vacuum ){
123844 sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest);
123845 insFlags = OPFLAG_APPEND|OPFLAG_USESEEKRESULT;
123846 }else{
123847 insFlags = OPFLAG_NCHANGE|OPFLAG_LASTROWID|OPFLAG_APPEND;
123848 }
123849 sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
 
 
 
 
 
 
 
 
123850 sqlite3VdbeAddOp4(v, OP_Insert, iDest, regData, regRowid,
123851 (char*)pDest, P4_TABLE);
123852 sqlite3VdbeChangeP5(v, insFlags);
 
123853 sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1); VdbeCoverage(v);
123854 sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
123855 sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
123856 }else{
123857 sqlite3TableLock(pParse, iDbDest, pDest->tnum, 1, pDest->zName);
@@ -123889,17 +124483,20 @@
123889 for(i=0; i<pSrcIdx->nColumn; i++){
123890 const char *zColl = pSrcIdx->azColl[i];
123891 if( sqlite3_stricmp(sqlite3StrBINARY, zColl) ) break;
123892 }
123893 if( i==pSrcIdx->nColumn ){
123894 idxInsFlags = OPFLAG_USESEEKRESULT;
123895 sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest);
 
123896 }
123897 }else if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){
123898 idxInsFlags |= OPFLAG_NCHANGE;
123899 }
123900 sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
 
 
123901 sqlite3VdbeAddOp2(v, OP_IdxInsert, iDest, regData);
123902 sqlite3VdbeChangeP5(v, idxInsFlags|OPFLAG_APPEND);
123903 sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1+1); VdbeCoverage(v);
123904 sqlite3VdbeJumpHere(v, addr1);
123905 sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
@@ -134009,11 +134606,11 @@
134009 sqlite3AggInfoPersistWalkerInit(&w, pParse);
134010 sqlite3WalkSelect(&w,pSub1);
134011 sqlite3SelectDelete(db, pSub1);
134012
134013 #if SELECTTRACE_ENABLED
134014 if( sqlite3_unsupported_selecttrace & 0x100 ){
134015 SELECTTRACE(0x100,pParse,p,("After flattening:\n"));
134016 sqlite3TreeViewSelect(0, p, 0);
134017 }
134018 #endif
134019
@@ -135453,11 +136050,11 @@
135453 sWalker.pParse = pParse;
135454 sWalker.xExprCallback = havingToWhereExprCb;
135455 sWalker.u.pSelect = p;
135456 sqlite3WalkExpr(&sWalker, p->pHaving);
135457 #if SELECTTRACE_ENABLED
135458 if( sWalker.eCode && (sqlite3_unsupported_selecttrace & 0x100)!=0 ){
135459 SELECTTRACE(0x100,pParse,p,("Move HAVING terms into WHERE:\n"));
135460 sqlite3TreeViewSelect(0, p, 0);
135461 }
135462 #endif
135463 }
@@ -135575,11 +136172,11 @@
135575 }
135576 p->pEList->a[0].pExpr = pExpr;
135577 p->selFlags &= ~SF_Aggregate;
135578
135579 #if SELECTTRACE_ENABLED
135580 if( sqlite3_unsupported_selecttrace & 0x400 ){
135581 SELECTTRACE(0x400,pParse,p,("After count-of-view optimization:\n"));
135582 sqlite3TreeViewSelect(0, p, 0);
135583 }
135584 #endif
135585 return 1;
@@ -135628,11 +136225,11 @@
135628 return 1;
135629 }
135630 if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
135631 #if SELECTTRACE_ENABLED
135632 SELECTTRACE(1,pParse,p, ("begin processing:\n", pParse->addrExplain));
135633 if( sqlite3_unsupported_selecttrace & 0x100 ){
135634 sqlite3TreeViewSelect(0, p, 0);
135635 }
135636 #endif
135637
135638 assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistFifo );
@@ -135653,11 +136250,11 @@
135653 if( pParse->nErr || db->mallocFailed ){
135654 goto select_end;
135655 }
135656 assert( p->pEList!=0 );
135657 #if SELECTTRACE_ENABLED
135658 if( sqlite3_unsupported_selecttrace & 0x104 ){
135659 SELECTTRACE(0x104,pParse,p, ("after name resolution:\n"));
135660 sqlite3TreeViewSelect(0, p, 0);
135661 }
135662 #endif
135663
@@ -135688,11 +136285,11 @@
135688 if( rc ){
135689 assert( db->mallocFailed || pParse->nErr>0 );
135690 goto select_end;
135691 }
135692 #if SELECTTRACE_ENABLED
135693 if( p->pWin && (sqlite3_unsupported_selecttrace & 0x108)!=0 ){
135694 SELECTTRACE(0x104,pParse,p, ("after window rewrite:\n"));
135695 sqlite3TreeViewSelect(0, p, 0);
135696 }
135697 #endif
135698 #endif /* SQLITE_OMIT_WINDOWFUNC */
@@ -135795,11 +136392,11 @@
135795 */
135796 if( p->pPrior ){
135797 rc = multiSelect(pParse, p, pDest);
135798 #if SELECTTRACE_ENABLED
135799 SELECTTRACE(0x1,pParse,p,("end compound-select processing\n"));
135800 if( (sqlite3_unsupported_selecttrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
135801 sqlite3TreeViewSelect(0, p, 0);
135802 }
135803 #endif
135804 if( p->pNext==0 ) ExplainQueryPlanPop(pParse);
135805 return rc;
@@ -135814,11 +136411,11 @@
135814 if( pTabList->nSrc>1
135815 && OptimizationEnabled(db, SQLITE_PropagateConst)
135816 && propagateConstants(pParse, p)
135817 ){
135818 #if SELECTTRACE_ENABLED
135819 if( sqlite3_unsupported_selecttrace & 0x100 ){
135820 SELECTTRACE(0x100,pParse,p,("After constant propagation:\n"));
135821 sqlite3TreeViewSelect(0, p, 0);
135822 }
135823 #endif
135824 }else{
@@ -135902,11 +136499,11 @@
135902 if( OptimizationEnabled(db, SQLITE_PushDown)
135903 && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
135904 (pItem->fg.jointype & JT_OUTER)!=0)
135905 ){
135906 #if SELECTTRACE_ENABLED
135907 if( sqlite3_unsupported_selecttrace & 0x100 ){
135908 SELECTTRACE(0x100,pParse,p,
135909 ("After WHERE-clause push-down into subquery %d:\n", pSub->selId));
135910 sqlite3TreeViewSelect(0, p, 0);
135911 }
135912 #endif
@@ -136002,11 +136599,11 @@
136002 pGroupBy = p->pGroupBy;
136003 pHaving = p->pHaving;
136004 sDistinct.isTnct = (p->selFlags & SF_Distinct)!=0;
136005
136006 #if SELECTTRACE_ENABLED
136007 if( sqlite3_unsupported_selecttrace & 0x400 ){
136008 SELECTTRACE(0x400,pParse,p,("After all FROM-clause analysis:\n"));
136009 sqlite3TreeViewSelect(0, p, 0);
136010 }
136011 #endif
136012
@@ -136038,11 +136635,11 @@
136038 ** the sDistinct.isTnct is still set. Hence, isTnct represents the
136039 ** original setting of the SF_Distinct flag, not the current setting */
136040 assert( sDistinct.isTnct );
136041
136042 #if SELECTTRACE_ENABLED
136043 if( sqlite3_unsupported_selecttrace & 0x400 ){
136044 SELECTTRACE(0x400,pParse,p,("Transform DISTINCT into GROUP BY:\n"));
136045 sqlite3TreeViewSelect(0, p, 0);
136046 }
136047 #endif
136048 }
@@ -136286,11 +136883,11 @@
136286 sNC.ncFlags &= ~NC_InAggFunc;
136287 }
136288 pAggInfo->mxReg = pParse->nMem;
136289 if( db->mallocFailed ) goto select_end;
136290 #if SELECTTRACE_ENABLED
136291 if( sqlite3_unsupported_selecttrace & 0x400 ){
136292 int ii;
136293 SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", pAggInfo));
136294 sqlite3TreeViewSelect(0, p, 0);
136295 for(ii=0; ii<pAggInfo->nColumn; ii++){
136296 sqlite3DebugPrintf("agg-column[%d] iMem=%d\n",
@@ -136705,11 +137302,11 @@
136705 }
136706 #endif
136707
136708 #if SELECTTRACE_ENABLED
136709 SELECTTRACE(0x1,pParse,p,("end processing\n"));
136710 if( (sqlite3_unsupported_selecttrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
136711 sqlite3TreeViewSelect(0, p, 0);
136712 }
136713 #endif
136714 ExplainQueryPlanPop(pParse);
136715 return rc;
@@ -139476,19 +140073,26 @@
139476
139477 #ifndef SQLITE_OMIT_UPSERT
139478 /*
139479 ** Free a list of Upsert objects
139480 */
139481 SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3 *db, Upsert *p){
139482 if( p ){
 
139483 sqlite3ExprListDelete(db, p->pUpsertTarget);
139484 sqlite3ExprDelete(db, p->pUpsertTargetWhere);
139485 sqlite3ExprListDelete(db, p->pUpsertSet);
139486 sqlite3ExprDelete(db, p->pUpsertWhere);
 
139487 sqlite3DbFree(db, p);
139488 }
 
139489 }
 
 
 
 
139490
139491 /*
139492 ** Duplicate an Upsert object.
139493 */
139494 SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3 *db, Upsert *p){
@@ -139495,11 +140099,12 @@
139495 if( p==0 ) return 0;
139496 return sqlite3UpsertNew(db,
139497 sqlite3ExprListDup(db, p->pUpsertTarget, 0),
139498 sqlite3ExprDup(db, p->pUpsertTargetWhere, 0),
139499 sqlite3ExprListDup(db, p->pUpsertSet, 0),
139500 sqlite3ExprDup(db, p->pUpsertWhere, 0)
 
139501 );
139502 }
139503
139504 /*
139505 ** Create a new Upsert object.
@@ -139507,26 +140112,29 @@
139507 SQLITE_PRIVATE Upsert *sqlite3UpsertNew(
139508 sqlite3 *db, /* Determines which memory allocator to use */
139509 ExprList *pTarget, /* Target argument to ON CONFLICT, or NULL */
139510 Expr *pTargetWhere, /* Optional WHERE clause on the target */
139511 ExprList *pSet, /* UPDATE columns, or NULL for a DO NOTHING */
139512 Expr *pWhere /* WHERE clause for the ON CONFLICT UPDATE */
 
139513 ){
139514 Upsert *pNew;
139515 pNew = sqlite3DbMallocRaw(db, sizeof(Upsert));
139516 if( pNew==0 ){
139517 sqlite3ExprListDelete(db, pTarget);
139518 sqlite3ExprDelete(db, pTargetWhere);
139519 sqlite3ExprListDelete(db, pSet);
139520 sqlite3ExprDelete(db, pWhere);
 
139521 return 0;
139522 }else{
139523 pNew->pUpsertTarget = pTarget;
139524 pNew->pUpsertTargetWhere = pTargetWhere;
139525 pNew->pUpsertSet = pSet;
139526 pNew->pUpsertWhere = pWhere;
139527 pNew->pUpsertIdx = 0;
 
139528 }
139529 return pNew;
139530 }
139531
139532 /*
@@ -139547,10 +140155,11 @@
139547 Index *pIdx; /* One of the indexes of pTab */
139548 ExprList *pTarget; /* The conflict-target clause */
139549 Expr *pTerm; /* One term of the conflict-target clause */
139550 NameContext sNC; /* Context for resolving symbolic names */
139551 Expr sCol[2]; /* Index column converted into an Expr */
 
139552
139553 assert( pTabList->nSrc==1 );
139554 assert( pTabList->a[0].pTab!=0 );
139555 assert( pUpsert!=0 );
139556 assert( pUpsert->pUpsertTarget!=0 );
@@ -139560,91 +140169,135 @@
139560 ** WHERE clause.
139561 */
139562 memset(&sNC, 0, sizeof(sNC));
139563 sNC.pParse = pParse;
139564 sNC.pSrcList = pTabList;
139565 rc = sqlite3ResolveExprListNames(&sNC, pUpsert->pUpsertTarget);
139566 if( rc ) return rc;
139567 rc = sqlite3ResolveExprNames(&sNC, pUpsert->pUpsertTargetWhere);
139568 if( rc ) return rc;
139569
139570 /* Check to see if the conflict target matches the rowid. */
139571 pTab = pTabList->a[0].pTab;
139572 pTarget = pUpsert->pUpsertTarget;
139573 iCursor = pTabList->a[0].iCursor;
139574 if( HasRowid(pTab)
139575 && pTarget->nExpr==1
139576 && (pTerm = pTarget->a[0].pExpr)->op==TK_COLUMN
139577 && pTerm->iColumn==XN_ROWID
139578 ){
139579 /* The conflict-target is the rowid of the primary table */
139580 assert( pUpsert->pUpsertIdx==0 );
139581 return SQLITE_OK;
139582 }
139583
139584 /* Initialize sCol[0..1] to be an expression parse tree for a
139585 ** single column of an index. The sCol[0] node will be the TK_COLLATE
139586 ** operator and sCol[1] will be the TK_COLUMN operator. Code below
139587 ** will populate the specific collation and column number values
139588 ** prior to comparing against the conflict-target expression.
139589 */
139590 memset(sCol, 0, sizeof(sCol));
139591 sCol[0].op = TK_COLLATE;
139592 sCol[0].pLeft = &sCol[1];
139593 sCol[1].op = TK_COLUMN;
139594 sCol[1].iTable = pTabList->a[0].iCursor;
139595
139596 /* Check for matches against other indexes */
139597 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
139598 int ii, jj, nn;
139599 if( !IsUniqueIndex(pIdx) ) continue;
139600 if( pTarget->nExpr!=pIdx->nKeyCol ) continue;
139601 if( pIdx->pPartIdxWhere ){
139602 if( pUpsert->pUpsertTargetWhere==0 ) continue;
139603 if( sqlite3ExprCompare(pParse, pUpsert->pUpsertTargetWhere,
139604 pIdx->pPartIdxWhere, iCursor)!=0 ){
139605 continue;
139606 }
139607 }
139608 nn = pIdx->nKeyCol;
139609 for(ii=0; ii<nn; ii++){
139610 Expr *pExpr;
139611 sCol[0].u.zToken = (char*)pIdx->azColl[ii];
139612 if( pIdx->aiColumn[ii]==XN_EXPR ){
139613 assert( pIdx->aColExpr!=0 );
139614 assert( pIdx->aColExpr->nExpr>ii );
139615 pExpr = pIdx->aColExpr->a[ii].pExpr;
139616 if( pExpr->op!=TK_COLLATE ){
139617 sCol[0].pLeft = pExpr;
139618 pExpr = &sCol[0];
139619 }
139620 }else{
139621 sCol[0].pLeft = &sCol[1];
139622 sCol[1].iColumn = pIdx->aiColumn[ii];
139623 pExpr = &sCol[0];
139624 }
139625 for(jj=0; jj<nn; jj++){
139626 if( sqlite3ExprCompare(pParse, pTarget->a[jj].pExpr, pExpr,iCursor)<2 ){
139627 break; /* Column ii of the index matches column jj of target */
139628 }
139629 }
139630 if( jj>=nn ){
139631 /* The target contains no match for column jj of the index */
139632 break;
139633 }
139634 }
139635 if( ii<nn ){
139636 /* Column ii of the index did not match any term of the conflict target.
139637 ** Continue the search with the next index. */
139638 continue;
139639 }
139640 pUpsert->pUpsertIdx = pIdx;
139641 return SQLITE_OK;
139642 }
139643 sqlite3ErrorMsg(pParse, "ON CONFLICT clause does not match any "
139644 "PRIMARY KEY or UNIQUE constraint");
139645 return SQLITE_ERROR;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139646 }
139647
139648 /*
139649 ** Generate bytecode that does an UPDATE as part of an upsert.
139650 **
@@ -139664,15 +140317,17 @@
139664 Vdbe *v = pParse->pVdbe;
139665 sqlite3 *db = pParse->db;
139666 SrcList *pSrc; /* FROM clause for the UPDATE */
139667 int iDataCur;
139668 int i;
 
139669
139670 assert( v!=0 );
139671 assert( pUpsert!=0 );
139672 VdbeNoopComment((v, "Begin DO UPDATE of UPSERT"));
139673 iDataCur = pUpsert->iDataCur;
 
 
139674 if( pIdx && iCur!=iDataCur ){
139675 if( HasRowid(pTab) ){
139676 int regRowid = sqlite3GetTempReg(pParse);
139677 sqlite3VdbeAddOp2(v, OP_IdxRowid, iCur, regRowid);
139678 sqlite3VdbeAddOp3(v, OP_SeekRowid, iDataCur, 0, regRowid);
@@ -139698,23 +140353,21 @@
139698 "corrupt database", P4_STATIC);
139699 sqlite3MayAbort(pParse);
139700 sqlite3VdbeJumpHere(v, i);
139701 }
139702 }
139703 /* pUpsert does not own pUpsertSrc - the outer INSERT statement does. So
139704 ** we have to make a copy before passing it down into sqlite3Update() */
139705 pSrc = sqlite3SrcListDup(db, pUpsert->pUpsertSrc, 0);
139706 /* excluded.* columns of type REAL need to be converted to a hard real */
139707 for(i=0; i<pTab->nCol; i++){
139708 if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){
139709 sqlite3VdbeAddOp1(v, OP_RealAffinity, pUpsert->regData+i);
139710 }
139711 }
139712 sqlite3Update(pParse, pSrc, pUpsert->pUpsertSet,
139713 pUpsert->pUpsertWhere, OE_Abort, 0, 0, pUpsert);
139714 pUpsert->pUpsertSet = 0; /* Will have been deleted by sqlite3Update() */
139715 pUpsert->pUpsertWhere = 0; /* Will have been deleted by sqlite3Update() */
139716 VdbeNoopComment((v, "End DO UPDATE of UPSERT"));
139717 }
139718
139719 #endif /* SQLITE_OMIT_UPSERT */
139720
@@ -141487,23 +142140,10 @@
141487 ** a separate source file for easier editing.
141488 */
141489 #ifndef SQLITE_WHEREINT_H
141490 #define SQLITE_WHEREINT_H
141491
141492 /*
141493 ** Trace output macros
141494 */
141495 #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
141496 /***/ extern int sqlite3WhereTrace;
141497 #endif
141498 #if defined(SQLITE_DEBUG) \
141499 && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_WHERETRACE))
141500 # define WHERETRACE(K,X) if(sqlite3WhereTrace&(K)) sqlite3DebugPrintf X
141501 # define WHERETRACE_ENABLED 1
141502 #else
141503 # define WHERETRACE(K,X)
141504 #endif
141505
141506 /* Forward references
141507 */
141508 typedef struct WhereClause WhereClause;
141509 typedef struct WhereMaskSet WhereMaskSet;
@@ -146219,16 +146859,10 @@
146219 Parse *pParse; /* The parsing context */
146220 };
146221
146222 /* Forward declaration of methods */
146223 static int whereLoopResize(sqlite3*, WhereLoop*, int);
146224
146225 /* Test variable that can be set to enable WHERE tracing */
146226 #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
146227 /***/ int sqlite3WhereTrace = 0;
146228 #endif
146229
146230
146231 /*
146232 ** Return the estimated number of output rows from a WHERE clause
146233 */
146234 SQLITE_PRIVATE LogEst sqlite3WhereOutputRowCount(WhereInfo *pWInfo){
@@ -155319,22 +155953,22 @@
155319 #define sqlite3ParserCTX_PDECL ,Parse *pParse
155320 #define sqlite3ParserCTX_PARAM ,pParse
155321 #define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
155322 #define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
155323 #define YYFALLBACK 1
155324 #define YYNSTATE 553
155325 #define YYNRULE 385
155326 #define YYNRULE_WITH_ACTION 325
155327 #define YYNTOKEN 181
155328 #define YY_MAX_SHIFT 552
155329 #define YY_MIN_SHIFTREDUCE 803
155330 #define YY_MAX_SHIFTREDUCE 1187
155331 #define YY_ERROR_ACTION 1188
155332 #define YY_ACCEPT_ACTION 1189
155333 #define YY_NO_ACTION 1190
155334 #define YY_MIN_REDUCE 1191
155335 #define YY_MAX_REDUCE 1575
155336 /************* End control #defines *******************************************/
155337 #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
155338
155339 /* Define the yytestcase() macro to be a no-op if is not already defined
155340 ** otherwise.
@@ -155397,209 +156031,209 @@
155397 ** yy_reduce_ofst[] For each state, the offset into yy_action for
155398 ** shifting non-terminals after a reduce.
155399 ** yy_default[] Default action for each state.
155400 **
155401 *********** Begin parsing tables **********************************************/
155402 #define YY_ACTTAB_COUNT (1962)
155403 static const YYACTIONTYPE yy_action[] = {
155404 /* 0 */ 546, 1222, 546, 451, 1260, 546, 1239, 546, 114, 111,
155405 /* 10 */ 211, 546, 1537, 546, 1260, 523, 114, 111, 211, 392,
155406 /* 20 */ 1232, 344, 42, 42, 42, 42, 1225, 42, 42, 71,
155407 /* 30 */ 71, 937, 1224, 71, 71, 71, 71, 1462, 1493, 938,
155408 /* 40 */ 820, 453, 6, 121, 122, 112, 1165, 1165, 1006, 1009,
155409 /* 50 */ 999, 999, 119, 119, 120, 120, 120, 120, 1543, 392,
155410 /* 60 */ 1358, 1517, 552, 2, 1193, 194, 528, 436, 143, 291,
155411 /* 70 */ 528, 136, 528, 371, 261, 504, 272, 385, 1273, 527,
155412 /* 80 */ 503, 493, 164, 121, 122, 112, 1165, 1165, 1006, 1009,
155413 /* 90 */ 999, 999, 119, 119, 120, 120, 120, 120, 1358, 442,
155414 /* 100 */ 1514, 118, 118, 118, 118, 117, 117, 116, 116, 116,
155415 /* 110 */ 115, 424, 266, 266, 266, 266, 1498, 358, 1500, 435,
155416 /* 120 */ 357, 1498, 517, 524, 1485, 543, 1114, 543, 1114, 392,
155417 /* 130 */ 405, 241, 208, 114, 111, 211, 98, 290, 537, 221,
155418 /* 140 */ 1029, 118, 118, 118, 118, 117, 117, 116, 116, 116,
155419 /* 150 */ 115, 424, 1142, 121, 122, 112, 1165, 1165, 1006, 1009,
155420 /* 160 */ 999, 999, 119, 119, 120, 120, 120, 120, 406, 428,
155421 /* 170 */ 117, 117, 116, 116, 116, 115, 424, 1418, 468, 123,
155422 /* 180 */ 118, 118, 118, 118, 117, 117, 116, 116, 116, 115,
155423 /* 190 */ 424, 116, 116, 116, 115, 424, 540, 540, 540, 392,
155424 /* 200 */ 505, 120, 120, 120, 120, 113, 1051, 1142, 1143, 1144,
155425 /* 210 */ 1051, 118, 118, 118, 118, 117, 117, 116, 116, 116,
155426 /* 220 */ 115, 424, 1461, 121, 122, 112, 1165, 1165, 1006, 1009,
155427 /* 230 */ 999, 999, 119, 119, 120, 120, 120, 120, 392, 444,
155428 /* 240 */ 316, 83, 463, 81, 359, 382, 1142, 80, 118, 118,
155429 /* 250 */ 118, 118, 117, 117, 116, 116, 116, 115, 424, 179,
155430 /* 260 */ 434, 424, 121, 122, 112, 1165, 1165, 1006, 1009, 999,
155431 /* 270 */ 999, 119, 119, 120, 120, 120, 120, 434, 433, 266,
155432 /* 280 */ 266, 118, 118, 118, 118, 117, 117, 116, 116, 116,
155433 /* 290 */ 115, 424, 543, 1109, 903, 506, 1142, 114, 111, 211,
155434 /* 300 */ 1431, 1142, 1143, 1144, 206, 491, 1109, 392, 449, 1109,
155435 /* 310 */ 545, 330, 120, 120, 120, 120, 298, 1431, 1433, 17,
155436 /* 320 */ 118, 118, 118, 118, 117, 117, 116, 116, 116, 115,
155437 /* 330 */ 424, 121, 122, 112, 1165, 1165, 1006, 1009, 999, 999,
155438 /* 340 */ 119, 119, 120, 120, 120, 120, 392, 1358, 434, 1142,
155439 /* 350 */ 482, 1142, 1143, 1144, 996, 996, 1007, 1010, 445, 118,
155440 /* 360 */ 118, 118, 118, 117, 117, 116, 116, 116, 115, 424,
155441 /* 370 */ 121, 122, 112, 1165, 1165, 1006, 1009, 999, 999, 119,
155442 /* 380 */ 119, 120, 120, 120, 120, 1054, 1054, 465, 1431, 118,
155443 /* 390 */ 118, 118, 118, 117, 117, 116, 116, 116, 115, 424,
155444 /* 400 */ 1142, 451, 546, 1426, 1142, 1143, 1144, 233, 966, 1142,
155445 /* 410 */ 481, 478, 477, 171, 360, 392, 164, 407, 414, 842,
155446 /* 420 */ 476, 164, 185, 334, 71, 71, 1243, 1000, 118, 118,
155447 /* 430 */ 118, 118, 117, 117, 116, 116, 116, 115, 424, 121,
155448 /* 440 */ 122, 112, 1165, 1165, 1006, 1009, 999, 999, 119, 119,
155449 /* 450 */ 120, 120, 120, 120, 392, 1142, 1143, 1144, 835, 12,
155450 /* 460 */ 314, 509, 163, 356, 1142, 1143, 1144, 114, 111, 211,
155451 /* 470 */ 508, 290, 537, 546, 276, 180, 290, 537, 121, 122,
155452 /* 480 */ 112, 1165, 1165, 1006, 1009, 999, 999, 119, 119, 120,
155453 /* 490 */ 120, 120, 120, 345, 484, 71, 71, 118, 118, 118,
155454 /* 500 */ 118, 117, 117, 116, 116, 116, 115, 424, 1142, 209,
155455 /* 510 */ 411, 523, 1142, 1109, 1571, 378, 252, 269, 342, 487,
155456 /* 520 */ 337, 486, 238, 392, 513, 364, 1109, 1127, 333, 1109,
155457 /* 530 */ 191, 409, 286, 32, 457, 443, 118, 118, 118, 118,
155458 /* 540 */ 117, 117, 116, 116, 116, 115, 424, 121, 122, 112,
155459 /* 550 */ 1165, 1165, 1006, 1009, 999, 999, 119, 119, 120, 120,
155460 /* 560 */ 120, 120, 392, 1142, 1143, 1144, 987, 1142, 1143, 1144,
155461 /* 570 */ 1142, 233, 492, 1492, 481, 478, 477, 6, 163, 546,
155462 /* 580 */ 512, 546, 115, 424, 476, 5, 121, 122, 112, 1165,
155463 /* 590 */ 1165, 1006, 1009, 999, 999, 119, 119, 120, 120, 120,
155464 /* 600 */ 120, 13, 13, 13, 13, 118, 118, 118, 118, 117,
155465 /* 610 */ 117, 116, 116, 116, 115, 424, 403, 502, 408, 546,
155466 /* 620 */ 1486, 544, 1142, 892, 892, 1142, 1143, 1144, 1473, 1142,
155467 /* 630 */ 275, 392, 808, 809, 810, 971, 422, 422, 422, 16,
155468 /* 640 */ 16, 55, 55, 1242, 118, 118, 118, 118, 117, 117,
155469 /* 650 */ 116, 116, 116, 115, 424, 121, 122, 112, 1165, 1165,
155470 /* 660 */ 1006, 1009, 999, 999, 119, 119, 120, 120, 120, 120,
155471 /* 670 */ 392, 1189, 1, 1, 552, 2, 1193, 1142, 1143, 1144,
155472 /* 680 */ 194, 291, 898, 136, 1142, 1143, 1144, 897, 521, 1492,
155473 /* 690 */ 1273, 3, 380, 6, 121, 122, 112, 1165, 1165, 1006,
155474 /* 700 */ 1009, 999, 999, 119, 119, 120, 120, 120, 120, 858,
155475 /* 710 */ 546, 924, 546, 118, 118, 118, 118, 117, 117, 116,
155476 /* 720 */ 116, 116, 115, 424, 266, 266, 1092, 1569, 1142, 551,
155477 /* 730 */ 1569, 1193, 13, 13, 13, 13, 291, 543, 136, 392,
155478 /* 740 */ 485, 421, 420, 966, 344, 1273, 468, 410, 859, 279,
155479 /* 750 */ 140, 221, 118, 118, 118, 118, 117, 117, 116, 116,
155480 /* 760 */ 116, 115, 424, 121, 122, 112, 1165, 1165, 1006, 1009,
155481 /* 770 */ 999, 999, 119, 119, 120, 120, 120, 120, 546, 266,
155482 /* 780 */ 266, 428, 392, 1142, 1143, 1144, 1172, 830, 1172, 468,
155483 /* 790 */ 431, 145, 543, 1146, 401, 314, 439, 302, 838, 1490,
155484 /* 800 */ 71, 71, 412, 6, 1090, 473, 221, 100, 112, 1165,
155485 /* 810 */ 1165, 1006, 1009, 999, 999, 119, 119, 120, 120, 120,
155486 /* 820 */ 120, 118, 118, 118, 118, 117, 117, 116, 116, 116,
155487 /* 830 */ 115, 424, 237, 1425, 546, 451, 428, 287, 986, 546,
155488 /* 840 */ 236, 235, 234, 830, 97, 529, 429, 1265, 1265, 1146,
155489 /* 850 */ 494, 307, 430, 838, 977, 546, 71, 71, 976, 1241,
155490 /* 860 */ 546, 51, 51, 300, 118, 118, 118, 118, 117, 117,
155491 /* 870 */ 116, 116, 116, 115, 424, 194, 103, 70, 70, 266,
155492 /* 880 */ 266, 546, 71, 71, 266, 266, 30, 391, 344, 976,
155493 /* 890 */ 976, 978, 543, 528, 1109, 328, 392, 543, 495, 397,
155494 /* 900 */ 1470, 195, 530, 13, 13, 1358, 240, 1109, 277, 280,
155495 /* 910 */ 1109, 280, 304, 457, 306, 333, 392, 31, 188, 419,
155496 /* 920 */ 121, 122, 112, 1165, 1165, 1006, 1009, 999, 999, 119,
155497 /* 930 */ 119, 120, 120, 120, 120, 142, 392, 365, 457, 986,
155498 /* 940 */ 121, 122, 112, 1165, 1165, 1006, 1009, 999, 999, 119,
155499 /* 950 */ 119, 120, 120, 120, 120, 977, 323, 1142, 326, 976,
155500 /* 960 */ 121, 110, 112, 1165, 1165, 1006, 1009, 999, 999, 119,
155501 /* 970 */ 119, 120, 120, 120, 120, 464, 377, 1185, 118, 118,
155502 /* 980 */ 118, 118, 117, 117, 116, 116, 116, 115, 424, 1142,
155503 /* 990 */ 976, 976, 978, 305, 9, 366, 244, 362, 118, 118,
155504 /* 1000 */ 118, 118, 117, 117, 116, 116, 116, 115, 424, 313,
155505 /* 1010 */ 546, 344, 1142, 1143, 1144, 299, 290, 537, 118, 118,
155506 /* 1020 */ 118, 118, 117, 117, 116, 116, 116, 115, 424, 1263,
155507 /* 1030 */ 1263, 1163, 13, 13, 278, 421, 420, 468, 392, 923,
155508 /* 1040 */ 260, 260, 289, 1169, 1142, 1143, 1144, 189, 1171, 266,
155509 /* 1050 */ 266, 468, 390, 543, 1186, 546, 1170, 263, 144, 489,
155510 /* 1060 */ 922, 546, 543, 122, 112, 1165, 1165, 1006, 1009, 999,
155511 /* 1070 */ 999, 119, 119, 120, 120, 120, 120, 71, 71, 1142,
155512 /* 1080 */ 1172, 1272, 1172, 13, 13, 898, 1070, 1163, 546, 468,
155513 /* 1090 */ 897, 107, 538, 1491, 4, 1268, 1109, 6, 525, 1049,
155514 /* 1100 */ 12, 1071, 1092, 1570, 312, 455, 1570, 520, 541, 1109,
155515 /* 1110 */ 56, 56, 1109, 1489, 423, 1358, 1072, 6, 345, 285,
155516 /* 1120 */ 118, 118, 118, 118, 117, 117, 116, 116, 116, 115,
155517 /* 1130 */ 424, 425, 1271, 321, 1142, 1143, 1144, 878, 266, 266,
155518 /* 1140 */ 1277, 107, 538, 535, 4, 1488, 293, 879, 1211, 6,
155519 /* 1150 */ 210, 543, 543, 164, 294, 496, 416, 204, 541, 267,
155520 /* 1160 */ 267, 1214, 398, 511, 499, 204, 266, 266, 396, 531,
155521 /* 1170 */ 8, 986, 543, 519, 546, 922, 458, 105, 105, 543,
155522 /* 1180 */ 1090, 425, 266, 266, 106, 417, 425, 548, 547, 266,
155523 /* 1190 */ 266, 976, 518, 535, 1373, 543, 15, 15, 266, 266,
155524 /* 1200 */ 456, 1120, 543, 266, 266, 1070, 1372, 515, 290, 537,
155525 /* 1210 */ 546, 543, 514, 97, 444, 316, 543, 546, 922, 125,
155526 /* 1220 */ 1071, 986, 976, 976, 978, 979, 27, 105, 105, 401,
155527 /* 1230 */ 343, 1511, 44, 44, 106, 1072, 425, 548, 547, 57,
155528 /* 1240 */ 57, 976, 343, 1511, 107, 538, 546, 4, 462, 401,
155529 /* 1250 */ 214, 1120, 459, 297, 377, 1091, 534, 1309, 546, 539,
155530 /* 1260 */ 398, 541, 290, 537, 104, 244, 102, 526, 58, 58,
155531 /* 1270 */ 546, 199, 976, 976, 978, 979, 27, 1516, 1131, 427,
155532 /* 1280 */ 59, 59, 270, 237, 425, 138, 95, 375, 375, 374,
155533 /* 1290 */ 255, 372, 60, 60, 817, 1180, 535, 546, 273, 546,
155534 /* 1300 */ 1163, 1308, 389, 388, 546, 438, 546, 215, 210, 296,
155535 /* 1310 */ 515, 849, 546, 265, 208, 516, 1476, 295, 274, 61,
155536 /* 1320 */ 61, 62, 62, 308, 986, 109, 45, 45, 46, 46,
155537 /* 1330 */ 105, 105, 1186, 922, 47, 47, 341, 106, 546, 425,
155538 /* 1340 */ 548, 547, 1542, 546, 976, 867, 340, 217, 546, 937,
155539 /* 1350 */ 397, 107, 538, 218, 4, 156, 1163, 938, 158, 546,
155540 /* 1360 */ 49, 49, 1162, 546, 268, 50, 50, 546, 541, 1450,
155541 /* 1370 */ 63, 63, 546, 1449, 216, 976, 976, 978, 979, 27,
155542 /* 1380 */ 446, 64, 64, 546, 460, 65, 65, 546, 318, 14,
155543 /* 1390 */ 14, 425, 1305, 546, 66, 66, 1087, 546, 141, 379,
155544 /* 1400 */ 38, 546, 963, 535, 322, 127, 127, 546, 393, 67,
155545 /* 1410 */ 67, 546, 325, 290, 537, 52, 52, 515, 546, 68,
155546 /* 1420 */ 68, 845, 514, 69, 69, 399, 165, 857, 856, 53,
155547 /* 1430 */ 53, 986, 311, 151, 151, 97, 432, 105, 105, 327,
155548 /* 1440 */ 152, 152, 526, 1048, 106, 1048, 425, 548, 547, 1131,
155549 /* 1450 */ 427, 976, 1032, 270, 968, 239, 329, 243, 375, 375,
155550 /* 1460 */ 374, 255, 372, 940, 941, 817, 1296, 546, 220, 546,
155551 /* 1470 */ 107, 538, 546, 4, 546, 1256, 199, 845, 215, 1036,
155552 /* 1480 */ 296, 1530, 976, 976, 978, 979, 27, 541, 295, 76,
155553 /* 1490 */ 76, 54, 54, 980, 72, 72, 128, 128, 864, 865,
155554 /* 1500 */ 107, 538, 546, 4, 1047, 546, 1047, 533, 469, 546,
155555 /* 1510 */ 425, 546, 450, 1240, 546, 243, 546, 541, 217, 546,
155556 /* 1520 */ 452, 197, 535, 243, 73, 73, 156, 129, 129, 158,
155557 /* 1530 */ 336, 130, 130, 126, 126, 1036, 150, 150, 149, 149,
155558 /* 1540 */ 425, 134, 134, 317, 474, 216, 97, 239, 331, 980,
155559 /* 1550 */ 986, 97, 535, 346, 347, 546, 105, 105, 902, 931,
155560 /* 1560 */ 546, 895, 243, 106, 109, 425, 548, 547, 546, 1505,
155561 /* 1570 */ 976, 828, 99, 538, 139, 4, 546, 133, 133, 393,
155562 /* 1580 */ 986, 1317, 131, 131, 290, 537, 105, 105, 1357, 541,
155563 /* 1590 */ 132, 132, 1292, 106, 1303, 425, 548, 547, 75, 75,
155564 /* 1600 */ 976, 976, 976, 978, 979, 27, 546, 432, 896, 1289,
155565 /* 1610 */ 532, 109, 425, 1363, 546, 1221, 1213, 1202, 258, 546,
155566 /* 1620 */ 349, 546, 1201, 11, 535, 1203, 1524, 351, 77, 77,
155567 /* 1630 */ 376, 976, 976, 978, 979, 27, 74, 74, 353, 213,
155568 /* 1640 */ 301, 43, 43, 48, 48, 437, 310, 201, 303, 1350,
155569 /* 1650 */ 315, 355, 986, 454, 479, 1239, 339, 192, 105, 105,
155570 /* 1660 */ 1422, 1421, 193, 536, 205, 106, 1527, 425, 548, 547,
155571 /* 1670 */ 1180, 167, 976, 270, 247, 1469, 1467, 1177, 375, 375,
155572 /* 1680 */ 374, 255, 372, 200, 369, 817, 400, 83, 79, 82,
155573 /* 1690 */ 1427, 448, 177, 95, 1342, 161, 169, 1339, 215, 440,
155574 /* 1700 */ 296, 172, 173, 976, 976, 978, 979, 27, 295, 174,
155575 /* 1710 */ 175, 441, 472, 223, 1347, 383, 35, 381, 36, 461,
155576 /* 1720 */ 88, 1353, 181, 447, 384, 1416, 227, 467, 259, 229,
155577 /* 1730 */ 186, 488, 470, 324, 1250, 230, 231, 320, 217, 1204,
155578 /* 1740 */ 1438, 1259, 386, 1258, 413, 90, 156, 849, 1541, 158,
155579 /* 1750 */ 206, 415, 1540, 507, 1300, 1257, 94, 348, 1229, 1301,
155580 /* 1760 */ 387, 1510, 1228, 338, 1227, 216, 350, 1539, 498, 283,
155581 /* 1770 */ 284, 1249, 501, 1299, 352, 245, 246, 418, 1298, 354,
155582 /* 1780 */ 1496, 1495, 124, 10, 526, 363, 101, 1324, 253, 96,
155583 /* 1790 */ 510, 1210, 34, 549, 1137, 254, 256, 257, 166, 393,
155584 /* 1800 */ 550, 1199, 1282, 361, 290, 537, 1281, 196, 367, 368,
155585 /* 1810 */ 1194, 153, 1454, 137, 281, 1323, 1455, 804, 154, 426,
155586 /* 1820 */ 198, 155, 1453, 1452, 292, 212, 202, 432, 1402, 203,
155587 /* 1830 */ 271, 135, 288, 78, 1046, 1044, 960, 168, 157, 881,
155588 /* 1840 */ 170, 219, 309, 222, 1060, 176, 964, 159, 402, 84,
155589 /* 1850 */ 178, 404, 85, 86, 87, 160, 1063, 224, 394, 395,
155590 /* 1860 */ 225, 1059, 146, 18, 226, 319, 243, 1174, 466, 228,
155591 /* 1870 */ 1052, 182, 183, 37, 819, 471, 340, 232, 332, 483,
155592 /* 1880 */ 184, 89, 162, 19, 20, 475, 91, 480, 847, 335,
155593 /* 1890 */ 147, 860, 282, 92, 490, 93, 1125, 148, 1012, 1095,
155594 /* 1900 */ 39, 497, 1096, 40, 500, 262, 207, 264, 930, 187,
155595 /* 1910 */ 925, 109, 1111, 1115, 1113, 7, 1099, 242, 33, 1119,
155596 /* 1920 */ 21, 522, 22, 23, 24, 1118, 25, 190, 97, 26,
155597 /* 1930 */ 1027, 1013, 1011, 1015, 1069, 1016, 1068, 249, 248, 28,
155598 /* 1940 */ 41, 891, 981, 829, 108, 29, 250, 542, 251, 370,
155599 /* 1950 */ 373, 1133, 1132, 1190, 1190, 1190, 1190, 1190, 1190, 1190,
155600 /* 1960 */ 1532, 1531,
155601 };
155602 static const YYCODETYPE yy_lookahead[] = {
155603 /* 0 */ 189, 211, 189, 189, 218, 189, 220, 189, 267, 268,
155604 /* 10 */ 269, 189, 210, 189, 228, 189, 267, 268, 269, 19,
155605 /* 20 */ 218, 189, 211, 212, 211, 212, 211, 211, 212, 211,
@@ -155688,117 +156322,117 @@
155688 /* 850 */ 200, 16, 189, 114, 115, 189, 211, 212, 119, 221,
155689 /* 860 */ 189, 211, 212, 258, 101, 102, 103, 104, 105, 106,
155690 /* 870 */ 107, 108, 109, 110, 111, 189, 156, 211, 212, 234,
155691 /* 880 */ 235, 189, 211, 212, 234, 235, 22, 201, 189, 150,
155692 /* 890 */ 151, 152, 247, 248, 76, 16, 19, 247, 248, 113,
155693 /* 900 */ 189, 24, 257, 211, 212, 189, 26, 89, 262, 223,
155694 /* 910 */ 92, 225, 77, 189, 79, 129, 19, 53, 226, 248,
155695 /* 920 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
155696 /* 930 */ 53, 54, 55, 56, 57, 236, 19, 271, 189, 99,
155697 /* 940 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
155698 /* 950 */ 53, 54, 55, 56, 57, 115, 77, 59, 79, 119,
155699 /* 960 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
155700 /* 970 */ 53, 54, 55, 56, 57, 259, 22, 23, 101, 102,
155701 /* 980 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 59,
155702 /* 990 */ 150, 151, 152, 158, 22, 244, 24, 246, 101, 102,
155703 /* 1000 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 285,
155704 /* 1010 */ 189, 189, 114, 115, 116, 200, 136, 137, 101, 102,
155705 /* 1020 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 230,
155706 /* 1030 */ 231, 59, 211, 212, 285, 105, 106, 189, 19, 141,
155707 /* 1040 */ 234, 235, 239, 113, 114, 115, 116, 226, 118, 234,
155708 /* 1050 */ 235, 189, 249, 247, 100, 189, 126, 23, 236, 107,
155709 /* 1060 */ 26, 189, 247, 44, 45, 46, 47, 48, 49, 50,
155710 /* 1070 */ 51, 52, 53, 54, 55, 56, 57, 211, 212, 59,
155711 /* 1080 */ 150, 233, 152, 211, 212, 133, 12, 115, 189, 189,
155712 /* 1090 */ 138, 19, 20, 300, 22, 233, 76, 304, 226, 11,
155713 /* 1100 */ 208, 27, 22, 23, 200, 19, 26, 87, 36, 89,
155714 /* 1110 */ 211, 212, 92, 300, 248, 189, 42, 304, 189, 250,
155715 /* 1120 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
155716 /* 1130 */ 111, 59, 200, 233, 114, 115, 116, 63, 234, 235,
155717 /* 1140 */ 235, 19, 20, 71, 22, 300, 189, 73, 200, 304,
155718 /* 1150 */ 116, 247, 247, 81, 189, 200, 227, 26, 36, 234,
155719 /* 1160 */ 235, 203, 204, 143, 200, 26, 234, 235, 194, 200,
155720 /* 1170 */ 48, 99, 247, 66, 189, 141, 284, 105, 106, 247,
155721 /* 1180 */ 100, 59, 234, 235, 112, 259, 114, 115, 116, 234,
155722 /* 1190 */ 235, 119, 85, 71, 266, 247, 211, 212, 234, 235,
155723 /* 1200 */ 114, 94, 247, 234, 235, 12, 266, 85, 136, 137,
155724 /* 1210 */ 189, 247, 90, 26, 126, 127, 247, 189, 26, 22,
155725 /* 1220 */ 27, 99, 150, 151, 152, 153, 154, 105, 106, 189,
155726 /* 1230 */ 302, 303, 211, 212, 112, 42, 114, 115, 116, 211,
155727 /* 1240 */ 212, 119, 302, 303, 19, 20, 189, 22, 274, 189,
155728 /* 1250 */ 15, 144, 278, 189, 22, 23, 63, 189, 189, 203,
155729 /* 1260 */ 204, 36, 136, 137, 155, 24, 157, 143, 211, 212,
155730 /* 1270 */ 189, 140, 150, 151, 152, 153, 154, 0, 1, 2,
155731 /* 1280 */ 211, 212, 5, 46, 59, 161, 147, 10, 11, 12,
155732 /* 1290 */ 13, 14, 211, 212, 17, 60, 71, 189, 258, 189,
155733 /* 1300 */ 59, 189, 105, 106, 189, 189, 189, 30, 116, 32,
155734 /* 1310 */ 85, 124, 189, 251, 252, 90, 189, 40, 258, 211,
155735 /* 1320 */ 212, 211, 212, 189, 99, 26, 211, 212, 211, 212,
155736 /* 1330 */ 105, 106, 100, 141, 211, 212, 119, 112, 189, 114,
155737 /* 1340 */ 115, 116, 23, 189, 119, 26, 129, 70, 189, 31,
155738 /* 1350 */ 113, 19, 20, 24, 22, 78, 115, 39, 81, 189,
155739 /* 1360 */ 211, 212, 26, 189, 22, 211, 212, 189, 36, 189,
155740 /* 1370 */ 211, 212, 189, 189, 97, 150, 151, 152, 153, 154,
155741 /* 1380 */ 127, 211, 212, 189, 189, 211, 212, 189, 189, 211,
155742 /* 1390 */ 212, 59, 189, 189, 211, 212, 23, 189, 22, 26,
155743 /* 1400 */ 24, 189, 149, 71, 189, 211, 212, 189, 131, 211,
155744 /* 1410 */ 212, 189, 189, 136, 137, 211, 212, 85, 189, 211,
155745 /* 1420 */ 212, 59, 90, 211, 212, 292, 293, 118, 119, 211,
155746 /* 1430 */ 212, 99, 23, 211, 212, 26, 159, 105, 106, 189,
155747 /* 1440 */ 211, 212, 143, 150, 112, 152, 114, 115, 116, 1,
155748 /* 1450 */ 2, 119, 23, 5, 23, 26, 189, 26, 10, 11,
155749 /* 1460 */ 12, 13, 14, 83, 84, 17, 253, 189, 139, 189,
155750 /* 1470 */ 19, 20, 189, 22, 189, 189, 140, 115, 30, 59,
155751 /* 1480 */ 32, 139, 150, 151, 152, 153, 154, 36, 40, 211,
155752 /* 1490 */ 212, 211, 212, 59, 211, 212, 211, 212, 7, 8,
155753 /* 1500 */ 19, 20, 189, 22, 150, 189, 152, 231, 281, 189,
155754 /* 1510 */ 59, 189, 23, 189, 189, 26, 189, 36, 70, 189,
155755 /* 1520 */ 23, 237, 71, 26, 211, 212, 78, 211, 212, 81,
155756 /* 1530 */ 189, 211, 212, 211, 212, 115, 211, 212, 211, 212,
155757 /* 1540 */ 59, 211, 212, 23, 23, 97, 26, 26, 23, 115,
155758 /* 1550 */ 99, 26, 71, 189, 189, 189, 105, 106, 107, 23,
155759 /* 1560 */ 189, 23, 26, 112, 26, 114, 115, 116, 189, 309,
155760 /* 1570 */ 119, 23, 19, 20, 26, 22, 189, 211, 212, 131,
155761 /* 1580 */ 99, 189, 211, 212, 136, 137, 105, 106, 189, 36,
155762 /* 1590 */ 211, 212, 189, 112, 189, 114, 115, 116, 211, 212,
155763 /* 1600 */ 119, 150, 151, 152, 153, 154, 189, 159, 23, 250,
155764 /* 1610 */ 189, 26, 59, 189, 189, 189, 189, 189, 280, 189,
155765 /* 1620 */ 250, 189, 189, 238, 71, 189, 189, 250, 211, 212,
155766 /* 1630 */ 187, 150, 151, 152, 153, 154, 211, 212, 250, 290,
155767 /* 1640 */ 240, 211, 212, 211, 212, 254, 286, 209, 254, 241,
155768 /* 1650 */ 240, 254, 99, 286, 215, 220, 214, 244, 105, 106,
155769 /* 1660 */ 214, 214, 244, 273, 224, 112, 192, 114, 115, 116,
155770 /* 1670 */ 60, 290, 119, 5, 139, 196, 196, 38, 10, 11,
155771 /* 1680 */ 12, 13, 14, 238, 240, 17, 196, 148, 287, 287,
155772 /* 1690 */ 276, 113, 22, 147, 241, 43, 229, 241, 30, 18,
155773 /* 1700 */ 32, 232, 232, 150, 151, 152, 153, 154, 40, 232,
155774 /* 1710 */ 232, 196, 18, 195, 265, 265, 264, 241, 264, 196,
155775 /* 1720 */ 155, 229, 229, 241, 241, 241, 195, 62, 196, 195,
155776 /* 1730 */ 22, 113, 216, 196, 222, 195, 195, 282, 70, 196,
155777 /* 1740 */ 283, 213, 216, 213, 64, 22, 78, 124, 219, 81,
155778 /* 1750 */ 162, 111, 219, 142, 256, 213, 113, 255, 213, 256,
155779 /* 1760 */ 216, 303, 215, 213, 213, 97, 255, 213, 216, 275,
155780 /* 1770 */ 275, 222, 216, 256, 255, 196, 91, 82, 256, 255,
155781 /* 1780 */ 308, 308, 146, 22, 143, 196, 155, 260, 25, 145,
155782 /* 1790 */ 144, 199, 26, 198, 13, 190, 190, 6, 293, 131,
155783 /* 1800 */ 188, 188, 245, 244, 136, 137, 245, 243, 242, 241,
155784 /* 1810 */ 188, 202, 208, 217, 217, 260, 208, 4, 202, 3,
155785 /* 1820 */ 22, 202, 208, 208, 160, 15, 209, 159, 270, 209,
155786 /* 1830 */ 98, 16, 272, 208, 23, 23, 137, 148, 128, 20,
155787 /* 1840 */ 140, 24, 16, 142, 1, 140, 149, 128, 61, 53,
155788 /* 1850 */ 148, 37, 53, 53, 53, 128, 114, 34, 296, 296,
155789 /* 1860 */ 139, 1, 5, 22, 113, 158, 26, 75, 41, 139,
155790 /* 1870 */ 68, 68, 113, 24, 20, 19, 129, 123, 23, 96,
155791 /* 1880 */ 22, 22, 37, 22, 22, 67, 22, 67, 59, 24,
155792 /* 1890 */ 23, 28, 67, 147, 22, 26, 23, 23, 23, 23,
155793 /* 1900 */ 22, 24, 23, 22, 24, 23, 139, 23, 114, 22,
155794 /* 1910 */ 141, 26, 88, 75, 86, 44, 23, 34, 22, 75,
155795 /* 1920 */ 34, 24, 34, 34, 34, 93, 34, 26, 26, 34,
155796 /* 1930 */ 23, 23, 23, 23, 23, 11, 23, 22, 26, 22,
155797 /* 1940 */ 22, 133, 23, 23, 22, 22, 139, 26, 139, 23,
155798 /* 1950 */ 15, 1, 1, 310, 310, 310, 310, 310, 310, 310,
155799 /* 1960 */ 139, 139, 310, 310, 310, 310, 310, 310, 310, 310,
155800 /* 1970 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155801 /* 1980 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155802 /* 1990 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155803 /* 2000 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155804 /* 2010 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
@@ -155812,15 +156446,15 @@
155812 /* 2090 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155813 /* 2100 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155814 /* 2110 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155815 /* 2120 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155816 /* 2130 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
155817 /* 2140 */ 310, 310, 310,
155818 };
155819 #define YY_SHIFT_COUNT (552)
155820 #define YY_SHIFT_MIN (0)
155821 #define YY_SHIFT_MAX (1951)
155822 static const unsigned short int yy_shift_ofst[] = {
155823 /* 0 */ 1448, 1277, 1668, 1072, 1072, 340, 1122, 1225, 1332, 1481,
155824 /* 10 */ 1481, 1481, 335, 0, 0, 180, 897, 1481, 1481, 1481,
155825 /* 20 */ 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481,
155826 /* 30 */ 930, 930, 1020, 1020, 290, 1, 340, 340, 340, 340,
@@ -155833,55 +156467,55 @@
155833 /* 100 */ 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481,
155834 /* 110 */ 1481, 1481, 1553, 1481, 1481, 1481, 1481, 1481, 1481, 1481,
155835 /* 120 */ 1481, 1481, 1481, 1481, 1481, 1481, 147, 258, 258, 258,
155836 /* 130 */ 258, 258, 79, 65, 84, 449, 19, 786, 449, 636,
155837 /* 140 */ 636, 449, 880, 880, 880, 880, 113, 142, 142, 472,
155838 /* 150 */ 150, 1962, 1962, 399, 399, 399, 93, 237, 341, 237,
155839 /* 160 */ 237, 1074, 1074, 437, 350, 704, 1080, 449, 449, 449,
155840 /* 170 */ 449, 449, 449, 449, 449, 449, 449, 449, 449, 449,
155841 /* 180 */ 449, 449, 449, 449, 449, 449, 449, 449, 818, 818,
155842 /* 190 */ 449, 1088, 217, 217, 734, 734, 1124, 1126, 1962, 1962,
155843 /* 200 */ 1962, 739, 840, 840, 453, 454, 511, 187, 563, 570,
155844 /* 210 */ 898, 669, 449, 449, 449, 449, 449, 449, 449, 449,
155845 /* 220 */ 449, 670, 449, 449, 449, 449, 449, 449, 449, 449,
155846 /* 230 */ 449, 449, 449, 449, 674, 674, 674, 449, 449, 449,
155847 /* 240 */ 449, 1034, 449, 449, 449, 972, 1107, 449, 449, 1193,
155848 /* 250 */ 449, 449, 449, 449, 449, 449, 449, 449, 260, 177,
155849 /* 260 */ 489, 1241, 1241, 1241, 1241, 1192, 489, 489, 952, 1197,
155850 /* 270 */ 625, 1235, 1131, 181, 181, 1086, 1139, 1131, 1086, 1187,
155851 /* 280 */ 1319, 1237, 1318, 1318, 1318, 181, 1299, 1299, 1109, 1336,
155852 /* 290 */ 549, 1376, 1610, 1535, 1535, 1639, 1639, 1535, 1539, 1578,
155853 /* 300 */ 1670, 1546, 1652, 1546, 1681, 1681, 1681, 1681, 1535, 1694,
155854 /* 310 */ 1546, 1546, 1578, 1670, 1652, 1546, 1652, 1546, 1535, 1694,
155855 /* 320 */ 1565, 1665, 1535, 1694, 1708, 1535, 1694, 1535, 1694, 1708,
155856 /* 330 */ 1618, 1618, 1618, 1680, 1723, 1723, 1708, 1618, 1623, 1618,
155857 /* 340 */ 1680, 1618, 1618, 1588, 1708, 1640, 1640, 1708, 1611, 1643,
155858 /* 350 */ 1611, 1643, 1611, 1643, 1611, 1643, 1535, 1685, 1685, 1695,
155859 /* 360 */ 1695, 1636, 1641, 1761, 1535, 1631, 1636, 1644, 1646, 1546,
155860 /* 370 */ 1763, 1766, 1781, 1781, 1791, 1791, 1791, 1962, 1962, 1962,
155861 /* 380 */ 1962, 1962, 1962, 1962, 1962, 1962, 1962, 1962, 1962, 1962,
155862 /* 390 */ 1962, 1962, 308, 835, 954, 1232, 879, 715, 728, 1373,
155863 /* 400 */ 864, 1329, 1253, 1409, 297, 1431, 1489, 1497, 1520, 1521,
155864 /* 410 */ 1525, 1362, 1309, 1491, 1217, 1420, 1429, 1536, 1380, 1538,
155865 /* 420 */ 1293, 1354, 1548, 1585, 1434, 1342, 1813, 1816, 1798, 1664,
155866 /* 430 */ 1810, 1732, 1815, 1811, 1812, 1699, 1689, 1710, 1817, 1700,
155867 /* 440 */ 1819, 1701, 1826, 1843, 1705, 1697, 1719, 1787, 1814, 1702,
155868 /* 450 */ 1796, 1799, 1800, 1801, 1727, 1742, 1823, 1721, 1860, 1857,
155869 /* 460 */ 1841, 1751, 1707, 1802, 1840, 1803, 1792, 1827, 1730, 1759,
155870 /* 470 */ 1849, 1854, 1856, 1747, 1754, 1858, 1818, 1859, 1861, 1855,
155871 /* 480 */ 1862, 1820, 1829, 1865, 1783, 1863, 1864, 1825, 1845, 1867,
155872 /* 490 */ 1746, 1872, 1873, 1874, 1875, 1869, 1876, 1878, 1877, 1879,
155873 /* 500 */ 1881, 1880, 1767, 1882, 1884, 1794, 1883, 1887, 1769, 1885,
155874 /* 510 */ 1886, 1888, 1889, 1890, 1824, 1838, 1828, 1871, 1844, 1832,
155875 /* 520 */ 1892, 1893, 1896, 1897, 1901, 1902, 1895, 1907, 1885, 1908,
155876 /* 530 */ 1909, 1910, 1911, 1912, 1913, 1915, 1924, 1917, 1918, 1919,
155877 /* 540 */ 1920, 1922, 1923, 1921, 1808, 1807, 1809, 1821, 1822, 1926,
155878 /* 550 */ 1935, 1950, 1951,
155879 };
155880 #define YY_REDUCE_COUNT (391)
155881 #define YY_REDUCE_MIN (-262)
155882 #define YY_REDUCE_MAX (1625)
155883 static const short yy_reduce_ofst[] = {
155884 /* 0 */ 490, -122, 545, 645, 650, -120, -189, -187, -184, -182,
155885 /* 10 */ -178, -176, 45, 30, 200, -251, -134, 390, 392, 521,
155886 /* 20 */ 523, 213, 692, 821, 284, 589, 872, 666, 671, 866,
155887 /* 30 */ 71, 111, 273, 389, 686, 815, 904, 932, 948, 955,
@@ -155895,92 +156529,92 @@
155895 /* 110 */ 1285, 1313, 1316, 1320, 1322, 1325, 1327, 1330, 1366, 1371,
155896 /* 120 */ 1379, 1387, 1417, 1425, 1430, 1432, -259, -259, -259, -259,
155897 /* 130 */ -259, -259, -259, -259, -259, 557, 974, -214, -174, -9,
155898 /* 140 */ 431, -124, 806, 925, 806, 925, 251, 928, 940, -259,
155899 /* 150 */ -259, -259, -259, -198, -198, -198, 127, -186, -168, 212,
155900 /* 160 */ 646, 617, 799, -262, 555, 220, 220, 491, 605, 1040,
155901 /* 170 */ 1060, 699, -11, 600, 848, 862, 345, -129, 724, -91,
155902 /* 180 */ 158, 749, 716, 900, 304, 822, 929, 926, 499, 793,
155903 /* 190 */ 322, 892, 813, 845, 958, 1056, 751, 905, 1133, 1062,
155904 /* 200 */ 803, -210, -185, -179, -148, -167, -89, 121, 274, 281,
155905 /* 210 */ 320, 336, 439, 663, 711, 957, 965, 1064, 1068, 1112,
155906 /* 220 */ 1116, -196, 1127, 1134, 1180, 1184, 1195, 1199, 1203, 1215,
155907 /* 230 */ 1223, 1250, 1267, 1286, 205, 422, 638, 1324, 1341, 1364,
155908 /* 240 */ 1365, 1213, 1392, 1399, 1403, 869, 1260, 1405, 1421, 1276,
155909 /* 250 */ 1424, 121, 1426, 1427, 1428, 1433, 1436, 1437, 1227, 1338,
155910 /* 260 */ 1284, 1359, 1370, 1377, 1388, 1213, 1284, 1284, 1385, 1438,
155911 /* 270 */ 1443, 1349, 1400, 1391, 1394, 1360, 1408, 1410, 1367, 1439,
155912 /* 280 */ 1440, 1435, 1442, 1446, 1447, 1397, 1413, 1418, 1390, 1444,
155913 /* 290 */ 1445, 1474, 1381, 1479, 1480, 1401, 1402, 1490, 1414, 1449,
155914 /* 300 */ 1452, 1453, 1467, 1456, 1469, 1470, 1477, 1478, 1515, 1518,
155915 /* 310 */ 1476, 1482, 1450, 1454, 1492, 1483, 1493, 1484, 1523, 1531,
155916 /* 320 */ 1457, 1455, 1532, 1534, 1516, 1537, 1540, 1543, 1541, 1526,
155917 /* 330 */ 1528, 1530, 1542, 1512, 1529, 1533, 1544, 1545, 1547, 1550,
155918 /* 340 */ 1549, 1551, 1554, 1458, 1552, 1494, 1495, 1556, 1498, 1502,
155919 /* 350 */ 1503, 1511, 1517, 1519, 1522, 1524, 1579, 1472, 1473, 1527,
155920 /* 360 */ 1555, 1557, 1559, 1558, 1589, 1560, 1561, 1564, 1566, 1568,
155921 /* 370 */ 1592, 1595, 1605, 1606, 1612, 1613, 1622, 1562, 1563, 1505,
155922 /* 380 */ 1609, 1604, 1608, 1614, 1615, 1616, 1596, 1597, 1617, 1620,
155923 /* 390 */ 1625, 1619,
155924 };
155925 static const YYACTIONTYPE yy_default[] = {
155926 /* 0 */ 1575, 1575, 1575, 1411, 1188, 1297, 1188, 1188, 1188, 1411,
155927 /* 10 */ 1411, 1411, 1188, 1327, 1327, 1464, 1219, 1188, 1188, 1188,
155928 /* 20 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1410, 1188, 1188,
155929 /* 30 */ 1188, 1188, 1494, 1494, 1188, 1188, 1188, 1188, 1188, 1188,
155930 /* 40 */ 1188, 1188, 1188, 1336, 1188, 1188, 1188, 1188, 1188, 1188,
155931 /* 50 */ 1412, 1413, 1188, 1188, 1188, 1463, 1465, 1428, 1346, 1345,
155932 /* 60 */ 1344, 1343, 1446, 1314, 1341, 1334, 1338, 1406, 1407, 1405,
155933 /* 70 */ 1409, 1413, 1412, 1188, 1337, 1377, 1391, 1376, 1188, 1188,
155934 /* 80 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155935 /* 90 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155936 /* 100 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155937 /* 110 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155938 /* 120 */ 1188, 1188, 1188, 1188, 1188, 1188, 1385, 1390, 1396, 1389,
155939 /* 130 */ 1386, 1379, 1378, 1380, 1381, 1188, 1209, 1261, 1188, 1188,
155940 /* 140 */ 1188, 1188, 1482, 1481, 1188, 1188, 1219, 1371, 1370, 1382,
155941 /* 150 */ 1383, 1393, 1392, 1471, 1529, 1528, 1429, 1188, 1188, 1188,
155942 /* 160 */ 1188, 1188, 1188, 1494, 1188, 1188, 1188, 1188, 1188, 1188,
155943 /* 170 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155944 /* 180 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1494, 1494,
155945 /* 190 */ 1188, 1219, 1494, 1494, 1215, 1215, 1321, 1188, 1477, 1297,
155946 /* 200 */ 1288, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155947 /* 210 */ 1188, 1188, 1188, 1188, 1188, 1468, 1466, 1188, 1188, 1188,
155948 /* 220 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155949 /* 230 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155950 /* 240 */ 1188, 1188, 1188, 1188, 1188, 1293, 1188, 1188, 1188, 1188,
155951 /* 250 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1523, 1188, 1441,
155952 /* 260 */ 1275, 1293, 1293, 1293, 1293, 1295, 1276, 1274, 1287, 1220,
155953 /* 270 */ 1195, 1567, 1294, 1316, 1316, 1564, 1340, 1294, 1564, 1236,
155954 /* 280 */ 1545, 1231, 1327, 1327, 1327, 1316, 1321, 1321, 1408, 1294,
155955 /* 290 */ 1287, 1188, 1567, 1302, 1302, 1566, 1566, 1302, 1429, 1349,
155956 /* 300 */ 1355, 1340, 1264, 1340, 1270, 1270, 1270, 1270, 1302, 1206,
155957 /* 310 */ 1340, 1340, 1349, 1355, 1264, 1340, 1264, 1340, 1302, 1206,
155958 /* 320 */ 1445, 1561, 1302, 1206, 1419, 1302, 1206, 1302, 1206, 1419,
155959 /* 330 */ 1262, 1262, 1262, 1251, 1188, 1188, 1419, 1262, 1236, 1262,
155960 /* 340 */ 1251, 1262, 1262, 1512, 1419, 1423, 1423, 1419, 1320, 1315,
155961 /* 350 */ 1320, 1315, 1320, 1315, 1320, 1315, 1302, 1504, 1504, 1330,
155962 /* 360 */ 1330, 1335, 1321, 1414, 1302, 1188, 1335, 1333, 1331, 1340,
155963 /* 370 */ 1212, 1254, 1526, 1526, 1522, 1522, 1522, 1572, 1572, 1477,
155964 /* 380 */ 1538, 1219, 1219, 1219, 1219, 1538, 1238, 1238, 1220, 1220,
155965 /* 390 */ 1219, 1538, 1188, 1188, 1188, 1188, 1188, 1188, 1533, 1188,
155966 /* 400 */ 1430, 1306, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155967 /* 410 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155968 /* 420 */ 1188, 1188, 1188, 1188, 1188, 1360, 1188, 1191, 1474, 1188,
155969 /* 430 */ 1188, 1472, 1188, 1188, 1188, 1188, 1188, 1188, 1307, 1188,
155970 /* 440 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155971 /* 450 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1563, 1188, 1188,
155972 /* 460 */ 1188, 1188, 1188, 1188, 1444, 1443, 1188, 1188, 1304, 1188,
155973 /* 470 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155974 /* 480 */ 1188, 1188, 1234, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155975 /* 490 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155976 /* 500 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1332,
155977 /* 510 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155978 /* 520 */ 1188, 1188, 1188, 1188, 1509, 1322, 1188, 1188, 1554, 1188,
155979 /* 530 */ 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188,
155980 /* 540 */ 1188, 1188, 1188, 1549, 1278, 1362, 1188, 1361, 1365, 1188,
155981 /* 550 */ 1200, 1188, 1188,
155982 };
155983 /********** End of lemon-generated parsing tables *****************************/
155984
155985 /* The next table maps tokens (terminal symbols) into fallback tokens.
155986 ** If a construct like the following:
@@ -156741,236 +157375,237 @@
156741 /* 154 */ "setlist ::= nm EQ expr",
156742 /* 155 */ "setlist ::= LP idlist RP EQ expr",
156743 /* 156 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert",
156744 /* 157 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES",
156745 /* 158 */ "upsert ::=",
156746 /* 159 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt",
156747 /* 160 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING",
156748 /* 161 */ "upsert ::= ON CONFLICT DO NOTHING",
156749 /* 162 */ "insert_cmd ::= INSERT orconf",
156750 /* 163 */ "insert_cmd ::= REPLACE",
156751 /* 164 */ "idlist_opt ::=",
156752 /* 165 */ "idlist_opt ::= LP idlist RP",
156753 /* 166 */ "idlist ::= idlist COMMA nm",
156754 /* 167 */ "idlist ::= nm",
156755 /* 168 */ "expr ::= LP expr RP",
156756 /* 169 */ "expr ::= ID|INDEXED",
156757 /* 170 */ "expr ::= JOIN_KW",
156758 /* 171 */ "expr ::= nm DOT nm",
156759 /* 172 */ "expr ::= nm DOT nm DOT nm",
156760 /* 173 */ "term ::= NULL|FLOAT|BLOB",
156761 /* 174 */ "term ::= STRING",
156762 /* 175 */ "term ::= INTEGER",
156763 /* 176 */ "expr ::= VARIABLE",
156764 /* 177 */ "expr ::= expr COLLATE ID|STRING",
156765 /* 178 */ "expr ::= CAST LP expr AS typetoken RP",
156766 /* 179 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
156767 /* 180 */ "expr ::= ID|INDEXED LP STAR RP",
156768 /* 181 */ "expr ::= ID|INDEXED LP distinct exprlist RP filter_over",
156769 /* 182 */ "expr ::= ID|INDEXED LP STAR RP filter_over",
156770 /* 183 */ "term ::= CTIME_KW",
156771 /* 184 */ "expr ::= LP nexprlist COMMA expr RP",
156772 /* 185 */ "expr ::= expr AND expr",
156773 /* 186 */ "expr ::= expr OR expr",
156774 /* 187 */ "expr ::= expr LT|GT|GE|LE expr",
156775 /* 188 */ "expr ::= expr EQ|NE expr",
156776 /* 189 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
156777 /* 190 */ "expr ::= expr PLUS|MINUS expr",
156778 /* 191 */ "expr ::= expr STAR|SLASH|REM expr",
156779 /* 192 */ "expr ::= expr CONCAT expr",
156780 /* 193 */ "likeop ::= NOT LIKE_KW|MATCH",
156781 /* 194 */ "expr ::= expr likeop expr",
156782 /* 195 */ "expr ::= expr likeop expr ESCAPE expr",
156783 /* 196 */ "expr ::= expr ISNULL|NOTNULL",
156784 /* 197 */ "expr ::= expr NOT NULL",
156785 /* 198 */ "expr ::= expr IS expr",
156786 /* 199 */ "expr ::= expr IS NOT expr",
156787 /* 200 */ "expr ::= NOT expr",
156788 /* 201 */ "expr ::= BITNOT expr",
156789 /* 202 */ "expr ::= PLUS|MINUS expr",
156790 /* 203 */ "between_op ::= BETWEEN",
156791 /* 204 */ "between_op ::= NOT BETWEEN",
156792 /* 205 */ "expr ::= expr between_op expr AND expr",
156793 /* 206 */ "in_op ::= IN",
156794 /* 207 */ "in_op ::= NOT IN",
156795 /* 208 */ "expr ::= expr in_op LP exprlist RP",
156796 /* 209 */ "expr ::= LP select RP",
156797 /* 210 */ "expr ::= expr in_op LP select RP",
156798 /* 211 */ "expr ::= expr in_op nm dbnm paren_exprlist",
156799 /* 212 */ "expr ::= EXISTS LP select RP",
156800 /* 213 */ "expr ::= CASE case_operand case_exprlist case_else END",
156801 /* 214 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
156802 /* 215 */ "case_exprlist ::= WHEN expr THEN expr",
156803 /* 216 */ "case_else ::= ELSE expr",
156804 /* 217 */ "case_else ::=",
156805 /* 218 */ "case_operand ::= expr",
156806 /* 219 */ "case_operand ::=",
156807 /* 220 */ "exprlist ::=",
156808 /* 221 */ "nexprlist ::= nexprlist COMMA expr",
156809 /* 222 */ "nexprlist ::= expr",
156810 /* 223 */ "paren_exprlist ::=",
156811 /* 224 */ "paren_exprlist ::= LP exprlist RP",
156812 /* 225 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
156813 /* 226 */ "uniqueflag ::= UNIQUE",
156814 /* 227 */ "uniqueflag ::=",
156815 /* 228 */ "eidlist_opt ::=",
156816 /* 229 */ "eidlist_opt ::= LP eidlist RP",
156817 /* 230 */ "eidlist ::= eidlist COMMA nm collate sortorder",
156818 /* 231 */ "eidlist ::= nm collate sortorder",
156819 /* 232 */ "collate ::=",
156820 /* 233 */ "collate ::= COLLATE ID|STRING",
156821 /* 234 */ "cmd ::= DROP INDEX ifexists fullname",
156822 /* 235 */ "cmd ::= VACUUM vinto",
156823 /* 236 */ "cmd ::= VACUUM nm vinto",
156824 /* 237 */ "vinto ::= INTO expr",
156825 /* 238 */ "vinto ::=",
156826 /* 239 */ "cmd ::= PRAGMA nm dbnm",
156827 /* 240 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
156828 /* 241 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
156829 /* 242 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
156830 /* 243 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
156831 /* 244 */ "plus_num ::= PLUS INTEGER|FLOAT",
156832 /* 245 */ "minus_num ::= MINUS INTEGER|FLOAT",
156833 /* 246 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
156834 /* 247 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
156835 /* 248 */ "trigger_time ::= BEFORE|AFTER",
156836 /* 249 */ "trigger_time ::= INSTEAD OF",
156837 /* 250 */ "trigger_time ::=",
156838 /* 251 */ "trigger_event ::= DELETE|INSERT",
156839 /* 252 */ "trigger_event ::= UPDATE",
156840 /* 253 */ "trigger_event ::= UPDATE OF idlist",
156841 /* 254 */ "when_clause ::=",
156842 /* 255 */ "when_clause ::= WHEN expr",
156843 /* 256 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
156844 /* 257 */ "trigger_cmd_list ::= trigger_cmd SEMI",
156845 /* 258 */ "trnm ::= nm DOT nm",
156846 /* 259 */ "tridxby ::= INDEXED BY nm",
156847 /* 260 */ "tridxby ::= NOT INDEXED",
156848 /* 261 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt",
156849 /* 262 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt",
156850 /* 263 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
156851 /* 264 */ "trigger_cmd ::= scanpt select scanpt",
156852 /* 265 */ "expr ::= RAISE LP IGNORE RP",
156853 /* 266 */ "expr ::= RAISE LP raisetype COMMA nm RP",
156854 /* 267 */ "raisetype ::= ROLLBACK",
156855 /* 268 */ "raisetype ::= ABORT",
156856 /* 269 */ "raisetype ::= FAIL",
156857 /* 270 */ "cmd ::= DROP TRIGGER ifexists fullname",
156858 /* 271 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
156859 /* 272 */ "cmd ::= DETACH database_kw_opt expr",
156860 /* 273 */ "key_opt ::=",
156861 /* 274 */ "key_opt ::= KEY expr",
156862 /* 275 */ "cmd ::= REINDEX",
156863 /* 276 */ "cmd ::= REINDEX nm dbnm",
156864 /* 277 */ "cmd ::= ANALYZE",
156865 /* 278 */ "cmd ::= ANALYZE nm dbnm",
156866 /* 279 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
156867 /* 280 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
156868 /* 281 */ "add_column_fullname ::= fullname",
156869 /* 282 */ "cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm",
156870 /* 283 */ "cmd ::= create_vtab",
156871 /* 284 */ "cmd ::= create_vtab LP vtabarglist RP",
156872 /* 285 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
156873 /* 286 */ "vtabarg ::=",
156874 /* 287 */ "vtabargtoken ::= ANY",
156875 /* 288 */ "vtabargtoken ::= lp anylist RP",
156876 /* 289 */ "lp ::= LP",
156877 /* 290 */ "with ::= WITH wqlist",
156878 /* 291 */ "with ::= WITH RECURSIVE wqlist",
156879 /* 292 */ "wqlist ::= nm eidlist_opt AS LP select RP",
156880 /* 293 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
156881 /* 294 */ "windowdefn_list ::= windowdefn",
156882 /* 295 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
156883 /* 296 */ "windowdefn ::= nm AS LP window RP",
156884 /* 297 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
156885 /* 298 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
156886 /* 299 */ "window ::= ORDER BY sortlist frame_opt",
156887 /* 300 */ "window ::= nm ORDER BY sortlist frame_opt",
156888 /* 301 */ "window ::= frame_opt",
156889 /* 302 */ "window ::= nm frame_opt",
156890 /* 303 */ "frame_opt ::=",
156891 /* 304 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
156892 /* 305 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
156893 /* 306 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
156894 /* 307 */ "frame_bound_s ::= frame_bound",
156895 /* 308 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
156896 /* 309 */ "frame_bound_e ::= frame_bound",
156897 /* 310 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
156898 /* 311 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
156899 /* 312 */ "frame_bound ::= CURRENT ROW",
156900 /* 313 */ "frame_exclude_opt ::=",
156901 /* 314 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
156902 /* 315 */ "frame_exclude ::= NO OTHERS",
156903 /* 316 */ "frame_exclude ::= CURRENT ROW",
156904 /* 317 */ "frame_exclude ::= GROUP|TIES",
156905 /* 318 */ "window_clause ::= WINDOW windowdefn_list",
156906 /* 319 */ "filter_over ::= filter_clause over_clause",
156907 /* 320 */ "filter_over ::= over_clause",
156908 /* 321 */ "filter_over ::= filter_clause",
156909 /* 322 */ "over_clause ::= OVER LP window RP",
156910 /* 323 */ "over_clause ::= OVER nm",
156911 /* 324 */ "filter_clause ::= FILTER LP WHERE expr RP",
156912 /* 325 */ "input ::= cmdlist",
156913 /* 326 */ "cmdlist ::= cmdlist ecmd",
156914 /* 327 */ "cmdlist ::= ecmd",
156915 /* 328 */ "ecmd ::= SEMI",
156916 /* 329 */ "ecmd ::= cmdx SEMI",
156917 /* 330 */ "ecmd ::= explain cmdx SEMI",
156918 /* 331 */ "trans_opt ::=",
156919 /* 332 */ "trans_opt ::= TRANSACTION",
156920 /* 333 */ "trans_opt ::= TRANSACTION nm",
156921 /* 334 */ "savepoint_opt ::= SAVEPOINT",
156922 /* 335 */ "savepoint_opt ::=",
156923 /* 336 */ "cmd ::= create_table create_table_args",
156924 /* 337 */ "columnlist ::= columnlist COMMA columnname carglist",
156925 /* 338 */ "columnlist ::= columnname carglist",
156926 /* 339 */ "nm ::= ID|INDEXED",
156927 /* 340 */ "nm ::= STRING",
156928 /* 341 */ "nm ::= JOIN_KW",
156929 /* 342 */ "typetoken ::= typename",
156930 /* 343 */ "typename ::= ID|STRING",
156931 /* 344 */ "signed ::= plus_num",
156932 /* 345 */ "signed ::= minus_num",
156933 /* 346 */ "carglist ::= carglist ccons",
156934 /* 347 */ "carglist ::=",
156935 /* 348 */ "ccons ::= NULL onconf",
156936 /* 349 */ "ccons ::= GENERATED ALWAYS AS generated",
156937 /* 350 */ "ccons ::= AS generated",
156938 /* 351 */ "conslist_opt ::= COMMA conslist",
156939 /* 352 */ "conslist ::= conslist tconscomma tcons",
156940 /* 353 */ "conslist ::= tcons",
156941 /* 354 */ "tconscomma ::=",
156942 /* 355 */ "defer_subclause_opt ::= defer_subclause",
156943 /* 356 */ "resolvetype ::= raisetype",
156944 /* 357 */ "selectnowith ::= oneselect",
156945 /* 358 */ "oneselect ::= values",
156946 /* 359 */ "sclp ::= selcollist COMMA",
156947 /* 360 */ "as ::= ID|STRING",
156948 /* 361 */ "expr ::= term",
156949 /* 362 */ "likeop ::= LIKE_KW|MATCH",
156950 /* 363 */ "exprlist ::= nexprlist",
156951 /* 364 */ "nmnum ::= plus_num",
156952 /* 365 */ "nmnum ::= nm",
156953 /* 366 */ "nmnum ::= ON",
156954 /* 367 */ "nmnum ::= DELETE",
156955 /* 368 */ "nmnum ::= DEFAULT",
156956 /* 369 */ "plus_num ::= INTEGER|FLOAT",
156957 /* 370 */ "foreach_clause ::=",
156958 /* 371 */ "foreach_clause ::= FOR EACH ROW",
156959 /* 372 */ "trnm ::= nm",
156960 /* 373 */ "tridxby ::=",
156961 /* 374 */ "database_kw_opt ::= DATABASE",
156962 /* 375 */ "database_kw_opt ::=",
156963 /* 376 */ "kwcolumn_opt ::=",
156964 /* 377 */ "kwcolumn_opt ::= COLUMNKW",
156965 /* 378 */ "vtabarglist ::= vtabarg",
156966 /* 379 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
156967 /* 380 */ "vtabarg ::= vtabarg vtabargtoken",
156968 /* 381 */ "anylist ::=",
156969 /* 382 */ "anylist ::= anylist LP anylist RP",
156970 /* 383 */ "anylist ::= anylist ANY",
156971 /* 384 */ "with ::=",
 
156972 };
156973 #endif /* NDEBUG */
156974
156975
156976 #if YYSTACKDEPTH<=0
@@ -157633,236 +158268,237 @@
157633 262, /* (154) setlist ::= nm EQ expr */
157634 262, /* (155) setlist ::= LP idlist RP EQ expr */
157635 186, /* (156) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
157636 186, /* (157) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
157637 265, /* (158) upsert ::= */
157638 265, /* (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
157639 265, /* (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
157640 265, /* (161) upsert ::= ON CONFLICT DO NOTHING */
157641 263, /* (162) insert_cmd ::= INSERT orconf */
157642 263, /* (163) insert_cmd ::= REPLACE */
157643 264, /* (164) idlist_opt ::= */
157644 264, /* (165) idlist_opt ::= LP idlist RP */
157645 259, /* (166) idlist ::= idlist COMMA nm */
157646 259, /* (167) idlist ::= nm */
157647 212, /* (168) expr ::= LP expr RP */
157648 212, /* (169) expr ::= ID|INDEXED */
157649 212, /* (170) expr ::= JOIN_KW */
157650 212, /* (171) expr ::= nm DOT nm */
157651 212, /* (172) expr ::= nm DOT nm DOT nm */
157652 211, /* (173) term ::= NULL|FLOAT|BLOB */
157653 211, /* (174) term ::= STRING */
157654 211, /* (175) term ::= INTEGER */
157655 212, /* (176) expr ::= VARIABLE */
157656 212, /* (177) expr ::= expr COLLATE ID|STRING */
157657 212, /* (178) expr ::= CAST LP expr AS typetoken RP */
157658 212, /* (179) expr ::= ID|INDEXED LP distinct exprlist RP */
157659 212, /* (180) expr ::= ID|INDEXED LP STAR RP */
157660 212, /* (181) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
157661 212, /* (182) expr ::= ID|INDEXED LP STAR RP filter_over */
157662 211, /* (183) term ::= CTIME_KW */
157663 212, /* (184) expr ::= LP nexprlist COMMA expr RP */
157664 212, /* (185) expr ::= expr AND expr */
157665 212, /* (186) expr ::= expr OR expr */
157666 212, /* (187) expr ::= expr LT|GT|GE|LE expr */
157667 212, /* (188) expr ::= expr EQ|NE expr */
157668 212, /* (189) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
157669 212, /* (190) expr ::= expr PLUS|MINUS expr */
157670 212, /* (191) expr ::= expr STAR|SLASH|REM expr */
157671 212, /* (192) expr ::= expr CONCAT expr */
157672 267, /* (193) likeop ::= NOT LIKE_KW|MATCH */
157673 212, /* (194) expr ::= expr likeop expr */
157674 212, /* (195) expr ::= expr likeop expr ESCAPE expr */
157675 212, /* (196) expr ::= expr ISNULL|NOTNULL */
157676 212, /* (197) expr ::= expr NOT NULL */
157677 212, /* (198) expr ::= expr IS expr */
157678 212, /* (199) expr ::= expr IS NOT expr */
157679 212, /* (200) expr ::= NOT expr */
157680 212, /* (201) expr ::= BITNOT expr */
157681 212, /* (202) expr ::= PLUS|MINUS expr */
157682 268, /* (203) between_op ::= BETWEEN */
157683 268, /* (204) between_op ::= NOT BETWEEN */
157684 212, /* (205) expr ::= expr between_op expr AND expr */
157685 269, /* (206) in_op ::= IN */
157686 269, /* (207) in_op ::= NOT IN */
157687 212, /* (208) expr ::= expr in_op LP exprlist RP */
157688 212, /* (209) expr ::= LP select RP */
157689 212, /* (210) expr ::= expr in_op LP select RP */
157690 212, /* (211) expr ::= expr in_op nm dbnm paren_exprlist */
157691 212, /* (212) expr ::= EXISTS LP select RP */
157692 212, /* (213) expr ::= CASE case_operand case_exprlist case_else END */
157693 272, /* (214) case_exprlist ::= case_exprlist WHEN expr THEN expr */
157694 272, /* (215) case_exprlist ::= WHEN expr THEN expr */
157695 273, /* (216) case_else ::= ELSE expr */
157696 273, /* (217) case_else ::= */
157697 271, /* (218) case_operand ::= expr */
157698 271, /* (219) case_operand ::= */
157699 257, /* (220) exprlist ::= */
157700 248, /* (221) nexprlist ::= nexprlist COMMA expr */
157701 248, /* (222) nexprlist ::= expr */
157702 270, /* (223) paren_exprlist ::= */
157703 270, /* (224) paren_exprlist ::= LP exprlist RP */
157704 186, /* (225) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
157705 274, /* (226) uniqueflag ::= UNIQUE */
157706 274, /* (227) uniqueflag ::= */
157707 216, /* (228) eidlist_opt ::= */
157708 216, /* (229) eidlist_opt ::= LP eidlist RP */
157709 227, /* (230) eidlist ::= eidlist COMMA nm collate sortorder */
157710 227, /* (231) eidlist ::= nm collate sortorder */
157711 275, /* (232) collate ::= */
157712 275, /* (233) collate ::= COLLATE ID|STRING */
157713 186, /* (234) cmd ::= DROP INDEX ifexists fullname */
157714 186, /* (235) cmd ::= VACUUM vinto */
157715 186, /* (236) cmd ::= VACUUM nm vinto */
157716 276, /* (237) vinto ::= INTO expr */
157717 276, /* (238) vinto ::= */
157718 186, /* (239) cmd ::= PRAGMA nm dbnm */
157719 186, /* (240) cmd ::= PRAGMA nm dbnm EQ nmnum */
157720 186, /* (241) cmd ::= PRAGMA nm dbnm LP nmnum RP */
157721 186, /* (242) cmd ::= PRAGMA nm dbnm EQ minus_num */
157722 186, /* (243) cmd ::= PRAGMA nm dbnm LP minus_num RP */
157723 206, /* (244) plus_num ::= PLUS INTEGER|FLOAT */
157724 207, /* (245) minus_num ::= MINUS INTEGER|FLOAT */
157725 186, /* (246) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
157726 278, /* (247) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
157727 280, /* (248) trigger_time ::= BEFORE|AFTER */
157728 280, /* (249) trigger_time ::= INSTEAD OF */
157729 280, /* (250) trigger_time ::= */
157730 281, /* (251) trigger_event ::= DELETE|INSERT */
157731 281, /* (252) trigger_event ::= UPDATE */
157732 281, /* (253) trigger_event ::= UPDATE OF idlist */
157733 283, /* (254) when_clause ::= */
157734 283, /* (255) when_clause ::= WHEN expr */
157735 279, /* (256) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
157736 279, /* (257) trigger_cmd_list ::= trigger_cmd SEMI */
157737 285, /* (258) trnm ::= nm DOT nm */
157738 286, /* (259) tridxby ::= INDEXED BY nm */
157739 286, /* (260) tridxby ::= NOT INDEXED */
157740 284, /* (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
157741 284, /* (262) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
157742 284, /* (263) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
157743 284, /* (264) trigger_cmd ::= scanpt select scanpt */
157744 212, /* (265) expr ::= RAISE LP IGNORE RP */
157745 212, /* (266) expr ::= RAISE LP raisetype COMMA nm RP */
157746 231, /* (267) raisetype ::= ROLLBACK */
157747 231, /* (268) raisetype ::= ABORT */
157748 231, /* (269) raisetype ::= FAIL */
157749 186, /* (270) cmd ::= DROP TRIGGER ifexists fullname */
157750 186, /* (271) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
157751 186, /* (272) cmd ::= DETACH database_kw_opt expr */
157752 288, /* (273) key_opt ::= */
157753 288, /* (274) key_opt ::= KEY expr */
157754 186, /* (275) cmd ::= REINDEX */
157755 186, /* (276) cmd ::= REINDEX nm dbnm */
157756 186, /* (277) cmd ::= ANALYZE */
157757 186, /* (278) cmd ::= ANALYZE nm dbnm */
157758 186, /* (279) cmd ::= ALTER TABLE fullname RENAME TO nm */
157759 186, /* (280) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
157760 289, /* (281) add_column_fullname ::= fullname */
157761 186, /* (282) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
157762 186, /* (283) cmd ::= create_vtab */
157763 186, /* (284) cmd ::= create_vtab LP vtabarglist RP */
157764 291, /* (285) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
157765 293, /* (286) vtabarg ::= */
157766 294, /* (287) vtabargtoken ::= ANY */
157767 294, /* (288) vtabargtoken ::= lp anylist RP */
157768 295, /* (289) lp ::= LP */
157769 261, /* (290) with ::= WITH wqlist */
157770 261, /* (291) with ::= WITH RECURSIVE wqlist */
157771 236, /* (292) wqlist ::= nm eidlist_opt AS LP select RP */
157772 236, /* (293) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
157773 297, /* (294) windowdefn_list ::= windowdefn */
157774 297, /* (295) windowdefn_list ::= windowdefn_list COMMA windowdefn */
157775 298, /* (296) windowdefn ::= nm AS LP window RP */
157776 299, /* (297) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
157777 299, /* (298) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
157778 299, /* (299) window ::= ORDER BY sortlist frame_opt */
157779 299, /* (300) window ::= nm ORDER BY sortlist frame_opt */
157780 299, /* (301) window ::= frame_opt */
157781 299, /* (302) window ::= nm frame_opt */
157782 300, /* (303) frame_opt ::= */
157783 300, /* (304) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
157784 300, /* (305) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
157785 304, /* (306) range_or_rows ::= RANGE|ROWS|GROUPS */
157786 306, /* (307) frame_bound_s ::= frame_bound */
157787 306, /* (308) frame_bound_s ::= UNBOUNDED PRECEDING */
157788 307, /* (309) frame_bound_e ::= frame_bound */
157789 307, /* (310) frame_bound_e ::= UNBOUNDED FOLLOWING */
157790 305, /* (311) frame_bound ::= expr PRECEDING|FOLLOWING */
157791 305, /* (312) frame_bound ::= CURRENT ROW */
157792 308, /* (313) frame_exclude_opt ::= */
157793 308, /* (314) frame_exclude_opt ::= EXCLUDE frame_exclude */
157794 309, /* (315) frame_exclude ::= NO OTHERS */
157795 309, /* (316) frame_exclude ::= CURRENT ROW */
157796 309, /* (317) frame_exclude ::= GROUP|TIES */
157797 246, /* (318) window_clause ::= WINDOW windowdefn_list */
157798 266, /* (319) filter_over ::= filter_clause over_clause */
157799 266, /* (320) filter_over ::= over_clause */
157800 266, /* (321) filter_over ::= filter_clause */
157801 303, /* (322) over_clause ::= OVER LP window RP */
157802 303, /* (323) over_clause ::= OVER nm */
157803 302, /* (324) filter_clause ::= FILTER LP WHERE expr RP */
157804 181, /* (325) input ::= cmdlist */
157805 182, /* (326) cmdlist ::= cmdlist ecmd */
157806 182, /* (327) cmdlist ::= ecmd */
157807 183, /* (328) ecmd ::= SEMI */
157808 183, /* (329) ecmd ::= cmdx SEMI */
157809 183, /* (330) ecmd ::= explain cmdx SEMI */
157810 188, /* (331) trans_opt ::= */
157811 188, /* (332) trans_opt ::= TRANSACTION */
157812 188, /* (333) trans_opt ::= TRANSACTION nm */
157813 190, /* (334) savepoint_opt ::= SAVEPOINT */
157814 190, /* (335) savepoint_opt ::= */
157815 186, /* (336) cmd ::= create_table create_table_args */
157816 197, /* (337) columnlist ::= columnlist COMMA columnname carglist */
157817 197, /* (338) columnlist ::= columnname carglist */
157818 189, /* (339) nm ::= ID|INDEXED */
157819 189, /* (340) nm ::= STRING */
157820 189, /* (341) nm ::= JOIN_KW */
157821 203, /* (342) typetoken ::= typename */
157822 204, /* (343) typename ::= ID|STRING */
157823 205, /* (344) signed ::= plus_num */
157824 205, /* (345) signed ::= minus_num */
157825 202, /* (346) carglist ::= carglist ccons */
157826 202, /* (347) carglist ::= */
157827 210, /* (348) ccons ::= NULL onconf */
157828 210, /* (349) ccons ::= GENERATED ALWAYS AS generated */
157829 210, /* (350) ccons ::= AS generated */
157830 198, /* (351) conslist_opt ::= COMMA conslist */
157831 223, /* (352) conslist ::= conslist tconscomma tcons */
157832 223, /* (353) conslist ::= tcons */
157833 224, /* (354) tconscomma ::= */
157834 228, /* (355) defer_subclause_opt ::= defer_subclause */
157835 230, /* (356) resolvetype ::= raisetype */
157836 234, /* (357) selectnowith ::= oneselect */
157837 235, /* (358) oneselect ::= values */
157838 249, /* (359) sclp ::= selcollist COMMA */
157839 250, /* (360) as ::= ID|STRING */
157840 212, /* (361) expr ::= term */
157841 267, /* (362) likeop ::= LIKE_KW|MATCH */
157842 257, /* (363) exprlist ::= nexprlist */
157843 277, /* (364) nmnum ::= plus_num */
157844 277, /* (365) nmnum ::= nm */
157845 277, /* (366) nmnum ::= ON */
157846 277, /* (367) nmnum ::= DELETE */
157847 277, /* (368) nmnum ::= DEFAULT */
157848 206, /* (369) plus_num ::= INTEGER|FLOAT */
157849 282, /* (370) foreach_clause ::= */
157850 282, /* (371) foreach_clause ::= FOR EACH ROW */
157851 285, /* (372) trnm ::= nm */
157852 286, /* (373) tridxby ::= */
157853 287, /* (374) database_kw_opt ::= DATABASE */
157854 287, /* (375) database_kw_opt ::= */
157855 290, /* (376) kwcolumn_opt ::= */
157856 290, /* (377) kwcolumn_opt ::= COLUMNKW */
157857 292, /* (378) vtabarglist ::= vtabarg */
157858 292, /* (379) vtabarglist ::= vtabarglist COMMA vtabarg */
157859 293, /* (380) vtabarg ::= vtabarg vtabargtoken */
157860 296, /* (381) anylist ::= */
157861 296, /* (382) anylist ::= anylist LP anylist RP */
157862 296, /* (383) anylist ::= anylist ANY */
157863 261, /* (384) with ::= */
 
157864 };
157865
157866 /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
157867 ** of symbols on the right-hand side of that rule. */
157868 static const signed char yyRuleInfoNRhs[] = {
@@ -158023,236 +158659,237 @@
158023 -3, /* (154) setlist ::= nm EQ expr */
158024 -5, /* (155) setlist ::= LP idlist RP EQ expr */
158025 -7, /* (156) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
158026 -7, /* (157) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
158027 0, /* (158) upsert ::= */
158028 -11, /* (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
158029 -8, /* (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
158030 -4, /* (161) upsert ::= ON CONFLICT DO NOTHING */
158031 -2, /* (162) insert_cmd ::= INSERT orconf */
158032 -1, /* (163) insert_cmd ::= REPLACE */
158033 0, /* (164) idlist_opt ::= */
158034 -3, /* (165) idlist_opt ::= LP idlist RP */
158035 -3, /* (166) idlist ::= idlist COMMA nm */
158036 -1, /* (167) idlist ::= nm */
158037 -3, /* (168) expr ::= LP expr RP */
158038 -1, /* (169) expr ::= ID|INDEXED */
158039 -1, /* (170) expr ::= JOIN_KW */
158040 -3, /* (171) expr ::= nm DOT nm */
158041 -5, /* (172) expr ::= nm DOT nm DOT nm */
158042 -1, /* (173) term ::= NULL|FLOAT|BLOB */
158043 -1, /* (174) term ::= STRING */
158044 -1, /* (175) term ::= INTEGER */
158045 -1, /* (176) expr ::= VARIABLE */
158046 -3, /* (177) expr ::= expr COLLATE ID|STRING */
158047 -6, /* (178) expr ::= CAST LP expr AS typetoken RP */
158048 -5, /* (179) expr ::= ID|INDEXED LP distinct exprlist RP */
158049 -4, /* (180) expr ::= ID|INDEXED LP STAR RP */
158050 -6, /* (181) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
158051 -5, /* (182) expr ::= ID|INDEXED LP STAR RP filter_over */
158052 -1, /* (183) term ::= CTIME_KW */
158053 -5, /* (184) expr ::= LP nexprlist COMMA expr RP */
158054 -3, /* (185) expr ::= expr AND expr */
158055 -3, /* (186) expr ::= expr OR expr */
158056 -3, /* (187) expr ::= expr LT|GT|GE|LE expr */
158057 -3, /* (188) expr ::= expr EQ|NE expr */
158058 -3, /* (189) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
158059 -3, /* (190) expr ::= expr PLUS|MINUS expr */
158060 -3, /* (191) expr ::= expr STAR|SLASH|REM expr */
158061 -3, /* (192) expr ::= expr CONCAT expr */
158062 -2, /* (193) likeop ::= NOT LIKE_KW|MATCH */
158063 -3, /* (194) expr ::= expr likeop expr */
158064 -5, /* (195) expr ::= expr likeop expr ESCAPE expr */
158065 -2, /* (196) expr ::= expr ISNULL|NOTNULL */
158066 -3, /* (197) expr ::= expr NOT NULL */
158067 -3, /* (198) expr ::= expr IS expr */
158068 -4, /* (199) expr ::= expr IS NOT expr */
158069 -2, /* (200) expr ::= NOT expr */
158070 -2, /* (201) expr ::= BITNOT expr */
158071 -2, /* (202) expr ::= PLUS|MINUS expr */
158072 -1, /* (203) between_op ::= BETWEEN */
158073 -2, /* (204) between_op ::= NOT BETWEEN */
158074 -5, /* (205) expr ::= expr between_op expr AND expr */
158075 -1, /* (206) in_op ::= IN */
158076 -2, /* (207) in_op ::= NOT IN */
158077 -5, /* (208) expr ::= expr in_op LP exprlist RP */
158078 -3, /* (209) expr ::= LP select RP */
158079 -5, /* (210) expr ::= expr in_op LP select RP */
158080 -5, /* (211) expr ::= expr in_op nm dbnm paren_exprlist */
158081 -4, /* (212) expr ::= EXISTS LP select RP */
158082 -5, /* (213) expr ::= CASE case_operand case_exprlist case_else END */
158083 -5, /* (214) case_exprlist ::= case_exprlist WHEN expr THEN expr */
158084 -4, /* (215) case_exprlist ::= WHEN expr THEN expr */
158085 -2, /* (216) case_else ::= ELSE expr */
158086 0, /* (217) case_else ::= */
158087 -1, /* (218) case_operand ::= expr */
158088 0, /* (219) case_operand ::= */
158089 0, /* (220) exprlist ::= */
158090 -3, /* (221) nexprlist ::= nexprlist COMMA expr */
158091 -1, /* (222) nexprlist ::= expr */
158092 0, /* (223) paren_exprlist ::= */
158093 -3, /* (224) paren_exprlist ::= LP exprlist RP */
158094 -12, /* (225) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
158095 -1, /* (226) uniqueflag ::= UNIQUE */
158096 0, /* (227) uniqueflag ::= */
158097 0, /* (228) eidlist_opt ::= */
158098 -3, /* (229) eidlist_opt ::= LP eidlist RP */
158099 -5, /* (230) eidlist ::= eidlist COMMA nm collate sortorder */
158100 -3, /* (231) eidlist ::= nm collate sortorder */
158101 0, /* (232) collate ::= */
158102 -2, /* (233) collate ::= COLLATE ID|STRING */
158103 -4, /* (234) cmd ::= DROP INDEX ifexists fullname */
158104 -2, /* (235) cmd ::= VACUUM vinto */
158105 -3, /* (236) cmd ::= VACUUM nm vinto */
158106 -2, /* (237) vinto ::= INTO expr */
158107 0, /* (238) vinto ::= */
158108 -3, /* (239) cmd ::= PRAGMA nm dbnm */
158109 -5, /* (240) cmd ::= PRAGMA nm dbnm EQ nmnum */
158110 -6, /* (241) cmd ::= PRAGMA nm dbnm LP nmnum RP */
158111 -5, /* (242) cmd ::= PRAGMA nm dbnm EQ minus_num */
158112 -6, /* (243) cmd ::= PRAGMA nm dbnm LP minus_num RP */
158113 -2, /* (244) plus_num ::= PLUS INTEGER|FLOAT */
158114 -2, /* (245) minus_num ::= MINUS INTEGER|FLOAT */
158115 -5, /* (246) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
158116 -11, /* (247) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
158117 -1, /* (248) trigger_time ::= BEFORE|AFTER */
158118 -2, /* (249) trigger_time ::= INSTEAD OF */
158119 0, /* (250) trigger_time ::= */
158120 -1, /* (251) trigger_event ::= DELETE|INSERT */
158121 -1, /* (252) trigger_event ::= UPDATE */
158122 -3, /* (253) trigger_event ::= UPDATE OF idlist */
158123 0, /* (254) when_clause ::= */
158124 -2, /* (255) when_clause ::= WHEN expr */
158125 -3, /* (256) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
158126 -2, /* (257) trigger_cmd_list ::= trigger_cmd SEMI */
158127 -3, /* (258) trnm ::= nm DOT nm */
158128 -3, /* (259) tridxby ::= INDEXED BY nm */
158129 -2, /* (260) tridxby ::= NOT INDEXED */
158130 -9, /* (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
158131 -8, /* (262) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
158132 -6, /* (263) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
158133 -3, /* (264) trigger_cmd ::= scanpt select scanpt */
158134 -4, /* (265) expr ::= RAISE LP IGNORE RP */
158135 -6, /* (266) expr ::= RAISE LP raisetype COMMA nm RP */
158136 -1, /* (267) raisetype ::= ROLLBACK */
158137 -1, /* (268) raisetype ::= ABORT */
158138 -1, /* (269) raisetype ::= FAIL */
158139 -4, /* (270) cmd ::= DROP TRIGGER ifexists fullname */
158140 -6, /* (271) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
158141 -3, /* (272) cmd ::= DETACH database_kw_opt expr */
158142 0, /* (273) key_opt ::= */
158143 -2, /* (274) key_opt ::= KEY expr */
158144 -1, /* (275) cmd ::= REINDEX */
158145 -3, /* (276) cmd ::= REINDEX nm dbnm */
158146 -1, /* (277) cmd ::= ANALYZE */
158147 -3, /* (278) cmd ::= ANALYZE nm dbnm */
158148 -6, /* (279) cmd ::= ALTER TABLE fullname RENAME TO nm */
158149 -7, /* (280) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
158150 -1, /* (281) add_column_fullname ::= fullname */
158151 -8, /* (282) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
158152 -1, /* (283) cmd ::= create_vtab */
158153 -4, /* (284) cmd ::= create_vtab LP vtabarglist RP */
158154 -8, /* (285) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
158155 0, /* (286) vtabarg ::= */
158156 -1, /* (287) vtabargtoken ::= ANY */
158157 -3, /* (288) vtabargtoken ::= lp anylist RP */
158158 -1, /* (289) lp ::= LP */
158159 -2, /* (290) with ::= WITH wqlist */
158160 -3, /* (291) with ::= WITH RECURSIVE wqlist */
158161 -6, /* (292) wqlist ::= nm eidlist_opt AS LP select RP */
158162 -8, /* (293) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
158163 -1, /* (294) windowdefn_list ::= windowdefn */
158164 -3, /* (295) windowdefn_list ::= windowdefn_list COMMA windowdefn */
158165 -5, /* (296) windowdefn ::= nm AS LP window RP */
158166 -5, /* (297) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
158167 -6, /* (298) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
158168 -4, /* (299) window ::= ORDER BY sortlist frame_opt */
158169 -5, /* (300) window ::= nm ORDER BY sortlist frame_opt */
158170 -1, /* (301) window ::= frame_opt */
158171 -2, /* (302) window ::= nm frame_opt */
158172 0, /* (303) frame_opt ::= */
158173 -3, /* (304) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
158174 -6, /* (305) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
158175 -1, /* (306) range_or_rows ::= RANGE|ROWS|GROUPS */
158176 -1, /* (307) frame_bound_s ::= frame_bound */
158177 -2, /* (308) frame_bound_s ::= UNBOUNDED PRECEDING */
158178 -1, /* (309) frame_bound_e ::= frame_bound */
158179 -2, /* (310) frame_bound_e ::= UNBOUNDED FOLLOWING */
158180 -2, /* (311) frame_bound ::= expr PRECEDING|FOLLOWING */
158181 -2, /* (312) frame_bound ::= CURRENT ROW */
158182 0, /* (313) frame_exclude_opt ::= */
158183 -2, /* (314) frame_exclude_opt ::= EXCLUDE frame_exclude */
158184 -2, /* (315) frame_exclude ::= NO OTHERS */
158185 -2, /* (316) frame_exclude ::= CURRENT ROW */
158186 -1, /* (317) frame_exclude ::= GROUP|TIES */
158187 -2, /* (318) window_clause ::= WINDOW windowdefn_list */
158188 -2, /* (319) filter_over ::= filter_clause over_clause */
158189 -1, /* (320) filter_over ::= over_clause */
158190 -1, /* (321) filter_over ::= filter_clause */
158191 -4, /* (322) over_clause ::= OVER LP window RP */
158192 -2, /* (323) over_clause ::= OVER nm */
158193 -5, /* (324) filter_clause ::= FILTER LP WHERE expr RP */
158194 -1, /* (325) input ::= cmdlist */
158195 -2, /* (326) cmdlist ::= cmdlist ecmd */
158196 -1, /* (327) cmdlist ::= ecmd */
158197 -1, /* (328) ecmd ::= SEMI */
158198 -2, /* (329) ecmd ::= cmdx SEMI */
158199 -3, /* (330) ecmd ::= explain cmdx SEMI */
158200 0, /* (331) trans_opt ::= */
158201 -1, /* (332) trans_opt ::= TRANSACTION */
158202 -2, /* (333) trans_opt ::= TRANSACTION nm */
158203 -1, /* (334) savepoint_opt ::= SAVEPOINT */
158204 0, /* (335) savepoint_opt ::= */
158205 -2, /* (336) cmd ::= create_table create_table_args */
158206 -4, /* (337) columnlist ::= columnlist COMMA columnname carglist */
158207 -2, /* (338) columnlist ::= columnname carglist */
158208 -1, /* (339) nm ::= ID|INDEXED */
158209 -1, /* (340) nm ::= STRING */
158210 -1, /* (341) nm ::= JOIN_KW */
158211 -1, /* (342) typetoken ::= typename */
158212 -1, /* (343) typename ::= ID|STRING */
158213 -1, /* (344) signed ::= plus_num */
158214 -1, /* (345) signed ::= minus_num */
158215 -2, /* (346) carglist ::= carglist ccons */
158216 0, /* (347) carglist ::= */
158217 -2, /* (348) ccons ::= NULL onconf */
158218 -4, /* (349) ccons ::= GENERATED ALWAYS AS generated */
158219 -2, /* (350) ccons ::= AS generated */
158220 -2, /* (351) conslist_opt ::= COMMA conslist */
158221 -3, /* (352) conslist ::= conslist tconscomma tcons */
158222 -1, /* (353) conslist ::= tcons */
158223 0, /* (354) tconscomma ::= */
158224 -1, /* (355) defer_subclause_opt ::= defer_subclause */
158225 -1, /* (356) resolvetype ::= raisetype */
158226 -1, /* (357) selectnowith ::= oneselect */
158227 -1, /* (358) oneselect ::= values */
158228 -2, /* (359) sclp ::= selcollist COMMA */
158229 -1, /* (360) as ::= ID|STRING */
158230 -1, /* (361) expr ::= term */
158231 -1, /* (362) likeop ::= LIKE_KW|MATCH */
158232 -1, /* (363) exprlist ::= nexprlist */
158233 -1, /* (364) nmnum ::= plus_num */
158234 -1, /* (365) nmnum ::= nm */
158235 -1, /* (366) nmnum ::= ON */
158236 -1, /* (367) nmnum ::= DELETE */
158237 -1, /* (368) nmnum ::= DEFAULT */
158238 -1, /* (369) plus_num ::= INTEGER|FLOAT */
158239 0, /* (370) foreach_clause ::= */
158240 -3, /* (371) foreach_clause ::= FOR EACH ROW */
158241 -1, /* (372) trnm ::= nm */
158242 0, /* (373) tridxby ::= */
158243 -1, /* (374) database_kw_opt ::= DATABASE */
158244 0, /* (375) database_kw_opt ::= */
158245 0, /* (376) kwcolumn_opt ::= */
158246 -1, /* (377) kwcolumn_opt ::= COLUMNKW */
158247 -1, /* (378) vtabarglist ::= vtabarg */
158248 -3, /* (379) vtabarglist ::= vtabarglist COMMA vtabarg */
158249 -2, /* (380) vtabarg ::= vtabarg vtabargtoken */
158250 0, /* (381) anylist ::= */
158251 -4, /* (382) anylist ::= anylist LP anylist RP */
158252 -2, /* (383) anylist ::= anylist ANY */
158253 0, /* (384) with ::= */
 
158254 };
158255
158256 static void yy_accept(yyParser*); /* Forward Declaration */
158257
158258 /*
@@ -158357,11 +158994,11 @@
158357 {yymsp[1].minor.yy192 = TK_DEFERRED;}
158358 break;
158359 case 5: /* transtype ::= DEFERRED */
158360 case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
158361 case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
158362 case 306: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==306);
158363 {yymsp[0].minor.yy192 = yymsp[0].major; /*A-overwrites-X*/}
158364 break;
158365 case 8: /* cmd ::= COMMIT|END trans_opt */
158366 case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
158367 {sqlite3EndTransaction(pParse,yymsp[-1].major);}
@@ -158395,11 +159032,11 @@
158395 case 45: /* autoinc ::= */ yytestcase(yyruleno==45);
158396 case 60: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==60);
158397 case 70: /* defer_subclause_opt ::= */ yytestcase(yyruleno==70);
158398 case 79: /* ifexists ::= */ yytestcase(yyruleno==79);
158399 case 96: /* distinct ::= */ yytestcase(yyruleno==96);
158400 case 232: /* collate ::= */ yytestcase(yyruleno==232);
158401 {yymsp[1].minor.yy192 = 0;}
158402 break;
158403 case 16: /* ifnotexists ::= IF NOT EXISTS */
158404 {yymsp[-2].minor.yy192 = 1;}
158405 break;
@@ -158554,18 +159191,18 @@
158554 case 58: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
158555 {yymsp[-2].minor.yy192 = 0;}
158556 break;
158557 case 59: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
158558 case 74: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==74);
158559 case 162: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==162);
158560 {yymsp[-1].minor.yy192 = yymsp[0].minor.yy192;}
158561 break;
158562 case 61: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
158563 case 78: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==78);
158564 case 204: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==204);
158565 case 207: /* in_op ::= NOT IN */ yytestcase(yyruleno==207);
158566 case 233: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==233);
158567 {yymsp[-1].minor.yy192 = 1;}
158568 break;
158569 case 62: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
158570 {yymsp[-1].minor.yy192 = 0;}
158571 break;
@@ -158597,11 +159234,11 @@
158597 break;
158598 case 75: /* resolvetype ::= IGNORE */
158599 {yymsp[0].minor.yy192 = OE_Ignore;}
158600 break;
158601 case 76: /* resolvetype ::= REPLACE */
158602 case 163: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==163);
158603 {yymsp[0].minor.yy192 = OE_Replace;}
158604 break;
158605 case 77: /* cmd ::= DROP TABLE ifexists fullname */
158606 {
158607 sqlite3DropTable(pParse, yymsp[0].minor.yy47, 0, yymsp[-1].minor.yy192);
@@ -158729,13 +159366,13 @@
158729 {yymsp[0].minor.yy192 = SF_All;}
158730 break;
158731 case 97: /* sclp ::= */
158732 case 130: /* orderby_opt ::= */ yytestcase(yyruleno==130);
158733 case 140: /* groupby_opt ::= */ yytestcase(yyruleno==140);
158734 case 220: /* exprlist ::= */ yytestcase(yyruleno==220);
158735 case 223: /* paren_exprlist ::= */ yytestcase(yyruleno==223);
158736 case 228: /* eidlist_opt ::= */ yytestcase(yyruleno==228);
158737 {yymsp[1].minor.yy242 = 0;}
158738 break;
158739 case 98: /* selcollist ::= sclp scanpt expr scanpt as */
158740 {
158741 yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy242, yymsp[-2].minor.yy202);
@@ -158757,12 +159394,12 @@
158757 yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242, pDot);
158758 }
158759 break;
158760 case 101: /* as ::= AS nm */
158761 case 112: /* dbnm ::= DOT nm */ yytestcase(yyruleno==112);
158762 case 244: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==244);
158763 case 245: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==245);
158764 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
158765 break;
158766 case 103: /* from ::= */
158767 case 106: /* stl_prefix ::= */ yytestcase(yyruleno==106);
158768 {yymsp[1].minor.yy47 = 0;}
@@ -158874,21 +159511,21 @@
158874 {yymsp[-3].minor.yy192 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
158875 break;
158876 case 123: /* on_opt ::= ON expr */
158877 case 143: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==143);
158878 case 150: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==150);
158879 case 216: /* case_else ::= ELSE expr */ yytestcase(yyruleno==216);
158880 case 237: /* vinto ::= INTO expr */ yytestcase(yyruleno==237);
158881 {yymsp[-1].minor.yy202 = yymsp[0].minor.yy202;}
158882 break;
158883 case 124: /* on_opt ::= */
158884 case 142: /* having_opt ::= */ yytestcase(yyruleno==142);
158885 case 144: /* limit_opt ::= */ yytestcase(yyruleno==144);
158886 case 149: /* where_opt ::= */ yytestcase(yyruleno==149);
158887 case 217: /* case_else ::= */ yytestcase(yyruleno==217);
158888 case 219: /* case_operand ::= */ yytestcase(yyruleno==219);
158889 case 238: /* vinto ::= */ yytestcase(yyruleno==238);
158890 {yymsp[1].minor.yy202 = 0;}
158891 break;
158892 case 126: /* indexed_opt ::= INDEXED BY nm */
158893 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
158894 break;
@@ -158897,11 +159534,11 @@
158897 break;
158898 case 128: /* using_opt ::= USING LP idlist RP */
158899 {yymsp[-3].minor.yy600 = yymsp[-1].minor.yy600;}
158900 break;
158901 case 129: /* using_opt ::= */
158902 case 164: /* idlist_opt ::= */ yytestcase(yyruleno==164);
158903 {yymsp[1].minor.yy600 = 0;}
158904 break;
158905 case 131: /* orderby_opt ::= ORDER BY sortlist */
158906 case 141: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==141);
158907 {yymsp[-2].minor.yy242 = yymsp[0].minor.yy242;}
@@ -158991,36 +159628,39 @@
158991 }
158992 break;
158993 case 158: /* upsert ::= */
158994 { yymsp[1].minor.yy318 = 0; }
158995 break;
158996 case 159: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
158997 { yymsp[-10].minor.yy318 = sqlite3UpsertNew(pParse->db,yymsp[-7].minor.yy242,yymsp[-5].minor.yy202,yymsp[-1].minor.yy242,yymsp[0].minor.yy202);}
158998 break;
158999 case 160: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
159000 { yymsp[-7].minor.yy318 = sqlite3UpsertNew(pParse->db,yymsp[-4].minor.yy242,yymsp[-2].minor.yy202,0,0); }
159001 break;
159002 case 161: /* upsert ::= ON CONFLICT DO NOTHING */
159003 { yymsp[-3].minor.yy318 = sqlite3UpsertNew(pParse->db,0,0,0,0); }
159004 break;
159005 case 165: /* idlist_opt ::= LP idlist RP */
 
 
 
159006 {yymsp[-2].minor.yy600 = yymsp[-1].minor.yy600;}
159007 break;
159008 case 166: /* idlist ::= idlist COMMA nm */
159009 {yymsp[-2].minor.yy600 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy600,&yymsp[0].minor.yy0);}
159010 break;
159011 case 167: /* idlist ::= nm */
159012 {yymsp[0].minor.yy600 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
159013 break;
159014 case 168: /* expr ::= LP expr RP */
159015 {yymsp[-2].minor.yy202 = yymsp[-1].minor.yy202;}
159016 break;
159017 case 169: /* expr ::= ID|INDEXED */
159018 case 170: /* expr ::= JOIN_KW */ yytestcase(yyruleno==170);
159019 {yymsp[0].minor.yy202=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
159020 break;
159021 case 171: /* expr ::= nm DOT nm */
159022 {
159023 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
159024 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
159025 if( IN_RENAME_OBJECT ){
159026 sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[0].minor.yy0);
@@ -159028,11 +159668,11 @@
159028 }
159029 yylhsminor.yy202 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
159030 }
159031 yymsp[-2].minor.yy202 = yylhsminor.yy202;
159032 break;
159033 case 172: /* expr ::= nm DOT nm DOT nm */
159034 {
159035 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
159036 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
159037 Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
159038 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
@@ -159042,21 +159682,21 @@
159042 }
159043 yylhsminor.yy202 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
159044 }
159045 yymsp[-4].minor.yy202 = yylhsminor.yy202;
159046 break;
159047 case 173: /* term ::= NULL|FLOAT|BLOB */
159048 case 174: /* term ::= STRING */ yytestcase(yyruleno==174);
159049 {yymsp[0].minor.yy202=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
159050 break;
159051 case 175: /* term ::= INTEGER */
159052 {
159053 yylhsminor.yy202 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
159054 }
159055 yymsp[0].minor.yy202 = yylhsminor.yy202;
159056 break;
159057 case 176: /* expr ::= VARIABLE */
159058 {
159059 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
159060 u32 n = yymsp[0].minor.yy0.n;
159061 yymsp[0].minor.yy202 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
159062 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy202, n);
@@ -159074,54 +159714,54 @@
159074 if( yymsp[0].minor.yy202 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy202->iTable);
159075 }
159076 }
159077 }
159078 break;
159079 case 177: /* expr ::= expr COLLATE ID|STRING */
159080 {
159081 yymsp[-2].minor.yy202 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy202, &yymsp[0].minor.yy0, 1);
159082 }
159083 break;
159084 case 178: /* expr ::= CAST LP expr AS typetoken RP */
159085 {
159086 yymsp[-5].minor.yy202 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
159087 sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy202, yymsp[-3].minor.yy202, 0);
159088 }
159089 break;
159090 case 179: /* expr ::= ID|INDEXED LP distinct exprlist RP */
159091 {
159092 yylhsminor.yy202 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy242, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy192);
159093 }
159094 yymsp[-4].minor.yy202 = yylhsminor.yy202;
159095 break;
159096 case 180: /* expr ::= ID|INDEXED LP STAR RP */
159097 {
159098 yylhsminor.yy202 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
159099 }
159100 yymsp[-3].minor.yy202 = yylhsminor.yy202;
159101 break;
159102 case 181: /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
159103 {
159104 yylhsminor.yy202 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy242, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy192);
159105 sqlite3WindowAttach(pParse, yylhsminor.yy202, yymsp[0].minor.yy303);
159106 }
159107 yymsp[-5].minor.yy202 = yylhsminor.yy202;
159108 break;
159109 case 182: /* expr ::= ID|INDEXED LP STAR RP filter_over */
159110 {
159111 yylhsminor.yy202 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
159112 sqlite3WindowAttach(pParse, yylhsminor.yy202, yymsp[0].minor.yy303);
159113 }
159114 yymsp[-4].minor.yy202 = yylhsminor.yy202;
159115 break;
159116 case 183: /* term ::= CTIME_KW */
159117 {
159118 yylhsminor.yy202 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
159119 }
159120 yymsp[0].minor.yy202 = yylhsminor.yy202;
159121 break;
159122 case 184: /* expr ::= LP nexprlist COMMA expr RP */
159123 {
159124 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy242, yymsp[-1].minor.yy202);
159125 yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
159126 if( yymsp[-4].minor.yy202 ){
159127 yymsp[-4].minor.yy202->x.pList = pList;
@@ -159131,26 +159771,26 @@
159131 }else{
159132 sqlite3ExprListDelete(pParse->db, pList);
159133 }
159134 }
159135 break;
159136 case 185: /* expr ::= expr AND expr */
159137 {yymsp[-2].minor.yy202=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy202,yymsp[0].minor.yy202);}
159138 break;
159139 case 186: /* expr ::= expr OR expr */
159140 case 187: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==187);
159141 case 188: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==188);
159142 case 189: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==189);
159143 case 190: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==190);
159144 case 191: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==191);
159145 case 192: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==192);
159146 {yymsp[-2].minor.yy202=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy202,yymsp[0].minor.yy202);}
159147 break;
159148 case 193: /* likeop ::= NOT LIKE_KW|MATCH */
159149 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
159150 break;
159151 case 194: /* expr ::= expr likeop expr */
159152 {
159153 ExprList *pList;
159154 int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
159155 yymsp[-1].minor.yy0.n &= 0x7fffffff;
159156 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy202);
@@ -159158,11 +159798,11 @@
159158 yymsp[-2].minor.yy202 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
159159 if( bNot ) yymsp[-2].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy202, 0);
159160 if( yymsp[-2].minor.yy202 ) yymsp[-2].minor.yy202->flags |= EP_InfixFunc;
159161 }
159162 break;
159163 case 195: /* expr ::= expr likeop expr ESCAPE expr */
159164 {
159165 ExprList *pList;
159166 int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
159167 yymsp[-3].minor.yy0.n &= 0x7fffffff;
159168 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy202);
@@ -159171,43 +159811,43 @@
159171 yymsp[-4].minor.yy202 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
159172 if( bNot ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159173 if( yymsp[-4].minor.yy202 ) yymsp[-4].minor.yy202->flags |= EP_InfixFunc;
159174 }
159175 break;
159176 case 196: /* expr ::= expr ISNULL|NOTNULL */
159177 {yymsp[-1].minor.yy202 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy202,0);}
159178 break;
159179 case 197: /* expr ::= expr NOT NULL */
159180 {yymsp[-2].minor.yy202 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy202,0);}
159181 break;
159182 case 198: /* expr ::= expr IS expr */
159183 {
159184 yymsp[-2].minor.yy202 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy202,yymsp[0].minor.yy202);
159185 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy202, yymsp[-2].minor.yy202, TK_ISNULL);
159186 }
159187 break;
159188 case 199: /* expr ::= expr IS NOT expr */
159189 {
159190 yymsp[-3].minor.yy202 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy202,yymsp[0].minor.yy202);
159191 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy202, yymsp[-3].minor.yy202, TK_NOTNULL);
159192 }
159193 break;
159194 case 200: /* expr ::= NOT expr */
159195 case 201: /* expr ::= BITNOT expr */ yytestcase(yyruleno==201);
159196 {yymsp[-1].minor.yy202 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy202, 0);/*A-overwrites-B*/}
159197 break;
159198 case 202: /* expr ::= PLUS|MINUS expr */
159199 {
159200 yymsp[-1].minor.yy202 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy202, 0);
159201 /*A-overwrites-B*/
159202 }
159203 break;
159204 case 203: /* between_op ::= BETWEEN */
159205 case 206: /* in_op ::= IN */ yytestcase(yyruleno==206);
159206 {yymsp[0].minor.yy192 = 0;}
159207 break;
159208 case 205: /* expr ::= expr between_op expr AND expr */
159209 {
159210 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy202);
159211 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy202);
159212 yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy202, 0);
159213 if( yymsp[-4].minor.yy202 ){
@@ -159216,11 +159856,11 @@
159216 sqlite3ExprListDelete(pParse->db, pList);
159217 }
159218 if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159219 }
159220 break;
159221 case 208: /* expr ::= expr in_op LP exprlist RP */
159222 {
159223 if( yymsp[-1].minor.yy242==0 ){
159224 /* Expressions of the form
159225 **
159226 ** expr1 IN ()
@@ -159248,41 +159888,41 @@
159248 }
159249 if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159250 }
159251 }
159252 break;
159253 case 209: /* expr ::= LP select RP */
159254 {
159255 yymsp[-2].minor.yy202 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
159256 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy202, yymsp[-1].minor.yy539);
159257 }
159258 break;
159259 case 210: /* expr ::= expr in_op LP select RP */
159260 {
159261 yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy202, 0);
159262 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy202, yymsp[-1].minor.yy539);
159263 if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159264 }
159265 break;
159266 case 211: /* expr ::= expr in_op nm dbnm paren_exprlist */
159267 {
159268 SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
159269 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
159270 if( yymsp[0].minor.yy242 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy242);
159271 yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy202, 0);
159272 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy202, pSelect);
159273 if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159274 }
159275 break;
159276 case 212: /* expr ::= EXISTS LP select RP */
159277 {
159278 Expr *p;
159279 p = yymsp[-3].minor.yy202 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
159280 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy539);
159281 }
159282 break;
159283 case 213: /* expr ::= CASE case_operand case_exprlist case_else END */
159284 {
159285 yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy202, 0);
159286 if( yymsp[-4].minor.yy202 ){
159287 yymsp[-4].minor.yy202->x.pList = yymsp[-1].minor.yy202 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy242,yymsp[-1].minor.yy202) : yymsp[-2].minor.yy242;
159288 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy202);
@@ -159290,394 +159930,394 @@
159290 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy242);
159291 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy202);
159292 }
159293 }
159294 break;
159295 case 214: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
159296 {
159297 yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242, yymsp[-2].minor.yy202);
159298 yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242, yymsp[0].minor.yy202);
159299 }
159300 break;
159301 case 215: /* case_exprlist ::= WHEN expr THEN expr */
159302 {
159303 yymsp[-3].minor.yy242 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy202);
159304 yymsp[-3].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy242, yymsp[0].minor.yy202);
159305 }
159306 break;
159307 case 218: /* case_operand ::= expr */
159308 {yymsp[0].minor.yy202 = yymsp[0].minor.yy202; /*A-overwrites-X*/}
159309 break;
159310 case 221: /* nexprlist ::= nexprlist COMMA expr */
159311 {yymsp[-2].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy242,yymsp[0].minor.yy202);}
159312 break;
159313 case 222: /* nexprlist ::= expr */
159314 {yymsp[0].minor.yy242 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy202); /*A-overwrites-Y*/}
159315 break;
159316 case 224: /* paren_exprlist ::= LP exprlist RP */
159317 case 229: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==229);
159318 {yymsp[-2].minor.yy242 = yymsp[-1].minor.yy242;}
159319 break;
159320 case 225: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
159321 {
159322 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
159323 sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy242, yymsp[-10].minor.yy192,
159324 &yymsp[-11].minor.yy0, yymsp[0].minor.yy202, SQLITE_SO_ASC, yymsp[-8].minor.yy192, SQLITE_IDXTYPE_APPDEF);
159325 if( IN_RENAME_OBJECT && pParse->pNewIndex ){
159326 sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
159327 }
159328 }
159329 break;
159330 case 226: /* uniqueflag ::= UNIQUE */
159331 case 268: /* raisetype ::= ABORT */ yytestcase(yyruleno==268);
159332 {yymsp[0].minor.yy192 = OE_Abort;}
159333 break;
159334 case 227: /* uniqueflag ::= */
159335 {yymsp[1].minor.yy192 = OE_None;}
159336 break;
159337 case 230: /* eidlist ::= eidlist COMMA nm collate sortorder */
159338 {
159339 yymsp[-4].minor.yy242 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy242, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy192, yymsp[0].minor.yy192);
159340 }
159341 break;
159342 case 231: /* eidlist ::= nm collate sortorder */
159343 {
159344 yymsp[-2].minor.yy242 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy192, yymsp[0].minor.yy192); /*A-overwrites-Y*/
159345 }
159346 break;
159347 case 234: /* cmd ::= DROP INDEX ifexists fullname */
159348 {sqlite3DropIndex(pParse, yymsp[0].minor.yy47, yymsp[-1].minor.yy192);}
159349 break;
159350 case 235: /* cmd ::= VACUUM vinto */
159351 {sqlite3Vacuum(pParse,0,yymsp[0].minor.yy202);}
159352 break;
159353 case 236: /* cmd ::= VACUUM nm vinto */
159354 {sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy202);}
159355 break;
159356 case 239: /* cmd ::= PRAGMA nm dbnm */
159357 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
159358 break;
159359 case 240: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
159360 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
159361 break;
159362 case 241: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
159363 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
159364 break;
159365 case 242: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
159366 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
159367 break;
159368 case 243: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
159369 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
159370 break;
159371 case 246: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
159372 {
159373 Token all;
159374 all.z = yymsp[-3].minor.yy0.z;
159375 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
159376 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy447, &all);
159377 }
159378 break;
159379 case 247: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
159380 {
159381 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy192, yymsp[-4].minor.yy230.a, yymsp[-4].minor.yy230.b, yymsp[-2].minor.yy47, yymsp[0].minor.yy202, yymsp[-10].minor.yy192, yymsp[-8].minor.yy192);
159382 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
159383 }
159384 break;
159385 case 248: /* trigger_time ::= BEFORE|AFTER */
159386 { yymsp[0].minor.yy192 = yymsp[0].major; /*A-overwrites-X*/ }
159387 break;
159388 case 249: /* trigger_time ::= INSTEAD OF */
159389 { yymsp[-1].minor.yy192 = TK_INSTEAD;}
159390 break;
159391 case 250: /* trigger_time ::= */
159392 { yymsp[1].minor.yy192 = TK_BEFORE; }
159393 break;
159394 case 251: /* trigger_event ::= DELETE|INSERT */
159395 case 252: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==252);
159396 {yymsp[0].minor.yy230.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy230.b = 0;}
159397 break;
159398 case 253: /* trigger_event ::= UPDATE OF idlist */
159399 {yymsp[-2].minor.yy230.a = TK_UPDATE; yymsp[-2].minor.yy230.b = yymsp[0].minor.yy600;}
159400 break;
159401 case 254: /* when_clause ::= */
159402 case 273: /* key_opt ::= */ yytestcase(yyruleno==273);
159403 { yymsp[1].minor.yy202 = 0; }
159404 break;
159405 case 255: /* when_clause ::= WHEN expr */
159406 case 274: /* key_opt ::= KEY expr */ yytestcase(yyruleno==274);
159407 { yymsp[-1].minor.yy202 = yymsp[0].minor.yy202; }
159408 break;
159409 case 256: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
159410 {
159411 assert( yymsp[-2].minor.yy447!=0 );
159412 yymsp[-2].minor.yy447->pLast->pNext = yymsp[-1].minor.yy447;
159413 yymsp[-2].minor.yy447->pLast = yymsp[-1].minor.yy447;
159414 }
159415 break;
159416 case 257: /* trigger_cmd_list ::= trigger_cmd SEMI */
159417 {
159418 assert( yymsp[-1].minor.yy447!=0 );
159419 yymsp[-1].minor.yy447->pLast = yymsp[-1].minor.yy447;
159420 }
159421 break;
159422 case 258: /* trnm ::= nm DOT nm */
159423 {
159424 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
159425 sqlite3ErrorMsg(pParse,
159426 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
159427 "statements within triggers");
159428 }
159429 break;
159430 case 259: /* tridxby ::= INDEXED BY nm */
159431 {
159432 sqlite3ErrorMsg(pParse,
159433 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
159434 "within triggers");
159435 }
159436 break;
159437 case 260: /* tridxby ::= NOT INDEXED */
159438 {
159439 sqlite3ErrorMsg(pParse,
159440 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
159441 "within triggers");
159442 }
159443 break;
159444 case 261: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
159445 {yylhsminor.yy447 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy47, yymsp[-3].minor.yy242, yymsp[-1].minor.yy202, yymsp[-7].minor.yy192, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy436);}
159446 yymsp[-8].minor.yy447 = yylhsminor.yy447;
159447 break;
159448 case 262: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
159449 {
159450 yylhsminor.yy447 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy600,yymsp[-2].minor.yy539,yymsp[-6].minor.yy192,yymsp[-1].minor.yy318,yymsp[-7].minor.yy436,yymsp[0].minor.yy436);/*yylhsminor.yy447-overwrites-yymsp[-6].minor.yy192*/
159451 }
159452 yymsp[-7].minor.yy447 = yylhsminor.yy447;
159453 break;
159454 case 263: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
159455 {yylhsminor.yy447 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy202, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy436);}
159456 yymsp[-5].minor.yy447 = yylhsminor.yy447;
159457 break;
159458 case 264: /* trigger_cmd ::= scanpt select scanpt */
159459 {yylhsminor.yy447 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy539, yymsp[-2].minor.yy436, yymsp[0].minor.yy436); /*yylhsminor.yy447-overwrites-yymsp[-1].minor.yy539*/}
159460 yymsp[-2].minor.yy447 = yylhsminor.yy447;
159461 break;
159462 case 265: /* expr ::= RAISE LP IGNORE RP */
159463 {
159464 yymsp[-3].minor.yy202 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
159465 if( yymsp[-3].minor.yy202 ){
159466 yymsp[-3].minor.yy202->affExpr = OE_Ignore;
159467 }
159468 }
159469 break;
159470 case 266: /* expr ::= RAISE LP raisetype COMMA nm RP */
159471 {
159472 yymsp[-5].minor.yy202 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
159473 if( yymsp[-5].minor.yy202 ) {
159474 yymsp[-5].minor.yy202->affExpr = (char)yymsp[-3].minor.yy192;
159475 }
159476 }
159477 break;
159478 case 267: /* raisetype ::= ROLLBACK */
159479 {yymsp[0].minor.yy192 = OE_Rollback;}
159480 break;
159481 case 269: /* raisetype ::= FAIL */
159482 {yymsp[0].minor.yy192 = OE_Fail;}
159483 break;
159484 case 270: /* cmd ::= DROP TRIGGER ifexists fullname */
159485 {
159486 sqlite3DropTrigger(pParse,yymsp[0].minor.yy47,yymsp[-1].minor.yy192);
159487 }
159488 break;
159489 case 271: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
159490 {
159491 sqlite3Attach(pParse, yymsp[-3].minor.yy202, yymsp[-1].minor.yy202, yymsp[0].minor.yy202);
159492 }
159493 break;
159494 case 272: /* cmd ::= DETACH database_kw_opt expr */
159495 {
159496 sqlite3Detach(pParse, yymsp[0].minor.yy202);
159497 }
159498 break;
159499 case 275: /* cmd ::= REINDEX */
159500 {sqlite3Reindex(pParse, 0, 0);}
159501 break;
159502 case 276: /* cmd ::= REINDEX nm dbnm */
159503 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
159504 break;
159505 case 277: /* cmd ::= ANALYZE */
159506 {sqlite3Analyze(pParse, 0, 0);}
159507 break;
159508 case 278: /* cmd ::= ANALYZE nm dbnm */
159509 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
159510 break;
159511 case 279: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
159512 {
159513 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy47,&yymsp[0].minor.yy0);
159514 }
159515 break;
159516 case 280: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
159517 {
159518 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
159519 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
159520 }
159521 break;
159522 case 281: /* add_column_fullname ::= fullname */
159523 {
159524 disableLookaside(pParse);
159525 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy47);
159526 }
159527 break;
159528 case 282: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
159529 {
159530 sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy47, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
159531 }
159532 break;
159533 case 283: /* cmd ::= create_vtab */
159534 {sqlite3VtabFinishParse(pParse,0);}
159535 break;
159536 case 284: /* cmd ::= create_vtab LP vtabarglist RP */
159537 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
159538 break;
159539 case 285: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
159540 {
159541 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy192);
159542 }
159543 break;
159544 case 286: /* vtabarg ::= */
159545 {sqlite3VtabArgInit(pParse);}
159546 break;
159547 case 287: /* vtabargtoken ::= ANY */
159548 case 288: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==288);
159549 case 289: /* lp ::= LP */ yytestcase(yyruleno==289);
159550 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
159551 break;
159552 case 290: /* with ::= WITH wqlist */
159553 case 291: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==291);
159554 { sqlite3WithPush(pParse, yymsp[0].minor.yy131, 1); }
159555 break;
159556 case 292: /* wqlist ::= nm eidlist_opt AS LP select RP */
159557 {
159558 yymsp[-5].minor.yy131 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy242, yymsp[-1].minor.yy539); /*A-overwrites-X*/
159559 }
159560 break;
159561 case 293: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
159562 {
159563 yymsp[-7].minor.yy131 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy131, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy242, yymsp[-1].minor.yy539);
159564 }
159565 break;
159566 case 294: /* windowdefn_list ::= windowdefn */
159567 { yylhsminor.yy303 = yymsp[0].minor.yy303; }
159568 yymsp[0].minor.yy303 = yylhsminor.yy303;
159569 break;
159570 case 295: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
159571 {
159572 assert( yymsp[0].minor.yy303!=0 );
159573 sqlite3WindowChain(pParse, yymsp[0].minor.yy303, yymsp[-2].minor.yy303);
159574 yymsp[0].minor.yy303->pNextWin = yymsp[-2].minor.yy303;
159575 yylhsminor.yy303 = yymsp[0].minor.yy303;
159576 }
159577 yymsp[-2].minor.yy303 = yylhsminor.yy303;
159578 break;
159579 case 296: /* windowdefn ::= nm AS LP window RP */
159580 {
159581 if( ALWAYS(yymsp[-1].minor.yy303) ){
159582 yymsp[-1].minor.yy303->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
159583 }
159584 yylhsminor.yy303 = yymsp[-1].minor.yy303;
159585 }
159586 yymsp[-4].minor.yy303 = yylhsminor.yy303;
159587 break;
159588 case 297: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
159589 {
159590 yymsp[-4].minor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, yymsp[-2].minor.yy242, yymsp[-1].minor.yy242, 0);
159591 }
159592 break;
159593 case 298: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
159594 {
159595 yylhsminor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, yymsp[-2].minor.yy242, yymsp[-1].minor.yy242, &yymsp[-5].minor.yy0);
159596 }
159597 yymsp[-5].minor.yy303 = yylhsminor.yy303;
159598 break;
159599 case 299: /* window ::= ORDER BY sortlist frame_opt */
159600 {
159601 yymsp[-3].minor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, 0, yymsp[-1].minor.yy242, 0);
159602 }
159603 break;
159604 case 300: /* window ::= nm ORDER BY sortlist frame_opt */
159605 {
159606 yylhsminor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, 0, yymsp[-1].minor.yy242, &yymsp[-4].minor.yy0);
159607 }
159608 yymsp[-4].minor.yy303 = yylhsminor.yy303;
159609 break;
159610 case 301: /* window ::= frame_opt */
159611 case 320: /* filter_over ::= over_clause */ yytestcase(yyruleno==320);
159612 {
159613 yylhsminor.yy303 = yymsp[0].minor.yy303;
159614 }
159615 yymsp[0].minor.yy303 = yylhsminor.yy303;
159616 break;
159617 case 302: /* window ::= nm frame_opt */
159618 {
159619 yylhsminor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, 0, 0, &yymsp[-1].minor.yy0);
159620 }
159621 yymsp[-1].minor.yy303 = yylhsminor.yy303;
159622 break;
159623 case 303: /* frame_opt ::= */
159624 {
159625 yymsp[1].minor.yy303 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
159626 }
159627 break;
159628 case 304: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
159629 {
159630 yylhsminor.yy303 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy192, yymsp[-1].minor.yy77.eType, yymsp[-1].minor.yy77.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy58);
159631 }
159632 yymsp[-2].minor.yy303 = yylhsminor.yy303;
159633 break;
159634 case 305: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
159635 {
159636 yylhsminor.yy303 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy192, yymsp[-3].minor.yy77.eType, yymsp[-3].minor.yy77.pExpr, yymsp[-1].minor.yy77.eType, yymsp[-1].minor.yy77.pExpr, yymsp[0].minor.yy58);
159637 }
159638 yymsp[-5].minor.yy303 = yylhsminor.yy303;
159639 break;
159640 case 307: /* frame_bound_s ::= frame_bound */
159641 case 309: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==309);
159642 {yylhsminor.yy77 = yymsp[0].minor.yy77;}
159643 yymsp[0].minor.yy77 = yylhsminor.yy77;
159644 break;
159645 case 308: /* frame_bound_s ::= UNBOUNDED PRECEDING */
159646 case 310: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==310);
159647 case 312: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==312);
159648 {yylhsminor.yy77.eType = yymsp[-1].major; yylhsminor.yy77.pExpr = 0;}
159649 yymsp[-1].minor.yy77 = yylhsminor.yy77;
159650 break;
159651 case 311: /* frame_bound ::= expr PRECEDING|FOLLOWING */
159652 {yylhsminor.yy77.eType = yymsp[0].major; yylhsminor.yy77.pExpr = yymsp[-1].minor.yy202;}
159653 yymsp[-1].minor.yy77 = yylhsminor.yy77;
159654 break;
159655 case 313: /* frame_exclude_opt ::= */
159656 {yymsp[1].minor.yy58 = 0;}
159657 break;
159658 case 314: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
159659 {yymsp[-1].minor.yy58 = yymsp[0].minor.yy58;}
159660 break;
159661 case 315: /* frame_exclude ::= NO OTHERS */
159662 case 316: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==316);
159663 {yymsp[-1].minor.yy58 = yymsp[-1].major; /*A-overwrites-X*/}
159664 break;
159665 case 317: /* frame_exclude ::= GROUP|TIES */
159666 {yymsp[0].minor.yy58 = yymsp[0].major; /*A-overwrites-X*/}
159667 break;
159668 case 318: /* window_clause ::= WINDOW windowdefn_list */
159669 { yymsp[-1].minor.yy303 = yymsp[0].minor.yy303; }
159670 break;
159671 case 319: /* filter_over ::= filter_clause over_clause */
159672 {
159673 yymsp[0].minor.yy303->pFilter = yymsp[-1].minor.yy202;
159674 yylhsminor.yy303 = yymsp[0].minor.yy303;
159675 }
159676 yymsp[-1].minor.yy303 = yylhsminor.yy303;
159677 break;
159678 case 321: /* filter_over ::= filter_clause */
159679 {
159680 yylhsminor.yy303 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
159681 if( yylhsminor.yy303 ){
159682 yylhsminor.yy303->eFrmType = TK_FILTER;
159683 yylhsminor.yy303->pFilter = yymsp[0].minor.yy202;
@@ -159685,88 +160325,88 @@
159685 sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy202);
159686 }
159687 }
159688 yymsp[0].minor.yy303 = yylhsminor.yy303;
159689 break;
159690 case 322: /* over_clause ::= OVER LP window RP */
159691 {
159692 yymsp[-3].minor.yy303 = yymsp[-1].minor.yy303;
159693 assert( yymsp[-3].minor.yy303!=0 );
159694 }
159695 break;
159696 case 323: /* over_clause ::= OVER nm */
159697 {
159698 yymsp[-1].minor.yy303 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
159699 if( yymsp[-1].minor.yy303 ){
159700 yymsp[-1].minor.yy303->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
159701 }
159702 }
159703 break;
159704 case 324: /* filter_clause ::= FILTER LP WHERE expr RP */
159705 { yymsp[-4].minor.yy202 = yymsp[-1].minor.yy202; }
159706 break;
159707 default:
159708 /* (325) input ::= cmdlist */ yytestcase(yyruleno==325);
159709 /* (326) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==326);
159710 /* (327) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=327);
159711 /* (328) ecmd ::= SEMI */ yytestcase(yyruleno==328);
159712 /* (329) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==329);
159713 /* (330) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=330);
159714 /* (331) trans_opt ::= */ yytestcase(yyruleno==331);
159715 /* (332) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==332);
159716 /* (333) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==333);
159717 /* (334) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==334);
159718 /* (335) savepoint_opt ::= */ yytestcase(yyruleno==335);
159719 /* (336) cmd ::= create_table create_table_args */ yytestcase(yyruleno==336);
159720 /* (337) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==337);
159721 /* (338) columnlist ::= columnname carglist */ yytestcase(yyruleno==338);
159722 /* (339) nm ::= ID|INDEXED */ yytestcase(yyruleno==339);
159723 /* (340) nm ::= STRING */ yytestcase(yyruleno==340);
159724 /* (341) nm ::= JOIN_KW */ yytestcase(yyruleno==341);
159725 /* (342) typetoken ::= typename */ yytestcase(yyruleno==342);
159726 /* (343) typename ::= ID|STRING */ yytestcase(yyruleno==343);
159727 /* (344) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=344);
159728 /* (345) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=345);
159729 /* (346) carglist ::= carglist ccons */ yytestcase(yyruleno==346);
159730 /* (347) carglist ::= */ yytestcase(yyruleno==347);
159731 /* (348) ccons ::= NULL onconf */ yytestcase(yyruleno==348);
159732 /* (349) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==349);
159733 /* (350) ccons ::= AS generated */ yytestcase(yyruleno==350);
159734 /* (351) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==351);
159735 /* (352) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==352);
159736 /* (353) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=353);
159737 /* (354) tconscomma ::= */ yytestcase(yyruleno==354);
159738 /* (355) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=355);
159739 /* (356) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=356);
159740 /* (357) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=357);
159741 /* (358) oneselect ::= values */ yytestcase(yyruleno==358);
159742 /* (359) sclp ::= selcollist COMMA */ yytestcase(yyruleno==359);
159743 /* (360) as ::= ID|STRING */ yytestcase(yyruleno==360);
159744 /* (361) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=361);
159745 /* (362) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==362);
159746 /* (363) exprlist ::= nexprlist */ yytestcase(yyruleno==363);
159747 /* (364) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=364);
159748 /* (365) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=365);
159749 /* (366) nmnum ::= ON */ yytestcase(yyruleno==366);
159750 /* (367) nmnum ::= DELETE */ yytestcase(yyruleno==367);
159751 /* (368) nmnum ::= DEFAULT */ yytestcase(yyruleno==368);
159752 /* (369) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==369);
159753 /* (370) foreach_clause ::= */ yytestcase(yyruleno==370);
159754 /* (371) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==371);
159755 /* (372) trnm ::= nm */ yytestcase(yyruleno==372);
159756 /* (373) tridxby ::= */ yytestcase(yyruleno==373);
159757 /* (374) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==374);
159758 /* (375) database_kw_opt ::= */ yytestcase(yyruleno==375);
159759 /* (376) kwcolumn_opt ::= */ yytestcase(yyruleno==376);
159760 /* (377) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==377);
159761 /* (378) vtabarglist ::= vtabarg */ yytestcase(yyruleno==378);
159762 /* (379) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==379);
159763 /* (380) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==380);
159764 /* (381) anylist ::= */ yytestcase(yyruleno==381);
159765 /* (382) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==382);
159766 /* (383) anylist ::= anylist ANY */ yytestcase(yyruleno==383);
159767 /* (384) with ::= */ yytestcase(yyruleno==384);
159768 break;
159769 /********** End reduce actions ************************************************/
159770 };
159771 assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
159772 yygoto = yyRuleInfoLhs[yyruleno];
@@ -160093,12 +160733,12 @@
160093 ** The lookup table is much faster. To maximize speed, and to ensure that
160094 ** a lookup table is used, all of the classes need to be small integers and
160095 ** all of them need to be used within the switch.
160096 */
160097 #define CC_X 0 /* The letter 'x', or start of BLOB literal */
160098 #define CC_KYWD 1 /* Alphabetics or '_'. Usable in a keyword */
160099 #define CC_ID 2 /* unicode characters usable in IDs */
160100 #define CC_DIGIT 3 /* Digits */
160101 #define CC_DOLLAR 4 /* '$' */
160102 #define CC_VARALPHA 5 /* '@', '#', ':'. Alphabetic SQL variables */
160103 #define CC_VARNUM 6 /* '?'. Numeric SQL variables */
160104 #define CC_SPACE 7 /* Space characters */
@@ -160119,24 +160759,25 @@
160119 #define CC_PERCENT 22 /* '%' */
160120 #define CC_COMMA 23 /* ',' */
160121 #define CC_AND 24 /* '&' */
160122 #define CC_TILDA 25 /* '~' */
160123 #define CC_DOT 26 /* '.' */
160124 #define CC_ILLEGAL 27 /* Illegal character */
160125 #define CC_NUL 28 /* 0x00 */
 
160126
160127 static const unsigned char aiClass[] = {
160128 #ifdef SQLITE_ASCII
160129 /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
160130 /* 0x */ 28, 27, 27, 27, 27, 27, 27, 27, 27, 7, 7, 27, 7, 7, 27, 27,
160131 /* 1x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
160132 /* 2x */ 7, 15, 8, 5, 4, 22, 24, 8, 17, 18, 21, 20, 23, 11, 26, 16,
160133 /* 3x */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 19, 12, 14, 13, 6,
160134 /* 4x */ 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
160135 /* 5x */ 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 9, 27, 27, 27, 1,
160136 /* 6x */ 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
160137 /* 7x */ 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 27, 10, 27, 25, 27,
160138 /* 8x */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160139 /* 9x */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160140 /* Ax */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160141 /* Bx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160142 /* Cx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -160144,26 +160785,26 @@
160144 /* Ex */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160145 /* Fx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
160146 #endif
160147 #ifdef SQLITE_EBCDIC
160148 /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
160149 /* 0x */ 27, 27, 27, 27, 27, 7, 27, 27, 27, 27, 27, 27, 7, 7, 27, 27,
160150 /* 1x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
160151 /* 2x */ 27, 27, 27, 27, 27, 7, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
160152 /* 3x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
160153 /* 4x */ 7, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 26, 12, 17, 20, 10,
160154 /* 5x */ 24, 27, 27, 27, 27, 27, 27, 27, 27, 27, 15, 4, 21, 18, 19, 27,
160155 /* 6x */ 11, 16, 27, 27, 27, 27, 27, 27, 27, 27, 27, 23, 22, 1, 13, 6,
160156 /* 7x */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 8, 5, 5, 5, 8, 14, 8,
160157 /* 8x */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27,
160158 /* 9x */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27,
160159 /* Ax */ 27, 25, 1, 1, 1, 1, 1, 0, 1, 1, 27, 27, 27, 27, 27, 27,
160160 /* Bx */ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 9, 27, 27, 27, 27, 27,
160161 /* Cx */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27,
160162 /* Dx */ 27, 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, 27, 27, 27, 27, 27,
160163 /* Ex */ 27, 27, 1, 1, 1, 1, 1, 0, 1, 1, 27, 27, 27, 27, 27, 27,
160164 /* Fx */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 27, 27, 27, 27, 27, 27,
160165 #endif
160166 };
160167
160168 /*
160169 ** The charMap() macro maps alphabetic characters (only) into their
@@ -160504,11 +161145,11 @@
160504 ** return the integer n (the length of the token). */
160505 static int keywordCode(const char *z, int n, int *pType){
160506 int i, j;
160507 const char *zKW;
160508 if( n>=2 ){
160509 i = ((charMap(z[0])*4) ^ (charMap(z[n-1])*3) ^ n) % 127;
160510 for(i=((int)aKWHash[i])-1; i>=0; i=((int)aKWNext[i])-1){
160511 if( aKWLen[i]!=n ) continue;
160512 zKW = &zKWText[aKWOffset[i]];
160513 #ifdef SQLITE_ASCII
160514 if( (z[0]&~0x20)!=zKW[0] ) continue;
@@ -161046,11 +161687,11 @@
161046 }
161047 }
161048 if( n==0 ) *tokenType = TK_ILLEGAL;
161049 return i;
161050 }
161051 case CC_KYWD: {
161052 for(i=1; aiClass[z[i]]<=CC_KYWD; i++){}
161053 if( IdChar(z[i]) ){
161054 /* This token started out using characters that can appear in keywords,
161055 ** but z[i] is a character not allowed within keywords, so this must
161056 ** be an identifier instead */
@@ -161076,10 +161717,11 @@
161076 #endif
161077 /* If it is not a BLOB literal, then it must be an ID, since no
161078 ** SQL keywords start with the letter 'x'. Fall through */
161079 /* no break */ deliberate_fall_through
161080 }
 
161081 case CC_ID: {
161082 i = 1;
161083 break;
161084 }
161085 case CC_NUL: {
@@ -166058,11 +166700,30 @@
166058 *pn = sqlite3BtreeSeekCount(db->aDb->pBt);
166059 (void)db; /* Silence harmless unused variable warning */
166060 break;
166061 }
166062
166063
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166064 }
166065 va_end(ap);
166066 #endif /* SQLITE_UNTESTABLE */
166067 return rc;
166068 }
@@ -215282,12 +215943,12 @@
215282 ){
215283 rc = fts5ExprNodeNext(p, pRoot, 1, iFirst);
215284 }
215285
215286 /* If the iterator is not at a real match, skip forward until it is. */
215287 while( pRoot->bNomatch ){
215288 assert( pRoot->bEof==0 && rc==SQLITE_OK );
215289 rc = fts5ExprNodeNext(p, pRoot, 0, 0);
215290 }
215291 return rc;
215292 }
215293
@@ -220467,11 +221128,11 @@
220467 u8 *pChunk = &pSeg->pLeaf->p[pSeg->iLeafOffset];
220468 int nChunk = MIN(nRem, pSeg->pLeaf->szLeaf - pSeg->iLeafOffset);
220469 int pgno = pSeg->iLeafPgno;
220470 int pgnoSave = 0;
220471
220472 /* This function does notmwork with detail=none databases. */
220473 assert( p->pConfig->eDetail!=FTS5_DETAIL_NONE );
220474
220475 if( (pSeg->flags & FTS5_SEGITER_REVERSE)==0 ){
220476 pgnoSave = pgno+1;
220477 }
@@ -220480,10 +221141,13 @@
220480 xChunk(p, pCtx, pChunk, nChunk);
220481 nRem -= nChunk;
220482 fts5DataRelease(pData);
220483 if( nRem<=0 ){
220484 break;
 
 
 
220485 }else{
220486 pgno++;
220487 pData = fts5LeafRead(p, FTS5_SEGMENT_ROWID(pSeg->pSeg->iSegid, pgno));
220488 if( pData==0 ) break;
220489 pChunk = &pData->p[4];
@@ -220531,70 +221195,76 @@
220531 }
220532 }
220533 }
220534
220535 /*
220536 ** IN/OUT parameter (*pa) points to a position list n bytes in size. If
220537 ** the position list contains entries for column iCol, then (*pa) is set
220538 ** to point to the sub-position-list for that column and the number of
220539 ** bytes in it returned. Or, if the argument position list does not
220540 ** contain any entries for column iCol, return 0.
 
 
 
 
 
220541 */
220542 static int fts5IndexExtractCol(
220543 const u8 **pa, /* IN/OUT: Pointer to poslist */
220544 int n, /* IN: Size of poslist in bytes */
220545 int iCol /* Column to extract from poslist */
220546 ){
220547 int iCurrent = 0; /* Anything before the first 0x01 is col 0 */
220548 const u8 *p = *pa;
220549 const u8 *pEnd = &p[n]; /* One byte past end of position list */
220550
220551 while( iCol>iCurrent ){
220552 /* Advance pointer p until it points to pEnd or an 0x01 byte that is
220553 ** not part of a varint. Note that it is not possible for a negative
220554 ** or extremely large varint to occur within an uncorrupted position
220555 ** list. So the last byte of each varint may be assumed to have a clear
220556 ** 0x80 bit. */
220557 while( *p!=0x01 ){
220558 while( *p++ & 0x80 );
220559 if( p>=pEnd ) return 0;
220560 }
220561 *pa = p++;
220562 iCurrent = *p++;
220563 if( iCurrent & 0x80 ){
220564 p--;
220565 p += fts5GetVarint32(p, iCurrent);
220566 }
220567 }
220568 if( iCol!=iCurrent ) return 0;
220569
220570 /* Advance pointer p until it points to pEnd or an 0x01 byte that is
220571 ** not part of a varint */
220572 while( p<pEnd && *p!=0x01 ){
220573 while( *p++ & 0x80 );
220574 }
220575
220576 return p - (*pa);
220577 }
220578
220579 static void fts5IndexExtractColset(
220580 int *pRc,
220581 Fts5Colset *pColset, /* Colset to filter on */
220582 const u8 *pPos, int nPos, /* Position list */
220583 Fts5Buffer *pBuf /* Output buffer */
220584 ){
220585 if( *pRc==SQLITE_OK ){
220586 int i;
220587 fts5BufferZero(pBuf);
220588 for(i=0; i<pColset->nCol; i++){
220589 const u8 *pSub = pPos;
220590 int nSub = fts5IndexExtractCol(&pSub, nPos, pColset->aiCol[i]);
220591 if( nSub ){
220592 fts5BufferAppendBlob(pRc, pBuf, nSub, pSub);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220593 }
220594 }
220595 }
 
220596 }
220597
220598 /*
220599 ** xSetOutputs callback used by detail=none tables.
220600 */
@@ -220710,20 +221380,13 @@
220710
220711 if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){
220712 /* All data is stored on the current page. Populate the output
220713 ** variables to point into the body of the page object. */
220714 const u8 *a = &pSeg->pLeaf->p[pSeg->iLeafOffset];
220715 if( pColset->nCol==1 ){
220716 pIter->base.nData = fts5IndexExtractCol(&a, pSeg->nPos,pColset->aiCol[0]);
220717 pIter->base.pData = a;
220718 }else{
220719 int *pRc = &pIter->pIndex->rc;
220720 fts5BufferZero(&pIter->poslist);
220721 fts5IndexExtractColset(pRc, pColset, a, pSeg->nPos, &pIter->poslist);
220722 pIter->base.pData = pIter->poslist.p;
220723 pIter->base.nData = pIter->poslist.n;
220724 }
220725 }else{
220726 /* The data is distributed over two or more pages. Copy it into the
220727 ** Fts5Iter.poslist buffer and then set the output pointer to point
220728 ** to this buffer. */
220729 fts5BufferZero(&pIter->poslist);
@@ -222202,11 +222865,11 @@
222202
222203
222204 static void fts5DoclistIterNext(Fts5DoclistIter *pIter){
222205 u8 *p = pIter->aPoslist + pIter->nSize + pIter->nPoslist;
222206
222207 assert( pIter->aPoslist );
222208 if( p>=pIter->aEof ){
222209 pIter->aPoslist = 0;
222210 }else{
222211 i64 iDelta;
222212
@@ -222286,20 +222949,24 @@
222286 ** In this case the buffers consist of a delta-encoded list of rowids only.
222287 */
222288 static void fts5MergeRowidLists(
222289 Fts5Index *p, /* FTS5 backend object */
222290 Fts5Buffer *p1, /* First list to merge */
222291 Fts5Buffer *p2 /* Second list to merge */
 
222292 ){
222293 int i1 = 0;
222294 int i2 = 0;
222295 i64 iRowid1 = 0;
222296 i64 iRowid2 = 0;
222297 i64 iOut = 0;
222298
222299 Fts5Buffer out;
 
 
222300 memset(&out, 0, sizeof(out));
 
222301 sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n);
222302 if( p->rc ) return;
222303
222304 fts5NextRowid(p1, &i1, &iRowid1);
222305 fts5NextRowid(p2, &i2, &iRowid2);
@@ -222321,185 +222988,218 @@
222321 }
222322
222323 fts5BufferSwap(&out, p1);
222324 fts5BufferFree(&out);
222325 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222326
222327 /*
222328 ** Buffers p1 and p2 contain doclists. This function merges the content
222329 ** of the two doclists together and sets buffer p1 to the result before
222330 ** returning.
222331 **
222332 ** If an error occurs, an error code is left in p->rc. If an error has
222333 ** already occurred, this function is a no-op.
222334 */
222335 static void fts5MergePrefixLists(
222336 Fts5Index *p, /* FTS5 backend object */
222337 Fts5Buffer *p1, /* First list to merge */
222338 Fts5Buffer *p2 /* Second list to merge */
222339 ){
222340 if( p2->n ){
222341 i64 iLastRowid = 0;
222342 Fts5DoclistIter i1;
222343 Fts5DoclistIter i2;
222344 Fts5Buffer out = {0, 0, 0};
222345 Fts5Buffer tmp = {0, 0, 0};
222346
222347 /* The maximum size of the output is equal to the sum of the two
222348 ** input sizes + 1 varint (9 bytes). The extra varint is because if the
222349 ** first rowid in one input is a large negative number, and the first in
222350 ** the other a non-negative number, the delta for the non-negative
222351 ** number will be larger on disk than the literal integer value
222352 ** was.
222353 **
222354 ** Or, if the input position-lists are corrupt, then the output might
222355 ** include up to 2 extra 10-byte positions created by interpreting -1
222356 ** (the value PoslistNext64() uses for EOF) as a position and appending
222357 ** it to the output. This can happen at most once for each input
222358 ** position-list, hence two 10 byte paddings. */
222359 if( sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n + 9+10+10) ) return;
222360 fts5DoclistIterInit(p1, &i1);
222361 fts5DoclistIterInit(p2, &i2);
222362
222363 while( 1 ){
222364 if( i1.iRowid<i2.iRowid ){
222365 /* Copy entry from i1 */
222366 fts5MergeAppendDocid(&out, iLastRowid, i1.iRowid);
222367 fts5BufferSafeAppendBlob(&out, i1.aPoslist, i1.nPoslist+i1.nSize);
222368 fts5DoclistIterNext(&i1);
222369 if( i1.aPoslist==0 ) break;
222370 assert( out.n<=((i1.aPoslist-p1->p) + (i2.aPoslist-p2->p)+9+10+10) );
222371 }
222372 else if( i2.iRowid!=i1.iRowid ){
222373 /* Copy entry from i2 */
222374 fts5MergeAppendDocid(&out, iLastRowid, i2.iRowid);
222375 fts5BufferSafeAppendBlob(&out, i2.aPoslist, i2.nPoslist+i2.nSize);
222376 fts5DoclistIterNext(&i2);
222377 if( i2.aPoslist==0 ) break;
222378 assert( out.n<=((i1.aPoslist-p1->p) + (i2.aPoslist-p2->p)+9+10+10) );
222379 }
222380 else{
222381 /* Merge the two position lists. */
222382 i64 iPos1 = 0;
222383 i64 iPos2 = 0;
222384 int iOff1 = 0;
222385 int iOff2 = 0;
222386 u8 *a1 = &i1.aPoslist[i1.nSize];
222387 u8 *a2 = &i2.aPoslist[i2.nSize];
222388 int nCopy;
222389 u8 *aCopy;
222390
222391 i64 iPrev = 0;
222392 Fts5PoslistWriter writer;
222393 memset(&writer, 0, sizeof(writer));
222394
222395 /* See the earlier comment in this function for an explanation of why
222396 ** corrupt input position lists might cause the output to consume
222397 ** at most 20 bytes of unexpected space. */
222398 fts5MergeAppendDocid(&out, iLastRowid, i2.iRowid);
222399 fts5BufferZero(&tmp);
222400 sqlite3Fts5BufferSize(&p->rc, &tmp,
222401 i1.nPoslist + i2.nPoslist + 10 + 10 + FTS5_DATA_ZERO_PADDING
222402 );
222403 if( p->rc ) break;
222404
222405 sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1);
222406 sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2);
222407 assert_nc( iPos1>=0 && iPos2>=0 );
222408
222409 if( iPos1<iPos2 ){
222410 sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1);
222411 sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1);
222412 }else{
222413 sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2);
222414 sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2);
222415 }
222416 if( iPos1>=0 && iPos2>=0 ){
222417 while( 1 ){
222418 if( iPos1<iPos2 ){
222419 if( iPos1!=iPrev ){
222420 sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1);
222421 }
222422 sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1);
222423 if( iPos1<0 ) break;
222424 }else{
222425 assert_nc( iPos2!=iPrev );
222426 sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2);
222427 sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2);
222428 if( iPos2<0 ) break;
222429 }
222430 }
222431 }
222432
222433 if( iPos1>=0 ){
222434 if( iPos1!=iPrev ){
222435 sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1);
222436 }
222437 aCopy = &a1[iOff1];
222438 nCopy = i1.nPoslist - iOff1;
222439 }else{
222440 assert_nc( iPos2>=0 && iPos2!=iPrev );
222441 sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2);
222442 aCopy = &a2[iOff2];
222443 nCopy = i2.nPoslist - iOff2;
222444 }
222445 if( nCopy>0 ){
222446 fts5BufferSafeAppendBlob(&tmp, aCopy, nCopy);
222447 }
222448
222449 /* WRITEPOSLISTSIZE */
222450 assert_nc( tmp.n<=i1.nPoslist+i2.nPoslist );
222451 assert( tmp.n<=i1.nPoslist+i2.nPoslist+10+10 );
222452 if( tmp.n>i1.nPoslist+i2.nPoslist ){
222453 if( p->rc==SQLITE_OK ) p->rc = FTS5_CORRUPT;
222454 break;
222455 }
222456 fts5BufferSafeAppendVarint(&out, tmp.n * 2);
222457 fts5BufferSafeAppendBlob(&out, tmp.p, tmp.n);
222458 fts5DoclistIterNext(&i1);
222459 fts5DoclistIterNext(&i2);
222460 assert_nc( out.n<=(p1->n+p2->n+9) );
222461 if( i1.aPoslist==0 || i2.aPoslist==0 ) break;
222462 assert( out.n<=((i1.aPoslist-p1->p) + (i2.aPoslist-p2->p)+9+10+10) );
222463 }
222464 }
222465
222466 if( i1.aPoslist ){
222467 fts5MergeAppendDocid(&out, iLastRowid, i1.iRowid);
222468 fts5BufferSafeAppendBlob(&out, i1.aPoslist, i1.aEof - i1.aPoslist);
222469 }
222470 else if( i2.aPoslist ){
222471 fts5MergeAppendDocid(&out, iLastRowid, i2.iRowid);
222472 fts5BufferSafeAppendBlob(&out, i2.aPoslist, i2.aEof - i2.aPoslist);
222473 }
222474 assert_nc( out.n<=(p1->n+p2->n+9) );
222475
222476 fts5BufferFree(p1);
222477 fts5BufferFree(&tmp);
222478 memset(&out.p[out.n], 0, FTS5_DATA_ZERO_PADDING);
222479 *p1 = out;
222480 }
222481 }
222482
222483 static void fts5SetupPrefixIter(
222484 Fts5Index *p, /* Index to read from */
222485 int bDesc, /* True for "ORDER BY rowid DESC" */
222486 const u8 *pToken, /* Buffer containing prefix to match */
 
222487 int nToken, /* Size of buffer pToken in bytes */
222488 Fts5Colset *pColset, /* Restrict matches to these columns */
222489 Fts5Iter **ppIter /* OUT: New iterator */
222490 ){
222491 Fts5Structure *pStruct;
222492 Fts5Buffer *aBuf;
222493 const int nBuf = 32;
 
222494
222495 void (*xMerge)(Fts5Index*, Fts5Buffer*, Fts5Buffer*);
222496 void (*xAppend)(Fts5Index*, i64, Fts5Iter*, Fts5Buffer*);
222497 if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){
222498 xMerge = fts5MergeRowidLists;
222499 xAppend = fts5AppendRowid;
222500 }else{
 
 
222501 xMerge = fts5MergePrefixLists;
222502 xAppend = fts5AppendPoslist;
222503 }
222504
222505 aBuf = (Fts5Buffer*)fts5IdxMalloc(p, sizeof(Fts5Buffer)*nBuf);
@@ -222515,10 +223215,31 @@
222515 Fts5Data *pData;
222516 Fts5Buffer doclist;
222517 int bNewTerm = 1;
222518
222519 memset(&doclist, 0, sizeof(doclist));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222520 fts5MultiIterNew(p, pStruct, flags, pColset, pToken, nToken, -1, 0, &p1);
222521 fts5IterSetOutputCb(&p->rc, p1);
222522 for( /* no-op */ ;
222523 fts5MultiIterEof(p, p1)==0;
222524 fts5MultiIterNext2(p, p1, &bNewTerm)
@@ -222535,31 +223256,43 @@
222535
222536 if( p1->base.nData==0 ) continue;
222537
222538 if( p1->base.iRowid<=iLastRowid && doclist.n>0 ){
222539 for(i=0; p->rc==SQLITE_OK && doclist.n; i++){
222540 assert( i<nBuf );
222541 if( aBuf[i].n==0 ){
222542 fts5BufferSwap(&doclist, &aBuf[i]);
222543 fts5BufferZero(&doclist);
222544 }else{
222545 xMerge(p, &doclist, &aBuf[i]);
222546 fts5BufferZero(&aBuf[i]);
 
 
 
 
 
 
 
 
222547 }
222548 }
222549 iLastRowid = 0;
222550 }
222551
222552 xAppend(p, p1->base.iRowid-iLastRowid, p1, &doclist);
222553 iLastRowid = p1->base.iRowid;
222554 }
222555
222556 for(i=0; i<nBuf; i++){
 
 
222557 if( p->rc==SQLITE_OK ){
222558 xMerge(p, &doclist, &aBuf[i]);
222559 }
222560 fts5BufferFree(&aBuf[i]);
 
 
222561 }
222562 fts5MultiIterFree(p1);
222563
222564 pData = fts5IdxMalloc(p, sizeof(Fts5Data)+doclist.n+FTS5_DATA_ZERO_PADDING);
222565 if( pData ){
@@ -222810,10 +223543,11 @@
222810 /* If the QUERY_SCAN flag is set, all other flags must be clear. */
222811 assert( (flags & FTS5INDEX_QUERY_SCAN)==0 || flags==FTS5INDEX_QUERY_SCAN );
222812
222813 if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){
222814 int iIdx = 0; /* Index to search */
 
222815 if( nToken ) memcpy(&buf.p[1], pToken, nToken);
222816
222817 /* Figure out which index to search and set iIdx accordingly. If this
222818 ** is a prefix query for which there is no prefix index, set iIdx to
222819 ** greater than pConfig->nPrefix to indicate that the query will be
@@ -222831,11 +223565,13 @@
222831 }else
222832 #endif
222833 if( flags & FTS5INDEX_QUERY_PREFIX ){
222834 int nChar = fts5IndexCharlen(pToken, nToken);
222835 for(iIdx=1; iIdx<=pConfig->nPrefix; iIdx++){
222836 if( pConfig->aPrefix[iIdx-1]==nChar ) break;
 
 
222837 }
222838 }
222839
222840 if( iIdx<=pConfig->nPrefix ){
222841 /* Straight index lookup */
@@ -222848,12 +223584,11 @@
222848 fts5StructureRelease(pStruct);
222849 }
222850 }else{
222851 /* Scan multiple terms in the main index */
222852 int bDesc = (flags & FTS5INDEX_QUERY_DESC)!=0;
222853 buf.p[0] = FTS5_MAIN_PREFIX;
222854 fts5SetupPrefixIter(p, bDesc, buf.p, nToken+1, pColset, &pRet);
222855 assert( p->rc!=SQLITE_OK || pRet->pColset==0 );
222856 fts5IterSetOutputCb(&p->rc, pRet);
222857 if( p->rc==SQLITE_OK ){
222858 Fts5SegIter *pSeg = &pRet->aSeg[pRet->aFirst[1].iFirst];
222859 if( pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg);
@@ -226817,11 +227552,11 @@
226817 int nArg, /* Number of args */
226818 sqlite3_value **apUnused /* Function arguments */
226819 ){
226820 assert( nArg==0 );
226821 UNUSED_PARAM2(nArg, apUnused);
226822 sqlite3_result_text(pCtx, "fts5: 2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b", -1, SQLITE_TRANSIENT);
226823 }
226824
226825 /*
226826 ** Return true if zName is the extension on one of the shadow tables used
226827 ** by this module.
@@ -231743,12 +232478,12 @@
231743 }
231744 #endif /* SQLITE_CORE */
231745 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
231746
231747 /************** End of stmt.c ************************************************/
231748 #if __LINE__!=231748
231749 #undef SQLITE_SOURCE_ID
231750 #define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089falt2"
231751 #endif
231752 /* Return the source-id for this library */
231753 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
231754 /************************** End of sqlite3.c ******************************/
231755
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.35.0. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -281,10 +281,13 @@
281 #if SQLITE_ENABLE_LOAD_EXTENSION
282 "ENABLE_LOAD_EXTENSION",
283 #endif
284 #ifdef SQLITE_ENABLE_LOCKING_STYLE
285 "ENABLE_LOCKING_STYLE=" CTIMEOPT_VAL(SQLITE_ENABLE_LOCKING_STYLE),
286 #endif
287 #if SQLITE_ENABLE_MATH_FUNCTIONS
288 "ENABLE_MATH_FUNCTIONS"
289 #endif
290 #if SQLITE_ENABLE_MEMORY_MANAGEMENT
291 "ENABLE_MEMORY_MANAGEMENT",
292 #endif
293 #if SQLITE_ENABLE_MEMSYS3
@@ -988,10 +991,22 @@
991 # define MSVC_VERSION _MSC_VER
992 #else
993 # define MSVC_VERSION 0
994 #endif
995
996 /*
997 ** Some C99 functions in "math.h" are only present for MSVC when its version
998 ** is associated with Visual Studio 2013 or higher.
999 */
1000 #ifndef SQLITE_HAVE_C99_MATH_FUNCS
1001 # if MSVC_VERSION==0 || MSVC_VERSION>=1800
1002 # define SQLITE_HAVE_C99_MATH_FUNCS (1)
1003 # else
1004 # define SQLITE_HAVE_C99_MATH_FUNCS (0)
1005 # endif
1006 #endif
1007
1008 /* Needed for various definitions... */
1009 #if defined(__GNUC__) && !defined(_GNU_SOURCE)
1010 # define _GNU_SOURCE
1011 #endif
1012
@@ -1169,13 +1184,13 @@
1184 **
1185 ** See also: [sqlite3_libversion()],
1186 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1187 ** [sqlite_version()] and [sqlite_source_id()].
1188 */
1189 #define SQLITE_VERSION "3.35.0"
1190 #define SQLITE_VERSION_NUMBER 3035000
1191 #define SQLITE_SOURCE_ID "2020-12-15 13:55:38 ea0a7f103a6f6a9e57d7377140ff9f372bf2b156f86f148291fb05a7030f2b36"
1192
1193 /*
1194 ** CAPI3REF: Run-Time Library Version Numbers
1195 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1196 **
@@ -8811,11 +8826,12 @@
8826 #define SQLITE_TESTCTRL_PARSER_COVERAGE 26
8827 #define SQLITE_TESTCTRL_RESULT_INTREAL 27
8828 #define SQLITE_TESTCTRL_PRNG_SEED 28
8829 #define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
8830 #define SQLITE_TESTCTRL_SEEK_COUNT 30
8831 #define SQLITE_TESTCTRL_TRACEFLAGS 31
8832 #define SQLITE_TESTCTRL_LAST 31 /* Largest TESTCTRL */
8833
8834 /*
8835 ** CAPI3REF: SQL Keyword Checking
8836 **
8837 ** These routines provide access to the set of SQL language keywords
@@ -14592,25 +14608,39 @@
14608
14609 /*
14610 ** SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not
14611 ** the Select query generator tracing logic is turned on.
14612 */
14613 #if !defined(SQLITE_AMALGAMATION)
14614 SQLITE_PRIVATE u32 sqlite3SelectTrace;
 
 
14615 #endif
14616 #if defined(SQLITE_DEBUG) \
14617 && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_SELECTTRACE))
14618 # define SELECTTRACE_ENABLED 1
14619 # define SELECTTRACE(K,P,S,X) \
14620 if(sqlite3SelectTrace&(K)) \
14621 sqlite3DebugPrintf("%u/%d/%p: ",(S)->selId,(P)->addrExplain,(S)),\
14622 sqlite3DebugPrintf X
14623 #else
14624 # define SELECTTRACE(K,P,S,X)
14625 # define SELECTTRACE_ENABLED 0
14626 #endif
14627
14628 /*
14629 ** Macros for "wheretrace"
14630 */
14631 #if !defined(SQLITE_AMAGAMATION)
14632 SQLITE_PRIVATE u32 sqlite3WhereTrace;
14633 #endif
14634 #if defined(SQLITE_DEBUG) \
14635 && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_WHERETRACE))
14636 # define WHERETRACE(K,X) if(sqlite3WhereTrace&(K)) sqlite3DebugPrintf X
14637 # define WHERETRACE_ENABLED 1
14638 #else
14639 # define WHERETRACE(K,X)
14640 #endif
14641
14642
14643 /*
14644 ** An instance of the following structure is used to store the busy-handler
14645 ** callback for a given sqlite handle.
14646 **
@@ -15316,10 +15346,11 @@
15346
15347 /* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */
15348 #define BTREE_SAVEPOSITION 0x02 /* Leave cursor pointing at NEXT or PREV */
15349 #define BTREE_AUXDELETE 0x04 /* not the primary delete operation */
15350 #define BTREE_APPEND 0x08 /* Insert is likely an append */
15351 #define BTREE_PREFORMAT 0x80 /* Insert is likely an append */
15352
15353 /* An instance of the BtreePayload object describes the content of a single
15354 ** entry in either an index or table btree.
15355 **
15356 ** Index btrees (used for indexes and also WITHOUT ROWID tables) contain
@@ -15414,10 +15445,12 @@
15445 #endif
15446
15447 #ifndef SQLITE_OMIT_WAL
15448 SQLITE_PRIVATE int sqlite3BtreeCheckpoint(Btree*, int, int *, int *);
15449 #endif
15450
15451 SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor*, BtCursor*, i64);
15452
15453 /*
15454 ** If we are not using shared cache, then there is no need to
15455 ** use mutexes to access the BtShared structures. So make the
15456 ** Enter and Leave procedures no-ops.
@@ -15757,64 +15790,65 @@
15790 #define OP_SeekScan 118 /* synopsis: Scan-ahead up to P1 rows */
15791 #define OP_SeekHit 119 /* synopsis: set P2<=seekHit<=P3 */
15792 #define OP_Sequence 120 /* synopsis: r[P2]=cursor[P1].ctr++ */
15793 #define OP_NewRowid 121 /* synopsis: r[P2]=rowid */
15794 #define OP_Insert 122 /* synopsis: intkey=r[P3] data=r[P2] */
15795 #define OP_RowCell 123
15796 #define OP_Delete 124
15797 #define OP_ResetCount 125
15798 #define OP_SorterCompare 126 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
15799 #define OP_SorterData 127 /* synopsis: r[P2]=data */
15800 #define OP_RowData 128 /* synopsis: r[P2]=data */
15801 #define OP_Rowid 129 /* synopsis: r[P2]=rowid */
15802 #define OP_NullRow 130
15803 #define OP_SeekEnd 131
15804 #define OP_IdxInsert 132 /* synopsis: key=r[P2] */
15805 #define OP_SorterInsert 133 /* synopsis: key=r[P2] */
15806 #define OP_IdxDelete 134 /* synopsis: key=r[P2@P3] */
15807 #define OP_DeferredSeek 135 /* synopsis: Move P3 to P1.rowid if needed */
15808 #define OP_IdxRowid 136 /* synopsis: r[P2]=rowid */
15809 #define OP_FinishSeek 137
15810 #define OP_Destroy 138
15811 #define OP_Clear 139
15812 #define OP_ResetSorter 140
15813 #define OP_CreateBtree 141 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
15814 #define OP_SqlExec 142
15815 #define OP_ParseSchema 143
15816 #define OP_LoadAnalysis 144
15817 #define OP_DropTable 145
15818 #define OP_DropIndex 146
15819 #define OP_DropTrigger 147
15820 #define OP_IntegrityCk 148
15821 #define OP_RowSetAdd 149 /* synopsis: rowset(P1)=r[P2] */
15822 #define OP_Real 150 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
15823 #define OP_Param 151
15824 #define OP_FkCounter 152 /* synopsis: fkctr[P1]+=P2 */
15825 #define OP_MemMax 153 /* synopsis: r[P1]=max(r[P1],r[P2]) */
15826 #define OP_OffsetLimit 154 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
15827 #define OP_AggInverse 155 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
15828 #define OP_AggStep 156 /* synopsis: accum=r[P3] step(r[P2@P5]) */
15829 #define OP_AggStep1 157 /* synopsis: accum=r[P3] step(r[P2@P5]) */
15830 #define OP_AggValue 158 /* synopsis: r[P3]=value N=P2 */
15831 #define OP_AggFinal 159 /* synopsis: accum=r[P1] N=P2 */
15832 #define OP_Expire 160
15833 #define OP_CursorLock 161
15834 #define OP_CursorUnlock 162
15835 #define OP_TableLock 163 /* synopsis: iDb=P1 root=P2 write=P3 */
15836 #define OP_VBegin 164
15837 #define OP_VCreate 165
15838 #define OP_VDestroy 166
15839 #define OP_VOpen 167
15840 #define OP_VColumn 168 /* synopsis: r[P3]=vcolumn(P2) */
15841 #define OP_VRename 169
15842 #define OP_Pagecount 170
15843 #define OP_MaxPgcnt 171
15844 #define OP_Trace 172
15845 #define OP_CursorHint 173
15846 #define OP_ReleaseReg 174 /* synopsis: release r[P1@P2] mask P3 */
15847 #define OP_Noop 175
15848 #define OP_Explain 176
15849 #define OP_Abortable 177
15850
15851 /* Properties such as "out2" or "jump" that are specified in
15852 ** comments following the "case" for each opcode in the vdbe.c
15853 ** are encoded into bitvectors as follows:
15854 */
@@ -15839,17 +15873,17 @@
15873 /* 88 */ 0x20, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\
15874 /* 96 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x26, 0x26,\
15875 /* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x00,\
15876 /* 112 */ 0x12, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\
15877 /* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15878 /* 128 */ 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,\
15879 /* 136 */ 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00,\
15880 /* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10,\
15881 /* 152 */ 0x00, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,\
15882 /* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
15883 /* 168 */ 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00,\
15884 /* 176 */ 0x00, 0x00,}
15885
15886 /* The sqlite3P2Values() routine is able to run faster if it knows
15887 ** the value of the largest JUMP opcode. The smaller the maximum
15888 ** JUMP opcode the better, so the mkopcodeh.tcl script that
15889 ** generated this include file strives to group all JUMP opcodes
@@ -17285,10 +17319,13 @@
17319 ** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions
17320 ** and functions like sqlite_version() that can change, but not during
17321 ** a single query. The iArg is ignored. The user-data is always set
17322 ** to a NULL pointer. The bNC parameter is not used.
17323 **
17324 ** MFUNCTION(zName, nArg, xPtr, xFunc)
17325 ** For math-library functions. xPtr is an arbitrary pointer.
17326 **
17327 ** PURE_DATE(zName, nArg, iArg, bNC, xFunc)
17328 ** Used for "pure" date/time functions, this macro is like DFUNCTION
17329 ** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is
17330 ** ignored and the user-data for these functions is set to an
17331 ** arbitrary non-NULL pointer. The bNC parameter is not used.
@@ -17320,10 +17357,13 @@
17357 {nArg, SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
17358 SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, 0, #zName, {0} }
17359 #define SFUNCTION(zName, nArg, iArg, bNC, xFunc) \
17360 {nArg, SQLITE_UTF8|SQLITE_DIRECTONLY|SQLITE_FUNC_UNSAFE, \
17361 SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, 0, #zName, {0} }
17362 #define MFUNCTION(zName, nArg, xPtr, xFunc) \
17363 {nArg, SQLITE_FUNC_CONSTANT|SQLITE_UTF8, \
17364 xPtr, 0, xFunc, 0, 0, 0, #zName, {0} }
17365 #define INLINE_FUNC(zName, nArg, iArg, mFlags) \
17366 {nArg, SQLITE_UTF8|SQLITE_FUNC_INLINE|SQLITE_FUNC_CONSTANT|(mFlags), \
17367 SQLITE_INT_TO_PTR(iArg), 0, noopFunc, 0, 0, 0, #zName, {0} }
17368 #define TEST_FUNC(zName, nArg, iArg, mFlags) \
17369 {nArg, SQLITE_UTF8|SQLITE_FUNC_INTERNAL|SQLITE_FUNC_TEST| \
@@ -17719,20 +17759,26 @@
17759 ** occurs. IGNORE means that the particular row that caused the constraint
17760 ** error is not inserted or updated. Processing continues and no error
17761 ** is returned. REPLACE means that preexisting database rows that caused
17762 ** a UNIQUE constraint violation are removed so that the new insert or
17763 ** update can proceed. Processing continues and no error is reported.
17764 ** UPDATE applies to insert operations only and means that the insert
17765 ** is omitted and the DO UPDATE clause of an upsert is run instead.
17766 **
17767 ** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys.
17768 ** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the
17769 ** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign
17770 ** key is set to NULL. SETDFLT means that the foreign key is set
17771 ** to its default value. CASCADE means that a DELETE or UPDATE of the
17772 ** referenced table row is propagated into the row that holds the
17773 ** foreign key.
17774 **
17775 ** The OE_Default value is a place holder that means to use whatever
17776 ** conflict resolution algorthm is required from context.
17777 **
17778 ** The following symbolic values are used to record which type
17779 ** of conflict resolution action to take.
17780 */
17781 #define OE_None 0 /* There is no constraint to check */
17782 #define OE_Rollback 1 /* Fail the operation and rollback the transaction */
17783 #define OE_Abort 2 /* Back out changes but do no rollback transaction */
17784 #define OE_Fail 3 /* Stop the operation but leave all prior changes */
@@ -18482,19 +18528,25 @@
18528 ** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The
18529 ** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the
18530 ** WHERE clause is omitted.
18531 */
18532 struct Upsert {
18533 ExprList *pUpsertTarget; /* Optional description of conflict target */
18534 Expr *pUpsertTargetWhere; /* WHERE clause for partial index targets */
18535 ExprList *pUpsertSet; /* The SET clause from an ON CONFLICT UPDATE */
18536 Expr *pUpsertWhere; /* WHERE clause for the ON CONFLICT UPDATE */
18537 Upsert *pNextUpsert; /* Next ON CONFLICT clause in the list */
18538 u8 isDoUpdate; /* True for DO UPDATE. False for DO NOTHING */
18539 /* Above this point is the parse tree for the ON CONFLICT clauses.
18540 ** The next group of fields stores intermediate data. */
18541 void *pToFree; /* Free memory when deleting the Upsert object */
18542 /* All fields above are owned by the Upsert object and must be freed
18543 ** when the Upsert is destroyed. The fields below are used to transfer
18544 ** information from the INSERT processing down into the UPDATE processing
18545 ** while generating code. The fields below are owned by the INSERT
18546 ** statement and will be freed by INSERT processing. */
18547 Index *pUpsertIdx; /* UNIQUE constraint specified by pUpsertTarget */
18548 SrcList *pUpsertSrc; /* Table to be updated */
18549 int regData; /* First register holding array of VALUES */
18550 int iDataCur; /* Index of the data cursor */
18551 int iIdxCur; /* Index of the first index cursor */
18552 };
@@ -18932,10 +18984,11 @@
18984 #define OPFLAG_P2ISREG 0x10 /* P2 to OP_Open** is a register number */
18985 #define OPFLAG_PERMUTE 0x01 /* OP_Compare: use the permutation */
18986 #define OPFLAG_SAVEPOSITION 0x02 /* OP_Delete/Insert: save cursor pos */
18987 #define OPFLAG_AUXDELETE 0x04 /* OP_Delete: index in a DELETE op */
18988 #define OPFLAG_NOCHNG_MAGIC 0x6d /* OP_MakeRecord: serialtype 10 is ok */
18989 #define OPFLAG_PREFORMAT 0x80 /* OP_Insert uses preformatted cell */
18990
18991 /*
18992 * Each trigger present in the database schema is stored as an instance of
18993 * struct Trigger.
18994 *
@@ -20029,11 +20082,10 @@
20082 SQLITE_PRIVATE const char sqlite3StrBINARY[];
20083 SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[];
20084 SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[];
20085 SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config;
20086 SQLITE_PRIVATE FuncDefHash sqlite3BuiltinFunctions;
 
20087 #ifndef SQLITE_OMIT_WSD
20088 SQLITE_PRIVATE int sqlite3PendingByte;
20089 #endif
20090 #endif /* SQLITE_AMALGAMATION */
20091 #ifdef VDBE_PROFILE
@@ -20240,19 +20292,23 @@
20292 #else
20293 #define sqlite3WithPush(x,y,z)
20294 #define sqlite3WithDelete(x,y)
20295 #endif
20296 #ifndef SQLITE_OMIT_UPSERT
20297 SQLITE_PRIVATE Upsert *sqlite3UpsertNew(sqlite3*,ExprList*,Expr*,ExprList*,Expr*,Upsert*);
20298 SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3*,Upsert*);
20299 SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3*,Upsert*);
20300 SQLITE_PRIVATE int sqlite3UpsertAnalyzeTarget(Parse*,SrcList*,Upsert*);
20301 SQLITE_PRIVATE void sqlite3UpsertDoUpdate(Parse*,Upsert*,Table*,Index*,int);
20302 SQLITE_PRIVATE Upsert *sqlite3UpsertOfIndex(Upsert*,Index*);
20303 SQLITE_PRIVATE int sqlite3UpsertNextIsIPK(Upsert*);
20304 #else
20305 #define sqlite3UpsertNew(u,v,w,x,y,z) ((Upsert*)0)
20306 #define sqlite3UpsertDelete(x,y)
20307 #define sqlite3UpsertDup(x,y) ((Upsert*)0)
20308 #define sqlite3UpsertOfIndex(x,y) ((Upsert*)0)
20309 #define sqlite3UpsertNextIsIPK(x) 0
20310 #endif
20311
20312
20313 /* Declarations for functions in fkey.c. All of these are replaced by
20314 ** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
@@ -20744,13 +20800,14 @@
20800 #ifndef SQLITE_OMIT_WSD
20801 SQLITE_PRIVATE int sqlite3PendingByte = 0x40000000;
20802 #endif
20803
20804 /*
20805 ** Tracing flags set by SQLITE_TESTCTRL_TRACEFLAGS.
20806 */
20807 SQLITE_PRIVATE u32 sqlite3SelectTrace = 0;
20808 SQLITE_PRIVATE u32 sqlite3WhereTrace = 0;
20809
20810 /* #include "opcodes.h" */
20811 /*
20812 ** Properties of opcodes. The OPFLG_INITIALIZER macro is
20813 ** created by mkopcodeh.awk during compilation. Data is obtained
@@ -23170,10 +23227,12 @@
23227 SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
23228 if( id->pMethods==0 ) return SQLITE_NOTFOUND;
23229 #ifdef SQLITE_TEST
23230 if( op!=SQLITE_FCNTL_COMMIT_PHASETWO
23231 && op!=SQLITE_FCNTL_LOCK_TIMEOUT
23232 && op!=SQLITE_FCNTL_CKPT_DONE
23233 && op!=SQLITE_FCNTL_CKPT_START
23234 ){
23235 /* Faults are not injected into COMMIT_PHASETWO because, assuming SQLite
23236 ** is using a regular VFS, it is called after the corresponding
23237 ** transaction has been committed. Injecting a fault at this point
23238 ** confuses the test scripts - the COMMIT comand returns SQLITE_NOMEM
@@ -23180,11 +23239,16 @@
23239 ** but the transaction is committed anyway.
23240 **
23241 ** The core must call OsFileControl() though, not OsFileControlHint(),
23242 ** as if a custom VFS (e.g. zipvfs) returns an error here, it probably
23243 ** means the commit really has failed and an error should be returned
23244 ** to the user.
23245 **
23246 ** The CKPT_DONE and CKPT_START file-controls are write-only signals
23247 ** to the cksumvfs. Their return code is meaningless and is ignored
23248 ** by the SQLite core, so there is no point in simulating OOMs for them.
23249 */
23250 DO_OS_MALLOC_TEST(id);
23251 }
23252 #endif
23253 return id->pMethods->xFileControl(id, op, pArg);
23254 }
@@ -33371,64 +33435,65 @@
33435 /* 118 */ "SeekScan" OpHelp("Scan-ahead up to P1 rows"),
33436 /* 119 */ "SeekHit" OpHelp("set P2<=seekHit<=P3"),
33437 /* 120 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"),
33438 /* 121 */ "NewRowid" OpHelp("r[P2]=rowid"),
33439 /* 122 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
33440 /* 123 */ "RowCell" OpHelp(""),
33441 /* 124 */ "Delete" OpHelp(""),
33442 /* 125 */ "ResetCount" OpHelp(""),
33443 /* 126 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
33444 /* 127 */ "SorterData" OpHelp("r[P2]=data"),
33445 /* 128 */ "RowData" OpHelp("r[P2]=data"),
33446 /* 129 */ "Rowid" OpHelp("r[P2]=rowid"),
33447 /* 130 */ "NullRow" OpHelp(""),
33448 /* 131 */ "SeekEnd" OpHelp(""),
33449 /* 132 */ "IdxInsert" OpHelp("key=r[P2]"),
33450 /* 133 */ "SorterInsert" OpHelp("key=r[P2]"),
33451 /* 134 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
33452 /* 135 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
33453 /* 136 */ "IdxRowid" OpHelp("r[P2]=rowid"),
33454 /* 137 */ "FinishSeek" OpHelp(""),
33455 /* 138 */ "Destroy" OpHelp(""),
33456 /* 139 */ "Clear" OpHelp(""),
33457 /* 140 */ "ResetSorter" OpHelp(""),
33458 /* 141 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"),
33459 /* 142 */ "SqlExec" OpHelp(""),
33460 /* 143 */ "ParseSchema" OpHelp(""),
33461 /* 144 */ "LoadAnalysis" OpHelp(""),
33462 /* 145 */ "DropTable" OpHelp(""),
33463 /* 146 */ "DropIndex" OpHelp(""),
33464 /* 147 */ "DropTrigger" OpHelp(""),
33465 /* 148 */ "IntegrityCk" OpHelp(""),
33466 /* 149 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
33467 /* 150 */ "Real" OpHelp("r[P2]=P4"),
33468 /* 151 */ "Param" OpHelp(""),
33469 /* 152 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
33470 /* 153 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
33471 /* 154 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
33472 /* 155 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
33473 /* 156 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
33474 /* 157 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"),
33475 /* 158 */ "AggValue" OpHelp("r[P3]=value N=P2"),
33476 /* 159 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
33477 /* 160 */ "Expire" OpHelp(""),
33478 /* 161 */ "CursorLock" OpHelp(""),
33479 /* 162 */ "CursorUnlock" OpHelp(""),
33480 /* 163 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
33481 /* 164 */ "VBegin" OpHelp(""),
33482 /* 165 */ "VCreate" OpHelp(""),
33483 /* 166 */ "VDestroy" OpHelp(""),
33484 /* 167 */ "VOpen" OpHelp(""),
33485 /* 168 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
33486 /* 169 */ "VRename" OpHelp(""),
33487 /* 170 */ "Pagecount" OpHelp(""),
33488 /* 171 */ "MaxPgcnt" OpHelp(""),
33489 /* 172 */ "Trace" OpHelp(""),
33490 /* 173 */ "CursorHint" OpHelp(""),
33491 /* 174 */ "ReleaseReg" OpHelp("release r[P1@P2] mask P3"),
33492 /* 175 */ "Noop" OpHelp(""),
33493 /* 176 */ "Explain" OpHelp(""),
33494 /* 177 */ "Abortable" OpHelp(""),
33495 };
33496 return azName[i];
33497 }
33498 #endif
33499
@@ -64147,10 +64212,11 @@
64212 BtShared *pNext; /* Next on a list of sharable BtShared structs */
64213 BtLock *pLock; /* List of locks held on this shared-btree struct */
64214 Btree *pWriter; /* Btree with currently open write transaction */
64215 #endif
64216 u8 *pTmpSpace; /* Temp space sufficient to hold a single cell */
64217 int nPreformatSize; /* Size of last cell written by TransferRow() */
64218 };
64219
64220 /*
64221 ** Allowed values for BtShared.btsFlags
64222 */
@@ -65859,10 +65925,28 @@
65925 }else{
65926 pInfo->nLocal = (u16)minLocal;
65927 }
65928 pInfo->nSize = (u16)(&pInfo->pPayload[pInfo->nLocal] - pCell) + 4;
65929 }
65930
65931 /*
65932 ** Given a record with nPayload bytes of payload stored within btree
65933 ** page pPage, return the number of bytes of payload stored locally.
65934 */
65935 static int btreePayloadToLocal(MemPage *pPage, i64 nPayload){
65936 int maxLocal; /* Maximum amount of payload held locally */
65937 maxLocal = pPage->maxLocal;
65938 if( nPayload<=maxLocal ){
65939 return nPayload;
65940 }else{
65941 int minLocal; /* Minimum amount of payload held locally */
65942 int surplus; /* Overflow payload available for local storage */
65943 minLocal = pPage->minLocal;
65944 surplus = minLocal + (nPayload - minLocal)%(pPage->pBt->usableSize-4);
65945 return ( surplus <= maxLocal ) ? surplus : minLocal;
65946 }
65947 }
65948
65949 /*
65950 ** The following routines are implementations of the MemPage.xParseCell()
65951 ** method.
65952 **
@@ -73377,11 +73461,12 @@
73461 Btree *p = pCur->pBtree;
73462 BtShared *pBt = p->pBt;
73463 unsigned char *oldCell;
73464 unsigned char *newCell = 0;
73465
73466 assert( (flags & (BTREE_SAVEPOSITION|BTREE_APPEND|BTREE_PREFORMAT))==flags );
73467 assert( (flags & BTREE_PREFORMAT)==0 || seekResult || pCur->pKeyInfo==0 );
73468
73469 if( pCur->eState==CURSOR_FAULT ){
73470 assert( pCur->skipNext!=SQLITE_OK );
73471 return pCur->skipNext;
73472 }
@@ -73395,11 +73480,11 @@
73480 /* Assert that the caller has been consistent. If this cursor was opened
73481 ** expecting an index b-tree, then the caller should be inserting blob
73482 ** keys with no associated data. If the cursor was opened expecting an
73483 ** intkey table, the caller should be inserting integer keys with a
73484 ** blob of associated data. */
73485 assert( (flags & BTREE_PREFORMAT) || (pX->pKey==0)==(pCur->pKeyInfo==0) );
73486
73487 /* Save the positions of any other cursors open on this table.
73488 **
73489 ** In some cases, the call to btreeMoveto() below is a no-op. For
73490 ** example, when inserting data into a table with auto-generated integer
@@ -73505,11 +73590,11 @@
73590 assert( pCur->eState==CURSOR_VALID
73591 || (pCur->eState==CURSOR_INVALID && loc)
73592 || CORRUPT_DB );
73593
73594 pPage = pCur->pPage;
73595 assert( pPage->intKey || pX->nKey>=0 || (flags & BTREE_PREFORMAT) );
73596 assert( pPage->leaf || !pPage->intKey );
73597 if( pPage->nFree<0 ){
73598 if( pCur->eState>CURSOR_INVALID ){
73599 rc = SQLITE_CORRUPT_BKPT;
73600 }else{
@@ -73522,11 +73607,25 @@
73607 pCur->pgnoRoot, pX->nKey, pX->nData, pPage->pgno,
73608 loc==0 ? "overwrite" : "new entry"));
73609 assert( pPage->isInit );
73610 newCell = pBt->pTmpSpace;
73611 assert( newCell!=0 );
73612 if( flags & BTREE_PREFORMAT ){
73613 rc = SQLITE_OK;
73614 szNew = pBt->nPreformatSize;
73615 if( szNew<4 ) szNew = 4;
73616 if( ISAUTOVACUUM && szNew>pPage->maxLocal ){
73617 CellInfo info;
73618 pPage->xParseCell(pPage, newCell, &info);
73619 if( info.nPayload!=info.nLocal ){
73620 Pgno ovfl = get4byte(&newCell[szNew-4]);
73621 ptrmapPut(pBt, ovfl, PTRMAP_OVERFLOW1, pPage->pgno, &rc);
73622 }
73623 }
73624 }else{
73625 rc = fillInCell(pPage, newCell, pX, &szNew);
73626 }
73627 if( rc ) goto end_insert;
73628 assert( szNew==pPage->xCellSize(pPage, newCell) );
73629 assert( szNew <= MX_CELL_SIZE(pBt) );
73630 idx = pCur->ix;
73631 if( loc==0 ){
@@ -73626,10 +73725,112 @@
73725 }
73726 }
73727 assert( pCur->iPage<0 || pCur->pPage->nOverflow==0 );
73728
73729 end_insert:
73730 return rc;
73731 }
73732
73733 /*
73734 ** This function is used as part of copying the current row from cursor
73735 ** pSrc into cursor pDest. If the cursors are open on intkey tables, then
73736 ** parameter iKey is used as the rowid value when the record is copied
73737 ** into pDest. Otherwise, the record is copied verbatim.
73738 **
73739 ** This function does not actually write the new value to cursor pDest.
73740 ** Instead, it creates and populates any required overflow pages and
73741 ** writes the data for the new cell into the BtShared.pTmpSpace buffer
73742 ** for the destination database. The size of the cell, in bytes, is left
73743 ** in BtShared.nPreformatSize. The caller completes the insertion by
73744 ** calling sqlite3BtreeInsert() with the BTREE_PREFORMAT flag specified.
73745 **
73746 ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
73747 */
73748 SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor *pDest, BtCursor *pSrc, i64 iKey){
73749 int rc = SQLITE_OK;
73750 BtShared *pBt = pDest->pBt;
73751 u8 *aOut = pBt->pTmpSpace; /* Pointer to next output buffer */
73752 const u8 *aIn; /* Pointer to next input buffer */
73753 int nIn; /* Size of input buffer aIn[] */
73754 int nRem; /* Bytes of data still to copy */
73755
73756 getCellInfo(pSrc);
73757 aOut += putVarint32(aOut, pSrc->info.nPayload);
73758 if( pDest->pKeyInfo==0 ) aOut += putVarint(aOut, iKey);
73759 nIn = pSrc->info.nLocal;
73760 aIn = pSrc->info.pPayload;
73761 nRem = pSrc->info.nPayload;
73762 if( nIn==nRem && nIn<pDest->pPage->maxLocal ){
73763 memcpy(aOut, aIn, nIn);
73764 pBt->nPreformatSize = nIn + (aOut - pBt->pTmpSpace);
73765 }else{
73766 Pager *pSrcPager = pSrc->pBt->pPager;
73767 u8 *pPgnoOut = 0;
73768 Pgno ovflIn = 0;
73769 DbPage *pPageIn = 0;
73770 MemPage *pPageOut = 0;
73771 int nOut; /* Size of output buffer aOut[] */
73772
73773 nOut = btreePayloadToLocal(pDest->pPage, pSrc->info.nPayload);
73774 pBt->nPreformatSize = nOut + (aOut - pBt->pTmpSpace);
73775 if( nOut<pSrc->info.nPayload ){
73776 pPgnoOut = &aOut[nOut];
73777 pBt->nPreformatSize += 4;
73778 }
73779
73780 if( nRem>nIn ){
73781 ovflIn = get4byte(&pSrc->info.pPayload[nIn]);
73782 }
73783
73784 do {
73785 nRem -= nOut;
73786 do{
73787 assert( nOut>0 );
73788 if( nIn>0 ){
73789 int nCopy = MIN(nOut, nIn);
73790 memcpy(aOut, aIn, nCopy);
73791 nOut -= nCopy;
73792 nIn -= nCopy;
73793 aOut += nCopy;
73794 aIn += nCopy;
73795 }
73796 if( nOut>0 ){
73797 sqlite3PagerUnref(pPageIn);
73798 pPageIn = 0;
73799 rc = sqlite3PagerGet(pSrcPager, ovflIn, &pPageIn, PAGER_GET_READONLY);
73800 if( rc==SQLITE_OK ){
73801 aIn = (const u8*)sqlite3PagerGetData(pPageIn);
73802 ovflIn = get4byte(aIn);
73803 aIn += 4;
73804 nIn = pSrc->pBt->usableSize - 4;
73805 }
73806 }
73807 }while( rc==SQLITE_OK && nOut>0 );
73808
73809 if( rc==SQLITE_OK && nRem>0 ){
73810 Pgno pgnoNew;
73811 MemPage *pNew = 0;
73812 rc = allocateBtreePage(pBt, &pNew, &pgnoNew, 0, 0);
73813 put4byte(pPgnoOut, pgnoNew);
73814 if( ISAUTOVACUUM && pPageOut ){
73815 ptrmapPut(pBt, pgnoNew, PTRMAP_OVERFLOW2, pPageOut->pgno, &rc);
73816 }
73817 releasePage(pPageOut);
73818 pPageOut = pNew;
73819 if( pPageOut ){
73820 pPgnoOut = pPageOut->aData;
73821 put4byte(pPgnoOut, 0);
73822 aOut = &pPgnoOut[4];
73823 nOut = MIN(pBt->usableSize - 4, nRem);
73824 }
73825 }
73826 }while( nRem>0 && rc==SQLITE_OK );
73827
73828 releasePage(pPageOut);
73829 sqlite3PagerUnref(pPageIn);
73830 }
73831
73832 return rc;
73833 }
73834
73835 /*
73836 ** Delete the entry that the cursor is pointing to.
@@ -90701,11 +90902,12 @@
90902 }else{
90903 x.nZero = 0;
90904 }
90905 x.pKey = 0;
90906 rc = sqlite3BtreeInsert(pC->uc.pCursor, &x,
90907 (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION|OPFLAG_PREFORMAT)),
90908 seekResult
90909 );
90910 pC->deferredMoveto = 0;
90911 pC->cacheStatus = CACHE_STALE;
90912
90913 /* Invoke the update-hook if required. */
@@ -90717,10 +90919,35 @@
90919 (pOp->p5 & OPFLAG_ISUPDATE) ? SQLITE_UPDATE : SQLITE_INSERT,
90920 zDb, pTab->zName, x.nKey);
90921 }
90922 break;
90923 }
90924
90925 /* Opcode: RowCell P1 P2 P3 * *
90926 **
90927 ** P1 and P2 are both open cursors. Both must be opened on the same type
90928 ** of table - intkey or index. This opcode is used as part of copying
90929 ** the current row from P2 into P1. If the cursors are opened on intkey
90930 ** tables, register P3 contains the rowid to use with the new record in
90931 ** P1. If they are opened on index tables, P3 is not used.
90932 **
90933 ** This opcode must be followed by either an Insert or InsertIdx opcode
90934 ** with the OPFLAG_PREFORMAT flag set to complete the insert operation.
90935 */
90936 case OP_RowCell: {
90937 VdbeCursor *pDest; /* Cursor to write to */
90938 VdbeCursor *pSrc; /* Cursor to read from */
90939 i64 iKey; /* Rowid value to insert with */
90940 assert( pOp[1].opcode==OP_Insert || pOp[1].opcode==OP_IdxInsert );
90941 assert( pOp[1].p5 & OPFLAG_PREFORMAT );
90942 pDest = p->apCsr[pOp->p1];
90943 pSrc = p->apCsr[pOp->p2];
90944 iKey = pOp->p3 ? aMem[pOp->p3].u.i : 0;
90945 rc = sqlite3BtreeTransferRow(pDest->uc.pCursor, pSrc->uc.pCursor, iKey);
90946 if( rc!=SQLITE_OK ) goto abort_due_to_error;
90947 break;
90948 };
90949
90950 /* Opcode: Delete P1 P2 P3 P4 P5
90951 **
90952 ** Delete the record at which the P1 cursor is currently pointing.
90953 **
@@ -91373,11 +91600,11 @@
91600 pC = p->apCsr[pOp->p1];
91601 sqlite3VdbeIncrWriteCounter(p, pC);
91602 assert( pC!=0 );
91603 assert( !isSorter(pC) );
91604 pIn2 = &aMem[pOp->p2];
91605 assert( (pIn2->flags & MEM_Blob) || (pOp->p5 & OPFLAG_PREFORMAT) );
91606 if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++;
91607 assert( pC->eCurType==CURTYPE_BTREE );
91608 assert( pC->isTable==0 );
91609 rc = ExpandBlob(pIn2);
91610 if( rc ) goto abort_due_to_error;
@@ -91384,11 +91611,11 @@
91611 x.nKey = pIn2->n;
91612 x.pKey = pIn2->z;
91613 x.aMem = aMem + pOp->p3;
91614 x.nMem = (u16)pOp->p4.i;
91615 rc = sqlite3BtreeInsert(pC->uc.pCursor, &x,
91616 (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION|OPFLAG_PREFORMAT)),
91617 ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0)
91618 );
91619 assert( pC->deferredMoveto==0 );
91620 pC->cacheStatus = CACHE_STALE;
91621 if( rc) goto abort_due_to_error;
@@ -119441,10 +119668,197 @@
119668 }
119669
119670 *pIsNocase = (pDef->funcFlags & SQLITE_FUNC_CASE)==0;
119671 return 1;
119672 }
119673
119674 /* Mathematical Constants */
119675 #ifndef M_PI
119676 # define M_PI 3.141592653589793238462643383279502884
119677 #endif
119678 #ifndef M_LN10
119679 # define M_LN10 2.302585092994045684017991454684364208
119680 #endif
119681 #ifndef M_LN2
119682 # define M_LN2 0.693147180559945309417232121458176568
119683 #endif
119684
119685
119686 /* Extra math functions that require linking with -lm
119687 */
119688 #ifdef SQLITE_ENABLE_MATH_FUNCTIONS
119689 /*
119690 ** Implementation SQL functions:
119691 **
119692 ** ceil(X)
119693 ** ceiling(X)
119694 ** floor(X)
119695 **
119696 ** The sqlite3_user_data() pointer is a pointer to the libm implementation
119697 ** of the underlying C function.
119698 */
119699 static void ceilingFunc(
119700 sqlite3_context *context,
119701 int argc,
119702 sqlite3_value **argv
119703 ){
119704 assert( argc==1 );
119705 switch( sqlite3_value_numeric_type(argv[0]) ){
119706 case SQLITE_INTEGER: {
119707 sqlite3_result_int64(context, sqlite3_value_int64(argv[0]));
119708 break;
119709 }
119710 case SQLITE_FLOAT: {
119711 double (*x)(double) = (double(*)(double))sqlite3_user_data(context);
119712 sqlite3_result_double(context, x(sqlite3_value_double(argv[0])));
119713 break;
119714 }
119715 default: {
119716 break;
119717 }
119718 }
119719 }
119720
119721 /*
119722 ** Implementation of SQL functions:
119723 **
119724 ** ln(X) - natural logarithm
119725 ** log(X) - log X base 10
119726 ** log10(X) - log X base 10
119727 ** log(B,X) - log X base B
119728 */
119729 static void logFunc(
119730 sqlite3_context *context,
119731 int argc,
119732 sqlite3_value **argv
119733 ){
119734 double x, b, ans;
119735 assert( argc==1 || argc==2 );
119736 switch( sqlite3_value_numeric_type(argv[0]) ){
119737 case SQLITE_INTEGER:
119738 case SQLITE_FLOAT:
119739 x = sqlite3_value_double(argv[0]);
119740 if( x<0.0 ) return;
119741 break;
119742 default:
119743 return;
119744 }
119745 if( argc==2 ){
119746 switch( sqlite3_value_numeric_type(argv[0]) ){
119747 case SQLITE_INTEGER:
119748 case SQLITE_FLOAT:
119749 b = x;
119750 x = sqlite3_value_double(argv[1]);
119751 if( x<0.0 ) return;
119752 break;
119753 default:
119754 return;
119755 }
119756 ans = log(x)/log(b);
119757 }else{
119758 ans = log(x);
119759 switch( SQLITE_PTR_TO_INT(sqlite3_user_data(context)) ){
119760 case 1:
119761 /* Convert from natural logarithm to log base 10 */
119762 ans *= 1.0/M_LN10;
119763 break;
119764 case 2:
119765 /* Convert from natural logarithm to log base 2 */
119766 ans *= 1.0/M_LN2;
119767 break;
119768 default:
119769 break;
119770 }
119771 }
119772 sqlite3_result_double(context, ans);
119773 }
119774
119775 /*
119776 ** Functions to converts degrees to radians and radians to degrees.
119777 */
119778 static double degToRad(double x){ return x*(M_PI/180.0); }
119779 static double radToDeg(double x){ return x*(180.0/M_PI); }
119780
119781 /*
119782 ** Implementation of 1-argument SQL math functions:
119783 **
119784 ** exp(X) - Compute e to the X-th power
119785 */
119786 static void math1Func(
119787 sqlite3_context *context,
119788 int argc,
119789 sqlite3_value **argv
119790 ){
119791 int type0;
119792 double v0, ans;
119793 double (*x)(double);
119794 assert( argc==1 );
119795 type0 = sqlite3_value_numeric_type(argv[0]);
119796 if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
119797 v0 = sqlite3_value_double(argv[0]);
119798 x = (double(*)(double))sqlite3_user_data(context);
119799 ans = x(v0);
119800 sqlite3_result_double(context, ans);
119801 }
119802
119803 /*
119804 ** Implementation of 2-argument SQL math functions:
119805 **
119806 ** power(X,Y) - Compute X to the Y-th power
119807 */
119808 static void math2Func(
119809 sqlite3_context *context,
119810 int argc,
119811 sqlite3_value **argv
119812 ){
119813 int type0, type1;
119814 double v0, v1, ans;
119815 double (*x)(double,double);
119816 assert( argc==2 );
119817 type0 = sqlite3_value_numeric_type(argv[0]);
119818 if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
119819 type1 = sqlite3_value_numeric_type(argv[1]);
119820 if( type1!=SQLITE_INTEGER && type1!=SQLITE_FLOAT ) return;
119821 v0 = sqlite3_value_double(argv[0]);
119822 v1 = sqlite3_value_double(argv[1]);
119823 x = (double(*)(double,double))sqlite3_user_data(context);
119824 ans = x(v0, v1);
119825 sqlite3_result_double(context, ans);
119826 }
119827
119828 /*
119829 ** Implementation of 2-argument SQL math functions:
119830 **
119831 ** power(X,Y) - Compute X to the Y-th power
119832 */
119833 static void piFunc(
119834 sqlite3_context *context,
119835 int argc,
119836 sqlite3_value **argv
119837 ){
119838 assert( argc==0 );
119839 sqlite3_result_double(context, M_PI);
119840 }
119841
119842 #endif /* SQLITE_ENABLE_MATH_FUNCTIONS */
119843
119844 /*
119845 ** Implementation of sign(X) function.
119846 */
119847 static void signFunc(
119848 sqlite3_context *context,
119849 int argc,
119850 sqlite3_value **argv
119851 ){
119852 int type0;
119853 double x;
119854 assert( argc==1 );
119855 type0 = sqlite3_value_numeric_type(argv[0]);
119856 if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
119857 x = sqlite3_value_double(argv[0]);
119858 sqlite3_result_int(context, x<0.0 ? -1 : x>0.0 ? +1 : 0);
119859 }
119860
119861 /*
119862 ** All of the FuncDef structures in the aBuiltinFunc[] array above
119863 ** to the global function hash table. This occurs at start-time (as
119864 ** a consequence of calling sqlite3_initialize()).
@@ -119560,10 +119974,47 @@
119974 #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
119975 FUNCTION(unknown, -1, 0, 0, unknownFunc ),
119976 #endif
119977 FUNCTION(coalesce, 1, 0, 0, 0 ),
119978 FUNCTION(coalesce, 0, 0, 0, 0 ),
119979 #ifdef SQLITE_ENABLE_MATH_FUNCTIONS
119980 MFUNCTION(ceil, 1, ceil, ceilingFunc ),
119981 MFUNCTION(ceiling, 1, ceil, ceilingFunc ),
119982 MFUNCTION(floor, 1, floor, ceilingFunc ),
119983 #if SQLITE_HAVE_C99_MATH_FUNCS
119984 MFUNCTION(trunc, 1, trunc, ceilingFunc ),
119985 #endif
119986 FUNCTION(ln, 1, 0, 0, logFunc ),
119987 FUNCTION(log, 1, 1, 0, logFunc ),
119988 FUNCTION(log10, 1, 1, 0, logFunc ),
119989 FUNCTION(log2, 1, 2, 0, logFunc ),
119990 FUNCTION(log, 2, 0, 0, logFunc ),
119991 MFUNCTION(exp, 1, exp, math1Func ),
119992 MFUNCTION(pow, 2, pow, math2Func ),
119993 MFUNCTION(power, 2, pow, math2Func ),
119994 MFUNCTION(mod, 2, fmod, math2Func ),
119995 MFUNCTION(acos, 1, acos, math1Func ),
119996 MFUNCTION(asin, 1, asin, math1Func ),
119997 MFUNCTION(atan, 1, atan, math1Func ),
119998 MFUNCTION(atan2, 2, atan2, math2Func ),
119999 MFUNCTION(cos, 1, cos, math1Func ),
120000 MFUNCTION(sin, 1, sin, math1Func ),
120001 MFUNCTION(tan, 1, tan, math1Func ),
120002 MFUNCTION(cosh, 1, cosh, math1Func ),
120003 MFUNCTION(sinh, 1, sinh, math1Func ),
120004 MFUNCTION(tanh, 1, tanh, math1Func ),
120005 #if SQLITE_HAVE_C99_MATH_FUNCS
120006 MFUNCTION(acosh, 1, acosh, math1Func ),
120007 MFUNCTION(asinh, 1, asinh, math1Func ),
120008 MFUNCTION(atanh, 1, atanh, math1Func ),
120009 #endif
120010 MFUNCTION(sqrt, 1, sqrt, math1Func ),
120011 MFUNCTION(radians, 1, degToRad, math1Func ),
120012 MFUNCTION(degrees, 1, radToDeg, math1Func ),
120013 FUNCTION(pi, 0, 0, 0, piFunc ),
120014 #endif /* SQLITE_ENABLE_MATH_FUNCTIONS */
120015 FUNCTION(sign, 1, 0, 0, signFunc ),
120016 INLINE_FUNC(coalesce, -1, INLINEFUNC_coalesce, 0 ),
120017 INLINE_FUNC(iif, 3, INLINEFUNC_iif, 0 ),
120018 };
120019 #ifndef SQLITE_OMIT_ALTERTABLE
120020 sqlite3AlterFunctions();
@@ -122018,10 +122469,11 @@
122469 }
122470 aRegIdx[i] = ++pParse->nMem; /* Register to store the table record */
122471 }
122472 #ifndef SQLITE_OMIT_UPSERT
122473 if( pUpsert ){
122474 Upsert *pNx;
122475 if( IsVirtual(pTab) ){
122476 sqlite3ErrorMsg(pParse, "UPSERT not implemented for virtual table \"%s\"",
122477 pTab->zName);
122478 goto insert_cleanup;
122479 }
@@ -122031,17 +122483,21 @@
122483 }
122484 if( sqlite3HasExplicitNulls(pParse, pUpsert->pUpsertTarget) ){
122485 goto insert_cleanup;
122486 }
122487 pTabList->a[0].iCursor = iDataCur;
122488 pNx = pUpsert;
122489 do{
122490 pNx->pUpsertSrc = pTabList;
122491 pNx->regData = regData;
122492 pNx->iDataCur = iDataCur;
122493 pNx->iIdxCur = iIdxCur;
122494 if( pNx->pUpsertTarget ){
122495 sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx);
122496 }
122497 pNx = pNx->pNextUpsert;
122498 }while( pNx!=0 );
122499 }
122500 #endif
122501
122502
122503 /* This is the top of the main insertion loop */
@@ -122441,10 +122897,74 @@
122897 testcase( w.eCode==CKCNSTRNT_COLUMN );
122898 testcase( w.eCode==CKCNSTRNT_ROWID );
122899 testcase( w.eCode==(CKCNSTRNT_ROWID|CKCNSTRNT_COLUMN) );
122900 return w.eCode!=0;
122901 }
122902
122903 /*
122904 ** The sqlite3GenerateConstraintChecks() routine usually wants to visit
122905 ** the indexes of a table in the order provided in the Table->pIndex list.
122906 ** However, sometimes (rarely - when there is an upsert) it wants to visit
122907 ** the indexes in a different order. The following data structures accomplish
122908 ** this.
122909 **
122910 ** The IndexIterator object is used to walk through all of the indexes
122911 ** of a table in either Index.pNext order, or in some other order established
122912 ** by an array of IndexListTerm objects.
122913 */
122914 typedef struct IndexListTerm IndexListTerm;
122915 typedef struct IndexIterator IndexIterator;
122916 struct IndexIterator {
122917 int eType; /* 0 for Index.pNext list. 1 for an array of IndexListTerm */
122918 int i; /* Index of the current item from the list */
122919 union {
122920 struct { /* Use this object for eType==0: A Index.pNext list */
122921 Index *pIdx; /* The current Index */
122922 } lx;
122923 struct { /* Use this object for eType==1; Array of IndexListTerm */
122924 int nIdx; /* Size of the array */
122925 IndexListTerm *aIdx; /* Array of IndexListTerms */
122926 } ax;
122927 } u;
122928 };
122929
122930 /* When IndexIterator.eType==1, then each index is an array of instances
122931 ** of the following object
122932 */
122933 struct IndexListTerm {
122934 Index *p; /* The index */
122935 int ix; /* Which entry in the original Table.pIndex list is this index*/
122936 };
122937
122938 /* Return the first index on the list */
122939 static Index *indexIteratorFirst(IndexIterator *pIter, int *pIx){
122940 assert( pIter->i==0 );
122941 if( pIter->eType ){
122942 *pIx = pIter->u.ax.aIdx[0].ix;
122943 return pIter->u.ax.aIdx[0].p;
122944 }else{
122945 *pIx = 0;
122946 return pIter->u.lx.pIdx;
122947 }
122948 }
122949
122950 /* Return the next index from the list. Return NULL when out of indexes */
122951 static Index *indexIteratorNext(IndexIterator *pIter, int *pIx){
122952 if( pIter->eType ){
122953 int i = ++pIter->i;
122954 if( i>=pIter->u.ax.nIdx ){
122955 *pIx = i;
122956 return 0;
122957 }
122958 *pIx = pIter->u.ax.aIdx[i].ix;
122959 return pIter->u.ax.aIdx[i].p;
122960 }else{
122961 ++(*pIx);
122962 pIter->u.lx.pIdx = pIter->u.lx.pIdx->pNext;
122963 return pIter->u.lx.pIdx;
122964 }
122965 }
122966
122967 /*
122968 ** Generate code to do constraint checks prior to an INSERT or an UPDATE
122969 ** on table pTab.
122970 **
@@ -122550,32 +123070,33 @@
123070 int *aiChng, /* column i is unchanged if aiChng[i]<0 */
123071 Upsert *pUpsert /* ON CONFLICT clauses, if any. NULL otherwise */
123072 ){
123073 Vdbe *v; /* VDBE under constrution */
123074 Index *pIdx; /* Pointer to one of the indices */
123075 Index *pPk = 0; /* The PRIMARY KEY index for WITHOUT ROWID tables */
123076 sqlite3 *db; /* Database connection */
123077 int i; /* loop counter */
123078 int ix; /* Index loop counter */
123079 int nCol; /* Number of columns */
123080 int onError; /* Conflict resolution strategy */
123081 int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */
123082 int nPkField; /* Number of fields in PRIMARY KEY. 1 for ROWID tables */
123083 Upsert *pUpsertClause = 0; /* The specific ON CONFLICT clause for pIdx */
123084 u8 isUpdate; /* True if this is an UPDATE operation */
123085 u8 bAffinityDone = 0; /* True if the OP_Affinity operation has been run */
123086 int upsertIpkReturn = 0; /* Address of Goto at end of IPK uniqueness check */
123087 int upsertIpkDelay = 0; /* Address of Goto to bypass initial IPK check */
123088 int ipkTop = 0; /* Top of the IPK uniqueness check */
123089 int ipkBottom = 0; /* OP_Goto at the end of the IPK uniqueness check */
123090 /* Variables associated with retesting uniqueness constraints after
123091 ** replace triggers fire have run */
123092 int regTrigCnt; /* Register used to count replace trigger invocations */
123093 int addrRecheck = 0; /* Jump here to recheck all uniqueness constraints */
123094 int lblRecheckOk = 0; /* Each recheck jumps to this label if it passes */
123095 Trigger *pTrigger; /* List of DELETE triggers on the table pTab */
123096 int nReplaceTrig = 0; /* Number of replace triggers coded */
123097 IndexIterator sIdxIter; /* Index iterator */
123098
123099 isUpdate = regOldData!=0;
123100 db = pParse->db;
123101 v = pParse->pVdbe;
123102 assert( v!=0 );
@@ -122769,23 +123290,67 @@
123290 **
123291 ** The ordering of (2) and (3) is accomplished by making sure the linked
123292 ** list of indexes attached to a table puts all OE_Replace indexes last
123293 ** in the list. See sqlite3CreateIndex() for where that happens.
123294 */
123295 sIdxIter.eType = 0;
123296 sIdxIter.i = 0;
123297 sIdxIter.u.ax.aIdx = 0; /* Silence harmless compiler warning */
123298 sIdxIter.u.lx.pIdx = pTab->pIndex;
123299 if( pUpsert ){
123300 if( pUpsert->pUpsertTarget==0 ){
123301 /* There is just on ON CONFLICT clause and it has no constraint-target */
123302 assert( pUpsert->pNextUpsert==0 );
123303 if( pUpsert->isDoUpdate==0 ){
123304 /* A single ON CONFLICT DO NOTHING clause, without a constraint-target.
123305 ** Make all unique constraint resolution be OE_Ignore */
123306 overrideError = OE_Ignore;
123307 pUpsert = 0;
123308 }else{
123309 /* A single ON CONFLICT DO UPDATE. Make all resolutions OE_Update */
123310 overrideError = OE_Update;
123311 }
123312 }else if( pTab->pIndex!=0 ){
123313 /* Otherwise, we'll need to run the IndexListTerm array version of the
123314 ** iterator to ensure that all of the ON CONFLICT conditions are
123315 ** checked first and in order. */
123316 int nIdx, jj;
123317 u64 nByte;
123318 Upsert *pTerm;
123319 u8 *bUsed;
123320 for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){
123321 assert( aRegIdx[nIdx]>0 );
123322 }
123323 sIdxIter.eType = 1;
123324 sIdxIter.u.ax.nIdx = nIdx;
123325 nByte = (sizeof(IndexListTerm)+1)*nIdx + nIdx;
123326 sIdxIter.u.ax.aIdx = sqlite3DbMallocZero(db, nByte);
123327 if( sIdxIter.u.ax.aIdx==0 ) return; /* OOM */
123328 bUsed = (u8*)&sIdxIter.u.ax.aIdx[nIdx];
123329 pUpsert->pToFree = sIdxIter.u.ax.aIdx;
123330 for(i=0, pTerm=pUpsert; pTerm; pTerm=pTerm->pNextUpsert){
123331 if( pTerm->pUpsertTarget==0 ) break;
123332 if( pTerm->pUpsertIdx==0 ) continue; /* Skip ON CONFLICT for the IPK */
123333 jj = 0;
123334 pIdx = pTab->pIndex;
123335 while( ALWAYS(pIdx!=0) && pIdx!=pTerm->pUpsertIdx ){
123336 pIdx = pIdx->pNext;
123337 jj++;
123338 }
123339 if( bUsed[jj] ) continue; /* Duplicate ON CONFLICT clause ignored */
123340 bUsed[jj] = 1;
123341 sIdxIter.u.ax.aIdx[i].p = pIdx;
123342 sIdxIter.u.ax.aIdx[i].ix = jj;
123343 i++;
123344 }
123345 for(jj=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, jj++){
123346 if( bUsed[jj] ) continue;
123347 sIdxIter.u.ax.aIdx[i].p = pIdx;
123348 sIdxIter.u.ax.aIdx[i].ix = jj;
123349 i++;
123350 }
123351 assert( i==nIdx );
123352 }
123353 }
123354
123355 /* Determine if it is possible that triggers (either explicitly coded
123356 ** triggers or FK resolution actions) might run as a result of deletes
@@ -122844,15 +123409,24 @@
123409 }else if( onError==OE_Default ){
123410 onError = OE_Abort;
123411 }
123412
123413 /* figure out whether or not upsert applies in this case */
123414 if( pUpsert ){
123415 pUpsertClause = sqlite3UpsertOfIndex(pUpsert,0);
123416 if( pUpsertClause!=0 ){
123417 if( pUpsertClause->isDoUpdate==0 ){
123418 onError = OE_Ignore; /* DO NOTHING is the same as INSERT OR IGNORE */
123419 }else{
123420 onError = OE_Update; /* DO UPDATE */
123421 }
123422 }
123423 if( pUpsertClause!=pUpsert ){
123424 /* The first ON CONFLICT clause has a conflict target other than
123425 ** the IPK. We have to jump ahead to that first ON CONFLICT clause
123426 ** and then come back here and deal with the IPK afterwards */
123427 upsertIpkDelay = sqlite3VdbeAddOp0(v, OP_Goto);
123428 }
123429 }
123430
123431 /* If the response to a rowid conflict is REPLACE but the response
123432 ** to some other UNIQUE constraint is FAIL or IGNORE, then we need
@@ -122955,11 +123529,13 @@
123529 sqlite3VdbeGoto(v, ignoreDest);
123530 break;
123531 }
123532 }
123533 sqlite3VdbeResolveLabel(v, addrRowidOk);
123534 if( pUpsert && pUpsertClause!=pUpsert ){
123535 upsertIpkReturn = sqlite3VdbeAddOp0(v, OP_Goto);
123536 }else if( ipkTop ){
123537 ipkBottom = sqlite3VdbeAddOp0(v, OP_Goto);
123538 sqlite3VdbeJumpHere(v, ipkTop-1);
123539 }
123540 }
123541
@@ -122968,27 +123544,29 @@
123544 ** Compute the revised record entries for indices as we go.
123545 **
123546 ** This loop also handles the case of the PRIMARY KEY index for a
123547 ** WITHOUT ROWID table.
123548 */
123549 for(pIdx = indexIteratorFirst(&sIdxIter, &ix);
123550 pIdx;
123551 pIdx = indexIteratorNext(&sIdxIter, &ix)
123552 ){
123553 int regIdx; /* Range of registers hold conent for pIdx */
123554 int regR; /* Range of registers holding conflicting PK */
123555 int iThisCur; /* Cursor for this UNIQUE index */
123556 int addrUniqueOk; /* Jump here if the UNIQUE constraint is satisfied */
123557 int addrConflictCk; /* First opcode in the conflict check logic */
123558
123559 if( aRegIdx[ix]==0 ) continue; /* Skip indices that do not change */
123560 if( pUpsert ){
123561 pUpsertClause = sqlite3UpsertOfIndex(pUpsert, pIdx);
123562 if( upsertIpkDelay && pUpsertClause==pUpsert ){
123563 sqlite3VdbeJumpHere(v, upsertIpkDelay);
123564 }
123565 }
123566 addrUniqueOk = sqlite3VdbeMakeLabel(pParse);
123567 if( bAffinityDone==0 ){
 
123568 sqlite3TableAffinity(v, pTab, regNewData+1);
123569 bAffinityDone = 1;
123570 }
123571 VdbeNoopComment((v, "prep index %s", pIdx->zName));
123572 iThisCur = iIdxCur+ix;
@@ -123055,12 +123633,12 @@
123633 }else if( onError==OE_Default ){
123634 onError = OE_Abort;
123635 }
123636
123637 /* Figure out if the upsert clause applies to this index */
123638 if( pUpsertClause ){
123639 if( pUpsertClause->isDoUpdate==0 ){
123640 onError = OE_Ignore; /* DO NOTHING is the same as INSERT OR IGNORE */
123641 }else{
123642 onError = OE_Update; /* DO UPDATE */
123643 }
123644 }
@@ -123094,11 +123672,11 @@
123672 addrConflictCk =
123673 sqlite3VdbeAddOp4Int(v, OP_NoConflict, iThisCur, addrUniqueOk,
123674 regIdx, pIdx->nKeyCol); VdbeCoverage(v);
123675
123676 /* Generate code to handle collisions */
123677 regR = pIdx==pPk ? regIdx : sqlite3GetTempRange(pParse, nPkField);
123678 if( isUpdate || onError==OE_Replace ){
123679 if( HasRowid(pTab) ){
123680 sqlite3VdbeAddOp2(v, OP_IdxRowid, iThisCur, regR);
123681 /* Conflict only if the rowid of the existing index entry
123682 ** is different from old-rowid */
@@ -123246,17 +123824,20 @@
123824 }
123825 seenReplace = 1;
123826 break;
123827 }
123828 }
123829 sqlite3VdbeResolveLabel(v, addrUniqueOk);
 
 
 
 
 
123830 if( regR!=regIdx ) sqlite3ReleaseTempRange(pParse, regR, nPkField);
123831 if( pUpsertClause
123832 && upsertIpkReturn
123833 && sqlite3UpsertNextIsIPK(pUpsertClause)
123834 ){
123835 sqlite3VdbeGoto(v, upsertIpkDelay+1);
123836 sqlite3VdbeJumpHere(v, upsertIpkReturn);
123837 upsertIpkReturn = 0;
123838 }
123839 }
123840
123841 /* If the IPK constraint is a REPLACE, run it last */
123842 if( ipkTop ){
123843 sqlite3VdbeGoto(v, ipkTop);
@@ -123791,10 +124372,11 @@
124372 sqlite3CodeVerifySchema(pParse, iDbSrc);
124373 iSrc = pParse->nTab++;
124374 iDest = pParse->nTab++;
124375 regAutoinc = autoIncBegin(pParse, iDbDest, pDest);
124376 regData = sqlite3GetTempReg(pParse);
124377 sqlite3VdbeAddOp2(v, OP_Null, 0, regData);
124378 regRowid = sqlite3GetTempReg(pParse);
124379 sqlite3OpenTable(pParse, iDest, iDbDest, pDest, OP_OpenWrite);
124380 assert( HasRowid(pDest) || destHasUniqueIdx );
124381 if( (db->mDbFlags & DBFLAG_Vacuum)==0 && (
124382 (pDest->iPKey<0 && pDest->pIndex!=0) /* (1) */
@@ -123826,32 +124408,44 @@
124408 u8 insFlags;
124409 sqlite3OpenTable(pParse, iSrc, iDbSrc, pSrc, OP_OpenRead);
124410 emptySrcTest = sqlite3VdbeAddOp2(v, OP_Rewind, iSrc, 0); VdbeCoverage(v);
124411 if( pDest->iPKey>=0 ){
124412 addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
124413 if( (db->mDbFlags & DBFLAG_Vacuum)==0 ){
124414 sqlite3VdbeVerifyAbortable(v, onError);
124415 addr2 = sqlite3VdbeAddOp3(v, OP_NotExists, iDest, 0, regRowid);
124416 VdbeCoverage(v);
124417 sqlite3RowidConstraint(pParse, onError, pDest);
124418 sqlite3VdbeJumpHere(v, addr2);
124419 }
124420 autoIncStep(pParse, regAutoinc, regRowid);
124421 }else if( pDest->pIndex==0 && !(db->mDbFlags & DBFLAG_VacuumInto) ){
124422 addr1 = sqlite3VdbeAddOp2(v, OP_NewRowid, iDest, regRowid);
124423 }else{
124424 addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
124425 assert( (pDest->tabFlags & TF_Autoincrement)==0 );
124426 }
124427
124428 if( db->mDbFlags & DBFLAG_Vacuum ){
124429 sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest);
124430 insFlags = OPFLAG_APPEND|OPFLAG_USESEEKRESULT|OPFLAG_PREFORMAT;
124431 }else{
124432 insFlags = OPFLAG_NCHANGE|OPFLAG_LASTROWID|OPFLAG_APPEND|OPFLAG_PREFORMAT;
124433 }
124434 #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
124435 if( db->xPreUpdateCallback ){
124436 sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
124437 insFlags &= ~OPFLAG_PREFORMAT;
124438 }else
124439 #endif
124440 {
124441 sqlite3VdbeAddOp3(v, OP_RowCell, iDest, iSrc, regRowid);
124442 }
124443 sqlite3VdbeAddOp4(v, OP_Insert, iDest, regData, regRowid,
124444 (char*)pDest, P4_TABLE);
124445 sqlite3VdbeChangeP5(v, insFlags);
124446
124447 sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1); VdbeCoverage(v);
124448 sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
124449 sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
124450 }else{
124451 sqlite3TableLock(pParse, iDbDest, pDest->tnum, 1, pDest->zName);
@@ -123889,17 +124483,20 @@
124483 for(i=0; i<pSrcIdx->nColumn; i++){
124484 const char *zColl = pSrcIdx->azColl[i];
124485 if( sqlite3_stricmp(sqlite3StrBINARY, zColl) ) break;
124486 }
124487 if( i==pSrcIdx->nColumn ){
124488 idxInsFlags = OPFLAG_USESEEKRESULT|OPFLAG_PREFORMAT;
124489 sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest);
124490 sqlite3VdbeAddOp3(v, OP_RowCell, iDest, iSrc, regData);
124491 }
124492 }else if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){
124493 idxInsFlags |= OPFLAG_NCHANGE;
124494 }
124495 if( idxInsFlags!=(OPFLAG_USESEEKRESULT|OPFLAG_PREFORMAT) ){
124496 sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
124497 }
124498 sqlite3VdbeAddOp2(v, OP_IdxInsert, iDest, regData);
124499 sqlite3VdbeChangeP5(v, idxInsFlags|OPFLAG_APPEND);
124500 sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1+1); VdbeCoverage(v);
124501 sqlite3VdbeJumpHere(v, addr1);
124502 sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
@@ -134009,11 +134606,11 @@
134606 sqlite3AggInfoPersistWalkerInit(&w, pParse);
134607 sqlite3WalkSelect(&w,pSub1);
134608 sqlite3SelectDelete(db, pSub1);
134609
134610 #if SELECTTRACE_ENABLED
134611 if( sqlite3SelectTrace & 0x100 ){
134612 SELECTTRACE(0x100,pParse,p,("After flattening:\n"));
134613 sqlite3TreeViewSelect(0, p, 0);
134614 }
134615 #endif
134616
@@ -135453,11 +136050,11 @@
136050 sWalker.pParse = pParse;
136051 sWalker.xExprCallback = havingToWhereExprCb;
136052 sWalker.u.pSelect = p;
136053 sqlite3WalkExpr(&sWalker, p->pHaving);
136054 #if SELECTTRACE_ENABLED
136055 if( sWalker.eCode && (sqlite3SelectTrace & 0x100)!=0 ){
136056 SELECTTRACE(0x100,pParse,p,("Move HAVING terms into WHERE:\n"));
136057 sqlite3TreeViewSelect(0, p, 0);
136058 }
136059 #endif
136060 }
@@ -135575,11 +136172,11 @@
136172 }
136173 p->pEList->a[0].pExpr = pExpr;
136174 p->selFlags &= ~SF_Aggregate;
136175
136176 #if SELECTTRACE_ENABLED
136177 if( sqlite3SelectTrace & 0x400 ){
136178 SELECTTRACE(0x400,pParse,p,("After count-of-view optimization:\n"));
136179 sqlite3TreeViewSelect(0, p, 0);
136180 }
136181 #endif
136182 return 1;
@@ -135628,11 +136225,11 @@
136225 return 1;
136226 }
136227 if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
136228 #if SELECTTRACE_ENABLED
136229 SELECTTRACE(1,pParse,p, ("begin processing:\n", pParse->addrExplain));
136230 if( sqlite3SelectTrace & 0x100 ){
136231 sqlite3TreeViewSelect(0, p, 0);
136232 }
136233 #endif
136234
136235 assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistFifo );
@@ -135653,11 +136250,11 @@
136250 if( pParse->nErr || db->mallocFailed ){
136251 goto select_end;
136252 }
136253 assert( p->pEList!=0 );
136254 #if SELECTTRACE_ENABLED
136255 if( sqlite3SelectTrace & 0x104 ){
136256 SELECTTRACE(0x104,pParse,p, ("after name resolution:\n"));
136257 sqlite3TreeViewSelect(0, p, 0);
136258 }
136259 #endif
136260
@@ -135688,11 +136285,11 @@
136285 if( rc ){
136286 assert( db->mallocFailed || pParse->nErr>0 );
136287 goto select_end;
136288 }
136289 #if SELECTTRACE_ENABLED
136290 if( p->pWin && (sqlite3SelectTrace & 0x108)!=0 ){
136291 SELECTTRACE(0x104,pParse,p, ("after window rewrite:\n"));
136292 sqlite3TreeViewSelect(0, p, 0);
136293 }
136294 #endif
136295 #endif /* SQLITE_OMIT_WINDOWFUNC */
@@ -135795,11 +136392,11 @@
136392 */
136393 if( p->pPrior ){
136394 rc = multiSelect(pParse, p, pDest);
136395 #if SELECTTRACE_ENABLED
136396 SELECTTRACE(0x1,pParse,p,("end compound-select processing\n"));
136397 if( (sqlite3SelectTrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
136398 sqlite3TreeViewSelect(0, p, 0);
136399 }
136400 #endif
136401 if( p->pNext==0 ) ExplainQueryPlanPop(pParse);
136402 return rc;
@@ -135814,11 +136411,11 @@
136411 if( pTabList->nSrc>1
136412 && OptimizationEnabled(db, SQLITE_PropagateConst)
136413 && propagateConstants(pParse, p)
136414 ){
136415 #if SELECTTRACE_ENABLED
136416 if( sqlite3SelectTrace & 0x100 ){
136417 SELECTTRACE(0x100,pParse,p,("After constant propagation:\n"));
136418 sqlite3TreeViewSelect(0, p, 0);
136419 }
136420 #endif
136421 }else{
@@ -135902,11 +136499,11 @@
136499 if( OptimizationEnabled(db, SQLITE_PushDown)
136500 && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
136501 (pItem->fg.jointype & JT_OUTER)!=0)
136502 ){
136503 #if SELECTTRACE_ENABLED
136504 if( sqlite3SelectTrace & 0x100 ){
136505 SELECTTRACE(0x100,pParse,p,
136506 ("After WHERE-clause push-down into subquery %d:\n", pSub->selId));
136507 sqlite3TreeViewSelect(0, p, 0);
136508 }
136509 #endif
@@ -136002,11 +136599,11 @@
136599 pGroupBy = p->pGroupBy;
136600 pHaving = p->pHaving;
136601 sDistinct.isTnct = (p->selFlags & SF_Distinct)!=0;
136602
136603 #if SELECTTRACE_ENABLED
136604 if( sqlite3SelectTrace & 0x400 ){
136605 SELECTTRACE(0x400,pParse,p,("After all FROM-clause analysis:\n"));
136606 sqlite3TreeViewSelect(0, p, 0);
136607 }
136608 #endif
136609
@@ -136038,11 +136635,11 @@
136635 ** the sDistinct.isTnct is still set. Hence, isTnct represents the
136636 ** original setting of the SF_Distinct flag, not the current setting */
136637 assert( sDistinct.isTnct );
136638
136639 #if SELECTTRACE_ENABLED
136640 if( sqlite3SelectTrace & 0x400 ){
136641 SELECTTRACE(0x400,pParse,p,("Transform DISTINCT into GROUP BY:\n"));
136642 sqlite3TreeViewSelect(0, p, 0);
136643 }
136644 #endif
136645 }
@@ -136286,11 +136883,11 @@
136883 sNC.ncFlags &= ~NC_InAggFunc;
136884 }
136885 pAggInfo->mxReg = pParse->nMem;
136886 if( db->mallocFailed ) goto select_end;
136887 #if SELECTTRACE_ENABLED
136888 if( sqlite3SelectTrace & 0x400 ){
136889 int ii;
136890 SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", pAggInfo));
136891 sqlite3TreeViewSelect(0, p, 0);
136892 for(ii=0; ii<pAggInfo->nColumn; ii++){
136893 sqlite3DebugPrintf("agg-column[%d] iMem=%d\n",
@@ -136705,11 +137302,11 @@
137302 }
137303 #endif
137304
137305 #if SELECTTRACE_ENABLED
137306 SELECTTRACE(0x1,pParse,p,("end processing\n"));
137307 if( (sqlite3SelectTrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){
137308 sqlite3TreeViewSelect(0, p, 0);
137309 }
137310 #endif
137311 ExplainQueryPlanPop(pParse);
137312 return rc;
@@ -139476,19 +140073,26 @@
140073
140074 #ifndef SQLITE_OMIT_UPSERT
140075 /*
140076 ** Free a list of Upsert objects
140077 */
140078 static void SQLITE_NOINLINE upsertDelete(sqlite3 *db, Upsert *p){
140079 do{
140080 Upsert *pNext = p->pNextUpsert;
140081 sqlite3ExprListDelete(db, p->pUpsertTarget);
140082 sqlite3ExprDelete(db, p->pUpsertTargetWhere);
140083 sqlite3ExprListDelete(db, p->pUpsertSet);
140084 sqlite3ExprDelete(db, p->pUpsertWhere);
140085 sqlite3DbFree(db, p->pToFree);
140086 sqlite3DbFree(db, p);
140087 p = pNext;
140088 }while( p );
140089 }
140090 SQLITE_PRIVATE void sqlite3UpsertDelete(sqlite3 *db, Upsert *p){
140091 if( p ) upsertDelete(db, p);
140092 }
140093
140094
140095 /*
140096 ** Duplicate an Upsert object.
140097 */
140098 SQLITE_PRIVATE Upsert *sqlite3UpsertDup(sqlite3 *db, Upsert *p){
@@ -139495,11 +140099,12 @@
140099 if( p==0 ) return 0;
140100 return sqlite3UpsertNew(db,
140101 sqlite3ExprListDup(db, p->pUpsertTarget, 0),
140102 sqlite3ExprDup(db, p->pUpsertTargetWhere, 0),
140103 sqlite3ExprListDup(db, p->pUpsertSet, 0),
140104 sqlite3ExprDup(db, p->pUpsertWhere, 0),
140105 sqlite3UpsertDup(db, p->pNextUpsert)
140106 );
140107 }
140108
140109 /*
140110 ** Create a new Upsert object.
@@ -139507,26 +140112,29 @@
140112 SQLITE_PRIVATE Upsert *sqlite3UpsertNew(
140113 sqlite3 *db, /* Determines which memory allocator to use */
140114 ExprList *pTarget, /* Target argument to ON CONFLICT, or NULL */
140115 Expr *pTargetWhere, /* Optional WHERE clause on the target */
140116 ExprList *pSet, /* UPDATE columns, or NULL for a DO NOTHING */
140117 Expr *pWhere, /* WHERE clause for the ON CONFLICT UPDATE */
140118 Upsert *pNext /* Next ON CONFLICT clause in the list */
140119 ){
140120 Upsert *pNew;
140121 pNew = sqlite3DbMallocZero(db, sizeof(Upsert));
140122 if( pNew==0 ){
140123 sqlite3ExprListDelete(db, pTarget);
140124 sqlite3ExprDelete(db, pTargetWhere);
140125 sqlite3ExprListDelete(db, pSet);
140126 sqlite3ExprDelete(db, pWhere);
140127 sqlite3UpsertDelete(db, pNext);
140128 return 0;
140129 }else{
140130 pNew->pUpsertTarget = pTarget;
140131 pNew->pUpsertTargetWhere = pTargetWhere;
140132 pNew->pUpsertSet = pSet;
140133 pNew->pUpsertWhere = pWhere;
140134 pNew->isDoUpdate = pSet!=0;
140135 pNew->pNextUpsert = pNext;
140136 }
140137 return pNew;
140138 }
140139
140140 /*
@@ -139547,10 +140155,11 @@
140155 Index *pIdx; /* One of the indexes of pTab */
140156 ExprList *pTarget; /* The conflict-target clause */
140157 Expr *pTerm; /* One term of the conflict-target clause */
140158 NameContext sNC; /* Context for resolving symbolic names */
140159 Expr sCol[2]; /* Index column converted into an Expr */
140160 int nClause = 0; /* Counter of ON CONFLICT clauses */
140161
140162 assert( pTabList->nSrc==1 );
140163 assert( pTabList->a[0].pTab!=0 );
140164 assert( pUpsert!=0 );
140165 assert( pUpsert->pUpsertTarget!=0 );
@@ -139560,91 +140169,135 @@
140169 ** WHERE clause.
140170 */
140171 memset(&sNC, 0, sizeof(sNC));
140172 sNC.pParse = pParse;
140173 sNC.pSrcList = pTabList;
140174 for(; pUpsert && pUpsert->pUpsertTarget;
140175 pUpsert=pUpsert->pNextUpsert, nClause++){
140176 rc = sqlite3ResolveExprListNames(&sNC, pUpsert->pUpsertTarget);
140177 if( rc ) return rc;
140178 rc = sqlite3ResolveExprNames(&sNC, pUpsert->pUpsertTargetWhere);
140179 if( rc ) return rc;
140180
140181 /* Check to see if the conflict target matches the rowid. */
140182 pTab = pTabList->a[0].pTab;
140183 pTarget = pUpsert->pUpsertTarget;
140184 iCursor = pTabList->a[0].iCursor;
140185 if( HasRowid(pTab)
140186 && pTarget->nExpr==1
140187 && (pTerm = pTarget->a[0].pExpr)->op==TK_COLUMN
140188 && pTerm->iColumn==XN_ROWID
140189 ){
140190 /* The conflict-target is the rowid of the primary table */
140191 assert( pUpsert->pUpsertIdx==0 );
140192 continue;
140193 }
140194
140195 /* Initialize sCol[0..1] to be an expression parse tree for a
140196 ** single column of an index. The sCol[0] node will be the TK_COLLATE
140197 ** operator and sCol[1] will be the TK_COLUMN operator. Code below
140198 ** will populate the specific collation and column number values
140199 ** prior to comparing against the conflict-target expression.
140200 */
140201 memset(sCol, 0, sizeof(sCol));
140202 sCol[0].op = TK_COLLATE;
140203 sCol[0].pLeft = &sCol[1];
140204 sCol[1].op = TK_COLUMN;
140205 sCol[1].iTable = pTabList->a[0].iCursor;
140206
140207 /* Check for matches against other indexes */
140208 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
140209 int ii, jj, nn;
140210 if( !IsUniqueIndex(pIdx) ) continue;
140211 if( pTarget->nExpr!=pIdx->nKeyCol ) continue;
140212 if( pIdx->pPartIdxWhere ){
140213 if( pUpsert->pUpsertTargetWhere==0 ) continue;
140214 if( sqlite3ExprCompare(pParse, pUpsert->pUpsertTargetWhere,
140215 pIdx->pPartIdxWhere, iCursor)!=0 ){
140216 continue;
140217 }
140218 }
140219 nn = pIdx->nKeyCol;
140220 for(ii=0; ii<nn; ii++){
140221 Expr *pExpr;
140222 sCol[0].u.zToken = (char*)pIdx->azColl[ii];
140223 if( pIdx->aiColumn[ii]==XN_EXPR ){
140224 assert( pIdx->aColExpr!=0 );
140225 assert( pIdx->aColExpr->nExpr>ii );
140226 pExpr = pIdx->aColExpr->a[ii].pExpr;
140227 if( pExpr->op!=TK_COLLATE ){
140228 sCol[0].pLeft = pExpr;
140229 pExpr = &sCol[0];
140230 }
140231 }else{
140232 sCol[0].pLeft = &sCol[1];
140233 sCol[1].iColumn = pIdx->aiColumn[ii];
140234 pExpr = &sCol[0];
140235 }
140236 for(jj=0; jj<nn; jj++){
140237 if( sqlite3ExprCompare(pParse,pTarget->a[jj].pExpr,pExpr,iCursor)<2 ){
140238 break; /* Column ii of the index matches column jj of target */
140239 }
140240 }
140241 if( jj>=nn ){
140242 /* The target contains no match for column jj of the index */
140243 break;
140244 }
140245 }
140246 if( ii<nn ){
140247 /* Column ii of the index did not match any term of the conflict target.
140248 ** Continue the search with the next index. */
140249 continue;
140250 }
140251 pUpsert->pUpsertIdx = pIdx;
140252 break;
140253 }
140254 if( pUpsert->pUpsertIdx==0 ){
140255 char zWhich[16];
140256 if( nClause==0 && pUpsert->pNextUpsert==0 ){
140257 zWhich[0] = 0;
140258 }else{
140259 sqlite3_snprintf(sizeof(zWhich),zWhich,"%r ", nClause+1);
140260 }
140261 sqlite3ErrorMsg(pParse, "%sON CONFLICT clause does not match any "
140262 "PRIMARY KEY or UNIQUE constraint", zWhich);
140263 return SQLITE_ERROR;
140264 }
140265 }
140266 return SQLITE_OK;
140267 }
140268
140269 /*
140270 ** Return true if pUpsert is the last ON CONFLICT clause with a
140271 ** conflict target, or if pUpsert is followed by another ON CONFLICT
140272 ** clause that targets the INTEGER PRIMARY KEY.
140273 */
140274 SQLITE_PRIVATE int sqlite3UpsertNextIsIPK(Upsert *pUpsert){
140275 Upsert *pNext;
140276 if( NEVER(pUpsert==0) ) return 0;
140277 pNext = pUpsert->pNextUpsert;
140278 if( pNext==0 ) return 1;
140279 if( pNext->pUpsertTarget==0 ) return 1;
140280 if( pNext->pUpsertIdx==0 ) return 1;
140281 return 0;
140282 }
140283
140284 /*
140285 ** Given the list of ON CONFLICT clauses described by pUpsert, and
140286 ** a particular index pIdx, return a pointer to the particular ON CONFLICT
140287 ** clause that applies to the index. Or, if the index is not subject to
140288 ** any ON CONFLICT clause, return NULL.
140289 */
140290 SQLITE_PRIVATE Upsert *sqlite3UpsertOfIndex(Upsert *pUpsert, Index *pIdx){
140291 while(
140292 pUpsert
140293 && pUpsert->pUpsertTarget!=0
140294 && pUpsert->pUpsertIdx!=pIdx
140295 ){
140296 pUpsert = pUpsert->pNextUpsert;
140297 }
140298 return pUpsert;
140299 }
140300
140301 /*
140302 ** Generate bytecode that does an UPDATE as part of an upsert.
140303 **
@@ -139664,15 +140317,17 @@
140317 Vdbe *v = pParse->pVdbe;
140318 sqlite3 *db = pParse->db;
140319 SrcList *pSrc; /* FROM clause for the UPDATE */
140320 int iDataCur;
140321 int i;
140322 Upsert *pTop = pUpsert;
140323
140324 assert( v!=0 );
140325 assert( pUpsert!=0 );
 
140326 iDataCur = pUpsert->iDataCur;
140327 pUpsert = sqlite3UpsertOfIndex(pTop, pIdx);
140328 VdbeNoopComment((v, "Begin DO UPDATE of UPSERT"));
140329 if( pIdx && iCur!=iDataCur ){
140330 if( HasRowid(pTab) ){
140331 int regRowid = sqlite3GetTempReg(pParse);
140332 sqlite3VdbeAddOp2(v, OP_IdxRowid, iCur, regRowid);
140333 sqlite3VdbeAddOp3(v, OP_SeekRowid, iDataCur, 0, regRowid);
@@ -139698,23 +140353,21 @@
140353 "corrupt database", P4_STATIC);
140354 sqlite3MayAbort(pParse);
140355 sqlite3VdbeJumpHere(v, i);
140356 }
140357 }
140358 /* pUpsert does not own pTop->pUpsertSrc - the outer INSERT statement does.
140359 ** So we have to make a copy before passing it down into sqlite3Update() */
140360 pSrc = sqlite3SrcListDup(db, pTop->pUpsertSrc, 0);
140361 /* excluded.* columns of type REAL need to be converted to a hard real */
140362 for(i=0; i<pTab->nCol; i++){
140363 if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){
140364 sqlite3VdbeAddOp1(v, OP_RealAffinity, pTop->regData+i);
140365 }
140366 }
140367 sqlite3Update(pParse, pSrc, sqlite3ExprListDup(db,pUpsert->pUpsertSet,0),
140368 sqlite3ExprDup(db,pUpsert->pUpsertWhere,0), OE_Abort, 0, 0, pUpsert);
 
 
140369 VdbeNoopComment((v, "End DO UPDATE of UPSERT"));
140370 }
140371
140372 #endif /* SQLITE_OMIT_UPSERT */
140373
@@ -141487,23 +142140,10 @@
142140 ** a separate source file for easier editing.
142141 */
142142 #ifndef SQLITE_WHEREINT_H
142143 #define SQLITE_WHEREINT_H
142144
 
 
 
 
 
 
 
 
 
 
 
 
 
142145
142146 /* Forward references
142147 */
142148 typedef struct WhereClause WhereClause;
142149 typedef struct WhereMaskSet WhereMaskSet;
@@ -146219,16 +146859,10 @@
146859 Parse *pParse; /* The parsing context */
146860 };
146861
146862 /* Forward declaration of methods */
146863 static int whereLoopResize(sqlite3*, WhereLoop*, int);
 
 
 
 
 
 
146864
146865 /*
146866 ** Return the estimated number of output rows from a WHERE clause
146867 */
146868 SQLITE_PRIVATE LogEst sqlite3WhereOutputRowCount(WhereInfo *pWInfo){
@@ -155319,22 +155953,22 @@
155953 #define sqlite3ParserCTX_PDECL ,Parse *pParse
155954 #define sqlite3ParserCTX_PARAM ,pParse
155955 #define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
155956 #define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
155957 #define YYFALLBACK 1
155958 #define YYNSTATE 558
155959 #define YYNRULE 386
155960 #define YYNRULE_WITH_ACTION 326
155961 #define YYNTOKEN 181
155962 #define YY_MAX_SHIFT 557
155963 #define YY_MIN_SHIFTREDUCE 809
155964 #define YY_MAX_SHIFTREDUCE 1194
155965 #define YY_ERROR_ACTION 1195
155966 #define YY_ACCEPT_ACTION 1196
155967 #define YY_NO_ACTION 1197
155968 #define YY_MIN_REDUCE 1198
155969 #define YY_MAX_REDUCE 1583
155970 /************* End control #defines *******************************************/
155971 #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
155972
155973 /* Define the yytestcase() macro to be a no-op if is not already defined
155974 ** otherwise.
@@ -155397,209 +156031,209 @@
156031 ** yy_reduce_ofst[] For each state, the offset into yy_action for
156032 ** shifting non-terminals after a reduce.
156033 ** yy_default[] Default action for each state.
156034 **
156035 *********** Begin parsing tables **********************************************/
156036 #define YY_ACTTAB_COUNT (1968)
156037 static const YYACTIONTYPE yy_action[] = {
156038 /* 0 */ 551, 1229, 551, 456, 1267, 551, 1246, 551, 114, 111,
156039 /* 10 */ 212, 551, 1545, 551, 1267, 528, 114, 111, 212, 396,
156040 /* 20 */ 1239, 348, 42, 42, 42, 42, 1232, 42, 42, 71,
156041 /* 30 */ 71, 943, 1231, 71, 71, 71, 71, 1470, 1501, 944,
156042 /* 40 */ 826, 458, 6, 121, 122, 112, 1172, 1172, 1013, 1016,
156043 /* 50 */ 1006, 1006, 119, 119, 120, 120, 120, 120, 1551, 396,
156044 /* 60 */ 1366, 1525, 557, 2, 1200, 195, 533, 441, 143, 293,
156045 /* 70 */ 533, 136, 533, 375, 262, 509, 273, 389, 1280, 532,
156046 /* 80 */ 508, 498, 165, 121, 122, 112, 1172, 1172, 1013, 1016,
156047 /* 90 */ 1006, 1006, 119, 119, 120, 120, 120, 120, 1366, 447,
156048 /* 100 */ 1522, 118, 118, 118, 118, 117, 117, 116, 116, 116,
156049 /* 110 */ 115, 429, 267, 267, 267, 267, 1506, 362, 1508, 440,
156050 /* 120 */ 361, 1506, 522, 529, 1493, 548, 1121, 548, 1121, 396,
156051 /* 130 */ 410, 242, 209, 114, 111, 212, 98, 292, 542, 222,
156052 /* 140 */ 1036, 118, 118, 118, 118, 117, 117, 116, 116, 116,
156053 /* 150 */ 115, 429, 1149, 121, 122, 112, 1172, 1172, 1013, 1016,
156054 /* 160 */ 1006, 1006, 119, 119, 120, 120, 120, 120, 411, 433,
156055 /* 170 */ 117, 117, 116, 116, 116, 115, 429, 1426, 473, 123,
156056 /* 180 */ 118, 118, 118, 118, 117, 117, 116, 116, 116, 115,
156057 /* 190 */ 429, 116, 116, 116, 115, 429, 545, 545, 545, 396,
156058 /* 200 */ 510, 120, 120, 120, 120, 113, 1058, 1149, 1150, 1151,
156059 /* 210 */ 1058, 118, 118, 118, 118, 117, 117, 116, 116, 116,
156060 /* 220 */ 115, 429, 1469, 121, 122, 112, 1172, 1172, 1013, 1016,
156061 /* 230 */ 1006, 1006, 119, 119, 120, 120, 120, 120, 396, 449,
156062 /* 240 */ 320, 83, 468, 81, 363, 386, 1149, 80, 118, 118,
156063 /* 250 */ 118, 118, 117, 117, 116, 116, 116, 115, 429, 180,
156064 /* 260 */ 439, 429, 121, 122, 112, 1172, 1172, 1013, 1016, 1006,
156065 /* 270 */ 1006, 119, 119, 120, 120, 120, 120, 439, 438, 267,
156066 /* 280 */ 267, 118, 118, 118, 118, 117, 117, 116, 116, 116,
156067 /* 290 */ 115, 429, 548, 1116, 909, 511, 1149, 114, 111, 212,
156068 /* 300 */ 1439, 1149, 1150, 1151, 207, 496, 1116, 396, 454, 1116,
156069 /* 310 */ 550, 334, 120, 120, 120, 120, 300, 1439, 1441, 17,
156070 /* 320 */ 118, 118, 118, 118, 117, 117, 116, 116, 116, 115,
156071 /* 330 */ 429, 121, 122, 112, 1172, 1172, 1013, 1016, 1006, 1006,
156072 /* 340 */ 119, 119, 120, 120, 120, 120, 396, 1366, 439, 1149,
156073 /* 350 */ 487, 1149, 1150, 1151, 1003, 1003, 1014, 1017, 406, 118,
156074 /* 360 */ 118, 118, 118, 117, 117, 116, 116, 116, 115, 429,
156075 /* 370 */ 121, 122, 112, 1172, 1172, 1013, 1016, 1006, 1006, 119,
156076 /* 380 */ 119, 120, 120, 120, 120, 1061, 1061, 470, 1439, 118,
156077 /* 390 */ 118, 118, 118, 117, 117, 116, 116, 116, 115, 429,
156078 /* 400 */ 1149, 456, 551, 1434, 1149, 1150, 1151, 234, 973, 1149,
156079 /* 410 */ 486, 483, 482, 172, 364, 396, 165, 412, 419, 848,
156080 /* 420 */ 481, 165, 186, 338, 71, 71, 1250, 1007, 118, 118,
156081 /* 430 */ 118, 118, 117, 117, 116, 116, 116, 115, 429, 121,
156082 /* 440 */ 122, 112, 1172, 1172, 1013, 1016, 1006, 1006, 119, 119,
156083 /* 450 */ 120, 120, 120, 120, 396, 1149, 1150, 1151, 841, 12,
156084 /* 460 */ 318, 514, 164, 360, 1149, 1150, 1151, 114, 111, 212,
156085 /* 470 */ 513, 292, 542, 551, 277, 181, 292, 542, 121, 122,
156086 /* 480 */ 112, 1172, 1172, 1013, 1016, 1006, 1006, 119, 119, 120,
156087 /* 490 */ 120, 120, 120, 349, 489, 71, 71, 118, 118, 118,
156088 /* 500 */ 118, 117, 117, 116, 116, 116, 115, 429, 1149, 210,
156089 /* 510 */ 416, 528, 1149, 1116, 1579, 382, 253, 270, 346, 492,
156090 /* 520 */ 341, 491, 239, 396, 518, 368, 1116, 1134, 337, 1116,
156091 /* 530 */ 192, 414, 288, 32, 462, 448, 118, 118, 118, 118,
156092 /* 540 */ 117, 117, 116, 116, 116, 115, 429, 121, 122, 112,
156093 /* 550 */ 1172, 1172, 1013, 1016, 1006, 1006, 119, 119, 120, 120,
156094 /* 560 */ 120, 120, 396, 1149, 1150, 1151, 994, 1149, 1150, 1151,
156095 /* 570 */ 1149, 234, 497, 1500, 486, 483, 482, 6, 164, 551,
156096 /* 580 */ 517, 551, 115, 429, 481, 5, 121, 122, 112, 1172,
156097 /* 590 */ 1172, 1013, 1016, 1006, 1006, 119, 119, 120, 120, 120,
156098 /* 600 */ 120, 13, 13, 13, 13, 118, 118, 118, 118, 117,
156099 /* 610 */ 117, 116, 116, 116, 115, 429, 408, 507, 413, 551,
156100 /* 620 */ 1494, 549, 1149, 898, 898, 1149, 1150, 1151, 1481, 1149,
156101 /* 630 */ 276, 396, 814, 815, 816, 978, 427, 427, 427, 16,
156102 /* 640 */ 16, 55, 55, 1249, 118, 118, 118, 118, 117, 117,
156103 /* 650 */ 116, 116, 116, 115, 429, 121, 122, 112, 1172, 1172,
156104 /* 660 */ 1013, 1016, 1006, 1006, 119, 119, 120, 120, 120, 120,
156105 /* 670 */ 396, 1196, 1, 1, 557, 2, 1200, 1149, 1150, 1151,
156106 /* 680 */ 195, 293, 904, 136, 1149, 1150, 1151, 903, 526, 1500,
156107 /* 690 */ 1280, 3, 384, 6, 121, 122, 112, 1172, 1172, 1013,
156108 /* 700 */ 1016, 1006, 1006, 119, 119, 120, 120, 120, 120, 864,
156109 /* 710 */ 551, 930, 551, 118, 118, 118, 118, 117, 117, 116,
156110 /* 720 */ 116, 116, 115, 429, 267, 267, 1099, 1577, 1149, 556,
156111 /* 730 */ 1577, 1200, 13, 13, 13, 13, 293, 548, 136, 396,
156112 /* 740 */ 490, 426, 425, 973, 348, 1280, 473, 415, 865, 281,
156113 /* 750 */ 140, 222, 118, 118, 118, 118, 117, 117, 116, 116,
156114 /* 760 */ 116, 115, 429, 121, 122, 112, 1172, 1172, 1013, 1016,
156115 /* 770 */ 1006, 1006, 119, 119, 120, 120, 120, 120, 551, 267,
156116 /* 780 */ 267, 433, 396, 1149, 1150, 1151, 1179, 836, 1179, 473,
156117 /* 790 */ 436, 145, 548, 1153, 405, 318, 444, 304, 844, 1498,
156118 /* 800 */ 71, 71, 417, 6, 1097, 478, 222, 100, 112, 1172,
156119 /* 810 */ 1172, 1013, 1016, 1006, 1006, 119, 119, 120, 120, 120,
156120 /* 820 */ 120, 118, 118, 118, 118, 117, 117, 116, 116, 116,
156121 /* 830 */ 115, 429, 238, 1433, 551, 456, 433, 289, 993, 551,
156122 /* 840 */ 237, 236, 235, 836, 97, 534, 434, 1272, 1272, 1153,
156123 /* 850 */ 499, 309, 435, 844, 984, 551, 71, 71, 983, 1248,
156124 /* 860 */ 551, 51, 51, 302, 118, 118, 118, 118, 117, 117,
156125 /* 870 */ 116, 116, 116, 115, 429, 195, 103, 70, 70, 267,
156126 /* 880 */ 267, 551, 71, 71, 267, 267, 30, 395, 348, 983,
156127 /* 890 */ 983, 985, 548, 533, 1116, 332, 396, 548, 500, 401,
156128 /* 900 */ 460, 196, 535, 13, 13, 1366, 241, 1116, 278, 282,
156129 /* 910 */ 1116, 282, 306, 462, 308, 337, 396, 31, 189, 424,
156130 /* 920 */ 121, 122, 112, 1172, 1172, 1013, 1016, 1006, 1006, 119,
156131 /* 930 */ 119, 120, 120, 120, 120, 142, 396, 369, 456, 993,
156132 /* 940 */ 121, 122, 112, 1172, 1172, 1013, 1016, 1006, 1006, 119,
156133 /* 950 */ 119, 120, 120, 120, 120, 984, 327, 1149, 330, 983,
156134 /* 960 */ 121, 110, 112, 1172, 1172, 1013, 1016, 1006, 1006, 119,
156135 /* 970 */ 119, 120, 120, 120, 120, 469, 381, 1192, 118, 118,
156136 /* 980 */ 118, 118, 117, 117, 116, 116, 116, 115, 429, 1149,
156137 /* 990 */ 983, 983, 985, 307, 9, 461, 245, 462, 118, 118,
156138 /* 1000 */ 118, 118, 117, 117, 116, 116, 116, 115, 429, 317,
156139 /* 1010 */ 551, 279, 1149, 1150, 1151, 301, 292, 542, 118, 118,
156140 /* 1020 */ 118, 118, 117, 117, 116, 116, 116, 115, 429, 1270,
156141 /* 1030 */ 1270, 1170, 13, 13, 531, 426, 425, 473, 396, 929,
156142 /* 1040 */ 261, 261, 97, 1176, 1149, 1150, 1151, 190, 1178, 267,
156143 /* 1050 */ 267, 473, 138, 548, 1193, 551, 1177, 264, 348, 494,
156144 /* 1060 */ 928, 551, 548, 122, 112, 1172, 1172, 1013, 1016, 1006,
156145 /* 1070 */ 1006, 119, 119, 120, 120, 120, 120, 71, 71, 1149,
156146 /* 1080 */ 1179, 1279, 1179, 13, 13, 904, 1077, 1170, 551, 473,
156147 /* 1090 */ 903, 107, 543, 280, 4, 1275, 1116, 450, 530, 1056,
156148 /* 1100 */ 12, 1078, 1099, 1578, 316, 144, 1578, 525, 546, 1116,
156149 /* 1110 */ 56, 56, 1116, 1499, 428, 1366, 1079, 6, 349, 970,
156150 /* 1120 */ 118, 118, 118, 118, 117, 117, 116, 116, 116, 115,
156151 /* 1130 */ 429, 430, 1278, 325, 1149, 1150, 1151, 884, 267, 267,
156152 /* 1140 */ 855, 107, 543, 540, 4, 1497, 238, 885, 1218, 6,
156153 /* 1150 */ 211, 548, 370, 165, 366, 501, 421, 1496, 546, 268,
156154 /* 1160 */ 268, 6, 1550, 516, 504, 873, 267, 267, 400, 536,
156155 /* 1170 */ 8, 993, 548, 524, 551, 928, 463, 105, 105, 548,
156156 /* 1180 */ 1097, 430, 267, 267, 106, 422, 430, 553, 552, 267,
156157 /* 1190 */ 267, 983, 523, 540, 1381, 548, 15, 15, 267, 267,
156158 /* 1200 */ 1478, 1127, 548, 267, 267, 1077, 1380, 520, 292, 542,
156159 /* 1210 */ 551, 548, 519, 401, 449, 320, 548, 551, 928, 125,
156160 /* 1220 */ 1078, 993, 983, 983, 985, 986, 27, 105, 105, 405,
156161 /* 1230 */ 347, 1519, 44, 44, 106, 1079, 430, 553, 552, 57,
156162 /* 1240 */ 57, 983, 347, 1519, 107, 543, 551, 4, 467, 405,
156163 /* 1250 */ 215, 1127, 464, 295, 381, 1098, 539, 296, 551, 1221,
156164 /* 1260 */ 402, 546, 544, 402, 299, 245, 292, 542, 58, 58,
156165 /* 1270 */ 551, 1284, 983, 983, 985, 986, 27, 1524, 1138, 432,
156166 /* 1280 */ 59, 59, 271, 548, 430, 403, 166, 379, 379, 378,
156167 /* 1290 */ 256, 376, 60, 60, 823, 1187, 540, 551, 274, 551,
156168 /* 1300 */ 1170, 851, 393, 392, 551, 205, 551, 216, 211, 298,
156169 /* 1310 */ 520, 1303, 551, 266, 209, 521, 1316, 297, 275, 61,
156170 /* 1320 */ 61, 62, 62, 451, 993, 205, 45, 45, 46, 46,
156171 /* 1330 */ 105, 105, 1193, 928, 47, 47, 291, 106, 551, 430,
156172 /* 1340 */ 553, 552, 943, 551, 983, 313, 394, 218, 551, 109,
156173 /* 1350 */ 944, 107, 543, 219, 4, 156, 1170, 851, 158, 551,
156174 /* 1360 */ 49, 49, 104, 551, 102, 50, 50, 551, 546, 1315,
156175 /* 1370 */ 63, 63, 551, 443, 217, 983, 983, 985, 986, 27,
156176 /* 1380 */ 1484, 64, 64, 551, 310, 65, 65, 551, 1458, 14,
156177 /* 1390 */ 14, 430, 1457, 551, 66, 66, 1094, 551, 1169, 383,
156178 /* 1400 */ 141, 551, 38, 540, 269, 127, 127, 551, 397, 67,
156179 /* 1410 */ 67, 551, 465, 292, 542, 52, 52, 520, 551, 68,
156180 /* 1420 */ 68, 1043, 519, 69, 69, 315, 95, 322, 97, 53,
156181 /* 1430 */ 53, 993, 975, 151, 151, 244, 437, 105, 105, 200,
156182 /* 1440 */ 152, 152, 455, 1312, 106, 244, 430, 553, 552, 1138,
156183 /* 1450 */ 432, 983, 457, 271, 321, 244, 326, 97, 379, 379,
156184 /* 1460 */ 378, 256, 376, 863, 862, 823, 531, 551, 221, 551,
156185 /* 1470 */ 107, 543, 551, 4, 551, 329, 479, 1043, 216, 240,
156186 /* 1480 */ 298, 331, 983, 983, 985, 986, 27, 546, 297, 76,
156187 /* 1490 */ 76, 54, 54, 333, 72, 72, 128, 128, 870, 871,
156188 /* 1500 */ 107, 543, 551, 4, 1263, 551, 946, 947, 1247, 551,
156189 /* 1510 */ 430, 551, 200, 1055, 551, 1055, 551, 546, 218, 551,
156190 /* 1520 */ 335, 1538, 540, 97, 73, 73, 156, 129, 129, 158,
156191 /* 1530 */ 340, 130, 130, 126, 126, 350, 150, 150, 149, 149,
156192 /* 1540 */ 430, 134, 134, 345, 1039, 217, 937, 240, 901, 244,
156193 /* 1550 */ 993, 109, 540, 344, 987, 551, 105, 105, 908, 351,
156194 /* 1560 */ 551, 1513, 1054, 106, 1054, 430, 553, 552, 551, 1324,
156195 /* 1570 */ 983, 834, 99, 543, 139, 4, 551, 133, 133, 397,
156196 /* 1580 */ 993, 1365, 131, 131, 292, 542, 105, 105, 1299, 546,
156197 /* 1590 */ 132, 132, 287, 106, 1310, 430, 553, 552, 75, 75,
156198 /* 1600 */ 983, 983, 983, 985, 986, 27, 551, 437, 902, 537,
156199 /* 1610 */ 987, 109, 430, 259, 551, 538, 1371, 1228, 474, 551,
156200 /* 1620 */ 198, 551, 1220, 1209, 540, 1208, 1210, 1532, 77, 77,
156201 /* 1630 */ 202, 983, 983, 985, 986, 27, 74, 74, 1296, 353,
156202 /* 1640 */ 355, 43, 43, 48, 48, 357, 11, 380, 214, 343,
156203 /* 1650 */ 303, 442, 993, 312, 305, 1360, 314, 484, 105, 105,
156204 /* 1660 */ 459, 1246, 319, 206, 1430, 106, 1429, 430, 553, 552,
156205 /* 1670 */ 359, 541, 983, 271, 1535, 1187, 168, 248, 379, 379,
156206 /* 1680 */ 378, 256, 376, 201, 193, 823, 373, 194, 1477, 1475,
156207 /* 1690 */ 1184, 79, 404, 82, 83, 453, 178, 95, 216, 1349,
156208 /* 1700 */ 298, 162, 1435, 983, 983, 985, 986, 27, 297, 1354,
156209 /* 1710 */ 1346, 35, 170, 445, 446, 477, 173, 174, 175, 176,
156210 /* 1720 */ 385, 224, 1358, 1361, 1357, 466, 387, 36, 182, 452,
156211 /* 1730 */ 388, 1424, 228, 88, 472, 260, 230, 1446, 218, 187,
156212 /* 1740 */ 475, 328, 231, 390, 324, 1211, 156, 232, 493, 158,
156213 /* 1750 */ 418, 90, 1257, 1266, 1549, 1265, 1264, 855, 1256, 207,
156214 /* 1760 */ 420, 512, 1307, 1548, 94, 217, 352, 391, 1236, 1235,
156215 /* 1770 */ 342, 1234, 1547, 1518, 354, 285, 503, 286, 506, 246,
156216 /* 1780 */ 247, 1504, 1503, 423, 1308, 124, 531, 1306, 356, 10,
156217 /* 1790 */ 1305, 367, 1331, 101, 290, 96, 254, 515, 1217, 397,
156218 /* 1800 */ 34, 554, 1144, 255, 292, 542, 257, 372, 1289, 365,
156219 /* 1810 */ 371, 358, 1288, 197, 258, 555, 1206, 1201, 1462, 153,
156220 /* 1820 */ 1463, 1330, 1461, 154, 137, 283, 1460, 437, 155, 203,
156221 /* 1830 */ 810, 204, 78, 431, 1410, 199, 294, 213, 272, 135,
156222 /* 1840 */ 1053, 1051, 966, 157, 169, 220, 171, 887, 311, 223,
156223 /* 1850 */ 1067, 177, 159, 160, 407, 84, 409, 179, 85, 86,
156224 /* 1860 */ 87, 161, 1070, 225, 1066, 398, 167, 399, 18, 226,
156225 /* 1870 */ 146, 227, 323, 244, 1181, 471, 229, 1059, 183, 184,
156226 /* 1880 */ 37, 825, 344, 476, 233, 336, 488, 480, 185, 89,
156227 /* 1890 */ 19, 20, 485, 92, 853, 339, 91, 163, 866, 147,
156228 /* 1900 */ 284, 495, 502, 1132, 148, 1019, 936, 1102, 39, 93,
156229 /* 1910 */ 1103, 40, 505, 263, 208, 265, 188, 931, 1122, 243,
156230 /* 1920 */ 1126, 109, 33, 1120, 1118, 21, 1106, 22, 527, 1034,
156231 /* 1930 */ 23, 24, 1125, 25, 191, 97, 26, 1020, 1018, 1022,
156232 /* 1940 */ 1076, 250, 7, 1075, 249, 1023, 28, 41, 547, 988,
156233 /* 1950 */ 835, 108, 29, 251, 252, 1540, 374, 897, 377, 1140,
156234 /* 1960 */ 1139, 1197, 1197, 1197, 1197, 1197, 1197, 1539,
156235 };
156236 static const YYCODETYPE yy_lookahead[] = {
156237 /* 0 */ 189, 211, 189, 189, 218, 189, 220, 189, 267, 268,
156238 /* 10 */ 269, 189, 210, 189, 228, 189, 267, 268, 269, 19,
156239 /* 20 */ 218, 189, 211, 212, 211, 212, 211, 211, 212, 211,
@@ -155688,117 +156322,117 @@
156322 /* 850 */ 200, 16, 189, 114, 115, 189, 211, 212, 119, 221,
156323 /* 860 */ 189, 211, 212, 258, 101, 102, 103, 104, 105, 106,
156324 /* 870 */ 107, 108, 109, 110, 111, 189, 156, 211, 212, 234,
156325 /* 880 */ 235, 189, 211, 212, 234, 235, 22, 201, 189, 150,
156326 /* 890 */ 151, 152, 247, 248, 76, 16, 19, 247, 248, 113,
156327 /* 900 */ 19, 24, 257, 211, 212, 189, 26, 89, 262, 223,
156328 /* 910 */ 92, 225, 77, 189, 79, 129, 19, 53, 226, 248,
156329 /* 920 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
156330 /* 930 */ 53, 54, 55, 56, 57, 236, 19, 271, 189, 99,
156331 /* 940 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
156332 /* 950 */ 53, 54, 55, 56, 57, 115, 77, 59, 79, 119,
156333 /* 960 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
156334 /* 970 */ 53, 54, 55, 56, 57, 259, 22, 23, 101, 102,
156335 /* 980 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 59,
156336 /* 990 */ 150, 151, 152, 158, 22, 114, 24, 189, 101, 102,
156337 /* 1000 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 285,
156338 /* 1010 */ 189, 262, 114, 115, 116, 200, 136, 137, 101, 102,
156339 /* 1020 */ 103, 104, 105, 106, 107, 108, 109, 110, 111, 230,
156340 /* 1030 */ 231, 59, 211, 212, 143, 105, 106, 189, 19, 141,
156341 /* 1040 */ 234, 235, 26, 113, 114, 115, 116, 226, 118, 234,
156342 /* 1050 */ 235, 189, 161, 247, 100, 189, 126, 23, 189, 107,
156343 /* 1060 */ 26, 189, 247, 44, 45, 46, 47, 48, 49, 50,
156344 /* 1070 */ 51, 52, 53, 54, 55, 56, 57, 211, 212, 59,
156345 /* 1080 */ 150, 233, 152, 211, 212, 133, 12, 115, 189, 189,
156346 /* 1090 */ 138, 19, 20, 285, 22, 233, 76, 127, 226, 11,
156347 /* 1100 */ 208, 27, 22, 23, 200, 236, 26, 87, 36, 89,
156348 /* 1110 */ 211, 212, 92, 300, 248, 189, 42, 304, 189, 149,
156349 /* 1120 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
156350 /* 1130 */ 111, 59, 200, 233, 114, 115, 116, 63, 234, 235,
156351 /* 1140 */ 124, 19, 20, 71, 22, 300, 46, 73, 200, 304,
156352 /* 1150 */ 116, 247, 244, 81, 246, 200, 227, 300, 36, 234,
156353 /* 1160 */ 235, 304, 23, 143, 200, 26, 234, 235, 194, 200,
156354 /* 1170 */ 48, 99, 247, 66, 189, 141, 284, 105, 106, 247,
156355 /* 1180 */ 100, 59, 234, 235, 112, 259, 114, 115, 116, 234,
156356 /* 1190 */ 235, 119, 85, 71, 266, 247, 211, 212, 234, 235,
156357 /* 1200 */ 189, 94, 247, 234, 235, 12, 266, 85, 136, 137,
156358 /* 1210 */ 189, 247, 90, 113, 126, 127, 247, 189, 26, 22,
156359 /* 1220 */ 27, 99, 150, 151, 152, 153, 154, 105, 106, 189,
156360 /* 1230 */ 302, 303, 211, 212, 112, 42, 114, 115, 116, 211,
156361 /* 1240 */ 212, 119, 302, 303, 19, 20, 189, 22, 274, 189,
156362 /* 1250 */ 15, 144, 278, 189, 22, 23, 63, 189, 189, 203,
156363 /* 1260 */ 204, 36, 203, 204, 189, 24, 136, 137, 211, 212,
156364 /* 1270 */ 189, 235, 150, 151, 152, 153, 154, 0, 1, 2,
156365 /* 1280 */ 211, 212, 5, 247, 59, 292, 293, 10, 11, 12,
156366 /* 1290 */ 13, 14, 211, 212, 17, 60, 71, 189, 258, 189,
156367 /* 1300 */ 59, 59, 105, 106, 189, 26, 189, 30, 116, 32,
156368 /* 1310 */ 85, 253, 189, 251, 252, 90, 189, 40, 258, 211,
156369 /* 1320 */ 212, 211, 212, 127, 99, 26, 211, 212, 211, 212,
156370 /* 1330 */ 105, 106, 100, 141, 211, 212, 239, 112, 189, 114,
156371 /* 1340 */ 115, 116, 31, 189, 119, 149, 249, 70, 189, 26,
156372 /* 1350 */ 39, 19, 20, 24, 22, 78, 115, 115, 81, 189,
156373 /* 1360 */ 211, 212, 155, 189, 157, 211, 212, 189, 36, 189,
156374 /* 1370 */ 211, 212, 189, 189, 97, 150, 151, 152, 153, 154,
156375 /* 1380 */ 189, 211, 212, 189, 189, 211, 212, 189, 189, 211,
156376 /* 1390 */ 212, 59, 189, 189, 211, 212, 23, 189, 26, 26,
156377 /* 1400 */ 22, 189, 24, 71, 22, 211, 212, 189, 131, 211,
156378 /* 1410 */ 212, 189, 189, 136, 137, 211, 212, 85, 189, 211,
156379 /* 1420 */ 212, 59, 90, 211, 212, 23, 147, 189, 26, 211,
156380 /* 1430 */ 212, 99, 23, 211, 212, 26, 159, 105, 106, 140,
156381 /* 1440 */ 211, 212, 23, 189, 112, 26, 114, 115, 116, 1,
156382 /* 1450 */ 2, 119, 23, 5, 23, 26, 189, 26, 10, 11,
156383 /* 1460 */ 12, 13, 14, 118, 119, 17, 143, 189, 139, 189,
156384 /* 1470 */ 19, 20, 189, 22, 189, 189, 23, 115, 30, 26,
156385 /* 1480 */ 32, 189, 150, 151, 152, 153, 154, 36, 40, 211,
156386 /* 1490 */ 212, 211, 212, 189, 211, 212, 211, 212, 7, 8,
156387 /* 1500 */ 19, 20, 189, 22, 189, 189, 83, 84, 189, 189,
156388 /* 1510 */ 59, 189, 140, 150, 189, 152, 189, 36, 70, 189,
156389 /* 1520 */ 23, 139, 71, 26, 211, 212, 78, 211, 212, 81,
156390 /* 1530 */ 189, 211, 212, 211, 212, 189, 211, 212, 211, 212,
156391 /* 1540 */ 59, 211, 212, 119, 23, 97, 23, 26, 23, 26,
156392 /* 1550 */ 99, 26, 71, 129, 59, 189, 105, 106, 107, 189,
156393 /* 1560 */ 189, 309, 150, 112, 152, 114, 115, 116, 189, 189,
156394 /* 1570 */ 119, 23, 19, 20, 26, 22, 189, 211, 212, 131,
156395 /* 1580 */ 99, 189, 211, 212, 136, 137, 105, 106, 189, 36,
156396 /* 1590 */ 211, 212, 250, 112, 189, 114, 115, 116, 211, 212,
156397 /* 1600 */ 119, 150, 151, 152, 153, 154, 189, 159, 23, 189,
156398 /* 1610 */ 115, 26, 59, 280, 189, 231, 189, 189, 281, 189,
156399 /* 1620 */ 237, 189, 189, 189, 71, 189, 189, 189, 211, 212,
156400 /* 1630 */ 209, 150, 151, 152, 153, 154, 211, 212, 250, 250,
156401 /* 1640 */ 250, 211, 212, 211, 212, 250, 238, 187, 290, 214,
156402 /* 1650 */ 240, 254, 99, 286, 254, 241, 241, 215, 105, 106,
156403 /* 1660 */ 286, 220, 240, 224, 214, 112, 214, 114, 115, 116,
156404 /* 1670 */ 254, 273, 119, 5, 192, 60, 290, 139, 10, 11,
156405 /* 1680 */ 12, 13, 14, 238, 244, 17, 240, 244, 196, 196,
156406 /* 1690 */ 38, 287, 196, 287, 148, 113, 22, 147, 30, 241,
156407 /* 1700 */ 32, 43, 276, 150, 151, 152, 153, 154, 40, 265,
156408 /* 1710 */ 241, 264, 229, 18, 196, 18, 232, 232, 232, 232,
156409 /* 1720 */ 241, 195, 265, 229, 265, 196, 265, 264, 229, 241,
156410 /* 1730 */ 241, 241, 195, 155, 62, 196, 195, 283, 70, 22,
156411 /* 1740 */ 216, 196, 195, 216, 282, 196, 78, 195, 113, 81,
156412 /* 1750 */ 64, 22, 222, 213, 219, 213, 213, 124, 222, 162,
156413 /* 1760 */ 111, 142, 256, 219, 113, 97, 255, 216, 213, 215,
156414 /* 1770 */ 213, 213, 213, 303, 255, 275, 216, 275, 216, 196,
156415 /* 1780 */ 91, 308, 308, 82, 256, 146, 143, 256, 255, 22,
156416 /* 1790 */ 256, 196, 260, 155, 272, 145, 25, 144, 199, 131,
156417 /* 1800 */ 26, 198, 13, 190, 136, 137, 190, 241, 245, 244,
156418 /* 1810 */ 242, 255, 245, 243, 6, 188, 188, 188, 208, 202,
156419 /* 1820 */ 208, 260, 208, 202, 217, 217, 208, 159, 202, 209,
156420 /* 1830 */ 4, 209, 208, 3, 270, 22, 160, 15, 98, 16,
156421 /* 1840 */ 23, 23, 137, 128, 148, 24, 140, 20, 16, 142,
156422 /* 1850 */ 1, 140, 128, 128, 61, 53, 37, 148, 53, 53,
156423 /* 1860 */ 53, 128, 114, 34, 1, 296, 293, 296, 22, 139,
156424 /* 1870 */ 5, 113, 158, 26, 75, 41, 139, 68, 68, 113,
156425 /* 1880 */ 24, 20, 129, 19, 123, 23, 96, 67, 22, 22,
156426 /* 1890 */ 22, 22, 67, 147, 59, 24, 22, 37, 28, 23,
156427 /* 1900 */ 67, 22, 24, 23, 23, 23, 114, 23, 22, 26,
156428 /* 1910 */ 23, 22, 24, 23, 139, 23, 22, 141, 75, 34,
156429 /* 1920 */ 75, 26, 22, 86, 88, 34, 23, 34, 24, 23,
156430 /* 1930 */ 34, 34, 93, 34, 26, 26, 34, 23, 23, 23,
156431 /* 1940 */ 23, 22, 44, 23, 26, 11, 22, 22, 26, 23,
156432 /* 1950 */ 23, 22, 22, 139, 139, 139, 23, 133, 15, 1,
156433 /* 1960 */ 1, 310, 310, 310, 310, 310, 310, 139, 310, 310,
156434 /* 1970 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
156435 /* 1980 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
156436 /* 1990 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
156437 /* 2000 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
156438 /* 2010 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
@@ -155812,15 +156446,15 @@
156446 /* 2090 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
156447 /* 2100 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
156448 /* 2110 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
156449 /* 2120 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
156450 /* 2130 */ 310, 310, 310, 310, 310, 310, 310, 310, 310, 310,
156451 /* 2140 */ 310, 310, 310, 310, 310, 310, 310, 310, 310,
156452 };
156453 #define YY_SHIFT_COUNT (557)
156454 #define YY_SHIFT_MIN (0)
156455 #define YY_SHIFT_MAX (1959)
156456 static const unsigned short int yy_shift_ofst[] = {
156457 /* 0 */ 1448, 1277, 1668, 1072, 1072, 340, 1122, 1225, 1332, 1481,
156458 /* 10 */ 1481, 1481, 335, 0, 0, 180, 897, 1481, 1481, 1481,
156459 /* 20 */ 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481,
156460 /* 30 */ 930, 930, 1020, 1020, 290, 1, 340, 340, 340, 340,
@@ -155833,55 +156467,55 @@
156467 /* 100 */ 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481,
156468 /* 110 */ 1481, 1481, 1553, 1481, 1481, 1481, 1481, 1481, 1481, 1481,
156469 /* 120 */ 1481, 1481, 1481, 1481, 1481, 1481, 147, 258, 258, 258,
156470 /* 130 */ 258, 258, 79, 65, 84, 449, 19, 786, 449, 636,
156471 /* 140 */ 636, 449, 880, 880, 880, 880, 113, 142, 142, 472,
156472 /* 150 */ 150, 1968, 1968, 399, 399, 399, 93, 237, 341, 237,
156473 /* 160 */ 237, 237, 1074, 1074, 437, 350, 704, 1080, 449, 449,
156474 /* 170 */ 449, 449, 449, 449, 449, 449, 449, 449, 449, 449,
156475 /* 180 */ 449, 449, 449, 449, 449, 449, 449, 449, 449, 818,
156476 /* 190 */ 818, 449, 1088, 217, 217, 734, 734, 891, 1130, 1968,
156477 /* 200 */ 1968, 1968, 739, 840, 840, 453, 454, 511, 187, 563,
156478 /* 210 */ 570, 898, 669, 449, 449, 449, 449, 449, 449, 449,
156479 /* 220 */ 449, 449, 670, 449, 449, 449, 449, 449, 449, 449,
156480 /* 230 */ 449, 449, 449, 449, 449, 674, 674, 674, 449, 449,
156481 /* 240 */ 449, 449, 1034, 449, 449, 449, 972, 1107, 449, 449,
156482 /* 250 */ 1193, 449, 449, 449, 449, 449, 449, 449, 449, 260,
156483 /* 260 */ 177, 489, 1241, 1241, 1241, 1241, 1192, 489, 489, 952,
156484 /* 270 */ 1197, 625, 1235, 1299, 181, 181, 881, 1279, 1279, 1299,
156485 /* 280 */ 881, 1016, 1139, 1100, 1311, 1311, 1311, 181, 1323, 1323,
156486 /* 290 */ 1207, 1372, 549, 1378, 1615, 1538, 1538, 1652, 1652, 1538,
156487 /* 300 */ 1546, 1582, 1674, 1550, 1658, 1550, 1695, 1695, 1695, 1695,
156488 /* 310 */ 1538, 1697, 1550, 1582, 1582, 1550, 1582, 1674, 1658, 1550,
156489 /* 320 */ 1658, 1550, 1538, 1697, 1578, 1672, 1538, 1697, 1717, 1538,
156490 /* 330 */ 1697, 1538, 1697, 1717, 1635, 1635, 1635, 1686, 1729, 1729,
156491 /* 340 */ 1717, 1635, 1633, 1635, 1686, 1635, 1635, 1597, 1717, 1649,
156492 /* 350 */ 1649, 1717, 1619, 1651, 1619, 1651, 1619, 1651, 1619, 1651,
156493 /* 360 */ 1538, 1689, 1689, 1701, 1701, 1639, 1643, 1767, 1538, 1638,
156494 /* 370 */ 1639, 1650, 1653, 1550, 1771, 1774, 1789, 1789, 1808, 1808,
156495 /* 380 */ 1808, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968, 1968,
156496 /* 390 */ 1968, 1968, 1968, 1968, 1968, 1968, 308, 835, 954, 1232,
156497 /* 400 */ 879, 715, 728, 1373, 864, 1329, 970, 1196, 1402, 297,
156498 /* 410 */ 1409, 1419, 1429, 1431, 1453, 1497, 1242, 1345, 1491, 1424,
156499 /* 420 */ 1362, 1521, 1523, 1423, 1525, 1363, 1412, 1548, 1585, 1495,
156500 /* 430 */ 1382, 1826, 1830, 1813, 1676, 1822, 1740, 1823, 1817, 1818,
156501 /* 440 */ 1705, 1696, 1715, 1821, 1706, 1827, 1707, 1832, 1849, 1711,
156502 /* 450 */ 1724, 1725, 1793, 1819, 1709, 1802, 1805, 1806, 1807, 1733,
156503 /* 460 */ 1748, 1829, 1730, 1863, 1865, 1846, 1758, 1714, 1809, 1847,
156504 /* 470 */ 1810, 1799, 1834, 1737, 1766, 1856, 1861, 1864, 1753, 1761,
156505 /* 480 */ 1866, 1820, 1867, 1868, 1862, 1869, 1825, 1835, 1871, 1790,
156506 /* 490 */ 1870, 1874, 1833, 1860, 1876, 1746, 1879, 1880, 1881, 1882,
156507 /* 500 */ 1883, 1884, 1886, 1878, 1887, 1889, 1888, 1775, 1890, 1892,
156508 /* 510 */ 1792, 1885, 1894, 1776, 1895, 1891, 1893, 1896, 1897, 1836,
156509 /* 520 */ 1843, 1837, 1898, 1845, 1839, 1899, 1903, 1900, 1904, 1908,
156510 /* 530 */ 1909, 1902, 1906, 1895, 1914, 1915, 1916, 1917, 1918, 1920,
156511 /* 540 */ 1919, 1934, 1924, 1925, 1926, 1927, 1929, 1930, 1922, 1824,
156512 /* 550 */ 1814, 1815, 1816, 1828, 1933, 1943, 1958, 1959,
156513 };
156514 #define YY_REDUCE_COUNT (395)
156515 #define YY_REDUCE_MIN (-262)
156516 #define YY_REDUCE_MAX (1629)
156517 static const short yy_reduce_ofst[] = {
156518 /* 0 */ 490, -122, 545, 645, 650, -120, -189, -187, -184, -182,
156519 /* 10 */ -178, -176, 45, 30, 200, -251, -134, 390, 392, 521,
156520 /* 20 */ 523, 213, 692, 821, 284, 589, 872, 666, 671, 866,
156521 /* 30 */ 71, 111, 273, 389, 686, 815, 904, 932, 948, 955,
@@ -155895,92 +156529,92 @@
156529 /* 110 */ 1285, 1313, 1316, 1320, 1322, 1325, 1327, 1330, 1366, 1371,
156530 /* 120 */ 1379, 1387, 1417, 1425, 1430, 1432, -259, -259, -259, -259,
156531 /* 130 */ -259, -259, -259, -259, -259, 557, 974, -214, -174, -9,
156532 /* 140 */ 431, -124, 806, 925, 806, 925, 251, 928, 940, -259,
156533 /* 150 */ -259, -259, -259, -198, -198, -198, 127, -186, -168, 212,
156534 /* 160 */ 646, 749, 617, 799, -262, 555, 220, 220, 491, 605,
156535 /* 170 */ 1040, 1060, 699, -11, 600, 848, 862, 345, -129, 724,
156536 /* 180 */ -91, 158, 808, 716, 900, 304, 869, 929, 926, 499,
156537 /* 190 */ 813, 322, 892, 845, 857, 1056, 1059, 908, 1036, 993,
156538 /* 200 */ 1062, 1097, -210, -185, -179, -148, -167, -89, 121, 274,
156539 /* 210 */ 281, 320, 336, 439, 663, 1011, 1064, 1068, 1075, 1127,
156540 /* 220 */ 1180, 1184, -196, 1191, 1195, 1199, 1203, 1223, 1238, 1254,
156541 /* 230 */ 1267, 1286, 1292, 1304, 1315, 205, 422, 638, 1319, 1341,
156542 /* 240 */ 1346, 1370, 1058, 1380, 1392, 1399, 1342, 1252, 1405, 1420,
156543 /* 250 */ 1384, 1427, 121, 1428, 1433, 1434, 1436, 1437, 1438, 1337,
156544 /* 260 */ 1333, 1383, 1388, 1389, 1390, 1395, 1058, 1383, 1383, 1408,
156545 /* 270 */ 1421, 1460, 1358, 1410, 1397, 1400, 1367, 1414, 1415, 1422,
156546 /* 280 */ 1374, 1442, 1439, 1441, 1435, 1450, 1452, 1416, 1440, 1443,
156547 /* 290 */ 1398, 1446, 1445, 1482, 1386, 1492, 1493, 1404, 1406, 1496,
156548 /* 300 */ 1426, 1444, 1447, 1458, 1483, 1469, 1484, 1485, 1486, 1487,
156549 /* 310 */ 1518, 1526, 1479, 1457, 1459, 1488, 1461, 1463, 1494, 1489,
156550 /* 320 */ 1499, 1490, 1529, 1537, 1454, 1462, 1539, 1541, 1524, 1545,
156551 /* 330 */ 1547, 1549, 1552, 1527, 1540, 1542, 1543, 1530, 1535, 1544,
156552 /* 340 */ 1551, 1555, 1554, 1557, 1536, 1558, 1559, 1470, 1560, 1500,
156553 /* 350 */ 1502, 1562, 1506, 1511, 1528, 1519, 1531, 1533, 1534, 1556,
156554 /* 360 */ 1583, 1473, 1474, 1532, 1561, 1563, 1565, 1564, 1595, 1522,
156555 /* 370 */ 1567, 1570, 1568, 1566, 1599, 1603, 1613, 1616, 1627, 1628,
156556 /* 380 */ 1629, 1569, 1571, 1573, 1617, 1610, 1612, 1614, 1618, 1621,
156557 /* 390 */ 1607, 1608, 1620, 1622, 1624, 1626,
156558 };
156559 static const YYACTIONTYPE yy_default[] = {
156560 /* 0 */ 1583, 1583, 1583, 1419, 1195, 1304, 1195, 1195, 1195, 1419,
156561 /* 10 */ 1419, 1419, 1195, 1334, 1334, 1472, 1226, 1195, 1195, 1195,
156562 /* 20 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1418, 1195, 1195,
156563 /* 30 */ 1195, 1195, 1502, 1502, 1195, 1195, 1195, 1195, 1195, 1195,
156564 /* 40 */ 1195, 1195, 1195, 1343, 1195, 1195, 1195, 1195, 1195, 1195,
156565 /* 50 */ 1420, 1421, 1195, 1195, 1195, 1471, 1473, 1436, 1353, 1352,
156566 /* 60 */ 1351, 1350, 1454, 1321, 1348, 1341, 1345, 1414, 1415, 1413,
156567 /* 70 */ 1417, 1421, 1420, 1195, 1344, 1385, 1399, 1384, 1195, 1195,
156568 /* 80 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156569 /* 90 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156570 /* 100 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156571 /* 110 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156572 /* 120 */ 1195, 1195, 1195, 1195, 1195, 1195, 1393, 1398, 1404, 1397,
156573 /* 130 */ 1394, 1387, 1386, 1388, 1389, 1195, 1216, 1268, 1195, 1195,
156574 /* 140 */ 1195, 1195, 1490, 1489, 1195, 1195, 1226, 1379, 1378, 1390,
156575 /* 150 */ 1391, 1401, 1400, 1479, 1537, 1536, 1437, 1195, 1195, 1195,
156576 /* 160 */ 1195, 1195, 1195, 1195, 1502, 1195, 1195, 1195, 1195, 1195,
156577 /* 170 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156578 /* 180 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1502,
156579 /* 190 */ 1502, 1195, 1226, 1502, 1502, 1222, 1222, 1328, 1195, 1485,
156580 /* 200 */ 1304, 1295, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156581 /* 210 */ 1195, 1195, 1195, 1195, 1195, 1195, 1476, 1474, 1195, 1195,
156582 /* 220 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156583 /* 230 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156584 /* 240 */ 1195, 1195, 1195, 1195, 1195, 1195, 1300, 1195, 1195, 1195,
156585 /* 250 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1531, 1195,
156586 /* 260 */ 1449, 1282, 1300, 1300, 1300, 1300, 1302, 1283, 1281, 1294,
156587 /* 270 */ 1227, 1202, 1575, 1301, 1323, 1323, 1572, 1347, 1347, 1301,
156588 /* 280 */ 1572, 1243, 1553, 1238, 1334, 1334, 1334, 1323, 1328, 1328,
156589 /* 290 */ 1416, 1301, 1294, 1195, 1575, 1309, 1309, 1574, 1574, 1309,
156590 /* 300 */ 1437, 1356, 1363, 1347, 1271, 1347, 1277, 1277, 1277, 1277,
156591 /* 310 */ 1309, 1213, 1347, 1356, 1356, 1347, 1356, 1363, 1271, 1347,
156592 /* 320 */ 1271, 1347, 1309, 1213, 1453, 1569, 1309, 1213, 1427, 1309,
156593 /* 330 */ 1213, 1309, 1213, 1427, 1269, 1269, 1269, 1258, 1195, 1195,
156594 /* 340 */ 1427, 1269, 1243, 1269, 1258, 1269, 1269, 1520, 1427, 1431,
156595 /* 350 */ 1431, 1427, 1327, 1322, 1327, 1322, 1327, 1322, 1327, 1322,
156596 /* 360 */ 1309, 1512, 1512, 1337, 1337, 1342, 1328, 1422, 1309, 1195,
156597 /* 370 */ 1342, 1340, 1338, 1347, 1219, 1261, 1534, 1534, 1530, 1530,
156598 /* 380 */ 1530, 1580, 1580, 1485, 1546, 1226, 1226, 1226, 1226, 1546,
156599 /* 390 */ 1245, 1245, 1227, 1227, 1226, 1546, 1195, 1195, 1195, 1195,
156600 /* 400 */ 1195, 1195, 1541, 1195, 1438, 1313, 1195, 1195, 1195, 1195,
156601 /* 410 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156602 /* 420 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156603 /* 430 */ 1368, 1195, 1198, 1482, 1195, 1195, 1480, 1195, 1195, 1195,
156604 /* 440 */ 1195, 1195, 1195, 1314, 1195, 1195, 1195, 1195, 1195, 1195,
156605 /* 450 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156606 /* 460 */ 1195, 1195, 1571, 1195, 1195, 1195, 1195, 1195, 1195, 1452,
156607 /* 470 */ 1451, 1195, 1195, 1311, 1195, 1195, 1195, 1195, 1195, 1195,
156608 /* 480 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1241, 1195, 1195,
156609 /* 490 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156610 /* 500 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195,
156611 /* 510 */ 1195, 1195, 1195, 1195, 1339, 1195, 1195, 1195, 1195, 1195,
156612 /* 520 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1517,
156613 /* 530 */ 1329, 1195, 1195, 1562, 1195, 1195, 1195, 1195, 1195, 1195,
156614 /* 540 */ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1557, 1285,
156615 /* 550 */ 1370, 1195, 1369, 1373, 1195, 1207, 1195, 1195,
156616 };
156617 /********** End of lemon-generated parsing tables *****************************/
156618
156619 /* The next table maps tokens (terminal symbols) into fallback tokens.
156620 ** If a construct like the following:
@@ -156741,236 +157375,237 @@
157375 /* 154 */ "setlist ::= nm EQ expr",
157376 /* 155 */ "setlist ::= LP idlist RP EQ expr",
157377 /* 156 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert",
157378 /* 157 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES",
157379 /* 158 */ "upsert ::=",
157380 /* 159 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert",
157381 /* 160 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert",
157382 /* 161 */ "upsert ::= ON CONFLICT DO NOTHING",
157383 /* 162 */ "upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt",
157384 /* 163 */ "insert_cmd ::= INSERT orconf",
157385 /* 164 */ "insert_cmd ::= REPLACE",
157386 /* 165 */ "idlist_opt ::=",
157387 /* 166 */ "idlist_opt ::= LP idlist RP",
157388 /* 167 */ "idlist ::= idlist COMMA nm",
157389 /* 168 */ "idlist ::= nm",
157390 /* 169 */ "expr ::= LP expr RP",
157391 /* 170 */ "expr ::= ID|INDEXED",
157392 /* 171 */ "expr ::= JOIN_KW",
157393 /* 172 */ "expr ::= nm DOT nm",
157394 /* 173 */ "expr ::= nm DOT nm DOT nm",
157395 /* 174 */ "term ::= NULL|FLOAT|BLOB",
157396 /* 175 */ "term ::= STRING",
157397 /* 176 */ "term ::= INTEGER",
157398 /* 177 */ "expr ::= VARIABLE",
157399 /* 178 */ "expr ::= expr COLLATE ID|STRING",
157400 /* 179 */ "expr ::= CAST LP expr AS typetoken RP",
157401 /* 180 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
157402 /* 181 */ "expr ::= ID|INDEXED LP STAR RP",
157403 /* 182 */ "expr ::= ID|INDEXED LP distinct exprlist RP filter_over",
157404 /* 183 */ "expr ::= ID|INDEXED LP STAR RP filter_over",
157405 /* 184 */ "term ::= CTIME_KW",
157406 /* 185 */ "expr ::= LP nexprlist COMMA expr RP",
157407 /* 186 */ "expr ::= expr AND expr",
157408 /* 187 */ "expr ::= expr OR expr",
157409 /* 188 */ "expr ::= expr LT|GT|GE|LE expr",
157410 /* 189 */ "expr ::= expr EQ|NE expr",
157411 /* 190 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
157412 /* 191 */ "expr ::= expr PLUS|MINUS expr",
157413 /* 192 */ "expr ::= expr STAR|SLASH|REM expr",
157414 /* 193 */ "expr ::= expr CONCAT expr",
157415 /* 194 */ "likeop ::= NOT LIKE_KW|MATCH",
157416 /* 195 */ "expr ::= expr likeop expr",
157417 /* 196 */ "expr ::= expr likeop expr ESCAPE expr",
157418 /* 197 */ "expr ::= expr ISNULL|NOTNULL",
157419 /* 198 */ "expr ::= expr NOT NULL",
157420 /* 199 */ "expr ::= expr IS expr",
157421 /* 200 */ "expr ::= expr IS NOT expr",
157422 /* 201 */ "expr ::= NOT expr",
157423 /* 202 */ "expr ::= BITNOT expr",
157424 /* 203 */ "expr ::= PLUS|MINUS expr",
157425 /* 204 */ "between_op ::= BETWEEN",
157426 /* 205 */ "between_op ::= NOT BETWEEN",
157427 /* 206 */ "expr ::= expr between_op expr AND expr",
157428 /* 207 */ "in_op ::= IN",
157429 /* 208 */ "in_op ::= NOT IN",
157430 /* 209 */ "expr ::= expr in_op LP exprlist RP",
157431 /* 210 */ "expr ::= LP select RP",
157432 /* 211 */ "expr ::= expr in_op LP select RP",
157433 /* 212 */ "expr ::= expr in_op nm dbnm paren_exprlist",
157434 /* 213 */ "expr ::= EXISTS LP select RP",
157435 /* 214 */ "expr ::= CASE case_operand case_exprlist case_else END",
157436 /* 215 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
157437 /* 216 */ "case_exprlist ::= WHEN expr THEN expr",
157438 /* 217 */ "case_else ::= ELSE expr",
157439 /* 218 */ "case_else ::=",
157440 /* 219 */ "case_operand ::= expr",
157441 /* 220 */ "case_operand ::=",
157442 /* 221 */ "exprlist ::=",
157443 /* 222 */ "nexprlist ::= nexprlist COMMA expr",
157444 /* 223 */ "nexprlist ::= expr",
157445 /* 224 */ "paren_exprlist ::=",
157446 /* 225 */ "paren_exprlist ::= LP exprlist RP",
157447 /* 226 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
157448 /* 227 */ "uniqueflag ::= UNIQUE",
157449 /* 228 */ "uniqueflag ::=",
157450 /* 229 */ "eidlist_opt ::=",
157451 /* 230 */ "eidlist_opt ::= LP eidlist RP",
157452 /* 231 */ "eidlist ::= eidlist COMMA nm collate sortorder",
157453 /* 232 */ "eidlist ::= nm collate sortorder",
157454 /* 233 */ "collate ::=",
157455 /* 234 */ "collate ::= COLLATE ID|STRING",
157456 /* 235 */ "cmd ::= DROP INDEX ifexists fullname",
157457 /* 236 */ "cmd ::= VACUUM vinto",
157458 /* 237 */ "cmd ::= VACUUM nm vinto",
157459 /* 238 */ "vinto ::= INTO expr",
157460 /* 239 */ "vinto ::=",
157461 /* 240 */ "cmd ::= PRAGMA nm dbnm",
157462 /* 241 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
157463 /* 242 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
157464 /* 243 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
157465 /* 244 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
157466 /* 245 */ "plus_num ::= PLUS INTEGER|FLOAT",
157467 /* 246 */ "minus_num ::= MINUS INTEGER|FLOAT",
157468 /* 247 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
157469 /* 248 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
157470 /* 249 */ "trigger_time ::= BEFORE|AFTER",
157471 /* 250 */ "trigger_time ::= INSTEAD OF",
157472 /* 251 */ "trigger_time ::=",
157473 /* 252 */ "trigger_event ::= DELETE|INSERT",
157474 /* 253 */ "trigger_event ::= UPDATE",
157475 /* 254 */ "trigger_event ::= UPDATE OF idlist",
157476 /* 255 */ "when_clause ::=",
157477 /* 256 */ "when_clause ::= WHEN expr",
157478 /* 257 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
157479 /* 258 */ "trigger_cmd_list ::= trigger_cmd SEMI",
157480 /* 259 */ "trnm ::= nm DOT nm",
157481 /* 260 */ "tridxby ::= INDEXED BY nm",
157482 /* 261 */ "tridxby ::= NOT INDEXED",
157483 /* 262 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt",
157484 /* 263 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt",
157485 /* 264 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
157486 /* 265 */ "trigger_cmd ::= scanpt select scanpt",
157487 /* 266 */ "expr ::= RAISE LP IGNORE RP",
157488 /* 267 */ "expr ::= RAISE LP raisetype COMMA nm RP",
157489 /* 268 */ "raisetype ::= ROLLBACK",
157490 /* 269 */ "raisetype ::= ABORT",
157491 /* 270 */ "raisetype ::= FAIL",
157492 /* 271 */ "cmd ::= DROP TRIGGER ifexists fullname",
157493 /* 272 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
157494 /* 273 */ "cmd ::= DETACH database_kw_opt expr",
157495 /* 274 */ "key_opt ::=",
157496 /* 275 */ "key_opt ::= KEY expr",
157497 /* 276 */ "cmd ::= REINDEX",
157498 /* 277 */ "cmd ::= REINDEX nm dbnm",
157499 /* 278 */ "cmd ::= ANALYZE",
157500 /* 279 */ "cmd ::= ANALYZE nm dbnm",
157501 /* 280 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
157502 /* 281 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
157503 /* 282 */ "add_column_fullname ::= fullname",
157504 /* 283 */ "cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm",
157505 /* 284 */ "cmd ::= create_vtab",
157506 /* 285 */ "cmd ::= create_vtab LP vtabarglist RP",
157507 /* 286 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
157508 /* 287 */ "vtabarg ::=",
157509 /* 288 */ "vtabargtoken ::= ANY",
157510 /* 289 */ "vtabargtoken ::= lp anylist RP",
157511 /* 290 */ "lp ::= LP",
157512 /* 291 */ "with ::= WITH wqlist",
157513 /* 292 */ "with ::= WITH RECURSIVE wqlist",
157514 /* 293 */ "wqlist ::= nm eidlist_opt AS LP select RP",
157515 /* 294 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
157516 /* 295 */ "windowdefn_list ::= windowdefn",
157517 /* 296 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
157518 /* 297 */ "windowdefn ::= nm AS LP window RP",
157519 /* 298 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
157520 /* 299 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
157521 /* 300 */ "window ::= ORDER BY sortlist frame_opt",
157522 /* 301 */ "window ::= nm ORDER BY sortlist frame_opt",
157523 /* 302 */ "window ::= frame_opt",
157524 /* 303 */ "window ::= nm frame_opt",
157525 /* 304 */ "frame_opt ::=",
157526 /* 305 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
157527 /* 306 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
157528 /* 307 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
157529 /* 308 */ "frame_bound_s ::= frame_bound",
157530 /* 309 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
157531 /* 310 */ "frame_bound_e ::= frame_bound",
157532 /* 311 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
157533 /* 312 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
157534 /* 313 */ "frame_bound ::= CURRENT ROW",
157535 /* 314 */ "frame_exclude_opt ::=",
157536 /* 315 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
157537 /* 316 */ "frame_exclude ::= NO OTHERS",
157538 /* 317 */ "frame_exclude ::= CURRENT ROW",
157539 /* 318 */ "frame_exclude ::= GROUP|TIES",
157540 /* 319 */ "window_clause ::= WINDOW windowdefn_list",
157541 /* 320 */ "filter_over ::= filter_clause over_clause",
157542 /* 321 */ "filter_over ::= over_clause",
157543 /* 322 */ "filter_over ::= filter_clause",
157544 /* 323 */ "over_clause ::= OVER LP window RP",
157545 /* 324 */ "over_clause ::= OVER nm",
157546 /* 325 */ "filter_clause ::= FILTER LP WHERE expr RP",
157547 /* 326 */ "input ::= cmdlist",
157548 /* 327 */ "cmdlist ::= cmdlist ecmd",
157549 /* 328 */ "cmdlist ::= ecmd",
157550 /* 329 */ "ecmd ::= SEMI",
157551 /* 330 */ "ecmd ::= cmdx SEMI",
157552 /* 331 */ "ecmd ::= explain cmdx SEMI",
157553 /* 332 */ "trans_opt ::=",
157554 /* 333 */ "trans_opt ::= TRANSACTION",
157555 /* 334 */ "trans_opt ::= TRANSACTION nm",
157556 /* 335 */ "savepoint_opt ::= SAVEPOINT",
157557 /* 336 */ "savepoint_opt ::=",
157558 /* 337 */ "cmd ::= create_table create_table_args",
157559 /* 338 */ "columnlist ::= columnlist COMMA columnname carglist",
157560 /* 339 */ "columnlist ::= columnname carglist",
157561 /* 340 */ "nm ::= ID|INDEXED",
157562 /* 341 */ "nm ::= STRING",
157563 /* 342 */ "nm ::= JOIN_KW",
157564 /* 343 */ "typetoken ::= typename",
157565 /* 344 */ "typename ::= ID|STRING",
157566 /* 345 */ "signed ::= plus_num",
157567 /* 346 */ "signed ::= minus_num",
157568 /* 347 */ "carglist ::= carglist ccons",
157569 /* 348 */ "carglist ::=",
157570 /* 349 */ "ccons ::= NULL onconf",
157571 /* 350 */ "ccons ::= GENERATED ALWAYS AS generated",
157572 /* 351 */ "ccons ::= AS generated",
157573 /* 352 */ "conslist_opt ::= COMMA conslist",
157574 /* 353 */ "conslist ::= conslist tconscomma tcons",
157575 /* 354 */ "conslist ::= tcons",
157576 /* 355 */ "tconscomma ::=",
157577 /* 356 */ "defer_subclause_opt ::= defer_subclause",
157578 /* 357 */ "resolvetype ::= raisetype",
157579 /* 358 */ "selectnowith ::= oneselect",
157580 /* 359 */ "oneselect ::= values",
157581 /* 360 */ "sclp ::= selcollist COMMA",
157582 /* 361 */ "as ::= ID|STRING",
157583 /* 362 */ "expr ::= term",
157584 /* 363 */ "likeop ::= LIKE_KW|MATCH",
157585 /* 364 */ "exprlist ::= nexprlist",
157586 /* 365 */ "nmnum ::= plus_num",
157587 /* 366 */ "nmnum ::= nm",
157588 /* 367 */ "nmnum ::= ON",
157589 /* 368 */ "nmnum ::= DELETE",
157590 /* 369 */ "nmnum ::= DEFAULT",
157591 /* 370 */ "plus_num ::= INTEGER|FLOAT",
157592 /* 371 */ "foreach_clause ::=",
157593 /* 372 */ "foreach_clause ::= FOR EACH ROW",
157594 /* 373 */ "trnm ::= nm",
157595 /* 374 */ "tridxby ::=",
157596 /* 375 */ "database_kw_opt ::= DATABASE",
157597 /* 376 */ "database_kw_opt ::=",
157598 /* 377 */ "kwcolumn_opt ::=",
157599 /* 378 */ "kwcolumn_opt ::= COLUMNKW",
157600 /* 379 */ "vtabarglist ::= vtabarg",
157601 /* 380 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
157602 /* 381 */ "vtabarg ::= vtabarg vtabargtoken",
157603 /* 382 */ "anylist ::=",
157604 /* 383 */ "anylist ::= anylist LP anylist RP",
157605 /* 384 */ "anylist ::= anylist ANY",
157606 /* 385 */ "with ::=",
157607 };
157608 #endif /* NDEBUG */
157609
157610
157611 #if YYSTACKDEPTH<=0
@@ -157633,236 +158268,237 @@
158268 262, /* (154) setlist ::= nm EQ expr */
158269 262, /* (155) setlist ::= LP idlist RP EQ expr */
158270 186, /* (156) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
158271 186, /* (157) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
158272 265, /* (158) upsert ::= */
158273 265, /* (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
158274 265, /* (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
158275 265, /* (161) upsert ::= ON CONFLICT DO NOTHING */
158276 265, /* (162) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt */
158277 263, /* (163) insert_cmd ::= INSERT orconf */
158278 263, /* (164) insert_cmd ::= REPLACE */
158279 264, /* (165) idlist_opt ::= */
158280 264, /* (166) idlist_opt ::= LP idlist RP */
158281 259, /* (167) idlist ::= idlist COMMA nm */
158282 259, /* (168) idlist ::= nm */
158283 212, /* (169) expr ::= LP expr RP */
158284 212, /* (170) expr ::= ID|INDEXED */
158285 212, /* (171) expr ::= JOIN_KW */
158286 212, /* (172) expr ::= nm DOT nm */
158287 212, /* (173) expr ::= nm DOT nm DOT nm */
158288 211, /* (174) term ::= NULL|FLOAT|BLOB */
158289 211, /* (175) term ::= STRING */
158290 211, /* (176) term ::= INTEGER */
158291 212, /* (177) expr ::= VARIABLE */
158292 212, /* (178) expr ::= expr COLLATE ID|STRING */
158293 212, /* (179) expr ::= CAST LP expr AS typetoken RP */
158294 212, /* (180) expr ::= ID|INDEXED LP distinct exprlist RP */
158295 212, /* (181) expr ::= ID|INDEXED LP STAR RP */
158296 212, /* (182) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
158297 212, /* (183) expr ::= ID|INDEXED LP STAR RP filter_over */
158298 211, /* (184) term ::= CTIME_KW */
158299 212, /* (185) expr ::= LP nexprlist COMMA expr RP */
158300 212, /* (186) expr ::= expr AND expr */
158301 212, /* (187) expr ::= expr OR expr */
158302 212, /* (188) expr ::= expr LT|GT|GE|LE expr */
158303 212, /* (189) expr ::= expr EQ|NE expr */
158304 212, /* (190) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
158305 212, /* (191) expr ::= expr PLUS|MINUS expr */
158306 212, /* (192) expr ::= expr STAR|SLASH|REM expr */
158307 212, /* (193) expr ::= expr CONCAT expr */
158308 267, /* (194) likeop ::= NOT LIKE_KW|MATCH */
158309 212, /* (195) expr ::= expr likeop expr */
158310 212, /* (196) expr ::= expr likeop expr ESCAPE expr */
158311 212, /* (197) expr ::= expr ISNULL|NOTNULL */
158312 212, /* (198) expr ::= expr NOT NULL */
158313 212, /* (199) expr ::= expr IS expr */
158314 212, /* (200) expr ::= expr IS NOT expr */
158315 212, /* (201) expr ::= NOT expr */
158316 212, /* (202) expr ::= BITNOT expr */
158317 212, /* (203) expr ::= PLUS|MINUS expr */
158318 268, /* (204) between_op ::= BETWEEN */
158319 268, /* (205) between_op ::= NOT BETWEEN */
158320 212, /* (206) expr ::= expr between_op expr AND expr */
158321 269, /* (207) in_op ::= IN */
158322 269, /* (208) in_op ::= NOT IN */
158323 212, /* (209) expr ::= expr in_op LP exprlist RP */
158324 212, /* (210) expr ::= LP select RP */
158325 212, /* (211) expr ::= expr in_op LP select RP */
158326 212, /* (212) expr ::= expr in_op nm dbnm paren_exprlist */
158327 212, /* (213) expr ::= EXISTS LP select RP */
158328 212, /* (214) expr ::= CASE case_operand case_exprlist case_else END */
158329 272, /* (215) case_exprlist ::= case_exprlist WHEN expr THEN expr */
158330 272, /* (216) case_exprlist ::= WHEN expr THEN expr */
158331 273, /* (217) case_else ::= ELSE expr */
158332 273, /* (218) case_else ::= */
158333 271, /* (219) case_operand ::= expr */
158334 271, /* (220) case_operand ::= */
158335 257, /* (221) exprlist ::= */
158336 248, /* (222) nexprlist ::= nexprlist COMMA expr */
158337 248, /* (223) nexprlist ::= expr */
158338 270, /* (224) paren_exprlist ::= */
158339 270, /* (225) paren_exprlist ::= LP exprlist RP */
158340 186, /* (226) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
158341 274, /* (227) uniqueflag ::= UNIQUE */
158342 274, /* (228) uniqueflag ::= */
158343 216, /* (229) eidlist_opt ::= */
158344 216, /* (230) eidlist_opt ::= LP eidlist RP */
158345 227, /* (231) eidlist ::= eidlist COMMA nm collate sortorder */
158346 227, /* (232) eidlist ::= nm collate sortorder */
158347 275, /* (233) collate ::= */
158348 275, /* (234) collate ::= COLLATE ID|STRING */
158349 186, /* (235) cmd ::= DROP INDEX ifexists fullname */
158350 186, /* (236) cmd ::= VACUUM vinto */
158351 186, /* (237) cmd ::= VACUUM nm vinto */
158352 276, /* (238) vinto ::= INTO expr */
158353 276, /* (239) vinto ::= */
158354 186, /* (240) cmd ::= PRAGMA nm dbnm */
158355 186, /* (241) cmd ::= PRAGMA nm dbnm EQ nmnum */
158356 186, /* (242) cmd ::= PRAGMA nm dbnm LP nmnum RP */
158357 186, /* (243) cmd ::= PRAGMA nm dbnm EQ minus_num */
158358 186, /* (244) cmd ::= PRAGMA nm dbnm LP minus_num RP */
158359 206, /* (245) plus_num ::= PLUS INTEGER|FLOAT */
158360 207, /* (246) minus_num ::= MINUS INTEGER|FLOAT */
158361 186, /* (247) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
158362 278, /* (248) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
158363 280, /* (249) trigger_time ::= BEFORE|AFTER */
158364 280, /* (250) trigger_time ::= INSTEAD OF */
158365 280, /* (251) trigger_time ::= */
158366 281, /* (252) trigger_event ::= DELETE|INSERT */
158367 281, /* (253) trigger_event ::= UPDATE */
158368 281, /* (254) trigger_event ::= UPDATE OF idlist */
158369 283, /* (255) when_clause ::= */
158370 283, /* (256) when_clause ::= WHEN expr */
158371 279, /* (257) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
158372 279, /* (258) trigger_cmd_list ::= trigger_cmd SEMI */
158373 285, /* (259) trnm ::= nm DOT nm */
158374 286, /* (260) tridxby ::= INDEXED BY nm */
158375 286, /* (261) tridxby ::= NOT INDEXED */
158376 284, /* (262) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
158377 284, /* (263) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
158378 284, /* (264) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
158379 284, /* (265) trigger_cmd ::= scanpt select scanpt */
158380 212, /* (266) expr ::= RAISE LP IGNORE RP */
158381 212, /* (267) expr ::= RAISE LP raisetype COMMA nm RP */
158382 231, /* (268) raisetype ::= ROLLBACK */
158383 231, /* (269) raisetype ::= ABORT */
158384 231, /* (270) raisetype ::= FAIL */
158385 186, /* (271) cmd ::= DROP TRIGGER ifexists fullname */
158386 186, /* (272) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
158387 186, /* (273) cmd ::= DETACH database_kw_opt expr */
158388 288, /* (274) key_opt ::= */
158389 288, /* (275) key_opt ::= KEY expr */
158390 186, /* (276) cmd ::= REINDEX */
158391 186, /* (277) cmd ::= REINDEX nm dbnm */
158392 186, /* (278) cmd ::= ANALYZE */
158393 186, /* (279) cmd ::= ANALYZE nm dbnm */
158394 186, /* (280) cmd ::= ALTER TABLE fullname RENAME TO nm */
158395 186, /* (281) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
158396 289, /* (282) add_column_fullname ::= fullname */
158397 186, /* (283) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
158398 186, /* (284) cmd ::= create_vtab */
158399 186, /* (285) cmd ::= create_vtab LP vtabarglist RP */
158400 291, /* (286) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
158401 293, /* (287) vtabarg ::= */
158402 294, /* (288) vtabargtoken ::= ANY */
158403 294, /* (289) vtabargtoken ::= lp anylist RP */
158404 295, /* (290) lp ::= LP */
158405 261, /* (291) with ::= WITH wqlist */
158406 261, /* (292) with ::= WITH RECURSIVE wqlist */
158407 236, /* (293) wqlist ::= nm eidlist_opt AS LP select RP */
158408 236, /* (294) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
158409 297, /* (295) windowdefn_list ::= windowdefn */
158410 297, /* (296) windowdefn_list ::= windowdefn_list COMMA windowdefn */
158411 298, /* (297) windowdefn ::= nm AS LP window RP */
158412 299, /* (298) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
158413 299, /* (299) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
158414 299, /* (300) window ::= ORDER BY sortlist frame_opt */
158415 299, /* (301) window ::= nm ORDER BY sortlist frame_opt */
158416 299, /* (302) window ::= frame_opt */
158417 299, /* (303) window ::= nm frame_opt */
158418 300, /* (304) frame_opt ::= */
158419 300, /* (305) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
158420 300, /* (306) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
158421 304, /* (307) range_or_rows ::= RANGE|ROWS|GROUPS */
158422 306, /* (308) frame_bound_s ::= frame_bound */
158423 306, /* (309) frame_bound_s ::= UNBOUNDED PRECEDING */
158424 307, /* (310) frame_bound_e ::= frame_bound */
158425 307, /* (311) frame_bound_e ::= UNBOUNDED FOLLOWING */
158426 305, /* (312) frame_bound ::= expr PRECEDING|FOLLOWING */
158427 305, /* (313) frame_bound ::= CURRENT ROW */
158428 308, /* (314) frame_exclude_opt ::= */
158429 308, /* (315) frame_exclude_opt ::= EXCLUDE frame_exclude */
158430 309, /* (316) frame_exclude ::= NO OTHERS */
158431 309, /* (317) frame_exclude ::= CURRENT ROW */
158432 309, /* (318) frame_exclude ::= GROUP|TIES */
158433 246, /* (319) window_clause ::= WINDOW windowdefn_list */
158434 266, /* (320) filter_over ::= filter_clause over_clause */
158435 266, /* (321) filter_over ::= over_clause */
158436 266, /* (322) filter_over ::= filter_clause */
158437 303, /* (323) over_clause ::= OVER LP window RP */
158438 303, /* (324) over_clause ::= OVER nm */
158439 302, /* (325) filter_clause ::= FILTER LP WHERE expr RP */
158440 181, /* (326) input ::= cmdlist */
158441 182, /* (327) cmdlist ::= cmdlist ecmd */
158442 182, /* (328) cmdlist ::= ecmd */
158443 183, /* (329) ecmd ::= SEMI */
158444 183, /* (330) ecmd ::= cmdx SEMI */
158445 183, /* (331) ecmd ::= explain cmdx SEMI */
158446 188, /* (332) trans_opt ::= */
158447 188, /* (333) trans_opt ::= TRANSACTION */
158448 188, /* (334) trans_opt ::= TRANSACTION nm */
158449 190, /* (335) savepoint_opt ::= SAVEPOINT */
158450 190, /* (336) savepoint_opt ::= */
158451 186, /* (337) cmd ::= create_table create_table_args */
158452 197, /* (338) columnlist ::= columnlist COMMA columnname carglist */
158453 197, /* (339) columnlist ::= columnname carglist */
158454 189, /* (340) nm ::= ID|INDEXED */
158455 189, /* (341) nm ::= STRING */
158456 189, /* (342) nm ::= JOIN_KW */
158457 203, /* (343) typetoken ::= typename */
158458 204, /* (344) typename ::= ID|STRING */
158459 205, /* (345) signed ::= plus_num */
158460 205, /* (346) signed ::= minus_num */
158461 202, /* (347) carglist ::= carglist ccons */
158462 202, /* (348) carglist ::= */
158463 210, /* (349) ccons ::= NULL onconf */
158464 210, /* (350) ccons ::= GENERATED ALWAYS AS generated */
158465 210, /* (351) ccons ::= AS generated */
158466 198, /* (352) conslist_opt ::= COMMA conslist */
158467 223, /* (353) conslist ::= conslist tconscomma tcons */
158468 223, /* (354) conslist ::= tcons */
158469 224, /* (355) tconscomma ::= */
158470 228, /* (356) defer_subclause_opt ::= defer_subclause */
158471 230, /* (357) resolvetype ::= raisetype */
158472 234, /* (358) selectnowith ::= oneselect */
158473 235, /* (359) oneselect ::= values */
158474 249, /* (360) sclp ::= selcollist COMMA */
158475 250, /* (361) as ::= ID|STRING */
158476 212, /* (362) expr ::= term */
158477 267, /* (363) likeop ::= LIKE_KW|MATCH */
158478 257, /* (364) exprlist ::= nexprlist */
158479 277, /* (365) nmnum ::= plus_num */
158480 277, /* (366) nmnum ::= nm */
158481 277, /* (367) nmnum ::= ON */
158482 277, /* (368) nmnum ::= DELETE */
158483 277, /* (369) nmnum ::= DEFAULT */
158484 206, /* (370) plus_num ::= INTEGER|FLOAT */
158485 282, /* (371) foreach_clause ::= */
158486 282, /* (372) foreach_clause ::= FOR EACH ROW */
158487 285, /* (373) trnm ::= nm */
158488 286, /* (374) tridxby ::= */
158489 287, /* (375) database_kw_opt ::= DATABASE */
158490 287, /* (376) database_kw_opt ::= */
158491 290, /* (377) kwcolumn_opt ::= */
158492 290, /* (378) kwcolumn_opt ::= COLUMNKW */
158493 292, /* (379) vtabarglist ::= vtabarg */
158494 292, /* (380) vtabarglist ::= vtabarglist COMMA vtabarg */
158495 293, /* (381) vtabarg ::= vtabarg vtabargtoken */
158496 296, /* (382) anylist ::= */
158497 296, /* (383) anylist ::= anylist LP anylist RP */
158498 296, /* (384) anylist ::= anylist ANY */
158499 261, /* (385) with ::= */
158500 };
158501
158502 /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
158503 ** of symbols on the right-hand side of that rule. */
158504 static const signed char yyRuleInfoNRhs[] = {
@@ -158023,236 +158659,237 @@
158659 -3, /* (154) setlist ::= nm EQ expr */
158660 -5, /* (155) setlist ::= LP idlist RP EQ expr */
158661 -7, /* (156) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
158662 -7, /* (157) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
158663 0, /* (158) upsert ::= */
158664 -12, /* (159) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
158665 -9, /* (160) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
158666 -4, /* (161) upsert ::= ON CONFLICT DO NOTHING */
158667 -7, /* (162) upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt */
158668 -2, /* (163) insert_cmd ::= INSERT orconf */
158669 -1, /* (164) insert_cmd ::= REPLACE */
158670 0, /* (165) idlist_opt ::= */
158671 -3, /* (166) idlist_opt ::= LP idlist RP */
158672 -3, /* (167) idlist ::= idlist COMMA nm */
158673 -1, /* (168) idlist ::= nm */
158674 -3, /* (169) expr ::= LP expr RP */
158675 -1, /* (170) expr ::= ID|INDEXED */
158676 -1, /* (171) expr ::= JOIN_KW */
158677 -3, /* (172) expr ::= nm DOT nm */
158678 -5, /* (173) expr ::= nm DOT nm DOT nm */
158679 -1, /* (174) term ::= NULL|FLOAT|BLOB */
158680 -1, /* (175) term ::= STRING */
158681 -1, /* (176) term ::= INTEGER */
158682 -1, /* (177) expr ::= VARIABLE */
158683 -3, /* (178) expr ::= expr COLLATE ID|STRING */
158684 -6, /* (179) expr ::= CAST LP expr AS typetoken RP */
158685 -5, /* (180) expr ::= ID|INDEXED LP distinct exprlist RP */
158686 -4, /* (181) expr ::= ID|INDEXED LP STAR RP */
158687 -6, /* (182) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
158688 -5, /* (183) expr ::= ID|INDEXED LP STAR RP filter_over */
158689 -1, /* (184) term ::= CTIME_KW */
158690 -5, /* (185) expr ::= LP nexprlist COMMA expr RP */
158691 -3, /* (186) expr ::= expr AND expr */
158692 -3, /* (187) expr ::= expr OR expr */
158693 -3, /* (188) expr ::= expr LT|GT|GE|LE expr */
158694 -3, /* (189) expr ::= expr EQ|NE expr */
158695 -3, /* (190) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
158696 -3, /* (191) expr ::= expr PLUS|MINUS expr */
158697 -3, /* (192) expr ::= expr STAR|SLASH|REM expr */
158698 -3, /* (193) expr ::= expr CONCAT expr */
158699 -2, /* (194) likeop ::= NOT LIKE_KW|MATCH */
158700 -3, /* (195) expr ::= expr likeop expr */
158701 -5, /* (196) expr ::= expr likeop expr ESCAPE expr */
158702 -2, /* (197) expr ::= expr ISNULL|NOTNULL */
158703 -3, /* (198) expr ::= expr NOT NULL */
158704 -3, /* (199) expr ::= expr IS expr */
158705 -4, /* (200) expr ::= expr IS NOT expr */
158706 -2, /* (201) expr ::= NOT expr */
158707 -2, /* (202) expr ::= BITNOT expr */
158708 -2, /* (203) expr ::= PLUS|MINUS expr */
158709 -1, /* (204) between_op ::= BETWEEN */
158710 -2, /* (205) between_op ::= NOT BETWEEN */
158711 -5, /* (206) expr ::= expr between_op expr AND expr */
158712 -1, /* (207) in_op ::= IN */
158713 -2, /* (208) in_op ::= NOT IN */
158714 -5, /* (209) expr ::= expr in_op LP exprlist RP */
158715 -3, /* (210) expr ::= LP select RP */
158716 -5, /* (211) expr ::= expr in_op LP select RP */
158717 -5, /* (212) expr ::= expr in_op nm dbnm paren_exprlist */
158718 -4, /* (213) expr ::= EXISTS LP select RP */
158719 -5, /* (214) expr ::= CASE case_operand case_exprlist case_else END */
158720 -5, /* (215) case_exprlist ::= case_exprlist WHEN expr THEN expr */
158721 -4, /* (216) case_exprlist ::= WHEN expr THEN expr */
158722 -2, /* (217) case_else ::= ELSE expr */
158723 0, /* (218) case_else ::= */
158724 -1, /* (219) case_operand ::= expr */
158725 0, /* (220) case_operand ::= */
158726 0, /* (221) exprlist ::= */
158727 -3, /* (222) nexprlist ::= nexprlist COMMA expr */
158728 -1, /* (223) nexprlist ::= expr */
158729 0, /* (224) paren_exprlist ::= */
158730 -3, /* (225) paren_exprlist ::= LP exprlist RP */
158731 -12, /* (226) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
158732 -1, /* (227) uniqueflag ::= UNIQUE */
158733 0, /* (228) uniqueflag ::= */
158734 0, /* (229) eidlist_opt ::= */
158735 -3, /* (230) eidlist_opt ::= LP eidlist RP */
158736 -5, /* (231) eidlist ::= eidlist COMMA nm collate sortorder */
158737 -3, /* (232) eidlist ::= nm collate sortorder */
158738 0, /* (233) collate ::= */
158739 -2, /* (234) collate ::= COLLATE ID|STRING */
158740 -4, /* (235) cmd ::= DROP INDEX ifexists fullname */
158741 -2, /* (236) cmd ::= VACUUM vinto */
158742 -3, /* (237) cmd ::= VACUUM nm vinto */
158743 -2, /* (238) vinto ::= INTO expr */
158744 0, /* (239) vinto ::= */
158745 -3, /* (240) cmd ::= PRAGMA nm dbnm */
158746 -5, /* (241) cmd ::= PRAGMA nm dbnm EQ nmnum */
158747 -6, /* (242) cmd ::= PRAGMA nm dbnm LP nmnum RP */
158748 -5, /* (243) cmd ::= PRAGMA nm dbnm EQ minus_num */
158749 -6, /* (244) cmd ::= PRAGMA nm dbnm LP minus_num RP */
158750 -2, /* (245) plus_num ::= PLUS INTEGER|FLOAT */
158751 -2, /* (246) minus_num ::= MINUS INTEGER|FLOAT */
158752 -5, /* (247) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
158753 -11, /* (248) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
158754 -1, /* (249) trigger_time ::= BEFORE|AFTER */
158755 -2, /* (250) trigger_time ::= INSTEAD OF */
158756 0, /* (251) trigger_time ::= */
158757 -1, /* (252) trigger_event ::= DELETE|INSERT */
158758 -1, /* (253) trigger_event ::= UPDATE */
158759 -3, /* (254) trigger_event ::= UPDATE OF idlist */
158760 0, /* (255) when_clause ::= */
158761 -2, /* (256) when_clause ::= WHEN expr */
158762 -3, /* (257) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
158763 -2, /* (258) trigger_cmd_list ::= trigger_cmd SEMI */
158764 -3, /* (259) trnm ::= nm DOT nm */
158765 -3, /* (260) tridxby ::= INDEXED BY nm */
158766 -2, /* (261) tridxby ::= NOT INDEXED */
158767 -9, /* (262) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
158768 -8, /* (263) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
158769 -6, /* (264) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
158770 -3, /* (265) trigger_cmd ::= scanpt select scanpt */
158771 -4, /* (266) expr ::= RAISE LP IGNORE RP */
158772 -6, /* (267) expr ::= RAISE LP raisetype COMMA nm RP */
158773 -1, /* (268) raisetype ::= ROLLBACK */
158774 -1, /* (269) raisetype ::= ABORT */
158775 -1, /* (270) raisetype ::= FAIL */
158776 -4, /* (271) cmd ::= DROP TRIGGER ifexists fullname */
158777 -6, /* (272) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
158778 -3, /* (273) cmd ::= DETACH database_kw_opt expr */
158779 0, /* (274) key_opt ::= */
158780 -2, /* (275) key_opt ::= KEY expr */
158781 -1, /* (276) cmd ::= REINDEX */
158782 -3, /* (277) cmd ::= REINDEX nm dbnm */
158783 -1, /* (278) cmd ::= ANALYZE */
158784 -3, /* (279) cmd ::= ANALYZE nm dbnm */
158785 -6, /* (280) cmd ::= ALTER TABLE fullname RENAME TO nm */
158786 -7, /* (281) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
158787 -1, /* (282) add_column_fullname ::= fullname */
158788 -8, /* (283) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
158789 -1, /* (284) cmd ::= create_vtab */
158790 -4, /* (285) cmd ::= create_vtab LP vtabarglist RP */
158791 -8, /* (286) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
158792 0, /* (287) vtabarg ::= */
158793 -1, /* (288) vtabargtoken ::= ANY */
158794 -3, /* (289) vtabargtoken ::= lp anylist RP */
158795 -1, /* (290) lp ::= LP */
158796 -2, /* (291) with ::= WITH wqlist */
158797 -3, /* (292) with ::= WITH RECURSIVE wqlist */
158798 -6, /* (293) wqlist ::= nm eidlist_opt AS LP select RP */
158799 -8, /* (294) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
158800 -1, /* (295) windowdefn_list ::= windowdefn */
158801 -3, /* (296) windowdefn_list ::= windowdefn_list COMMA windowdefn */
158802 -5, /* (297) windowdefn ::= nm AS LP window RP */
158803 -5, /* (298) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
158804 -6, /* (299) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
158805 -4, /* (300) window ::= ORDER BY sortlist frame_opt */
158806 -5, /* (301) window ::= nm ORDER BY sortlist frame_opt */
158807 -1, /* (302) window ::= frame_opt */
158808 -2, /* (303) window ::= nm frame_opt */
158809 0, /* (304) frame_opt ::= */
158810 -3, /* (305) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
158811 -6, /* (306) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
158812 -1, /* (307) range_or_rows ::= RANGE|ROWS|GROUPS */
158813 -1, /* (308) frame_bound_s ::= frame_bound */
158814 -2, /* (309) frame_bound_s ::= UNBOUNDED PRECEDING */
158815 -1, /* (310) frame_bound_e ::= frame_bound */
158816 -2, /* (311) frame_bound_e ::= UNBOUNDED FOLLOWING */
158817 -2, /* (312) frame_bound ::= expr PRECEDING|FOLLOWING */
158818 -2, /* (313) frame_bound ::= CURRENT ROW */
158819 0, /* (314) frame_exclude_opt ::= */
158820 -2, /* (315) frame_exclude_opt ::= EXCLUDE frame_exclude */
158821 -2, /* (316) frame_exclude ::= NO OTHERS */
158822 -2, /* (317) frame_exclude ::= CURRENT ROW */
158823 -1, /* (318) frame_exclude ::= GROUP|TIES */
158824 -2, /* (319) window_clause ::= WINDOW windowdefn_list */
158825 -2, /* (320) filter_over ::= filter_clause over_clause */
158826 -1, /* (321) filter_over ::= over_clause */
158827 -1, /* (322) filter_over ::= filter_clause */
158828 -4, /* (323) over_clause ::= OVER LP window RP */
158829 -2, /* (324) over_clause ::= OVER nm */
158830 -5, /* (325) filter_clause ::= FILTER LP WHERE expr RP */
158831 -1, /* (326) input ::= cmdlist */
158832 -2, /* (327) cmdlist ::= cmdlist ecmd */
158833 -1, /* (328) cmdlist ::= ecmd */
158834 -1, /* (329) ecmd ::= SEMI */
158835 -2, /* (330) ecmd ::= cmdx SEMI */
158836 -3, /* (331) ecmd ::= explain cmdx SEMI */
158837 0, /* (332) trans_opt ::= */
158838 -1, /* (333) trans_opt ::= TRANSACTION */
158839 -2, /* (334) trans_opt ::= TRANSACTION nm */
158840 -1, /* (335) savepoint_opt ::= SAVEPOINT */
158841 0, /* (336) savepoint_opt ::= */
158842 -2, /* (337) cmd ::= create_table create_table_args */
158843 -4, /* (338) columnlist ::= columnlist COMMA columnname carglist */
158844 -2, /* (339) columnlist ::= columnname carglist */
158845 -1, /* (340) nm ::= ID|INDEXED */
158846 -1, /* (341) nm ::= STRING */
158847 -1, /* (342) nm ::= JOIN_KW */
158848 -1, /* (343) typetoken ::= typename */
158849 -1, /* (344) typename ::= ID|STRING */
158850 -1, /* (345) signed ::= plus_num */
158851 -1, /* (346) signed ::= minus_num */
158852 -2, /* (347) carglist ::= carglist ccons */
158853 0, /* (348) carglist ::= */
158854 -2, /* (349) ccons ::= NULL onconf */
158855 -4, /* (350) ccons ::= GENERATED ALWAYS AS generated */
158856 -2, /* (351) ccons ::= AS generated */
158857 -2, /* (352) conslist_opt ::= COMMA conslist */
158858 -3, /* (353) conslist ::= conslist tconscomma tcons */
158859 -1, /* (354) conslist ::= tcons */
158860 0, /* (355) tconscomma ::= */
158861 -1, /* (356) defer_subclause_opt ::= defer_subclause */
158862 -1, /* (357) resolvetype ::= raisetype */
158863 -1, /* (358) selectnowith ::= oneselect */
158864 -1, /* (359) oneselect ::= values */
158865 -2, /* (360) sclp ::= selcollist COMMA */
158866 -1, /* (361) as ::= ID|STRING */
158867 -1, /* (362) expr ::= term */
158868 -1, /* (363) likeop ::= LIKE_KW|MATCH */
158869 -1, /* (364) exprlist ::= nexprlist */
158870 -1, /* (365) nmnum ::= plus_num */
158871 -1, /* (366) nmnum ::= nm */
158872 -1, /* (367) nmnum ::= ON */
158873 -1, /* (368) nmnum ::= DELETE */
158874 -1, /* (369) nmnum ::= DEFAULT */
158875 -1, /* (370) plus_num ::= INTEGER|FLOAT */
158876 0, /* (371) foreach_clause ::= */
158877 -3, /* (372) foreach_clause ::= FOR EACH ROW */
158878 -1, /* (373) trnm ::= nm */
158879 0, /* (374) tridxby ::= */
158880 -1, /* (375) database_kw_opt ::= DATABASE */
158881 0, /* (376) database_kw_opt ::= */
158882 0, /* (377) kwcolumn_opt ::= */
158883 -1, /* (378) kwcolumn_opt ::= COLUMNKW */
158884 -1, /* (379) vtabarglist ::= vtabarg */
158885 -3, /* (380) vtabarglist ::= vtabarglist COMMA vtabarg */
158886 -2, /* (381) vtabarg ::= vtabarg vtabargtoken */
158887 0, /* (382) anylist ::= */
158888 -4, /* (383) anylist ::= anylist LP anylist RP */
158889 -2, /* (384) anylist ::= anylist ANY */
158890 0, /* (385) with ::= */
158891 };
158892
158893 static void yy_accept(yyParser*); /* Forward Declaration */
158894
158895 /*
@@ -158357,11 +158994,11 @@
158994 {yymsp[1].minor.yy192 = TK_DEFERRED;}
158995 break;
158996 case 5: /* transtype ::= DEFERRED */
158997 case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
158998 case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
158999 case 307: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==307);
159000 {yymsp[0].minor.yy192 = yymsp[0].major; /*A-overwrites-X*/}
159001 break;
159002 case 8: /* cmd ::= COMMIT|END trans_opt */
159003 case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
159004 {sqlite3EndTransaction(pParse,yymsp[-1].major);}
@@ -158395,11 +159032,11 @@
159032 case 45: /* autoinc ::= */ yytestcase(yyruleno==45);
159033 case 60: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==60);
159034 case 70: /* defer_subclause_opt ::= */ yytestcase(yyruleno==70);
159035 case 79: /* ifexists ::= */ yytestcase(yyruleno==79);
159036 case 96: /* distinct ::= */ yytestcase(yyruleno==96);
159037 case 233: /* collate ::= */ yytestcase(yyruleno==233);
159038 {yymsp[1].minor.yy192 = 0;}
159039 break;
159040 case 16: /* ifnotexists ::= IF NOT EXISTS */
159041 {yymsp[-2].minor.yy192 = 1;}
159042 break;
@@ -158554,18 +159191,18 @@
159191 case 58: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
159192 {yymsp[-2].minor.yy192 = 0;}
159193 break;
159194 case 59: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
159195 case 74: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==74);
159196 case 163: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==163);
159197 {yymsp[-1].minor.yy192 = yymsp[0].minor.yy192;}
159198 break;
159199 case 61: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
159200 case 78: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==78);
159201 case 205: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==205);
159202 case 208: /* in_op ::= NOT IN */ yytestcase(yyruleno==208);
159203 case 234: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==234);
159204 {yymsp[-1].minor.yy192 = 1;}
159205 break;
159206 case 62: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
159207 {yymsp[-1].minor.yy192 = 0;}
159208 break;
@@ -158597,11 +159234,11 @@
159234 break;
159235 case 75: /* resolvetype ::= IGNORE */
159236 {yymsp[0].minor.yy192 = OE_Ignore;}
159237 break;
159238 case 76: /* resolvetype ::= REPLACE */
159239 case 164: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==164);
159240 {yymsp[0].minor.yy192 = OE_Replace;}
159241 break;
159242 case 77: /* cmd ::= DROP TABLE ifexists fullname */
159243 {
159244 sqlite3DropTable(pParse, yymsp[0].minor.yy47, 0, yymsp[-1].minor.yy192);
@@ -158729,13 +159366,13 @@
159366 {yymsp[0].minor.yy192 = SF_All;}
159367 break;
159368 case 97: /* sclp ::= */
159369 case 130: /* orderby_opt ::= */ yytestcase(yyruleno==130);
159370 case 140: /* groupby_opt ::= */ yytestcase(yyruleno==140);
159371 case 221: /* exprlist ::= */ yytestcase(yyruleno==221);
159372 case 224: /* paren_exprlist ::= */ yytestcase(yyruleno==224);
159373 case 229: /* eidlist_opt ::= */ yytestcase(yyruleno==229);
159374 {yymsp[1].minor.yy242 = 0;}
159375 break;
159376 case 98: /* selcollist ::= sclp scanpt expr scanpt as */
159377 {
159378 yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy242, yymsp[-2].minor.yy202);
@@ -158757,12 +159394,12 @@
159394 yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242, pDot);
159395 }
159396 break;
159397 case 101: /* as ::= AS nm */
159398 case 112: /* dbnm ::= DOT nm */ yytestcase(yyruleno==112);
159399 case 245: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==245);
159400 case 246: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==246);
159401 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
159402 break;
159403 case 103: /* from ::= */
159404 case 106: /* stl_prefix ::= */ yytestcase(yyruleno==106);
159405 {yymsp[1].minor.yy47 = 0;}
@@ -158874,21 +159511,21 @@
159511 {yymsp[-3].minor.yy192 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
159512 break;
159513 case 123: /* on_opt ::= ON expr */
159514 case 143: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==143);
159515 case 150: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==150);
159516 case 217: /* case_else ::= ELSE expr */ yytestcase(yyruleno==217);
159517 case 238: /* vinto ::= INTO expr */ yytestcase(yyruleno==238);
159518 {yymsp[-1].minor.yy202 = yymsp[0].minor.yy202;}
159519 break;
159520 case 124: /* on_opt ::= */
159521 case 142: /* having_opt ::= */ yytestcase(yyruleno==142);
159522 case 144: /* limit_opt ::= */ yytestcase(yyruleno==144);
159523 case 149: /* where_opt ::= */ yytestcase(yyruleno==149);
159524 case 218: /* case_else ::= */ yytestcase(yyruleno==218);
159525 case 220: /* case_operand ::= */ yytestcase(yyruleno==220);
159526 case 239: /* vinto ::= */ yytestcase(yyruleno==239);
159527 {yymsp[1].minor.yy202 = 0;}
159528 break;
159529 case 126: /* indexed_opt ::= INDEXED BY nm */
159530 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
159531 break;
@@ -158897,11 +159534,11 @@
159534 break;
159535 case 128: /* using_opt ::= USING LP idlist RP */
159536 {yymsp[-3].minor.yy600 = yymsp[-1].minor.yy600;}
159537 break;
159538 case 129: /* using_opt ::= */
159539 case 165: /* idlist_opt ::= */ yytestcase(yyruleno==165);
159540 {yymsp[1].minor.yy600 = 0;}
159541 break;
159542 case 131: /* orderby_opt ::= ORDER BY sortlist */
159543 case 141: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==141);
159544 {yymsp[-2].minor.yy242 = yymsp[0].minor.yy242;}
@@ -158991,36 +159628,39 @@
159628 }
159629 break;
159630 case 158: /* upsert ::= */
159631 { yymsp[1].minor.yy318 = 0; }
159632 break;
159633 case 159: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
159634 { yymsp[-11].minor.yy318 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy242,yymsp[-6].minor.yy202,yymsp[-2].minor.yy242,yymsp[-1].minor.yy202,yymsp[0].minor.yy318);}
159635 break;
159636 case 160: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
159637 { yymsp[-8].minor.yy318 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy242,yymsp[-3].minor.yy202,0,0,yymsp[0].minor.yy318); }
159638 break;
159639 case 161: /* upsert ::= ON CONFLICT DO NOTHING */
159640 { yymsp[-3].minor.yy318 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
159641 break;
159642 case 162: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt */
159643 { yymsp[-6].minor.yy318 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-1].minor.yy242,yymsp[0].minor.yy202,0);}
159644 break;
159645 case 166: /* idlist_opt ::= LP idlist RP */
159646 {yymsp[-2].minor.yy600 = yymsp[-1].minor.yy600;}
159647 break;
159648 case 167: /* idlist ::= idlist COMMA nm */
159649 {yymsp[-2].minor.yy600 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy600,&yymsp[0].minor.yy0);}
159650 break;
159651 case 168: /* idlist ::= nm */
159652 {yymsp[0].minor.yy600 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
159653 break;
159654 case 169: /* expr ::= LP expr RP */
159655 {yymsp[-2].minor.yy202 = yymsp[-1].minor.yy202;}
159656 break;
159657 case 170: /* expr ::= ID|INDEXED */
159658 case 171: /* expr ::= JOIN_KW */ yytestcase(yyruleno==171);
159659 {yymsp[0].minor.yy202=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
159660 break;
159661 case 172: /* expr ::= nm DOT nm */
159662 {
159663 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
159664 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
159665 if( IN_RENAME_OBJECT ){
159666 sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[0].minor.yy0);
@@ -159028,11 +159668,11 @@
159668 }
159669 yylhsminor.yy202 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
159670 }
159671 yymsp[-2].minor.yy202 = yylhsminor.yy202;
159672 break;
159673 case 173: /* expr ::= nm DOT nm DOT nm */
159674 {
159675 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
159676 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
159677 Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
159678 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
@@ -159042,21 +159682,21 @@
159682 }
159683 yylhsminor.yy202 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
159684 }
159685 yymsp[-4].minor.yy202 = yylhsminor.yy202;
159686 break;
159687 case 174: /* term ::= NULL|FLOAT|BLOB */
159688 case 175: /* term ::= STRING */ yytestcase(yyruleno==175);
159689 {yymsp[0].minor.yy202=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
159690 break;
159691 case 176: /* term ::= INTEGER */
159692 {
159693 yylhsminor.yy202 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
159694 }
159695 yymsp[0].minor.yy202 = yylhsminor.yy202;
159696 break;
159697 case 177: /* expr ::= VARIABLE */
159698 {
159699 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
159700 u32 n = yymsp[0].minor.yy0.n;
159701 yymsp[0].minor.yy202 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
159702 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy202, n);
@@ -159074,54 +159714,54 @@
159714 if( yymsp[0].minor.yy202 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy202->iTable);
159715 }
159716 }
159717 }
159718 break;
159719 case 178: /* expr ::= expr COLLATE ID|STRING */
159720 {
159721 yymsp[-2].minor.yy202 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy202, &yymsp[0].minor.yy0, 1);
159722 }
159723 break;
159724 case 179: /* expr ::= CAST LP expr AS typetoken RP */
159725 {
159726 yymsp[-5].minor.yy202 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
159727 sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy202, yymsp[-3].minor.yy202, 0);
159728 }
159729 break;
159730 case 180: /* expr ::= ID|INDEXED LP distinct exprlist RP */
159731 {
159732 yylhsminor.yy202 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy242, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy192);
159733 }
159734 yymsp[-4].minor.yy202 = yylhsminor.yy202;
159735 break;
159736 case 181: /* expr ::= ID|INDEXED LP STAR RP */
159737 {
159738 yylhsminor.yy202 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
159739 }
159740 yymsp[-3].minor.yy202 = yylhsminor.yy202;
159741 break;
159742 case 182: /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
159743 {
159744 yylhsminor.yy202 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy242, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy192);
159745 sqlite3WindowAttach(pParse, yylhsminor.yy202, yymsp[0].minor.yy303);
159746 }
159747 yymsp[-5].minor.yy202 = yylhsminor.yy202;
159748 break;
159749 case 183: /* expr ::= ID|INDEXED LP STAR RP filter_over */
159750 {
159751 yylhsminor.yy202 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
159752 sqlite3WindowAttach(pParse, yylhsminor.yy202, yymsp[0].minor.yy303);
159753 }
159754 yymsp[-4].minor.yy202 = yylhsminor.yy202;
159755 break;
159756 case 184: /* term ::= CTIME_KW */
159757 {
159758 yylhsminor.yy202 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
159759 }
159760 yymsp[0].minor.yy202 = yylhsminor.yy202;
159761 break;
159762 case 185: /* expr ::= LP nexprlist COMMA expr RP */
159763 {
159764 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy242, yymsp[-1].minor.yy202);
159765 yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
159766 if( yymsp[-4].minor.yy202 ){
159767 yymsp[-4].minor.yy202->x.pList = pList;
@@ -159131,26 +159771,26 @@
159771 }else{
159772 sqlite3ExprListDelete(pParse->db, pList);
159773 }
159774 }
159775 break;
159776 case 186: /* expr ::= expr AND expr */
159777 {yymsp[-2].minor.yy202=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy202,yymsp[0].minor.yy202);}
159778 break;
159779 case 187: /* expr ::= expr OR expr */
159780 case 188: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==188);
159781 case 189: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==189);
159782 case 190: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==190);
159783 case 191: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==191);
159784 case 192: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==192);
159785 case 193: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==193);
159786 {yymsp[-2].minor.yy202=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy202,yymsp[0].minor.yy202);}
159787 break;
159788 case 194: /* likeop ::= NOT LIKE_KW|MATCH */
159789 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
159790 break;
159791 case 195: /* expr ::= expr likeop expr */
159792 {
159793 ExprList *pList;
159794 int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
159795 yymsp[-1].minor.yy0.n &= 0x7fffffff;
159796 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy202);
@@ -159158,11 +159798,11 @@
159798 yymsp[-2].minor.yy202 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
159799 if( bNot ) yymsp[-2].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy202, 0);
159800 if( yymsp[-2].minor.yy202 ) yymsp[-2].minor.yy202->flags |= EP_InfixFunc;
159801 }
159802 break;
159803 case 196: /* expr ::= expr likeop expr ESCAPE expr */
159804 {
159805 ExprList *pList;
159806 int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
159807 yymsp[-3].minor.yy0.n &= 0x7fffffff;
159808 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy202);
@@ -159171,43 +159811,43 @@
159811 yymsp[-4].minor.yy202 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
159812 if( bNot ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159813 if( yymsp[-4].minor.yy202 ) yymsp[-4].minor.yy202->flags |= EP_InfixFunc;
159814 }
159815 break;
159816 case 197: /* expr ::= expr ISNULL|NOTNULL */
159817 {yymsp[-1].minor.yy202 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy202,0);}
159818 break;
159819 case 198: /* expr ::= expr NOT NULL */
159820 {yymsp[-2].minor.yy202 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy202,0);}
159821 break;
159822 case 199: /* expr ::= expr IS expr */
159823 {
159824 yymsp[-2].minor.yy202 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy202,yymsp[0].minor.yy202);
159825 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy202, yymsp[-2].minor.yy202, TK_ISNULL);
159826 }
159827 break;
159828 case 200: /* expr ::= expr IS NOT expr */
159829 {
159830 yymsp[-3].minor.yy202 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy202,yymsp[0].minor.yy202);
159831 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy202, yymsp[-3].minor.yy202, TK_NOTNULL);
159832 }
159833 break;
159834 case 201: /* expr ::= NOT expr */
159835 case 202: /* expr ::= BITNOT expr */ yytestcase(yyruleno==202);
159836 {yymsp[-1].minor.yy202 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy202, 0);/*A-overwrites-B*/}
159837 break;
159838 case 203: /* expr ::= PLUS|MINUS expr */
159839 {
159840 yymsp[-1].minor.yy202 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy202, 0);
159841 /*A-overwrites-B*/
159842 }
159843 break;
159844 case 204: /* between_op ::= BETWEEN */
159845 case 207: /* in_op ::= IN */ yytestcase(yyruleno==207);
159846 {yymsp[0].minor.yy192 = 0;}
159847 break;
159848 case 206: /* expr ::= expr between_op expr AND expr */
159849 {
159850 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy202);
159851 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy202);
159852 yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy202, 0);
159853 if( yymsp[-4].minor.yy202 ){
@@ -159216,11 +159856,11 @@
159856 sqlite3ExprListDelete(pParse->db, pList);
159857 }
159858 if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159859 }
159860 break;
159861 case 209: /* expr ::= expr in_op LP exprlist RP */
159862 {
159863 if( yymsp[-1].minor.yy242==0 ){
159864 /* Expressions of the form
159865 **
159866 ** expr1 IN ()
@@ -159248,41 +159888,41 @@
159888 }
159889 if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159890 }
159891 }
159892 break;
159893 case 210: /* expr ::= LP select RP */
159894 {
159895 yymsp[-2].minor.yy202 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
159896 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy202, yymsp[-1].minor.yy539);
159897 }
159898 break;
159899 case 211: /* expr ::= expr in_op LP select RP */
159900 {
159901 yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy202, 0);
159902 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy202, yymsp[-1].minor.yy539);
159903 if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159904 }
159905 break;
159906 case 212: /* expr ::= expr in_op nm dbnm paren_exprlist */
159907 {
159908 SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
159909 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
159910 if( yymsp[0].minor.yy242 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy242);
159911 yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy202, 0);
159912 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy202, pSelect);
159913 if( yymsp[-3].minor.yy192 ) yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy202, 0);
159914 }
159915 break;
159916 case 213: /* expr ::= EXISTS LP select RP */
159917 {
159918 Expr *p;
159919 p = yymsp[-3].minor.yy202 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
159920 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy539);
159921 }
159922 break;
159923 case 214: /* expr ::= CASE case_operand case_exprlist case_else END */
159924 {
159925 yymsp[-4].minor.yy202 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy202, 0);
159926 if( yymsp[-4].minor.yy202 ){
159927 yymsp[-4].minor.yy202->x.pList = yymsp[-1].minor.yy202 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy242,yymsp[-1].minor.yy202) : yymsp[-2].minor.yy242;
159928 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy202);
@@ -159290,394 +159930,394 @@
159930 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy242);
159931 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy202);
159932 }
159933 }
159934 break;
159935 case 215: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
159936 {
159937 yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242, yymsp[-2].minor.yy202);
159938 yymsp[-4].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy242, yymsp[0].minor.yy202);
159939 }
159940 break;
159941 case 216: /* case_exprlist ::= WHEN expr THEN expr */
159942 {
159943 yymsp[-3].minor.yy242 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy202);
159944 yymsp[-3].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy242, yymsp[0].minor.yy202);
159945 }
159946 break;
159947 case 219: /* case_operand ::= expr */
159948 {yymsp[0].minor.yy202 = yymsp[0].minor.yy202; /*A-overwrites-X*/}
159949 break;
159950 case 222: /* nexprlist ::= nexprlist COMMA expr */
159951 {yymsp[-2].minor.yy242 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy242,yymsp[0].minor.yy202);}
159952 break;
159953 case 223: /* nexprlist ::= expr */
159954 {yymsp[0].minor.yy242 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy202); /*A-overwrites-Y*/}
159955 break;
159956 case 225: /* paren_exprlist ::= LP exprlist RP */
159957 case 230: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==230);
159958 {yymsp[-2].minor.yy242 = yymsp[-1].minor.yy242;}
159959 break;
159960 case 226: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
159961 {
159962 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
159963 sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy242, yymsp[-10].minor.yy192,
159964 &yymsp[-11].minor.yy0, yymsp[0].minor.yy202, SQLITE_SO_ASC, yymsp[-8].minor.yy192, SQLITE_IDXTYPE_APPDEF);
159965 if( IN_RENAME_OBJECT && pParse->pNewIndex ){
159966 sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
159967 }
159968 }
159969 break;
159970 case 227: /* uniqueflag ::= UNIQUE */
159971 case 269: /* raisetype ::= ABORT */ yytestcase(yyruleno==269);
159972 {yymsp[0].minor.yy192 = OE_Abort;}
159973 break;
159974 case 228: /* uniqueflag ::= */
159975 {yymsp[1].minor.yy192 = OE_None;}
159976 break;
159977 case 231: /* eidlist ::= eidlist COMMA nm collate sortorder */
159978 {
159979 yymsp[-4].minor.yy242 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy242, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy192, yymsp[0].minor.yy192);
159980 }
159981 break;
159982 case 232: /* eidlist ::= nm collate sortorder */
159983 {
159984 yymsp[-2].minor.yy242 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy192, yymsp[0].minor.yy192); /*A-overwrites-Y*/
159985 }
159986 break;
159987 case 235: /* cmd ::= DROP INDEX ifexists fullname */
159988 {sqlite3DropIndex(pParse, yymsp[0].minor.yy47, yymsp[-1].minor.yy192);}
159989 break;
159990 case 236: /* cmd ::= VACUUM vinto */
159991 {sqlite3Vacuum(pParse,0,yymsp[0].minor.yy202);}
159992 break;
159993 case 237: /* cmd ::= VACUUM nm vinto */
159994 {sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy202);}
159995 break;
159996 case 240: /* cmd ::= PRAGMA nm dbnm */
159997 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
159998 break;
159999 case 241: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
160000 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
160001 break;
160002 case 242: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
160003 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
160004 break;
160005 case 243: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
160006 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
160007 break;
160008 case 244: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
160009 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
160010 break;
160011 case 247: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
160012 {
160013 Token all;
160014 all.z = yymsp[-3].minor.yy0.z;
160015 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
160016 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy447, &all);
160017 }
160018 break;
160019 case 248: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
160020 {
160021 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy192, yymsp[-4].minor.yy230.a, yymsp[-4].minor.yy230.b, yymsp[-2].minor.yy47, yymsp[0].minor.yy202, yymsp[-10].minor.yy192, yymsp[-8].minor.yy192);
160022 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
160023 }
160024 break;
160025 case 249: /* trigger_time ::= BEFORE|AFTER */
160026 { yymsp[0].minor.yy192 = yymsp[0].major; /*A-overwrites-X*/ }
160027 break;
160028 case 250: /* trigger_time ::= INSTEAD OF */
160029 { yymsp[-1].minor.yy192 = TK_INSTEAD;}
160030 break;
160031 case 251: /* trigger_time ::= */
160032 { yymsp[1].minor.yy192 = TK_BEFORE; }
160033 break;
160034 case 252: /* trigger_event ::= DELETE|INSERT */
160035 case 253: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==253);
160036 {yymsp[0].minor.yy230.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy230.b = 0;}
160037 break;
160038 case 254: /* trigger_event ::= UPDATE OF idlist */
160039 {yymsp[-2].minor.yy230.a = TK_UPDATE; yymsp[-2].minor.yy230.b = yymsp[0].minor.yy600;}
160040 break;
160041 case 255: /* when_clause ::= */
160042 case 274: /* key_opt ::= */ yytestcase(yyruleno==274);
160043 { yymsp[1].minor.yy202 = 0; }
160044 break;
160045 case 256: /* when_clause ::= WHEN expr */
160046 case 275: /* key_opt ::= KEY expr */ yytestcase(yyruleno==275);
160047 { yymsp[-1].minor.yy202 = yymsp[0].minor.yy202; }
160048 break;
160049 case 257: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
160050 {
160051 assert( yymsp[-2].minor.yy447!=0 );
160052 yymsp[-2].minor.yy447->pLast->pNext = yymsp[-1].minor.yy447;
160053 yymsp[-2].minor.yy447->pLast = yymsp[-1].minor.yy447;
160054 }
160055 break;
160056 case 258: /* trigger_cmd_list ::= trigger_cmd SEMI */
160057 {
160058 assert( yymsp[-1].minor.yy447!=0 );
160059 yymsp[-1].minor.yy447->pLast = yymsp[-1].minor.yy447;
160060 }
160061 break;
160062 case 259: /* trnm ::= nm DOT nm */
160063 {
160064 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
160065 sqlite3ErrorMsg(pParse,
160066 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
160067 "statements within triggers");
160068 }
160069 break;
160070 case 260: /* tridxby ::= INDEXED BY nm */
160071 {
160072 sqlite3ErrorMsg(pParse,
160073 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
160074 "within triggers");
160075 }
160076 break;
160077 case 261: /* tridxby ::= NOT INDEXED */
160078 {
160079 sqlite3ErrorMsg(pParse,
160080 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
160081 "within triggers");
160082 }
160083 break;
160084 case 262: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
160085 {yylhsminor.yy447 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy47, yymsp[-3].minor.yy242, yymsp[-1].minor.yy202, yymsp[-7].minor.yy192, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy436);}
160086 yymsp[-8].minor.yy447 = yylhsminor.yy447;
160087 break;
160088 case 263: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
160089 {
160090 yylhsminor.yy447 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy600,yymsp[-2].minor.yy539,yymsp[-6].minor.yy192,yymsp[-1].minor.yy318,yymsp[-7].minor.yy436,yymsp[0].minor.yy436);/*yylhsminor.yy447-overwrites-yymsp[-6].minor.yy192*/
160091 }
160092 yymsp[-7].minor.yy447 = yylhsminor.yy447;
160093 break;
160094 case 264: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
160095 {yylhsminor.yy447 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy202, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy436);}
160096 yymsp[-5].minor.yy447 = yylhsminor.yy447;
160097 break;
160098 case 265: /* trigger_cmd ::= scanpt select scanpt */
160099 {yylhsminor.yy447 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy539, yymsp[-2].minor.yy436, yymsp[0].minor.yy436); /*yylhsminor.yy447-overwrites-yymsp[-1].minor.yy539*/}
160100 yymsp[-2].minor.yy447 = yylhsminor.yy447;
160101 break;
160102 case 266: /* expr ::= RAISE LP IGNORE RP */
160103 {
160104 yymsp[-3].minor.yy202 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
160105 if( yymsp[-3].minor.yy202 ){
160106 yymsp[-3].minor.yy202->affExpr = OE_Ignore;
160107 }
160108 }
160109 break;
160110 case 267: /* expr ::= RAISE LP raisetype COMMA nm RP */
160111 {
160112 yymsp[-5].minor.yy202 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
160113 if( yymsp[-5].minor.yy202 ) {
160114 yymsp[-5].minor.yy202->affExpr = (char)yymsp[-3].minor.yy192;
160115 }
160116 }
160117 break;
160118 case 268: /* raisetype ::= ROLLBACK */
160119 {yymsp[0].minor.yy192 = OE_Rollback;}
160120 break;
160121 case 270: /* raisetype ::= FAIL */
160122 {yymsp[0].minor.yy192 = OE_Fail;}
160123 break;
160124 case 271: /* cmd ::= DROP TRIGGER ifexists fullname */
160125 {
160126 sqlite3DropTrigger(pParse,yymsp[0].minor.yy47,yymsp[-1].minor.yy192);
160127 }
160128 break;
160129 case 272: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
160130 {
160131 sqlite3Attach(pParse, yymsp[-3].minor.yy202, yymsp[-1].minor.yy202, yymsp[0].minor.yy202);
160132 }
160133 break;
160134 case 273: /* cmd ::= DETACH database_kw_opt expr */
160135 {
160136 sqlite3Detach(pParse, yymsp[0].minor.yy202);
160137 }
160138 break;
160139 case 276: /* cmd ::= REINDEX */
160140 {sqlite3Reindex(pParse, 0, 0);}
160141 break;
160142 case 277: /* cmd ::= REINDEX nm dbnm */
160143 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
160144 break;
160145 case 278: /* cmd ::= ANALYZE */
160146 {sqlite3Analyze(pParse, 0, 0);}
160147 break;
160148 case 279: /* cmd ::= ANALYZE nm dbnm */
160149 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
160150 break;
160151 case 280: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
160152 {
160153 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy47,&yymsp[0].minor.yy0);
160154 }
160155 break;
160156 case 281: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
160157 {
160158 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
160159 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
160160 }
160161 break;
160162 case 282: /* add_column_fullname ::= fullname */
160163 {
160164 disableLookaside(pParse);
160165 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy47);
160166 }
160167 break;
160168 case 283: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
160169 {
160170 sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy47, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
160171 }
160172 break;
160173 case 284: /* cmd ::= create_vtab */
160174 {sqlite3VtabFinishParse(pParse,0);}
160175 break;
160176 case 285: /* cmd ::= create_vtab LP vtabarglist RP */
160177 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
160178 break;
160179 case 286: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
160180 {
160181 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy192);
160182 }
160183 break;
160184 case 287: /* vtabarg ::= */
160185 {sqlite3VtabArgInit(pParse);}
160186 break;
160187 case 288: /* vtabargtoken ::= ANY */
160188 case 289: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==289);
160189 case 290: /* lp ::= LP */ yytestcase(yyruleno==290);
160190 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
160191 break;
160192 case 291: /* with ::= WITH wqlist */
160193 case 292: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==292);
160194 { sqlite3WithPush(pParse, yymsp[0].minor.yy131, 1); }
160195 break;
160196 case 293: /* wqlist ::= nm eidlist_opt AS LP select RP */
160197 {
160198 yymsp[-5].minor.yy131 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy242, yymsp[-1].minor.yy539); /*A-overwrites-X*/
160199 }
160200 break;
160201 case 294: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
160202 {
160203 yymsp[-7].minor.yy131 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy131, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy242, yymsp[-1].minor.yy539);
160204 }
160205 break;
160206 case 295: /* windowdefn_list ::= windowdefn */
160207 { yylhsminor.yy303 = yymsp[0].minor.yy303; }
160208 yymsp[0].minor.yy303 = yylhsminor.yy303;
160209 break;
160210 case 296: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
160211 {
160212 assert( yymsp[0].minor.yy303!=0 );
160213 sqlite3WindowChain(pParse, yymsp[0].minor.yy303, yymsp[-2].minor.yy303);
160214 yymsp[0].minor.yy303->pNextWin = yymsp[-2].minor.yy303;
160215 yylhsminor.yy303 = yymsp[0].minor.yy303;
160216 }
160217 yymsp[-2].minor.yy303 = yylhsminor.yy303;
160218 break;
160219 case 297: /* windowdefn ::= nm AS LP window RP */
160220 {
160221 if( ALWAYS(yymsp[-1].minor.yy303) ){
160222 yymsp[-1].minor.yy303->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
160223 }
160224 yylhsminor.yy303 = yymsp[-1].minor.yy303;
160225 }
160226 yymsp[-4].minor.yy303 = yylhsminor.yy303;
160227 break;
160228 case 298: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
160229 {
160230 yymsp[-4].minor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, yymsp[-2].minor.yy242, yymsp[-1].minor.yy242, 0);
160231 }
160232 break;
160233 case 299: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
160234 {
160235 yylhsminor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, yymsp[-2].minor.yy242, yymsp[-1].minor.yy242, &yymsp[-5].minor.yy0);
160236 }
160237 yymsp[-5].minor.yy303 = yylhsminor.yy303;
160238 break;
160239 case 300: /* window ::= ORDER BY sortlist frame_opt */
160240 {
160241 yymsp[-3].minor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, 0, yymsp[-1].minor.yy242, 0);
160242 }
160243 break;
160244 case 301: /* window ::= nm ORDER BY sortlist frame_opt */
160245 {
160246 yylhsminor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, 0, yymsp[-1].minor.yy242, &yymsp[-4].minor.yy0);
160247 }
160248 yymsp[-4].minor.yy303 = yylhsminor.yy303;
160249 break;
160250 case 302: /* window ::= frame_opt */
160251 case 321: /* filter_over ::= over_clause */ yytestcase(yyruleno==321);
160252 {
160253 yylhsminor.yy303 = yymsp[0].minor.yy303;
160254 }
160255 yymsp[0].minor.yy303 = yylhsminor.yy303;
160256 break;
160257 case 303: /* window ::= nm frame_opt */
160258 {
160259 yylhsminor.yy303 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy303, 0, 0, &yymsp[-1].minor.yy0);
160260 }
160261 yymsp[-1].minor.yy303 = yylhsminor.yy303;
160262 break;
160263 case 304: /* frame_opt ::= */
160264 {
160265 yymsp[1].minor.yy303 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
160266 }
160267 break;
160268 case 305: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
160269 {
160270 yylhsminor.yy303 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy192, yymsp[-1].minor.yy77.eType, yymsp[-1].minor.yy77.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy58);
160271 }
160272 yymsp[-2].minor.yy303 = yylhsminor.yy303;
160273 break;
160274 case 306: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
160275 {
160276 yylhsminor.yy303 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy192, yymsp[-3].minor.yy77.eType, yymsp[-3].minor.yy77.pExpr, yymsp[-1].minor.yy77.eType, yymsp[-1].minor.yy77.pExpr, yymsp[0].minor.yy58);
160277 }
160278 yymsp[-5].minor.yy303 = yylhsminor.yy303;
160279 break;
160280 case 308: /* frame_bound_s ::= frame_bound */
160281 case 310: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==310);
160282 {yylhsminor.yy77 = yymsp[0].minor.yy77;}
160283 yymsp[0].minor.yy77 = yylhsminor.yy77;
160284 break;
160285 case 309: /* frame_bound_s ::= UNBOUNDED PRECEDING */
160286 case 311: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==311);
160287 case 313: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==313);
160288 {yylhsminor.yy77.eType = yymsp[-1].major; yylhsminor.yy77.pExpr = 0;}
160289 yymsp[-1].minor.yy77 = yylhsminor.yy77;
160290 break;
160291 case 312: /* frame_bound ::= expr PRECEDING|FOLLOWING */
160292 {yylhsminor.yy77.eType = yymsp[0].major; yylhsminor.yy77.pExpr = yymsp[-1].minor.yy202;}
160293 yymsp[-1].minor.yy77 = yylhsminor.yy77;
160294 break;
160295 case 314: /* frame_exclude_opt ::= */
160296 {yymsp[1].minor.yy58 = 0;}
160297 break;
160298 case 315: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
160299 {yymsp[-1].minor.yy58 = yymsp[0].minor.yy58;}
160300 break;
160301 case 316: /* frame_exclude ::= NO OTHERS */
160302 case 317: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==317);
160303 {yymsp[-1].minor.yy58 = yymsp[-1].major; /*A-overwrites-X*/}
160304 break;
160305 case 318: /* frame_exclude ::= GROUP|TIES */
160306 {yymsp[0].minor.yy58 = yymsp[0].major; /*A-overwrites-X*/}
160307 break;
160308 case 319: /* window_clause ::= WINDOW windowdefn_list */
160309 { yymsp[-1].minor.yy303 = yymsp[0].minor.yy303; }
160310 break;
160311 case 320: /* filter_over ::= filter_clause over_clause */
160312 {
160313 yymsp[0].minor.yy303->pFilter = yymsp[-1].minor.yy202;
160314 yylhsminor.yy303 = yymsp[0].minor.yy303;
160315 }
160316 yymsp[-1].minor.yy303 = yylhsminor.yy303;
160317 break;
160318 case 322: /* filter_over ::= filter_clause */
160319 {
160320 yylhsminor.yy303 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
160321 if( yylhsminor.yy303 ){
160322 yylhsminor.yy303->eFrmType = TK_FILTER;
160323 yylhsminor.yy303->pFilter = yymsp[0].minor.yy202;
@@ -159685,88 +160325,88 @@
160325 sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy202);
160326 }
160327 }
160328 yymsp[0].minor.yy303 = yylhsminor.yy303;
160329 break;
160330 case 323: /* over_clause ::= OVER LP window RP */
160331 {
160332 yymsp[-3].minor.yy303 = yymsp[-1].minor.yy303;
160333 assert( yymsp[-3].minor.yy303!=0 );
160334 }
160335 break;
160336 case 324: /* over_clause ::= OVER nm */
160337 {
160338 yymsp[-1].minor.yy303 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
160339 if( yymsp[-1].minor.yy303 ){
160340 yymsp[-1].minor.yy303->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
160341 }
160342 }
160343 break;
160344 case 325: /* filter_clause ::= FILTER LP WHERE expr RP */
160345 { yymsp[-4].minor.yy202 = yymsp[-1].minor.yy202; }
160346 break;
160347 default:
160348 /* (326) input ::= cmdlist */ yytestcase(yyruleno==326);
160349 /* (327) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==327);
160350 /* (328) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=328);
160351 /* (329) ecmd ::= SEMI */ yytestcase(yyruleno==329);
160352 /* (330) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==330);
160353 /* (331) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=331);
160354 /* (332) trans_opt ::= */ yytestcase(yyruleno==332);
160355 /* (333) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==333);
160356 /* (334) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==334);
160357 /* (335) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==335);
160358 /* (336) savepoint_opt ::= */ yytestcase(yyruleno==336);
160359 /* (337) cmd ::= create_table create_table_args */ yytestcase(yyruleno==337);
160360 /* (338) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==338);
160361 /* (339) columnlist ::= columnname carglist */ yytestcase(yyruleno==339);
160362 /* (340) nm ::= ID|INDEXED */ yytestcase(yyruleno==340);
160363 /* (341) nm ::= STRING */ yytestcase(yyruleno==341);
160364 /* (342) nm ::= JOIN_KW */ yytestcase(yyruleno==342);
160365 /* (343) typetoken ::= typename */ yytestcase(yyruleno==343);
160366 /* (344) typename ::= ID|STRING */ yytestcase(yyruleno==344);
160367 /* (345) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=345);
160368 /* (346) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=346);
160369 /* (347) carglist ::= carglist ccons */ yytestcase(yyruleno==347);
160370 /* (348) carglist ::= */ yytestcase(yyruleno==348);
160371 /* (349) ccons ::= NULL onconf */ yytestcase(yyruleno==349);
160372 /* (350) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==350);
160373 /* (351) ccons ::= AS generated */ yytestcase(yyruleno==351);
160374 /* (352) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==352);
160375 /* (353) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==353);
160376 /* (354) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=354);
160377 /* (355) tconscomma ::= */ yytestcase(yyruleno==355);
160378 /* (356) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=356);
160379 /* (357) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=357);
160380 /* (358) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=358);
160381 /* (359) oneselect ::= values */ yytestcase(yyruleno==359);
160382 /* (360) sclp ::= selcollist COMMA */ yytestcase(yyruleno==360);
160383 /* (361) as ::= ID|STRING */ yytestcase(yyruleno==361);
160384 /* (362) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=362);
160385 /* (363) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==363);
160386 /* (364) exprlist ::= nexprlist */ yytestcase(yyruleno==364);
160387 /* (365) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=365);
160388 /* (366) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=366);
160389 /* (367) nmnum ::= ON */ yytestcase(yyruleno==367);
160390 /* (368) nmnum ::= DELETE */ yytestcase(yyruleno==368);
160391 /* (369) nmnum ::= DEFAULT */ yytestcase(yyruleno==369);
160392 /* (370) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==370);
160393 /* (371) foreach_clause ::= */ yytestcase(yyruleno==371);
160394 /* (372) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==372);
160395 /* (373) trnm ::= nm */ yytestcase(yyruleno==373);
160396 /* (374) tridxby ::= */ yytestcase(yyruleno==374);
160397 /* (375) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==375);
160398 /* (376) database_kw_opt ::= */ yytestcase(yyruleno==376);
160399 /* (377) kwcolumn_opt ::= */ yytestcase(yyruleno==377);
160400 /* (378) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==378);
160401 /* (379) vtabarglist ::= vtabarg */ yytestcase(yyruleno==379);
160402 /* (380) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==380);
160403 /* (381) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==381);
160404 /* (382) anylist ::= */ yytestcase(yyruleno==382);
160405 /* (383) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==383);
160406 /* (384) anylist ::= anylist ANY */ yytestcase(yyruleno==384);
160407 /* (385) with ::= */ yytestcase(yyruleno==385);
160408 break;
160409 /********** End reduce actions ************************************************/
160410 };
160411 assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
160412 yygoto = yyRuleInfoLhs[yyruleno];
@@ -160093,12 +160733,12 @@
160733 ** The lookup table is much faster. To maximize speed, and to ensure that
160734 ** a lookup table is used, all of the classes need to be small integers and
160735 ** all of them need to be used within the switch.
160736 */
160737 #define CC_X 0 /* The letter 'x', or start of BLOB literal */
160738 #define CC_KYWD0 1 /* First letter of a keyword */
160739 #define CC_KYWD 2 /* Alphabetics or '_'. Usable in a keyword */
160740 #define CC_DIGIT 3 /* Digits */
160741 #define CC_DOLLAR 4 /* '$' */
160742 #define CC_VARALPHA 5 /* '@', '#', ':'. Alphabetic SQL variables */
160743 #define CC_VARNUM 6 /* '?'. Numeric SQL variables */
160744 #define CC_SPACE 7 /* Space characters */
@@ -160119,24 +160759,25 @@
160759 #define CC_PERCENT 22 /* '%' */
160760 #define CC_COMMA 23 /* ',' */
160761 #define CC_AND 24 /* '&' */
160762 #define CC_TILDA 25 /* '~' */
160763 #define CC_DOT 26 /* '.' */
160764 #define CC_ID 27 /* unicode characters usable in IDs */
160765 #define CC_ILLEGAL 28 /* Illegal character */
160766 #define CC_NUL 29 /* 0x00 */
160767
160768 static const unsigned char aiClass[] = {
160769 #ifdef SQLITE_ASCII
160770 /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
160771 /* 0x */ 29, 28, 28, 28, 28, 28, 28, 28, 28, 7, 7, 28, 7, 7, 28, 28,
160772 /* 1x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
160773 /* 2x */ 7, 15, 8, 5, 4, 22, 24, 8, 17, 18, 21, 20, 23, 11, 26, 16,
160774 /* 3x */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 19, 12, 14, 13, 6,
160775 /* 4x */ 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
160776 /* 5x */ 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 9, 28, 28, 28, 2,
160777 /* 6x */ 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
160778 /* 7x */ 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 28, 10, 28, 25, 28,
160779 /* 8x */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160780 /* 9x */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160781 /* Ax */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160782 /* Bx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160783 /* Cx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -160144,26 +160785,26 @@
160785 /* Ex */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
160786 /* Fx */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
160787 #endif
160788 #ifdef SQLITE_EBCDIC
160789 /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
160790 /* 0x */ 29, 28, 28, 28, 28, 7, 28, 28, 28, 28, 28, 28, 7, 7, 28, 28,
160791 /* 1x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
160792 /* 2x */ 28, 28, 28, 28, 28, 7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
160793 /* 3x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
160794 /* 4x */ 7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 26, 12, 17, 20, 10,
160795 /* 5x */ 24, 28, 28, 28, 28, 28, 28, 28, 28, 28, 15, 4, 21, 18, 19, 28,
160796 /* 6x */ 11, 16, 28, 28, 28, 28, 28, 28, 28, 28, 28, 23, 22, 2, 13, 6,
160797 /* 7x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 8, 5, 5, 5, 8, 14, 8,
160798 /* 8x */ 28, 1, 1, 1, 1, 1, 1, 1, 1, 1, 28, 28, 28, 28, 28, 28,
160799 /* 9x */ 28, 1, 1, 1, 1, 1, 1, 1, 1, 1, 28, 28, 28, 28, 28, 28,
160800 /* Ax */ 28, 25, 1, 1, 1, 1, 1, 0, 2, 2, 28, 28, 28, 28, 28, 28,
160801 /* Bx */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 9, 28, 28, 28, 28, 28,
160802 /* Cx */ 28, 1, 1, 1, 1, 1, 1, 1, 1, 1, 28, 28, 28, 28, 28, 28,
160803 /* Dx */ 28, 1, 1, 1, 1, 1, 1, 1, 1, 1, 28, 28, 28, 28, 28, 28,
160804 /* Ex */ 28, 28, 1, 1, 1, 1, 1, 0, 2, 2, 28, 28, 28, 28, 28, 28,
160805 /* Fx */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 28, 28, 28, 28, 28, 28,
160806 #endif
160807 };
160808
160809 /*
160810 ** The charMap() macro maps alphabetic characters (only) into their
@@ -160504,11 +161145,11 @@
161145 ** return the integer n (the length of the token). */
161146 static int keywordCode(const char *z, int n, int *pType){
161147 int i, j;
161148 const char *zKW;
161149 if( n>=2 ){
161150 i = ((charMap(z[0])*4) ^ (charMap(z[n-1])*3) ^ n*1) % 127;
161151 for(i=((int)aKWHash[i])-1; i>=0; i=((int)aKWNext[i])-1){
161152 if( aKWLen[i]!=n ) continue;
161153 zKW = &zKWText[aKWOffset[i]];
161154 #ifdef SQLITE_ASCII
161155 if( (z[0]&~0x20)!=zKW[0] ) continue;
@@ -161046,11 +161687,11 @@
161687 }
161688 }
161689 if( n==0 ) *tokenType = TK_ILLEGAL;
161690 return i;
161691 }
161692 case CC_KYWD0: {
161693 for(i=1; aiClass[z[i]]<=CC_KYWD; i++){}
161694 if( IdChar(z[i]) ){
161695 /* This token started out using characters that can appear in keywords,
161696 ** but z[i] is a character not allowed within keywords, so this must
161697 ** be an identifier instead */
@@ -161076,10 +161717,11 @@
161717 #endif
161718 /* If it is not a BLOB literal, then it must be an ID, since no
161719 ** SQL keywords start with the letter 'x'. Fall through */
161720 /* no break */ deliberate_fall_through
161721 }
161722 case CC_KYWD:
161723 case CC_ID: {
161724 i = 1;
161725 break;
161726 }
161727 case CC_NUL: {
@@ -166058,11 +166700,30 @@
166700 *pn = sqlite3BtreeSeekCount(db->aDb->pBt);
166701 (void)db; /* Silence harmless unused variable warning */
166702 break;
166703 }
166704
166705 /* sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, op, ptr)
166706 **
166707 ** "ptr" is a pointer to a u32.
166708 **
166709 ** op==0 Store the current sqlite3SelectTrace in *ptr
166710 ** op==1 Set sqlite3SelectTrace to the value *ptr
166711 ** op==3 Store the current sqlite3WhereTrace in *ptr
166712 ** op==3 Set sqlite3WhereTrace to the value *ptr
166713 */
166714 case SQLITE_TESTCTRL_TRACEFLAGS: {
166715 int opTrace = va_arg(ap, int);
166716 u32 *ptr = va_arg(ap, u32*);
166717 switch( opTrace ){
166718 case 0: *ptr = sqlite3SelectTrace; break;
166719 case 1: sqlite3SelectTrace = *ptr; break;
166720 case 2: *ptr = sqlite3WhereTrace; break;
166721 case 3: sqlite3WhereTrace = *ptr; break;
166722 }
166723 break;
166724 }
166725 }
166726 va_end(ap);
166727 #endif /* SQLITE_UNTESTABLE */
166728 return rc;
166729 }
@@ -215282,12 +215943,12 @@
215943 ){
215944 rc = fts5ExprNodeNext(p, pRoot, 1, iFirst);
215945 }
215946
215947 /* If the iterator is not at a real match, skip forward until it is. */
215948 while( pRoot->bNomatch && rc==SQLITE_OK ){
215949 assert( pRoot->bEof==0 );
215950 rc = fts5ExprNodeNext(p, pRoot, 0, 0);
215951 }
215952 return rc;
215953 }
215954
@@ -220467,11 +221128,11 @@
221128 u8 *pChunk = &pSeg->pLeaf->p[pSeg->iLeafOffset];
221129 int nChunk = MIN(nRem, pSeg->pLeaf->szLeaf - pSeg->iLeafOffset);
221130 int pgno = pSeg->iLeafPgno;
221131 int pgnoSave = 0;
221132
221133 /* This function does not work with detail=none databases. */
221134 assert( p->pConfig->eDetail!=FTS5_DETAIL_NONE );
221135
221136 if( (pSeg->flags & FTS5_SEGITER_REVERSE)==0 ){
221137 pgnoSave = pgno+1;
221138 }
@@ -220480,10 +221141,13 @@
221141 xChunk(p, pCtx, pChunk, nChunk);
221142 nRem -= nChunk;
221143 fts5DataRelease(pData);
221144 if( nRem<=0 ){
221145 break;
221146 }else if( pSeg->pSeg==0 ){
221147 p->rc = FTS5_CORRUPT;
221148 return;
221149 }else{
221150 pgno++;
221151 pData = fts5LeafRead(p, FTS5_SEGMENT_ROWID(pSeg->pSeg->iSegid, pgno));
221152 if( pData==0 ) break;
221153 pChunk = &pData->p[4];
@@ -220531,70 +221195,76 @@
221195 }
221196 }
221197 }
221198
221199 /*
221200 ** Parameter pPos points to a buffer containing a position list, size nPos.
221201 ** This function filters it according to pColset (which must be non-NULL)
221202 ** and sets pIter->base.pData/nData to point to the new position list.
221203 ** If memory is required for the new position list, use buffer pIter->poslist.
221204 ** Or, if the new position list is a contiguous subset of the input, set
221205 ** pIter->base.pData/nData to point directly to it.
221206 **
221207 ** This function is a no-op if *pRc is other than SQLITE_OK when it is
221208 ** called. If an OOM error is encountered, *pRc is set to SQLITE_NOMEM
221209 ** before returning.
221210 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221211 static void fts5IndexExtractColset(
221212 int *pRc,
221213 Fts5Colset *pColset, /* Colset to filter on */
221214 const u8 *pPos, int nPos, /* Position list */
221215 Fts5Iter *pIter
221216 ){
221217 if( *pRc==SQLITE_OK ){
221218 const u8 *p = pPos;
221219 const u8 *aCopy = p;
221220 const u8 *pEnd = &p[nPos]; /* One byte past end of position list */
221221 int i = 0;
221222 int iCurrent = 0;
221223
221224 if( pColset->nCol>1 && sqlite3Fts5BufferSize(pRc, &pIter->poslist, nPos) ){
221225 return;
221226 }
221227
221228 while( 1 ){
221229 while( pColset->aiCol[i]<iCurrent ){
221230 i++;
221231 if( i==pColset->nCol ){
221232 pIter->base.pData = pIter->poslist.p;
221233 pIter->base.nData = pIter->poslist.n;
221234 return;
221235 }
221236 }
221237
221238 /* Advance pointer p until it points to pEnd or an 0x01 byte that is
221239 ** not part of a varint */
221240 while( p<pEnd && *p!=0x01 ){
221241 while( *p++ & 0x80 );
221242 }
221243
221244 if( pColset->aiCol[i]==iCurrent ){
221245 if( pColset->nCol==1 ){
221246 pIter->base.pData = aCopy;
221247 pIter->base.nData = p-aCopy;
221248 return;
221249 }
221250 fts5BufferSafeAppendBlob(&pIter->poslist, aCopy, p-aCopy);
221251 }
221252 if( p==pEnd ){
221253 pIter->base.pData = pIter->poslist.p;
221254 pIter->base.nData = pIter->poslist.n;
221255 return;
221256 }
221257 aCopy = p++;
221258 iCurrent = *p++;
221259 if( iCurrent & 0x80 ){
221260 p--;
221261 p += fts5GetVarint32(p, iCurrent);
221262 }
221263 }
221264 }
221265
221266 }
221267
221268 /*
221269 ** xSetOutputs callback used by detail=none tables.
221270 */
@@ -220710,20 +221380,13 @@
221380
221381 if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){
221382 /* All data is stored on the current page. Populate the output
221383 ** variables to point into the body of the page object. */
221384 const u8 *a = &pSeg->pLeaf->p[pSeg->iLeafOffset];
221385 int *pRc = &pIter->pIndex->rc;
221386 fts5BufferZero(&pIter->poslist);
221387 fts5IndexExtractColset(pRc, pColset, a, pSeg->nPos, pIter);
 
 
 
 
 
 
 
221388 }else{
221389 /* The data is distributed over two or more pages. Copy it into the
221390 ** Fts5Iter.poslist buffer and then set the output pointer to point
221391 ** to this buffer. */
221392 fts5BufferZero(&pIter->poslist);
@@ -222202,11 +222865,11 @@
222865
222866
222867 static void fts5DoclistIterNext(Fts5DoclistIter *pIter){
222868 u8 *p = pIter->aPoslist + pIter->nSize + pIter->nPoslist;
222869
222870 assert( pIter->aPoslist || (p==0 && pIter->aPoslist==0) );
222871 if( p>=pIter->aEof ){
222872 pIter->aPoslist = 0;
222873 }else{
222874 i64 iDelta;
222875
@@ -222286,20 +222949,24 @@
222949 ** In this case the buffers consist of a delta-encoded list of rowids only.
222950 */
222951 static void fts5MergeRowidLists(
222952 Fts5Index *p, /* FTS5 backend object */
222953 Fts5Buffer *p1, /* First list to merge */
222954 int nBuf, /* Number of entries in apBuf[] */
222955 Fts5Buffer *aBuf /* Array of other lists to merge into p1 */
222956 ){
222957 int i1 = 0;
222958 int i2 = 0;
222959 i64 iRowid1 = 0;
222960 i64 iRowid2 = 0;
222961 i64 iOut = 0;
222962 Fts5Buffer *p2 = &aBuf[0];
222963 Fts5Buffer out;
222964
222965 (void)nBuf;
222966 memset(&out, 0, sizeof(out));
222967 assert( nBuf==1 );
222968 sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n);
222969 if( p->rc ) return;
222970
222971 fts5NextRowid(p1, &i1, &iRowid1);
222972 fts5NextRowid(p2, &i2, &iRowid2);
@@ -222321,185 +222988,218 @@
222988 }
222989
222990 fts5BufferSwap(&out, p1);
222991 fts5BufferFree(&out);
222992 }
222993
222994 typedef struct PrefixMerger PrefixMerger;
222995 struct PrefixMerger {
222996 Fts5DoclistIter iter; /* Doclist iterator */
222997 i64 iPos; /* For iterating through a position list */
222998 int iOff;
222999 u8 *aPos;
223000 PrefixMerger *pNext; /* Next in docid/poslist order */
223001 };
223002
223003 static void fts5PrefixMergerInsertByRowid(
223004 PrefixMerger **ppHead,
223005 PrefixMerger *p
223006 ){
223007 if( p->iter.aPoslist ){
223008 PrefixMerger **pp = ppHead;
223009 while( *pp && p->iter.iRowid>(*pp)->iter.iRowid ){
223010 pp = &(*pp)->pNext;
223011 }
223012 p->pNext = *pp;
223013 *pp = p;
223014 }
223015 }
223016
223017 static void fts5PrefixMergerInsertByPosition(
223018 PrefixMerger **ppHead,
223019 PrefixMerger *p
223020 ){
223021 if( p->iPos>=0 ){
223022 PrefixMerger **pp = ppHead;
223023 while( *pp && p->iPos>(*pp)->iPos ){
223024 pp = &(*pp)->pNext;
223025 }
223026 p->pNext = *pp;
223027 *pp = p;
223028 }
223029 }
223030
223031
223032 /*
223033 ** Array aBuf[] contains nBuf doclists. These are all merged in with the
223034 ** doclist in buffer p1.
 
 
 
 
223035 */
223036 static void fts5MergePrefixLists(
223037 Fts5Index *p, /* FTS5 backend object */
223038 Fts5Buffer *p1, /* First list to merge */
223039 int nBuf, /* Number of buffers in array aBuf[] */
223040 Fts5Buffer *aBuf /* Other lists to merge in */
223041 ){
223042 #define fts5PrefixMergerNextPosition(p) \
223043 sqlite3Fts5PoslistNext64((p)->aPos,(p)->iter.nPoslist,&(p)->iOff,&(p)->iPos);
223044 #define FTS5_MERGE_NLIST 16
223045 PrefixMerger aMerger[FTS5_MERGE_NLIST];
223046 PrefixMerger *pHead = 0;
223047 int i;
223048 int nOut = 0;
223049 Fts5Buffer out = {0, 0, 0};
223050 Fts5Buffer tmp = {0, 0, 0};
223051 i64 iLastRowid = 0;
223052
223053 /* Initialize a doclist-iterator for each input buffer. Arrange them in
223054 ** a linked-list starting at pHead in ascending order of rowid. Avoid
223055 ** linking any iterators already at EOF into the linked list at all. */
223056 assert( nBuf+1<=sizeof(aMerger)/sizeof(aMerger[0]) );
223057 memset(aMerger, 0, sizeof(PrefixMerger)*(nBuf+1));
223058 pHead = &aMerger[nBuf];
223059 fts5DoclistIterInit(p1, &pHead->iter);
223060 for(i=0; i<nBuf; i++){
223061 fts5DoclistIterInit(&aBuf[i], &aMerger[i].iter);
223062 fts5PrefixMergerInsertByRowid(&pHead, &aMerger[i]);
223063 nOut += aBuf[i].n;
223064 }
223065 if( nOut==0 ) return;
223066 nOut += p1->n + 9 + 10*nBuf;
223067
223068 /* The maximum size of the output is equal to the sum of the
223069 ** input sizes + 1 varint (9 bytes). The extra varint is because if the
223070 ** first rowid in one input is a large negative number, and the first in
223071 ** the other a non-negative number, the delta for the non-negative
223072 ** number will be larger on disk than the literal integer value
223073 ** was.
223074 **
223075 ** Or, if the input position-lists are corrupt, then the output might
223076 ** include up to (nBuf+1) extra 10-byte positions created by interpreting -1
223077 ** (the value PoslistNext64() uses for EOF) as a position and appending
223078 ** it to the output. This can happen at most once for each input
223079 ** position-list, hence (nBuf+1) 10 byte paddings. */
223080 if( sqlite3Fts5BufferSize(&p->rc, &out, nOut) ) return;
223081
223082 while( pHead ){
223083 fts5MergeAppendDocid(&out, iLastRowid, pHead->iter.iRowid);
223084
223085 if( pHead->pNext && iLastRowid==pHead->pNext->iter.iRowid ){
223086 /* Merge data from two or more poslists */
223087 i64 iPrev = 0;
223088 int nTmp = FTS5_DATA_ZERO_PADDING;
223089 int nMerge = 0;
223090 PrefixMerger *pSave = pHead;
223091 PrefixMerger *pThis = 0;
223092 int nTail = 0;
223093
223094 pHead = 0;
223095 while( pSave && pSave->iter.iRowid==iLastRowid ){
223096 PrefixMerger *pNext = pSave->pNext;
223097 pSave->iOff = 0;
223098 pSave->iPos = 0;
223099 pSave->aPos = &pSave->iter.aPoslist[pSave->iter.nSize];
223100 fts5PrefixMergerNextPosition(pSave);
223101 nTmp += pSave->iter.nPoslist + 10;
223102 nMerge++;
223103 fts5PrefixMergerInsertByPosition(&pHead, pSave);
223104 pSave = pNext;
223105 }
223106
223107 if( pHead==0 || pHead->pNext==0 ){
223108 p->rc = FTS5_CORRUPT;
223109 break;
223110 }
223111
223112 /* See the earlier comment in this function for an explanation of why
223113 ** corrupt input position lists might cause the output to consume
223114 ** at most nMerge*10 bytes of unexpected space. */
223115 if( sqlite3Fts5BufferSize(&p->rc, &tmp, nTmp+nMerge*10) ){
223116 break;
223117 }
223118 fts5BufferZero(&tmp);
223119
223120 pThis = pHead;
223121 pHead = pThis->pNext;
223122 sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, pThis->iPos);
223123 fts5PrefixMergerNextPosition(pThis);
223124 fts5PrefixMergerInsertByPosition(&pHead, pThis);
223125
223126 while( pHead->pNext ){
223127 pThis = pHead;
223128 if( pThis->iPos!=iPrev ){
223129 sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, pThis->iPos);
223130 }
223131 fts5PrefixMergerNextPosition(pThis);
223132 pHead = pThis->pNext;
223133 fts5PrefixMergerInsertByPosition(&pHead, pThis);
223134 }
223135
223136 if( pHead->iPos!=iPrev ){
223137 sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, pHead->iPos);
223138 }
223139 nTail = pHead->iter.nPoslist - pHead->iOff;
223140
223141 /* WRITEPOSLISTSIZE */
223142 assert( tmp.n+nTail<=nTmp );
223143 if( tmp.n+nTail>nTmp-FTS5_DATA_ZERO_PADDING ){
223144 if( p->rc==SQLITE_OK ) p->rc = FTS5_CORRUPT;
223145 break;
223146 }
223147 fts5BufferSafeAppendVarint(&out, (tmp.n+nTail) * 2);
223148 fts5BufferSafeAppendBlob(&out, tmp.p, tmp.n);
223149 if( nTail>0 ){
223150 fts5BufferSafeAppendBlob(&out, &pHead->aPos[pHead->iOff], nTail);
223151 }
223152
223153 pHead = pSave;
223154 for(i=0; i<nBuf+1; i++){
223155 PrefixMerger *pX = &aMerger[i];
223156 if( pX->iter.aPoslist && pX->iter.iRowid==iLastRowid ){
223157 fts5DoclistIterNext(&pX->iter);
223158 fts5PrefixMergerInsertByRowid(&pHead, pX);
223159 }
223160 }
223161
223162 }else{
223163 /* Copy poslist from pHead to output */
223164 PrefixMerger *pThis = pHead;
223165 Fts5DoclistIter *pI = &pThis->iter;
223166 fts5BufferSafeAppendBlob(&out, pI->aPoslist, pI->nPoslist+pI->nSize);
223167 fts5DoclistIterNext(pI);
223168 pHead = pThis->pNext;
223169 fts5PrefixMergerInsertByRowid(&pHead, pThis);
223170 }
223171 }
223172
223173 fts5BufferFree(p1);
223174 fts5BufferFree(&tmp);
223175 memset(&out.p[out.n], 0, FTS5_DATA_ZERO_PADDING);
223176 *p1 = out;
 
 
 
 
 
223177 }
223178
223179 static void fts5SetupPrefixIter(
223180 Fts5Index *p, /* Index to read from */
223181 int bDesc, /* True for "ORDER BY rowid DESC" */
223182 int iIdx, /* Index to scan for data */
223183 u8 *pToken, /* Buffer containing prefix to match */
223184 int nToken, /* Size of buffer pToken in bytes */
223185 Fts5Colset *pColset, /* Restrict matches to these columns */
223186 Fts5Iter **ppIter /* OUT: New iterator */
223187 ){
223188 Fts5Structure *pStruct;
223189 Fts5Buffer *aBuf;
223190 int nBuf = 32;
223191 int nMerge = 1;
223192
223193 void (*xMerge)(Fts5Index*, Fts5Buffer*, int, Fts5Buffer*);
223194 void (*xAppend)(Fts5Index*, i64, Fts5Iter*, Fts5Buffer*);
223195 if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){
223196 xMerge = fts5MergeRowidLists;
223197 xAppend = fts5AppendRowid;
223198 }else{
223199 nMerge = FTS5_MERGE_NLIST-1;
223200 nBuf = nMerge*8; /* Sufficient to merge (16^8)==(2^32) lists */
223201 xMerge = fts5MergePrefixLists;
223202 xAppend = fts5AppendPoslist;
223203 }
223204
223205 aBuf = (Fts5Buffer*)fts5IdxMalloc(p, sizeof(Fts5Buffer)*nBuf);
@@ -222515,10 +223215,31 @@
223215 Fts5Data *pData;
223216 Fts5Buffer doclist;
223217 int bNewTerm = 1;
223218
223219 memset(&doclist, 0, sizeof(doclist));
223220 if( iIdx!=0 ){
223221 int dummy = 0;
223222 const int f2 = FTS5INDEX_QUERY_SKIPEMPTY|FTS5INDEX_QUERY_NOOUTPUT;
223223 pToken[0] = FTS5_MAIN_PREFIX;
223224 fts5MultiIterNew(p, pStruct, f2, pColset, pToken, nToken, -1, 0, &p1);
223225 fts5IterSetOutputCb(&p->rc, p1);
223226 for(;
223227 fts5MultiIterEof(p, p1)==0;
223228 fts5MultiIterNext2(p, p1, &dummy)
223229 ){
223230 Fts5SegIter *pSeg = &p1->aSeg[ p1->aFirst[1].iFirst ];
223231 p1->xSetOutputs(p1, pSeg);
223232 if( p1->base.nData ){
223233 xAppend(p, p1->base.iRowid-iLastRowid, p1, &doclist);
223234 iLastRowid = p1->base.iRowid;
223235 }
223236 }
223237 fts5MultiIterFree(p1);
223238 }
223239
223240 pToken[0] = FTS5_MAIN_PREFIX + iIdx;
223241 fts5MultiIterNew(p, pStruct, flags, pColset, pToken, nToken, -1, 0, &p1);
223242 fts5IterSetOutputCb(&p->rc, p1);
223243 for( /* no-op */ ;
223244 fts5MultiIterEof(p, p1)==0;
223245 fts5MultiIterNext2(p, p1, &bNewTerm)
@@ -222535,31 +223256,43 @@
223256
223257 if( p1->base.nData==0 ) continue;
223258
223259 if( p1->base.iRowid<=iLastRowid && doclist.n>0 ){
223260 for(i=0; p->rc==SQLITE_OK && doclist.n; i++){
223261 int i1 = i*nMerge;
223262 int iStore;
223263 assert( i1+nMerge<=nBuf );
223264 for(iStore=i1; iStore<i1+nMerge; iStore++){
223265 if( aBuf[iStore].n==0 ){
223266 fts5BufferSwap(&doclist, &aBuf[iStore]);
223267 fts5BufferZero(&doclist);
223268 break;
223269 }
223270 }
223271 if( iStore==i1+nMerge ){
223272 xMerge(p, &doclist, nMerge, &aBuf[i1]);
223273 for(iStore=i1; iStore<i1+nMerge; iStore++){
223274 fts5BufferZero(&aBuf[iStore]);
223275 }
223276 }
223277 }
223278 iLastRowid = 0;
223279 }
223280
223281 xAppend(p, p1->base.iRowid-iLastRowid, p1, &doclist);
223282 iLastRowid = p1->base.iRowid;
223283 }
223284
223285 assert( (nBuf%nMerge)==0 );
223286 for(i=0; i<nBuf; i+=nMerge){
223287 int iFree;
223288 if( p->rc==SQLITE_OK ){
223289 xMerge(p, &doclist, nMerge, &aBuf[i]);
223290 }
223291 for(iFree=i; iFree<i+nMerge; iFree++){
223292 fts5BufferFree(&aBuf[iFree]);
223293 }
223294 }
223295 fts5MultiIterFree(p1);
223296
223297 pData = fts5IdxMalloc(p, sizeof(Fts5Data)+doclist.n+FTS5_DATA_ZERO_PADDING);
223298 if( pData ){
@@ -222810,10 +223543,11 @@
223543 /* If the QUERY_SCAN flag is set, all other flags must be clear. */
223544 assert( (flags & FTS5INDEX_QUERY_SCAN)==0 || flags==FTS5INDEX_QUERY_SCAN );
223545
223546 if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){
223547 int iIdx = 0; /* Index to search */
223548 int iPrefixIdx = 0; /* +1 prefix index */
223549 if( nToken ) memcpy(&buf.p[1], pToken, nToken);
223550
223551 /* Figure out which index to search and set iIdx accordingly. If this
223552 ** is a prefix query for which there is no prefix index, set iIdx to
223553 ** greater than pConfig->nPrefix to indicate that the query will be
@@ -222831,11 +223565,13 @@
223565 }else
223566 #endif
223567 if( flags & FTS5INDEX_QUERY_PREFIX ){
223568 int nChar = fts5IndexCharlen(pToken, nToken);
223569 for(iIdx=1; iIdx<=pConfig->nPrefix; iIdx++){
223570 int nIdxChar = pConfig->aPrefix[iIdx-1];
223571 if( nIdxChar==nChar ) break;
223572 if( nIdxChar==nChar+1 ) iPrefixIdx = iIdx;
223573 }
223574 }
223575
223576 if( iIdx<=pConfig->nPrefix ){
223577 /* Straight index lookup */
@@ -222848,12 +223584,11 @@
223584 fts5StructureRelease(pStruct);
223585 }
223586 }else{
223587 /* Scan multiple terms in the main index */
223588 int bDesc = (flags & FTS5INDEX_QUERY_DESC)!=0;
223589 fts5SetupPrefixIter(p, bDesc, iPrefixIdx, buf.p, nToken+1, pColset,&pRet);
 
223590 assert( p->rc!=SQLITE_OK || pRet->pColset==0 );
223591 fts5IterSetOutputCb(&p->rc, pRet);
223592 if( p->rc==SQLITE_OK ){
223593 Fts5SegIter *pSeg = &pRet->aSeg[pRet->aFirst[1].iFirst];
223594 if( pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg);
@@ -226817,11 +227552,11 @@
227552 int nArg, /* Number of args */
227553 sqlite3_value **apUnused /* Function arguments */
227554 ){
227555 assert( nArg==0 );
227556 UNUSED_PARAM2(nArg, apUnused);
227557 sqlite3_result_text(pCtx, "fts5: 2020-12-15 13:55:38 ea0a7f103a6f6a9e57d7377140ff9f372bf2b156f86f148291fb05a7030f2b36", -1, SQLITE_TRANSIENT);
227558 }
227559
227560 /*
227561 ** Return true if zName is the extension on one of the shadow tables used
227562 ** by this module.
@@ -231743,12 +232478,12 @@
232478 }
232479 #endif /* SQLITE_CORE */
232480 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
232481
232482 /************** End of stmt.c ************************************************/
232483 #if __LINE__!=232483
232484 #undef SQLITE_SOURCE_ID
232485 #define SQLITE_SOURCE_ID "2020-12-15 13:55:38 ea0a7f103a6f6a9e57d7377140ff9f372bf2b156f86f148291fb05a7030falt2"
232486 #endif
232487 /* Return the source-id for this library */
232488 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
232489 /************************** End of sqlite3.c ******************************/
232490
+5 -4
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121121
**
122122
** See also: [sqlite3_libversion()],
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126
-#define SQLITE_VERSION "3.34.0"
127
-#define SQLITE_VERSION_NUMBER 3034000
128
-#define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b"
126
+#define SQLITE_VERSION "3.35.0"
127
+#define SQLITE_VERSION_NUMBER 3035000
128
+#define SQLITE_SOURCE_ID "2020-12-15 13:55:38 ea0a7f103a6f6a9e57d7377140ff9f372bf2b156f86f148291fb05a7030f2b36"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
@@ -7763,11 +7763,12 @@
77637763
#define SQLITE_TESTCTRL_PARSER_COVERAGE 26
77647764
#define SQLITE_TESTCTRL_RESULT_INTREAL 27
77657765
#define SQLITE_TESTCTRL_PRNG_SEED 28
77667766
#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
77677767
#define SQLITE_TESTCTRL_SEEK_COUNT 30
7768
-#define SQLITE_TESTCTRL_LAST 30 /* Largest TESTCTRL */
7768
+#define SQLITE_TESTCTRL_TRACEFLAGS 31
7769
+#define SQLITE_TESTCTRL_LAST 31 /* Largest TESTCTRL */
77697770
77707771
/*
77717772
** CAPI3REF: SQL Keyword Checking
77727773
**
77737774
** These routines provide access to the set of SQL language keywords
77747775
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121 **
122 ** See also: [sqlite3_libversion()],
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.34.0"
127 #define SQLITE_VERSION_NUMBER 3034000
128 #define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -7763,11 +7763,12 @@
7763 #define SQLITE_TESTCTRL_PARSER_COVERAGE 26
7764 #define SQLITE_TESTCTRL_RESULT_INTREAL 27
7765 #define SQLITE_TESTCTRL_PRNG_SEED 28
7766 #define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
7767 #define SQLITE_TESTCTRL_SEEK_COUNT 30
7768 #define SQLITE_TESTCTRL_LAST 30 /* Largest TESTCTRL */
 
7769
7770 /*
7771 ** CAPI3REF: SQL Keyword Checking
7772 **
7773 ** These routines provide access to the set of SQL language keywords
7774
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121 **
122 ** See also: [sqlite3_libversion()],
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.35.0"
127 #define SQLITE_VERSION_NUMBER 3035000
128 #define SQLITE_SOURCE_ID "2020-12-15 13:55:38 ea0a7f103a6f6a9e57d7377140ff9f372bf2b156f86f148291fb05a7030f2b36"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -7763,11 +7763,12 @@
7763 #define SQLITE_TESTCTRL_PARSER_COVERAGE 26
7764 #define SQLITE_TESTCTRL_RESULT_INTREAL 27
7765 #define SQLITE_TESTCTRL_PRNG_SEED 28
7766 #define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
7767 #define SQLITE_TESTCTRL_SEEK_COUNT 30
7768 #define SQLITE_TESTCTRL_TRACEFLAGS 31
7769 #define SQLITE_TESTCTRL_LAST 31 /* Largest TESTCTRL */
7770
7771 /*
7772 ** CAPI3REF: SQL Keyword Checking
7773 **
7774 ** These routines provide access to the set of SQL language keywords
7775

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button