Fossil SCM

Update the built-in SQLite to the latest 3.43.0 alpha code in order to fix compiler warnings on old PPC macs.

drh 2023-06-19 13:10 trunk
Commit aaf6abf6cab4f00115385e1f73115996be65b5d8e368af3aad963641c4114c17
+33 -27
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -244,10 +244,11 @@
244244
245245
#if defined(_WIN32) || defined(WIN32)
246246
#if SQLITE_OS_WINRT
247247
#include <intrin.h>
248248
#endif
249
+#undef WIN32_LEAN_AND_MEAN
249250
#define WIN32_LEAN_AND_MEAN
250251
#include <windows.h>
251252
252253
/* string conversion routines only needed on Win32 */
253254
extern char *sqlite3_win32_unicode_to_utf8(LPCWSTR);
@@ -1471,11 +1472,11 @@
14711472
#ifndef is_filtered
14721473
# define is_filtered(a) ((((a).attrib)&_A_HIDDEN) || (((a).attrib)&_A_SYSTEM))
14731474
#endif
14741475
14751476
/*
1476
-** Provide the function prototype for the POSIX compatiable getenv()
1477
+** Provide the function prototype for the POSIX compatible getenv()
14771478
** function. This function is not thread-safe.
14781479
*/
14791480
14801481
extern const char *windirent_getenv(const char *name);
14811482
@@ -4640,18 +4641,22 @@
46404641
}
46414642
sqlite3_result_int64(ctx, x);
46424643
return SQLITE_OK;
46434644
}
46444645
4646
+#ifndef LARGEST_UINT64
4647
+#define LARGEST_UINT64 (0xffffffff|(((sqlite3_uint64)0xffffffff)<<32))
4648
+#endif
4649
+
46454650
/*
46464651
** Return the rowid for the current row, logically equivalent to n+1 where
46474652
** "n" is the ascending integer in the aforesaid production definition.
46484653
*/
46494654
static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
46504655
series_cursor *pCur = (series_cursor*)cur;
46514656
sqlite3_uint64 n = pCur->ss.uSeqIndexNow;
4652
- *pRowid = (sqlite3_int64)((n<0xffffffffffffffff)? n+1 : 0);
4657
+ *pRowid = (sqlite3_int64)((n<LARGEST_UINT64)? n+1 : 0);
46534658
return SQLITE_OK;
46544659
}
46554660
46564661
/*
46574662
** Return TRUE if the cursor has been moved off of the last
@@ -12913,17 +12918,16 @@
1291312918
** It contains one entry for each b-tree pointer between a parent and
1291412919
** child page in the database.
1291512920
*/
1291612921
1291712922
#if !defined(SQLITEINT_H)
12918
-/* #include "sqlite3ext.h" */
12923
+/* #include "sqlite3.h" */
1291912924
1292012925
/* typedef unsigned char u8; */
1292112926
/* typedef unsigned int u32; */
1292212927
1292312928
#endif
12924
-SQLITE_EXTENSION_INIT1
1292512929
#include <string.h>
1292612930
#include <assert.h>
1292712931
1292812932
#ifndef SQLITE_OMIT_VIRTUALTABLE
1292912933
@@ -13504,12 +13508,18 @@
1350413508
if( pCsr->iField>0 ){
1350513509
sqlite3_int64 iType;
1350613510
if( pCsr->pHdrPtr>&pCsr->pRec[pCsr->nRec] ){
1350713511
bNextPage = 1;
1350813512
}else{
13513
+ int szField = 0;
1350913514
pCsr->pHdrPtr += dbdataGetVarintU32(pCsr->pHdrPtr, &iType);
13510
- pCsr->pPtr += dbdataValueBytes(iType);
13515
+ szField = dbdataValueBytes(iType);
13516
+ if( (pCsr->nRec - (pCsr->pPtr - pCsr->pRec))<szField ){
13517
+ pCsr->pPtr = &pCsr->pRec[pCsr->nRec];
13518
+ }else{
13519
+ pCsr->pPtr += szField;
13520
+ }
1351113521
}
1351213522
}
1351313523
}
1351413524
1351513525
if( bNextPage ){
@@ -13778,19 +13788,15 @@
1377813788
rc = sqlite3_create_module(db, "sqlite_dbptr", &dbdata_module, (void*)1);
1377913789
}
1378013790
return rc;
1378113791
}
1378213792
13783
-#ifdef _WIN32
13784
-
13785
-#endif
1378613793
int sqlite3_dbdata_init(
1378713794
sqlite3 *db,
1378813795
char **pzErrMsg,
1378913796
const sqlite3_api_routines *pApi
1379013797
){
13791
- SQLITE_EXTENSION_INIT2(pApi);
1379213798
(void)pzErrMsg;
1379313799
return sqlite3DbdataRegister(db);
1379413800
}
1379513801
1379613802
#endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
@@ -15900,11 +15906,11 @@
1590015906
int iNext = 0;
1590115907
int nByte = 0;
1590215908
if( iFree>(n-4) ) return 0;
1590315909
iNext = recoverGetU16(&a[iFree]);
1590415910
nByte = recoverGetU16(&a[iFree+2]);
15905
- if( iFree+nByte>n ) return 0;
15911
+ if( iFree+nByte>n || nByte<4 ) return 0;
1590615912
if( iNext && iNext<iFree+nByte ) return 0;
1590715913
memset(&aUsed[iFree], 0xFF, nByte);
1590815914
iFree = iNext;
1590915915
}
1591015916
@@ -16726,11 +16732,11 @@
1672616732
*/
1672716733
typedef struct ShellState ShellState;
1672816734
struct ShellState {
1672916735
sqlite3 *db; /* The database */
1673016736
u8 autoExplain; /* Automatically turn on .explain mode */
16731
- u8 autoEQP; /* Run EXPLAIN QUERY PLAN prior to seach SQL stmt */
16737
+ u8 autoEQP; /* Run EXPLAIN QUERY PLAN prior to each SQL stmt */
1673216738
u8 autoEQPtest; /* autoEQP is in test mode */
1673316739
u8 autoEQPtrace; /* autoEQP is in trace mode */
1673416740
u8 scanstatsOn; /* True to display scan stats before each finalize */
1673516741
u8 openMode; /* SHELL_OPEN_NORMAL, _APPENDVFS, or _ZIPFILE */
1673616742
u8 doXdgOpen; /* Invoke start/open/xdg-open in output_reset() */
@@ -16738,11 +16744,11 @@
1673816744
u8 eTraceType; /* SHELL_TRACE_* value for type of trace */
1673916745
u8 bSafeMode; /* True to prohibit unsafe operations */
1674016746
u8 bSafeModePersist; /* The long-term value of bSafeMode */
1674116747
ColModeOpts cmOpts; /* Option values affecting columnar mode output */
1674216748
unsigned statsOn; /* True to display memory stats before each finalize */
16743
- unsigned mEqpLines; /* Mask of veritical lines in the EQP output graph */
16749
+ unsigned mEqpLines; /* Mask of vertical lines in the EQP output graph */
1674416750
int inputNesting; /* Track nesting level of .read and other redirects */
1674516751
int outCount; /* Revert to stdout when reaching zero */
1674616752
int cnt; /* Number of records displayed so far */
1674716753
int lineno; /* Line number of last line read from in */
1674816754
int openFlags; /* Additional flags to open. (SQLITE_OPEN_NOFOLLOW) */
@@ -16789,11 +16795,11 @@
1678916795
} aAuxDb[5], /* Array of all database connections */
1679016796
*pAuxDb; /* Currently active database connection */
1679116797
int *aiIndent; /* Array of indents used in MODE_Explain */
1679216798
int nIndent; /* Size of array aiIndent[] */
1679316799
int iIndent; /* Index of current op in aiIndent[] */
16794
- char *zNonce; /* Nonce for temporary safe-mode excapes */
16800
+ char *zNonce; /* Nonce for temporary safe-mode escapes */
1679516801
EQPGraph sGraph; /* Information for the graphical EXPLAIN QUERY PLAN */
1679616802
ExpertInfo expert; /* Valid if previous command was ".expert OPT..." */
1679716803
#ifdef SQLITE_SHELL_FIDDLE
1679816804
struct {
1679916805
const char * zInput; /* Input string from wasm/JS proxy */
@@ -16831,11 +16837,11 @@
1683116837
#define SHELL_TRACE_EXPANDED 1 /* Show expanded SQL text */
1683216838
#define SHELL_TRACE_NORMALIZED 2 /* Show normalized SQL text */
1683316839
1683416840
/* Bits in the ShellState.flgProgress variable */
1683516841
#define SHELL_PROGRESS_QUIET 0x01 /* Omit announcing every progress callback */
16836
-#define SHELL_PROGRESS_RESET 0x02 /* Reset the count when the progres
16842
+#define SHELL_PROGRESS_RESET 0x02 /* Reset the count when the progress
1683716843
** callback limit is reached, and for each
1683816844
** top-level SQL statement */
1683916845
#define SHELL_PROGRESS_ONCE 0x04 /* Cancel the --limit after firing once */
1684016846
1684116847
/*
@@ -18345,11 +18351,11 @@
1834518351
/*
1834618352
** Allocate space and save off string indicating current error.
1834718353
*/
1834818354
static char *save_err_msg(
1834918355
sqlite3 *db, /* Database to query */
18350
- const char *zPhase, /* When the error occcurs */
18356
+ const char *zPhase, /* When the error occurs */
1835118357
int rc, /* Error code returned from API */
1835218358
const char *zSql /* SQL string, or NULL */
1835318359
){
1835418360
char *zErr;
1835518361
char *zContext;
@@ -18768,11 +18774,11 @@
1876818774
int p2op = (p2 + (iOp-iAddr));
1876918775
1877018776
/* Grow the p->aiIndent array as required */
1877118777
if( iOp>=nAlloc ){
1877218778
if( iOp==0 ){
18773
- /* Do further verfication that this is explain output. Abort if
18779
+ /* Do further verification that this is explain output. Abort if
1877418780
** it is not */
1877518781
static const char *explainCols[] = {
1877618782
"addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment" };
1877718783
int jj;
1877818784
for(jj=0; jj<ArraySize(explainCols); jj++){
@@ -19111,11 +19117,11 @@
1911119117
** first, in order to determine column widths, before providing
1911219118
** any output.
1911319119
*/
1911419120
static void exec_prepared_stmt_columnar(
1911519121
ShellState *p, /* Pointer to ShellState */
19116
- sqlite3_stmt *pStmt /* Statment to run */
19122
+ sqlite3_stmt *pStmt /* Statement to run */
1911719123
){
1911819124
sqlite3_int64 nRow = 0;
1911919125
int nColumn = 0;
1912019126
char **azData = 0;
1912119127
sqlite3_int64 nAlloc = 0;
@@ -19337,11 +19343,11 @@
1933719343
/*
1933819344
** Run a prepared statement
1933919345
*/
1934019346
static void exec_prepared_stmt(
1934119347
ShellState *pArg, /* Pointer to ShellState */
19342
- sqlite3_stmt *pStmt /* Statment to run */
19348
+ sqlite3_stmt *pStmt /* Statement to run */
1934319349
){
1934419350
int rc;
1934519351
sqlite3_uint64 nRow = 0;
1934619352
1934719353
if( pArg->cMode==MODE_Column
@@ -19596,11 +19602,11 @@
1959619602
}
1959719603
zStmtSql = sqlite3_sql(pStmt);
1959819604
if( zStmtSql==0 ) zStmtSql = "";
1959919605
while( IsSpace(zStmtSql[0]) ) zStmtSql++;
1960019606
19601
- /* save off the prepared statment handle and reset row count */
19607
+ /* save off the prepared statement handle and reset row count */
1960219608
if( pArg ){
1960319609
pArg->pStmt = pStmt;
1960419610
pArg->cnt = 0;
1960519611
}
1960619612
@@ -19644,11 +19650,11 @@
1964419650
sqlite3_finalize(pExplain);
1964519651
sqlite3_free(zEQP);
1964619652
}
1964719653
if( pArg->autoEQP>=AUTOEQP_trigger && triggerEQP==0 ){
1964819654
sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 0, 0);
19649
- /* Reprepare pStmt before reactiving trace modes */
19655
+ /* Reprepare pStmt before reactivating trace modes */
1965019656
sqlite3_finalize(pStmt);
1965119657
sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
1965219658
if( pArg ) pArg->pStmt = pStmt;
1965319659
}
1965419660
restore_debug_trace_modes();
@@ -19781,11 +19787,11 @@
1978119787
** rowids on tables where the rowid is inaccessible because there are other
1978219788
** columns in the table named "rowid", "_rowid_", and "oid".
1978319789
*/
1978419790
if( preserveRowid && isIPK ){
1978519791
/* If a single PRIMARY KEY column with type INTEGER was seen, then it
19786
- ** might be an alise for the ROWID. But it might also be a WITHOUT ROWID
19792
+ ** might be an alias for the ROWID. But it might also be a WITHOUT ROWID
1978719793
** table or a INTEGER PRIMARY KEY DESC column, neither of which are
1978819794
** ROWID aliases. To distinguish these cases, check to see if
1978919795
** there is a "pk" entry in "PRAGMA index_list". There will be
1979019796
** no "pk" index if the PRIMARY KEY really is an alias for the ROWID.
1979119797
*/
@@ -20758,11 +20764,11 @@
2075820764
#define SHELL_SUB_MACRO(base, variant) base ## _ ## variant
2075920765
#define SHELL_SUBMACRO(base, variant) SHELL_SUB_MACRO(base, variant)
2076020766
/* Let custom-included extensions get their ..._init() called.
2076120767
* The WHATEVER_INIT( db, pzErrorMsg, pApi ) macro should cause
2076220768
* the extension's sqlite3_*_init( db, pzErrorMsg, pApi )
20763
- * inititialization routine to be called.
20769
+ * initialization routine to be called.
2076420770
*/
2076520771
{
2076620772
int irc = SHELL_SUBMACRO(SQLITE_SHELL_EXTFUNCS, INIT)(p->db);
2076720773
/* Let custom-included extensions expose their functionality.
2076820774
* The WHATEVER_EXPOSE( db, pzErrorMsg ) macro should cause
@@ -20835,11 +20841,11 @@
2083520841
);
2083620842
}
2083720843
}
2083820844
2083920845
/*
20840
-** Attempt to close the databaes connection. Report errors.
20846
+** Attempt to close the database connection. Report errors.
2084120847
*/
2084220848
void close_db(sqlite3 *db){
2084320849
int rc = sqlite3_close(db);
2084420850
if( rc ){
2084520851
utf8_printf(stderr, "Error: sqlite3_close() returns %d: %s\n",
@@ -21329,11 +21335,11 @@
2132921335
memcpy(zInsert+i, ");", 3);
2133021336
rc = sqlite3_prepare_v2(newDb, zInsert, -1, &pInsert, 0);
2133121337
if( rc ){
2133221338
utf8_printf(stderr, "Error %d: %s on [%s]\n",
2133321339
sqlite3_extended_errcode(newDb), sqlite3_errmsg(newDb),
21334
- zQuery);
21340
+ zInsert);
2133521341
goto end_data_xfer;
2133621342
}
2133721343
for(k=0; k<2; k++){
2133821344
while( (rc = sqlite3_step(pQuery))==SQLITE_ROW ){
2133921345
for(i=0; i<n; i++){
@@ -27407,11 +27413,11 @@
2740727413
z = argv[i];
2740827414
if( z[0]!='-' || i>nOptsEnd ){
2740927415
if( data.aAuxDb->zDbFilename==0 ){
2741027416
data.aAuxDb->zDbFilename = z;
2741127417
}else{
27412
- /* Excesss arguments are interpreted as SQL (or dot-commands) and
27418
+ /* Excess arguments are interpreted as SQL (or dot-commands) and
2741327419
** mean that nothing is read from stdin */
2741427420
readStdin = 0;
2741527421
nCmd++;
2741627422
azCmd = realloc(azCmd, sizeof(azCmd[0])*nCmd);
2741727423
shell_check_oom(azCmd);
@@ -27492,11 +27498,11 @@
2749227498
);
2749327499
vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1);
2749427500
#endif
2749527501
#ifdef SQLITE_ENABLE_MULTIPLEX
2749627502
}else if( cli_strcmp(z,"-multiplex")==0 ){
27497
- extern int sqlite3_multiple_initialize(const char*,int);
27503
+ extern int sqlite3_multiplex_initialize(const char*,int);
2749827504
sqlite3_multiplex_initialize(0, 1);
2749927505
#endif
2750027506
}else if( cli_strcmp(z,"-mmap")==0 ){
2750127507
sqlite3_int64 sz = integerValue(cmdline_option_value(argc,argv,++i));
2750227508
verify_uninitialized();
@@ -27535,11 +27541,11 @@
2753527541
sqlite3MemTraceActivate(stderr);
2753627542
}else if( cli_strcmp(z,"-bail")==0 ){
2753727543
bail_on_error = 1;
2753827544
}else if( cli_strcmp(z,"-nonce")==0 ){
2753927545
free(data.zNonce);
27540
- data.zNonce = strdup(argv[++i]);
27546
+ data.zNonce = strdup(cmdline_option_value(argc, argv, ++i));
2754127547
}else if( cli_strcmp(z,"-unsafe-testing")==0 ){
2754227548
ShellSetFlag(&data,SHFLG_TestingMode);
2754327549
}else if( cli_strcmp(z,"-safe")==0 ){
2754427550
/* no-op - catch this on the second pass */
2754527551
}
2754627552
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -244,10 +244,11 @@
244
245 #if defined(_WIN32) || defined(WIN32)
246 #if SQLITE_OS_WINRT
247 #include <intrin.h>
248 #endif
 
249 #define WIN32_LEAN_AND_MEAN
250 #include <windows.h>
251
252 /* string conversion routines only needed on Win32 */
253 extern char *sqlite3_win32_unicode_to_utf8(LPCWSTR);
@@ -1471,11 +1472,11 @@
1471 #ifndef is_filtered
1472 # define is_filtered(a) ((((a).attrib)&_A_HIDDEN) || (((a).attrib)&_A_SYSTEM))
1473 #endif
1474
1475 /*
1476 ** Provide the function prototype for the POSIX compatiable getenv()
1477 ** function. This function is not thread-safe.
1478 */
1479
1480 extern const char *windirent_getenv(const char *name);
1481
@@ -4640,18 +4641,22 @@
4640 }
4641 sqlite3_result_int64(ctx, x);
4642 return SQLITE_OK;
4643 }
4644
 
 
 
 
4645 /*
4646 ** Return the rowid for the current row, logically equivalent to n+1 where
4647 ** "n" is the ascending integer in the aforesaid production definition.
4648 */
4649 static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
4650 series_cursor *pCur = (series_cursor*)cur;
4651 sqlite3_uint64 n = pCur->ss.uSeqIndexNow;
4652 *pRowid = (sqlite3_int64)((n<0xffffffffffffffff)? n+1 : 0);
4653 return SQLITE_OK;
4654 }
4655
4656 /*
4657 ** Return TRUE if the cursor has been moved off of the last
@@ -12913,17 +12918,16 @@
12913 ** It contains one entry for each b-tree pointer between a parent and
12914 ** child page in the database.
12915 */
12916
12917 #if !defined(SQLITEINT_H)
12918 /* #include "sqlite3ext.h" */
12919
12920 /* typedef unsigned char u8; */
12921 /* typedef unsigned int u32; */
12922
12923 #endif
12924 SQLITE_EXTENSION_INIT1
12925 #include <string.h>
12926 #include <assert.h>
12927
12928 #ifndef SQLITE_OMIT_VIRTUALTABLE
12929
@@ -13504,12 +13508,18 @@
13504 if( pCsr->iField>0 ){
13505 sqlite3_int64 iType;
13506 if( pCsr->pHdrPtr>&pCsr->pRec[pCsr->nRec] ){
13507 bNextPage = 1;
13508 }else{
 
13509 pCsr->pHdrPtr += dbdataGetVarintU32(pCsr->pHdrPtr, &iType);
13510 pCsr->pPtr += dbdataValueBytes(iType);
 
 
 
 
 
13511 }
13512 }
13513 }
13514
13515 if( bNextPage ){
@@ -13778,19 +13788,15 @@
13778 rc = sqlite3_create_module(db, "sqlite_dbptr", &dbdata_module, (void*)1);
13779 }
13780 return rc;
13781 }
13782
13783 #ifdef _WIN32
13784
13785 #endif
13786 int sqlite3_dbdata_init(
13787 sqlite3 *db,
13788 char **pzErrMsg,
13789 const sqlite3_api_routines *pApi
13790 ){
13791 SQLITE_EXTENSION_INIT2(pApi);
13792 (void)pzErrMsg;
13793 return sqlite3DbdataRegister(db);
13794 }
13795
13796 #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
@@ -15900,11 +15906,11 @@
15900 int iNext = 0;
15901 int nByte = 0;
15902 if( iFree>(n-4) ) return 0;
15903 iNext = recoverGetU16(&a[iFree]);
15904 nByte = recoverGetU16(&a[iFree+2]);
15905 if( iFree+nByte>n ) return 0;
15906 if( iNext && iNext<iFree+nByte ) return 0;
15907 memset(&aUsed[iFree], 0xFF, nByte);
15908 iFree = iNext;
15909 }
15910
@@ -16726,11 +16732,11 @@
16726 */
16727 typedef struct ShellState ShellState;
16728 struct ShellState {
16729 sqlite3 *db; /* The database */
16730 u8 autoExplain; /* Automatically turn on .explain mode */
16731 u8 autoEQP; /* Run EXPLAIN QUERY PLAN prior to seach SQL stmt */
16732 u8 autoEQPtest; /* autoEQP is in test mode */
16733 u8 autoEQPtrace; /* autoEQP is in trace mode */
16734 u8 scanstatsOn; /* True to display scan stats before each finalize */
16735 u8 openMode; /* SHELL_OPEN_NORMAL, _APPENDVFS, or _ZIPFILE */
16736 u8 doXdgOpen; /* Invoke start/open/xdg-open in output_reset() */
@@ -16738,11 +16744,11 @@
16738 u8 eTraceType; /* SHELL_TRACE_* value for type of trace */
16739 u8 bSafeMode; /* True to prohibit unsafe operations */
16740 u8 bSafeModePersist; /* The long-term value of bSafeMode */
16741 ColModeOpts cmOpts; /* Option values affecting columnar mode output */
16742 unsigned statsOn; /* True to display memory stats before each finalize */
16743 unsigned mEqpLines; /* Mask of veritical lines in the EQP output graph */
16744 int inputNesting; /* Track nesting level of .read and other redirects */
16745 int outCount; /* Revert to stdout when reaching zero */
16746 int cnt; /* Number of records displayed so far */
16747 int lineno; /* Line number of last line read from in */
16748 int openFlags; /* Additional flags to open. (SQLITE_OPEN_NOFOLLOW) */
@@ -16789,11 +16795,11 @@
16789 } aAuxDb[5], /* Array of all database connections */
16790 *pAuxDb; /* Currently active database connection */
16791 int *aiIndent; /* Array of indents used in MODE_Explain */
16792 int nIndent; /* Size of array aiIndent[] */
16793 int iIndent; /* Index of current op in aiIndent[] */
16794 char *zNonce; /* Nonce for temporary safe-mode excapes */
16795 EQPGraph sGraph; /* Information for the graphical EXPLAIN QUERY PLAN */
16796 ExpertInfo expert; /* Valid if previous command was ".expert OPT..." */
16797 #ifdef SQLITE_SHELL_FIDDLE
16798 struct {
16799 const char * zInput; /* Input string from wasm/JS proxy */
@@ -16831,11 +16837,11 @@
16831 #define SHELL_TRACE_EXPANDED 1 /* Show expanded SQL text */
16832 #define SHELL_TRACE_NORMALIZED 2 /* Show normalized SQL text */
16833
16834 /* Bits in the ShellState.flgProgress variable */
16835 #define SHELL_PROGRESS_QUIET 0x01 /* Omit announcing every progress callback */
16836 #define SHELL_PROGRESS_RESET 0x02 /* Reset the count when the progres
16837 ** callback limit is reached, and for each
16838 ** top-level SQL statement */
16839 #define SHELL_PROGRESS_ONCE 0x04 /* Cancel the --limit after firing once */
16840
16841 /*
@@ -18345,11 +18351,11 @@
18345 /*
18346 ** Allocate space and save off string indicating current error.
18347 */
18348 static char *save_err_msg(
18349 sqlite3 *db, /* Database to query */
18350 const char *zPhase, /* When the error occcurs */
18351 int rc, /* Error code returned from API */
18352 const char *zSql /* SQL string, or NULL */
18353 ){
18354 char *zErr;
18355 char *zContext;
@@ -18768,11 +18774,11 @@
18768 int p2op = (p2 + (iOp-iAddr));
18769
18770 /* Grow the p->aiIndent array as required */
18771 if( iOp>=nAlloc ){
18772 if( iOp==0 ){
18773 /* Do further verfication that this is explain output. Abort if
18774 ** it is not */
18775 static const char *explainCols[] = {
18776 "addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment" };
18777 int jj;
18778 for(jj=0; jj<ArraySize(explainCols); jj++){
@@ -19111,11 +19117,11 @@
19111 ** first, in order to determine column widths, before providing
19112 ** any output.
19113 */
19114 static void exec_prepared_stmt_columnar(
19115 ShellState *p, /* Pointer to ShellState */
19116 sqlite3_stmt *pStmt /* Statment to run */
19117 ){
19118 sqlite3_int64 nRow = 0;
19119 int nColumn = 0;
19120 char **azData = 0;
19121 sqlite3_int64 nAlloc = 0;
@@ -19337,11 +19343,11 @@
19337 /*
19338 ** Run a prepared statement
19339 */
19340 static void exec_prepared_stmt(
19341 ShellState *pArg, /* Pointer to ShellState */
19342 sqlite3_stmt *pStmt /* Statment to run */
19343 ){
19344 int rc;
19345 sqlite3_uint64 nRow = 0;
19346
19347 if( pArg->cMode==MODE_Column
@@ -19596,11 +19602,11 @@
19596 }
19597 zStmtSql = sqlite3_sql(pStmt);
19598 if( zStmtSql==0 ) zStmtSql = "";
19599 while( IsSpace(zStmtSql[0]) ) zStmtSql++;
19600
19601 /* save off the prepared statment handle and reset row count */
19602 if( pArg ){
19603 pArg->pStmt = pStmt;
19604 pArg->cnt = 0;
19605 }
19606
@@ -19644,11 +19650,11 @@
19644 sqlite3_finalize(pExplain);
19645 sqlite3_free(zEQP);
19646 }
19647 if( pArg->autoEQP>=AUTOEQP_trigger && triggerEQP==0 ){
19648 sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 0, 0);
19649 /* Reprepare pStmt before reactiving trace modes */
19650 sqlite3_finalize(pStmt);
19651 sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
19652 if( pArg ) pArg->pStmt = pStmt;
19653 }
19654 restore_debug_trace_modes();
@@ -19781,11 +19787,11 @@
19781 ** rowids on tables where the rowid is inaccessible because there are other
19782 ** columns in the table named "rowid", "_rowid_", and "oid".
19783 */
19784 if( preserveRowid && isIPK ){
19785 /* If a single PRIMARY KEY column with type INTEGER was seen, then it
19786 ** might be an alise for the ROWID. But it might also be a WITHOUT ROWID
19787 ** table or a INTEGER PRIMARY KEY DESC column, neither of which are
19788 ** ROWID aliases. To distinguish these cases, check to see if
19789 ** there is a "pk" entry in "PRAGMA index_list". There will be
19790 ** no "pk" index if the PRIMARY KEY really is an alias for the ROWID.
19791 */
@@ -20758,11 +20764,11 @@
20758 #define SHELL_SUB_MACRO(base, variant) base ## _ ## variant
20759 #define SHELL_SUBMACRO(base, variant) SHELL_SUB_MACRO(base, variant)
20760 /* Let custom-included extensions get their ..._init() called.
20761 * The WHATEVER_INIT( db, pzErrorMsg, pApi ) macro should cause
20762 * the extension's sqlite3_*_init( db, pzErrorMsg, pApi )
20763 * inititialization routine to be called.
20764 */
20765 {
20766 int irc = SHELL_SUBMACRO(SQLITE_SHELL_EXTFUNCS, INIT)(p->db);
20767 /* Let custom-included extensions expose their functionality.
20768 * The WHATEVER_EXPOSE( db, pzErrorMsg ) macro should cause
@@ -20835,11 +20841,11 @@
20835 );
20836 }
20837 }
20838
20839 /*
20840 ** Attempt to close the databaes connection. Report errors.
20841 */
20842 void close_db(sqlite3 *db){
20843 int rc = sqlite3_close(db);
20844 if( rc ){
20845 utf8_printf(stderr, "Error: sqlite3_close() returns %d: %s\n",
@@ -21329,11 +21335,11 @@
21329 memcpy(zInsert+i, ");", 3);
21330 rc = sqlite3_prepare_v2(newDb, zInsert, -1, &pInsert, 0);
21331 if( rc ){
21332 utf8_printf(stderr, "Error %d: %s on [%s]\n",
21333 sqlite3_extended_errcode(newDb), sqlite3_errmsg(newDb),
21334 zQuery);
21335 goto end_data_xfer;
21336 }
21337 for(k=0; k<2; k++){
21338 while( (rc = sqlite3_step(pQuery))==SQLITE_ROW ){
21339 for(i=0; i<n; i++){
@@ -27407,11 +27413,11 @@
27407 z = argv[i];
27408 if( z[0]!='-' || i>nOptsEnd ){
27409 if( data.aAuxDb->zDbFilename==0 ){
27410 data.aAuxDb->zDbFilename = z;
27411 }else{
27412 /* Excesss arguments are interpreted as SQL (or dot-commands) and
27413 ** mean that nothing is read from stdin */
27414 readStdin = 0;
27415 nCmd++;
27416 azCmd = realloc(azCmd, sizeof(azCmd[0])*nCmd);
27417 shell_check_oom(azCmd);
@@ -27492,11 +27498,11 @@
27492 );
27493 vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1);
27494 #endif
27495 #ifdef SQLITE_ENABLE_MULTIPLEX
27496 }else if( cli_strcmp(z,"-multiplex")==0 ){
27497 extern int sqlite3_multiple_initialize(const char*,int);
27498 sqlite3_multiplex_initialize(0, 1);
27499 #endif
27500 }else if( cli_strcmp(z,"-mmap")==0 ){
27501 sqlite3_int64 sz = integerValue(cmdline_option_value(argc,argv,++i));
27502 verify_uninitialized();
@@ -27535,11 +27541,11 @@
27535 sqlite3MemTraceActivate(stderr);
27536 }else if( cli_strcmp(z,"-bail")==0 ){
27537 bail_on_error = 1;
27538 }else if( cli_strcmp(z,"-nonce")==0 ){
27539 free(data.zNonce);
27540 data.zNonce = strdup(argv[++i]);
27541 }else if( cli_strcmp(z,"-unsafe-testing")==0 ){
27542 ShellSetFlag(&data,SHFLG_TestingMode);
27543 }else if( cli_strcmp(z,"-safe")==0 ){
27544 /* no-op - catch this on the second pass */
27545 }
27546
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -244,10 +244,11 @@
244
245 #if defined(_WIN32) || defined(WIN32)
246 #if SQLITE_OS_WINRT
247 #include <intrin.h>
248 #endif
249 #undef WIN32_LEAN_AND_MEAN
250 #define WIN32_LEAN_AND_MEAN
251 #include <windows.h>
252
253 /* string conversion routines only needed on Win32 */
254 extern char *sqlite3_win32_unicode_to_utf8(LPCWSTR);
@@ -1471,11 +1472,11 @@
1472 #ifndef is_filtered
1473 # define is_filtered(a) ((((a).attrib)&_A_HIDDEN) || (((a).attrib)&_A_SYSTEM))
1474 #endif
1475
1476 /*
1477 ** Provide the function prototype for the POSIX compatible getenv()
1478 ** function. This function is not thread-safe.
1479 */
1480
1481 extern const char *windirent_getenv(const char *name);
1482
@@ -4640,18 +4641,22 @@
4641 }
4642 sqlite3_result_int64(ctx, x);
4643 return SQLITE_OK;
4644 }
4645
4646 #ifndef LARGEST_UINT64
4647 #define LARGEST_UINT64 (0xffffffff|(((sqlite3_uint64)0xffffffff)<<32))
4648 #endif
4649
4650 /*
4651 ** Return the rowid for the current row, logically equivalent to n+1 where
4652 ** "n" is the ascending integer in the aforesaid production definition.
4653 */
4654 static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
4655 series_cursor *pCur = (series_cursor*)cur;
4656 sqlite3_uint64 n = pCur->ss.uSeqIndexNow;
4657 *pRowid = (sqlite3_int64)((n<LARGEST_UINT64)? n+1 : 0);
4658 return SQLITE_OK;
4659 }
4660
4661 /*
4662 ** Return TRUE if the cursor has been moved off of the last
@@ -12913,17 +12918,16 @@
12918 ** It contains one entry for each b-tree pointer between a parent and
12919 ** child page in the database.
12920 */
12921
12922 #if !defined(SQLITEINT_H)
12923 /* #include "sqlite3.h" */
12924
12925 /* typedef unsigned char u8; */
12926 /* typedef unsigned int u32; */
12927
12928 #endif
 
12929 #include <string.h>
12930 #include <assert.h>
12931
12932 #ifndef SQLITE_OMIT_VIRTUALTABLE
12933
@@ -13504,12 +13508,18 @@
13508 if( pCsr->iField>0 ){
13509 sqlite3_int64 iType;
13510 if( pCsr->pHdrPtr>&pCsr->pRec[pCsr->nRec] ){
13511 bNextPage = 1;
13512 }else{
13513 int szField = 0;
13514 pCsr->pHdrPtr += dbdataGetVarintU32(pCsr->pHdrPtr, &iType);
13515 szField = dbdataValueBytes(iType);
13516 if( (pCsr->nRec - (pCsr->pPtr - pCsr->pRec))<szField ){
13517 pCsr->pPtr = &pCsr->pRec[pCsr->nRec];
13518 }else{
13519 pCsr->pPtr += szField;
13520 }
13521 }
13522 }
13523 }
13524
13525 if( bNextPage ){
@@ -13778,19 +13788,15 @@
13788 rc = sqlite3_create_module(db, "sqlite_dbptr", &dbdata_module, (void*)1);
13789 }
13790 return rc;
13791 }
13792
 
 
 
13793 int sqlite3_dbdata_init(
13794 sqlite3 *db,
13795 char **pzErrMsg,
13796 const sqlite3_api_routines *pApi
13797 ){
 
13798 (void)pzErrMsg;
13799 return sqlite3DbdataRegister(db);
13800 }
13801
13802 #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
@@ -15900,11 +15906,11 @@
15906 int iNext = 0;
15907 int nByte = 0;
15908 if( iFree>(n-4) ) return 0;
15909 iNext = recoverGetU16(&a[iFree]);
15910 nByte = recoverGetU16(&a[iFree+2]);
15911 if( iFree+nByte>n || nByte<4 ) return 0;
15912 if( iNext && iNext<iFree+nByte ) return 0;
15913 memset(&aUsed[iFree], 0xFF, nByte);
15914 iFree = iNext;
15915 }
15916
@@ -16726,11 +16732,11 @@
16732 */
16733 typedef struct ShellState ShellState;
16734 struct ShellState {
16735 sqlite3 *db; /* The database */
16736 u8 autoExplain; /* Automatically turn on .explain mode */
16737 u8 autoEQP; /* Run EXPLAIN QUERY PLAN prior to each SQL stmt */
16738 u8 autoEQPtest; /* autoEQP is in test mode */
16739 u8 autoEQPtrace; /* autoEQP is in trace mode */
16740 u8 scanstatsOn; /* True to display scan stats before each finalize */
16741 u8 openMode; /* SHELL_OPEN_NORMAL, _APPENDVFS, or _ZIPFILE */
16742 u8 doXdgOpen; /* Invoke start/open/xdg-open in output_reset() */
@@ -16738,11 +16744,11 @@
16744 u8 eTraceType; /* SHELL_TRACE_* value for type of trace */
16745 u8 bSafeMode; /* True to prohibit unsafe operations */
16746 u8 bSafeModePersist; /* The long-term value of bSafeMode */
16747 ColModeOpts cmOpts; /* Option values affecting columnar mode output */
16748 unsigned statsOn; /* True to display memory stats before each finalize */
16749 unsigned mEqpLines; /* Mask of vertical lines in the EQP output graph */
16750 int inputNesting; /* Track nesting level of .read and other redirects */
16751 int outCount; /* Revert to stdout when reaching zero */
16752 int cnt; /* Number of records displayed so far */
16753 int lineno; /* Line number of last line read from in */
16754 int openFlags; /* Additional flags to open. (SQLITE_OPEN_NOFOLLOW) */
@@ -16789,11 +16795,11 @@
16795 } aAuxDb[5], /* Array of all database connections */
16796 *pAuxDb; /* Currently active database connection */
16797 int *aiIndent; /* Array of indents used in MODE_Explain */
16798 int nIndent; /* Size of array aiIndent[] */
16799 int iIndent; /* Index of current op in aiIndent[] */
16800 char *zNonce; /* Nonce for temporary safe-mode escapes */
16801 EQPGraph sGraph; /* Information for the graphical EXPLAIN QUERY PLAN */
16802 ExpertInfo expert; /* Valid if previous command was ".expert OPT..." */
16803 #ifdef SQLITE_SHELL_FIDDLE
16804 struct {
16805 const char * zInput; /* Input string from wasm/JS proxy */
@@ -16831,11 +16837,11 @@
16837 #define SHELL_TRACE_EXPANDED 1 /* Show expanded SQL text */
16838 #define SHELL_TRACE_NORMALIZED 2 /* Show normalized SQL text */
16839
16840 /* Bits in the ShellState.flgProgress variable */
16841 #define SHELL_PROGRESS_QUIET 0x01 /* Omit announcing every progress callback */
16842 #define SHELL_PROGRESS_RESET 0x02 /* Reset the count when the progress
16843 ** callback limit is reached, and for each
16844 ** top-level SQL statement */
16845 #define SHELL_PROGRESS_ONCE 0x04 /* Cancel the --limit after firing once */
16846
16847 /*
@@ -18345,11 +18351,11 @@
18351 /*
18352 ** Allocate space and save off string indicating current error.
18353 */
18354 static char *save_err_msg(
18355 sqlite3 *db, /* Database to query */
18356 const char *zPhase, /* When the error occurs */
18357 int rc, /* Error code returned from API */
18358 const char *zSql /* SQL string, or NULL */
18359 ){
18360 char *zErr;
18361 char *zContext;
@@ -18768,11 +18774,11 @@
18774 int p2op = (p2 + (iOp-iAddr));
18775
18776 /* Grow the p->aiIndent array as required */
18777 if( iOp>=nAlloc ){
18778 if( iOp==0 ){
18779 /* Do further verification that this is explain output. Abort if
18780 ** it is not */
18781 static const char *explainCols[] = {
18782 "addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment" };
18783 int jj;
18784 for(jj=0; jj<ArraySize(explainCols); jj++){
@@ -19111,11 +19117,11 @@
19117 ** first, in order to determine column widths, before providing
19118 ** any output.
19119 */
19120 static void exec_prepared_stmt_columnar(
19121 ShellState *p, /* Pointer to ShellState */
19122 sqlite3_stmt *pStmt /* Statement to run */
19123 ){
19124 sqlite3_int64 nRow = 0;
19125 int nColumn = 0;
19126 char **azData = 0;
19127 sqlite3_int64 nAlloc = 0;
@@ -19337,11 +19343,11 @@
19343 /*
19344 ** Run a prepared statement
19345 */
19346 static void exec_prepared_stmt(
19347 ShellState *pArg, /* Pointer to ShellState */
19348 sqlite3_stmt *pStmt /* Statement to run */
19349 ){
19350 int rc;
19351 sqlite3_uint64 nRow = 0;
19352
19353 if( pArg->cMode==MODE_Column
@@ -19596,11 +19602,11 @@
19602 }
19603 zStmtSql = sqlite3_sql(pStmt);
19604 if( zStmtSql==0 ) zStmtSql = "";
19605 while( IsSpace(zStmtSql[0]) ) zStmtSql++;
19606
19607 /* save off the prepared statement handle and reset row count */
19608 if( pArg ){
19609 pArg->pStmt = pStmt;
19610 pArg->cnt = 0;
19611 }
19612
@@ -19644,11 +19650,11 @@
19650 sqlite3_finalize(pExplain);
19651 sqlite3_free(zEQP);
19652 }
19653 if( pArg->autoEQP>=AUTOEQP_trigger && triggerEQP==0 ){
19654 sqlite3_db_config(db, SQLITE_DBCONFIG_TRIGGER_EQP, 0, 0);
19655 /* Reprepare pStmt before reactivating trace modes */
19656 sqlite3_finalize(pStmt);
19657 sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
19658 if( pArg ) pArg->pStmt = pStmt;
19659 }
19660 restore_debug_trace_modes();
@@ -19781,11 +19787,11 @@
19787 ** rowids on tables where the rowid is inaccessible because there are other
19788 ** columns in the table named "rowid", "_rowid_", and "oid".
19789 */
19790 if( preserveRowid && isIPK ){
19791 /* If a single PRIMARY KEY column with type INTEGER was seen, then it
19792 ** might be an alias for the ROWID. But it might also be a WITHOUT ROWID
19793 ** table or a INTEGER PRIMARY KEY DESC column, neither of which are
19794 ** ROWID aliases. To distinguish these cases, check to see if
19795 ** there is a "pk" entry in "PRAGMA index_list". There will be
19796 ** no "pk" index if the PRIMARY KEY really is an alias for the ROWID.
19797 */
@@ -20758,11 +20764,11 @@
20764 #define SHELL_SUB_MACRO(base, variant) base ## _ ## variant
20765 #define SHELL_SUBMACRO(base, variant) SHELL_SUB_MACRO(base, variant)
20766 /* Let custom-included extensions get their ..._init() called.
20767 * The WHATEVER_INIT( db, pzErrorMsg, pApi ) macro should cause
20768 * the extension's sqlite3_*_init( db, pzErrorMsg, pApi )
20769 * initialization routine to be called.
20770 */
20771 {
20772 int irc = SHELL_SUBMACRO(SQLITE_SHELL_EXTFUNCS, INIT)(p->db);
20773 /* Let custom-included extensions expose their functionality.
20774 * The WHATEVER_EXPOSE( db, pzErrorMsg ) macro should cause
@@ -20835,11 +20841,11 @@
20841 );
20842 }
20843 }
20844
20845 /*
20846 ** Attempt to close the database connection. Report errors.
20847 */
20848 void close_db(sqlite3 *db){
20849 int rc = sqlite3_close(db);
20850 if( rc ){
20851 utf8_printf(stderr, "Error: sqlite3_close() returns %d: %s\n",
@@ -21329,11 +21335,11 @@
21335 memcpy(zInsert+i, ");", 3);
21336 rc = sqlite3_prepare_v2(newDb, zInsert, -1, &pInsert, 0);
21337 if( rc ){
21338 utf8_printf(stderr, "Error %d: %s on [%s]\n",
21339 sqlite3_extended_errcode(newDb), sqlite3_errmsg(newDb),
21340 zInsert);
21341 goto end_data_xfer;
21342 }
21343 for(k=0; k<2; k++){
21344 while( (rc = sqlite3_step(pQuery))==SQLITE_ROW ){
21345 for(i=0; i<n; i++){
@@ -27407,11 +27413,11 @@
27413 z = argv[i];
27414 if( z[0]!='-' || i>nOptsEnd ){
27415 if( data.aAuxDb->zDbFilename==0 ){
27416 data.aAuxDb->zDbFilename = z;
27417 }else{
27418 /* Excess arguments are interpreted as SQL (or dot-commands) and
27419 ** mean that nothing is read from stdin */
27420 readStdin = 0;
27421 nCmd++;
27422 azCmd = realloc(azCmd, sizeof(azCmd[0])*nCmd);
27423 shell_check_oom(azCmd);
@@ -27492,11 +27498,11 @@
27498 );
27499 vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1);
27500 #endif
27501 #ifdef SQLITE_ENABLE_MULTIPLEX
27502 }else if( cli_strcmp(z,"-multiplex")==0 ){
27503 extern int sqlite3_multiplex_initialize(const char*,int);
27504 sqlite3_multiplex_initialize(0, 1);
27505 #endif
27506 }else if( cli_strcmp(z,"-mmap")==0 ){
27507 sqlite3_int64 sz = integerValue(cmdline_option_value(argc,argv,++i));
27508 verify_uninitialized();
@@ -27535,11 +27541,11 @@
27541 sqlite3MemTraceActivate(stderr);
27542 }else if( cli_strcmp(z,"-bail")==0 ){
27543 bail_on_error = 1;
27544 }else if( cli_strcmp(z,"-nonce")==0 ){
27545 free(data.zNonce);
27546 data.zNonce = strdup(cmdline_option_value(argc, argv, ++i));
27547 }else if( cli_strcmp(z,"-unsafe-testing")==0 ){
27548 ShellSetFlag(&data,SHFLG_TestingMode);
27549 }else if( cli_strcmp(z,"-safe")==0 ){
27550 /* no-op - catch this on the second pass */
27551 }
27552
+600 -566
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
1616
** if you want a wrapper to interface SQLite with your choice of programming
1717
** language. The code for the "sqlite3" command-line shell is also in a
1818
** separate file. This file contains only code for the core SQLite library.
1919
**
2020
** The content in this amalgamation comes from Fossil check-in
21
-** ec4ab327decd6a5ee5e6a53f1489e17e0cd.
21
+** c94f87806a8b408d8204fc7deec16d01c08.
2222
*/
2323
#define SQLITE_CORE 1
2424
#define SQLITE_AMALGAMATION 1
2525
#ifndef SQLITE_PRIVATE
2626
# define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459459
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460460
** [sqlite_version()] and [sqlite_source_id()].
461461
*/
462462
#define SQLITE_VERSION "3.43.0"
463463
#define SQLITE_VERSION_NUMBER 3043000
464
-#define SQLITE_SOURCE_ID "2023-06-12 18:22:34 7ec4ab327decd6a5ee5e6a53f1489e17e0cdbb297945f9acc532b47d052eb7a9"
464
+#define SQLITE_SOURCE_ID "2023-06-19 13:09:16 3c94f87806a8b408d8204fc7deec16d01c085ee199ff21a1f20b6346ce816cfe"
465465
466466
/*
467467
** CAPI3REF: Run-Time Library Version Numbers
468468
** KEYWORDS: sqlite3_version sqlite3_sourceid
469469
**
@@ -18641,10 +18641,12 @@
1864118641
/* Macros used to ensure that the correct members of unions are accessed
1864218642
** in Expr.
1864318643
*/
1864418644
#define ExprUseUToken(E) (((E)->flags&EP_IntValue)==0)
1864518645
#define ExprUseUValue(E) (((E)->flags&EP_IntValue)!=0)
18646
+#define ExprUseWOfst(E) (((E)->flags&(EP_InnerON|EP_OuterON))==0)
18647
+#define ExprUseWJoin(E) (((E)->flags&(EP_InnerON|EP_OuterON))!=0)
1864618648
#define ExprUseXList(E) (((E)->flags&EP_xIsSelect)==0)
1864718649
#define ExprUseXSelect(E) (((E)->flags&EP_xIsSelect)!=0)
1864818650
#define ExprUseYTab(E) (((E)->flags&(EP_WinFunc|EP_Subrtn))==0)
1864918651
#define ExprUseYWin(E) (((E)->flags&EP_WinFunc)!=0)
1865018652
#define ExprUseYSub(E) (((E)->flags&EP_Subrtn)!=0)
@@ -21109,10 +21111,11 @@
2110921111
SQLITE_PRIVATE int sqlite3ExprCheckHeight(Parse*, int);
2111021112
#else
2111121113
#define sqlite3SelectExprHeight(x) 0
2111221114
#define sqlite3ExprCheckHeight(x,y)
2111321115
#endif
21116
+SQLITE_PRIVATE void sqlite3ExprSetErrorOffset(Expr*,int);
2111421117
2111521118
SQLITE_PRIVATE u32 sqlite3Get4byte(const u8*);
2111621119
SQLITE_PRIVATE void sqlite3Put4byte(u8*, u32);
2111721120
2111821121
#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
@@ -23747,12 +23750,12 @@
2374723750
**
2374823751
** The function returns the number of successful conversions.
2374923752
*/
2375023753
static int getDigits(const char *zDate, const char *zFormat, ...){
2375123754
/* The aMx[] array translates the 3rd character of each format
23752
- ** spec into a max size: a b c d e f */
23753
- static const u16 aMx[] = { 12, 14, 24, 31, 59, 9999 };
23755
+ ** spec into a max size: a b c d e f */
23756
+ static const u16 aMx[] = { 12, 14, 24, 31, 59, 14712 };
2375423757
va_list ap;
2375523758
int cnt = 0;
2375623759
char nextC;
2375723760
va_start(ap, zFormat);
2375823761
do{
@@ -24089,21 +24092,18 @@
2408924092
2409024093
/*
2409124094
** Compute the Hour, Minute, and Seconds from the julian day number.
2409224095
*/
2409324096
static void computeHMS(DateTime *p){
24094
- int s;
24097
+ int day_ms, day_min; /* milliseconds, minutes into the day */
2409524098
if( p->validHMS ) return;
2409624099
computeJD(p);
24097
- s = (int)((p->iJD + 43200000) % 86400000);
24098
- p->s = s/1000.0;
24099
- s = (int)p->s;
24100
- p->s -= s;
24101
- p->h = s/3600;
24102
- s -= p->h*3600;
24103
- p->m = s/60;
24104
- p->s += s - p->m*60;
24100
+ day_ms = (int)((p->iJD + 43200000) % 86400000);
24101
+ p->s = (day_ms % 60000)/1000.0;
24102
+ day_min = day_ms/60000;
24103
+ p->m = day_min % 60;
24104
+ p->h = day_min / 60;
2410524105
p->rawS = 0;
2410624106
p->validHMS = 1;
2410724107
}
2410824108
2410924109
/*
@@ -24509,32 +24509,41 @@
2450924509
case '9': {
2451024510
double rRounder;
2451124511
int i;
2451224512
int Y,M,D,h,m,x;
2451324513
const char *z2 = z;
24514
+ char z0 = z[0];
2451424515
for(n=1; z[n]; n++){
2451524516
if( z[n]==':' ) break;
2451624517
if( sqlite3Isspace(z[n]) ) break;
24517
- if( z[n]=='-' && n==5 && getDigits(&z[1], "40f", &Y)==1 ) break;
24518
+ if( z[n]=='-' ){
24519
+ if( n==5 && getDigits(&z[1], "40f", &Y)==1 ) break;
24520
+ if( n==6 && getDigits(&z[1], "50f", &Y)==1 ) break;
24521
+ }
2451824522
}
2451924523
if( sqlite3AtoF(z, &r, n, SQLITE_UTF8)<=0 ){
24520
- rc = 1;
24524
+ assert( rc==1 );
2452124525
break;
2452224526
}
2452324527
if( z[n]=='-' ){
2452424528
/* A modifier of the form (+|-)YYYY-MM-DD adds or subtracts the
2452524529
** specified number of years, months, and days. MM is limited to
2452624530
** the range 0-11 and DD is limited to 0-30.
2452724531
*/
24528
- if( z[0]!='+' && z[0]!='-' ) break; /* Must start with +/- */
24529
- if( NEVER(n!=5) ) break; /* Must be 4-digit YYYY */
24530
- if( getDigits(&z[1], "40f-20a-20d", &Y, &M, &D)!=3 ) break;
24532
+ if( z0!='+' && z0!='-' ) break; /* Must start with +/- */
24533
+ if( n==5 ){
24534
+ if( getDigits(&z[1], "40f-20a-20d", &Y, &M, &D)!=3 ) break;
24535
+ }else{
24536
+ assert( n==6 );
24537
+ if( getDigits(&z[1], "50f-20a-20d", &Y, &M, &D)!=3 ) break;
24538
+ z++;
24539
+ }
2453124540
if( M>=12 ) break; /* M range 0..11 */
2453224541
if( D>=31 ) break; /* D range 0..30 */
2453324542
computeYMD_HMS(p);
2453424543
p->validJD = 0;
24535
- if( z[0]=='-' ){
24544
+ if( z0=='-' ){
2453624545
p->Y -= Y;
2453724546
p->M -= M;
2453824547
D = -D;
2453924548
}else{
2454024549
p->Y += Y;
@@ -24574,11 +24583,11 @@
2457424583
if( parseHhMmSs(z2, &tx) ) break;
2457524584
computeJD(&tx);
2457624585
tx.iJD -= 43200000;
2457724586
day = tx.iJD/86400000;
2457824587
tx.iJD -= day*86400000;
24579
- if( z[0]=='-' ) tx.iJD = -tx.iJD;
24588
+ if( z0=='-' ) tx.iJD = -tx.iJD;
2458024589
computeJD(p);
2458124590
clearYMD_HMS_TZ(p);
2458224591
p->iJD += tx.iJD;
2458324592
rc = 0;
2458424593
break;
@@ -24590,11 +24599,11 @@
2459024599
while( sqlite3Isspace(*z) ) z++;
2459124600
n = sqlite3Strlen30(z);
2459224601
if( n>10 || n<3 ) break;
2459324602
if( sqlite3UpperToLower[(u8)z[n-1]]=='s' ) n--;
2459424603
computeJD(p);
24595
- rc = 1;
24604
+ assert( rc==1 );
2459624605
rRounder = r<0 ? -0.5 : +0.5;
2459724606
for(i=0; i<ArraySize(aXformType); i++){
2459824607
if( aXformType[i].nName==n
2459924608
&& sqlite3_strnicmp(aXformType[i].zName, z, n)==0
2460024609
&& r>-aXformType[i].rLimit && r<aXformType[i].rLimit
@@ -24757,11 +24766,11 @@
2475724766
zBuf[14] = ':';
2475824767
zBuf[15] = '0' + (x.m/10)%10;
2475924768
zBuf[16] = '0' + (x.m)%10;
2476024769
zBuf[17] = ':';
2476124770
if( x.useSubsec ){
24762
- s = (int)1000.0*x.s;
24771
+ s = (int)(1000.0*x.s + 0.5);
2476324772
zBuf[18] = '0' + (s/10000)%10;
2476424773
zBuf[19] = '0' + (s/1000)%10;
2476524774
zBuf[20] = '.';
2476624775
zBuf[21] = '0' + (s/100)%10;
2476724776
zBuf[22] = '0' + (s/10)%10;
@@ -24804,11 +24813,11 @@
2480424813
zBuf[2] = ':';
2480524814
zBuf[3] = '0' + (x.m/10)%10;
2480624815
zBuf[4] = '0' + (x.m)%10;
2480724816
zBuf[5] = ':';
2480824817
if( x.useSubsec ){
24809
- s = (int)1000.0*x.s;
24818
+ s = (int)(1000.0*x.s + 0.5);
2481024819
zBuf[6] = '0' + (s/10000)%10;
2481124820
zBuf[7] = '0' + (s/1000)%10;
2481224821
zBuf[8] = '.';
2481324822
zBuf[9] = '0' + (s/100)%10;
2481424823
zBuf[10] = '0' + (s/10)%10;
@@ -25034,18 +25043,19 @@
2503425043
** ISO-8601 string. The unix timestamps are not supported by this
2503525044
** routine.
2503625045
*/
2503725046
static void timediffFunc(
2503825047
sqlite3_context *context,
25039
- int argc,
25048
+ int NotUsed1,
2504025049
sqlite3_value **argv
2504125050
){
2504225051
char sign;
2504325052
int Y, M;
2504425053
DateTime d1, d2;
2504525054
sqlite3_str sRes;
25046
- if( isDate(context, 1, argv, &d1) ) return;
25055
+ UNUSED_PARAMETER(NotUsed1);
25056
+ if( isDate(context, 1, &argv[0], &d1) ) return;
2504725057
if( isDate(context, 1, &argv[1], &d2) ) return;
2504825058
computeYMD_HMS(&d1);
2504925059
computeYMD_HMS(&d2);
2505025060
if( d1.iJD>=d2.iJD ){
2505125061
sign = '+';
@@ -25063,11 +25073,11 @@
2506325073
if( M!=0 ){
2506425074
d2.M = d1.M;
2506525075
d2.validJD = 0;
2506625076
computeJD(&d2);
2506725077
}
25068
- if( d1.iJD<d2.iJD ){
25078
+ while( d1.iJD<d2.iJD ){
2506925079
M--;
2507025080
if( M<0 ){
2507125081
M = 11;
2507225082
Y--;
2507325083
}
@@ -25078,12 +25088,12 @@
2507825088
}
2507925089
d2.validJD = 0;
2508025090
computeJD(&d2);
2508125091
}
2508225092
d1.iJD -= d2.iJD;
25083
- d1.iJD += 148699540800000;
25084
- }else{
25093
+ d1.iJD += (u64)1486995408 * (u64)100000;
25094
+ }else /* d1<d2 */{
2508525095
sign = '-';
2508625096
Y = d2.Y - d1.Y;
2508725097
if( Y ){
2508825098
d2.Y = d1.Y;
2508925099
d2.validJD = 0;
@@ -25097,11 +25107,11 @@
2509725107
if( M!=0 ){
2509825108
d2.M = d1.M;
2509925109
d2.validJD = 0;
2510025110
computeJD(&d2);
2510125111
}
25102
- if( d1.iJD>d2.iJD ){
25112
+ while( d1.iJD>d2.iJD ){
2510325113
M--;
2510425114
if( M<0 ){
2510525115
M = 11;
2510625116
Y--;
2510725117
}
@@ -25112,11 +25122,11 @@
2511225122
}
2511325123
d2.validJD = 0;
2511425124
computeJD(&d2);
2511525125
}
2511625126
d1.iJD = d2.iJD - d1.iJD;
25117
- d1.iJD += 148699540800000;
25127
+ d1.iJD += (u64)1486995408 * (u64)100000;
2511825128
}
2511925129
d1.validYMD = 0;
2512025130
d1.validHMS = 0;
2512125131
d1.validTZ = 0;
2512225132
computeYMD_HMS(&d1);
@@ -48846,11 +48856,11 @@
4884648856
4884748857
/* Acquire an EXCLUSIVE lock
4884848858
*/
4884948859
if( locktype==EXCLUSIVE_LOCK && res ){
4885048860
assert( pFile->locktype>=SHARED_LOCK );
48851
- res = winUnlockReadLock(pFile);
48861
+ (void)winUnlockReadLock(pFile);
4885248862
res = winLockFile(&pFile->h, SQLITE_LOCKFILE_FLAGS, SHARED_FIRST, 0,
4885348863
SHARED_SIZE, 0);
4885448864
if( res ){
4885548865
newLocktype = EXCLUSIVE_LOCK;
4885648866
}else{
@@ -60607,15 +60617,11 @@
6060760617
u8 *pPtr;
6060860618
Pager *pPager = 0; /* Pager object to allocate and return */
6060960619
int rc = SQLITE_OK; /* Return code */
6061060620
int tempFile = 0; /* True for temp files (incl. in-memory files) */
6061160621
int memDb = 0; /* True if this is an in-memory file */
60612
-#ifndef SQLITE_OMIT_DESERIALIZE
6061360622
int memJM = 0; /* Memory journal mode */
60614
-#else
60615
-# define memJM 0
60616
-#endif
6061760623
int readOnly = 0; /* True if this is a read-only file */
6061860624
int journalFileSize; /* Bytes to allocate for each journal fd */
6061960625
char *zPathname = 0; /* Full path to database file */
6062060626
int nPathname = 0; /* Number of bytes in zPathname */
6062160627
int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */
@@ -60730,16 +60736,17 @@
6073060736
** The sqlite3_create_filename() interface and the databaseFilename() utility
6073160737
** that is used by sqlite3_filename_database() and kin also depend on the
6073260738
** specific formatting and order of the various filenames, so if the format
6073360739
** changes here, be sure to change it there as well.
6073460740
*/
60741
+ assert( SQLITE_PTRSIZE==sizeof(Pager*) );
6073560742
pPtr = (u8 *)sqlite3MallocZero(
6073660743
ROUND8(sizeof(*pPager)) + /* Pager structure */
6073760744
ROUND8(pcacheSize) + /* PCache object */
6073860745
ROUND8(pVfs->szOsFile) + /* The main db file */
6073960746
journalFileSize * 2 + /* The two journal files */
60740
- sizeof(pPager) + /* Space to hold a pointer */
60747
+ SQLITE_PTRSIZE + /* Space to hold a pointer */
6074160748
4 + /* Database prefix */
6074260749
nPathname + 1 + /* database filename */
6074360750
nUriByte + /* query parameters */
6074460751
nPathname + 8 + 1 + /* Journal filename */
6074560752
#ifndef SQLITE_OMIT_WAL
@@ -60756,11 +60763,11 @@
6075660763
pPager->pPCache = (PCache*)pPtr; pPtr += ROUND8(pcacheSize);
6075760764
pPager->fd = (sqlite3_file*)pPtr; pPtr += ROUND8(pVfs->szOsFile);
6075860765
pPager->sjfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
6075960766
pPager->jfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
6076060767
assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) );
60761
- memcpy(pPtr, &pPager, sizeof(pPager)); pPtr += sizeof(pPager);
60768
+ memcpy(pPtr, &pPager, SQLITE_PTRSIZE); pPtr += SQLITE_PTRSIZE;
6076260769
6076360770
/* Fill in the Pager.zFilename and pPager.zQueryParam fields */
6076460771
pPtr += 4; /* Skip zero prefix */
6076560772
pPager->zFilename = (char*)pPtr;
6076660773
if( nPathname>0 ){
@@ -60810,13 +60817,11 @@
6081060817
*/
6081160818
if( zFilename && zFilename[0] ){
6081260819
int fout = 0; /* VFS flags returned by xOpen() */
6081360820
rc = sqlite3OsOpen(pVfs, pPager->zFilename, pPager->fd, vfsFlags, &fout);
6081460821
assert( !memDb );
60815
-#ifndef SQLITE_OMIT_DESERIALIZE
6081660822
pPager->memVfs = memJM = (fout&SQLITE_OPEN_MEMORY)!=0;
60817
-#endif
6081860823
readOnly = (fout&SQLITE_OPEN_READONLY)!=0;
6081960824
6082060825
/* If the file was successfully opened for read/write access,
6082160826
** choose a default page size in case we have to create the
6082260827
** database file. The default page size is the maximum of:
@@ -71538,10 +71543,13 @@
7153871543
assert( sizeof(i64)==8 );
7153971544
assert( sizeof(u64)==8 );
7154071545
assert( sizeof(u32)==4 );
7154171546
assert( sizeof(u16)==2 );
7154271547
assert( sizeof(Pgno)==4 );
71548
+
71549
+ /* Suppress false-positive compiler warning from PVS-Studio */
71550
+ memset(&zDbHeader[16], 0, 8);
7154371551
7154471552
pBt = sqlite3MallocZero( sizeof(*pBt) );
7154571553
if( pBt==0 ){
7154671554
rc = SQLITE_NOMEM_BKPT;
7154771555
goto btree_open_out;
@@ -76385,11 +76393,11 @@
7638576393
assert( i<iEnd );
7638676394
j = get2byte(&aData[hdr+5]);
7638776395
if( NEVER(j>(u32)usableSize) ){ j = 0; }
7638876396
memcpy(&pTmp[j], &aData[j], usableSize - j);
7638976397
76390
- for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
76398
+ for(k=0; ALWAYS(k<NB*2) && pCArray->ixNx[k]<=i; k++){}
7639176399
pSrcEnd = pCArray->apEnd[k];
7639276400
7639376401
pData = pEnd;
7639476402
while( 1/*exit by break*/ ){
7639576403
u8 *pCell = pCArray->apCell[i];
@@ -76468,11 +76476,11 @@
7646876476
int iEnd = iFirst + nCell; /* End of loop. One past last cell to ins */
7646976477
int k; /* Current slot in pCArray->apEnd[] */
7647076478
u8 *pEnd; /* Maximum extent of cell data */
7647176479
assert( CORRUPT_DB || pPg->hdrOffset==0 ); /* Never called on page 1 */
7647276480
if( iEnd<=iFirst ) return 0;
76473
- for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
76481
+ for(k=0; ALWAYS(k<NB*2) && pCArray->ixNx[k]<=i ; k++){}
7647476482
pEnd = pCArray->apEnd[k];
7647576483
while( 1 /*Exit by break*/ ){
7647676484
int sz, rc;
7647776485
u8 *pSlot;
7647876486
assert( pCArray->szCell[i]!=0 );
@@ -77578,11 +77586,11 @@
7757877586
}
7757977587
}
7758077588
iOvflSpace += sz;
7758177589
assert( sz<=pBt->maxLocal+23 );
7758277590
assert( iOvflSpace <= (int)pBt->pageSize );
77583
- for(k=0; b.ixNx[k]<=j && ALWAYS(k<NB*2); k++){}
77591
+ for(k=0; ALWAYS(k<NB*2) && b.ixNx[k]<=j; k++){}
7758477592
pSrcEnd = b.apEnd[k];
7758577593
if( SQLITE_WITHIN(pSrcEnd, pCell, pCell+sz) ){
7758677594
rc = SQLITE_CORRUPT_BKPT;
7758777595
goto balance_cleanup;
7758877596
}
@@ -77614,10 +77622,12 @@
7761477622
** pass.
7761577623
*/
7761677624
for(i=1-nNew; i<nNew; i++){
7761777625
int iPg = i<0 ? -i : i;
7761877626
assert( iPg>=0 && iPg<nNew );
77627
+ assert( iPg>=1 || i>=0 );
77628
+ assert( iPg<ArraySize(cntOld) );
7761977629
if( abDone[iPg] ) continue; /* Skip pages already processed */
7762077630
if( i>=0 /* On the upwards pass, or... */
7762177631
|| cntOld[iPg-1]>=cntNew[iPg-1] /* Condition (1) is true */
7762277632
){
7762377633
int iNew;
@@ -107349,10 +107359,19 @@
107349107359
p->flags |= EP_Propagate & sqlite3ExprListFlags(p->x.pList);
107350107360
}
107351107361
}
107352107362
#define exprSetHeight(y)
107353107363
#endif /* SQLITE_MAX_EXPR_DEPTH>0 */
107364
+
107365
+/*
107366
+** Set the error offset for an Expr node, if possible.
107367
+*/
107368
+SQLITE_PRIVATE void sqlite3ExprSetErrorOffset(Expr *pExpr, int iOfst){
107369
+ if( pExpr==0 ) return;
107370
+ if( NEVER(ExprUseWJoin(pExpr)) ) return;
107371
+ pExpr->w.iOfst = iOfst;
107372
+}
107354107373
107355107374
/*
107356107375
** This routine is the core allocator for Expr nodes.
107357107376
**
107358107377
** Construct a new expression node and return a pointer to it. Memory
@@ -111093,11 +111112,11 @@
111093111112
#endif
111094111113
if( pDef==0 || pDef->xFinalize!=0 ){
111095111114
sqlite3ErrorMsg(pParse, "unknown function: %#T()", pExpr);
111096111115
break;
111097111116
}
111098
- if( pDef->funcFlags & SQLITE_FUNC_INLINE ){
111117
+ if( (pDef->funcFlags & SQLITE_FUNC_INLINE)!=0 && ALWAYS(pFarg!=0) ){
111099111118
assert( (pDef->funcFlags & SQLITE_FUNC_UNSAFE)==0 );
111100111119
assert( (pDef->funcFlags & SQLITE_FUNC_DIRECT)==0 );
111101111120
return exprCodeInlineFunction(pParse, pFarg,
111102111121
SQLITE_PTR_TO_INT(pDef->pUserData), target);
111103111122
}else if( pDef->funcFlags & (SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE) ){
@@ -113796,11 +113815,11 @@
113796113815
}
113797113816
assert( IsOrdinaryTable(pNew) );
113798113817
pNew->u.tab.pDfltList = sqlite3ExprListDup(db, pTab->u.tab.pDfltList, 0);
113799113818
pNew->pSchema = db->aDb[iDb].pSchema;
113800113819
pNew->u.tab.addColOffset = pTab->u.tab.addColOffset;
113801
- pNew->nTabRef = 1;
113820
+ assert( pNew->nTabRef==1 );
113802113821
113803113822
exit_begin_add_column:
113804113823
sqlite3SrcListDelete(db, pSrc);
113805113824
return;
113806113825
}
@@ -125175,11 +125194,11 @@
125175125194
if( sNC.ncFlags & NC_Subquery ) bComplex = 1;
125176125195
wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW);
125177125196
if( HasRowid(pTab) ){
125178125197
/* For a rowid table, initialize the RowSet to an empty set */
125179125198
pPk = 0;
125180
- nPk = 1;
125199
+ assert( nPk==1 );
125181125200
iRowSet = ++pParse->nMem;
125182125201
sqlite3VdbeAddOp2(v, OP_Null, 0, iRowSet);
125183125202
}else{
125184125203
/* For a WITHOUT ROWID table, create an ephemeral table used to
125185125204
** hold all primary keys for rows to be deleted. */
@@ -129658,13 +129677,12 @@
129658129677
/* Remove the FK from the fkeyHash hash table. */
129659129678
if( db->pnBytesFreed==0 ){
129660129679
if( pFKey->pPrevTo ){
129661129680
pFKey->pPrevTo->pNextTo = pFKey->pNextTo;
129662129681
}else{
129663
- void *p = (void *)pFKey->pNextTo;
129664
- const char *z = (p ? pFKey->pNextTo->zTo : pFKey->zTo);
129665
- sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, p);
129682
+ const char *z = (pFKey->pNextTo ? pFKey->pNextTo->zTo : pFKey->zTo);
129683
+ sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, pFKey->pNextTo);
129666129684
}
129667129685
if( pFKey->pNextTo ){
129668129686
pFKey->pNextTo->pPrevTo = pFKey->pPrevTo;
129669129687
}
129670129688
}
@@ -132346,10 +132364,12 @@
132346132364
Index *pIdx;
132347132365
Vdbe *v;
132348132366
132349132367
assert( op==OP_OpenRead || op==OP_OpenWrite );
132350132368
assert( op==OP_OpenWrite || p5==0 );
132369
+ assert( piDataCur!=0 );
132370
+ assert( piIdxCur!=0 );
132351132371
if( IsVirtual(pTab) ){
132352132372
/* This routine is a no-op for virtual tables. Leave the output
132353132373
** variables *piDataCur and *piIdxCur set to illegal cursor numbers
132354132374
** for improved error detection. */
132355132375
*piDataCur = *piIdxCur = -999;
@@ -132358,22 +132378,22 @@
132358132378
iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
132359132379
v = pParse->pVdbe;
132360132380
assert( v!=0 );
132361132381
if( iBase<0 ) iBase = pParse->nTab;
132362132382
iDataCur = iBase++;
132363
- if( piDataCur ) *piDataCur = iDataCur;
132383
+ *piDataCur = iDataCur;
132364132384
if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){
132365132385
sqlite3OpenTable(pParse, iDataCur, iDb, pTab, op);
132366132386
}else{
132367132387
sqlite3TableLock(pParse, iDb, pTab->tnum, op==OP_OpenWrite, pTab->zName);
132368132388
}
132369
- if( piIdxCur ) *piIdxCur = iBase;
132389
+ *piIdxCur = iBase;
132370132390
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
132371132391
int iIdxCur = iBase++;
132372132392
assert( pIdx->pSchema==pTab->pSchema );
132373132393
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
132374
- if( piDataCur ) *piDataCur = iIdxCur;
132394
+ *piDataCur = iIdxCur;
132375132395
p5 = 0;
132376132396
}
132377132397
if( aToOpen==0 || aToOpen[i+1] ){
132378132398
sqlite3VdbeAddOp3(v, op, iIdxCur, pIdx->tnum, iDb);
132379132399
sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
@@ -145379,14 +145399,20 @@
145379145399
}else{
145380145400
/* This expression is a "*" or a "TABLE.*" and needs to be
145381145401
** expanded. */
145382145402
int tableSeen = 0; /* Set to 1 when TABLE matches */
145383145403
char *zTName = 0; /* text of name of TABLE */
145404
+ int iErrOfst;
145384145405
if( pE->op==TK_DOT ){
145385145406
assert( pE->pLeft!=0 );
145386145407
assert( !ExprHasProperty(pE->pLeft, EP_IntValue) );
145387145408
zTName = pE->pLeft->u.zToken;
145409
+ assert( ExprUseWOfst(pE->pLeft) );
145410
+ iErrOfst = pE->pRight->w.iOfst;
145411
+ }else{
145412
+ assert( ExprUseWOfst(pE) );
145413
+ iErrOfst = pE->w.iOfst;
145388145414
}
145389145415
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
145390145416
Table *pTab = pFrom->pTab; /* Table for this data source */
145391145417
ExprList *pNestedFrom; /* Result-set of a nested FROM clause */
145392145418
char *zTabName; /* AS name for this data source */
@@ -145419,10 +145445,11 @@
145419145445
int ii;
145420145446
pUsing = pFrom[1].u3.pUsing;
145421145447
for(ii=0; ii<pUsing->nId; ii++){
145422145448
const char *zUName = pUsing->a[ii].zName;
145423145449
pRight = sqlite3Expr(db, TK_ID, zUName);
145450
+ sqlite3ExprSetErrorOffset(pRight, iErrOfst);
145424145451
pNew = sqlite3ExprListAppend(pParse, pNew, pRight);
145425145452
if( pNew ){
145426145453
struct ExprList_item *pX = &pNew->a[pNew->nExpr-1];
145427145454
assert( pX->zEName==0 );
145428145455
pX->zEName = sqlite3MPrintf(db,"..%s", zUName);
@@ -145491,10 +145518,11 @@
145491145518
pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pExpr);
145492145519
}
145493145520
}else{
145494145521
pExpr = pRight;
145495145522
}
145523
+ sqlite3ExprSetErrorOffset(pExpr, iErrOfst);
145496145524
pNew = sqlite3ExprListAppend(pParse, pNew, pExpr);
145497145525
if( pNew==0 ){
145498145526
break; /* OOM */
145499145527
}
145500145528
pX = &pNew->a[pNew->nExpr-1];
@@ -150150,10 +150178,12 @@
150150150178
sqlite3WhereEnd(pWInfo);
150151150179
}
150152150180
150153150181
if( !isView ){
150154150182
int addrOnce = 0;
150183
+ int iNotUsed1 = 0;
150184
+ int iNotUsed2 = 0;
150155150185
150156150186
/* Open every index that needs updating. */
150157150187
if( eOnePass!=ONEPASS_OFF ){
150158150188
if( aiCurOnePass[0]>=0 ) aToOpen[aiCurOnePass[0]-iBaseCur] = 0;
150159150189
if( aiCurOnePass[1]>=0 ) aToOpen[aiCurOnePass[1]-iBaseCur] = 0;
@@ -150161,11 +150191,11 @@
150161150191
150162150192
if( eOnePass==ONEPASS_MULTI && (nIdx-(aiCurOnePass[1]>=0))>0 ){
150163150193
addrOnce = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
150164150194
}
150165150195
sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenWrite, 0, iBaseCur,
150166
- aToOpen, 0, 0);
150196
+ aToOpen, &iNotUsed1, &iNotUsed2);
150167150197
if( addrOnce ){
150168150198
sqlite3VdbeJumpHereOrPopInst(v, addrOnce);
150169150199
}
150170150200
}
150171150201
@@ -156449,11 +156479,11 @@
156449156479
** a single escape character. The second condition is necessary so
156450156480
** that we can increment the prefix key to find an upper bound for the
156451156481
** range search. The third is because the caller assumes that the pattern
156452156482
** consists of at least one character after all escapes have been
156453156483
** removed. */
156454
- if( cnt!=0 && 255!=(u8)z[cnt-1] && (cnt>1 || z[0]!=wc[3]) ){
156484
+ if( (cnt>1 || (cnt>0 && z[0]!=wc[3])) && 255!=(u8)z[cnt-1] ){
156455156485
Expr *pPrefix;
156456156486
156457156487
/* A "complete" match if the pattern ends with "*" or "%" */
156458156488
*pisComplete = c==wc[0] && z[cnt+1]==0;
156459156489
@@ -168543,11 +168573,11 @@
168543168573
#define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
168544168574
#define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
168545168575
#define YYFALLBACK 1
168546168576
#define YYNSTATE 575
168547168577
#define YYNRULE 403
168548
-#define YYNRULE_WITH_ACTION 340
168578
+#define YYNRULE_WITH_ACTION 338
168549168579
#define YYNTOKEN 185
168550168580
#define YY_MAX_SHIFT 574
168551168581
#define YY_MIN_SHIFTREDUCE 833
168552168582
#define YY_MAX_SHIFTREDUCE 1235
168553168583
#define YY_ERROR_ACTION 1236
@@ -168625,140 +168655,140 @@
168625168655
static const YYACTIONTYPE yy_action[] = {
168626168656
/* 0 */ 568, 208, 568, 118, 115, 229, 568, 118, 115, 229,
168627168657
/* 10 */ 568, 1310, 377, 1289, 408, 562, 562, 562, 568, 409,
168628168658
/* 20 */ 378, 1310, 1272, 41, 41, 41, 41, 208, 1520, 71,
168629168659
/* 30 */ 71, 969, 419, 41, 41, 491, 303, 279, 303, 970,
168630
- /* 40 */ 397, 71, 71, 125, 126, 80, 1212, 1212, 1047, 1050,
168660
+ /* 40 */ 397, 71, 71, 125, 126, 80, 1210, 1210, 1047, 1050,
168631168661
/* 50 */ 1037, 1037, 123, 123, 124, 124, 124, 124, 476, 409,
168632168662
/* 60 */ 1237, 1, 1, 574, 2, 1241, 550, 118, 115, 229,
168633168663
/* 70 */ 317, 480, 146, 480, 524, 118, 115, 229, 529, 1323,
168634
- /* 80 */ 417, 523, 142, 125, 126, 80, 1212, 1212, 1047, 1050,
168664
+ /* 80 */ 417, 523, 142, 125, 126, 80, 1210, 1210, 1047, 1050,
168635168665
/* 90 */ 1037, 1037, 123, 123, 124, 124, 124, 124, 118, 115,
168636168666
/* 100 */ 229, 327, 122, 122, 122, 122, 121, 121, 120, 120,
168637168667
/* 110 */ 120, 119, 116, 444, 284, 284, 284, 284, 442, 442,
168638
- /* 120 */ 442, 1561, 376, 1563, 1188, 375, 1159, 565, 1159, 565,
168639
- /* 130 */ 409, 1561, 537, 259, 226, 444, 101, 145, 449, 316,
168668
+ /* 120 */ 442, 1559, 376, 1561, 1186, 375, 1157, 565, 1157, 565,
168669
+ /* 130 */ 409, 1559, 537, 259, 226, 444, 101, 145, 449, 316,
168640168670
/* 140 */ 559, 240, 122, 122, 122, 122, 121, 121, 120, 120,
168641
- /* 150 */ 120, 119, 116, 444, 125, 126, 80, 1212, 1212, 1047,
168671
+ /* 150 */ 120, 119, 116, 444, 125, 126, 80, 1210, 1210, 1047,
168642168672
/* 160 */ 1050, 1037, 1037, 123, 123, 124, 124, 124, 124, 142,
168643
- /* 170 */ 294, 1188, 339, 448, 120, 120, 120, 119, 116, 444,
168644
- /* 180 */ 127, 1188, 1189, 1188, 148, 441, 440, 568, 119, 116,
168673
+ /* 170 */ 294, 1186, 339, 448, 120, 120, 120, 119, 116, 444,
168674
+ /* 180 */ 127, 1186, 1187, 1186, 148, 441, 440, 568, 119, 116,
168645168675
/* 190 */ 444, 124, 124, 124, 124, 117, 122, 122, 122, 122,
168646168676
/* 200 */ 121, 121, 120, 120, 120, 119, 116, 444, 454, 113,
168647168677
/* 210 */ 13, 13, 546, 122, 122, 122, 122, 121, 121, 120,
168648
- /* 220 */ 120, 120, 119, 116, 444, 422, 316, 559, 1188, 1189,
168649
- /* 230 */ 1188, 149, 1220, 409, 1220, 124, 124, 124, 124, 122,
168678
+ /* 220 */ 120, 120, 119, 116, 444, 422, 316, 559, 1186, 1187,
168679
+ /* 230 */ 1186, 149, 1218, 409, 1218, 124, 124, 124, 124, 122,
168650168680
/* 240 */ 122, 122, 122, 121, 121, 120, 120, 120, 119, 116,
168651168681
/* 250 */ 444, 465, 342, 1034, 1034, 1048, 1051, 125, 126, 80,
168652
- /* 260 */ 1212, 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124,
168653
- /* 270 */ 124, 124, 1275, 522, 222, 1188, 568, 409, 224, 514,
168682
+ /* 260 */ 1210, 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124,
168683
+ /* 270 */ 124, 124, 1275, 522, 222, 1186, 568, 409, 224, 514,
168654168684
/* 280 */ 175, 82, 83, 122, 122, 122, 122, 121, 121, 120,
168655
- /* 290 */ 120, 120, 119, 116, 444, 1005, 16, 16, 1188, 133,
168656
- /* 300 */ 133, 125, 126, 80, 1212, 1212, 1047, 1050, 1037, 1037,
168685
+ /* 290 */ 120, 120, 119, 116, 444, 1005, 16, 16, 1186, 133,
168686
+ /* 300 */ 133, 125, 126, 80, 1210, 1210, 1047, 1050, 1037, 1037,
168657168687
/* 310 */ 123, 123, 124, 124, 124, 124, 122, 122, 122, 122,
168658168688
/* 320 */ 121, 121, 120, 120, 120, 119, 116, 444, 1038, 546,
168659
- /* 330 */ 1188, 373, 1188, 1189, 1188, 252, 1429, 399, 504, 501,
168689
+ /* 330 */ 1186, 373, 1186, 1187, 1186, 252, 1429, 399, 504, 501,
168660168690
/* 340 */ 500, 111, 560, 566, 4, 924, 924, 433, 499, 340,
168661
- /* 350 */ 460, 328, 360, 394, 1233, 1188, 1189, 1188, 563, 568,
168691
+ /* 350 */ 460, 328, 360, 394, 1231, 1186, 1187, 1186, 563, 568,
168662168692
/* 360 */ 122, 122, 122, 122, 121, 121, 120, 120, 120, 119,
168663
- /* 370 */ 116, 444, 284, 284, 369, 1574, 1600, 441, 440, 154,
168664
- /* 380 */ 409, 445, 71, 71, 1282, 565, 1217, 1188, 1189, 1188,
168665
- /* 390 */ 85, 1219, 271, 557, 543, 515, 1555, 568, 98, 1218,
168666
- /* 400 */ 6, 1274, 472, 142, 125, 126, 80, 1212, 1212, 1047,
168693
+ /* 370 */ 116, 444, 284, 284, 369, 1572, 1598, 441, 440, 154,
168694
+ /* 380 */ 409, 445, 71, 71, 1282, 565, 1215, 1186, 1187, 1186,
168695
+ /* 390 */ 85, 1217, 271, 557, 543, 515, 515, 568, 98, 1216,
168696
+ /* 400 */ 6, 1274, 472, 142, 125, 126, 80, 1210, 1210, 1047,
168667168697
/* 410 */ 1050, 1037, 1037, 123, 123, 124, 124, 124, 124, 550,
168668
- /* 420 */ 13, 13, 1024, 507, 1220, 1188, 1220, 549, 109, 109,
168669
- /* 430 */ 222, 568, 1234, 175, 568, 427, 110, 197, 445, 569,
168670
- /* 440 */ 445, 430, 1546, 1014, 325, 551, 1188, 270, 287, 368,
168698
+ /* 420 */ 13, 13, 1024, 507, 1218, 1186, 1218, 549, 109, 109,
168699
+ /* 430 */ 222, 568, 1232, 175, 568, 427, 110, 197, 445, 569,
168700
+ /* 440 */ 445, 430, 1546, 1014, 325, 551, 1186, 270, 287, 368,
168671168701
/* 450 */ 510, 363, 509, 257, 71, 71, 543, 71, 71, 359,
168672
- /* 460 */ 316, 559, 1606, 122, 122, 122, 122, 121, 121, 120,
168702
+ /* 460 */ 316, 559, 1604, 122, 122, 122, 122, 121, 121, 120,
168673168703
/* 470 */ 120, 120, 119, 116, 444, 1014, 1014, 1016, 1017, 27,
168674
- /* 480 */ 284, 284, 1188, 1189, 1188, 1154, 568, 1605, 409, 899,
168675
- /* 490 */ 190, 550, 356, 565, 550, 935, 533, 517, 1154, 516,
168676
- /* 500 */ 413, 1154, 552, 1188, 1189, 1188, 568, 544, 1548, 51,
168677
- /* 510 */ 51, 214, 125, 126, 80, 1212, 1212, 1047, 1050, 1037,
168678
- /* 520 */ 1037, 123, 123, 124, 124, 124, 124, 1188, 474, 135,
168704
+ /* 480 */ 284, 284, 1186, 1187, 1186, 1152, 568, 1603, 409, 899,
168705
+ /* 490 */ 190, 550, 356, 565, 550, 935, 533, 517, 1152, 516,
168706
+ /* 500 */ 413, 1152, 552, 1186, 1187, 1186, 568, 544, 544, 51,
168707
+ /* 510 */ 51, 214, 125, 126, 80, 1210, 1210, 1047, 1050, 1037,
168708
+ /* 520 */ 1037, 123, 123, 124, 124, 124, 124, 1186, 474, 135,
168679168709
/* 530 */ 135, 409, 284, 284, 1484, 505, 121, 121, 120, 120,
168680
- /* 540 */ 120, 119, 116, 444, 1005, 565, 518, 217, 541, 1555,
168681
- /* 550 */ 316, 559, 142, 6, 532, 125, 126, 80, 1212, 1212,
168710
+ /* 540 */ 120, 119, 116, 444, 1005, 565, 518, 217, 541, 541,
168711
+ /* 550 */ 316, 559, 142, 6, 532, 125, 126, 80, 1210, 1210,
168682168712
/* 560 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168683
- /* 570 */ 1549, 122, 122, 122, 122, 121, 121, 120, 120, 120,
168684
- /* 580 */ 119, 116, 444, 485, 1188, 1189, 1188, 482, 281, 1263,
168685
- /* 590 */ 955, 252, 1188, 373, 504, 501, 500, 1188, 340, 570,
168686
- /* 600 */ 1188, 570, 409, 292, 499, 955, 874, 191, 480, 316,
168713
+ /* 570 */ 1548, 122, 122, 122, 122, 121, 121, 120, 120, 120,
168714
+ /* 580 */ 119, 116, 444, 485, 1186, 1187, 1186, 482, 281, 1263,
168715
+ /* 590 */ 955, 252, 1186, 373, 504, 501, 500, 1186, 340, 570,
168716
+ /* 600 */ 1186, 570, 409, 292, 499, 955, 874, 191, 480, 316,
168687168717
/* 610 */ 559, 384, 290, 380, 122, 122, 122, 122, 121, 121,
168688
- /* 620 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1212,
168689
- /* 630 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168690
- /* 640 */ 124, 409, 394, 1132, 1188, 867, 100, 284, 284, 1188,
168691
- /* 650 */ 1189, 1188, 373, 1089, 1188, 1189, 1188, 1188, 1189, 1188,
168692
- /* 660 */ 565, 455, 32, 373, 233, 125, 126, 80, 1212, 1212,
168718
+ /* 620 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1210,
168719
+ /* 630 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168720
+ /* 640 */ 124, 409, 394, 1132, 1186, 867, 100, 284, 284, 1186,
168721
+ /* 650 */ 1187, 1186, 373, 1089, 1186, 1187, 1186, 1186, 1187, 1186,
168722
+ /* 660 */ 565, 455, 32, 373, 233, 125, 126, 80, 1210, 1210,
168693168723
/* 670 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168694168724
/* 680 */ 1428, 957, 568, 228, 956, 122, 122, 122, 122, 121,
168695
- /* 690 */ 121, 120, 120, 120, 119, 116, 444, 1154, 228, 1188,
168696
- /* 700 */ 157, 1188, 1189, 1188, 1547, 13, 13, 301, 955, 1228,
168697
- /* 710 */ 1154, 153, 409, 1154, 373, 1577, 1172, 5, 369, 1574,
168698
- /* 720 */ 429, 1234, 3, 955, 122, 122, 122, 122, 121, 121,
168699
- /* 730 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1212,
168700
- /* 740 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168701
- /* 750 */ 124, 409, 208, 567, 1188, 1025, 1188, 1189, 1188, 1188,
168725
+ /* 690 */ 121, 120, 120, 120, 119, 116, 444, 1152, 228, 1186,
168726
+ /* 700 */ 157, 1186, 1187, 1186, 1547, 13, 13, 301, 955, 1226,
168727
+ /* 710 */ 1152, 153, 409, 1152, 373, 1575, 1170, 5, 369, 1572,
168728
+ /* 720 */ 429, 1232, 3, 955, 122, 122, 122, 122, 121, 121,
168729
+ /* 730 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1210,
168730
+ /* 740 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168731
+ /* 750 */ 124, 409, 208, 567, 1186, 1025, 1186, 1187, 1186, 1186,
168702168732
/* 760 */ 388, 850, 155, 1546, 286, 402, 1094, 1094, 488, 568,
168703
- /* 770 */ 465, 342, 1315, 1315, 1546, 125, 126, 80, 1212, 1212,
168733
+ /* 770 */ 465, 342, 1315, 1315, 1546, 125, 126, 80, 1210, 1210,
168704168734
/* 780 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168705168735
/* 790 */ 129, 568, 13, 13, 374, 122, 122, 122, 122, 121,
168706168736
/* 800 */ 121, 120, 120, 120, 119, 116, 444, 302, 568, 453,
168707
- /* 810 */ 528, 1188, 1189, 1188, 13, 13, 1188, 1189, 1188, 1293,
168737
+ /* 810 */ 528, 1186, 1187, 1186, 13, 13, 1186, 1187, 1186, 1293,
168708168738
/* 820 */ 463, 1263, 409, 1313, 1313, 1546, 1010, 453, 452, 200,
168709168739
/* 830 */ 299, 71, 71, 1261, 122, 122, 122, 122, 121, 121,
168710
- /* 840 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1212,
168711
- /* 850 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168712
- /* 860 */ 124, 409, 227, 1069, 1154, 284, 284, 419, 312, 278,
168713
- /* 870 */ 278, 285, 285, 1415, 406, 405, 382, 1154, 565, 568,
168714
- /* 880 */ 1154, 1191, 565, 1594, 565, 125, 126, 80, 1212, 1212,
168740
+ /* 840 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1210,
168741
+ /* 850 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168742
+ /* 860 */ 124, 409, 227, 1069, 1152, 284, 284, 419, 312, 278,
168743
+ /* 870 */ 278, 285, 285, 1415, 406, 405, 382, 1152, 565, 568,
168744
+ /* 880 */ 1152, 1189, 565, 1592, 565, 125, 126, 80, 1210, 1210,
168715168745
/* 890 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168716168746
/* 900 */ 453, 1476, 13, 13, 1530, 122, 122, 122, 122, 121,
168717168747
/* 910 */ 121, 120, 120, 120, 119, 116, 444, 201, 568, 354,
168718
- /* 920 */ 1580, 574, 2, 1241, 838, 839, 840, 1556, 317, 1207,
168719
- /* 930 */ 146, 6, 409, 255, 254, 253, 206, 1323, 9, 1191,
168748
+ /* 920 */ 1578, 574, 2, 1241, 838, 839, 840, 1554, 317, 1205,
168749
+ /* 930 */ 146, 6, 409, 255, 254, 253, 206, 1323, 9, 1189,
168720168750
/* 940 */ 262, 71, 71, 424, 122, 122, 122, 122, 121, 121,
168721
- /* 950 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1212,
168722
- /* 960 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168723
- /* 970 */ 124, 568, 284, 284, 568, 1208, 409, 573, 313, 1241,
168724
- /* 980 */ 349, 1292, 352, 419, 317, 565, 146, 491, 525, 1637,
168751
+ /* 950 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1210,
168752
+ /* 960 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168753
+ /* 970 */ 124, 568, 284, 284, 568, 1206, 409, 573, 313, 1241,
168754
+ /* 980 */ 349, 1292, 352, 419, 317, 565, 146, 491, 525, 1635,
168725168755
/* 990 */ 395, 371, 491, 1323, 70, 70, 1291, 71, 71, 240,
168726
- /* 1000 */ 1321, 104, 80, 1212, 1212, 1047, 1050, 1037, 1037, 123,
168756
+ /* 1000 */ 1321, 104, 80, 1210, 1210, 1047, 1050, 1037, 1037, 123,
168727168757
/* 1010 */ 123, 124, 124, 124, 124, 122, 122, 122, 122, 121,
168728168758
/* 1020 */ 121, 120, 120, 120, 119, 116, 444, 1110, 284, 284,
168729
- /* 1030 */ 428, 448, 1519, 1208, 439, 284, 284, 1483, 1348, 311,
168759
+ /* 1030 */ 428, 448, 1519, 1206, 439, 284, 284, 1483, 1348, 311,
168730168760
/* 1040 */ 474, 565, 1111, 969, 491, 491, 217, 1259, 565, 1532,
168731168761
/* 1050 */ 568, 970, 207, 568, 1024, 240, 383, 1112, 519, 122,
168732168762
/* 1060 */ 122, 122, 122, 121, 121, 120, 120, 120, 119, 116,
168733168763
/* 1070 */ 444, 1015, 107, 71, 71, 1014, 13, 13, 910, 568,
168734168764
/* 1080 */ 1489, 568, 284, 284, 97, 526, 491, 448, 911, 1322,
168735168765
/* 1090 */ 1318, 545, 409, 284, 284, 565, 151, 209, 1489, 1491,
168736168766
/* 1100 */ 262, 450, 55, 55, 56, 56, 565, 1014, 1014, 1016,
168737
- /* 1110 */ 443, 332, 409, 527, 12, 295, 125, 126, 80, 1212,
168738
- /* 1120 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168739
- /* 1130 */ 124, 347, 409, 862, 1528, 1208, 125, 126, 80, 1212,
168740
- /* 1140 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168741
- /* 1150 */ 124, 1133, 1635, 474, 1635, 371, 125, 114, 80, 1212,
168742
- /* 1160 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168767
+ /* 1110 */ 443, 332, 409, 527, 12, 295, 125, 126, 80, 1210,
168768
+ /* 1120 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168769
+ /* 1130 */ 124, 347, 409, 862, 1528, 1206, 125, 126, 80, 1210,
168770
+ /* 1140 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168771
+ /* 1150 */ 124, 1133, 1633, 474, 1633, 371, 125, 114, 80, 1210,
168772
+ /* 1160 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168743168773
/* 1170 */ 124, 1489, 329, 474, 331, 122, 122, 122, 122, 121,
168744168774
/* 1180 */ 121, 120, 120, 120, 119, 116, 444, 203, 1415, 568,
168745
- /* 1190 */ 1290, 862, 464, 1208, 436, 122, 122, 122, 122, 121,
168746
- /* 1200 */ 121, 120, 120, 120, 119, 116, 444, 553, 1133, 1636,
168747
- /* 1210 */ 539, 1636, 15, 15, 890, 122, 122, 122, 122, 121,
168775
+ /* 1190 */ 1290, 862, 464, 1206, 436, 122, 122, 122, 122, 121,
168776
+ /* 1200 */ 121, 120, 120, 120, 119, 116, 444, 553, 1133, 1634,
168777
+ /* 1210 */ 539, 1634, 15, 15, 890, 122, 122, 122, 122, 121,
168748168778
/* 1220 */ 121, 120, 120, 120, 119, 116, 444, 568, 298, 538,
168749
- /* 1230 */ 1131, 1415, 1553, 1554, 1327, 409, 6, 6, 1165, 1264,
168779
+ /* 1230 */ 1131, 1415, 1552, 1553, 1327, 409, 6, 6, 1163, 1264,
168750168780
/* 1240 */ 415, 320, 284, 284, 1415, 508, 565, 525, 300, 457,
168751168781
/* 1250 */ 43, 43, 568, 891, 12, 565, 330, 478, 425, 407,
168752
- /* 1260 */ 126, 80, 1212, 1212, 1047, 1050, 1037, 1037, 123, 123,
168753
- /* 1270 */ 124, 124, 124, 124, 568, 57, 57, 288, 1188, 1415,
168754
- /* 1280 */ 496, 458, 392, 392, 391, 273, 389, 1131, 1552, 847,
168755
- /* 1290 */ 1165, 407, 6, 568, 321, 1154, 470, 44, 44, 1551,
168756
- /* 1300 */ 1110, 426, 234, 6, 323, 256, 540, 256, 1154, 431,
168757
- /* 1310 */ 568, 1154, 322, 17, 487, 1111, 58, 58, 122, 122,
168782
+ /* 1260 */ 126, 80, 1210, 1210, 1047, 1050, 1037, 1037, 123, 123,
168783
+ /* 1270 */ 124, 124, 124, 124, 568, 57, 57, 288, 1186, 1415,
168784
+ /* 1280 */ 496, 458, 392, 392, 391, 273, 389, 1131, 1551, 847,
168785
+ /* 1290 */ 1163, 407, 6, 568, 321, 1152, 470, 44, 44, 1550,
168786
+ /* 1300 */ 1110, 426, 234, 6, 323, 256, 540, 256, 1152, 431,
168787
+ /* 1310 */ 568, 1152, 322, 17, 487, 1111, 58, 58, 122, 122,
168758168788
/* 1320 */ 122, 122, 121, 121, 120, 120, 120, 119, 116, 444,
168759
- /* 1330 */ 1112, 216, 481, 59, 59, 1188, 1189, 1188, 111, 560,
168789
+ /* 1330 */ 1112, 216, 481, 59, 59, 1186, 1187, 1186, 111, 560,
168760168790
/* 1340 */ 324, 4, 236, 456, 526, 568, 237, 456, 568, 437,
168761168791
/* 1350 */ 168, 556, 420, 141, 479, 563, 568, 293, 568, 1091,
168762168792
/* 1360 */ 568, 293, 568, 1091, 531, 568, 870, 8, 60, 60,
168763168793
/* 1370 */ 235, 61, 61, 568, 414, 568, 414, 568, 445, 62,
168764168794
/* 1380 */ 62, 45, 45, 46, 46, 47, 47, 199, 49, 49,
@@ -168768,73 +168798,73 @@
168768168798
/* 1420 */ 568, 512, 930, 870, 1015, 109, 109, 929, 1014, 66,
168769168799
/* 1430 */ 66, 131, 131, 110, 451, 445, 569, 445, 416, 177,
168770168800
/* 1440 */ 1014, 132, 132, 67, 67, 568, 467, 568, 930, 471,
168771168801
/* 1450 */ 1360, 283, 226, 929, 315, 1359, 407, 568, 459, 407,
168772168802
/* 1460 */ 1014, 1014, 1016, 239, 407, 86, 213, 1346, 52, 52,
168773
- /* 1470 */ 68, 68, 1014, 1014, 1016, 1017, 27, 1579, 1176, 447,
168803
+ /* 1470 */ 68, 68, 1014, 1014, 1016, 1017, 27, 1577, 1174, 447,
168774168804
/* 1480 */ 69, 69, 288, 97, 108, 1535, 106, 392, 392, 391,
168775168805
/* 1490 */ 273, 389, 568, 877, 847, 881, 568, 111, 560, 466,
168776168806
/* 1500 */ 4, 568, 152, 30, 38, 568, 1128, 234, 396, 323,
168777168807
/* 1510 */ 111, 560, 527, 4, 563, 53, 53, 322, 568, 163,
168778168808
/* 1520 */ 163, 568, 337, 468, 164, 164, 333, 563, 76, 76,
168779168809
/* 1530 */ 568, 289, 1508, 568, 31, 1507, 568, 445, 338, 483,
168780168810
/* 1540 */ 100, 54, 54, 344, 72, 72, 296, 236, 1076, 557,
168781168811
/* 1550 */ 445, 877, 1356, 134, 134, 168, 73, 73, 141, 161,
168782
- /* 1560 */ 161, 1568, 557, 535, 568, 319, 568, 348, 536, 1007,
168812
+ /* 1560 */ 161, 1566, 557, 535, 568, 319, 568, 348, 536, 1007,
168783168813
/* 1570 */ 473, 261, 261, 889, 888, 235, 535, 568, 1024, 568,
168784168814
/* 1580 */ 475, 534, 261, 367, 109, 109, 521, 136, 136, 130,
168785168815
/* 1590 */ 130, 1024, 110, 366, 445, 569, 445, 109, 109, 1014,
168786168816
/* 1600 */ 162, 162, 156, 156, 568, 110, 1076, 445, 569, 445,
168787168817
/* 1610 */ 410, 351, 1014, 568, 353, 316, 559, 568, 343, 568,
168788168818
/* 1620 */ 100, 497, 357, 258, 100, 896, 897, 140, 140, 355,
168789168819
/* 1630 */ 1306, 1014, 1014, 1016, 1017, 27, 139, 139, 362, 451,
168790
- /* 1640 */ 137, 137, 138, 138, 1014, 1014, 1016, 1017, 27, 1176,
168820
+ /* 1640 */ 137, 137, 138, 138, 1014, 1014, 1016, 1017, 27, 1174,
168791168821
/* 1650 */ 447, 568, 372, 288, 111, 560, 1018, 4, 392, 392,
168792168822
/* 1660 */ 391, 273, 389, 568, 1137, 847, 568, 1072, 568, 258,
168793168823
/* 1670 */ 492, 563, 568, 211, 75, 75, 555, 960, 234, 261,
168794168824
/* 1680 */ 323, 111, 560, 927, 4, 113, 77, 77, 322, 74,
168795168825
/* 1690 */ 74, 42, 42, 1369, 445, 48, 48, 1414, 563, 972,
168796168826
/* 1700 */ 973, 1088, 1087, 1088, 1087, 860, 557, 150, 928, 1342,
168797168827
/* 1710 */ 113, 1354, 554, 1419, 1018, 1271, 1262, 1250, 236, 1249,
168798
- /* 1720 */ 1251, 445, 1587, 1339, 308, 276, 168, 309, 11, 141,
168828
+ /* 1720 */ 1251, 445, 1585, 1339, 308, 276, 168, 309, 11, 141,
168799168829
/* 1730 */ 393, 310, 232, 557, 1401, 1024, 335, 291, 1396, 219,
168800168830
/* 1740 */ 336, 109, 109, 934, 297, 1406, 235, 341, 477, 110,
168801168831
/* 1750 */ 502, 445, 569, 445, 1389, 1405, 1014, 400, 1289, 365,
168802168832
/* 1760 */ 223, 1480, 1024, 1479, 1351, 1352, 1350, 1349, 109, 109,
168803
- /* 1770 */ 204, 1590, 1228, 558, 265, 218, 110, 205, 445, 569,
168833
+ /* 1770 */ 204, 1588, 1226, 558, 265, 218, 110, 205, 445, 569,
168804168834
/* 1780 */ 445, 410, 387, 1014, 1527, 179, 316, 559, 1014, 1014,
168805
- /* 1790 */ 1016, 1017, 27, 230, 1525, 1225, 79, 560, 85, 4,
168835
+ /* 1790 */ 1016, 1017, 27, 230, 1525, 1223, 79, 560, 85, 4,
168806168836
/* 1800 */ 418, 215, 548, 81, 84, 188, 1402, 173, 181, 461,
168807168837
/* 1810 */ 451, 35, 462, 563, 183, 1014, 1014, 1016, 1017, 27,
168808168838
/* 1820 */ 184, 1485, 185, 186, 495, 242, 98, 398, 1408, 36,
168809168839
/* 1830 */ 1407, 484, 91, 469, 401, 1410, 445, 192, 1474, 246,
168810168840
/* 1840 */ 1496, 490, 346, 277, 248, 196, 493, 511, 557, 350,
168811168841
/* 1850 */ 1252, 249, 250, 403, 1309, 1308, 111, 560, 432, 4,
168812
- /* 1860 */ 1307, 1300, 93, 1604, 881, 1603, 224, 404, 434, 520,
168813
- /* 1870 */ 263, 435, 1573, 563, 1279, 1278, 364, 1024, 306, 1277,
168814
- /* 1880 */ 264, 1602, 1559, 109, 109, 370, 1299, 307, 1558, 438,
168842
+ /* 1860 */ 1307, 1300, 93, 1602, 881, 1601, 224, 404, 434, 520,
168843
+ /* 1870 */ 263, 435, 1571, 563, 1279, 1278, 364, 1024, 306, 1277,
168844
+ /* 1880 */ 264, 1600, 1557, 109, 109, 370, 1299, 307, 1556, 438,
168815168845
/* 1890 */ 128, 110, 1374, 445, 569, 445, 445, 546, 1014, 10,
168816168846
/* 1900 */ 1461, 105, 381, 1373, 34, 571, 99, 1332, 557, 314,
168817
- /* 1910 */ 1182, 530, 272, 274, 379, 210, 1331, 547, 385, 386,
168847
+ /* 1910 */ 1180, 530, 272, 274, 379, 210, 1331, 547, 385, 386,
168818168848
/* 1920 */ 275, 572, 1247, 1242, 411, 412, 1512, 165, 178, 1513,
168819168849
/* 1930 */ 1014, 1014, 1016, 1017, 27, 1511, 1510, 1024, 78, 147,
168820168850
/* 1940 */ 166, 220, 221, 109, 109, 834, 304, 167, 446, 212,
168821168851
/* 1950 */ 318, 110, 231, 445, 569, 445, 144, 1086, 1014, 1084,
168822
- /* 1960 */ 326, 180, 169, 1207, 182, 334, 238, 913, 241, 1100,
168852
+ /* 1960 */ 326, 180, 169, 1205, 182, 334, 238, 913, 241, 1100,
168823168853
/* 1970 */ 187, 170, 171, 421, 87, 88, 423, 189, 89, 90,
168824168854
/* 1980 */ 172, 1103, 243, 1099, 244, 158, 18, 245, 345, 247,
168825
- /* 1990 */ 1014, 1014, 1016, 1017, 27, 261, 1092, 193, 1222, 489,
168855
+ /* 1990 */ 1014, 1014, 1016, 1017, 27, 261, 1092, 193, 1220, 489,
168826168856
/* 2000 */ 194, 37, 366, 849, 494, 251, 195, 506, 92, 19,
168827168857
/* 2010 */ 498, 358, 20, 503, 879, 361, 94, 892, 305, 159,
168828
- /* 2020 */ 513, 39, 95, 1170, 160, 1053, 964, 1139, 96, 174,
168829
- /* 2030 */ 1138, 225, 280, 282, 198, 958, 113, 1160, 1156, 260,
168830
- /* 2040 */ 21, 22, 23, 1158, 1164, 1163, 1144, 24, 33, 25,
168858
+ /* 2020 */ 513, 39, 95, 1168, 160, 1053, 964, 1139, 96, 174,
168859
+ /* 2030 */ 1138, 225, 280, 282, 198, 958, 113, 1158, 1154, 260,
168860
+ /* 2040 */ 21, 22, 23, 1156, 1162, 1161, 1143, 24, 33, 25,
168831168861
/* 2050 */ 202, 542, 26, 100, 1067, 102, 1054, 103, 7, 1052,
168832168862
/* 2060 */ 1056, 1109, 1057, 1108, 266, 267, 28, 40, 390, 1019,
168833
- /* 2070 */ 861, 112, 29, 564, 1178, 1177, 268, 176, 143, 923,
168863
+ /* 2070 */ 861, 112, 29, 564, 1176, 1175, 268, 176, 143, 923,
168834168864
/* 2080 */ 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238,
168835
- /* 2090 */ 1238, 1238, 1238, 1238, 269, 1595,
168865
+ /* 2090 */ 1238, 1238, 1238, 1238, 269, 1593,
168836168866
};
168837168867
static const YYCODETYPE yy_lookahead[] = {
168838168868
/* 0 */ 193, 193, 193, 274, 275, 276, 193, 274, 275, 276,
168839168869
/* 10 */ 193, 223, 219, 225, 206, 210, 211, 212, 193, 19,
168840168870
/* 20 */ 219, 233, 216, 216, 217, 216, 217, 193, 295, 216,
@@ -169173,67 +169203,67 @@
169173169203
/* 380 */ 1665, 1623, 1702, 1630, 1666, 1667, 1671, 1673, 1703, 1718,
169174169204
/* 390 */ 1719, 1729, 1730, 1731, 1621, 1622, 1628, 1720, 1713, 1716,
169175169205
/* 400 */ 1722, 1723, 1733, 1717, 1724, 1727, 1728, 1725, 1740,
169176169206
};
169177169207
static const YYACTIONTYPE yy_default[] = {
169178
- /* 0 */ 1641, 1641, 1641, 1469, 1236, 1347, 1236, 1236, 1236, 1469,
169208
+ /* 0 */ 1639, 1639, 1639, 1469, 1236, 1347, 1236, 1236, 1236, 1469,
169179169209
/* 10 */ 1469, 1469, 1236, 1377, 1377, 1522, 1269, 1236, 1236, 1236,
169180169210
/* 20 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1468, 1236, 1236,
169181
- /* 30 */ 1236, 1236, 1557, 1557, 1236, 1236, 1236, 1236, 1236, 1236,
169211
+ /* 30 */ 1236, 1236, 1555, 1555, 1236, 1236, 1236, 1236, 1236, 1236,
169182169212
/* 40 */ 1236, 1236, 1386, 1236, 1393, 1236, 1236, 1236, 1236, 1236,
169183169213
/* 50 */ 1470, 1471, 1236, 1236, 1236, 1521, 1523, 1486, 1400, 1399,
169184169214
/* 60 */ 1398, 1397, 1504, 1365, 1391, 1384, 1388, 1465, 1466, 1464,
169185
- /* 70 */ 1619, 1471, 1470, 1236, 1387, 1433, 1449, 1432, 1236, 1236,
169215
+ /* 70 */ 1617, 1471, 1470, 1236, 1387, 1433, 1449, 1432, 1236, 1236,
169186169216
/* 80 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169187169217
/* 90 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169188169218
/* 100 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169189169219
/* 110 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169190169220
/* 120 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169191169221
/* 130 */ 1441, 1448, 1447, 1446, 1455, 1445, 1442, 1435, 1434, 1436,
169192169222
/* 140 */ 1437, 1236, 1236, 1260, 1236, 1236, 1257, 1311, 1236, 1236,
169193169223
/* 150 */ 1236, 1236, 1236, 1541, 1540, 1236, 1438, 1236, 1269, 1427,
169194
- /* 160 */ 1426, 1452, 1439, 1451, 1450, 1529, 1593, 1592, 1487, 1236,
169195
- /* 170 */ 1236, 1236, 1236, 1236, 1236, 1557, 1236, 1236, 1236, 1236,
169224
+ /* 160 */ 1426, 1452, 1439, 1451, 1450, 1529, 1591, 1590, 1487, 1236,
169225
+ /* 170 */ 1236, 1236, 1236, 1236, 1236, 1555, 1236, 1236, 1236, 1236,
169196169226
/* 180 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169197169227
/* 190 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1367,
169198
- /* 200 */ 1557, 1557, 1236, 1269, 1557, 1557, 1368, 1368, 1265, 1265,
169228
+ /* 200 */ 1555, 1555, 1236, 1269, 1555, 1555, 1368, 1368, 1265, 1265,
169199169229
/* 210 */ 1371, 1236, 1536, 1338, 1338, 1338, 1338, 1347, 1338, 1236,
169200169230
/* 220 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169201169231
/* 230 */ 1236, 1236, 1236, 1236, 1526, 1524, 1236, 1236, 1236, 1236,
169202169232
/* 240 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169203169233
/* 250 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169204169234
/* 260 */ 1236, 1236, 1236, 1343, 1236, 1236, 1236, 1236, 1236, 1236,
169205
- /* 270 */ 1236, 1236, 1236, 1236, 1236, 1586, 1236, 1499, 1325, 1343,
169206
- /* 280 */ 1343, 1343, 1343, 1345, 1326, 1324, 1337, 1270, 1243, 1633,
169207
- /* 290 */ 1403, 1392, 1344, 1392, 1630, 1390, 1403, 1403, 1390, 1403,
169208
- /* 300 */ 1344, 1630, 1286, 1608, 1281, 1377, 1377, 1377, 1367, 1367,
169209
- /* 310 */ 1367, 1367, 1371, 1371, 1467, 1344, 1337, 1236, 1633, 1633,
169210
- /* 320 */ 1353, 1353, 1632, 1632, 1353, 1487, 1616, 1412, 1314, 1320,
169211
- /* 330 */ 1320, 1320, 1320, 1353, 1254, 1390, 1616, 1616, 1390, 1412,
169212
- /* 340 */ 1314, 1390, 1314, 1390, 1353, 1254, 1503, 1627, 1353, 1254,
169235
+ /* 270 */ 1236, 1236, 1236, 1236, 1236, 1584, 1236, 1499, 1325, 1343,
169236
+ /* 280 */ 1343, 1343, 1343, 1345, 1326, 1324, 1337, 1270, 1243, 1631,
169237
+ /* 290 */ 1403, 1392, 1344, 1392, 1628, 1390, 1403, 1403, 1390, 1403,
169238
+ /* 300 */ 1344, 1628, 1286, 1606, 1281, 1377, 1377, 1377, 1367, 1367,
169239
+ /* 310 */ 1367, 1367, 1371, 1371, 1467, 1344, 1337, 1236, 1631, 1631,
169240
+ /* 320 */ 1353, 1353, 1630, 1630, 1353, 1487, 1614, 1412, 1314, 1320,
169241
+ /* 330 */ 1320, 1320, 1320, 1353, 1254, 1390, 1614, 1614, 1390, 1412,
169242
+ /* 340 */ 1314, 1390, 1314, 1390, 1353, 1254, 1503, 1625, 1353, 1254,
169213169243
/* 350 */ 1477, 1353, 1254, 1353, 1254, 1477, 1312, 1312, 1312, 1301,
169214
- /* 360 */ 1236, 1236, 1477, 1312, 1286, 1312, 1301, 1312, 1312, 1575,
169215
- /* 370 */ 1236, 1481, 1481, 1477, 1353, 1567, 1567, 1380, 1380, 1385,
169216
- /* 380 */ 1371, 1472, 1353, 1236, 1385, 1383, 1381, 1390, 1304, 1589,
169217
- /* 390 */ 1589, 1585, 1585, 1585, 1638, 1638, 1536, 1601, 1269, 1269,
169218
- /* 400 */ 1269, 1269, 1601, 1288, 1288, 1270, 1270, 1269, 1601, 1236,
169219
- /* 410 */ 1236, 1236, 1236, 1236, 1236, 1596, 1236, 1531, 1488, 1357,
169244
+ /* 360 */ 1236, 1236, 1477, 1312, 1286, 1312, 1301, 1312, 1312, 1573,
169245
+ /* 370 */ 1236, 1481, 1481, 1477, 1353, 1565, 1565, 1380, 1380, 1385,
169246
+ /* 380 */ 1371, 1472, 1353, 1236, 1385, 1383, 1381, 1390, 1304, 1587,
169247
+ /* 390 */ 1587, 1583, 1583, 1583, 1636, 1636, 1536, 1599, 1269, 1269,
169248
+ /* 400 */ 1269, 1269, 1599, 1288, 1288, 1270, 1270, 1269, 1599, 1236,
169249
+ /* 410 */ 1236, 1236, 1236, 1236, 1236, 1594, 1236, 1531, 1488, 1357,
169220169250
/* 420 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169221169251
/* 430 */ 1236, 1236, 1236, 1236, 1542, 1236, 1236, 1236, 1236, 1236,
169222169252
/* 440 */ 1236, 1236, 1236, 1236, 1236, 1417, 1236, 1239, 1533, 1236,
169223169253
/* 450 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1394, 1395, 1358,
169224169254
/* 460 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1409, 1236, 1236,
169225169255
/* 470 */ 1236, 1404, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169226
- /* 480 */ 1629, 1236, 1236, 1236, 1236, 1236, 1236, 1502, 1501, 1236,
169256
+ /* 480 */ 1627, 1236, 1236, 1236, 1236, 1236, 1236, 1502, 1501, 1236,
169227169257
/* 490 */ 1236, 1355, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169228169258
/* 500 */ 1236, 1236, 1236, 1236, 1236, 1284, 1236, 1236, 1236, 1236,
169229169259
/* 510 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169230169260
/* 520 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1382,
169231169261
/* 530 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169232
- /* 540 */ 1236, 1236, 1236, 1236, 1572, 1372, 1236, 1236, 1236, 1236,
169233
- /* 550 */ 1620, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169234
- /* 560 */ 1236, 1236, 1236, 1236, 1236, 1612, 1328, 1418, 1236, 1421,
169262
+ /* 540 */ 1236, 1236, 1236, 1236, 1570, 1372, 1236, 1236, 1236, 1236,
169263
+ /* 550 */ 1618, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169264
+ /* 560 */ 1236, 1236, 1236, 1236, 1236, 1610, 1328, 1418, 1236, 1421,
169235169265
/* 570 */ 1258, 1236, 1248, 1236, 1236,
169236169266
};
169237169267
/********** End of lemon-generated parsing tables *****************************/
169238169268
169239169269
/* The next table maps tokens (terminal symbols) into fallback tokens.
@@ -170158,104 +170188,104 @@
170158170188
/* 304 */ "wqas ::= AS MATERIALIZED",
170159170189
/* 305 */ "wqas ::= AS NOT MATERIALIZED",
170160170190
/* 306 */ "wqitem ::= nm eidlist_opt wqas LP select RP",
170161170191
/* 307 */ "wqlist ::= wqitem",
170162170192
/* 308 */ "wqlist ::= wqlist COMMA wqitem",
170163
- /* 309 */ "windowdefn_list ::= windowdefn",
170164
- /* 310 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
170165
- /* 311 */ "windowdefn ::= nm AS LP window RP",
170166
- /* 312 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
170167
- /* 313 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
170168
- /* 314 */ "window ::= ORDER BY sortlist frame_opt",
170169
- /* 315 */ "window ::= nm ORDER BY sortlist frame_opt",
170170
- /* 316 */ "window ::= frame_opt",
170171
- /* 317 */ "window ::= nm frame_opt",
170172
- /* 318 */ "frame_opt ::=",
170173
- /* 319 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
170174
- /* 320 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
170175
- /* 321 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
170176
- /* 322 */ "frame_bound_s ::= frame_bound",
170177
- /* 323 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
170178
- /* 324 */ "frame_bound_e ::= frame_bound",
170179
- /* 325 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
170180
- /* 326 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
170181
- /* 327 */ "frame_bound ::= CURRENT ROW",
170182
- /* 328 */ "frame_exclude_opt ::=",
170183
- /* 329 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
170184
- /* 330 */ "frame_exclude ::= NO OTHERS",
170185
- /* 331 */ "frame_exclude ::= CURRENT ROW",
170186
- /* 332 */ "frame_exclude ::= GROUP|TIES",
170187
- /* 333 */ "window_clause ::= WINDOW windowdefn_list",
170188
- /* 334 */ "filter_over ::= filter_clause over_clause",
170189
- /* 335 */ "filter_over ::= over_clause",
170190
- /* 336 */ "filter_over ::= filter_clause",
170191
- /* 337 */ "over_clause ::= OVER LP window RP",
170192
- /* 338 */ "over_clause ::= OVER nm",
170193
- /* 339 */ "filter_clause ::= FILTER LP WHERE expr RP",
170194
- /* 340 */ "input ::= cmdlist",
170195
- /* 341 */ "cmdlist ::= cmdlist ecmd",
170196
- /* 342 */ "cmdlist ::= ecmd",
170197
- /* 343 */ "ecmd ::= SEMI",
170198
- /* 344 */ "ecmd ::= cmdx SEMI",
170199
- /* 345 */ "ecmd ::= explain cmdx SEMI",
170200
- /* 346 */ "trans_opt ::=",
170201
- /* 347 */ "trans_opt ::= TRANSACTION",
170202
- /* 348 */ "trans_opt ::= TRANSACTION nm",
170203
- /* 349 */ "savepoint_opt ::= SAVEPOINT",
170204
- /* 350 */ "savepoint_opt ::=",
170205
- /* 351 */ "cmd ::= create_table create_table_args",
170206
- /* 352 */ "table_option_set ::= table_option",
170207
- /* 353 */ "columnlist ::= columnlist COMMA columnname carglist",
170208
- /* 354 */ "columnlist ::= columnname carglist",
170209
- /* 355 */ "nm ::= ID|INDEXED|JOIN_KW",
170210
- /* 356 */ "nm ::= STRING",
170211
- /* 357 */ "typetoken ::= typename",
170212
- /* 358 */ "typename ::= ID|STRING",
170213
- /* 359 */ "signed ::= plus_num",
170214
- /* 360 */ "signed ::= minus_num",
170215
- /* 361 */ "carglist ::= carglist ccons",
170216
- /* 362 */ "carglist ::=",
170217
- /* 363 */ "ccons ::= NULL onconf",
170218
- /* 364 */ "ccons ::= GENERATED ALWAYS AS generated",
170219
- /* 365 */ "ccons ::= AS generated",
170220
- /* 366 */ "conslist_opt ::= COMMA conslist",
170221
- /* 367 */ "conslist ::= conslist tconscomma tcons",
170222
- /* 368 */ "conslist ::= tcons",
170223
- /* 369 */ "tconscomma ::=",
170224
- /* 370 */ "defer_subclause_opt ::= defer_subclause",
170225
- /* 371 */ "resolvetype ::= raisetype",
170226
- /* 372 */ "selectnowith ::= oneselect",
170227
- /* 373 */ "oneselect ::= values",
170228
- /* 374 */ "sclp ::= selcollist COMMA",
170229
- /* 375 */ "as ::= ID|STRING",
170230
- /* 376 */ "indexed_opt ::= indexed_by",
170231
- /* 377 */ "returning ::=",
170232
- /* 378 */ "expr ::= term",
170233
- /* 379 */ "likeop ::= LIKE_KW|MATCH",
170234
- /* 380 */ "case_operand ::= expr",
170235
- /* 381 */ "exprlist ::= nexprlist",
170236
- /* 382 */ "nmnum ::= plus_num",
170237
- /* 383 */ "nmnum ::= nm",
170238
- /* 384 */ "nmnum ::= ON",
170239
- /* 385 */ "nmnum ::= DELETE",
170240
- /* 386 */ "nmnum ::= DEFAULT",
170241
- /* 387 */ "plus_num ::= INTEGER|FLOAT",
170242
- /* 388 */ "foreach_clause ::=",
170243
- /* 389 */ "foreach_clause ::= FOR EACH ROW",
170244
- /* 390 */ "trnm ::= nm",
170245
- /* 391 */ "tridxby ::=",
170246
- /* 392 */ "database_kw_opt ::= DATABASE",
170247
- /* 393 */ "database_kw_opt ::=",
170248
- /* 394 */ "kwcolumn_opt ::=",
170249
- /* 395 */ "kwcolumn_opt ::= COLUMNKW",
170250
- /* 396 */ "vtabarglist ::= vtabarg",
170251
- /* 397 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
170252
- /* 398 */ "vtabarg ::= vtabarg vtabargtoken",
170253
- /* 399 */ "anylist ::=",
170254
- /* 400 */ "anylist ::= anylist LP anylist RP",
170255
- /* 401 */ "anylist ::= anylist ANY",
170256
- /* 402 */ "with ::=",
170193
+ /* 309 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
170194
+ /* 310 */ "windowdefn ::= nm AS LP window RP",
170195
+ /* 311 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
170196
+ /* 312 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
170197
+ /* 313 */ "window ::= ORDER BY sortlist frame_opt",
170198
+ /* 314 */ "window ::= nm ORDER BY sortlist frame_opt",
170199
+ /* 315 */ "window ::= nm frame_opt",
170200
+ /* 316 */ "frame_opt ::=",
170201
+ /* 317 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
170202
+ /* 318 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
170203
+ /* 319 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
170204
+ /* 320 */ "frame_bound_s ::= frame_bound",
170205
+ /* 321 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
170206
+ /* 322 */ "frame_bound_e ::= frame_bound",
170207
+ /* 323 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
170208
+ /* 324 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
170209
+ /* 325 */ "frame_bound ::= CURRENT ROW",
170210
+ /* 326 */ "frame_exclude_opt ::=",
170211
+ /* 327 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
170212
+ /* 328 */ "frame_exclude ::= NO OTHERS",
170213
+ /* 329 */ "frame_exclude ::= CURRENT ROW",
170214
+ /* 330 */ "frame_exclude ::= GROUP|TIES",
170215
+ /* 331 */ "window_clause ::= WINDOW windowdefn_list",
170216
+ /* 332 */ "filter_over ::= filter_clause over_clause",
170217
+ /* 333 */ "filter_over ::= over_clause",
170218
+ /* 334 */ "filter_over ::= filter_clause",
170219
+ /* 335 */ "over_clause ::= OVER LP window RP",
170220
+ /* 336 */ "over_clause ::= OVER nm",
170221
+ /* 337 */ "filter_clause ::= FILTER LP WHERE expr RP",
170222
+ /* 338 */ "input ::= cmdlist",
170223
+ /* 339 */ "cmdlist ::= cmdlist ecmd",
170224
+ /* 340 */ "cmdlist ::= ecmd",
170225
+ /* 341 */ "ecmd ::= SEMI",
170226
+ /* 342 */ "ecmd ::= cmdx SEMI",
170227
+ /* 343 */ "ecmd ::= explain cmdx SEMI",
170228
+ /* 344 */ "trans_opt ::=",
170229
+ /* 345 */ "trans_opt ::= TRANSACTION",
170230
+ /* 346 */ "trans_opt ::= TRANSACTION nm",
170231
+ /* 347 */ "savepoint_opt ::= SAVEPOINT",
170232
+ /* 348 */ "savepoint_opt ::=",
170233
+ /* 349 */ "cmd ::= create_table create_table_args",
170234
+ /* 350 */ "table_option_set ::= table_option",
170235
+ /* 351 */ "columnlist ::= columnlist COMMA columnname carglist",
170236
+ /* 352 */ "columnlist ::= columnname carglist",
170237
+ /* 353 */ "nm ::= ID|INDEXED|JOIN_KW",
170238
+ /* 354 */ "nm ::= STRING",
170239
+ /* 355 */ "typetoken ::= typename",
170240
+ /* 356 */ "typename ::= ID|STRING",
170241
+ /* 357 */ "signed ::= plus_num",
170242
+ /* 358 */ "signed ::= minus_num",
170243
+ /* 359 */ "carglist ::= carglist ccons",
170244
+ /* 360 */ "carglist ::=",
170245
+ /* 361 */ "ccons ::= NULL onconf",
170246
+ /* 362 */ "ccons ::= GENERATED ALWAYS AS generated",
170247
+ /* 363 */ "ccons ::= AS generated",
170248
+ /* 364 */ "conslist_opt ::= COMMA conslist",
170249
+ /* 365 */ "conslist ::= conslist tconscomma tcons",
170250
+ /* 366 */ "conslist ::= tcons",
170251
+ /* 367 */ "tconscomma ::=",
170252
+ /* 368 */ "defer_subclause_opt ::= defer_subclause",
170253
+ /* 369 */ "resolvetype ::= raisetype",
170254
+ /* 370 */ "selectnowith ::= oneselect",
170255
+ /* 371 */ "oneselect ::= values",
170256
+ /* 372 */ "sclp ::= selcollist COMMA",
170257
+ /* 373 */ "as ::= ID|STRING",
170258
+ /* 374 */ "indexed_opt ::= indexed_by",
170259
+ /* 375 */ "returning ::=",
170260
+ /* 376 */ "expr ::= term",
170261
+ /* 377 */ "likeop ::= LIKE_KW|MATCH",
170262
+ /* 378 */ "case_operand ::= expr",
170263
+ /* 379 */ "exprlist ::= nexprlist",
170264
+ /* 380 */ "nmnum ::= plus_num",
170265
+ /* 381 */ "nmnum ::= nm",
170266
+ /* 382 */ "nmnum ::= ON",
170267
+ /* 383 */ "nmnum ::= DELETE",
170268
+ /* 384 */ "nmnum ::= DEFAULT",
170269
+ /* 385 */ "plus_num ::= INTEGER|FLOAT",
170270
+ /* 386 */ "foreach_clause ::=",
170271
+ /* 387 */ "foreach_clause ::= FOR EACH ROW",
170272
+ /* 388 */ "trnm ::= nm",
170273
+ /* 389 */ "tridxby ::=",
170274
+ /* 390 */ "database_kw_opt ::= DATABASE",
170275
+ /* 391 */ "database_kw_opt ::=",
170276
+ /* 392 */ "kwcolumn_opt ::=",
170277
+ /* 393 */ "kwcolumn_opt ::= COLUMNKW",
170278
+ /* 394 */ "vtabarglist ::= vtabarg",
170279
+ /* 395 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
170280
+ /* 396 */ "vtabarg ::= vtabarg vtabargtoken",
170281
+ /* 397 */ "anylist ::=",
170282
+ /* 398 */ "anylist ::= anylist LP anylist RP",
170283
+ /* 399 */ "anylist ::= anylist ANY",
170284
+ /* 400 */ "with ::=",
170285
+ /* 401 */ "windowdefn_list ::= windowdefn",
170286
+ /* 402 */ "window ::= frame_opt",
170257170287
};
170258170288
#endif /* NDEBUG */
170259170289
170260170290
170261170291
#if YYSTACKDEPTH<=0
@@ -171067,104 +171097,104 @@
171067171097
305, /* (304) wqas ::= AS MATERIALIZED */
171068171098
305, /* (305) wqas ::= AS NOT MATERIALIZED */
171069171099
304, /* (306) wqitem ::= nm eidlist_opt wqas LP select RP */
171070171100
241, /* (307) wqlist ::= wqitem */
171071171101
241, /* (308) wqlist ::= wqlist COMMA wqitem */
171072
- 306, /* (309) windowdefn_list ::= windowdefn */
171073
- 306, /* (310) windowdefn_list ::= windowdefn_list COMMA windowdefn */
171074
- 307, /* (311) windowdefn ::= nm AS LP window RP */
171075
- 308, /* (312) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
171076
- 308, /* (313) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
171077
- 308, /* (314) window ::= ORDER BY sortlist frame_opt */
171078
- 308, /* (315) window ::= nm ORDER BY sortlist frame_opt */
171079
- 308, /* (316) window ::= frame_opt */
171080
- 308, /* (317) window ::= nm frame_opt */
171081
- 309, /* (318) frame_opt ::= */
171082
- 309, /* (319) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
171083
- 309, /* (320) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
171084
- 313, /* (321) range_or_rows ::= RANGE|ROWS|GROUPS */
171085
- 315, /* (322) frame_bound_s ::= frame_bound */
171086
- 315, /* (323) frame_bound_s ::= UNBOUNDED PRECEDING */
171087
- 316, /* (324) frame_bound_e ::= frame_bound */
171088
- 316, /* (325) frame_bound_e ::= UNBOUNDED FOLLOWING */
171089
- 314, /* (326) frame_bound ::= expr PRECEDING|FOLLOWING */
171090
- 314, /* (327) frame_bound ::= CURRENT ROW */
171091
- 317, /* (328) frame_exclude_opt ::= */
171092
- 317, /* (329) frame_exclude_opt ::= EXCLUDE frame_exclude */
171093
- 318, /* (330) frame_exclude ::= NO OTHERS */
171094
- 318, /* (331) frame_exclude ::= CURRENT ROW */
171095
- 318, /* (332) frame_exclude ::= GROUP|TIES */
171096
- 251, /* (333) window_clause ::= WINDOW windowdefn_list */
171097
- 273, /* (334) filter_over ::= filter_clause over_clause */
171098
- 273, /* (335) filter_over ::= over_clause */
171099
- 273, /* (336) filter_over ::= filter_clause */
171100
- 312, /* (337) over_clause ::= OVER LP window RP */
171101
- 312, /* (338) over_clause ::= OVER nm */
171102
- 311, /* (339) filter_clause ::= FILTER LP WHERE expr RP */
171103
- 185, /* (340) input ::= cmdlist */
171104
- 186, /* (341) cmdlist ::= cmdlist ecmd */
171105
- 186, /* (342) cmdlist ::= ecmd */
171106
- 187, /* (343) ecmd ::= SEMI */
171107
- 187, /* (344) ecmd ::= cmdx SEMI */
171108
- 187, /* (345) ecmd ::= explain cmdx SEMI */
171109
- 192, /* (346) trans_opt ::= */
171110
- 192, /* (347) trans_opt ::= TRANSACTION */
171111
- 192, /* (348) trans_opt ::= TRANSACTION nm */
171112
- 194, /* (349) savepoint_opt ::= SAVEPOINT */
171113
- 194, /* (350) savepoint_opt ::= */
171114
- 190, /* (351) cmd ::= create_table create_table_args */
171115
- 203, /* (352) table_option_set ::= table_option */
171116
- 201, /* (353) columnlist ::= columnlist COMMA columnname carglist */
171117
- 201, /* (354) columnlist ::= columnname carglist */
171118
- 193, /* (355) nm ::= ID|INDEXED|JOIN_KW */
171119
- 193, /* (356) nm ::= STRING */
171120
- 208, /* (357) typetoken ::= typename */
171121
- 209, /* (358) typename ::= ID|STRING */
171122
- 210, /* (359) signed ::= plus_num */
171123
- 210, /* (360) signed ::= minus_num */
171124
- 207, /* (361) carglist ::= carglist ccons */
171125
- 207, /* (362) carglist ::= */
171126
- 215, /* (363) ccons ::= NULL onconf */
171127
- 215, /* (364) ccons ::= GENERATED ALWAYS AS generated */
171128
- 215, /* (365) ccons ::= AS generated */
171129
- 202, /* (366) conslist_opt ::= COMMA conslist */
171130
- 228, /* (367) conslist ::= conslist tconscomma tcons */
171131
- 228, /* (368) conslist ::= tcons */
171132
- 229, /* (369) tconscomma ::= */
171133
- 233, /* (370) defer_subclause_opt ::= defer_subclause */
171134
- 235, /* (371) resolvetype ::= raisetype */
171135
- 239, /* (372) selectnowith ::= oneselect */
171136
- 240, /* (373) oneselect ::= values */
171137
- 254, /* (374) sclp ::= selcollist COMMA */
171138
- 255, /* (375) as ::= ID|STRING */
171139
- 264, /* (376) indexed_opt ::= indexed_by */
171140
- 272, /* (377) returning ::= */
171141
- 217, /* (378) expr ::= term */
171142
- 274, /* (379) likeop ::= LIKE_KW|MATCH */
171143
- 278, /* (380) case_operand ::= expr */
171144
- 261, /* (381) exprlist ::= nexprlist */
171145
- 284, /* (382) nmnum ::= plus_num */
171146
- 284, /* (383) nmnum ::= nm */
171147
- 284, /* (384) nmnum ::= ON */
171148
- 284, /* (385) nmnum ::= DELETE */
171149
- 284, /* (386) nmnum ::= DEFAULT */
171150
- 211, /* (387) plus_num ::= INTEGER|FLOAT */
171151
- 289, /* (388) foreach_clause ::= */
171152
- 289, /* (389) foreach_clause ::= FOR EACH ROW */
171153
- 292, /* (390) trnm ::= nm */
171154
- 293, /* (391) tridxby ::= */
171155
- 294, /* (392) database_kw_opt ::= DATABASE */
171156
- 294, /* (393) database_kw_opt ::= */
171157
- 297, /* (394) kwcolumn_opt ::= */
171158
- 297, /* (395) kwcolumn_opt ::= COLUMNKW */
171159
- 299, /* (396) vtabarglist ::= vtabarg */
171160
- 299, /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */
171161
- 300, /* (398) vtabarg ::= vtabarg vtabargtoken */
171162
- 303, /* (399) anylist ::= */
171163
- 303, /* (400) anylist ::= anylist LP anylist RP */
171164
- 303, /* (401) anylist ::= anylist ANY */
171165
- 266, /* (402) with ::= */
171102
+ 306, /* (309) windowdefn_list ::= windowdefn_list COMMA windowdefn */
171103
+ 307, /* (310) windowdefn ::= nm AS LP window RP */
171104
+ 308, /* (311) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
171105
+ 308, /* (312) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
171106
+ 308, /* (313) window ::= ORDER BY sortlist frame_opt */
171107
+ 308, /* (314) window ::= nm ORDER BY sortlist frame_opt */
171108
+ 308, /* (315) window ::= nm frame_opt */
171109
+ 309, /* (316) frame_opt ::= */
171110
+ 309, /* (317) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
171111
+ 309, /* (318) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
171112
+ 313, /* (319) range_or_rows ::= RANGE|ROWS|GROUPS */
171113
+ 315, /* (320) frame_bound_s ::= frame_bound */
171114
+ 315, /* (321) frame_bound_s ::= UNBOUNDED PRECEDING */
171115
+ 316, /* (322) frame_bound_e ::= frame_bound */
171116
+ 316, /* (323) frame_bound_e ::= UNBOUNDED FOLLOWING */
171117
+ 314, /* (324) frame_bound ::= expr PRECEDING|FOLLOWING */
171118
+ 314, /* (325) frame_bound ::= CURRENT ROW */
171119
+ 317, /* (326) frame_exclude_opt ::= */
171120
+ 317, /* (327) frame_exclude_opt ::= EXCLUDE frame_exclude */
171121
+ 318, /* (328) frame_exclude ::= NO OTHERS */
171122
+ 318, /* (329) frame_exclude ::= CURRENT ROW */
171123
+ 318, /* (330) frame_exclude ::= GROUP|TIES */
171124
+ 251, /* (331) window_clause ::= WINDOW windowdefn_list */
171125
+ 273, /* (332) filter_over ::= filter_clause over_clause */
171126
+ 273, /* (333) filter_over ::= over_clause */
171127
+ 273, /* (334) filter_over ::= filter_clause */
171128
+ 312, /* (335) over_clause ::= OVER LP window RP */
171129
+ 312, /* (336) over_clause ::= OVER nm */
171130
+ 311, /* (337) filter_clause ::= FILTER LP WHERE expr RP */
171131
+ 185, /* (338) input ::= cmdlist */
171132
+ 186, /* (339) cmdlist ::= cmdlist ecmd */
171133
+ 186, /* (340) cmdlist ::= ecmd */
171134
+ 187, /* (341) ecmd ::= SEMI */
171135
+ 187, /* (342) ecmd ::= cmdx SEMI */
171136
+ 187, /* (343) ecmd ::= explain cmdx SEMI */
171137
+ 192, /* (344) trans_opt ::= */
171138
+ 192, /* (345) trans_opt ::= TRANSACTION */
171139
+ 192, /* (346) trans_opt ::= TRANSACTION nm */
171140
+ 194, /* (347) savepoint_opt ::= SAVEPOINT */
171141
+ 194, /* (348) savepoint_opt ::= */
171142
+ 190, /* (349) cmd ::= create_table create_table_args */
171143
+ 203, /* (350) table_option_set ::= table_option */
171144
+ 201, /* (351) columnlist ::= columnlist COMMA columnname carglist */
171145
+ 201, /* (352) columnlist ::= columnname carglist */
171146
+ 193, /* (353) nm ::= ID|INDEXED|JOIN_KW */
171147
+ 193, /* (354) nm ::= STRING */
171148
+ 208, /* (355) typetoken ::= typename */
171149
+ 209, /* (356) typename ::= ID|STRING */
171150
+ 210, /* (357) signed ::= plus_num */
171151
+ 210, /* (358) signed ::= minus_num */
171152
+ 207, /* (359) carglist ::= carglist ccons */
171153
+ 207, /* (360) carglist ::= */
171154
+ 215, /* (361) ccons ::= NULL onconf */
171155
+ 215, /* (362) ccons ::= GENERATED ALWAYS AS generated */
171156
+ 215, /* (363) ccons ::= AS generated */
171157
+ 202, /* (364) conslist_opt ::= COMMA conslist */
171158
+ 228, /* (365) conslist ::= conslist tconscomma tcons */
171159
+ 228, /* (366) conslist ::= tcons */
171160
+ 229, /* (367) tconscomma ::= */
171161
+ 233, /* (368) defer_subclause_opt ::= defer_subclause */
171162
+ 235, /* (369) resolvetype ::= raisetype */
171163
+ 239, /* (370) selectnowith ::= oneselect */
171164
+ 240, /* (371) oneselect ::= values */
171165
+ 254, /* (372) sclp ::= selcollist COMMA */
171166
+ 255, /* (373) as ::= ID|STRING */
171167
+ 264, /* (374) indexed_opt ::= indexed_by */
171168
+ 272, /* (375) returning ::= */
171169
+ 217, /* (376) expr ::= term */
171170
+ 274, /* (377) likeop ::= LIKE_KW|MATCH */
171171
+ 278, /* (378) case_operand ::= expr */
171172
+ 261, /* (379) exprlist ::= nexprlist */
171173
+ 284, /* (380) nmnum ::= plus_num */
171174
+ 284, /* (381) nmnum ::= nm */
171175
+ 284, /* (382) nmnum ::= ON */
171176
+ 284, /* (383) nmnum ::= DELETE */
171177
+ 284, /* (384) nmnum ::= DEFAULT */
171178
+ 211, /* (385) plus_num ::= INTEGER|FLOAT */
171179
+ 289, /* (386) foreach_clause ::= */
171180
+ 289, /* (387) foreach_clause ::= FOR EACH ROW */
171181
+ 292, /* (388) trnm ::= nm */
171182
+ 293, /* (389) tridxby ::= */
171183
+ 294, /* (390) database_kw_opt ::= DATABASE */
171184
+ 294, /* (391) database_kw_opt ::= */
171185
+ 297, /* (392) kwcolumn_opt ::= */
171186
+ 297, /* (393) kwcolumn_opt ::= COLUMNKW */
171187
+ 299, /* (394) vtabarglist ::= vtabarg */
171188
+ 299, /* (395) vtabarglist ::= vtabarglist COMMA vtabarg */
171189
+ 300, /* (396) vtabarg ::= vtabarg vtabargtoken */
171190
+ 303, /* (397) anylist ::= */
171191
+ 303, /* (398) anylist ::= anylist LP anylist RP */
171192
+ 303, /* (399) anylist ::= anylist ANY */
171193
+ 266, /* (400) with ::= */
171194
+ 306, /* (401) windowdefn_list ::= windowdefn */
171195
+ 308, /* (402) window ::= frame_opt */
171166171196
};
171167171197
171168171198
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
171169171199
** of symbols on the right-hand side of that rule. */
171170171200
static const signed char yyRuleInfoNRhs[] = {
@@ -171475,104 +171505,104 @@
171475171505
-2, /* (304) wqas ::= AS MATERIALIZED */
171476171506
-3, /* (305) wqas ::= AS NOT MATERIALIZED */
171477171507
-6, /* (306) wqitem ::= nm eidlist_opt wqas LP select RP */
171478171508
-1, /* (307) wqlist ::= wqitem */
171479171509
-3, /* (308) wqlist ::= wqlist COMMA wqitem */
171480
- -1, /* (309) windowdefn_list ::= windowdefn */
171481
- -3, /* (310) windowdefn_list ::= windowdefn_list COMMA windowdefn */
171482
- -5, /* (311) windowdefn ::= nm AS LP window RP */
171483
- -5, /* (312) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
171484
- -6, /* (313) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
171485
- -4, /* (314) window ::= ORDER BY sortlist frame_opt */
171486
- -5, /* (315) window ::= nm ORDER BY sortlist frame_opt */
171487
- -1, /* (316) window ::= frame_opt */
171488
- -2, /* (317) window ::= nm frame_opt */
171489
- 0, /* (318) frame_opt ::= */
171490
- -3, /* (319) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
171491
- -6, /* (320) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
171492
- -1, /* (321) range_or_rows ::= RANGE|ROWS|GROUPS */
171493
- -1, /* (322) frame_bound_s ::= frame_bound */
171494
- -2, /* (323) frame_bound_s ::= UNBOUNDED PRECEDING */
171495
- -1, /* (324) frame_bound_e ::= frame_bound */
171496
- -2, /* (325) frame_bound_e ::= UNBOUNDED FOLLOWING */
171497
- -2, /* (326) frame_bound ::= expr PRECEDING|FOLLOWING */
171498
- -2, /* (327) frame_bound ::= CURRENT ROW */
171499
- 0, /* (328) frame_exclude_opt ::= */
171500
- -2, /* (329) frame_exclude_opt ::= EXCLUDE frame_exclude */
171501
- -2, /* (330) frame_exclude ::= NO OTHERS */
171502
- -2, /* (331) frame_exclude ::= CURRENT ROW */
171503
- -1, /* (332) frame_exclude ::= GROUP|TIES */
171504
- -2, /* (333) window_clause ::= WINDOW windowdefn_list */
171505
- -2, /* (334) filter_over ::= filter_clause over_clause */
171506
- -1, /* (335) filter_over ::= over_clause */
171507
- -1, /* (336) filter_over ::= filter_clause */
171508
- -4, /* (337) over_clause ::= OVER LP window RP */
171509
- -2, /* (338) over_clause ::= OVER nm */
171510
- -5, /* (339) filter_clause ::= FILTER LP WHERE expr RP */
171511
- -1, /* (340) input ::= cmdlist */
171512
- -2, /* (341) cmdlist ::= cmdlist ecmd */
171513
- -1, /* (342) cmdlist ::= ecmd */
171514
- -1, /* (343) ecmd ::= SEMI */
171515
- -2, /* (344) ecmd ::= cmdx SEMI */
171516
- -3, /* (345) ecmd ::= explain cmdx SEMI */
171517
- 0, /* (346) trans_opt ::= */
171518
- -1, /* (347) trans_opt ::= TRANSACTION */
171519
- -2, /* (348) trans_opt ::= TRANSACTION nm */
171520
- -1, /* (349) savepoint_opt ::= SAVEPOINT */
171521
- 0, /* (350) savepoint_opt ::= */
171522
- -2, /* (351) cmd ::= create_table create_table_args */
171523
- -1, /* (352) table_option_set ::= table_option */
171524
- -4, /* (353) columnlist ::= columnlist COMMA columnname carglist */
171525
- -2, /* (354) columnlist ::= columnname carglist */
171526
- -1, /* (355) nm ::= ID|INDEXED|JOIN_KW */
171527
- -1, /* (356) nm ::= STRING */
171528
- -1, /* (357) typetoken ::= typename */
171529
- -1, /* (358) typename ::= ID|STRING */
171530
- -1, /* (359) signed ::= plus_num */
171531
- -1, /* (360) signed ::= minus_num */
171532
- -2, /* (361) carglist ::= carglist ccons */
171533
- 0, /* (362) carglist ::= */
171534
- -2, /* (363) ccons ::= NULL onconf */
171535
- -4, /* (364) ccons ::= GENERATED ALWAYS AS generated */
171536
- -2, /* (365) ccons ::= AS generated */
171537
- -2, /* (366) conslist_opt ::= COMMA conslist */
171538
- -3, /* (367) conslist ::= conslist tconscomma tcons */
171539
- -1, /* (368) conslist ::= tcons */
171540
- 0, /* (369) tconscomma ::= */
171541
- -1, /* (370) defer_subclause_opt ::= defer_subclause */
171542
- -1, /* (371) resolvetype ::= raisetype */
171543
- -1, /* (372) selectnowith ::= oneselect */
171544
- -1, /* (373) oneselect ::= values */
171545
- -2, /* (374) sclp ::= selcollist COMMA */
171546
- -1, /* (375) as ::= ID|STRING */
171547
- -1, /* (376) indexed_opt ::= indexed_by */
171548
- 0, /* (377) returning ::= */
171549
- -1, /* (378) expr ::= term */
171550
- -1, /* (379) likeop ::= LIKE_KW|MATCH */
171551
- -1, /* (380) case_operand ::= expr */
171552
- -1, /* (381) exprlist ::= nexprlist */
171553
- -1, /* (382) nmnum ::= plus_num */
171554
- -1, /* (383) nmnum ::= nm */
171555
- -1, /* (384) nmnum ::= ON */
171556
- -1, /* (385) nmnum ::= DELETE */
171557
- -1, /* (386) nmnum ::= DEFAULT */
171558
- -1, /* (387) plus_num ::= INTEGER|FLOAT */
171559
- 0, /* (388) foreach_clause ::= */
171560
- -3, /* (389) foreach_clause ::= FOR EACH ROW */
171561
- -1, /* (390) trnm ::= nm */
171562
- 0, /* (391) tridxby ::= */
171563
- -1, /* (392) database_kw_opt ::= DATABASE */
171564
- 0, /* (393) database_kw_opt ::= */
171565
- 0, /* (394) kwcolumn_opt ::= */
171566
- -1, /* (395) kwcolumn_opt ::= COLUMNKW */
171567
- -1, /* (396) vtabarglist ::= vtabarg */
171568
- -3, /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */
171569
- -2, /* (398) vtabarg ::= vtabarg vtabargtoken */
171570
- 0, /* (399) anylist ::= */
171571
- -4, /* (400) anylist ::= anylist LP anylist RP */
171572
- -2, /* (401) anylist ::= anylist ANY */
171573
- 0, /* (402) with ::= */
171510
+ -3, /* (309) windowdefn_list ::= windowdefn_list COMMA windowdefn */
171511
+ -5, /* (310) windowdefn ::= nm AS LP window RP */
171512
+ -5, /* (311) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
171513
+ -6, /* (312) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
171514
+ -4, /* (313) window ::= ORDER BY sortlist frame_opt */
171515
+ -5, /* (314) window ::= nm ORDER BY sortlist frame_opt */
171516
+ -2, /* (315) window ::= nm frame_opt */
171517
+ 0, /* (316) frame_opt ::= */
171518
+ -3, /* (317) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
171519
+ -6, /* (318) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
171520
+ -1, /* (319) range_or_rows ::= RANGE|ROWS|GROUPS */
171521
+ -1, /* (320) frame_bound_s ::= frame_bound */
171522
+ -2, /* (321) frame_bound_s ::= UNBOUNDED PRECEDING */
171523
+ -1, /* (322) frame_bound_e ::= frame_bound */
171524
+ -2, /* (323) frame_bound_e ::= UNBOUNDED FOLLOWING */
171525
+ -2, /* (324) frame_bound ::= expr PRECEDING|FOLLOWING */
171526
+ -2, /* (325) frame_bound ::= CURRENT ROW */
171527
+ 0, /* (326) frame_exclude_opt ::= */
171528
+ -2, /* (327) frame_exclude_opt ::= EXCLUDE frame_exclude */
171529
+ -2, /* (328) frame_exclude ::= NO OTHERS */
171530
+ -2, /* (329) frame_exclude ::= CURRENT ROW */
171531
+ -1, /* (330) frame_exclude ::= GROUP|TIES */
171532
+ -2, /* (331) window_clause ::= WINDOW windowdefn_list */
171533
+ -2, /* (332) filter_over ::= filter_clause over_clause */
171534
+ -1, /* (333) filter_over ::= over_clause */
171535
+ -1, /* (334) filter_over ::= filter_clause */
171536
+ -4, /* (335) over_clause ::= OVER LP window RP */
171537
+ -2, /* (336) over_clause ::= OVER nm */
171538
+ -5, /* (337) filter_clause ::= FILTER LP WHERE expr RP */
171539
+ -1, /* (338) input ::= cmdlist */
171540
+ -2, /* (339) cmdlist ::= cmdlist ecmd */
171541
+ -1, /* (340) cmdlist ::= ecmd */
171542
+ -1, /* (341) ecmd ::= SEMI */
171543
+ -2, /* (342) ecmd ::= cmdx SEMI */
171544
+ -3, /* (343) ecmd ::= explain cmdx SEMI */
171545
+ 0, /* (344) trans_opt ::= */
171546
+ -1, /* (345) trans_opt ::= TRANSACTION */
171547
+ -2, /* (346) trans_opt ::= TRANSACTION nm */
171548
+ -1, /* (347) savepoint_opt ::= SAVEPOINT */
171549
+ 0, /* (348) savepoint_opt ::= */
171550
+ -2, /* (349) cmd ::= create_table create_table_args */
171551
+ -1, /* (350) table_option_set ::= table_option */
171552
+ -4, /* (351) columnlist ::= columnlist COMMA columnname carglist */
171553
+ -2, /* (352) columnlist ::= columnname carglist */
171554
+ -1, /* (353) nm ::= ID|INDEXED|JOIN_KW */
171555
+ -1, /* (354) nm ::= STRING */
171556
+ -1, /* (355) typetoken ::= typename */
171557
+ -1, /* (356) typename ::= ID|STRING */
171558
+ -1, /* (357) signed ::= plus_num */
171559
+ -1, /* (358) signed ::= minus_num */
171560
+ -2, /* (359) carglist ::= carglist ccons */
171561
+ 0, /* (360) carglist ::= */
171562
+ -2, /* (361) ccons ::= NULL onconf */
171563
+ -4, /* (362) ccons ::= GENERATED ALWAYS AS generated */
171564
+ -2, /* (363) ccons ::= AS generated */
171565
+ -2, /* (364) conslist_opt ::= COMMA conslist */
171566
+ -3, /* (365) conslist ::= conslist tconscomma tcons */
171567
+ -1, /* (366) conslist ::= tcons */
171568
+ 0, /* (367) tconscomma ::= */
171569
+ -1, /* (368) defer_subclause_opt ::= defer_subclause */
171570
+ -1, /* (369) resolvetype ::= raisetype */
171571
+ -1, /* (370) selectnowith ::= oneselect */
171572
+ -1, /* (371) oneselect ::= values */
171573
+ -2, /* (372) sclp ::= selcollist COMMA */
171574
+ -1, /* (373) as ::= ID|STRING */
171575
+ -1, /* (374) indexed_opt ::= indexed_by */
171576
+ 0, /* (375) returning ::= */
171577
+ -1, /* (376) expr ::= term */
171578
+ -1, /* (377) likeop ::= LIKE_KW|MATCH */
171579
+ -1, /* (378) case_operand ::= expr */
171580
+ -1, /* (379) exprlist ::= nexprlist */
171581
+ -1, /* (380) nmnum ::= plus_num */
171582
+ -1, /* (381) nmnum ::= nm */
171583
+ -1, /* (382) nmnum ::= ON */
171584
+ -1, /* (383) nmnum ::= DELETE */
171585
+ -1, /* (384) nmnum ::= DEFAULT */
171586
+ -1, /* (385) plus_num ::= INTEGER|FLOAT */
171587
+ 0, /* (386) foreach_clause ::= */
171588
+ -3, /* (387) foreach_clause ::= FOR EACH ROW */
171589
+ -1, /* (388) trnm ::= nm */
171590
+ 0, /* (389) tridxby ::= */
171591
+ -1, /* (390) database_kw_opt ::= DATABASE */
171592
+ 0, /* (391) database_kw_opt ::= */
171593
+ 0, /* (392) kwcolumn_opt ::= */
171594
+ -1, /* (393) kwcolumn_opt ::= COLUMNKW */
171595
+ -1, /* (394) vtabarglist ::= vtabarg */
171596
+ -3, /* (395) vtabarglist ::= vtabarglist COMMA vtabarg */
171597
+ -2, /* (396) vtabarg ::= vtabarg vtabargtoken */
171598
+ 0, /* (397) anylist ::= */
171599
+ -4, /* (398) anylist ::= anylist LP anylist RP */
171600
+ -2, /* (399) anylist ::= anylist ANY */
171601
+ 0, /* (400) with ::= */
171602
+ -1, /* (401) windowdefn_list ::= windowdefn */
171603
+ -1, /* (402) window ::= frame_opt */
171574171604
};
171575171605
171576171606
static void yy_accept(yyParser*); /* Forward Declaration */
171577171607
171578171608
/*
@@ -171628,11 +171658,11 @@
171628171658
{yymsp[1].minor.yy394 = TK_DEFERRED;}
171629171659
break;
171630171660
case 5: /* transtype ::= DEFERRED */
171631171661
case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
171632171662
case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
171633
- case 321: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==321);
171663
+ case 319: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==319);
171634171664
{yymsp[0].minor.yy394 = yymsp[0].major; /*A-overwrites-X*/}
171635171665
break;
171636171666
case 8: /* cmd ::= COMMIT|END trans_opt */
171637171667
case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
171638171668
{sqlite3EndTransaction(pParse,yymsp[-1].major);}
@@ -171924,11 +171954,10 @@
171924171954
{
171925171955
Select *p = yymsp[0].minor.yy47;
171926171956
if( p ){
171927171957
parserDoubleLinkSelect(pParse, p);
171928171958
}
171929
- yymsp[0].minor.yy47 = p; /*A-overwrites-X*/
171930171959
}
171931171960
break;
171932171961
case 88: /* selectnowith ::= selectnowith multiselect_op oneselect */
171933171962
{
171934171963
Select *pRhs = yymsp[0].minor.yy47;
@@ -172016,18 +172045,21 @@
172016172045
}
172017172046
break;
172018172047
case 101: /* selcollist ::= sclp scanpt STAR */
172019172048
{
172020172049
Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
172050
+ sqlite3ExprSetErrorOffset(p, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
172021172051
yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, p);
172022172052
}
172023172053
break;
172024172054
case 102: /* selcollist ::= sclp scanpt nm DOT STAR */
172025172055
{
172026
- Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
172027
- Expr *pLeft = tokenExpr(pParse, TK_ID, yymsp[-2].minor.yy0);
172028
- Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
172056
+ Expr *pRight, *pLeft, *pDot;
172057
+ pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
172058
+ sqlite3ExprSetErrorOffset(pRight, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
172059
+ pLeft = tokenExpr(pParse, TK_ID, yymsp[-2].minor.yy0);
172060
+ pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
172029172061
yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, pDot);
172030172062
}
172031172063
break;
172032172064
case 103: /* as ::= AS nm */
172033172065
case 115: /* dbnm ::= DOT nm */ yytestcase(yyruleno==115);
@@ -172917,116 +172949,105 @@
172917172949
case 308: /* wqlist ::= wqlist COMMA wqitem */
172918172950
{
172919172951
yymsp[-2].minor.yy521 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy521, yymsp[0].minor.yy385);
172920172952
}
172921172953
break;
172922
- case 309: /* windowdefn_list ::= windowdefn */
172923
-{ yylhsminor.yy41 = yymsp[0].minor.yy41; }
172924
- yymsp[0].minor.yy41 = yylhsminor.yy41;
172925
- break;
172926
- case 310: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
172954
+ case 309: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
172927172955
{
172928172956
assert( yymsp[0].minor.yy41!=0 );
172929172957
sqlite3WindowChain(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy41);
172930172958
yymsp[0].minor.yy41->pNextWin = yymsp[-2].minor.yy41;
172931172959
yylhsminor.yy41 = yymsp[0].minor.yy41;
172932172960
}
172933172961
yymsp[-2].minor.yy41 = yylhsminor.yy41;
172934172962
break;
172935
- case 311: /* windowdefn ::= nm AS LP window RP */
172963
+ case 310: /* windowdefn ::= nm AS LP window RP */
172936172964
{
172937172965
if( ALWAYS(yymsp[-1].minor.yy41) ){
172938172966
yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
172939172967
}
172940172968
yylhsminor.yy41 = yymsp[-1].minor.yy41;
172941172969
}
172942172970
yymsp[-4].minor.yy41 = yylhsminor.yy41;
172943172971
break;
172944
- case 312: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
172972
+ case 311: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
172945172973
{
172946172974
yymsp[-4].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, 0);
172947172975
}
172948172976
break;
172949
- case 313: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
172977
+ case 312: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
172950172978
{
172951172979
yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, &yymsp[-5].minor.yy0);
172952172980
}
172953172981
yymsp[-5].minor.yy41 = yylhsminor.yy41;
172954172982
break;
172955
- case 314: /* window ::= ORDER BY sortlist frame_opt */
172983
+ case 313: /* window ::= ORDER BY sortlist frame_opt */
172956172984
{
172957172985
yymsp[-3].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, 0);
172958172986
}
172959172987
break;
172960
- case 315: /* window ::= nm ORDER BY sortlist frame_opt */
172988
+ case 314: /* window ::= nm ORDER BY sortlist frame_opt */
172961172989
{
172962172990
yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
172963172991
}
172964172992
yymsp[-4].minor.yy41 = yylhsminor.yy41;
172965172993
break;
172966
- case 316: /* window ::= frame_opt */
172967
- case 335: /* filter_over ::= over_clause */ yytestcase(yyruleno==335);
172968
-{
172969
- yylhsminor.yy41 = yymsp[0].minor.yy41;
172970
-}
172971
- yymsp[0].minor.yy41 = yylhsminor.yy41;
172972
- break;
172973
- case 317: /* window ::= nm frame_opt */
172994
+ case 315: /* window ::= nm frame_opt */
172974172995
{
172975172996
yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, 0, &yymsp[-1].minor.yy0);
172976172997
}
172977172998
yymsp[-1].minor.yy41 = yylhsminor.yy41;
172978172999
break;
172979
- case 318: /* frame_opt ::= */
173000
+ case 316: /* frame_opt ::= */
172980173001
{
172981173002
yymsp[1].minor.yy41 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
172982173003
}
172983173004
break;
172984
- case 319: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
173005
+ case 317: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
172985173006
{
172986173007
yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy394, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy516);
172987173008
}
172988173009
yymsp[-2].minor.yy41 = yylhsminor.yy41;
172989173010
break;
172990
- case 320: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
173011
+ case 318: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
172991173012
{
172992173013
yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy394, yymsp[-3].minor.yy595.eType, yymsp[-3].minor.yy595.pExpr, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, yymsp[0].minor.yy516);
172993173014
}
172994173015
yymsp[-5].minor.yy41 = yylhsminor.yy41;
172995173016
break;
172996
- case 322: /* frame_bound_s ::= frame_bound */
172997
- case 324: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==324);
173017
+ case 320: /* frame_bound_s ::= frame_bound */
173018
+ case 322: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==322);
172998173019
{yylhsminor.yy595 = yymsp[0].minor.yy595;}
172999173020
yymsp[0].minor.yy595 = yylhsminor.yy595;
173000173021
break;
173001
- case 323: /* frame_bound_s ::= UNBOUNDED PRECEDING */
173002
- case 325: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==325);
173003
- case 327: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==327);
173022
+ case 321: /* frame_bound_s ::= UNBOUNDED PRECEDING */
173023
+ case 323: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==323);
173024
+ case 325: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==325);
173004173025
{yylhsminor.yy595.eType = yymsp[-1].major; yylhsminor.yy595.pExpr = 0;}
173005173026
yymsp[-1].minor.yy595 = yylhsminor.yy595;
173006173027
break;
173007
- case 326: /* frame_bound ::= expr PRECEDING|FOLLOWING */
173028
+ case 324: /* frame_bound ::= expr PRECEDING|FOLLOWING */
173008173029
{yylhsminor.yy595.eType = yymsp[0].major; yylhsminor.yy595.pExpr = yymsp[-1].minor.yy528;}
173009173030
yymsp[-1].minor.yy595 = yylhsminor.yy595;
173010173031
break;
173011
- case 328: /* frame_exclude_opt ::= */
173032
+ case 326: /* frame_exclude_opt ::= */
173012173033
{yymsp[1].minor.yy516 = 0;}
173013173034
break;
173014
- case 329: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
173035
+ case 327: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
173015173036
{yymsp[-1].minor.yy516 = yymsp[0].minor.yy516;}
173016173037
break;
173017
- case 330: /* frame_exclude ::= NO OTHERS */
173018
- case 331: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==331);
173038
+ case 328: /* frame_exclude ::= NO OTHERS */
173039
+ case 329: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==329);
173019173040
{yymsp[-1].minor.yy516 = yymsp[-1].major; /*A-overwrites-X*/}
173020173041
break;
173021
- case 332: /* frame_exclude ::= GROUP|TIES */
173042
+ case 330: /* frame_exclude ::= GROUP|TIES */
173022173043
{yymsp[0].minor.yy516 = yymsp[0].major; /*A-overwrites-X*/}
173023173044
break;
173024
- case 333: /* window_clause ::= WINDOW windowdefn_list */
173045
+ case 331: /* window_clause ::= WINDOW windowdefn_list */
173025173046
{ yymsp[-1].minor.yy41 = yymsp[0].minor.yy41; }
173026173047
break;
173027
- case 334: /* filter_over ::= filter_clause over_clause */
173048
+ case 332: /* filter_over ::= filter_clause over_clause */
173028173049
{
173029173050
if( yymsp[0].minor.yy41 ){
173030173051
yymsp[0].minor.yy41->pFilter = yymsp[-1].minor.yy528;
173031173052
}else{
173032173053
sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy528);
@@ -173033,11 +173054,17 @@
173033173054
}
173034173055
yylhsminor.yy41 = yymsp[0].minor.yy41;
173035173056
}
173036173057
yymsp[-1].minor.yy41 = yylhsminor.yy41;
173037173058
break;
173038
- case 336: /* filter_over ::= filter_clause */
173059
+ case 333: /* filter_over ::= over_clause */
173060
+{
173061
+ yylhsminor.yy41 = yymsp[0].minor.yy41;
173062
+}
173063
+ yymsp[0].minor.yy41 = yylhsminor.yy41;
173064
+ break;
173065
+ case 334: /* filter_over ::= filter_clause */
173039173066
{
173040173067
yylhsminor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
173041173068
if( yylhsminor.yy41 ){
173042173069
yylhsminor.yy41->eFrmType = TK_FILTER;
173043173070
yylhsminor.yy41->pFilter = yymsp[0].minor.yy528;
@@ -173045,91 +173072,93 @@
173045173072
sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy528);
173046173073
}
173047173074
}
173048173075
yymsp[0].minor.yy41 = yylhsminor.yy41;
173049173076
break;
173050
- case 337: /* over_clause ::= OVER LP window RP */
173077
+ case 335: /* over_clause ::= OVER LP window RP */
173051173078
{
173052173079
yymsp[-3].minor.yy41 = yymsp[-1].minor.yy41;
173053173080
assert( yymsp[-3].minor.yy41!=0 );
173054173081
}
173055173082
break;
173056
- case 338: /* over_clause ::= OVER nm */
173083
+ case 336: /* over_clause ::= OVER nm */
173057173084
{
173058173085
yymsp[-1].minor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
173059173086
if( yymsp[-1].minor.yy41 ){
173060173087
yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
173061173088
}
173062173089
}
173063173090
break;
173064
- case 339: /* filter_clause ::= FILTER LP WHERE expr RP */
173091
+ case 337: /* filter_clause ::= FILTER LP WHERE expr RP */
173065173092
{ yymsp[-4].minor.yy528 = yymsp[-1].minor.yy528; }
173066173093
break;
173067173094
default:
173068
- /* (340) input ::= cmdlist */ yytestcase(yyruleno==340);
173069
- /* (341) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==341);
173070
- /* (342) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=342);
173071
- /* (343) ecmd ::= SEMI */ yytestcase(yyruleno==343);
173072
- /* (344) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==344);
173073
- /* (345) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=345);
173074
- /* (346) trans_opt ::= */ yytestcase(yyruleno==346);
173075
- /* (347) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==347);
173076
- /* (348) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==348);
173077
- /* (349) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==349);
173078
- /* (350) savepoint_opt ::= */ yytestcase(yyruleno==350);
173079
- /* (351) cmd ::= create_table create_table_args */ yytestcase(yyruleno==351);
173080
- /* (352) table_option_set ::= table_option (OPTIMIZED OUT) */ assert(yyruleno!=352);
173081
- /* (353) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==353);
173082
- /* (354) columnlist ::= columnname carglist */ yytestcase(yyruleno==354);
173083
- /* (355) nm ::= ID|INDEXED|JOIN_KW */ yytestcase(yyruleno==355);
173084
- /* (356) nm ::= STRING */ yytestcase(yyruleno==356);
173085
- /* (357) typetoken ::= typename */ yytestcase(yyruleno==357);
173086
- /* (358) typename ::= ID|STRING */ yytestcase(yyruleno==358);
173087
- /* (359) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=359);
173088
- /* (360) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=360);
173089
- /* (361) carglist ::= carglist ccons */ yytestcase(yyruleno==361);
173090
- /* (362) carglist ::= */ yytestcase(yyruleno==362);
173091
- /* (363) ccons ::= NULL onconf */ yytestcase(yyruleno==363);
173092
- /* (364) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==364);
173093
- /* (365) ccons ::= AS generated */ yytestcase(yyruleno==365);
173094
- /* (366) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==366);
173095
- /* (367) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==367);
173096
- /* (368) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=368);
173097
- /* (369) tconscomma ::= */ yytestcase(yyruleno==369);
173098
- /* (370) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=370);
173099
- /* (371) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=371);
173100
- /* (372) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=372);
173101
- /* (373) oneselect ::= values */ yytestcase(yyruleno==373);
173102
- /* (374) sclp ::= selcollist COMMA */ yytestcase(yyruleno==374);
173103
- /* (375) as ::= ID|STRING */ yytestcase(yyruleno==375);
173104
- /* (376) indexed_opt ::= indexed_by (OPTIMIZED OUT) */ assert(yyruleno!=376);
173105
- /* (377) returning ::= */ yytestcase(yyruleno==377);
173106
- /* (378) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=378);
173107
- /* (379) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==379);
173108
- /* (380) case_operand ::= expr */ yytestcase(yyruleno==380);
173109
- /* (381) exprlist ::= nexprlist */ yytestcase(yyruleno==381);
173110
- /* (382) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=382);
173111
- /* (383) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=383);
173112
- /* (384) nmnum ::= ON */ yytestcase(yyruleno==384);
173113
- /* (385) nmnum ::= DELETE */ yytestcase(yyruleno==385);
173114
- /* (386) nmnum ::= DEFAULT */ yytestcase(yyruleno==386);
173115
- /* (387) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==387);
173116
- /* (388) foreach_clause ::= */ yytestcase(yyruleno==388);
173117
- /* (389) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==389);
173118
- /* (390) trnm ::= nm */ yytestcase(yyruleno==390);
173119
- /* (391) tridxby ::= */ yytestcase(yyruleno==391);
173120
- /* (392) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==392);
173121
- /* (393) database_kw_opt ::= */ yytestcase(yyruleno==393);
173122
- /* (394) kwcolumn_opt ::= */ yytestcase(yyruleno==394);
173123
- /* (395) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==395);
173124
- /* (396) vtabarglist ::= vtabarg */ yytestcase(yyruleno==396);
173125
- /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==397);
173126
- /* (398) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==398);
173127
- /* (399) anylist ::= */ yytestcase(yyruleno==399);
173128
- /* (400) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==400);
173129
- /* (401) anylist ::= anylist ANY */ yytestcase(yyruleno==401);
173130
- /* (402) with ::= */ yytestcase(yyruleno==402);
173095
+ /* (338) input ::= cmdlist */ yytestcase(yyruleno==338);
173096
+ /* (339) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==339);
173097
+ /* (340) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=340);
173098
+ /* (341) ecmd ::= SEMI */ yytestcase(yyruleno==341);
173099
+ /* (342) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==342);
173100
+ /* (343) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=343);
173101
+ /* (344) trans_opt ::= */ yytestcase(yyruleno==344);
173102
+ /* (345) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==345);
173103
+ /* (346) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==346);
173104
+ /* (347) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==347);
173105
+ /* (348) savepoint_opt ::= */ yytestcase(yyruleno==348);
173106
+ /* (349) cmd ::= create_table create_table_args */ yytestcase(yyruleno==349);
173107
+ /* (350) table_option_set ::= table_option (OPTIMIZED OUT) */ assert(yyruleno!=350);
173108
+ /* (351) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==351);
173109
+ /* (352) columnlist ::= columnname carglist */ yytestcase(yyruleno==352);
173110
+ /* (353) nm ::= ID|INDEXED|JOIN_KW */ yytestcase(yyruleno==353);
173111
+ /* (354) nm ::= STRING */ yytestcase(yyruleno==354);
173112
+ /* (355) typetoken ::= typename */ yytestcase(yyruleno==355);
173113
+ /* (356) typename ::= ID|STRING */ yytestcase(yyruleno==356);
173114
+ /* (357) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=357);
173115
+ /* (358) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=358);
173116
+ /* (359) carglist ::= carglist ccons */ yytestcase(yyruleno==359);
173117
+ /* (360) carglist ::= */ yytestcase(yyruleno==360);
173118
+ /* (361) ccons ::= NULL onconf */ yytestcase(yyruleno==361);
173119
+ /* (362) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==362);
173120
+ /* (363) ccons ::= AS generated */ yytestcase(yyruleno==363);
173121
+ /* (364) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==364);
173122
+ /* (365) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==365);
173123
+ /* (366) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=366);
173124
+ /* (367) tconscomma ::= */ yytestcase(yyruleno==367);
173125
+ /* (368) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=368);
173126
+ /* (369) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=369);
173127
+ /* (370) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=370);
173128
+ /* (371) oneselect ::= values */ yytestcase(yyruleno==371);
173129
+ /* (372) sclp ::= selcollist COMMA */ yytestcase(yyruleno==372);
173130
+ /* (373) as ::= ID|STRING */ yytestcase(yyruleno==373);
173131
+ /* (374) indexed_opt ::= indexed_by (OPTIMIZED OUT) */ assert(yyruleno!=374);
173132
+ /* (375) returning ::= */ yytestcase(yyruleno==375);
173133
+ /* (376) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=376);
173134
+ /* (377) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==377);
173135
+ /* (378) case_operand ::= expr */ yytestcase(yyruleno==378);
173136
+ /* (379) exprlist ::= nexprlist */ yytestcase(yyruleno==379);
173137
+ /* (380) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=380);
173138
+ /* (381) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=381);
173139
+ /* (382) nmnum ::= ON */ yytestcase(yyruleno==382);
173140
+ /* (383) nmnum ::= DELETE */ yytestcase(yyruleno==383);
173141
+ /* (384) nmnum ::= DEFAULT */ yytestcase(yyruleno==384);
173142
+ /* (385) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==385);
173143
+ /* (386) foreach_clause ::= */ yytestcase(yyruleno==386);
173144
+ /* (387) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==387);
173145
+ /* (388) trnm ::= nm */ yytestcase(yyruleno==388);
173146
+ /* (389) tridxby ::= */ yytestcase(yyruleno==389);
173147
+ /* (390) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==390);
173148
+ /* (391) database_kw_opt ::= */ yytestcase(yyruleno==391);
173149
+ /* (392) kwcolumn_opt ::= */ yytestcase(yyruleno==392);
173150
+ /* (393) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==393);
173151
+ /* (394) vtabarglist ::= vtabarg */ yytestcase(yyruleno==394);
173152
+ /* (395) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==395);
173153
+ /* (396) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==396);
173154
+ /* (397) anylist ::= */ yytestcase(yyruleno==397);
173155
+ /* (398) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==398);
173156
+ /* (399) anylist ::= anylist ANY */ yytestcase(yyruleno==399);
173157
+ /* (400) with ::= */ yytestcase(yyruleno==400);
173158
+ /* (401) windowdefn_list ::= windowdefn (OPTIMIZED OUT) */ assert(yyruleno!=401);
173159
+ /* (402) window ::= frame_opt (OPTIMIZED OUT) */ assert(yyruleno!=402);
173131173160
break;
173132173161
/********** End reduce actions ************************************************/
173133173162
};
173134173163
assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
173135173164
yygoto = yyRuleInfoLhs[yyruleno];
@@ -203503,10 +203532,15 @@
203503203532
#else
203504203533
# define ALWAYS(X) (X)
203505203534
# define NEVER(X) (X)
203506203535
#endif
203507203536
#endif /* !defined(SQLITE_AMALGAMATION) */
203537
+
203538
+/* Macro to check for 4-byte alignment. Only used inside of assert() */
203539
+#ifdef SQLITE_DEBUG
203540
+# define FOUR_BYTE_ALIGNED(X) ((((char*)(X) - (char*)0) & 3)==0)
203541
+#endif
203508203542
203509203543
/* #include <string.h> */
203510203544
/* #include <stdio.h> */
203511203545
/* #include <assert.h> */
203512203546
/* #include <stdlib.h> */
@@ -203910,11 +203944,11 @@
203910203944
*/
203911203945
static int readInt16(u8 *p){
203912203946
return (p[0]<<8) + p[1];
203913203947
}
203914203948
static void readCoord(u8 *p, RtreeCoord *pCoord){
203915
- assert( (((sqlite3_uint64)p)&3)==0 ); /* p is always 4-byte aligned */
203949
+ assert( FOUR_BYTE_ALIGNED(p) );
203916203950
#if SQLITE_BYTEORDER==1234 && MSVC_VERSION>=1300
203917203951
pCoord->u = _byteswap_ulong(*(u32*)p);
203918203952
#elif SQLITE_BYTEORDER==1234 && GCC_VERSION>=4003000
203919203953
pCoord->u = __builtin_bswap32(*(u32*)p);
203920203954
#elif SQLITE_BYTEORDER==4321
@@ -203964,11 +203998,11 @@
203964203998
p[0] = (i>> 8)&0xFF;
203965203999
p[1] = (i>> 0)&0xFF;
203966204000
}
203967204001
static int writeCoord(u8 *p, RtreeCoord *pCoord){
203968204002
u32 i;
203969
- assert( (((sqlite3_uint64)p)&3)==0 ); /* p is always 4-byte aligned */
204003
+ assert( FOUR_BYTE_ALIGNED(p) );
203970204004
assert( sizeof(RtreeCoord)==4 );
203971204005
assert( sizeof(u32)==4 );
203972204006
#if SQLITE_BYTEORDER==1234 && GCC_VERSION>=4003000
203973204007
i = __builtin_bswap32(pCoord->u);
203974204008
memcpy(p, &i, 4);
@@ -204692,11 +204726,11 @@
204692204726
pCellData += 8 + 4*(p->iCoord&0xfe);
204693204727
204694204728
assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE
204695204729
|| p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_TRUE
204696204730
|| p->op==RTREE_FALSE );
204697
- assert( (((sqlite3_uint64)pCellData)&3)==0 ); /* 4-byte aligned */
204731
+ assert( FOUR_BYTE_ALIGNED(pCellData) );
204698204732
switch( p->op ){
204699204733
case RTREE_TRUE: return; /* Always satisfied */
204700204734
case RTREE_FALSE: break; /* Never satisfied */
204701204735
case RTREE_EQ:
204702204736
RTREE_DECODE_COORD(eInt, pCellData, val);
@@ -204745,11 +204779,11 @@
204745204779
204746204780
assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE
204747204781
|| p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_TRUE
204748204782
|| p->op==RTREE_FALSE );
204749204783
pCellData += 8 + p->iCoord*4;
204750
- assert( (((sqlite3_uint64)pCellData)&3)==0 ); /* 4-byte aligned */
204784
+ assert( FOUR_BYTE_ALIGNED(pCellData) );
204751204785
RTREE_DECODE_COORD(eInt, pCellData, xN);
204752204786
switch( p->op ){
204753204787
case RTREE_TRUE: return; /* Always satisfied */
204754204788
case RTREE_FALSE: break; /* Never satisfied */
204755204789
case RTREE_LE: if( xN <= p->u.rValue ) return; break;
@@ -242954,11 +242988,11 @@
242954242988
int nArg, /* Number of args */
242955242989
sqlite3_value **apUnused /* Function arguments */
242956242990
){
242957242991
assert( nArg==0 );
242958242992
UNUSED_PARAM2(nArg, apUnused);
242959
- sqlite3_result_text(pCtx, "fts5: 2023-06-12 18:22:34 7ec4ab327decd6a5ee5e6a53f1489e17e0cdbb297945f9acc532b47d052eb7a9", -1, SQLITE_TRANSIENT);
242993
+ sqlite3_result_text(pCtx, "fts5: 2023-06-19 13:09:16 3c94f87806a8b408d8204fc7deec16d01c085ee199ff21a1f20b6346ce816cfe", -1, SQLITE_TRANSIENT);
242960242994
}
242961242995
242962242996
/*
242963242997
** Return true if zName is the extension on one of the shadow tables used
242964242998
** by this module.
242965242999
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
16 ** if you want a wrapper to interface SQLite with your choice of programming
17 ** language. The code for the "sqlite3" command-line shell is also in a
18 ** separate file. This file contains only code for the core SQLite library.
19 **
20 ** The content in this amalgamation comes from Fossil check-in
21 ** ec4ab327decd6a5ee5e6a53f1489e17e0cd.
22 */
23 #define SQLITE_CORE 1
24 #define SQLITE_AMALGAMATION 1
25 #ifndef SQLITE_PRIVATE
26 # define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460 ** [sqlite_version()] and [sqlite_source_id()].
461 */
462 #define SQLITE_VERSION "3.43.0"
463 #define SQLITE_VERSION_NUMBER 3043000
464 #define SQLITE_SOURCE_ID "2023-06-12 18:22:34 7ec4ab327decd6a5ee5e6a53f1489e17e0cdbb297945f9acc532b47d052eb7a9"
465
466 /*
467 ** CAPI3REF: Run-Time Library Version Numbers
468 ** KEYWORDS: sqlite3_version sqlite3_sourceid
469 **
@@ -18641,10 +18641,12 @@
18641 /* Macros used to ensure that the correct members of unions are accessed
18642 ** in Expr.
18643 */
18644 #define ExprUseUToken(E) (((E)->flags&EP_IntValue)==0)
18645 #define ExprUseUValue(E) (((E)->flags&EP_IntValue)!=0)
 
 
18646 #define ExprUseXList(E) (((E)->flags&EP_xIsSelect)==0)
18647 #define ExprUseXSelect(E) (((E)->flags&EP_xIsSelect)!=0)
18648 #define ExprUseYTab(E) (((E)->flags&(EP_WinFunc|EP_Subrtn))==0)
18649 #define ExprUseYWin(E) (((E)->flags&EP_WinFunc)!=0)
18650 #define ExprUseYSub(E) (((E)->flags&EP_Subrtn)!=0)
@@ -21109,10 +21111,11 @@
21109 SQLITE_PRIVATE int sqlite3ExprCheckHeight(Parse*, int);
21110 #else
21111 #define sqlite3SelectExprHeight(x) 0
21112 #define sqlite3ExprCheckHeight(x,y)
21113 #endif
 
21114
21115 SQLITE_PRIVATE u32 sqlite3Get4byte(const u8*);
21116 SQLITE_PRIVATE void sqlite3Put4byte(u8*, u32);
21117
21118 #ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
@@ -23747,12 +23750,12 @@
23747 **
23748 ** The function returns the number of successful conversions.
23749 */
23750 static int getDigits(const char *zDate, const char *zFormat, ...){
23751 /* The aMx[] array translates the 3rd character of each format
23752 ** spec into a max size: a b c d e f */
23753 static const u16 aMx[] = { 12, 14, 24, 31, 59, 9999 };
23754 va_list ap;
23755 int cnt = 0;
23756 char nextC;
23757 va_start(ap, zFormat);
23758 do{
@@ -24089,21 +24092,18 @@
24089
24090 /*
24091 ** Compute the Hour, Minute, and Seconds from the julian day number.
24092 */
24093 static void computeHMS(DateTime *p){
24094 int s;
24095 if( p->validHMS ) return;
24096 computeJD(p);
24097 s = (int)((p->iJD + 43200000) % 86400000);
24098 p->s = s/1000.0;
24099 s = (int)p->s;
24100 p->s -= s;
24101 p->h = s/3600;
24102 s -= p->h*3600;
24103 p->m = s/60;
24104 p->s += s - p->m*60;
24105 p->rawS = 0;
24106 p->validHMS = 1;
24107 }
24108
24109 /*
@@ -24509,32 +24509,41 @@
24509 case '9': {
24510 double rRounder;
24511 int i;
24512 int Y,M,D,h,m,x;
24513 const char *z2 = z;
 
24514 for(n=1; z[n]; n++){
24515 if( z[n]==':' ) break;
24516 if( sqlite3Isspace(z[n]) ) break;
24517 if( z[n]=='-' && n==5 && getDigits(&z[1], "40f", &Y)==1 ) break;
 
 
 
24518 }
24519 if( sqlite3AtoF(z, &r, n, SQLITE_UTF8)<=0 ){
24520 rc = 1;
24521 break;
24522 }
24523 if( z[n]=='-' ){
24524 /* A modifier of the form (+|-)YYYY-MM-DD adds or subtracts the
24525 ** specified number of years, months, and days. MM is limited to
24526 ** the range 0-11 and DD is limited to 0-30.
24527 */
24528 if( z[0]!='+' && z[0]!='-' ) break; /* Must start with +/- */
24529 if( NEVER(n!=5) ) break; /* Must be 4-digit YYYY */
24530 if( getDigits(&z[1], "40f-20a-20d", &Y, &M, &D)!=3 ) break;
 
 
 
 
 
24531 if( M>=12 ) break; /* M range 0..11 */
24532 if( D>=31 ) break; /* D range 0..30 */
24533 computeYMD_HMS(p);
24534 p->validJD = 0;
24535 if( z[0]=='-' ){
24536 p->Y -= Y;
24537 p->M -= M;
24538 D = -D;
24539 }else{
24540 p->Y += Y;
@@ -24574,11 +24583,11 @@
24574 if( parseHhMmSs(z2, &tx) ) break;
24575 computeJD(&tx);
24576 tx.iJD -= 43200000;
24577 day = tx.iJD/86400000;
24578 tx.iJD -= day*86400000;
24579 if( z[0]=='-' ) tx.iJD = -tx.iJD;
24580 computeJD(p);
24581 clearYMD_HMS_TZ(p);
24582 p->iJD += tx.iJD;
24583 rc = 0;
24584 break;
@@ -24590,11 +24599,11 @@
24590 while( sqlite3Isspace(*z) ) z++;
24591 n = sqlite3Strlen30(z);
24592 if( n>10 || n<3 ) break;
24593 if( sqlite3UpperToLower[(u8)z[n-1]]=='s' ) n--;
24594 computeJD(p);
24595 rc = 1;
24596 rRounder = r<0 ? -0.5 : +0.5;
24597 for(i=0; i<ArraySize(aXformType); i++){
24598 if( aXformType[i].nName==n
24599 && sqlite3_strnicmp(aXformType[i].zName, z, n)==0
24600 && r>-aXformType[i].rLimit && r<aXformType[i].rLimit
@@ -24757,11 +24766,11 @@
24757 zBuf[14] = ':';
24758 zBuf[15] = '0' + (x.m/10)%10;
24759 zBuf[16] = '0' + (x.m)%10;
24760 zBuf[17] = ':';
24761 if( x.useSubsec ){
24762 s = (int)1000.0*x.s;
24763 zBuf[18] = '0' + (s/10000)%10;
24764 zBuf[19] = '0' + (s/1000)%10;
24765 zBuf[20] = '.';
24766 zBuf[21] = '0' + (s/100)%10;
24767 zBuf[22] = '0' + (s/10)%10;
@@ -24804,11 +24813,11 @@
24804 zBuf[2] = ':';
24805 zBuf[3] = '0' + (x.m/10)%10;
24806 zBuf[4] = '0' + (x.m)%10;
24807 zBuf[5] = ':';
24808 if( x.useSubsec ){
24809 s = (int)1000.0*x.s;
24810 zBuf[6] = '0' + (s/10000)%10;
24811 zBuf[7] = '0' + (s/1000)%10;
24812 zBuf[8] = '.';
24813 zBuf[9] = '0' + (s/100)%10;
24814 zBuf[10] = '0' + (s/10)%10;
@@ -25034,18 +25043,19 @@
25034 ** ISO-8601 string. The unix timestamps are not supported by this
25035 ** routine.
25036 */
25037 static void timediffFunc(
25038 sqlite3_context *context,
25039 int argc,
25040 sqlite3_value **argv
25041 ){
25042 char sign;
25043 int Y, M;
25044 DateTime d1, d2;
25045 sqlite3_str sRes;
25046 if( isDate(context, 1, argv, &d1) ) return;
 
25047 if( isDate(context, 1, &argv[1], &d2) ) return;
25048 computeYMD_HMS(&d1);
25049 computeYMD_HMS(&d2);
25050 if( d1.iJD>=d2.iJD ){
25051 sign = '+';
@@ -25063,11 +25073,11 @@
25063 if( M!=0 ){
25064 d2.M = d1.M;
25065 d2.validJD = 0;
25066 computeJD(&d2);
25067 }
25068 if( d1.iJD<d2.iJD ){
25069 M--;
25070 if( M<0 ){
25071 M = 11;
25072 Y--;
25073 }
@@ -25078,12 +25088,12 @@
25078 }
25079 d2.validJD = 0;
25080 computeJD(&d2);
25081 }
25082 d1.iJD -= d2.iJD;
25083 d1.iJD += 148699540800000;
25084 }else{
25085 sign = '-';
25086 Y = d2.Y - d1.Y;
25087 if( Y ){
25088 d2.Y = d1.Y;
25089 d2.validJD = 0;
@@ -25097,11 +25107,11 @@
25097 if( M!=0 ){
25098 d2.M = d1.M;
25099 d2.validJD = 0;
25100 computeJD(&d2);
25101 }
25102 if( d1.iJD>d2.iJD ){
25103 M--;
25104 if( M<0 ){
25105 M = 11;
25106 Y--;
25107 }
@@ -25112,11 +25122,11 @@
25112 }
25113 d2.validJD = 0;
25114 computeJD(&d2);
25115 }
25116 d1.iJD = d2.iJD - d1.iJD;
25117 d1.iJD += 148699540800000;
25118 }
25119 d1.validYMD = 0;
25120 d1.validHMS = 0;
25121 d1.validTZ = 0;
25122 computeYMD_HMS(&d1);
@@ -48846,11 +48856,11 @@
48846
48847 /* Acquire an EXCLUSIVE lock
48848 */
48849 if( locktype==EXCLUSIVE_LOCK && res ){
48850 assert( pFile->locktype>=SHARED_LOCK );
48851 res = winUnlockReadLock(pFile);
48852 res = winLockFile(&pFile->h, SQLITE_LOCKFILE_FLAGS, SHARED_FIRST, 0,
48853 SHARED_SIZE, 0);
48854 if( res ){
48855 newLocktype = EXCLUSIVE_LOCK;
48856 }else{
@@ -60607,15 +60617,11 @@
60607 u8 *pPtr;
60608 Pager *pPager = 0; /* Pager object to allocate and return */
60609 int rc = SQLITE_OK; /* Return code */
60610 int tempFile = 0; /* True for temp files (incl. in-memory files) */
60611 int memDb = 0; /* True if this is an in-memory file */
60612 #ifndef SQLITE_OMIT_DESERIALIZE
60613 int memJM = 0; /* Memory journal mode */
60614 #else
60615 # define memJM 0
60616 #endif
60617 int readOnly = 0; /* True if this is a read-only file */
60618 int journalFileSize; /* Bytes to allocate for each journal fd */
60619 char *zPathname = 0; /* Full path to database file */
60620 int nPathname = 0; /* Number of bytes in zPathname */
60621 int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */
@@ -60730,16 +60736,17 @@
60730 ** The sqlite3_create_filename() interface and the databaseFilename() utility
60731 ** that is used by sqlite3_filename_database() and kin also depend on the
60732 ** specific formatting and order of the various filenames, so if the format
60733 ** changes here, be sure to change it there as well.
60734 */
 
60735 pPtr = (u8 *)sqlite3MallocZero(
60736 ROUND8(sizeof(*pPager)) + /* Pager structure */
60737 ROUND8(pcacheSize) + /* PCache object */
60738 ROUND8(pVfs->szOsFile) + /* The main db file */
60739 journalFileSize * 2 + /* The two journal files */
60740 sizeof(pPager) + /* Space to hold a pointer */
60741 4 + /* Database prefix */
60742 nPathname + 1 + /* database filename */
60743 nUriByte + /* query parameters */
60744 nPathname + 8 + 1 + /* Journal filename */
60745 #ifndef SQLITE_OMIT_WAL
@@ -60756,11 +60763,11 @@
60756 pPager->pPCache = (PCache*)pPtr; pPtr += ROUND8(pcacheSize);
60757 pPager->fd = (sqlite3_file*)pPtr; pPtr += ROUND8(pVfs->szOsFile);
60758 pPager->sjfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
60759 pPager->jfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
60760 assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) );
60761 memcpy(pPtr, &pPager, sizeof(pPager)); pPtr += sizeof(pPager);
60762
60763 /* Fill in the Pager.zFilename and pPager.zQueryParam fields */
60764 pPtr += 4; /* Skip zero prefix */
60765 pPager->zFilename = (char*)pPtr;
60766 if( nPathname>0 ){
@@ -60810,13 +60817,11 @@
60810 */
60811 if( zFilename && zFilename[0] ){
60812 int fout = 0; /* VFS flags returned by xOpen() */
60813 rc = sqlite3OsOpen(pVfs, pPager->zFilename, pPager->fd, vfsFlags, &fout);
60814 assert( !memDb );
60815 #ifndef SQLITE_OMIT_DESERIALIZE
60816 pPager->memVfs = memJM = (fout&SQLITE_OPEN_MEMORY)!=0;
60817 #endif
60818 readOnly = (fout&SQLITE_OPEN_READONLY)!=0;
60819
60820 /* If the file was successfully opened for read/write access,
60821 ** choose a default page size in case we have to create the
60822 ** database file. The default page size is the maximum of:
@@ -71538,10 +71543,13 @@
71538 assert( sizeof(i64)==8 );
71539 assert( sizeof(u64)==8 );
71540 assert( sizeof(u32)==4 );
71541 assert( sizeof(u16)==2 );
71542 assert( sizeof(Pgno)==4 );
 
 
 
71543
71544 pBt = sqlite3MallocZero( sizeof(*pBt) );
71545 if( pBt==0 ){
71546 rc = SQLITE_NOMEM_BKPT;
71547 goto btree_open_out;
@@ -76385,11 +76393,11 @@
76385 assert( i<iEnd );
76386 j = get2byte(&aData[hdr+5]);
76387 if( NEVER(j>(u32)usableSize) ){ j = 0; }
76388 memcpy(&pTmp[j], &aData[j], usableSize - j);
76389
76390 for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
76391 pSrcEnd = pCArray->apEnd[k];
76392
76393 pData = pEnd;
76394 while( 1/*exit by break*/ ){
76395 u8 *pCell = pCArray->apCell[i];
@@ -76468,11 +76476,11 @@
76468 int iEnd = iFirst + nCell; /* End of loop. One past last cell to ins */
76469 int k; /* Current slot in pCArray->apEnd[] */
76470 u8 *pEnd; /* Maximum extent of cell data */
76471 assert( CORRUPT_DB || pPg->hdrOffset==0 ); /* Never called on page 1 */
76472 if( iEnd<=iFirst ) return 0;
76473 for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
76474 pEnd = pCArray->apEnd[k];
76475 while( 1 /*Exit by break*/ ){
76476 int sz, rc;
76477 u8 *pSlot;
76478 assert( pCArray->szCell[i]!=0 );
@@ -77578,11 +77586,11 @@
77578 }
77579 }
77580 iOvflSpace += sz;
77581 assert( sz<=pBt->maxLocal+23 );
77582 assert( iOvflSpace <= (int)pBt->pageSize );
77583 for(k=0; b.ixNx[k]<=j && ALWAYS(k<NB*2); k++){}
77584 pSrcEnd = b.apEnd[k];
77585 if( SQLITE_WITHIN(pSrcEnd, pCell, pCell+sz) ){
77586 rc = SQLITE_CORRUPT_BKPT;
77587 goto balance_cleanup;
77588 }
@@ -77614,10 +77622,12 @@
77614 ** pass.
77615 */
77616 for(i=1-nNew; i<nNew; i++){
77617 int iPg = i<0 ? -i : i;
77618 assert( iPg>=0 && iPg<nNew );
 
 
77619 if( abDone[iPg] ) continue; /* Skip pages already processed */
77620 if( i>=0 /* On the upwards pass, or... */
77621 || cntOld[iPg-1]>=cntNew[iPg-1] /* Condition (1) is true */
77622 ){
77623 int iNew;
@@ -107349,10 +107359,19 @@
107349 p->flags |= EP_Propagate & sqlite3ExprListFlags(p->x.pList);
107350 }
107351 }
107352 #define exprSetHeight(y)
107353 #endif /* SQLITE_MAX_EXPR_DEPTH>0 */
 
 
 
 
 
 
 
 
 
107354
107355 /*
107356 ** This routine is the core allocator for Expr nodes.
107357 **
107358 ** Construct a new expression node and return a pointer to it. Memory
@@ -111093,11 +111112,11 @@
111093 #endif
111094 if( pDef==0 || pDef->xFinalize!=0 ){
111095 sqlite3ErrorMsg(pParse, "unknown function: %#T()", pExpr);
111096 break;
111097 }
111098 if( pDef->funcFlags & SQLITE_FUNC_INLINE ){
111099 assert( (pDef->funcFlags & SQLITE_FUNC_UNSAFE)==0 );
111100 assert( (pDef->funcFlags & SQLITE_FUNC_DIRECT)==0 );
111101 return exprCodeInlineFunction(pParse, pFarg,
111102 SQLITE_PTR_TO_INT(pDef->pUserData), target);
111103 }else if( pDef->funcFlags & (SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE) ){
@@ -113796,11 +113815,11 @@
113796 }
113797 assert( IsOrdinaryTable(pNew) );
113798 pNew->u.tab.pDfltList = sqlite3ExprListDup(db, pTab->u.tab.pDfltList, 0);
113799 pNew->pSchema = db->aDb[iDb].pSchema;
113800 pNew->u.tab.addColOffset = pTab->u.tab.addColOffset;
113801 pNew->nTabRef = 1;
113802
113803 exit_begin_add_column:
113804 sqlite3SrcListDelete(db, pSrc);
113805 return;
113806 }
@@ -125175,11 +125194,11 @@
125175 if( sNC.ncFlags & NC_Subquery ) bComplex = 1;
125176 wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW);
125177 if( HasRowid(pTab) ){
125178 /* For a rowid table, initialize the RowSet to an empty set */
125179 pPk = 0;
125180 nPk = 1;
125181 iRowSet = ++pParse->nMem;
125182 sqlite3VdbeAddOp2(v, OP_Null, 0, iRowSet);
125183 }else{
125184 /* For a WITHOUT ROWID table, create an ephemeral table used to
125185 ** hold all primary keys for rows to be deleted. */
@@ -129658,13 +129677,12 @@
129658 /* Remove the FK from the fkeyHash hash table. */
129659 if( db->pnBytesFreed==0 ){
129660 if( pFKey->pPrevTo ){
129661 pFKey->pPrevTo->pNextTo = pFKey->pNextTo;
129662 }else{
129663 void *p = (void *)pFKey->pNextTo;
129664 const char *z = (p ? pFKey->pNextTo->zTo : pFKey->zTo);
129665 sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, p);
129666 }
129667 if( pFKey->pNextTo ){
129668 pFKey->pNextTo->pPrevTo = pFKey->pPrevTo;
129669 }
129670 }
@@ -132346,10 +132364,12 @@
132346 Index *pIdx;
132347 Vdbe *v;
132348
132349 assert( op==OP_OpenRead || op==OP_OpenWrite );
132350 assert( op==OP_OpenWrite || p5==0 );
 
 
132351 if( IsVirtual(pTab) ){
132352 /* This routine is a no-op for virtual tables. Leave the output
132353 ** variables *piDataCur and *piIdxCur set to illegal cursor numbers
132354 ** for improved error detection. */
132355 *piDataCur = *piIdxCur = -999;
@@ -132358,22 +132378,22 @@
132358 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
132359 v = pParse->pVdbe;
132360 assert( v!=0 );
132361 if( iBase<0 ) iBase = pParse->nTab;
132362 iDataCur = iBase++;
132363 if( piDataCur ) *piDataCur = iDataCur;
132364 if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){
132365 sqlite3OpenTable(pParse, iDataCur, iDb, pTab, op);
132366 }else{
132367 sqlite3TableLock(pParse, iDb, pTab->tnum, op==OP_OpenWrite, pTab->zName);
132368 }
132369 if( piIdxCur ) *piIdxCur = iBase;
132370 for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
132371 int iIdxCur = iBase++;
132372 assert( pIdx->pSchema==pTab->pSchema );
132373 if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
132374 if( piDataCur ) *piDataCur = iIdxCur;
132375 p5 = 0;
132376 }
132377 if( aToOpen==0 || aToOpen[i+1] ){
132378 sqlite3VdbeAddOp3(v, op, iIdxCur, pIdx->tnum, iDb);
132379 sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
@@ -145379,14 +145399,20 @@
145379 }else{
145380 /* This expression is a "*" or a "TABLE.*" and needs to be
145381 ** expanded. */
145382 int tableSeen = 0; /* Set to 1 when TABLE matches */
145383 char *zTName = 0; /* text of name of TABLE */
 
145384 if( pE->op==TK_DOT ){
145385 assert( pE->pLeft!=0 );
145386 assert( !ExprHasProperty(pE->pLeft, EP_IntValue) );
145387 zTName = pE->pLeft->u.zToken;
 
 
 
 
 
145388 }
145389 for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
145390 Table *pTab = pFrom->pTab; /* Table for this data source */
145391 ExprList *pNestedFrom; /* Result-set of a nested FROM clause */
145392 char *zTabName; /* AS name for this data source */
@@ -145419,10 +145445,11 @@
145419 int ii;
145420 pUsing = pFrom[1].u3.pUsing;
145421 for(ii=0; ii<pUsing->nId; ii++){
145422 const char *zUName = pUsing->a[ii].zName;
145423 pRight = sqlite3Expr(db, TK_ID, zUName);
 
145424 pNew = sqlite3ExprListAppend(pParse, pNew, pRight);
145425 if( pNew ){
145426 struct ExprList_item *pX = &pNew->a[pNew->nExpr-1];
145427 assert( pX->zEName==0 );
145428 pX->zEName = sqlite3MPrintf(db,"..%s", zUName);
@@ -145491,10 +145518,11 @@
145491 pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pExpr);
145492 }
145493 }else{
145494 pExpr = pRight;
145495 }
 
145496 pNew = sqlite3ExprListAppend(pParse, pNew, pExpr);
145497 if( pNew==0 ){
145498 break; /* OOM */
145499 }
145500 pX = &pNew->a[pNew->nExpr-1];
@@ -150150,10 +150178,12 @@
150150 sqlite3WhereEnd(pWInfo);
150151 }
150152
150153 if( !isView ){
150154 int addrOnce = 0;
 
 
150155
150156 /* Open every index that needs updating. */
150157 if( eOnePass!=ONEPASS_OFF ){
150158 if( aiCurOnePass[0]>=0 ) aToOpen[aiCurOnePass[0]-iBaseCur] = 0;
150159 if( aiCurOnePass[1]>=0 ) aToOpen[aiCurOnePass[1]-iBaseCur] = 0;
@@ -150161,11 +150191,11 @@
150161
150162 if( eOnePass==ONEPASS_MULTI && (nIdx-(aiCurOnePass[1]>=0))>0 ){
150163 addrOnce = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
150164 }
150165 sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenWrite, 0, iBaseCur,
150166 aToOpen, 0, 0);
150167 if( addrOnce ){
150168 sqlite3VdbeJumpHereOrPopInst(v, addrOnce);
150169 }
150170 }
150171
@@ -156449,11 +156479,11 @@
156449 ** a single escape character. The second condition is necessary so
156450 ** that we can increment the prefix key to find an upper bound for the
156451 ** range search. The third is because the caller assumes that the pattern
156452 ** consists of at least one character after all escapes have been
156453 ** removed. */
156454 if( cnt!=0 && 255!=(u8)z[cnt-1] && (cnt>1 || z[0]!=wc[3]) ){
156455 Expr *pPrefix;
156456
156457 /* A "complete" match if the pattern ends with "*" or "%" */
156458 *pisComplete = c==wc[0] && z[cnt+1]==0;
156459
@@ -168543,11 +168573,11 @@
168543 #define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
168544 #define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
168545 #define YYFALLBACK 1
168546 #define YYNSTATE 575
168547 #define YYNRULE 403
168548 #define YYNRULE_WITH_ACTION 340
168549 #define YYNTOKEN 185
168550 #define YY_MAX_SHIFT 574
168551 #define YY_MIN_SHIFTREDUCE 833
168552 #define YY_MAX_SHIFTREDUCE 1235
168553 #define YY_ERROR_ACTION 1236
@@ -168625,140 +168655,140 @@
168625 static const YYACTIONTYPE yy_action[] = {
168626 /* 0 */ 568, 208, 568, 118, 115, 229, 568, 118, 115, 229,
168627 /* 10 */ 568, 1310, 377, 1289, 408, 562, 562, 562, 568, 409,
168628 /* 20 */ 378, 1310, 1272, 41, 41, 41, 41, 208, 1520, 71,
168629 /* 30 */ 71, 969, 419, 41, 41, 491, 303, 279, 303, 970,
168630 /* 40 */ 397, 71, 71, 125, 126, 80, 1212, 1212, 1047, 1050,
168631 /* 50 */ 1037, 1037, 123, 123, 124, 124, 124, 124, 476, 409,
168632 /* 60 */ 1237, 1, 1, 574, 2, 1241, 550, 118, 115, 229,
168633 /* 70 */ 317, 480, 146, 480, 524, 118, 115, 229, 529, 1323,
168634 /* 80 */ 417, 523, 142, 125, 126, 80, 1212, 1212, 1047, 1050,
168635 /* 90 */ 1037, 1037, 123, 123, 124, 124, 124, 124, 118, 115,
168636 /* 100 */ 229, 327, 122, 122, 122, 122, 121, 121, 120, 120,
168637 /* 110 */ 120, 119, 116, 444, 284, 284, 284, 284, 442, 442,
168638 /* 120 */ 442, 1561, 376, 1563, 1188, 375, 1159, 565, 1159, 565,
168639 /* 130 */ 409, 1561, 537, 259, 226, 444, 101, 145, 449, 316,
168640 /* 140 */ 559, 240, 122, 122, 122, 122, 121, 121, 120, 120,
168641 /* 150 */ 120, 119, 116, 444, 125, 126, 80, 1212, 1212, 1047,
168642 /* 160 */ 1050, 1037, 1037, 123, 123, 124, 124, 124, 124, 142,
168643 /* 170 */ 294, 1188, 339, 448, 120, 120, 120, 119, 116, 444,
168644 /* 180 */ 127, 1188, 1189, 1188, 148, 441, 440, 568, 119, 116,
168645 /* 190 */ 444, 124, 124, 124, 124, 117, 122, 122, 122, 122,
168646 /* 200 */ 121, 121, 120, 120, 120, 119, 116, 444, 454, 113,
168647 /* 210 */ 13, 13, 546, 122, 122, 122, 122, 121, 121, 120,
168648 /* 220 */ 120, 120, 119, 116, 444, 422, 316, 559, 1188, 1189,
168649 /* 230 */ 1188, 149, 1220, 409, 1220, 124, 124, 124, 124, 122,
168650 /* 240 */ 122, 122, 122, 121, 121, 120, 120, 120, 119, 116,
168651 /* 250 */ 444, 465, 342, 1034, 1034, 1048, 1051, 125, 126, 80,
168652 /* 260 */ 1212, 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124,
168653 /* 270 */ 124, 124, 1275, 522, 222, 1188, 568, 409, 224, 514,
168654 /* 280 */ 175, 82, 83, 122, 122, 122, 122, 121, 121, 120,
168655 /* 290 */ 120, 120, 119, 116, 444, 1005, 16, 16, 1188, 133,
168656 /* 300 */ 133, 125, 126, 80, 1212, 1212, 1047, 1050, 1037, 1037,
168657 /* 310 */ 123, 123, 124, 124, 124, 124, 122, 122, 122, 122,
168658 /* 320 */ 121, 121, 120, 120, 120, 119, 116, 444, 1038, 546,
168659 /* 330 */ 1188, 373, 1188, 1189, 1188, 252, 1429, 399, 504, 501,
168660 /* 340 */ 500, 111, 560, 566, 4, 924, 924, 433, 499, 340,
168661 /* 350 */ 460, 328, 360, 394, 1233, 1188, 1189, 1188, 563, 568,
168662 /* 360 */ 122, 122, 122, 122, 121, 121, 120, 120, 120, 119,
168663 /* 370 */ 116, 444, 284, 284, 369, 1574, 1600, 441, 440, 154,
168664 /* 380 */ 409, 445, 71, 71, 1282, 565, 1217, 1188, 1189, 1188,
168665 /* 390 */ 85, 1219, 271, 557, 543, 515, 1555, 568, 98, 1218,
168666 /* 400 */ 6, 1274, 472, 142, 125, 126, 80, 1212, 1212, 1047,
168667 /* 410 */ 1050, 1037, 1037, 123, 123, 124, 124, 124, 124, 550,
168668 /* 420 */ 13, 13, 1024, 507, 1220, 1188, 1220, 549, 109, 109,
168669 /* 430 */ 222, 568, 1234, 175, 568, 427, 110, 197, 445, 569,
168670 /* 440 */ 445, 430, 1546, 1014, 325, 551, 1188, 270, 287, 368,
168671 /* 450 */ 510, 363, 509, 257, 71, 71, 543, 71, 71, 359,
168672 /* 460 */ 316, 559, 1606, 122, 122, 122, 122, 121, 121, 120,
168673 /* 470 */ 120, 120, 119, 116, 444, 1014, 1014, 1016, 1017, 27,
168674 /* 480 */ 284, 284, 1188, 1189, 1188, 1154, 568, 1605, 409, 899,
168675 /* 490 */ 190, 550, 356, 565, 550, 935, 533, 517, 1154, 516,
168676 /* 500 */ 413, 1154, 552, 1188, 1189, 1188, 568, 544, 1548, 51,
168677 /* 510 */ 51, 214, 125, 126, 80, 1212, 1212, 1047, 1050, 1037,
168678 /* 520 */ 1037, 123, 123, 124, 124, 124, 124, 1188, 474, 135,
168679 /* 530 */ 135, 409, 284, 284, 1484, 505, 121, 121, 120, 120,
168680 /* 540 */ 120, 119, 116, 444, 1005, 565, 518, 217, 541, 1555,
168681 /* 550 */ 316, 559, 142, 6, 532, 125, 126, 80, 1212, 1212,
168682 /* 560 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168683 /* 570 */ 1549, 122, 122, 122, 122, 121, 121, 120, 120, 120,
168684 /* 580 */ 119, 116, 444, 485, 1188, 1189, 1188, 482, 281, 1263,
168685 /* 590 */ 955, 252, 1188, 373, 504, 501, 500, 1188, 340, 570,
168686 /* 600 */ 1188, 570, 409, 292, 499, 955, 874, 191, 480, 316,
168687 /* 610 */ 559, 384, 290, 380, 122, 122, 122, 122, 121, 121,
168688 /* 620 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1212,
168689 /* 630 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168690 /* 640 */ 124, 409, 394, 1132, 1188, 867, 100, 284, 284, 1188,
168691 /* 650 */ 1189, 1188, 373, 1089, 1188, 1189, 1188, 1188, 1189, 1188,
168692 /* 660 */ 565, 455, 32, 373, 233, 125, 126, 80, 1212, 1212,
168693 /* 670 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168694 /* 680 */ 1428, 957, 568, 228, 956, 122, 122, 122, 122, 121,
168695 /* 690 */ 121, 120, 120, 120, 119, 116, 444, 1154, 228, 1188,
168696 /* 700 */ 157, 1188, 1189, 1188, 1547, 13, 13, 301, 955, 1228,
168697 /* 710 */ 1154, 153, 409, 1154, 373, 1577, 1172, 5, 369, 1574,
168698 /* 720 */ 429, 1234, 3, 955, 122, 122, 122, 122, 121, 121,
168699 /* 730 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1212,
168700 /* 740 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168701 /* 750 */ 124, 409, 208, 567, 1188, 1025, 1188, 1189, 1188, 1188,
168702 /* 760 */ 388, 850, 155, 1546, 286, 402, 1094, 1094, 488, 568,
168703 /* 770 */ 465, 342, 1315, 1315, 1546, 125, 126, 80, 1212, 1212,
168704 /* 780 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168705 /* 790 */ 129, 568, 13, 13, 374, 122, 122, 122, 122, 121,
168706 /* 800 */ 121, 120, 120, 120, 119, 116, 444, 302, 568, 453,
168707 /* 810 */ 528, 1188, 1189, 1188, 13, 13, 1188, 1189, 1188, 1293,
168708 /* 820 */ 463, 1263, 409, 1313, 1313, 1546, 1010, 453, 452, 200,
168709 /* 830 */ 299, 71, 71, 1261, 122, 122, 122, 122, 121, 121,
168710 /* 840 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1212,
168711 /* 850 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168712 /* 860 */ 124, 409, 227, 1069, 1154, 284, 284, 419, 312, 278,
168713 /* 870 */ 278, 285, 285, 1415, 406, 405, 382, 1154, 565, 568,
168714 /* 880 */ 1154, 1191, 565, 1594, 565, 125, 126, 80, 1212, 1212,
168715 /* 890 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168716 /* 900 */ 453, 1476, 13, 13, 1530, 122, 122, 122, 122, 121,
168717 /* 910 */ 121, 120, 120, 120, 119, 116, 444, 201, 568, 354,
168718 /* 920 */ 1580, 574, 2, 1241, 838, 839, 840, 1556, 317, 1207,
168719 /* 930 */ 146, 6, 409, 255, 254, 253, 206, 1323, 9, 1191,
168720 /* 940 */ 262, 71, 71, 424, 122, 122, 122, 122, 121, 121,
168721 /* 950 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1212,
168722 /* 960 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168723 /* 970 */ 124, 568, 284, 284, 568, 1208, 409, 573, 313, 1241,
168724 /* 980 */ 349, 1292, 352, 419, 317, 565, 146, 491, 525, 1637,
168725 /* 990 */ 395, 371, 491, 1323, 70, 70, 1291, 71, 71, 240,
168726 /* 1000 */ 1321, 104, 80, 1212, 1212, 1047, 1050, 1037, 1037, 123,
168727 /* 1010 */ 123, 124, 124, 124, 124, 122, 122, 122, 122, 121,
168728 /* 1020 */ 121, 120, 120, 120, 119, 116, 444, 1110, 284, 284,
168729 /* 1030 */ 428, 448, 1519, 1208, 439, 284, 284, 1483, 1348, 311,
168730 /* 1040 */ 474, 565, 1111, 969, 491, 491, 217, 1259, 565, 1532,
168731 /* 1050 */ 568, 970, 207, 568, 1024, 240, 383, 1112, 519, 122,
168732 /* 1060 */ 122, 122, 122, 121, 121, 120, 120, 120, 119, 116,
168733 /* 1070 */ 444, 1015, 107, 71, 71, 1014, 13, 13, 910, 568,
168734 /* 1080 */ 1489, 568, 284, 284, 97, 526, 491, 448, 911, 1322,
168735 /* 1090 */ 1318, 545, 409, 284, 284, 565, 151, 209, 1489, 1491,
168736 /* 1100 */ 262, 450, 55, 55, 56, 56, 565, 1014, 1014, 1016,
168737 /* 1110 */ 443, 332, 409, 527, 12, 295, 125, 126, 80, 1212,
168738 /* 1120 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168739 /* 1130 */ 124, 347, 409, 862, 1528, 1208, 125, 126, 80, 1212,
168740 /* 1140 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168741 /* 1150 */ 124, 1133, 1635, 474, 1635, 371, 125, 114, 80, 1212,
168742 /* 1160 */ 1212, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168743 /* 1170 */ 124, 1489, 329, 474, 331, 122, 122, 122, 122, 121,
168744 /* 1180 */ 121, 120, 120, 120, 119, 116, 444, 203, 1415, 568,
168745 /* 1190 */ 1290, 862, 464, 1208, 436, 122, 122, 122, 122, 121,
168746 /* 1200 */ 121, 120, 120, 120, 119, 116, 444, 553, 1133, 1636,
168747 /* 1210 */ 539, 1636, 15, 15, 890, 122, 122, 122, 122, 121,
168748 /* 1220 */ 121, 120, 120, 120, 119, 116, 444, 568, 298, 538,
168749 /* 1230 */ 1131, 1415, 1553, 1554, 1327, 409, 6, 6, 1165, 1264,
168750 /* 1240 */ 415, 320, 284, 284, 1415, 508, 565, 525, 300, 457,
168751 /* 1250 */ 43, 43, 568, 891, 12, 565, 330, 478, 425, 407,
168752 /* 1260 */ 126, 80, 1212, 1212, 1047, 1050, 1037, 1037, 123, 123,
168753 /* 1270 */ 124, 124, 124, 124, 568, 57, 57, 288, 1188, 1415,
168754 /* 1280 */ 496, 458, 392, 392, 391, 273, 389, 1131, 1552, 847,
168755 /* 1290 */ 1165, 407, 6, 568, 321, 1154, 470, 44, 44, 1551,
168756 /* 1300 */ 1110, 426, 234, 6, 323, 256, 540, 256, 1154, 431,
168757 /* 1310 */ 568, 1154, 322, 17, 487, 1111, 58, 58, 122, 122,
168758 /* 1320 */ 122, 122, 121, 121, 120, 120, 120, 119, 116, 444,
168759 /* 1330 */ 1112, 216, 481, 59, 59, 1188, 1189, 1188, 111, 560,
168760 /* 1340 */ 324, 4, 236, 456, 526, 568, 237, 456, 568, 437,
168761 /* 1350 */ 168, 556, 420, 141, 479, 563, 568, 293, 568, 1091,
168762 /* 1360 */ 568, 293, 568, 1091, 531, 568, 870, 8, 60, 60,
168763 /* 1370 */ 235, 61, 61, 568, 414, 568, 414, 568, 445, 62,
168764 /* 1380 */ 62, 45, 45, 46, 46, 47, 47, 199, 49, 49,
@@ -168768,73 +168798,73 @@
168768 /* 1420 */ 568, 512, 930, 870, 1015, 109, 109, 929, 1014, 66,
168769 /* 1430 */ 66, 131, 131, 110, 451, 445, 569, 445, 416, 177,
168770 /* 1440 */ 1014, 132, 132, 67, 67, 568, 467, 568, 930, 471,
168771 /* 1450 */ 1360, 283, 226, 929, 315, 1359, 407, 568, 459, 407,
168772 /* 1460 */ 1014, 1014, 1016, 239, 407, 86, 213, 1346, 52, 52,
168773 /* 1470 */ 68, 68, 1014, 1014, 1016, 1017, 27, 1579, 1176, 447,
168774 /* 1480 */ 69, 69, 288, 97, 108, 1535, 106, 392, 392, 391,
168775 /* 1490 */ 273, 389, 568, 877, 847, 881, 568, 111, 560, 466,
168776 /* 1500 */ 4, 568, 152, 30, 38, 568, 1128, 234, 396, 323,
168777 /* 1510 */ 111, 560, 527, 4, 563, 53, 53, 322, 568, 163,
168778 /* 1520 */ 163, 568, 337, 468, 164, 164, 333, 563, 76, 76,
168779 /* 1530 */ 568, 289, 1508, 568, 31, 1507, 568, 445, 338, 483,
168780 /* 1540 */ 100, 54, 54, 344, 72, 72, 296, 236, 1076, 557,
168781 /* 1550 */ 445, 877, 1356, 134, 134, 168, 73, 73, 141, 161,
168782 /* 1560 */ 161, 1568, 557, 535, 568, 319, 568, 348, 536, 1007,
168783 /* 1570 */ 473, 261, 261, 889, 888, 235, 535, 568, 1024, 568,
168784 /* 1580 */ 475, 534, 261, 367, 109, 109, 521, 136, 136, 130,
168785 /* 1590 */ 130, 1024, 110, 366, 445, 569, 445, 109, 109, 1014,
168786 /* 1600 */ 162, 162, 156, 156, 568, 110, 1076, 445, 569, 445,
168787 /* 1610 */ 410, 351, 1014, 568, 353, 316, 559, 568, 343, 568,
168788 /* 1620 */ 100, 497, 357, 258, 100, 896, 897, 140, 140, 355,
168789 /* 1630 */ 1306, 1014, 1014, 1016, 1017, 27, 139, 139, 362, 451,
168790 /* 1640 */ 137, 137, 138, 138, 1014, 1014, 1016, 1017, 27, 1176,
168791 /* 1650 */ 447, 568, 372, 288, 111, 560, 1018, 4, 392, 392,
168792 /* 1660 */ 391, 273, 389, 568, 1137, 847, 568, 1072, 568, 258,
168793 /* 1670 */ 492, 563, 568, 211, 75, 75, 555, 960, 234, 261,
168794 /* 1680 */ 323, 111, 560, 927, 4, 113, 77, 77, 322, 74,
168795 /* 1690 */ 74, 42, 42, 1369, 445, 48, 48, 1414, 563, 972,
168796 /* 1700 */ 973, 1088, 1087, 1088, 1087, 860, 557, 150, 928, 1342,
168797 /* 1710 */ 113, 1354, 554, 1419, 1018, 1271, 1262, 1250, 236, 1249,
168798 /* 1720 */ 1251, 445, 1587, 1339, 308, 276, 168, 309, 11, 141,
168799 /* 1730 */ 393, 310, 232, 557, 1401, 1024, 335, 291, 1396, 219,
168800 /* 1740 */ 336, 109, 109, 934, 297, 1406, 235, 341, 477, 110,
168801 /* 1750 */ 502, 445, 569, 445, 1389, 1405, 1014, 400, 1289, 365,
168802 /* 1760 */ 223, 1480, 1024, 1479, 1351, 1352, 1350, 1349, 109, 109,
168803 /* 1770 */ 204, 1590, 1228, 558, 265, 218, 110, 205, 445, 569,
168804 /* 1780 */ 445, 410, 387, 1014, 1527, 179, 316, 559, 1014, 1014,
168805 /* 1790 */ 1016, 1017, 27, 230, 1525, 1225, 79, 560, 85, 4,
168806 /* 1800 */ 418, 215, 548, 81, 84, 188, 1402, 173, 181, 461,
168807 /* 1810 */ 451, 35, 462, 563, 183, 1014, 1014, 1016, 1017, 27,
168808 /* 1820 */ 184, 1485, 185, 186, 495, 242, 98, 398, 1408, 36,
168809 /* 1830 */ 1407, 484, 91, 469, 401, 1410, 445, 192, 1474, 246,
168810 /* 1840 */ 1496, 490, 346, 277, 248, 196, 493, 511, 557, 350,
168811 /* 1850 */ 1252, 249, 250, 403, 1309, 1308, 111, 560, 432, 4,
168812 /* 1860 */ 1307, 1300, 93, 1604, 881, 1603, 224, 404, 434, 520,
168813 /* 1870 */ 263, 435, 1573, 563, 1279, 1278, 364, 1024, 306, 1277,
168814 /* 1880 */ 264, 1602, 1559, 109, 109, 370, 1299, 307, 1558, 438,
168815 /* 1890 */ 128, 110, 1374, 445, 569, 445, 445, 546, 1014, 10,
168816 /* 1900 */ 1461, 105, 381, 1373, 34, 571, 99, 1332, 557, 314,
168817 /* 1910 */ 1182, 530, 272, 274, 379, 210, 1331, 547, 385, 386,
168818 /* 1920 */ 275, 572, 1247, 1242, 411, 412, 1512, 165, 178, 1513,
168819 /* 1930 */ 1014, 1014, 1016, 1017, 27, 1511, 1510, 1024, 78, 147,
168820 /* 1940 */ 166, 220, 221, 109, 109, 834, 304, 167, 446, 212,
168821 /* 1950 */ 318, 110, 231, 445, 569, 445, 144, 1086, 1014, 1084,
168822 /* 1960 */ 326, 180, 169, 1207, 182, 334, 238, 913, 241, 1100,
168823 /* 1970 */ 187, 170, 171, 421, 87, 88, 423, 189, 89, 90,
168824 /* 1980 */ 172, 1103, 243, 1099, 244, 158, 18, 245, 345, 247,
168825 /* 1990 */ 1014, 1014, 1016, 1017, 27, 261, 1092, 193, 1222, 489,
168826 /* 2000 */ 194, 37, 366, 849, 494, 251, 195, 506, 92, 19,
168827 /* 2010 */ 498, 358, 20, 503, 879, 361, 94, 892, 305, 159,
168828 /* 2020 */ 513, 39, 95, 1170, 160, 1053, 964, 1139, 96, 174,
168829 /* 2030 */ 1138, 225, 280, 282, 198, 958, 113, 1160, 1156, 260,
168830 /* 2040 */ 21, 22, 23, 1158, 1164, 1163, 1144, 24, 33, 25,
168831 /* 2050 */ 202, 542, 26, 100, 1067, 102, 1054, 103, 7, 1052,
168832 /* 2060 */ 1056, 1109, 1057, 1108, 266, 267, 28, 40, 390, 1019,
168833 /* 2070 */ 861, 112, 29, 564, 1178, 1177, 268, 176, 143, 923,
168834 /* 2080 */ 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238,
168835 /* 2090 */ 1238, 1238, 1238, 1238, 269, 1595,
168836 };
168837 static const YYCODETYPE yy_lookahead[] = {
168838 /* 0 */ 193, 193, 193, 274, 275, 276, 193, 274, 275, 276,
168839 /* 10 */ 193, 223, 219, 225, 206, 210, 211, 212, 193, 19,
168840 /* 20 */ 219, 233, 216, 216, 217, 216, 217, 193, 295, 216,
@@ -169173,67 +169203,67 @@
169173 /* 380 */ 1665, 1623, 1702, 1630, 1666, 1667, 1671, 1673, 1703, 1718,
169174 /* 390 */ 1719, 1729, 1730, 1731, 1621, 1622, 1628, 1720, 1713, 1716,
169175 /* 400 */ 1722, 1723, 1733, 1717, 1724, 1727, 1728, 1725, 1740,
169176 };
169177 static const YYACTIONTYPE yy_default[] = {
169178 /* 0 */ 1641, 1641, 1641, 1469, 1236, 1347, 1236, 1236, 1236, 1469,
169179 /* 10 */ 1469, 1469, 1236, 1377, 1377, 1522, 1269, 1236, 1236, 1236,
169180 /* 20 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1468, 1236, 1236,
169181 /* 30 */ 1236, 1236, 1557, 1557, 1236, 1236, 1236, 1236, 1236, 1236,
169182 /* 40 */ 1236, 1236, 1386, 1236, 1393, 1236, 1236, 1236, 1236, 1236,
169183 /* 50 */ 1470, 1471, 1236, 1236, 1236, 1521, 1523, 1486, 1400, 1399,
169184 /* 60 */ 1398, 1397, 1504, 1365, 1391, 1384, 1388, 1465, 1466, 1464,
169185 /* 70 */ 1619, 1471, 1470, 1236, 1387, 1433, 1449, 1432, 1236, 1236,
169186 /* 80 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169187 /* 90 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169188 /* 100 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169189 /* 110 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169190 /* 120 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169191 /* 130 */ 1441, 1448, 1447, 1446, 1455, 1445, 1442, 1435, 1434, 1436,
169192 /* 140 */ 1437, 1236, 1236, 1260, 1236, 1236, 1257, 1311, 1236, 1236,
169193 /* 150 */ 1236, 1236, 1236, 1541, 1540, 1236, 1438, 1236, 1269, 1427,
169194 /* 160 */ 1426, 1452, 1439, 1451, 1450, 1529, 1593, 1592, 1487, 1236,
169195 /* 170 */ 1236, 1236, 1236, 1236, 1236, 1557, 1236, 1236, 1236, 1236,
169196 /* 180 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169197 /* 190 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1367,
169198 /* 200 */ 1557, 1557, 1236, 1269, 1557, 1557, 1368, 1368, 1265, 1265,
169199 /* 210 */ 1371, 1236, 1536, 1338, 1338, 1338, 1338, 1347, 1338, 1236,
169200 /* 220 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169201 /* 230 */ 1236, 1236, 1236, 1236, 1526, 1524, 1236, 1236, 1236, 1236,
169202 /* 240 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169203 /* 250 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169204 /* 260 */ 1236, 1236, 1236, 1343, 1236, 1236, 1236, 1236, 1236, 1236,
169205 /* 270 */ 1236, 1236, 1236, 1236, 1236, 1586, 1236, 1499, 1325, 1343,
169206 /* 280 */ 1343, 1343, 1343, 1345, 1326, 1324, 1337, 1270, 1243, 1633,
169207 /* 290 */ 1403, 1392, 1344, 1392, 1630, 1390, 1403, 1403, 1390, 1403,
169208 /* 300 */ 1344, 1630, 1286, 1608, 1281, 1377, 1377, 1377, 1367, 1367,
169209 /* 310 */ 1367, 1367, 1371, 1371, 1467, 1344, 1337, 1236, 1633, 1633,
169210 /* 320 */ 1353, 1353, 1632, 1632, 1353, 1487, 1616, 1412, 1314, 1320,
169211 /* 330 */ 1320, 1320, 1320, 1353, 1254, 1390, 1616, 1616, 1390, 1412,
169212 /* 340 */ 1314, 1390, 1314, 1390, 1353, 1254, 1503, 1627, 1353, 1254,
169213 /* 350 */ 1477, 1353, 1254, 1353, 1254, 1477, 1312, 1312, 1312, 1301,
169214 /* 360 */ 1236, 1236, 1477, 1312, 1286, 1312, 1301, 1312, 1312, 1575,
169215 /* 370 */ 1236, 1481, 1481, 1477, 1353, 1567, 1567, 1380, 1380, 1385,
169216 /* 380 */ 1371, 1472, 1353, 1236, 1385, 1383, 1381, 1390, 1304, 1589,
169217 /* 390 */ 1589, 1585, 1585, 1585, 1638, 1638, 1536, 1601, 1269, 1269,
169218 /* 400 */ 1269, 1269, 1601, 1288, 1288, 1270, 1270, 1269, 1601, 1236,
169219 /* 410 */ 1236, 1236, 1236, 1236, 1236, 1596, 1236, 1531, 1488, 1357,
169220 /* 420 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169221 /* 430 */ 1236, 1236, 1236, 1236, 1542, 1236, 1236, 1236, 1236, 1236,
169222 /* 440 */ 1236, 1236, 1236, 1236, 1236, 1417, 1236, 1239, 1533, 1236,
169223 /* 450 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1394, 1395, 1358,
169224 /* 460 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1409, 1236, 1236,
169225 /* 470 */ 1236, 1404, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169226 /* 480 */ 1629, 1236, 1236, 1236, 1236, 1236, 1236, 1502, 1501, 1236,
169227 /* 490 */ 1236, 1355, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169228 /* 500 */ 1236, 1236, 1236, 1236, 1236, 1284, 1236, 1236, 1236, 1236,
169229 /* 510 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169230 /* 520 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1382,
169231 /* 530 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169232 /* 540 */ 1236, 1236, 1236, 1236, 1572, 1372, 1236, 1236, 1236, 1236,
169233 /* 550 */ 1620, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169234 /* 560 */ 1236, 1236, 1236, 1236, 1236, 1612, 1328, 1418, 1236, 1421,
169235 /* 570 */ 1258, 1236, 1248, 1236, 1236,
169236 };
169237 /********** End of lemon-generated parsing tables *****************************/
169238
169239 /* The next table maps tokens (terminal symbols) into fallback tokens.
@@ -170158,104 +170188,104 @@
170158 /* 304 */ "wqas ::= AS MATERIALIZED",
170159 /* 305 */ "wqas ::= AS NOT MATERIALIZED",
170160 /* 306 */ "wqitem ::= nm eidlist_opt wqas LP select RP",
170161 /* 307 */ "wqlist ::= wqitem",
170162 /* 308 */ "wqlist ::= wqlist COMMA wqitem",
170163 /* 309 */ "windowdefn_list ::= windowdefn",
170164 /* 310 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
170165 /* 311 */ "windowdefn ::= nm AS LP window RP",
170166 /* 312 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
170167 /* 313 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
170168 /* 314 */ "window ::= ORDER BY sortlist frame_opt",
170169 /* 315 */ "window ::= nm ORDER BY sortlist frame_opt",
170170 /* 316 */ "window ::= frame_opt",
170171 /* 317 */ "window ::= nm frame_opt",
170172 /* 318 */ "frame_opt ::=",
170173 /* 319 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
170174 /* 320 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
170175 /* 321 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
170176 /* 322 */ "frame_bound_s ::= frame_bound",
170177 /* 323 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
170178 /* 324 */ "frame_bound_e ::= frame_bound",
170179 /* 325 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
170180 /* 326 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
170181 /* 327 */ "frame_bound ::= CURRENT ROW",
170182 /* 328 */ "frame_exclude_opt ::=",
170183 /* 329 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
170184 /* 330 */ "frame_exclude ::= NO OTHERS",
170185 /* 331 */ "frame_exclude ::= CURRENT ROW",
170186 /* 332 */ "frame_exclude ::= GROUP|TIES",
170187 /* 333 */ "window_clause ::= WINDOW windowdefn_list",
170188 /* 334 */ "filter_over ::= filter_clause over_clause",
170189 /* 335 */ "filter_over ::= over_clause",
170190 /* 336 */ "filter_over ::= filter_clause",
170191 /* 337 */ "over_clause ::= OVER LP window RP",
170192 /* 338 */ "over_clause ::= OVER nm",
170193 /* 339 */ "filter_clause ::= FILTER LP WHERE expr RP",
170194 /* 340 */ "input ::= cmdlist",
170195 /* 341 */ "cmdlist ::= cmdlist ecmd",
170196 /* 342 */ "cmdlist ::= ecmd",
170197 /* 343 */ "ecmd ::= SEMI",
170198 /* 344 */ "ecmd ::= cmdx SEMI",
170199 /* 345 */ "ecmd ::= explain cmdx SEMI",
170200 /* 346 */ "trans_opt ::=",
170201 /* 347 */ "trans_opt ::= TRANSACTION",
170202 /* 348 */ "trans_opt ::= TRANSACTION nm",
170203 /* 349 */ "savepoint_opt ::= SAVEPOINT",
170204 /* 350 */ "savepoint_opt ::=",
170205 /* 351 */ "cmd ::= create_table create_table_args",
170206 /* 352 */ "table_option_set ::= table_option",
170207 /* 353 */ "columnlist ::= columnlist COMMA columnname carglist",
170208 /* 354 */ "columnlist ::= columnname carglist",
170209 /* 355 */ "nm ::= ID|INDEXED|JOIN_KW",
170210 /* 356 */ "nm ::= STRING",
170211 /* 357 */ "typetoken ::= typename",
170212 /* 358 */ "typename ::= ID|STRING",
170213 /* 359 */ "signed ::= plus_num",
170214 /* 360 */ "signed ::= minus_num",
170215 /* 361 */ "carglist ::= carglist ccons",
170216 /* 362 */ "carglist ::=",
170217 /* 363 */ "ccons ::= NULL onconf",
170218 /* 364 */ "ccons ::= GENERATED ALWAYS AS generated",
170219 /* 365 */ "ccons ::= AS generated",
170220 /* 366 */ "conslist_opt ::= COMMA conslist",
170221 /* 367 */ "conslist ::= conslist tconscomma tcons",
170222 /* 368 */ "conslist ::= tcons",
170223 /* 369 */ "tconscomma ::=",
170224 /* 370 */ "defer_subclause_opt ::= defer_subclause",
170225 /* 371 */ "resolvetype ::= raisetype",
170226 /* 372 */ "selectnowith ::= oneselect",
170227 /* 373 */ "oneselect ::= values",
170228 /* 374 */ "sclp ::= selcollist COMMA",
170229 /* 375 */ "as ::= ID|STRING",
170230 /* 376 */ "indexed_opt ::= indexed_by",
170231 /* 377 */ "returning ::=",
170232 /* 378 */ "expr ::= term",
170233 /* 379 */ "likeop ::= LIKE_KW|MATCH",
170234 /* 380 */ "case_operand ::= expr",
170235 /* 381 */ "exprlist ::= nexprlist",
170236 /* 382 */ "nmnum ::= plus_num",
170237 /* 383 */ "nmnum ::= nm",
170238 /* 384 */ "nmnum ::= ON",
170239 /* 385 */ "nmnum ::= DELETE",
170240 /* 386 */ "nmnum ::= DEFAULT",
170241 /* 387 */ "plus_num ::= INTEGER|FLOAT",
170242 /* 388 */ "foreach_clause ::=",
170243 /* 389 */ "foreach_clause ::= FOR EACH ROW",
170244 /* 390 */ "trnm ::= nm",
170245 /* 391 */ "tridxby ::=",
170246 /* 392 */ "database_kw_opt ::= DATABASE",
170247 /* 393 */ "database_kw_opt ::=",
170248 /* 394 */ "kwcolumn_opt ::=",
170249 /* 395 */ "kwcolumn_opt ::= COLUMNKW",
170250 /* 396 */ "vtabarglist ::= vtabarg",
170251 /* 397 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
170252 /* 398 */ "vtabarg ::= vtabarg vtabargtoken",
170253 /* 399 */ "anylist ::=",
170254 /* 400 */ "anylist ::= anylist LP anylist RP",
170255 /* 401 */ "anylist ::= anylist ANY",
170256 /* 402 */ "with ::=",
170257 };
170258 #endif /* NDEBUG */
170259
170260
170261 #if YYSTACKDEPTH<=0
@@ -171067,104 +171097,104 @@
171067 305, /* (304) wqas ::= AS MATERIALIZED */
171068 305, /* (305) wqas ::= AS NOT MATERIALIZED */
171069 304, /* (306) wqitem ::= nm eidlist_opt wqas LP select RP */
171070 241, /* (307) wqlist ::= wqitem */
171071 241, /* (308) wqlist ::= wqlist COMMA wqitem */
171072 306, /* (309) windowdefn_list ::= windowdefn */
171073 306, /* (310) windowdefn_list ::= windowdefn_list COMMA windowdefn */
171074 307, /* (311) windowdefn ::= nm AS LP window RP */
171075 308, /* (312) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
171076 308, /* (313) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
171077 308, /* (314) window ::= ORDER BY sortlist frame_opt */
171078 308, /* (315) window ::= nm ORDER BY sortlist frame_opt */
171079 308, /* (316) window ::= frame_opt */
171080 308, /* (317) window ::= nm frame_opt */
171081 309, /* (318) frame_opt ::= */
171082 309, /* (319) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
171083 309, /* (320) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
171084 313, /* (321) range_or_rows ::= RANGE|ROWS|GROUPS */
171085 315, /* (322) frame_bound_s ::= frame_bound */
171086 315, /* (323) frame_bound_s ::= UNBOUNDED PRECEDING */
171087 316, /* (324) frame_bound_e ::= frame_bound */
171088 316, /* (325) frame_bound_e ::= UNBOUNDED FOLLOWING */
171089 314, /* (326) frame_bound ::= expr PRECEDING|FOLLOWING */
171090 314, /* (327) frame_bound ::= CURRENT ROW */
171091 317, /* (328) frame_exclude_opt ::= */
171092 317, /* (329) frame_exclude_opt ::= EXCLUDE frame_exclude */
171093 318, /* (330) frame_exclude ::= NO OTHERS */
171094 318, /* (331) frame_exclude ::= CURRENT ROW */
171095 318, /* (332) frame_exclude ::= GROUP|TIES */
171096 251, /* (333) window_clause ::= WINDOW windowdefn_list */
171097 273, /* (334) filter_over ::= filter_clause over_clause */
171098 273, /* (335) filter_over ::= over_clause */
171099 273, /* (336) filter_over ::= filter_clause */
171100 312, /* (337) over_clause ::= OVER LP window RP */
171101 312, /* (338) over_clause ::= OVER nm */
171102 311, /* (339) filter_clause ::= FILTER LP WHERE expr RP */
171103 185, /* (340) input ::= cmdlist */
171104 186, /* (341) cmdlist ::= cmdlist ecmd */
171105 186, /* (342) cmdlist ::= ecmd */
171106 187, /* (343) ecmd ::= SEMI */
171107 187, /* (344) ecmd ::= cmdx SEMI */
171108 187, /* (345) ecmd ::= explain cmdx SEMI */
171109 192, /* (346) trans_opt ::= */
171110 192, /* (347) trans_opt ::= TRANSACTION */
171111 192, /* (348) trans_opt ::= TRANSACTION nm */
171112 194, /* (349) savepoint_opt ::= SAVEPOINT */
171113 194, /* (350) savepoint_opt ::= */
171114 190, /* (351) cmd ::= create_table create_table_args */
171115 203, /* (352) table_option_set ::= table_option */
171116 201, /* (353) columnlist ::= columnlist COMMA columnname carglist */
171117 201, /* (354) columnlist ::= columnname carglist */
171118 193, /* (355) nm ::= ID|INDEXED|JOIN_KW */
171119 193, /* (356) nm ::= STRING */
171120 208, /* (357) typetoken ::= typename */
171121 209, /* (358) typename ::= ID|STRING */
171122 210, /* (359) signed ::= plus_num */
171123 210, /* (360) signed ::= minus_num */
171124 207, /* (361) carglist ::= carglist ccons */
171125 207, /* (362) carglist ::= */
171126 215, /* (363) ccons ::= NULL onconf */
171127 215, /* (364) ccons ::= GENERATED ALWAYS AS generated */
171128 215, /* (365) ccons ::= AS generated */
171129 202, /* (366) conslist_opt ::= COMMA conslist */
171130 228, /* (367) conslist ::= conslist tconscomma tcons */
171131 228, /* (368) conslist ::= tcons */
171132 229, /* (369) tconscomma ::= */
171133 233, /* (370) defer_subclause_opt ::= defer_subclause */
171134 235, /* (371) resolvetype ::= raisetype */
171135 239, /* (372) selectnowith ::= oneselect */
171136 240, /* (373) oneselect ::= values */
171137 254, /* (374) sclp ::= selcollist COMMA */
171138 255, /* (375) as ::= ID|STRING */
171139 264, /* (376) indexed_opt ::= indexed_by */
171140 272, /* (377) returning ::= */
171141 217, /* (378) expr ::= term */
171142 274, /* (379) likeop ::= LIKE_KW|MATCH */
171143 278, /* (380) case_operand ::= expr */
171144 261, /* (381) exprlist ::= nexprlist */
171145 284, /* (382) nmnum ::= plus_num */
171146 284, /* (383) nmnum ::= nm */
171147 284, /* (384) nmnum ::= ON */
171148 284, /* (385) nmnum ::= DELETE */
171149 284, /* (386) nmnum ::= DEFAULT */
171150 211, /* (387) plus_num ::= INTEGER|FLOAT */
171151 289, /* (388) foreach_clause ::= */
171152 289, /* (389) foreach_clause ::= FOR EACH ROW */
171153 292, /* (390) trnm ::= nm */
171154 293, /* (391) tridxby ::= */
171155 294, /* (392) database_kw_opt ::= DATABASE */
171156 294, /* (393) database_kw_opt ::= */
171157 297, /* (394) kwcolumn_opt ::= */
171158 297, /* (395) kwcolumn_opt ::= COLUMNKW */
171159 299, /* (396) vtabarglist ::= vtabarg */
171160 299, /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */
171161 300, /* (398) vtabarg ::= vtabarg vtabargtoken */
171162 303, /* (399) anylist ::= */
171163 303, /* (400) anylist ::= anylist LP anylist RP */
171164 303, /* (401) anylist ::= anylist ANY */
171165 266, /* (402) with ::= */
171166 };
171167
171168 /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
171169 ** of symbols on the right-hand side of that rule. */
171170 static const signed char yyRuleInfoNRhs[] = {
@@ -171475,104 +171505,104 @@
171475 -2, /* (304) wqas ::= AS MATERIALIZED */
171476 -3, /* (305) wqas ::= AS NOT MATERIALIZED */
171477 -6, /* (306) wqitem ::= nm eidlist_opt wqas LP select RP */
171478 -1, /* (307) wqlist ::= wqitem */
171479 -3, /* (308) wqlist ::= wqlist COMMA wqitem */
171480 -1, /* (309) windowdefn_list ::= windowdefn */
171481 -3, /* (310) windowdefn_list ::= windowdefn_list COMMA windowdefn */
171482 -5, /* (311) windowdefn ::= nm AS LP window RP */
171483 -5, /* (312) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
171484 -6, /* (313) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
171485 -4, /* (314) window ::= ORDER BY sortlist frame_opt */
171486 -5, /* (315) window ::= nm ORDER BY sortlist frame_opt */
171487 -1, /* (316) window ::= frame_opt */
171488 -2, /* (317) window ::= nm frame_opt */
171489 0, /* (318) frame_opt ::= */
171490 -3, /* (319) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
171491 -6, /* (320) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
171492 -1, /* (321) range_or_rows ::= RANGE|ROWS|GROUPS */
171493 -1, /* (322) frame_bound_s ::= frame_bound */
171494 -2, /* (323) frame_bound_s ::= UNBOUNDED PRECEDING */
171495 -1, /* (324) frame_bound_e ::= frame_bound */
171496 -2, /* (325) frame_bound_e ::= UNBOUNDED FOLLOWING */
171497 -2, /* (326) frame_bound ::= expr PRECEDING|FOLLOWING */
171498 -2, /* (327) frame_bound ::= CURRENT ROW */
171499 0, /* (328) frame_exclude_opt ::= */
171500 -2, /* (329) frame_exclude_opt ::= EXCLUDE frame_exclude */
171501 -2, /* (330) frame_exclude ::= NO OTHERS */
171502 -2, /* (331) frame_exclude ::= CURRENT ROW */
171503 -1, /* (332) frame_exclude ::= GROUP|TIES */
171504 -2, /* (333) window_clause ::= WINDOW windowdefn_list */
171505 -2, /* (334) filter_over ::= filter_clause over_clause */
171506 -1, /* (335) filter_over ::= over_clause */
171507 -1, /* (336) filter_over ::= filter_clause */
171508 -4, /* (337) over_clause ::= OVER LP window RP */
171509 -2, /* (338) over_clause ::= OVER nm */
171510 -5, /* (339) filter_clause ::= FILTER LP WHERE expr RP */
171511 -1, /* (340) input ::= cmdlist */
171512 -2, /* (341) cmdlist ::= cmdlist ecmd */
171513 -1, /* (342) cmdlist ::= ecmd */
171514 -1, /* (343) ecmd ::= SEMI */
171515 -2, /* (344) ecmd ::= cmdx SEMI */
171516 -3, /* (345) ecmd ::= explain cmdx SEMI */
171517 0, /* (346) trans_opt ::= */
171518 -1, /* (347) trans_opt ::= TRANSACTION */
171519 -2, /* (348) trans_opt ::= TRANSACTION nm */
171520 -1, /* (349) savepoint_opt ::= SAVEPOINT */
171521 0, /* (350) savepoint_opt ::= */
171522 -2, /* (351) cmd ::= create_table create_table_args */
171523 -1, /* (352) table_option_set ::= table_option */
171524 -4, /* (353) columnlist ::= columnlist COMMA columnname carglist */
171525 -2, /* (354) columnlist ::= columnname carglist */
171526 -1, /* (355) nm ::= ID|INDEXED|JOIN_KW */
171527 -1, /* (356) nm ::= STRING */
171528 -1, /* (357) typetoken ::= typename */
171529 -1, /* (358) typename ::= ID|STRING */
171530 -1, /* (359) signed ::= plus_num */
171531 -1, /* (360) signed ::= minus_num */
171532 -2, /* (361) carglist ::= carglist ccons */
171533 0, /* (362) carglist ::= */
171534 -2, /* (363) ccons ::= NULL onconf */
171535 -4, /* (364) ccons ::= GENERATED ALWAYS AS generated */
171536 -2, /* (365) ccons ::= AS generated */
171537 -2, /* (366) conslist_opt ::= COMMA conslist */
171538 -3, /* (367) conslist ::= conslist tconscomma tcons */
171539 -1, /* (368) conslist ::= tcons */
171540 0, /* (369) tconscomma ::= */
171541 -1, /* (370) defer_subclause_opt ::= defer_subclause */
171542 -1, /* (371) resolvetype ::= raisetype */
171543 -1, /* (372) selectnowith ::= oneselect */
171544 -1, /* (373) oneselect ::= values */
171545 -2, /* (374) sclp ::= selcollist COMMA */
171546 -1, /* (375) as ::= ID|STRING */
171547 -1, /* (376) indexed_opt ::= indexed_by */
171548 0, /* (377) returning ::= */
171549 -1, /* (378) expr ::= term */
171550 -1, /* (379) likeop ::= LIKE_KW|MATCH */
171551 -1, /* (380) case_operand ::= expr */
171552 -1, /* (381) exprlist ::= nexprlist */
171553 -1, /* (382) nmnum ::= plus_num */
171554 -1, /* (383) nmnum ::= nm */
171555 -1, /* (384) nmnum ::= ON */
171556 -1, /* (385) nmnum ::= DELETE */
171557 -1, /* (386) nmnum ::= DEFAULT */
171558 -1, /* (387) plus_num ::= INTEGER|FLOAT */
171559 0, /* (388) foreach_clause ::= */
171560 -3, /* (389) foreach_clause ::= FOR EACH ROW */
171561 -1, /* (390) trnm ::= nm */
171562 0, /* (391) tridxby ::= */
171563 -1, /* (392) database_kw_opt ::= DATABASE */
171564 0, /* (393) database_kw_opt ::= */
171565 0, /* (394) kwcolumn_opt ::= */
171566 -1, /* (395) kwcolumn_opt ::= COLUMNKW */
171567 -1, /* (396) vtabarglist ::= vtabarg */
171568 -3, /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */
171569 -2, /* (398) vtabarg ::= vtabarg vtabargtoken */
171570 0, /* (399) anylist ::= */
171571 -4, /* (400) anylist ::= anylist LP anylist RP */
171572 -2, /* (401) anylist ::= anylist ANY */
171573 0, /* (402) with ::= */
171574 };
171575
171576 static void yy_accept(yyParser*); /* Forward Declaration */
171577
171578 /*
@@ -171628,11 +171658,11 @@
171628 {yymsp[1].minor.yy394 = TK_DEFERRED;}
171629 break;
171630 case 5: /* transtype ::= DEFERRED */
171631 case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
171632 case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
171633 case 321: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==321);
171634 {yymsp[0].minor.yy394 = yymsp[0].major; /*A-overwrites-X*/}
171635 break;
171636 case 8: /* cmd ::= COMMIT|END trans_opt */
171637 case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
171638 {sqlite3EndTransaction(pParse,yymsp[-1].major);}
@@ -171924,11 +171954,10 @@
171924 {
171925 Select *p = yymsp[0].minor.yy47;
171926 if( p ){
171927 parserDoubleLinkSelect(pParse, p);
171928 }
171929 yymsp[0].minor.yy47 = p; /*A-overwrites-X*/
171930 }
171931 break;
171932 case 88: /* selectnowith ::= selectnowith multiselect_op oneselect */
171933 {
171934 Select *pRhs = yymsp[0].minor.yy47;
@@ -172016,18 +172045,21 @@
172016 }
172017 break;
172018 case 101: /* selcollist ::= sclp scanpt STAR */
172019 {
172020 Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
 
172021 yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, p);
172022 }
172023 break;
172024 case 102: /* selcollist ::= sclp scanpt nm DOT STAR */
172025 {
172026 Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
172027 Expr *pLeft = tokenExpr(pParse, TK_ID, yymsp[-2].minor.yy0);
172028 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
 
 
172029 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, pDot);
172030 }
172031 break;
172032 case 103: /* as ::= AS nm */
172033 case 115: /* dbnm ::= DOT nm */ yytestcase(yyruleno==115);
@@ -172917,116 +172949,105 @@
172917 case 308: /* wqlist ::= wqlist COMMA wqitem */
172918 {
172919 yymsp[-2].minor.yy521 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy521, yymsp[0].minor.yy385);
172920 }
172921 break;
172922 case 309: /* windowdefn_list ::= windowdefn */
172923 { yylhsminor.yy41 = yymsp[0].minor.yy41; }
172924 yymsp[0].minor.yy41 = yylhsminor.yy41;
172925 break;
172926 case 310: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
172927 {
172928 assert( yymsp[0].minor.yy41!=0 );
172929 sqlite3WindowChain(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy41);
172930 yymsp[0].minor.yy41->pNextWin = yymsp[-2].minor.yy41;
172931 yylhsminor.yy41 = yymsp[0].minor.yy41;
172932 }
172933 yymsp[-2].minor.yy41 = yylhsminor.yy41;
172934 break;
172935 case 311: /* windowdefn ::= nm AS LP window RP */
172936 {
172937 if( ALWAYS(yymsp[-1].minor.yy41) ){
172938 yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
172939 }
172940 yylhsminor.yy41 = yymsp[-1].minor.yy41;
172941 }
172942 yymsp[-4].minor.yy41 = yylhsminor.yy41;
172943 break;
172944 case 312: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
172945 {
172946 yymsp[-4].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, 0);
172947 }
172948 break;
172949 case 313: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
172950 {
172951 yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, &yymsp[-5].minor.yy0);
172952 }
172953 yymsp[-5].minor.yy41 = yylhsminor.yy41;
172954 break;
172955 case 314: /* window ::= ORDER BY sortlist frame_opt */
172956 {
172957 yymsp[-3].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, 0);
172958 }
172959 break;
172960 case 315: /* window ::= nm ORDER BY sortlist frame_opt */
172961 {
172962 yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
172963 }
172964 yymsp[-4].minor.yy41 = yylhsminor.yy41;
172965 break;
172966 case 316: /* window ::= frame_opt */
172967 case 335: /* filter_over ::= over_clause */ yytestcase(yyruleno==335);
172968 {
172969 yylhsminor.yy41 = yymsp[0].minor.yy41;
172970 }
172971 yymsp[0].minor.yy41 = yylhsminor.yy41;
172972 break;
172973 case 317: /* window ::= nm frame_opt */
172974 {
172975 yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, 0, &yymsp[-1].minor.yy0);
172976 }
172977 yymsp[-1].minor.yy41 = yylhsminor.yy41;
172978 break;
172979 case 318: /* frame_opt ::= */
172980 {
172981 yymsp[1].minor.yy41 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
172982 }
172983 break;
172984 case 319: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
172985 {
172986 yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy394, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy516);
172987 }
172988 yymsp[-2].minor.yy41 = yylhsminor.yy41;
172989 break;
172990 case 320: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
172991 {
172992 yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy394, yymsp[-3].minor.yy595.eType, yymsp[-3].minor.yy595.pExpr, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, yymsp[0].minor.yy516);
172993 }
172994 yymsp[-5].minor.yy41 = yylhsminor.yy41;
172995 break;
172996 case 322: /* frame_bound_s ::= frame_bound */
172997 case 324: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==324);
172998 {yylhsminor.yy595 = yymsp[0].minor.yy595;}
172999 yymsp[0].minor.yy595 = yylhsminor.yy595;
173000 break;
173001 case 323: /* frame_bound_s ::= UNBOUNDED PRECEDING */
173002 case 325: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==325);
173003 case 327: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==327);
173004 {yylhsminor.yy595.eType = yymsp[-1].major; yylhsminor.yy595.pExpr = 0;}
173005 yymsp[-1].minor.yy595 = yylhsminor.yy595;
173006 break;
173007 case 326: /* frame_bound ::= expr PRECEDING|FOLLOWING */
173008 {yylhsminor.yy595.eType = yymsp[0].major; yylhsminor.yy595.pExpr = yymsp[-1].minor.yy528;}
173009 yymsp[-1].minor.yy595 = yylhsminor.yy595;
173010 break;
173011 case 328: /* frame_exclude_opt ::= */
173012 {yymsp[1].minor.yy516 = 0;}
173013 break;
173014 case 329: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
173015 {yymsp[-1].minor.yy516 = yymsp[0].minor.yy516;}
173016 break;
173017 case 330: /* frame_exclude ::= NO OTHERS */
173018 case 331: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==331);
173019 {yymsp[-1].minor.yy516 = yymsp[-1].major; /*A-overwrites-X*/}
173020 break;
173021 case 332: /* frame_exclude ::= GROUP|TIES */
173022 {yymsp[0].minor.yy516 = yymsp[0].major; /*A-overwrites-X*/}
173023 break;
173024 case 333: /* window_clause ::= WINDOW windowdefn_list */
173025 { yymsp[-1].minor.yy41 = yymsp[0].minor.yy41; }
173026 break;
173027 case 334: /* filter_over ::= filter_clause over_clause */
173028 {
173029 if( yymsp[0].minor.yy41 ){
173030 yymsp[0].minor.yy41->pFilter = yymsp[-1].minor.yy528;
173031 }else{
173032 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy528);
@@ -173033,11 +173054,17 @@
173033 }
173034 yylhsminor.yy41 = yymsp[0].minor.yy41;
173035 }
173036 yymsp[-1].minor.yy41 = yylhsminor.yy41;
173037 break;
173038 case 336: /* filter_over ::= filter_clause */
 
 
 
 
 
 
173039 {
173040 yylhsminor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
173041 if( yylhsminor.yy41 ){
173042 yylhsminor.yy41->eFrmType = TK_FILTER;
173043 yylhsminor.yy41->pFilter = yymsp[0].minor.yy528;
@@ -173045,91 +173072,93 @@
173045 sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy528);
173046 }
173047 }
173048 yymsp[0].minor.yy41 = yylhsminor.yy41;
173049 break;
173050 case 337: /* over_clause ::= OVER LP window RP */
173051 {
173052 yymsp[-3].minor.yy41 = yymsp[-1].minor.yy41;
173053 assert( yymsp[-3].minor.yy41!=0 );
173054 }
173055 break;
173056 case 338: /* over_clause ::= OVER nm */
173057 {
173058 yymsp[-1].minor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
173059 if( yymsp[-1].minor.yy41 ){
173060 yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
173061 }
173062 }
173063 break;
173064 case 339: /* filter_clause ::= FILTER LP WHERE expr RP */
173065 { yymsp[-4].minor.yy528 = yymsp[-1].minor.yy528; }
173066 break;
173067 default:
173068 /* (340) input ::= cmdlist */ yytestcase(yyruleno==340);
173069 /* (341) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==341);
173070 /* (342) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=342);
173071 /* (343) ecmd ::= SEMI */ yytestcase(yyruleno==343);
173072 /* (344) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==344);
173073 /* (345) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=345);
173074 /* (346) trans_opt ::= */ yytestcase(yyruleno==346);
173075 /* (347) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==347);
173076 /* (348) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==348);
173077 /* (349) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==349);
173078 /* (350) savepoint_opt ::= */ yytestcase(yyruleno==350);
173079 /* (351) cmd ::= create_table create_table_args */ yytestcase(yyruleno==351);
173080 /* (352) table_option_set ::= table_option (OPTIMIZED OUT) */ assert(yyruleno!=352);
173081 /* (353) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==353);
173082 /* (354) columnlist ::= columnname carglist */ yytestcase(yyruleno==354);
173083 /* (355) nm ::= ID|INDEXED|JOIN_KW */ yytestcase(yyruleno==355);
173084 /* (356) nm ::= STRING */ yytestcase(yyruleno==356);
173085 /* (357) typetoken ::= typename */ yytestcase(yyruleno==357);
173086 /* (358) typename ::= ID|STRING */ yytestcase(yyruleno==358);
173087 /* (359) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=359);
173088 /* (360) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=360);
173089 /* (361) carglist ::= carglist ccons */ yytestcase(yyruleno==361);
173090 /* (362) carglist ::= */ yytestcase(yyruleno==362);
173091 /* (363) ccons ::= NULL onconf */ yytestcase(yyruleno==363);
173092 /* (364) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==364);
173093 /* (365) ccons ::= AS generated */ yytestcase(yyruleno==365);
173094 /* (366) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==366);
173095 /* (367) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==367);
173096 /* (368) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=368);
173097 /* (369) tconscomma ::= */ yytestcase(yyruleno==369);
173098 /* (370) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=370);
173099 /* (371) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=371);
173100 /* (372) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=372);
173101 /* (373) oneselect ::= values */ yytestcase(yyruleno==373);
173102 /* (374) sclp ::= selcollist COMMA */ yytestcase(yyruleno==374);
173103 /* (375) as ::= ID|STRING */ yytestcase(yyruleno==375);
173104 /* (376) indexed_opt ::= indexed_by (OPTIMIZED OUT) */ assert(yyruleno!=376);
173105 /* (377) returning ::= */ yytestcase(yyruleno==377);
173106 /* (378) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=378);
173107 /* (379) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==379);
173108 /* (380) case_operand ::= expr */ yytestcase(yyruleno==380);
173109 /* (381) exprlist ::= nexprlist */ yytestcase(yyruleno==381);
173110 /* (382) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=382);
173111 /* (383) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=383);
173112 /* (384) nmnum ::= ON */ yytestcase(yyruleno==384);
173113 /* (385) nmnum ::= DELETE */ yytestcase(yyruleno==385);
173114 /* (386) nmnum ::= DEFAULT */ yytestcase(yyruleno==386);
173115 /* (387) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==387);
173116 /* (388) foreach_clause ::= */ yytestcase(yyruleno==388);
173117 /* (389) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==389);
173118 /* (390) trnm ::= nm */ yytestcase(yyruleno==390);
173119 /* (391) tridxby ::= */ yytestcase(yyruleno==391);
173120 /* (392) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==392);
173121 /* (393) database_kw_opt ::= */ yytestcase(yyruleno==393);
173122 /* (394) kwcolumn_opt ::= */ yytestcase(yyruleno==394);
173123 /* (395) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==395);
173124 /* (396) vtabarglist ::= vtabarg */ yytestcase(yyruleno==396);
173125 /* (397) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==397);
173126 /* (398) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==398);
173127 /* (399) anylist ::= */ yytestcase(yyruleno==399);
173128 /* (400) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==400);
173129 /* (401) anylist ::= anylist ANY */ yytestcase(yyruleno==401);
173130 /* (402) with ::= */ yytestcase(yyruleno==402);
 
 
173131 break;
173132 /********** End reduce actions ************************************************/
173133 };
173134 assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
173135 yygoto = yyRuleInfoLhs[yyruleno];
@@ -203503,10 +203532,15 @@
203503 #else
203504 # define ALWAYS(X) (X)
203505 # define NEVER(X) (X)
203506 #endif
203507 #endif /* !defined(SQLITE_AMALGAMATION) */
 
 
 
 
 
203508
203509 /* #include <string.h> */
203510 /* #include <stdio.h> */
203511 /* #include <assert.h> */
203512 /* #include <stdlib.h> */
@@ -203910,11 +203944,11 @@
203910 */
203911 static int readInt16(u8 *p){
203912 return (p[0]<<8) + p[1];
203913 }
203914 static void readCoord(u8 *p, RtreeCoord *pCoord){
203915 assert( (((sqlite3_uint64)p)&3)==0 ); /* p is always 4-byte aligned */
203916 #if SQLITE_BYTEORDER==1234 && MSVC_VERSION>=1300
203917 pCoord->u = _byteswap_ulong(*(u32*)p);
203918 #elif SQLITE_BYTEORDER==1234 && GCC_VERSION>=4003000
203919 pCoord->u = __builtin_bswap32(*(u32*)p);
203920 #elif SQLITE_BYTEORDER==4321
@@ -203964,11 +203998,11 @@
203964 p[0] = (i>> 8)&0xFF;
203965 p[1] = (i>> 0)&0xFF;
203966 }
203967 static int writeCoord(u8 *p, RtreeCoord *pCoord){
203968 u32 i;
203969 assert( (((sqlite3_uint64)p)&3)==0 ); /* p is always 4-byte aligned */
203970 assert( sizeof(RtreeCoord)==4 );
203971 assert( sizeof(u32)==4 );
203972 #if SQLITE_BYTEORDER==1234 && GCC_VERSION>=4003000
203973 i = __builtin_bswap32(pCoord->u);
203974 memcpy(p, &i, 4);
@@ -204692,11 +204726,11 @@
204692 pCellData += 8 + 4*(p->iCoord&0xfe);
204693
204694 assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE
204695 || p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_TRUE
204696 || p->op==RTREE_FALSE );
204697 assert( (((sqlite3_uint64)pCellData)&3)==0 ); /* 4-byte aligned */
204698 switch( p->op ){
204699 case RTREE_TRUE: return; /* Always satisfied */
204700 case RTREE_FALSE: break; /* Never satisfied */
204701 case RTREE_EQ:
204702 RTREE_DECODE_COORD(eInt, pCellData, val);
@@ -204745,11 +204779,11 @@
204745
204746 assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE
204747 || p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_TRUE
204748 || p->op==RTREE_FALSE );
204749 pCellData += 8 + p->iCoord*4;
204750 assert( (((sqlite3_uint64)pCellData)&3)==0 ); /* 4-byte aligned */
204751 RTREE_DECODE_COORD(eInt, pCellData, xN);
204752 switch( p->op ){
204753 case RTREE_TRUE: return; /* Always satisfied */
204754 case RTREE_FALSE: break; /* Never satisfied */
204755 case RTREE_LE: if( xN <= p->u.rValue ) return; break;
@@ -242954,11 +242988,11 @@
242954 int nArg, /* Number of args */
242955 sqlite3_value **apUnused /* Function arguments */
242956 ){
242957 assert( nArg==0 );
242958 UNUSED_PARAM2(nArg, apUnused);
242959 sqlite3_result_text(pCtx, "fts5: 2023-06-12 18:22:34 7ec4ab327decd6a5ee5e6a53f1489e17e0cdbb297945f9acc532b47d052eb7a9", -1, SQLITE_TRANSIENT);
242960 }
242961
242962 /*
242963 ** Return true if zName is the extension on one of the shadow tables used
242964 ** by this module.
242965
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
16 ** if you want a wrapper to interface SQLite with your choice of programming
17 ** language. The code for the "sqlite3" command-line shell is also in a
18 ** separate file. This file contains only code for the core SQLite library.
19 **
20 ** The content in this amalgamation comes from Fossil check-in
21 ** c94f87806a8b408d8204fc7deec16d01c08.
22 */
23 #define SQLITE_CORE 1
24 #define SQLITE_AMALGAMATION 1
25 #ifndef SQLITE_PRIVATE
26 # define SQLITE_PRIVATE static
@@ -459,11 +459,11 @@
459 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
460 ** [sqlite_version()] and [sqlite_source_id()].
461 */
462 #define SQLITE_VERSION "3.43.0"
463 #define SQLITE_VERSION_NUMBER 3043000
464 #define SQLITE_SOURCE_ID "2023-06-19 13:09:16 3c94f87806a8b408d8204fc7deec16d01c085ee199ff21a1f20b6346ce816cfe"
465
466 /*
467 ** CAPI3REF: Run-Time Library Version Numbers
468 ** KEYWORDS: sqlite3_version sqlite3_sourceid
469 **
@@ -18641,10 +18641,12 @@
18641 /* Macros used to ensure that the correct members of unions are accessed
18642 ** in Expr.
18643 */
18644 #define ExprUseUToken(E) (((E)->flags&EP_IntValue)==0)
18645 #define ExprUseUValue(E) (((E)->flags&EP_IntValue)!=0)
18646 #define ExprUseWOfst(E) (((E)->flags&(EP_InnerON|EP_OuterON))==0)
18647 #define ExprUseWJoin(E) (((E)->flags&(EP_InnerON|EP_OuterON))!=0)
18648 #define ExprUseXList(E) (((E)->flags&EP_xIsSelect)==0)
18649 #define ExprUseXSelect(E) (((E)->flags&EP_xIsSelect)!=0)
18650 #define ExprUseYTab(E) (((E)->flags&(EP_WinFunc|EP_Subrtn))==0)
18651 #define ExprUseYWin(E) (((E)->flags&EP_WinFunc)!=0)
18652 #define ExprUseYSub(E) (((E)->flags&EP_Subrtn)!=0)
@@ -21109,10 +21111,11 @@
21111 SQLITE_PRIVATE int sqlite3ExprCheckHeight(Parse*, int);
21112 #else
21113 #define sqlite3SelectExprHeight(x) 0
21114 #define sqlite3ExprCheckHeight(x,y)
21115 #endif
21116 SQLITE_PRIVATE void sqlite3ExprSetErrorOffset(Expr*,int);
21117
21118 SQLITE_PRIVATE u32 sqlite3Get4byte(const u8*);
21119 SQLITE_PRIVATE void sqlite3Put4byte(u8*, u32);
21120
21121 #ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
@@ -23747,12 +23750,12 @@
23750 **
23751 ** The function returns the number of successful conversions.
23752 */
23753 static int getDigits(const char *zDate, const char *zFormat, ...){
23754 /* The aMx[] array translates the 3rd character of each format
23755 ** spec into a max size: a b c d e f */
23756 static const u16 aMx[] = { 12, 14, 24, 31, 59, 14712 };
23757 va_list ap;
23758 int cnt = 0;
23759 char nextC;
23760 va_start(ap, zFormat);
23761 do{
@@ -24089,21 +24092,18 @@
24092
24093 /*
24094 ** Compute the Hour, Minute, and Seconds from the julian day number.
24095 */
24096 static void computeHMS(DateTime *p){
24097 int day_ms, day_min; /* milliseconds, minutes into the day */
24098 if( p->validHMS ) return;
24099 computeJD(p);
24100 day_ms = (int)((p->iJD + 43200000) % 86400000);
24101 p->s = (day_ms % 60000)/1000.0;
24102 day_min = day_ms/60000;
24103 p->m = day_min % 60;
24104 p->h = day_min / 60;
 
 
 
24105 p->rawS = 0;
24106 p->validHMS = 1;
24107 }
24108
24109 /*
@@ -24509,32 +24509,41 @@
24509 case '9': {
24510 double rRounder;
24511 int i;
24512 int Y,M,D,h,m,x;
24513 const char *z2 = z;
24514 char z0 = z[0];
24515 for(n=1; z[n]; n++){
24516 if( z[n]==':' ) break;
24517 if( sqlite3Isspace(z[n]) ) break;
24518 if( z[n]=='-' ){
24519 if( n==5 && getDigits(&z[1], "40f", &Y)==1 ) break;
24520 if( n==6 && getDigits(&z[1], "50f", &Y)==1 ) break;
24521 }
24522 }
24523 if( sqlite3AtoF(z, &r, n, SQLITE_UTF8)<=0 ){
24524 assert( rc==1 );
24525 break;
24526 }
24527 if( z[n]=='-' ){
24528 /* A modifier of the form (+|-)YYYY-MM-DD adds or subtracts the
24529 ** specified number of years, months, and days. MM is limited to
24530 ** the range 0-11 and DD is limited to 0-30.
24531 */
24532 if( z0!='+' && z0!='-' ) break; /* Must start with +/- */
24533 if( n==5 ){
24534 if( getDigits(&z[1], "40f-20a-20d", &Y, &M, &D)!=3 ) break;
24535 }else{
24536 assert( n==6 );
24537 if( getDigits(&z[1], "50f-20a-20d", &Y, &M, &D)!=3 ) break;
24538 z++;
24539 }
24540 if( M>=12 ) break; /* M range 0..11 */
24541 if( D>=31 ) break; /* D range 0..30 */
24542 computeYMD_HMS(p);
24543 p->validJD = 0;
24544 if( z0=='-' ){
24545 p->Y -= Y;
24546 p->M -= M;
24547 D = -D;
24548 }else{
24549 p->Y += Y;
@@ -24574,11 +24583,11 @@
24583 if( parseHhMmSs(z2, &tx) ) break;
24584 computeJD(&tx);
24585 tx.iJD -= 43200000;
24586 day = tx.iJD/86400000;
24587 tx.iJD -= day*86400000;
24588 if( z0=='-' ) tx.iJD = -tx.iJD;
24589 computeJD(p);
24590 clearYMD_HMS_TZ(p);
24591 p->iJD += tx.iJD;
24592 rc = 0;
24593 break;
@@ -24590,11 +24599,11 @@
24599 while( sqlite3Isspace(*z) ) z++;
24600 n = sqlite3Strlen30(z);
24601 if( n>10 || n<3 ) break;
24602 if( sqlite3UpperToLower[(u8)z[n-1]]=='s' ) n--;
24603 computeJD(p);
24604 assert( rc==1 );
24605 rRounder = r<0 ? -0.5 : +0.5;
24606 for(i=0; i<ArraySize(aXformType); i++){
24607 if( aXformType[i].nName==n
24608 && sqlite3_strnicmp(aXformType[i].zName, z, n)==0
24609 && r>-aXformType[i].rLimit && r<aXformType[i].rLimit
@@ -24757,11 +24766,11 @@
24766 zBuf[14] = ':';
24767 zBuf[15] = '0' + (x.m/10)%10;
24768 zBuf[16] = '0' + (x.m)%10;
24769 zBuf[17] = ':';
24770 if( x.useSubsec ){
24771 s = (int)(1000.0*x.s + 0.5);
24772 zBuf[18] = '0' + (s/10000)%10;
24773 zBuf[19] = '0' + (s/1000)%10;
24774 zBuf[20] = '.';
24775 zBuf[21] = '0' + (s/100)%10;
24776 zBuf[22] = '0' + (s/10)%10;
@@ -24804,11 +24813,11 @@
24813 zBuf[2] = ':';
24814 zBuf[3] = '0' + (x.m/10)%10;
24815 zBuf[4] = '0' + (x.m)%10;
24816 zBuf[5] = ':';
24817 if( x.useSubsec ){
24818 s = (int)(1000.0*x.s + 0.5);
24819 zBuf[6] = '0' + (s/10000)%10;
24820 zBuf[7] = '0' + (s/1000)%10;
24821 zBuf[8] = '.';
24822 zBuf[9] = '0' + (s/100)%10;
24823 zBuf[10] = '0' + (s/10)%10;
@@ -25034,18 +25043,19 @@
25043 ** ISO-8601 string. The unix timestamps are not supported by this
25044 ** routine.
25045 */
25046 static void timediffFunc(
25047 sqlite3_context *context,
25048 int NotUsed1,
25049 sqlite3_value **argv
25050 ){
25051 char sign;
25052 int Y, M;
25053 DateTime d1, d2;
25054 sqlite3_str sRes;
25055 UNUSED_PARAMETER(NotUsed1);
25056 if( isDate(context, 1, &argv[0], &d1) ) return;
25057 if( isDate(context, 1, &argv[1], &d2) ) return;
25058 computeYMD_HMS(&d1);
25059 computeYMD_HMS(&d2);
25060 if( d1.iJD>=d2.iJD ){
25061 sign = '+';
@@ -25063,11 +25073,11 @@
25073 if( M!=0 ){
25074 d2.M = d1.M;
25075 d2.validJD = 0;
25076 computeJD(&d2);
25077 }
25078 while( d1.iJD<d2.iJD ){
25079 M--;
25080 if( M<0 ){
25081 M = 11;
25082 Y--;
25083 }
@@ -25078,12 +25088,12 @@
25088 }
25089 d2.validJD = 0;
25090 computeJD(&d2);
25091 }
25092 d1.iJD -= d2.iJD;
25093 d1.iJD += (u64)1486995408 * (u64)100000;
25094 }else /* d1<d2 */{
25095 sign = '-';
25096 Y = d2.Y - d1.Y;
25097 if( Y ){
25098 d2.Y = d1.Y;
25099 d2.validJD = 0;
@@ -25097,11 +25107,11 @@
25107 if( M!=0 ){
25108 d2.M = d1.M;
25109 d2.validJD = 0;
25110 computeJD(&d2);
25111 }
25112 while( d1.iJD>d2.iJD ){
25113 M--;
25114 if( M<0 ){
25115 M = 11;
25116 Y--;
25117 }
@@ -25112,11 +25122,11 @@
25122 }
25123 d2.validJD = 0;
25124 computeJD(&d2);
25125 }
25126 d1.iJD = d2.iJD - d1.iJD;
25127 d1.iJD += (u64)1486995408 * (u64)100000;
25128 }
25129 d1.validYMD = 0;
25130 d1.validHMS = 0;
25131 d1.validTZ = 0;
25132 computeYMD_HMS(&d1);
@@ -48846,11 +48856,11 @@
48856
48857 /* Acquire an EXCLUSIVE lock
48858 */
48859 if( locktype==EXCLUSIVE_LOCK && res ){
48860 assert( pFile->locktype>=SHARED_LOCK );
48861 (void)winUnlockReadLock(pFile);
48862 res = winLockFile(&pFile->h, SQLITE_LOCKFILE_FLAGS, SHARED_FIRST, 0,
48863 SHARED_SIZE, 0);
48864 if( res ){
48865 newLocktype = EXCLUSIVE_LOCK;
48866 }else{
@@ -60607,15 +60617,11 @@
60617 u8 *pPtr;
60618 Pager *pPager = 0; /* Pager object to allocate and return */
60619 int rc = SQLITE_OK; /* Return code */
60620 int tempFile = 0; /* True for temp files (incl. in-memory files) */
60621 int memDb = 0; /* True if this is an in-memory file */
 
60622 int memJM = 0; /* Memory journal mode */
 
 
 
60623 int readOnly = 0; /* True if this is a read-only file */
60624 int journalFileSize; /* Bytes to allocate for each journal fd */
60625 char *zPathname = 0; /* Full path to database file */
60626 int nPathname = 0; /* Number of bytes in zPathname */
60627 int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */
@@ -60730,16 +60736,17 @@
60736 ** The sqlite3_create_filename() interface and the databaseFilename() utility
60737 ** that is used by sqlite3_filename_database() and kin also depend on the
60738 ** specific formatting and order of the various filenames, so if the format
60739 ** changes here, be sure to change it there as well.
60740 */
60741 assert( SQLITE_PTRSIZE==sizeof(Pager*) );
60742 pPtr = (u8 *)sqlite3MallocZero(
60743 ROUND8(sizeof(*pPager)) + /* Pager structure */
60744 ROUND8(pcacheSize) + /* PCache object */
60745 ROUND8(pVfs->szOsFile) + /* The main db file */
60746 journalFileSize * 2 + /* The two journal files */
60747 SQLITE_PTRSIZE + /* Space to hold a pointer */
60748 4 + /* Database prefix */
60749 nPathname + 1 + /* database filename */
60750 nUriByte + /* query parameters */
60751 nPathname + 8 + 1 + /* Journal filename */
60752 #ifndef SQLITE_OMIT_WAL
@@ -60756,11 +60763,11 @@
60763 pPager->pPCache = (PCache*)pPtr; pPtr += ROUND8(pcacheSize);
60764 pPager->fd = (sqlite3_file*)pPtr; pPtr += ROUND8(pVfs->szOsFile);
60765 pPager->sjfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
60766 pPager->jfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
60767 assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) );
60768 memcpy(pPtr, &pPager, SQLITE_PTRSIZE); pPtr += SQLITE_PTRSIZE;
60769
60770 /* Fill in the Pager.zFilename and pPager.zQueryParam fields */
60771 pPtr += 4; /* Skip zero prefix */
60772 pPager->zFilename = (char*)pPtr;
60773 if( nPathname>0 ){
@@ -60810,13 +60817,11 @@
60817 */
60818 if( zFilename && zFilename[0] ){
60819 int fout = 0; /* VFS flags returned by xOpen() */
60820 rc = sqlite3OsOpen(pVfs, pPager->zFilename, pPager->fd, vfsFlags, &fout);
60821 assert( !memDb );
 
60822 pPager->memVfs = memJM = (fout&SQLITE_OPEN_MEMORY)!=0;
 
60823 readOnly = (fout&SQLITE_OPEN_READONLY)!=0;
60824
60825 /* If the file was successfully opened for read/write access,
60826 ** choose a default page size in case we have to create the
60827 ** database file. The default page size is the maximum of:
@@ -71538,10 +71543,13 @@
71543 assert( sizeof(i64)==8 );
71544 assert( sizeof(u64)==8 );
71545 assert( sizeof(u32)==4 );
71546 assert( sizeof(u16)==2 );
71547 assert( sizeof(Pgno)==4 );
71548
71549 /* Suppress false-positive compiler warning from PVS-Studio */
71550 memset(&zDbHeader[16], 0, 8);
71551
71552 pBt = sqlite3MallocZero( sizeof(*pBt) );
71553 if( pBt==0 ){
71554 rc = SQLITE_NOMEM_BKPT;
71555 goto btree_open_out;
@@ -76385,11 +76393,11 @@
76393 assert( i<iEnd );
76394 j = get2byte(&aData[hdr+5]);
76395 if( NEVER(j>(u32)usableSize) ){ j = 0; }
76396 memcpy(&pTmp[j], &aData[j], usableSize - j);
76397
76398 for(k=0; ALWAYS(k<NB*2) && pCArray->ixNx[k]<=i; k++){}
76399 pSrcEnd = pCArray->apEnd[k];
76400
76401 pData = pEnd;
76402 while( 1/*exit by break*/ ){
76403 u8 *pCell = pCArray->apCell[i];
@@ -76468,11 +76476,11 @@
76476 int iEnd = iFirst + nCell; /* End of loop. One past last cell to ins */
76477 int k; /* Current slot in pCArray->apEnd[] */
76478 u8 *pEnd; /* Maximum extent of cell data */
76479 assert( CORRUPT_DB || pPg->hdrOffset==0 ); /* Never called on page 1 */
76480 if( iEnd<=iFirst ) return 0;
76481 for(k=0; ALWAYS(k<NB*2) && pCArray->ixNx[k]<=i ; k++){}
76482 pEnd = pCArray->apEnd[k];
76483 while( 1 /*Exit by break*/ ){
76484 int sz, rc;
76485 u8 *pSlot;
76486 assert( pCArray->szCell[i]!=0 );
@@ -77578,11 +77586,11 @@
77586 }
77587 }
77588 iOvflSpace += sz;
77589 assert( sz<=pBt->maxLocal+23 );
77590 assert( iOvflSpace <= (int)pBt->pageSize );
77591 for(k=0; ALWAYS(k<NB*2) && b.ixNx[k]<=j; k++){}
77592 pSrcEnd = b.apEnd[k];
77593 if( SQLITE_WITHIN(pSrcEnd, pCell, pCell+sz) ){
77594 rc = SQLITE_CORRUPT_BKPT;
77595 goto balance_cleanup;
77596 }
@@ -77614,10 +77622,12 @@
77622 ** pass.
77623 */
77624 for(i=1-nNew; i<nNew; i++){
77625 int iPg = i<0 ? -i : i;
77626 assert( iPg>=0 && iPg<nNew );
77627 assert( iPg>=1 || i>=0 );
77628 assert( iPg<ArraySize(cntOld) );
77629 if( abDone[iPg] ) continue; /* Skip pages already processed */
77630 if( i>=0 /* On the upwards pass, or... */
77631 || cntOld[iPg-1]>=cntNew[iPg-1] /* Condition (1) is true */
77632 ){
77633 int iNew;
@@ -107349,10 +107359,19 @@
107359 p->flags |= EP_Propagate & sqlite3ExprListFlags(p->x.pList);
107360 }
107361 }
107362 #define exprSetHeight(y)
107363 #endif /* SQLITE_MAX_EXPR_DEPTH>0 */
107364
107365 /*
107366 ** Set the error offset for an Expr node, if possible.
107367 */
107368 SQLITE_PRIVATE void sqlite3ExprSetErrorOffset(Expr *pExpr, int iOfst){
107369 if( pExpr==0 ) return;
107370 if( NEVER(ExprUseWJoin(pExpr)) ) return;
107371 pExpr->w.iOfst = iOfst;
107372 }
107373
107374 /*
107375 ** This routine is the core allocator for Expr nodes.
107376 **
107377 ** Construct a new expression node and return a pointer to it. Memory
@@ -111093,11 +111112,11 @@
111112 #endif
111113 if( pDef==0 || pDef->xFinalize!=0 ){
111114 sqlite3ErrorMsg(pParse, "unknown function: %#T()", pExpr);
111115 break;
111116 }
111117 if( (pDef->funcFlags & SQLITE_FUNC_INLINE)!=0 && ALWAYS(pFarg!=0) ){
111118 assert( (pDef->funcFlags & SQLITE_FUNC_UNSAFE)==0 );
111119 assert( (pDef->funcFlags & SQLITE_FUNC_DIRECT)==0 );
111120 return exprCodeInlineFunction(pParse, pFarg,
111121 SQLITE_PTR_TO_INT(pDef->pUserData), target);
111122 }else if( pDef->funcFlags & (SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE) ){
@@ -113796,11 +113815,11 @@
113815 }
113816 assert( IsOrdinaryTable(pNew) );
113817 pNew->u.tab.pDfltList = sqlite3ExprListDup(db, pTab->u.tab.pDfltList, 0);
113818 pNew->pSchema = db->aDb[iDb].pSchema;
113819 pNew->u.tab.addColOffset = pTab->u.tab.addColOffset;
113820 assert( pNew->nTabRef==1 );
113821
113822 exit_begin_add_column:
113823 sqlite3SrcListDelete(db, pSrc);
113824 return;
113825 }
@@ -125175,11 +125194,11 @@
125194 if( sNC.ncFlags & NC_Subquery ) bComplex = 1;
125195 wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW);
125196 if( HasRowid(pTab) ){
125197 /* For a rowid table, initialize the RowSet to an empty set */
125198 pPk = 0;
125199 assert( nPk==1 );
125200 iRowSet = ++pParse->nMem;
125201 sqlite3VdbeAddOp2(v, OP_Null, 0, iRowSet);
125202 }else{
125203 /* For a WITHOUT ROWID table, create an ephemeral table used to
125204 ** hold all primary keys for rows to be deleted. */
@@ -129658,13 +129677,12 @@
129677 /* Remove the FK from the fkeyHash hash table. */
129678 if( db->pnBytesFreed==0 ){
129679 if( pFKey->pPrevTo ){
129680 pFKey->pPrevTo->pNextTo = pFKey->pNextTo;
129681 }else{
129682 const char *z = (pFKey->pNextTo ? pFKey->pNextTo->zTo : pFKey->zTo);
129683 sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, pFKey->pNextTo);
 
129684 }
129685 if( pFKey->pNextTo ){
129686 pFKey->pNextTo->pPrevTo = pFKey->pPrevTo;
129687 }
129688 }
@@ -132346,10 +132364,12 @@
132364 Index *pIdx;
132365 Vdbe *v;
132366
132367 assert( op==OP_OpenRead || op==OP_OpenWrite );
132368 assert( op==OP_OpenWrite || p5==0 );
132369 assert( piDataCur!=0 );
132370 assert( piIdxCur!=0 );
132371 if( IsVirtual(pTab) ){
132372 /* This routine is a no-op for virtual tables. Leave the output
132373 ** variables *piDataCur and *piIdxCur set to illegal cursor numbers
132374 ** for improved error detection. */
132375 *piDataCur = *piIdxCur = -999;
@@ -132358,22 +132378,22 @@
132378 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
132379 v = pParse->pVdbe;
132380 assert( v!=0 );
132381 if( iBase<0 ) iBase = pParse->nTab;
132382 iDataCur = iBase++;
132383 *piDataCur = iDataCur;
132384 if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){
132385 sqlite3OpenTable(pParse, iDataCur, iDb, pTab, op);
132386 }else{
132387 sqlite3TableLock(pParse, iDb, pTab->tnum, op==OP_OpenWrite, pTab->zName);
132388 }
132389 *piIdxCur = iBase;
132390 for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
132391 int iIdxCur = iBase++;
132392 assert( pIdx->pSchema==pTab->pSchema );
132393 if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
132394 *piDataCur = iIdxCur;
132395 p5 = 0;
132396 }
132397 if( aToOpen==0 || aToOpen[i+1] ){
132398 sqlite3VdbeAddOp3(v, op, iIdxCur, pIdx->tnum, iDb);
132399 sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
@@ -145379,14 +145399,20 @@
145399 }else{
145400 /* This expression is a "*" or a "TABLE.*" and needs to be
145401 ** expanded. */
145402 int tableSeen = 0; /* Set to 1 when TABLE matches */
145403 char *zTName = 0; /* text of name of TABLE */
145404 int iErrOfst;
145405 if( pE->op==TK_DOT ){
145406 assert( pE->pLeft!=0 );
145407 assert( !ExprHasProperty(pE->pLeft, EP_IntValue) );
145408 zTName = pE->pLeft->u.zToken;
145409 assert( ExprUseWOfst(pE->pLeft) );
145410 iErrOfst = pE->pRight->w.iOfst;
145411 }else{
145412 assert( ExprUseWOfst(pE) );
145413 iErrOfst = pE->w.iOfst;
145414 }
145415 for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
145416 Table *pTab = pFrom->pTab; /* Table for this data source */
145417 ExprList *pNestedFrom; /* Result-set of a nested FROM clause */
145418 char *zTabName; /* AS name for this data source */
@@ -145419,10 +145445,11 @@
145445 int ii;
145446 pUsing = pFrom[1].u3.pUsing;
145447 for(ii=0; ii<pUsing->nId; ii++){
145448 const char *zUName = pUsing->a[ii].zName;
145449 pRight = sqlite3Expr(db, TK_ID, zUName);
145450 sqlite3ExprSetErrorOffset(pRight, iErrOfst);
145451 pNew = sqlite3ExprListAppend(pParse, pNew, pRight);
145452 if( pNew ){
145453 struct ExprList_item *pX = &pNew->a[pNew->nExpr-1];
145454 assert( pX->zEName==0 );
145455 pX->zEName = sqlite3MPrintf(db,"..%s", zUName);
@@ -145491,10 +145518,11 @@
145518 pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pExpr);
145519 }
145520 }else{
145521 pExpr = pRight;
145522 }
145523 sqlite3ExprSetErrorOffset(pExpr, iErrOfst);
145524 pNew = sqlite3ExprListAppend(pParse, pNew, pExpr);
145525 if( pNew==0 ){
145526 break; /* OOM */
145527 }
145528 pX = &pNew->a[pNew->nExpr-1];
@@ -150150,10 +150178,12 @@
150178 sqlite3WhereEnd(pWInfo);
150179 }
150180
150181 if( !isView ){
150182 int addrOnce = 0;
150183 int iNotUsed1 = 0;
150184 int iNotUsed2 = 0;
150185
150186 /* Open every index that needs updating. */
150187 if( eOnePass!=ONEPASS_OFF ){
150188 if( aiCurOnePass[0]>=0 ) aToOpen[aiCurOnePass[0]-iBaseCur] = 0;
150189 if( aiCurOnePass[1]>=0 ) aToOpen[aiCurOnePass[1]-iBaseCur] = 0;
@@ -150161,11 +150191,11 @@
150191
150192 if( eOnePass==ONEPASS_MULTI && (nIdx-(aiCurOnePass[1]>=0))>0 ){
150193 addrOnce = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
150194 }
150195 sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenWrite, 0, iBaseCur,
150196 aToOpen, &iNotUsed1, &iNotUsed2);
150197 if( addrOnce ){
150198 sqlite3VdbeJumpHereOrPopInst(v, addrOnce);
150199 }
150200 }
150201
@@ -156449,11 +156479,11 @@
156479 ** a single escape character. The second condition is necessary so
156480 ** that we can increment the prefix key to find an upper bound for the
156481 ** range search. The third is because the caller assumes that the pattern
156482 ** consists of at least one character after all escapes have been
156483 ** removed. */
156484 if( (cnt>1 || (cnt>0 && z[0]!=wc[3])) && 255!=(u8)z[cnt-1] ){
156485 Expr *pPrefix;
156486
156487 /* A "complete" match if the pattern ends with "*" or "%" */
156488 *pisComplete = c==wc[0] && z[cnt+1]==0;
156489
@@ -168543,11 +168573,11 @@
168573 #define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
168574 #define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
168575 #define YYFALLBACK 1
168576 #define YYNSTATE 575
168577 #define YYNRULE 403
168578 #define YYNRULE_WITH_ACTION 338
168579 #define YYNTOKEN 185
168580 #define YY_MAX_SHIFT 574
168581 #define YY_MIN_SHIFTREDUCE 833
168582 #define YY_MAX_SHIFTREDUCE 1235
168583 #define YY_ERROR_ACTION 1236
@@ -168625,140 +168655,140 @@
168655 static const YYACTIONTYPE yy_action[] = {
168656 /* 0 */ 568, 208, 568, 118, 115, 229, 568, 118, 115, 229,
168657 /* 10 */ 568, 1310, 377, 1289, 408, 562, 562, 562, 568, 409,
168658 /* 20 */ 378, 1310, 1272, 41, 41, 41, 41, 208, 1520, 71,
168659 /* 30 */ 71, 969, 419, 41, 41, 491, 303, 279, 303, 970,
168660 /* 40 */ 397, 71, 71, 125, 126, 80, 1210, 1210, 1047, 1050,
168661 /* 50 */ 1037, 1037, 123, 123, 124, 124, 124, 124, 476, 409,
168662 /* 60 */ 1237, 1, 1, 574, 2, 1241, 550, 118, 115, 229,
168663 /* 70 */ 317, 480, 146, 480, 524, 118, 115, 229, 529, 1323,
168664 /* 80 */ 417, 523, 142, 125, 126, 80, 1210, 1210, 1047, 1050,
168665 /* 90 */ 1037, 1037, 123, 123, 124, 124, 124, 124, 118, 115,
168666 /* 100 */ 229, 327, 122, 122, 122, 122, 121, 121, 120, 120,
168667 /* 110 */ 120, 119, 116, 444, 284, 284, 284, 284, 442, 442,
168668 /* 120 */ 442, 1559, 376, 1561, 1186, 375, 1157, 565, 1157, 565,
168669 /* 130 */ 409, 1559, 537, 259, 226, 444, 101, 145, 449, 316,
168670 /* 140 */ 559, 240, 122, 122, 122, 122, 121, 121, 120, 120,
168671 /* 150 */ 120, 119, 116, 444, 125, 126, 80, 1210, 1210, 1047,
168672 /* 160 */ 1050, 1037, 1037, 123, 123, 124, 124, 124, 124, 142,
168673 /* 170 */ 294, 1186, 339, 448, 120, 120, 120, 119, 116, 444,
168674 /* 180 */ 127, 1186, 1187, 1186, 148, 441, 440, 568, 119, 116,
168675 /* 190 */ 444, 124, 124, 124, 124, 117, 122, 122, 122, 122,
168676 /* 200 */ 121, 121, 120, 120, 120, 119, 116, 444, 454, 113,
168677 /* 210 */ 13, 13, 546, 122, 122, 122, 122, 121, 121, 120,
168678 /* 220 */ 120, 120, 119, 116, 444, 422, 316, 559, 1186, 1187,
168679 /* 230 */ 1186, 149, 1218, 409, 1218, 124, 124, 124, 124, 122,
168680 /* 240 */ 122, 122, 122, 121, 121, 120, 120, 120, 119, 116,
168681 /* 250 */ 444, 465, 342, 1034, 1034, 1048, 1051, 125, 126, 80,
168682 /* 260 */ 1210, 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124,
168683 /* 270 */ 124, 124, 1275, 522, 222, 1186, 568, 409, 224, 514,
168684 /* 280 */ 175, 82, 83, 122, 122, 122, 122, 121, 121, 120,
168685 /* 290 */ 120, 120, 119, 116, 444, 1005, 16, 16, 1186, 133,
168686 /* 300 */ 133, 125, 126, 80, 1210, 1210, 1047, 1050, 1037, 1037,
168687 /* 310 */ 123, 123, 124, 124, 124, 124, 122, 122, 122, 122,
168688 /* 320 */ 121, 121, 120, 120, 120, 119, 116, 444, 1038, 546,
168689 /* 330 */ 1186, 373, 1186, 1187, 1186, 252, 1429, 399, 504, 501,
168690 /* 340 */ 500, 111, 560, 566, 4, 924, 924, 433, 499, 340,
168691 /* 350 */ 460, 328, 360, 394, 1231, 1186, 1187, 1186, 563, 568,
168692 /* 360 */ 122, 122, 122, 122, 121, 121, 120, 120, 120, 119,
168693 /* 370 */ 116, 444, 284, 284, 369, 1572, 1598, 441, 440, 154,
168694 /* 380 */ 409, 445, 71, 71, 1282, 565, 1215, 1186, 1187, 1186,
168695 /* 390 */ 85, 1217, 271, 557, 543, 515, 515, 568, 98, 1216,
168696 /* 400 */ 6, 1274, 472, 142, 125, 126, 80, 1210, 1210, 1047,
168697 /* 410 */ 1050, 1037, 1037, 123, 123, 124, 124, 124, 124, 550,
168698 /* 420 */ 13, 13, 1024, 507, 1218, 1186, 1218, 549, 109, 109,
168699 /* 430 */ 222, 568, 1232, 175, 568, 427, 110, 197, 445, 569,
168700 /* 440 */ 445, 430, 1546, 1014, 325, 551, 1186, 270, 287, 368,
168701 /* 450 */ 510, 363, 509, 257, 71, 71, 543, 71, 71, 359,
168702 /* 460 */ 316, 559, 1604, 122, 122, 122, 122, 121, 121, 120,
168703 /* 470 */ 120, 120, 119, 116, 444, 1014, 1014, 1016, 1017, 27,
168704 /* 480 */ 284, 284, 1186, 1187, 1186, 1152, 568, 1603, 409, 899,
168705 /* 490 */ 190, 550, 356, 565, 550, 935, 533, 517, 1152, 516,
168706 /* 500 */ 413, 1152, 552, 1186, 1187, 1186, 568, 544, 544, 51,
168707 /* 510 */ 51, 214, 125, 126, 80, 1210, 1210, 1047, 1050, 1037,
168708 /* 520 */ 1037, 123, 123, 124, 124, 124, 124, 1186, 474, 135,
168709 /* 530 */ 135, 409, 284, 284, 1484, 505, 121, 121, 120, 120,
168710 /* 540 */ 120, 119, 116, 444, 1005, 565, 518, 217, 541, 541,
168711 /* 550 */ 316, 559, 142, 6, 532, 125, 126, 80, 1210, 1210,
168712 /* 560 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168713 /* 570 */ 1548, 122, 122, 122, 122, 121, 121, 120, 120, 120,
168714 /* 580 */ 119, 116, 444, 485, 1186, 1187, 1186, 482, 281, 1263,
168715 /* 590 */ 955, 252, 1186, 373, 504, 501, 500, 1186, 340, 570,
168716 /* 600 */ 1186, 570, 409, 292, 499, 955, 874, 191, 480, 316,
168717 /* 610 */ 559, 384, 290, 380, 122, 122, 122, 122, 121, 121,
168718 /* 620 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1210,
168719 /* 630 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168720 /* 640 */ 124, 409, 394, 1132, 1186, 867, 100, 284, 284, 1186,
168721 /* 650 */ 1187, 1186, 373, 1089, 1186, 1187, 1186, 1186, 1187, 1186,
168722 /* 660 */ 565, 455, 32, 373, 233, 125, 126, 80, 1210, 1210,
168723 /* 670 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168724 /* 680 */ 1428, 957, 568, 228, 956, 122, 122, 122, 122, 121,
168725 /* 690 */ 121, 120, 120, 120, 119, 116, 444, 1152, 228, 1186,
168726 /* 700 */ 157, 1186, 1187, 1186, 1547, 13, 13, 301, 955, 1226,
168727 /* 710 */ 1152, 153, 409, 1152, 373, 1575, 1170, 5, 369, 1572,
168728 /* 720 */ 429, 1232, 3, 955, 122, 122, 122, 122, 121, 121,
168729 /* 730 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1210,
168730 /* 740 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168731 /* 750 */ 124, 409, 208, 567, 1186, 1025, 1186, 1187, 1186, 1186,
168732 /* 760 */ 388, 850, 155, 1546, 286, 402, 1094, 1094, 488, 568,
168733 /* 770 */ 465, 342, 1315, 1315, 1546, 125, 126, 80, 1210, 1210,
168734 /* 780 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168735 /* 790 */ 129, 568, 13, 13, 374, 122, 122, 122, 122, 121,
168736 /* 800 */ 121, 120, 120, 120, 119, 116, 444, 302, 568, 453,
168737 /* 810 */ 528, 1186, 1187, 1186, 13, 13, 1186, 1187, 1186, 1293,
168738 /* 820 */ 463, 1263, 409, 1313, 1313, 1546, 1010, 453, 452, 200,
168739 /* 830 */ 299, 71, 71, 1261, 122, 122, 122, 122, 121, 121,
168740 /* 840 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1210,
168741 /* 850 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168742 /* 860 */ 124, 409, 227, 1069, 1152, 284, 284, 419, 312, 278,
168743 /* 870 */ 278, 285, 285, 1415, 406, 405, 382, 1152, 565, 568,
168744 /* 880 */ 1152, 1189, 565, 1592, 565, 125, 126, 80, 1210, 1210,
168745 /* 890 */ 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124, 124,
168746 /* 900 */ 453, 1476, 13, 13, 1530, 122, 122, 122, 122, 121,
168747 /* 910 */ 121, 120, 120, 120, 119, 116, 444, 201, 568, 354,
168748 /* 920 */ 1578, 574, 2, 1241, 838, 839, 840, 1554, 317, 1205,
168749 /* 930 */ 146, 6, 409, 255, 254, 253, 206, 1323, 9, 1189,
168750 /* 940 */ 262, 71, 71, 424, 122, 122, 122, 122, 121, 121,
168751 /* 950 */ 120, 120, 120, 119, 116, 444, 125, 126, 80, 1210,
168752 /* 960 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168753 /* 970 */ 124, 568, 284, 284, 568, 1206, 409, 573, 313, 1241,
168754 /* 980 */ 349, 1292, 352, 419, 317, 565, 146, 491, 525, 1635,
168755 /* 990 */ 395, 371, 491, 1323, 70, 70, 1291, 71, 71, 240,
168756 /* 1000 */ 1321, 104, 80, 1210, 1210, 1047, 1050, 1037, 1037, 123,
168757 /* 1010 */ 123, 124, 124, 124, 124, 122, 122, 122, 122, 121,
168758 /* 1020 */ 121, 120, 120, 120, 119, 116, 444, 1110, 284, 284,
168759 /* 1030 */ 428, 448, 1519, 1206, 439, 284, 284, 1483, 1348, 311,
168760 /* 1040 */ 474, 565, 1111, 969, 491, 491, 217, 1259, 565, 1532,
168761 /* 1050 */ 568, 970, 207, 568, 1024, 240, 383, 1112, 519, 122,
168762 /* 1060 */ 122, 122, 122, 121, 121, 120, 120, 120, 119, 116,
168763 /* 1070 */ 444, 1015, 107, 71, 71, 1014, 13, 13, 910, 568,
168764 /* 1080 */ 1489, 568, 284, 284, 97, 526, 491, 448, 911, 1322,
168765 /* 1090 */ 1318, 545, 409, 284, 284, 565, 151, 209, 1489, 1491,
168766 /* 1100 */ 262, 450, 55, 55, 56, 56, 565, 1014, 1014, 1016,
168767 /* 1110 */ 443, 332, 409, 527, 12, 295, 125, 126, 80, 1210,
168768 /* 1120 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168769 /* 1130 */ 124, 347, 409, 862, 1528, 1206, 125, 126, 80, 1210,
168770 /* 1140 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168771 /* 1150 */ 124, 1133, 1633, 474, 1633, 371, 125, 114, 80, 1210,
168772 /* 1160 */ 1210, 1047, 1050, 1037, 1037, 123, 123, 124, 124, 124,
168773 /* 1170 */ 124, 1489, 329, 474, 331, 122, 122, 122, 122, 121,
168774 /* 1180 */ 121, 120, 120, 120, 119, 116, 444, 203, 1415, 568,
168775 /* 1190 */ 1290, 862, 464, 1206, 436, 122, 122, 122, 122, 121,
168776 /* 1200 */ 121, 120, 120, 120, 119, 116, 444, 553, 1133, 1634,
168777 /* 1210 */ 539, 1634, 15, 15, 890, 122, 122, 122, 122, 121,
168778 /* 1220 */ 121, 120, 120, 120, 119, 116, 444, 568, 298, 538,
168779 /* 1230 */ 1131, 1415, 1552, 1553, 1327, 409, 6, 6, 1163, 1264,
168780 /* 1240 */ 415, 320, 284, 284, 1415, 508, 565, 525, 300, 457,
168781 /* 1250 */ 43, 43, 568, 891, 12, 565, 330, 478, 425, 407,
168782 /* 1260 */ 126, 80, 1210, 1210, 1047, 1050, 1037, 1037, 123, 123,
168783 /* 1270 */ 124, 124, 124, 124, 568, 57, 57, 288, 1186, 1415,
168784 /* 1280 */ 496, 458, 392, 392, 391, 273, 389, 1131, 1551, 847,
168785 /* 1290 */ 1163, 407, 6, 568, 321, 1152, 470, 44, 44, 1550,
168786 /* 1300 */ 1110, 426, 234, 6, 323, 256, 540, 256, 1152, 431,
168787 /* 1310 */ 568, 1152, 322, 17, 487, 1111, 58, 58, 122, 122,
168788 /* 1320 */ 122, 122, 121, 121, 120, 120, 120, 119, 116, 444,
168789 /* 1330 */ 1112, 216, 481, 59, 59, 1186, 1187, 1186, 111, 560,
168790 /* 1340 */ 324, 4, 236, 456, 526, 568, 237, 456, 568, 437,
168791 /* 1350 */ 168, 556, 420, 141, 479, 563, 568, 293, 568, 1091,
168792 /* 1360 */ 568, 293, 568, 1091, 531, 568, 870, 8, 60, 60,
168793 /* 1370 */ 235, 61, 61, 568, 414, 568, 414, 568, 445, 62,
168794 /* 1380 */ 62, 45, 45, 46, 46, 47, 47, 199, 49, 49,
@@ -168768,73 +168798,73 @@
168798 /* 1420 */ 568, 512, 930, 870, 1015, 109, 109, 929, 1014, 66,
168799 /* 1430 */ 66, 131, 131, 110, 451, 445, 569, 445, 416, 177,
168800 /* 1440 */ 1014, 132, 132, 67, 67, 568, 467, 568, 930, 471,
168801 /* 1450 */ 1360, 283, 226, 929, 315, 1359, 407, 568, 459, 407,
168802 /* 1460 */ 1014, 1014, 1016, 239, 407, 86, 213, 1346, 52, 52,
168803 /* 1470 */ 68, 68, 1014, 1014, 1016, 1017, 27, 1577, 1174, 447,
168804 /* 1480 */ 69, 69, 288, 97, 108, 1535, 106, 392, 392, 391,
168805 /* 1490 */ 273, 389, 568, 877, 847, 881, 568, 111, 560, 466,
168806 /* 1500 */ 4, 568, 152, 30, 38, 568, 1128, 234, 396, 323,
168807 /* 1510 */ 111, 560, 527, 4, 563, 53, 53, 322, 568, 163,
168808 /* 1520 */ 163, 568, 337, 468, 164, 164, 333, 563, 76, 76,
168809 /* 1530 */ 568, 289, 1508, 568, 31, 1507, 568, 445, 338, 483,
168810 /* 1540 */ 100, 54, 54, 344, 72, 72, 296, 236, 1076, 557,
168811 /* 1550 */ 445, 877, 1356, 134, 134, 168, 73, 73, 141, 161,
168812 /* 1560 */ 161, 1566, 557, 535, 568, 319, 568, 348, 536, 1007,
168813 /* 1570 */ 473, 261, 261, 889, 888, 235, 535, 568, 1024, 568,
168814 /* 1580 */ 475, 534, 261, 367, 109, 109, 521, 136, 136, 130,
168815 /* 1590 */ 130, 1024, 110, 366, 445, 569, 445, 109, 109, 1014,
168816 /* 1600 */ 162, 162, 156, 156, 568, 110, 1076, 445, 569, 445,
168817 /* 1610 */ 410, 351, 1014, 568, 353, 316, 559, 568, 343, 568,
168818 /* 1620 */ 100, 497, 357, 258, 100, 896, 897, 140, 140, 355,
168819 /* 1630 */ 1306, 1014, 1014, 1016, 1017, 27, 139, 139, 362, 451,
168820 /* 1640 */ 137, 137, 138, 138, 1014, 1014, 1016, 1017, 27, 1174,
168821 /* 1650 */ 447, 568, 372, 288, 111, 560, 1018, 4, 392, 392,
168822 /* 1660 */ 391, 273, 389, 568, 1137, 847, 568, 1072, 568, 258,
168823 /* 1670 */ 492, 563, 568, 211, 75, 75, 555, 960, 234, 261,
168824 /* 1680 */ 323, 111, 560, 927, 4, 113, 77, 77, 322, 74,
168825 /* 1690 */ 74, 42, 42, 1369, 445, 48, 48, 1414, 563, 972,
168826 /* 1700 */ 973, 1088, 1087, 1088, 1087, 860, 557, 150, 928, 1342,
168827 /* 1710 */ 113, 1354, 554, 1419, 1018, 1271, 1262, 1250, 236, 1249,
168828 /* 1720 */ 1251, 445, 1585, 1339, 308, 276, 168, 309, 11, 141,
168829 /* 1730 */ 393, 310, 232, 557, 1401, 1024, 335, 291, 1396, 219,
168830 /* 1740 */ 336, 109, 109, 934, 297, 1406, 235, 341, 477, 110,
168831 /* 1750 */ 502, 445, 569, 445, 1389, 1405, 1014, 400, 1289, 365,
168832 /* 1760 */ 223, 1480, 1024, 1479, 1351, 1352, 1350, 1349, 109, 109,
168833 /* 1770 */ 204, 1588, 1226, 558, 265, 218, 110, 205, 445, 569,
168834 /* 1780 */ 445, 410, 387, 1014, 1527, 179, 316, 559, 1014, 1014,
168835 /* 1790 */ 1016, 1017, 27, 230, 1525, 1223, 79, 560, 85, 4,
168836 /* 1800 */ 418, 215, 548, 81, 84, 188, 1402, 173, 181, 461,
168837 /* 1810 */ 451, 35, 462, 563, 183, 1014, 1014, 1016, 1017, 27,
168838 /* 1820 */ 184, 1485, 185, 186, 495, 242, 98, 398, 1408, 36,
168839 /* 1830 */ 1407, 484, 91, 469, 401, 1410, 445, 192, 1474, 246,
168840 /* 1840 */ 1496, 490, 346, 277, 248, 196, 493, 511, 557, 350,
168841 /* 1850 */ 1252, 249, 250, 403, 1309, 1308, 111, 560, 432, 4,
168842 /* 1860 */ 1307, 1300, 93, 1602, 881, 1601, 224, 404, 434, 520,
168843 /* 1870 */ 263, 435, 1571, 563, 1279, 1278, 364, 1024, 306, 1277,
168844 /* 1880 */ 264, 1600, 1557, 109, 109, 370, 1299, 307, 1556, 438,
168845 /* 1890 */ 128, 110, 1374, 445, 569, 445, 445, 546, 1014, 10,
168846 /* 1900 */ 1461, 105, 381, 1373, 34, 571, 99, 1332, 557, 314,
168847 /* 1910 */ 1180, 530, 272, 274, 379, 210, 1331, 547, 385, 386,
168848 /* 1920 */ 275, 572, 1247, 1242, 411, 412, 1512, 165, 178, 1513,
168849 /* 1930 */ 1014, 1014, 1016, 1017, 27, 1511, 1510, 1024, 78, 147,
168850 /* 1940 */ 166, 220, 221, 109, 109, 834, 304, 167, 446, 212,
168851 /* 1950 */ 318, 110, 231, 445, 569, 445, 144, 1086, 1014, 1084,
168852 /* 1960 */ 326, 180, 169, 1205, 182, 334, 238, 913, 241, 1100,
168853 /* 1970 */ 187, 170, 171, 421, 87, 88, 423, 189, 89, 90,
168854 /* 1980 */ 172, 1103, 243, 1099, 244, 158, 18, 245, 345, 247,
168855 /* 1990 */ 1014, 1014, 1016, 1017, 27, 261, 1092, 193, 1220, 489,
168856 /* 2000 */ 194, 37, 366, 849, 494, 251, 195, 506, 92, 19,
168857 /* 2010 */ 498, 358, 20, 503, 879, 361, 94, 892, 305, 159,
168858 /* 2020 */ 513, 39, 95, 1168, 160, 1053, 964, 1139, 96, 174,
168859 /* 2030 */ 1138, 225, 280, 282, 198, 958, 113, 1158, 1154, 260,
168860 /* 2040 */ 21, 22, 23, 1156, 1162, 1161, 1143, 24, 33, 25,
168861 /* 2050 */ 202, 542, 26, 100, 1067, 102, 1054, 103, 7, 1052,
168862 /* 2060 */ 1056, 1109, 1057, 1108, 266, 267, 28, 40, 390, 1019,
168863 /* 2070 */ 861, 112, 29, 564, 1176, 1175, 268, 176, 143, 923,
168864 /* 2080 */ 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238,
168865 /* 2090 */ 1238, 1238, 1238, 1238, 269, 1593,
168866 };
168867 static const YYCODETYPE yy_lookahead[] = {
168868 /* 0 */ 193, 193, 193, 274, 275, 276, 193, 274, 275, 276,
168869 /* 10 */ 193, 223, 219, 225, 206, 210, 211, 212, 193, 19,
168870 /* 20 */ 219, 233, 216, 216, 217, 216, 217, 193, 295, 216,
@@ -169173,67 +169203,67 @@
169203 /* 380 */ 1665, 1623, 1702, 1630, 1666, 1667, 1671, 1673, 1703, 1718,
169204 /* 390 */ 1719, 1729, 1730, 1731, 1621, 1622, 1628, 1720, 1713, 1716,
169205 /* 400 */ 1722, 1723, 1733, 1717, 1724, 1727, 1728, 1725, 1740,
169206 };
169207 static const YYACTIONTYPE yy_default[] = {
169208 /* 0 */ 1639, 1639, 1639, 1469, 1236, 1347, 1236, 1236, 1236, 1469,
169209 /* 10 */ 1469, 1469, 1236, 1377, 1377, 1522, 1269, 1236, 1236, 1236,
169210 /* 20 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1468, 1236, 1236,
169211 /* 30 */ 1236, 1236, 1555, 1555, 1236, 1236, 1236, 1236, 1236, 1236,
169212 /* 40 */ 1236, 1236, 1386, 1236, 1393, 1236, 1236, 1236, 1236, 1236,
169213 /* 50 */ 1470, 1471, 1236, 1236, 1236, 1521, 1523, 1486, 1400, 1399,
169214 /* 60 */ 1398, 1397, 1504, 1365, 1391, 1384, 1388, 1465, 1466, 1464,
169215 /* 70 */ 1617, 1471, 1470, 1236, 1387, 1433, 1449, 1432, 1236, 1236,
169216 /* 80 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169217 /* 90 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169218 /* 100 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169219 /* 110 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169220 /* 120 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169221 /* 130 */ 1441, 1448, 1447, 1446, 1455, 1445, 1442, 1435, 1434, 1436,
169222 /* 140 */ 1437, 1236, 1236, 1260, 1236, 1236, 1257, 1311, 1236, 1236,
169223 /* 150 */ 1236, 1236, 1236, 1541, 1540, 1236, 1438, 1236, 1269, 1427,
169224 /* 160 */ 1426, 1452, 1439, 1451, 1450, 1529, 1591, 1590, 1487, 1236,
169225 /* 170 */ 1236, 1236, 1236, 1236, 1236, 1555, 1236, 1236, 1236, 1236,
169226 /* 180 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169227 /* 190 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1367,
169228 /* 200 */ 1555, 1555, 1236, 1269, 1555, 1555, 1368, 1368, 1265, 1265,
169229 /* 210 */ 1371, 1236, 1536, 1338, 1338, 1338, 1338, 1347, 1338, 1236,
169230 /* 220 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169231 /* 230 */ 1236, 1236, 1236, 1236, 1526, 1524, 1236, 1236, 1236, 1236,
169232 /* 240 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169233 /* 250 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169234 /* 260 */ 1236, 1236, 1236, 1343, 1236, 1236, 1236, 1236, 1236, 1236,
169235 /* 270 */ 1236, 1236, 1236, 1236, 1236, 1584, 1236, 1499, 1325, 1343,
169236 /* 280 */ 1343, 1343, 1343, 1345, 1326, 1324, 1337, 1270, 1243, 1631,
169237 /* 290 */ 1403, 1392, 1344, 1392, 1628, 1390, 1403, 1403, 1390, 1403,
169238 /* 300 */ 1344, 1628, 1286, 1606, 1281, 1377, 1377, 1377, 1367, 1367,
169239 /* 310 */ 1367, 1367, 1371, 1371, 1467, 1344, 1337, 1236, 1631, 1631,
169240 /* 320 */ 1353, 1353, 1630, 1630, 1353, 1487, 1614, 1412, 1314, 1320,
169241 /* 330 */ 1320, 1320, 1320, 1353, 1254, 1390, 1614, 1614, 1390, 1412,
169242 /* 340 */ 1314, 1390, 1314, 1390, 1353, 1254, 1503, 1625, 1353, 1254,
169243 /* 350 */ 1477, 1353, 1254, 1353, 1254, 1477, 1312, 1312, 1312, 1301,
169244 /* 360 */ 1236, 1236, 1477, 1312, 1286, 1312, 1301, 1312, 1312, 1573,
169245 /* 370 */ 1236, 1481, 1481, 1477, 1353, 1565, 1565, 1380, 1380, 1385,
169246 /* 380 */ 1371, 1472, 1353, 1236, 1385, 1383, 1381, 1390, 1304, 1587,
169247 /* 390 */ 1587, 1583, 1583, 1583, 1636, 1636, 1536, 1599, 1269, 1269,
169248 /* 400 */ 1269, 1269, 1599, 1288, 1288, 1270, 1270, 1269, 1599, 1236,
169249 /* 410 */ 1236, 1236, 1236, 1236, 1236, 1594, 1236, 1531, 1488, 1357,
169250 /* 420 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169251 /* 430 */ 1236, 1236, 1236, 1236, 1542, 1236, 1236, 1236, 1236, 1236,
169252 /* 440 */ 1236, 1236, 1236, 1236, 1236, 1417, 1236, 1239, 1533, 1236,
169253 /* 450 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1394, 1395, 1358,
169254 /* 460 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1409, 1236, 1236,
169255 /* 470 */ 1236, 1404, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169256 /* 480 */ 1627, 1236, 1236, 1236, 1236, 1236, 1236, 1502, 1501, 1236,
169257 /* 490 */ 1236, 1355, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169258 /* 500 */ 1236, 1236, 1236, 1236, 1236, 1284, 1236, 1236, 1236, 1236,
169259 /* 510 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169260 /* 520 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1382,
169261 /* 530 */ 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169262 /* 540 */ 1236, 1236, 1236, 1236, 1570, 1372, 1236, 1236, 1236, 1236,
169263 /* 550 */ 1618, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236, 1236,
169264 /* 560 */ 1236, 1236, 1236, 1236, 1236, 1610, 1328, 1418, 1236, 1421,
169265 /* 570 */ 1258, 1236, 1248, 1236, 1236,
169266 };
169267 /********** End of lemon-generated parsing tables *****************************/
169268
169269 /* The next table maps tokens (terminal symbols) into fallback tokens.
@@ -170158,104 +170188,104 @@
170188 /* 304 */ "wqas ::= AS MATERIALIZED",
170189 /* 305 */ "wqas ::= AS NOT MATERIALIZED",
170190 /* 306 */ "wqitem ::= nm eidlist_opt wqas LP select RP",
170191 /* 307 */ "wqlist ::= wqitem",
170192 /* 308 */ "wqlist ::= wqlist COMMA wqitem",
170193 /* 309 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
170194 /* 310 */ "windowdefn ::= nm AS LP window RP",
170195 /* 311 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
170196 /* 312 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
170197 /* 313 */ "window ::= ORDER BY sortlist frame_opt",
170198 /* 314 */ "window ::= nm ORDER BY sortlist frame_opt",
170199 /* 315 */ "window ::= nm frame_opt",
170200 /* 316 */ "frame_opt ::=",
170201 /* 317 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
170202 /* 318 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
170203 /* 319 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
170204 /* 320 */ "frame_bound_s ::= frame_bound",
170205 /* 321 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
170206 /* 322 */ "frame_bound_e ::= frame_bound",
170207 /* 323 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
170208 /* 324 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
170209 /* 325 */ "frame_bound ::= CURRENT ROW",
170210 /* 326 */ "frame_exclude_opt ::=",
170211 /* 327 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
170212 /* 328 */ "frame_exclude ::= NO OTHERS",
170213 /* 329 */ "frame_exclude ::= CURRENT ROW",
170214 /* 330 */ "frame_exclude ::= GROUP|TIES",
170215 /* 331 */ "window_clause ::= WINDOW windowdefn_list",
170216 /* 332 */ "filter_over ::= filter_clause over_clause",
170217 /* 333 */ "filter_over ::= over_clause",
170218 /* 334 */ "filter_over ::= filter_clause",
170219 /* 335 */ "over_clause ::= OVER LP window RP",
170220 /* 336 */ "over_clause ::= OVER nm",
170221 /* 337 */ "filter_clause ::= FILTER LP WHERE expr RP",
170222 /* 338 */ "input ::= cmdlist",
170223 /* 339 */ "cmdlist ::= cmdlist ecmd",
170224 /* 340 */ "cmdlist ::= ecmd",
170225 /* 341 */ "ecmd ::= SEMI",
170226 /* 342 */ "ecmd ::= cmdx SEMI",
170227 /* 343 */ "ecmd ::= explain cmdx SEMI",
170228 /* 344 */ "trans_opt ::=",
170229 /* 345 */ "trans_opt ::= TRANSACTION",
170230 /* 346 */ "trans_opt ::= TRANSACTION nm",
170231 /* 347 */ "savepoint_opt ::= SAVEPOINT",
170232 /* 348 */ "savepoint_opt ::=",
170233 /* 349 */ "cmd ::= create_table create_table_args",
170234 /* 350 */ "table_option_set ::= table_option",
170235 /* 351 */ "columnlist ::= columnlist COMMA columnname carglist",
170236 /* 352 */ "columnlist ::= columnname carglist",
170237 /* 353 */ "nm ::= ID|INDEXED|JOIN_KW",
170238 /* 354 */ "nm ::= STRING",
170239 /* 355 */ "typetoken ::= typename",
170240 /* 356 */ "typename ::= ID|STRING",
170241 /* 357 */ "signed ::= plus_num",
170242 /* 358 */ "signed ::= minus_num",
170243 /* 359 */ "carglist ::= carglist ccons",
170244 /* 360 */ "carglist ::=",
170245 /* 361 */ "ccons ::= NULL onconf",
170246 /* 362 */ "ccons ::= GENERATED ALWAYS AS generated",
170247 /* 363 */ "ccons ::= AS generated",
170248 /* 364 */ "conslist_opt ::= COMMA conslist",
170249 /* 365 */ "conslist ::= conslist tconscomma tcons",
170250 /* 366 */ "conslist ::= tcons",
170251 /* 367 */ "tconscomma ::=",
170252 /* 368 */ "defer_subclause_opt ::= defer_subclause",
170253 /* 369 */ "resolvetype ::= raisetype",
170254 /* 370 */ "selectnowith ::= oneselect",
170255 /* 371 */ "oneselect ::= values",
170256 /* 372 */ "sclp ::= selcollist COMMA",
170257 /* 373 */ "as ::= ID|STRING",
170258 /* 374 */ "indexed_opt ::= indexed_by",
170259 /* 375 */ "returning ::=",
170260 /* 376 */ "expr ::= term",
170261 /* 377 */ "likeop ::= LIKE_KW|MATCH",
170262 /* 378 */ "case_operand ::= expr",
170263 /* 379 */ "exprlist ::= nexprlist",
170264 /* 380 */ "nmnum ::= plus_num",
170265 /* 381 */ "nmnum ::= nm",
170266 /* 382 */ "nmnum ::= ON",
170267 /* 383 */ "nmnum ::= DELETE",
170268 /* 384 */ "nmnum ::= DEFAULT",
170269 /* 385 */ "plus_num ::= INTEGER|FLOAT",
170270 /* 386 */ "foreach_clause ::=",
170271 /* 387 */ "foreach_clause ::= FOR EACH ROW",
170272 /* 388 */ "trnm ::= nm",
170273 /* 389 */ "tridxby ::=",
170274 /* 390 */ "database_kw_opt ::= DATABASE",
170275 /* 391 */ "database_kw_opt ::=",
170276 /* 392 */ "kwcolumn_opt ::=",
170277 /* 393 */ "kwcolumn_opt ::= COLUMNKW",
170278 /* 394 */ "vtabarglist ::= vtabarg",
170279 /* 395 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
170280 /* 396 */ "vtabarg ::= vtabarg vtabargtoken",
170281 /* 397 */ "anylist ::=",
170282 /* 398 */ "anylist ::= anylist LP anylist RP",
170283 /* 399 */ "anylist ::= anylist ANY",
170284 /* 400 */ "with ::=",
170285 /* 401 */ "windowdefn_list ::= windowdefn",
170286 /* 402 */ "window ::= frame_opt",
170287 };
170288 #endif /* NDEBUG */
170289
170290
170291 #if YYSTACKDEPTH<=0
@@ -171067,104 +171097,104 @@
171097 305, /* (304) wqas ::= AS MATERIALIZED */
171098 305, /* (305) wqas ::= AS NOT MATERIALIZED */
171099 304, /* (306) wqitem ::= nm eidlist_opt wqas LP select RP */
171100 241, /* (307) wqlist ::= wqitem */
171101 241, /* (308) wqlist ::= wqlist COMMA wqitem */
171102 306, /* (309) windowdefn_list ::= windowdefn_list COMMA windowdefn */
171103 307, /* (310) windowdefn ::= nm AS LP window RP */
171104 308, /* (311) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
171105 308, /* (312) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
171106 308, /* (313) window ::= ORDER BY sortlist frame_opt */
171107 308, /* (314) window ::= nm ORDER BY sortlist frame_opt */
171108 308, /* (315) window ::= nm frame_opt */
171109 309, /* (316) frame_opt ::= */
171110 309, /* (317) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
171111 309, /* (318) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
171112 313, /* (319) range_or_rows ::= RANGE|ROWS|GROUPS */
171113 315, /* (320) frame_bound_s ::= frame_bound */
171114 315, /* (321) frame_bound_s ::= UNBOUNDED PRECEDING */
171115 316, /* (322) frame_bound_e ::= frame_bound */
171116 316, /* (323) frame_bound_e ::= UNBOUNDED FOLLOWING */
171117 314, /* (324) frame_bound ::= expr PRECEDING|FOLLOWING */
171118 314, /* (325) frame_bound ::= CURRENT ROW */
171119 317, /* (326) frame_exclude_opt ::= */
171120 317, /* (327) frame_exclude_opt ::= EXCLUDE frame_exclude */
171121 318, /* (328) frame_exclude ::= NO OTHERS */
171122 318, /* (329) frame_exclude ::= CURRENT ROW */
171123 318, /* (330) frame_exclude ::= GROUP|TIES */
171124 251, /* (331) window_clause ::= WINDOW windowdefn_list */
171125 273, /* (332) filter_over ::= filter_clause over_clause */
171126 273, /* (333) filter_over ::= over_clause */
171127 273, /* (334) filter_over ::= filter_clause */
171128 312, /* (335) over_clause ::= OVER LP window RP */
171129 312, /* (336) over_clause ::= OVER nm */
171130 311, /* (337) filter_clause ::= FILTER LP WHERE expr RP */
171131 185, /* (338) input ::= cmdlist */
171132 186, /* (339) cmdlist ::= cmdlist ecmd */
171133 186, /* (340) cmdlist ::= ecmd */
171134 187, /* (341) ecmd ::= SEMI */
171135 187, /* (342) ecmd ::= cmdx SEMI */
171136 187, /* (343) ecmd ::= explain cmdx SEMI */
171137 192, /* (344) trans_opt ::= */
171138 192, /* (345) trans_opt ::= TRANSACTION */
171139 192, /* (346) trans_opt ::= TRANSACTION nm */
171140 194, /* (347) savepoint_opt ::= SAVEPOINT */
171141 194, /* (348) savepoint_opt ::= */
171142 190, /* (349) cmd ::= create_table create_table_args */
171143 203, /* (350) table_option_set ::= table_option */
171144 201, /* (351) columnlist ::= columnlist COMMA columnname carglist */
171145 201, /* (352) columnlist ::= columnname carglist */
171146 193, /* (353) nm ::= ID|INDEXED|JOIN_KW */
171147 193, /* (354) nm ::= STRING */
171148 208, /* (355) typetoken ::= typename */
171149 209, /* (356) typename ::= ID|STRING */
171150 210, /* (357) signed ::= plus_num */
171151 210, /* (358) signed ::= minus_num */
171152 207, /* (359) carglist ::= carglist ccons */
171153 207, /* (360) carglist ::= */
171154 215, /* (361) ccons ::= NULL onconf */
171155 215, /* (362) ccons ::= GENERATED ALWAYS AS generated */
171156 215, /* (363) ccons ::= AS generated */
171157 202, /* (364) conslist_opt ::= COMMA conslist */
171158 228, /* (365) conslist ::= conslist tconscomma tcons */
171159 228, /* (366) conslist ::= tcons */
171160 229, /* (367) tconscomma ::= */
171161 233, /* (368) defer_subclause_opt ::= defer_subclause */
171162 235, /* (369) resolvetype ::= raisetype */
171163 239, /* (370) selectnowith ::= oneselect */
171164 240, /* (371) oneselect ::= values */
171165 254, /* (372) sclp ::= selcollist COMMA */
171166 255, /* (373) as ::= ID|STRING */
171167 264, /* (374) indexed_opt ::= indexed_by */
171168 272, /* (375) returning ::= */
171169 217, /* (376) expr ::= term */
171170 274, /* (377) likeop ::= LIKE_KW|MATCH */
171171 278, /* (378) case_operand ::= expr */
171172 261, /* (379) exprlist ::= nexprlist */
171173 284, /* (380) nmnum ::= plus_num */
171174 284, /* (381) nmnum ::= nm */
171175 284, /* (382) nmnum ::= ON */
171176 284, /* (383) nmnum ::= DELETE */
171177 284, /* (384) nmnum ::= DEFAULT */
171178 211, /* (385) plus_num ::= INTEGER|FLOAT */
171179 289, /* (386) foreach_clause ::= */
171180 289, /* (387) foreach_clause ::= FOR EACH ROW */
171181 292, /* (388) trnm ::= nm */
171182 293, /* (389) tridxby ::= */
171183 294, /* (390) database_kw_opt ::= DATABASE */
171184 294, /* (391) database_kw_opt ::= */
171185 297, /* (392) kwcolumn_opt ::= */
171186 297, /* (393) kwcolumn_opt ::= COLUMNKW */
171187 299, /* (394) vtabarglist ::= vtabarg */
171188 299, /* (395) vtabarglist ::= vtabarglist COMMA vtabarg */
171189 300, /* (396) vtabarg ::= vtabarg vtabargtoken */
171190 303, /* (397) anylist ::= */
171191 303, /* (398) anylist ::= anylist LP anylist RP */
171192 303, /* (399) anylist ::= anylist ANY */
171193 266, /* (400) with ::= */
171194 306, /* (401) windowdefn_list ::= windowdefn */
171195 308, /* (402) window ::= frame_opt */
171196 };
171197
171198 /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
171199 ** of symbols on the right-hand side of that rule. */
171200 static const signed char yyRuleInfoNRhs[] = {
@@ -171475,104 +171505,104 @@
171505 -2, /* (304) wqas ::= AS MATERIALIZED */
171506 -3, /* (305) wqas ::= AS NOT MATERIALIZED */
171507 -6, /* (306) wqitem ::= nm eidlist_opt wqas LP select RP */
171508 -1, /* (307) wqlist ::= wqitem */
171509 -3, /* (308) wqlist ::= wqlist COMMA wqitem */
171510 -3, /* (309) windowdefn_list ::= windowdefn_list COMMA windowdefn */
171511 -5, /* (310) windowdefn ::= nm AS LP window RP */
171512 -5, /* (311) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
171513 -6, /* (312) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
171514 -4, /* (313) window ::= ORDER BY sortlist frame_opt */
171515 -5, /* (314) window ::= nm ORDER BY sortlist frame_opt */
171516 -2, /* (315) window ::= nm frame_opt */
171517 0, /* (316) frame_opt ::= */
171518 -3, /* (317) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
171519 -6, /* (318) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
171520 -1, /* (319) range_or_rows ::= RANGE|ROWS|GROUPS */
171521 -1, /* (320) frame_bound_s ::= frame_bound */
171522 -2, /* (321) frame_bound_s ::= UNBOUNDED PRECEDING */
171523 -1, /* (322) frame_bound_e ::= frame_bound */
171524 -2, /* (323) frame_bound_e ::= UNBOUNDED FOLLOWING */
171525 -2, /* (324) frame_bound ::= expr PRECEDING|FOLLOWING */
171526 -2, /* (325) frame_bound ::= CURRENT ROW */
171527 0, /* (326) frame_exclude_opt ::= */
171528 -2, /* (327) frame_exclude_opt ::= EXCLUDE frame_exclude */
171529 -2, /* (328) frame_exclude ::= NO OTHERS */
171530 -2, /* (329) frame_exclude ::= CURRENT ROW */
171531 -1, /* (330) frame_exclude ::= GROUP|TIES */
171532 -2, /* (331) window_clause ::= WINDOW windowdefn_list */
171533 -2, /* (332) filter_over ::= filter_clause over_clause */
171534 -1, /* (333) filter_over ::= over_clause */
171535 -1, /* (334) filter_over ::= filter_clause */
171536 -4, /* (335) over_clause ::= OVER LP window RP */
171537 -2, /* (336) over_clause ::= OVER nm */
171538 -5, /* (337) filter_clause ::= FILTER LP WHERE expr RP */
171539 -1, /* (338) input ::= cmdlist */
171540 -2, /* (339) cmdlist ::= cmdlist ecmd */
171541 -1, /* (340) cmdlist ::= ecmd */
171542 -1, /* (341) ecmd ::= SEMI */
171543 -2, /* (342) ecmd ::= cmdx SEMI */
171544 -3, /* (343) ecmd ::= explain cmdx SEMI */
171545 0, /* (344) trans_opt ::= */
171546 -1, /* (345) trans_opt ::= TRANSACTION */
171547 -2, /* (346) trans_opt ::= TRANSACTION nm */
171548 -1, /* (347) savepoint_opt ::= SAVEPOINT */
171549 0, /* (348) savepoint_opt ::= */
171550 -2, /* (349) cmd ::= create_table create_table_args */
171551 -1, /* (350) table_option_set ::= table_option */
171552 -4, /* (351) columnlist ::= columnlist COMMA columnname carglist */
171553 -2, /* (352) columnlist ::= columnname carglist */
171554 -1, /* (353) nm ::= ID|INDEXED|JOIN_KW */
171555 -1, /* (354) nm ::= STRING */
171556 -1, /* (355) typetoken ::= typename */
171557 -1, /* (356) typename ::= ID|STRING */
171558 -1, /* (357) signed ::= plus_num */
171559 -1, /* (358) signed ::= minus_num */
171560 -2, /* (359) carglist ::= carglist ccons */
171561 0, /* (360) carglist ::= */
171562 -2, /* (361) ccons ::= NULL onconf */
171563 -4, /* (362) ccons ::= GENERATED ALWAYS AS generated */
171564 -2, /* (363) ccons ::= AS generated */
171565 -2, /* (364) conslist_opt ::= COMMA conslist */
171566 -3, /* (365) conslist ::= conslist tconscomma tcons */
171567 -1, /* (366) conslist ::= tcons */
171568 0, /* (367) tconscomma ::= */
171569 -1, /* (368) defer_subclause_opt ::= defer_subclause */
171570 -1, /* (369) resolvetype ::= raisetype */
171571 -1, /* (370) selectnowith ::= oneselect */
171572 -1, /* (371) oneselect ::= values */
171573 -2, /* (372) sclp ::= selcollist COMMA */
171574 -1, /* (373) as ::= ID|STRING */
171575 -1, /* (374) indexed_opt ::= indexed_by */
171576 0, /* (375) returning ::= */
171577 -1, /* (376) expr ::= term */
171578 -1, /* (377) likeop ::= LIKE_KW|MATCH */
171579 -1, /* (378) case_operand ::= expr */
171580 -1, /* (379) exprlist ::= nexprlist */
171581 -1, /* (380) nmnum ::= plus_num */
171582 -1, /* (381) nmnum ::= nm */
171583 -1, /* (382) nmnum ::= ON */
171584 -1, /* (383) nmnum ::= DELETE */
171585 -1, /* (384) nmnum ::= DEFAULT */
171586 -1, /* (385) plus_num ::= INTEGER|FLOAT */
171587 0, /* (386) foreach_clause ::= */
171588 -3, /* (387) foreach_clause ::= FOR EACH ROW */
171589 -1, /* (388) trnm ::= nm */
171590 0, /* (389) tridxby ::= */
171591 -1, /* (390) database_kw_opt ::= DATABASE */
171592 0, /* (391) database_kw_opt ::= */
171593 0, /* (392) kwcolumn_opt ::= */
171594 -1, /* (393) kwcolumn_opt ::= COLUMNKW */
171595 -1, /* (394) vtabarglist ::= vtabarg */
171596 -3, /* (395) vtabarglist ::= vtabarglist COMMA vtabarg */
171597 -2, /* (396) vtabarg ::= vtabarg vtabargtoken */
171598 0, /* (397) anylist ::= */
171599 -4, /* (398) anylist ::= anylist LP anylist RP */
171600 -2, /* (399) anylist ::= anylist ANY */
171601 0, /* (400) with ::= */
171602 -1, /* (401) windowdefn_list ::= windowdefn */
171603 -1, /* (402) window ::= frame_opt */
171604 };
171605
171606 static void yy_accept(yyParser*); /* Forward Declaration */
171607
171608 /*
@@ -171628,11 +171658,11 @@
171658 {yymsp[1].minor.yy394 = TK_DEFERRED;}
171659 break;
171660 case 5: /* transtype ::= DEFERRED */
171661 case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
171662 case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
171663 case 319: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==319);
171664 {yymsp[0].minor.yy394 = yymsp[0].major; /*A-overwrites-X*/}
171665 break;
171666 case 8: /* cmd ::= COMMIT|END trans_opt */
171667 case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
171668 {sqlite3EndTransaction(pParse,yymsp[-1].major);}
@@ -171924,11 +171954,10 @@
171954 {
171955 Select *p = yymsp[0].minor.yy47;
171956 if( p ){
171957 parserDoubleLinkSelect(pParse, p);
171958 }
 
171959 }
171960 break;
171961 case 88: /* selectnowith ::= selectnowith multiselect_op oneselect */
171962 {
171963 Select *pRhs = yymsp[0].minor.yy47;
@@ -172016,18 +172045,21 @@
172045 }
172046 break;
172047 case 101: /* selcollist ::= sclp scanpt STAR */
172048 {
172049 Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
172050 sqlite3ExprSetErrorOffset(p, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
172051 yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, p);
172052 }
172053 break;
172054 case 102: /* selcollist ::= sclp scanpt nm DOT STAR */
172055 {
172056 Expr *pRight, *pLeft, *pDot;
172057 pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
172058 sqlite3ExprSetErrorOffset(pRight, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
172059 pLeft = tokenExpr(pParse, TK_ID, yymsp[-2].minor.yy0);
172060 pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
172061 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, pDot);
172062 }
172063 break;
172064 case 103: /* as ::= AS nm */
172065 case 115: /* dbnm ::= DOT nm */ yytestcase(yyruleno==115);
@@ -172917,116 +172949,105 @@
172949 case 308: /* wqlist ::= wqlist COMMA wqitem */
172950 {
172951 yymsp[-2].minor.yy521 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy521, yymsp[0].minor.yy385);
172952 }
172953 break;
172954 case 309: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
 
 
 
 
172955 {
172956 assert( yymsp[0].minor.yy41!=0 );
172957 sqlite3WindowChain(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy41);
172958 yymsp[0].minor.yy41->pNextWin = yymsp[-2].minor.yy41;
172959 yylhsminor.yy41 = yymsp[0].minor.yy41;
172960 }
172961 yymsp[-2].minor.yy41 = yylhsminor.yy41;
172962 break;
172963 case 310: /* windowdefn ::= nm AS LP window RP */
172964 {
172965 if( ALWAYS(yymsp[-1].minor.yy41) ){
172966 yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
172967 }
172968 yylhsminor.yy41 = yymsp[-1].minor.yy41;
172969 }
172970 yymsp[-4].minor.yy41 = yylhsminor.yy41;
172971 break;
172972 case 311: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
172973 {
172974 yymsp[-4].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, 0);
172975 }
172976 break;
172977 case 312: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
172978 {
172979 yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, yymsp[-2].minor.yy322, yymsp[-1].minor.yy322, &yymsp[-5].minor.yy0);
172980 }
172981 yymsp[-5].minor.yy41 = yylhsminor.yy41;
172982 break;
172983 case 313: /* window ::= ORDER BY sortlist frame_opt */
172984 {
172985 yymsp[-3].minor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, 0);
172986 }
172987 break;
172988 case 314: /* window ::= nm ORDER BY sortlist frame_opt */
172989 {
172990 yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
172991 }
172992 yymsp[-4].minor.yy41 = yylhsminor.yy41;
172993 break;
172994 case 315: /* window ::= nm frame_opt */
 
 
 
 
 
 
 
172995 {
172996 yylhsminor.yy41 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy41, 0, 0, &yymsp[-1].minor.yy0);
172997 }
172998 yymsp[-1].minor.yy41 = yylhsminor.yy41;
172999 break;
173000 case 316: /* frame_opt ::= */
173001 {
173002 yymsp[1].minor.yy41 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
173003 }
173004 break;
173005 case 317: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
173006 {
173007 yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy394, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy516);
173008 }
173009 yymsp[-2].minor.yy41 = yylhsminor.yy41;
173010 break;
173011 case 318: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
173012 {
173013 yylhsminor.yy41 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy394, yymsp[-3].minor.yy595.eType, yymsp[-3].minor.yy595.pExpr, yymsp[-1].minor.yy595.eType, yymsp[-1].minor.yy595.pExpr, yymsp[0].minor.yy516);
173014 }
173015 yymsp[-5].minor.yy41 = yylhsminor.yy41;
173016 break;
173017 case 320: /* frame_bound_s ::= frame_bound */
173018 case 322: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==322);
173019 {yylhsminor.yy595 = yymsp[0].minor.yy595;}
173020 yymsp[0].minor.yy595 = yylhsminor.yy595;
173021 break;
173022 case 321: /* frame_bound_s ::= UNBOUNDED PRECEDING */
173023 case 323: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==323);
173024 case 325: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==325);
173025 {yylhsminor.yy595.eType = yymsp[-1].major; yylhsminor.yy595.pExpr = 0;}
173026 yymsp[-1].minor.yy595 = yylhsminor.yy595;
173027 break;
173028 case 324: /* frame_bound ::= expr PRECEDING|FOLLOWING */
173029 {yylhsminor.yy595.eType = yymsp[0].major; yylhsminor.yy595.pExpr = yymsp[-1].minor.yy528;}
173030 yymsp[-1].minor.yy595 = yylhsminor.yy595;
173031 break;
173032 case 326: /* frame_exclude_opt ::= */
173033 {yymsp[1].minor.yy516 = 0;}
173034 break;
173035 case 327: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
173036 {yymsp[-1].minor.yy516 = yymsp[0].minor.yy516;}
173037 break;
173038 case 328: /* frame_exclude ::= NO OTHERS */
173039 case 329: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==329);
173040 {yymsp[-1].minor.yy516 = yymsp[-1].major; /*A-overwrites-X*/}
173041 break;
173042 case 330: /* frame_exclude ::= GROUP|TIES */
173043 {yymsp[0].minor.yy516 = yymsp[0].major; /*A-overwrites-X*/}
173044 break;
173045 case 331: /* window_clause ::= WINDOW windowdefn_list */
173046 { yymsp[-1].minor.yy41 = yymsp[0].minor.yy41; }
173047 break;
173048 case 332: /* filter_over ::= filter_clause over_clause */
173049 {
173050 if( yymsp[0].minor.yy41 ){
173051 yymsp[0].minor.yy41->pFilter = yymsp[-1].minor.yy528;
173052 }else{
173053 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy528);
@@ -173033,11 +173054,17 @@
173054 }
173055 yylhsminor.yy41 = yymsp[0].minor.yy41;
173056 }
173057 yymsp[-1].minor.yy41 = yylhsminor.yy41;
173058 break;
173059 case 333: /* filter_over ::= over_clause */
173060 {
173061 yylhsminor.yy41 = yymsp[0].minor.yy41;
173062 }
173063 yymsp[0].minor.yy41 = yylhsminor.yy41;
173064 break;
173065 case 334: /* filter_over ::= filter_clause */
173066 {
173067 yylhsminor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
173068 if( yylhsminor.yy41 ){
173069 yylhsminor.yy41->eFrmType = TK_FILTER;
173070 yylhsminor.yy41->pFilter = yymsp[0].minor.yy528;
@@ -173045,91 +173072,93 @@
173072 sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy528);
173073 }
173074 }
173075 yymsp[0].minor.yy41 = yylhsminor.yy41;
173076 break;
173077 case 335: /* over_clause ::= OVER LP window RP */
173078 {
173079 yymsp[-3].minor.yy41 = yymsp[-1].minor.yy41;
173080 assert( yymsp[-3].minor.yy41!=0 );
173081 }
173082 break;
173083 case 336: /* over_clause ::= OVER nm */
173084 {
173085 yymsp[-1].minor.yy41 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
173086 if( yymsp[-1].minor.yy41 ){
173087 yymsp[-1].minor.yy41->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
173088 }
173089 }
173090 break;
173091 case 337: /* filter_clause ::= FILTER LP WHERE expr RP */
173092 { yymsp[-4].minor.yy528 = yymsp[-1].minor.yy528; }
173093 break;
173094 default:
173095 /* (338) input ::= cmdlist */ yytestcase(yyruleno==338);
173096 /* (339) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==339);
173097 /* (340) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=340);
173098 /* (341) ecmd ::= SEMI */ yytestcase(yyruleno==341);
173099 /* (342) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==342);
173100 /* (343) ecmd ::= explain cmdx SEMI (NEVER REDUCES) */ assert(yyruleno!=343);
173101 /* (344) trans_opt ::= */ yytestcase(yyruleno==344);
173102 /* (345) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==345);
173103 /* (346) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==346);
173104 /* (347) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==347);
173105 /* (348) savepoint_opt ::= */ yytestcase(yyruleno==348);
173106 /* (349) cmd ::= create_table create_table_args */ yytestcase(yyruleno==349);
173107 /* (350) table_option_set ::= table_option (OPTIMIZED OUT) */ assert(yyruleno!=350);
173108 /* (351) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==351);
173109 /* (352) columnlist ::= columnname carglist */ yytestcase(yyruleno==352);
173110 /* (353) nm ::= ID|INDEXED|JOIN_KW */ yytestcase(yyruleno==353);
173111 /* (354) nm ::= STRING */ yytestcase(yyruleno==354);
173112 /* (355) typetoken ::= typename */ yytestcase(yyruleno==355);
173113 /* (356) typename ::= ID|STRING */ yytestcase(yyruleno==356);
173114 /* (357) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=357);
173115 /* (358) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=358);
173116 /* (359) carglist ::= carglist ccons */ yytestcase(yyruleno==359);
173117 /* (360) carglist ::= */ yytestcase(yyruleno==360);
173118 /* (361) ccons ::= NULL onconf */ yytestcase(yyruleno==361);
173119 /* (362) ccons ::= GENERATED ALWAYS AS generated */ yytestcase(yyruleno==362);
173120 /* (363) ccons ::= AS generated */ yytestcase(yyruleno==363);
173121 /* (364) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==364);
173122 /* (365) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==365);
173123 /* (366) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=366);
173124 /* (367) tconscomma ::= */ yytestcase(yyruleno==367);
173125 /* (368) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=368);
173126 /* (369) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=369);
173127 /* (370) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=370);
173128 /* (371) oneselect ::= values */ yytestcase(yyruleno==371);
173129 /* (372) sclp ::= selcollist COMMA */ yytestcase(yyruleno==372);
173130 /* (373) as ::= ID|STRING */ yytestcase(yyruleno==373);
173131 /* (374) indexed_opt ::= indexed_by (OPTIMIZED OUT) */ assert(yyruleno!=374);
173132 /* (375) returning ::= */ yytestcase(yyruleno==375);
173133 /* (376) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=376);
173134 /* (377) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==377);
173135 /* (378) case_operand ::= expr */ yytestcase(yyruleno==378);
173136 /* (379) exprlist ::= nexprlist */ yytestcase(yyruleno==379);
173137 /* (380) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=380);
173138 /* (381) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=381);
173139 /* (382) nmnum ::= ON */ yytestcase(yyruleno==382);
173140 /* (383) nmnum ::= DELETE */ yytestcase(yyruleno==383);
173141 /* (384) nmnum ::= DEFAULT */ yytestcase(yyruleno==384);
173142 /* (385) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==385);
173143 /* (386) foreach_clause ::= */ yytestcase(yyruleno==386);
173144 /* (387) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==387);
173145 /* (388) trnm ::= nm */ yytestcase(yyruleno==388);
173146 /* (389) tridxby ::= */ yytestcase(yyruleno==389);
173147 /* (390) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==390);
173148 /* (391) database_kw_opt ::= */ yytestcase(yyruleno==391);
173149 /* (392) kwcolumn_opt ::= */ yytestcase(yyruleno==392);
173150 /* (393) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==393);
173151 /* (394) vtabarglist ::= vtabarg */ yytestcase(yyruleno==394);
173152 /* (395) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==395);
173153 /* (396) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==396);
173154 /* (397) anylist ::= */ yytestcase(yyruleno==397);
173155 /* (398) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==398);
173156 /* (399) anylist ::= anylist ANY */ yytestcase(yyruleno==399);
173157 /* (400) with ::= */ yytestcase(yyruleno==400);
173158 /* (401) windowdefn_list ::= windowdefn (OPTIMIZED OUT) */ assert(yyruleno!=401);
173159 /* (402) window ::= frame_opt (OPTIMIZED OUT) */ assert(yyruleno!=402);
173160 break;
173161 /********** End reduce actions ************************************************/
173162 };
173163 assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
173164 yygoto = yyRuleInfoLhs[yyruleno];
@@ -203503,10 +203532,15 @@
203532 #else
203533 # define ALWAYS(X) (X)
203534 # define NEVER(X) (X)
203535 #endif
203536 #endif /* !defined(SQLITE_AMALGAMATION) */
203537
203538 /* Macro to check for 4-byte alignment. Only used inside of assert() */
203539 #ifdef SQLITE_DEBUG
203540 # define FOUR_BYTE_ALIGNED(X) ((((char*)(X) - (char*)0) & 3)==0)
203541 #endif
203542
203543 /* #include <string.h> */
203544 /* #include <stdio.h> */
203545 /* #include <assert.h> */
203546 /* #include <stdlib.h> */
@@ -203910,11 +203944,11 @@
203944 */
203945 static int readInt16(u8 *p){
203946 return (p[0]<<8) + p[1];
203947 }
203948 static void readCoord(u8 *p, RtreeCoord *pCoord){
203949 assert( FOUR_BYTE_ALIGNED(p) );
203950 #if SQLITE_BYTEORDER==1234 && MSVC_VERSION>=1300
203951 pCoord->u = _byteswap_ulong(*(u32*)p);
203952 #elif SQLITE_BYTEORDER==1234 && GCC_VERSION>=4003000
203953 pCoord->u = __builtin_bswap32(*(u32*)p);
203954 #elif SQLITE_BYTEORDER==4321
@@ -203964,11 +203998,11 @@
203998 p[0] = (i>> 8)&0xFF;
203999 p[1] = (i>> 0)&0xFF;
204000 }
204001 static int writeCoord(u8 *p, RtreeCoord *pCoord){
204002 u32 i;
204003 assert( FOUR_BYTE_ALIGNED(p) );
204004 assert( sizeof(RtreeCoord)==4 );
204005 assert( sizeof(u32)==4 );
204006 #if SQLITE_BYTEORDER==1234 && GCC_VERSION>=4003000
204007 i = __builtin_bswap32(pCoord->u);
204008 memcpy(p, &i, 4);
@@ -204692,11 +204726,11 @@
204726 pCellData += 8 + 4*(p->iCoord&0xfe);
204727
204728 assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE
204729 || p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_TRUE
204730 || p->op==RTREE_FALSE );
204731 assert( FOUR_BYTE_ALIGNED(pCellData) );
204732 switch( p->op ){
204733 case RTREE_TRUE: return; /* Always satisfied */
204734 case RTREE_FALSE: break; /* Never satisfied */
204735 case RTREE_EQ:
204736 RTREE_DECODE_COORD(eInt, pCellData, val);
@@ -204745,11 +204779,11 @@
204779
204780 assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE
204781 || p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_TRUE
204782 || p->op==RTREE_FALSE );
204783 pCellData += 8 + p->iCoord*4;
204784 assert( FOUR_BYTE_ALIGNED(pCellData) );
204785 RTREE_DECODE_COORD(eInt, pCellData, xN);
204786 switch( p->op ){
204787 case RTREE_TRUE: return; /* Always satisfied */
204788 case RTREE_FALSE: break; /* Never satisfied */
204789 case RTREE_LE: if( xN <= p->u.rValue ) return; break;
@@ -242954,11 +242988,11 @@
242988 int nArg, /* Number of args */
242989 sqlite3_value **apUnused /* Function arguments */
242990 ){
242991 assert( nArg==0 );
242992 UNUSED_PARAM2(nArg, apUnused);
242993 sqlite3_result_text(pCtx, "fts5: 2023-06-19 13:09:16 3c94f87806a8b408d8204fc7deec16d01c085ee199ff21a1f20b6346ce816cfe", -1, SQLITE_TRANSIENT);
242994 }
242995
242996 /*
242997 ** Return true if zName is the extension on one of the shadow tables used
242998 ** by this module.
242999
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.43.0"
150150
#define SQLITE_VERSION_NUMBER 3043000
151
-#define SQLITE_SOURCE_ID "2023-06-12 18:22:34 7ec4ab327decd6a5ee5e6a53f1489e17e0cdbb297945f9acc532b47d052eb7a9"
151
+#define SQLITE_SOURCE_ID "2023-06-19 13:09:16 3c94f87806a8b408d8204fc7deec16d01c085ee199ff21a1f20b6346ce816cfe"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
157157
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.43.0"
150 #define SQLITE_VERSION_NUMBER 3043000
151 #define SQLITE_SOURCE_ID "2023-06-12 18:22:34 7ec4ab327decd6a5ee5e6a53f1489e17e0cdbb297945f9acc532b47d052eb7a9"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.43.0"
150 #define SQLITE_VERSION_NUMBER 3043000
151 #define SQLITE_SOURCE_ID "2023-06-19 13:09:16 3c94f87806a8b408d8204fc7deec16d01c085ee199ff21a1f20b6346ce816cfe"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
157

Keyboard Shortcuts

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