Fossil SCM

Merge all the latest trunk enhancements and fixes into the bv-corrections01 branch.

drh 2024-11-06 13:29 bv-corrections01 merge
Commit c1aefb00c351f7b94fb56f09b6376ad53b7edda7e75f6af86a5c2655f6e54a65
+1 -1
--- BUILD.txt
+++ BUILD.txt
@@ -42,11 +42,11 @@
4242
mkdir build
4343
cd build
4444
../configure
4545
make
4646
47
-This will now keep all generates files separate from the maintained
47
+This will now keep all generated files separate from the maintained
4848
source code.
4949
5050
--------------------------------------------------------------------------
5151
5252
Here are some notes on what is happening behind the scenes:
5353
--- BUILD.txt
+++ BUILD.txt
@@ -42,11 +42,11 @@
42 mkdir build
43 cd build
44 ../configure
45 make
46
47 This will now keep all generates files separate from the maintained
48 source code.
49
50 --------------------------------------------------------------------------
51
52 Here are some notes on what is happening behind the scenes:
53
--- BUILD.txt
+++ BUILD.txt
@@ -42,11 +42,11 @@
42 mkdir build
43 cd build
44 ../configure
45 make
46
47 This will now keep all generated files separate from the maintained
48 source code.
49
50 --------------------------------------------------------------------------
51
52 Here are some notes on what is happening behind the scenes:
53
+1 -1
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1
-2.25
1
+2.26
22
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 2.25
2
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 2.26
2
+40 -90
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -120,13 +120,10 @@
120120
#include <math.h>
121121
#include "sqlite3.h"
122122
typedef sqlite3_int64 i64;
123123
typedef sqlite3_uint64 u64;
124124
typedef unsigned char u8;
125
-#if SQLITE_USER_AUTHENTICATION
126
-# include "sqlite3userauth.h"
127
-#endif
128125
#include <ctype.h>
129126
#include <stdarg.h>
130127
131128
#if !defined(_WIN32) && !defined(WIN32)
132129
# include <signal.h>
@@ -408,21 +405,21 @@
408405
wchar_t *b1, *b2;
409406
int sz1, sz2;
410407
411408
sz1 = (int)strlen(zFilename);
412409
sz2 = (int)strlen(zMode);
413
- b1 = malloc( (sz1+1)*sizeof(b1[0]) );
414
- b2 = malloc( (sz2+1)*sizeof(b1[0]) );
410
+ b1 = sqlite3_malloc( (sz1+1)*sizeof(b1[0]) );
411
+ b2 = sqlite3_malloc( (sz2+1)*sizeof(b1[0]) );
415412
if( b1 && b2 ){
416413
sz1 = MultiByteToWideChar(CP_UTF8, 0, zFilename, sz1, b1, sz1);
417414
b1[sz1] = 0;
418415
sz2 = MultiByteToWideChar(CP_UTF8, 0, zMode, sz2, b2, sz2);
419416
b2[sz2] = 0;
420417
fp = _wfopen(b1, b2);
421418
}
422
- free(b1);
423
- free(b2);
419
+ sqlite3_free(b1);
420
+ sqlite3_free(b2);
424421
simBinaryOther = 0;
425422
return fp;
426423
}
427424
428425
@@ -434,21 +431,21 @@
434431
wchar_t *b1, *b2;
435432
int sz1, sz2;
436433
437434
sz1 = (int)strlen(zCommand);
438435
sz2 = (int)strlen(zMode);
439
- b1 = malloc( (sz1+1)*sizeof(b1[0]) );
440
- b2 = malloc( (sz2+1)*sizeof(b1[0]) );
436
+ b1 = sqlite3_malloc( (sz1+1)*sizeof(b1[0]) );
437
+ b2 = sqlite3_malloc( (sz2+1)*sizeof(b1[0]) );
441438
if( b1 && b2 ){
442439
sz1 = MultiByteToWideChar(CP_UTF8, 0, zCommand, sz1, b1, sz1);
443440
b1[sz1] = 0;
444441
sz2 = MultiByteToWideChar(CP_UTF8, 0, zMode, sz2, b2, sz2);
445442
b2[sz2] = 0;
446443
fp = _wpopen(b1, b2);
447444
}
448
- free(b1);
449
- free(b2);
445
+ sqlite3_free(b1);
446
+ sqlite3_free(b2);
450447
return fp;
451448
}
452449
453450
/*
454451
** Work-alike for fgets() from the standard C library.
@@ -458,11 +455,11 @@
458455
/* When reading from the command-prompt in Windows, it is necessary
459456
** to use _O_WTEXT input mode to read UTF-16 characters, then translate
460457
** that into UTF-8. Otherwise, non-ASCII characters all get translated
461458
** into '?'.
462459
*/
463
- wchar_t *b1 = malloc( sz*sizeof(wchar_t) );
460
+ wchar_t *b1 = sqlite3_malloc( sz*sizeof(wchar_t) );
464461
if( b1==0 ) return 0;
465462
_setmode(_fileno(in), IsConsole(in) ? _O_WTEXT : _O_U8TEXT);
466463
if( fgetws(b1, sz/4, in)==0 ){
467464
sqlite3_free(b1);
468465
return 0;
@@ -524,11 +521,11 @@
524521
/* When writing to the command-prompt in Windows, it is necessary
525522
** to use O_U8TEXT to render Unicode U+0080 and greater. Go ahead
526523
** use O_U8TEXT for everything in text mode.
527524
*/
528525
int sz = (int)strlen(z);
529
- wchar_t *b1 = malloc( (sz+1)*sizeof(wchar_t) );
526
+ wchar_t *b1 = sqlite3_malloc( (sz+1)*sizeof(wchar_t) );
530527
if( b1==0 ) return 0;
531528
sz = MultiByteToWideChar(CP_UTF8, 0, z, sz, b1, sz);
532529
b1[sz] = 0;
533530
_setmode(_fileno(out), _O_U8TEXT);
534531
if( UseBinaryWText(out) ){
@@ -5070,14 +5067,14 @@
50705067
char **pzErrMsg,
50715068
const sqlite3_api_routines *pApi
50725069
){
50735070
int rc = SQLITE_OK;
50745071
unsigned int i;
5075
-#if defined(SQLITE3_H) || defined(SQLITE_STATIC_PERCENTILE)
5076
- (void)pApi; /* Unused parameter */
5077
-#else
5072
+#ifdef SQLITE3EXT_H
50785073
SQLITE_EXTENSION_INIT2(pApi);
5074
+#else
5075
+ (void)pApi; /* Unused parameter */
50795076
#endif
50805077
(void)pzErrMsg; /* Unused parameter */
50815078
for(i=0; i<sizeof(aPercentFunc)/sizeof(aPercentFunc[0]); i++){
50825079
rc = sqlite3_create_window_function(db,
50835080
aPercentFunc[i].zName,
@@ -6831,35 +6828,41 @@
68316828
idxNum |= 0x40;
68326829
}
68336830
continue;
68346831
}
68356832
if( pConstraint->iColumn<SERIES_COLUMN_START ){
6836
- if( pConstraint->iColumn==SERIES_COLUMN_VALUE ){
6833
+ if( pConstraint->iColumn==SERIES_COLUMN_VALUE && pConstraint->usable ){
68376834
switch( op ){
68386835
case SQLITE_INDEX_CONSTRAINT_EQ:
68396836
case SQLITE_INDEX_CONSTRAINT_IS: {
68406837
idxNum |= 0x0080;
68416838
idxNum &= ~0x3300;
68426839
aIdx[5] = i;
68436840
aIdx[6] = -1;
6841
+#ifndef ZERO_ARGUMENT_GENERATE_SERIES
68446842
bStartSeen = 1;
6843
+#endif
68456844
break;
68466845
}
68476846
case SQLITE_INDEX_CONSTRAINT_GE: {
68486847
if( idxNum & 0x0080 ) break;
68496848
idxNum |= 0x0100;
68506849
idxNum &= ~0x0200;
68516850
aIdx[5] = i;
6851
+#ifndef ZERO_ARGUMENT_GENERATE_SERIES
68526852
bStartSeen = 1;
6853
+#endif
68536854
break;
68546855
}
68556856
case SQLITE_INDEX_CONSTRAINT_GT: {
68566857
if( idxNum & 0x0080 ) break;
68576858
idxNum |= 0x0200;
68586859
idxNum &= ~0x0100;
68596860
aIdx[5] = i;
6861
+#ifndef ZERO_ARGUMENT_GENERATE_SERIES
68606862
bStartSeen = 1;
6863
+#endif
68616864
break;
68626865
}
68636866
case SQLITE_INDEX_CONSTRAINT_LE: {
68646867
if( idxNum & 0x0080 ) break;
68656868
idxNum |= 0x1000;
@@ -21935,12 +21938,12 @@
2193521938
const char *zSkipValidUtf8(const char *z, int nAccept, long ccm){
2193621939
int ng = (nAccept<0)? -nAccept : 0;
2193721940
const char *pcLimit = (nAccept>=0)? z+nAccept : 0;
2193821941
assert(z!=0);
2193921942
while( (pcLimit)? (z<pcLimit) : (ng-- != 0) ){
21940
- char c = *z;
21941
- if( (c & 0x80) == 0 ){
21943
+ unsigned char c = *(u8*)z;
21944
+ if( c<0x7f ){
2194221945
if( ccm != 0L && c < 0x20 && ((1L<<c) & ccm) != 0 ) return z;
2194321946
++z; /* ASCII */
2194421947
}else if( (c & 0xC0) != 0xC0 ) return z; /* not a lead byte */
2194521948
else{
2194621949
const char *zt = z+1; /* Got lead byte, look at trail bytes.*/
@@ -22004,11 +22007,11 @@
2200422007
}
2200522008
sqlite3_fputs(zq, out);
2200622009
}
2200722010
2200822011
/*
22009
-** Output the given string as a quoted according to JSON quoting rules.
22012
+** Output the given string as quoted according to JSON quoting rules.
2201022013
*/
2201122014
static void output_json_string(FILE *out, const char *z, i64 n){
2201222015
char c;
2201322016
static const char *zq = "\"";
2201422017
static long ctrlMask = ~0L;
@@ -22042,12 +22045,12 @@
2204222045
default: cbsSay = 0; break;
2204322046
}
2204422047
if( cbsSay ){
2204522048
ace[1] = cbsSay;
2204622049
sqlite3_fputs(ace, out);
22047
- }else if( c<=0x1f ){
22048
- sqlite3_fprintf(out, "u%04x", c);
22050
+ }else if( c<=0x1f || c==0x7f ){
22051
+ sqlite3_fprintf(out, "\\u%04x", c);
2204922052
}else{
2205022053
ace[1] = (char)c;
2205122054
sqlite3_fputs(ace+1, out);
2205222055
}
2205322056
}
@@ -25654,11 +25657,12 @@
2565425657
sqlite3_fprintf(stderr,
2565525658
"Error: sqlite3_close() returns %d: %s\n", rc, sqlite3_errmsg(db));
2565625659
}
2565725660
}
2565825661
25659
-#if HAVE_READLINE || HAVE_EDITLINE
25662
+#if (HAVE_READLINE || HAVE_EDITLINE) \
25663
+ && !defined(SQLITE_OMIT_READLINE_COMPLETION)
2566025664
/*
2566125665
** Readline completion callbacks
2566225666
*/
2566325667
static char *readline_completion_generator(const char *text, int state){
2566425668
static sqlite3_stmt *pStmt = 0;
@@ -25692,19 +25696,26 @@
2569225696
#elif HAVE_LINENOISE
2569325697
/*
2569425698
** Linenoise completion callback. Note that the 3rd argument is from
2569525699
** the "msteveb" version of linenoise, not the "antirez" version.
2569625700
*/
25697
-static void linenoise_completion(const char *zLine, linenoiseCompletions *lc,
25698
- void *pUserData){
25701
+static void linenoise_completion(
25702
+ const char *zLine,
25703
+ linenoiseCompletions *lc
25704
+#if HAVE_LINENOISE==2
25705
+ ,void *pUserData
25706
+#endif
25707
+){
2569925708
i64 nLine = strlen(zLine);
2570025709
i64 i, iStart;
2570125710
sqlite3_stmt *pStmt = 0;
2570225711
char *zSql;
2570325712
char zBuf[1000];
2570425713
25714
+#if HAVE_LINENOISE==2
2570525715
UNUSED_PARAMETER(pUserData);
25716
+#endif
2570625717
if( nLine>(i64)sizeof(zBuf)-30 ) return;
2570725718
if( zLine[0]=='.' || zLine[0]=='#') return;
2570825719
for(i=nLine-1; i>=0 && (isalnum(zLine[i]) || zLine[i]=='_'); i--){}
2570925720
if( i==nLine-1 ) return;
2571025721
iStart = i+1;
@@ -31652,73 +31663,10 @@
3165231663
}
3165331664
}
3165431665
}else
3165531666
#endif
3165631667
31657
-#if SQLITE_USER_AUTHENTICATION
31658
- if( c=='u' && cli_strncmp(azArg[0], "user", n)==0 ){
31659
- if( nArg<2 ){
31660
- eputz("Usage: .user SUBCOMMAND ...\n");
31661
- rc = 1;
31662
- goto meta_command_exit;
31663
- }
31664
- open_db(p, 0);
31665
- if( cli_strcmp(azArg[1],"login")==0 ){
31666
- if( nArg!=4 ){
31667
- eputz("Usage: .user login USER PASSWORD\n");
31668
- rc = 1;
31669
- goto meta_command_exit;
31670
- }
31671
- rc = sqlite3_user_authenticate(p->db, azArg[2], azArg[3],
31672
- strlen30(azArg[3]));
31673
- if( rc ){
31674
- sqlite3_fprintf(stderr,"Authentication failed for user %s\n", azArg[2]);
31675
- rc = 1;
31676
- }
31677
- }else if( cli_strcmp(azArg[1],"add")==0 ){
31678
- if( nArg!=5 ){
31679
- eputz("Usage: .user add USER PASSWORD ISADMIN\n");
31680
- rc = 1;
31681
- goto meta_command_exit;
31682
- }
31683
- rc = sqlite3_user_add(p->db, azArg[2], azArg[3], strlen30(azArg[3]),
31684
- booleanValue(azArg[4]));
31685
- if( rc ){
31686
- sqlite3_fprintf(stderr,"User-Add failed: %d\n", rc);
31687
- rc = 1;
31688
- }
31689
- }else if( cli_strcmp(azArg[1],"edit")==0 ){
31690
- if( nArg!=5 ){
31691
- eputz("Usage: .user edit USER PASSWORD ISADMIN\n");
31692
- rc = 1;
31693
- goto meta_command_exit;
31694
- }
31695
- rc = sqlite3_user_change(p->db, azArg[2], azArg[3], strlen30(azArg[3]),
31696
- booleanValue(azArg[4]));
31697
- if( rc ){
31698
- sqlite3_fprintf(stderr,"User-Edit failed: %d\n", rc);
31699
- rc = 1;
31700
- }
31701
- }else if( cli_strcmp(azArg[1],"delete")==0 ){
31702
- if( nArg!=3 ){
31703
- eputz("Usage: .user delete USER\n");
31704
- rc = 1;
31705
- goto meta_command_exit;
31706
- }
31707
- rc = sqlite3_user_delete(p->db, azArg[2]);
31708
- if( rc ){
31709
- sqlite3_fprintf(stderr,"User-Delete failed: %d\n", rc);
31710
- rc = 1;
31711
- }
31712
- }else{
31713
- eputz("Usage: .user login|add|edit|delete ...\n");
31714
- rc = 1;
31715
- goto meta_command_exit;
31716
- }
31717
- }else
31718
-#endif /* SQLITE_USER_AUTHENTICATION */
31719
-
3172031668
if( c=='v' && cli_strncmp(azArg[0], "version", n)==0 ){
3172131669
char *zPtrSz = sizeof(void*)==8 ? "64-bit" : "32-bit";
3172231670
sqlite3_fprintf(p->out, "SQLite %s %s\n" /*extra-version-info*/,
3172331671
sqlite3_libversion(), sqlite3_sourceid());
3172431672
#if SQLITE_HAVE_ZLIB
@@ -33154,13 +33102,15 @@
3315433102
if( (zHistory = malloc(nHistory))!=0 ){
3315533103
sqlite3_snprintf(nHistory, zHistory,"%s/.sqlite_history", zHome);
3315633104
}
3315733105
}
3315833106
if( zHistory ){ shell_read_history(zHistory); }
33159
-#if HAVE_READLINE || HAVE_EDITLINE
33107
+#if (HAVE_READLINE || HAVE_EDITLINE) && !defined(SQLITE_OMIT_READLINE_COMPLETION)
3316033108
rl_attempted_completion_function = readline_completion;
33161
-#elif HAVE_LINENOISE
33109
+#elif HAVE_LINENOISE==1
33110
+ linenoiseSetCompletionCallback(linenoise_completion);
33111
+#elif HAVE_LINENOISE==2
3316233112
linenoiseSetCompletionCallback(linenoise_completion, NULL);
3316333113
#endif
3316433114
data.in = 0;
3316533115
rc = process_input(&data);
3316633116
if( zHistory ){
3316733117
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -120,13 +120,10 @@
120 #include <math.h>
121 #include "sqlite3.h"
122 typedef sqlite3_int64 i64;
123 typedef sqlite3_uint64 u64;
124 typedef unsigned char u8;
125 #if SQLITE_USER_AUTHENTICATION
126 # include "sqlite3userauth.h"
127 #endif
128 #include <ctype.h>
129 #include <stdarg.h>
130
131 #if !defined(_WIN32) && !defined(WIN32)
132 # include <signal.h>
@@ -408,21 +405,21 @@
408 wchar_t *b1, *b2;
409 int sz1, sz2;
410
411 sz1 = (int)strlen(zFilename);
412 sz2 = (int)strlen(zMode);
413 b1 = malloc( (sz1+1)*sizeof(b1[0]) );
414 b2 = malloc( (sz2+1)*sizeof(b1[0]) );
415 if( b1 && b2 ){
416 sz1 = MultiByteToWideChar(CP_UTF8, 0, zFilename, sz1, b1, sz1);
417 b1[sz1] = 0;
418 sz2 = MultiByteToWideChar(CP_UTF8, 0, zMode, sz2, b2, sz2);
419 b2[sz2] = 0;
420 fp = _wfopen(b1, b2);
421 }
422 free(b1);
423 free(b2);
424 simBinaryOther = 0;
425 return fp;
426 }
427
428
@@ -434,21 +431,21 @@
434 wchar_t *b1, *b2;
435 int sz1, sz2;
436
437 sz1 = (int)strlen(zCommand);
438 sz2 = (int)strlen(zMode);
439 b1 = malloc( (sz1+1)*sizeof(b1[0]) );
440 b2 = malloc( (sz2+1)*sizeof(b1[0]) );
441 if( b1 && b2 ){
442 sz1 = MultiByteToWideChar(CP_UTF8, 0, zCommand, sz1, b1, sz1);
443 b1[sz1] = 0;
444 sz2 = MultiByteToWideChar(CP_UTF8, 0, zMode, sz2, b2, sz2);
445 b2[sz2] = 0;
446 fp = _wpopen(b1, b2);
447 }
448 free(b1);
449 free(b2);
450 return fp;
451 }
452
453 /*
454 ** Work-alike for fgets() from the standard C library.
@@ -458,11 +455,11 @@
458 /* When reading from the command-prompt in Windows, it is necessary
459 ** to use _O_WTEXT input mode to read UTF-16 characters, then translate
460 ** that into UTF-8. Otherwise, non-ASCII characters all get translated
461 ** into '?'.
462 */
463 wchar_t *b1 = malloc( sz*sizeof(wchar_t) );
464 if( b1==0 ) return 0;
465 _setmode(_fileno(in), IsConsole(in) ? _O_WTEXT : _O_U8TEXT);
466 if( fgetws(b1, sz/4, in)==0 ){
467 sqlite3_free(b1);
468 return 0;
@@ -524,11 +521,11 @@
524 /* When writing to the command-prompt in Windows, it is necessary
525 ** to use O_U8TEXT to render Unicode U+0080 and greater. Go ahead
526 ** use O_U8TEXT for everything in text mode.
527 */
528 int sz = (int)strlen(z);
529 wchar_t *b1 = malloc( (sz+1)*sizeof(wchar_t) );
530 if( b1==0 ) return 0;
531 sz = MultiByteToWideChar(CP_UTF8, 0, z, sz, b1, sz);
532 b1[sz] = 0;
533 _setmode(_fileno(out), _O_U8TEXT);
534 if( UseBinaryWText(out) ){
@@ -5070,14 +5067,14 @@
5070 char **pzErrMsg,
5071 const sqlite3_api_routines *pApi
5072 ){
5073 int rc = SQLITE_OK;
5074 unsigned int i;
5075 #if defined(SQLITE3_H) || defined(SQLITE_STATIC_PERCENTILE)
5076 (void)pApi; /* Unused parameter */
5077 #else
5078 SQLITE_EXTENSION_INIT2(pApi);
 
 
5079 #endif
5080 (void)pzErrMsg; /* Unused parameter */
5081 for(i=0; i<sizeof(aPercentFunc)/sizeof(aPercentFunc[0]); i++){
5082 rc = sqlite3_create_window_function(db,
5083 aPercentFunc[i].zName,
@@ -6831,35 +6828,41 @@
6831 idxNum |= 0x40;
6832 }
6833 continue;
6834 }
6835 if( pConstraint->iColumn<SERIES_COLUMN_START ){
6836 if( pConstraint->iColumn==SERIES_COLUMN_VALUE ){
6837 switch( op ){
6838 case SQLITE_INDEX_CONSTRAINT_EQ:
6839 case SQLITE_INDEX_CONSTRAINT_IS: {
6840 idxNum |= 0x0080;
6841 idxNum &= ~0x3300;
6842 aIdx[5] = i;
6843 aIdx[6] = -1;
 
6844 bStartSeen = 1;
 
6845 break;
6846 }
6847 case SQLITE_INDEX_CONSTRAINT_GE: {
6848 if( idxNum & 0x0080 ) break;
6849 idxNum |= 0x0100;
6850 idxNum &= ~0x0200;
6851 aIdx[5] = i;
 
6852 bStartSeen = 1;
 
6853 break;
6854 }
6855 case SQLITE_INDEX_CONSTRAINT_GT: {
6856 if( idxNum & 0x0080 ) break;
6857 idxNum |= 0x0200;
6858 idxNum &= ~0x0100;
6859 aIdx[5] = i;
 
6860 bStartSeen = 1;
 
6861 break;
6862 }
6863 case SQLITE_INDEX_CONSTRAINT_LE: {
6864 if( idxNum & 0x0080 ) break;
6865 idxNum |= 0x1000;
@@ -21935,12 +21938,12 @@
21935 const char *zSkipValidUtf8(const char *z, int nAccept, long ccm){
21936 int ng = (nAccept<0)? -nAccept : 0;
21937 const char *pcLimit = (nAccept>=0)? z+nAccept : 0;
21938 assert(z!=0);
21939 while( (pcLimit)? (z<pcLimit) : (ng-- != 0) ){
21940 char c = *z;
21941 if( (c & 0x80) == 0 ){
21942 if( ccm != 0L && c < 0x20 && ((1L<<c) & ccm) != 0 ) return z;
21943 ++z; /* ASCII */
21944 }else if( (c & 0xC0) != 0xC0 ) return z; /* not a lead byte */
21945 else{
21946 const char *zt = z+1; /* Got lead byte, look at trail bytes.*/
@@ -22004,11 +22007,11 @@
22004 }
22005 sqlite3_fputs(zq, out);
22006 }
22007
22008 /*
22009 ** Output the given string as a quoted according to JSON quoting rules.
22010 */
22011 static void output_json_string(FILE *out, const char *z, i64 n){
22012 char c;
22013 static const char *zq = "\"";
22014 static long ctrlMask = ~0L;
@@ -22042,12 +22045,12 @@
22042 default: cbsSay = 0; break;
22043 }
22044 if( cbsSay ){
22045 ace[1] = cbsSay;
22046 sqlite3_fputs(ace, out);
22047 }else if( c<=0x1f ){
22048 sqlite3_fprintf(out, "u%04x", c);
22049 }else{
22050 ace[1] = (char)c;
22051 sqlite3_fputs(ace+1, out);
22052 }
22053 }
@@ -25654,11 +25657,12 @@
25654 sqlite3_fprintf(stderr,
25655 "Error: sqlite3_close() returns %d: %s\n", rc, sqlite3_errmsg(db));
25656 }
25657 }
25658
25659 #if HAVE_READLINE || HAVE_EDITLINE
 
25660 /*
25661 ** Readline completion callbacks
25662 */
25663 static char *readline_completion_generator(const char *text, int state){
25664 static sqlite3_stmt *pStmt = 0;
@@ -25692,19 +25696,26 @@
25692 #elif HAVE_LINENOISE
25693 /*
25694 ** Linenoise completion callback. Note that the 3rd argument is from
25695 ** the "msteveb" version of linenoise, not the "antirez" version.
25696 */
25697 static void linenoise_completion(const char *zLine, linenoiseCompletions *lc,
25698 void *pUserData){
 
 
 
 
 
25699 i64 nLine = strlen(zLine);
25700 i64 i, iStart;
25701 sqlite3_stmt *pStmt = 0;
25702 char *zSql;
25703 char zBuf[1000];
25704
 
25705 UNUSED_PARAMETER(pUserData);
 
25706 if( nLine>(i64)sizeof(zBuf)-30 ) return;
25707 if( zLine[0]=='.' || zLine[0]=='#') return;
25708 for(i=nLine-1; i>=0 && (isalnum(zLine[i]) || zLine[i]=='_'); i--){}
25709 if( i==nLine-1 ) return;
25710 iStart = i+1;
@@ -31652,73 +31663,10 @@
31652 }
31653 }
31654 }else
31655 #endif
31656
31657 #if SQLITE_USER_AUTHENTICATION
31658 if( c=='u' && cli_strncmp(azArg[0], "user", n)==0 ){
31659 if( nArg<2 ){
31660 eputz("Usage: .user SUBCOMMAND ...\n");
31661 rc = 1;
31662 goto meta_command_exit;
31663 }
31664 open_db(p, 0);
31665 if( cli_strcmp(azArg[1],"login")==0 ){
31666 if( nArg!=4 ){
31667 eputz("Usage: .user login USER PASSWORD\n");
31668 rc = 1;
31669 goto meta_command_exit;
31670 }
31671 rc = sqlite3_user_authenticate(p->db, azArg[2], azArg[3],
31672 strlen30(azArg[3]));
31673 if( rc ){
31674 sqlite3_fprintf(stderr,"Authentication failed for user %s\n", azArg[2]);
31675 rc = 1;
31676 }
31677 }else if( cli_strcmp(azArg[1],"add")==0 ){
31678 if( nArg!=5 ){
31679 eputz("Usage: .user add USER PASSWORD ISADMIN\n");
31680 rc = 1;
31681 goto meta_command_exit;
31682 }
31683 rc = sqlite3_user_add(p->db, azArg[2], azArg[3], strlen30(azArg[3]),
31684 booleanValue(azArg[4]));
31685 if( rc ){
31686 sqlite3_fprintf(stderr,"User-Add failed: %d\n", rc);
31687 rc = 1;
31688 }
31689 }else if( cli_strcmp(azArg[1],"edit")==0 ){
31690 if( nArg!=5 ){
31691 eputz("Usage: .user edit USER PASSWORD ISADMIN\n");
31692 rc = 1;
31693 goto meta_command_exit;
31694 }
31695 rc = sqlite3_user_change(p->db, azArg[2], azArg[3], strlen30(azArg[3]),
31696 booleanValue(azArg[4]));
31697 if( rc ){
31698 sqlite3_fprintf(stderr,"User-Edit failed: %d\n", rc);
31699 rc = 1;
31700 }
31701 }else if( cli_strcmp(azArg[1],"delete")==0 ){
31702 if( nArg!=3 ){
31703 eputz("Usage: .user delete USER\n");
31704 rc = 1;
31705 goto meta_command_exit;
31706 }
31707 rc = sqlite3_user_delete(p->db, azArg[2]);
31708 if( rc ){
31709 sqlite3_fprintf(stderr,"User-Delete failed: %d\n", rc);
31710 rc = 1;
31711 }
31712 }else{
31713 eputz("Usage: .user login|add|edit|delete ...\n");
31714 rc = 1;
31715 goto meta_command_exit;
31716 }
31717 }else
31718 #endif /* SQLITE_USER_AUTHENTICATION */
31719
31720 if( c=='v' && cli_strncmp(azArg[0], "version", n)==0 ){
31721 char *zPtrSz = sizeof(void*)==8 ? "64-bit" : "32-bit";
31722 sqlite3_fprintf(p->out, "SQLite %s %s\n" /*extra-version-info*/,
31723 sqlite3_libversion(), sqlite3_sourceid());
31724 #if SQLITE_HAVE_ZLIB
@@ -33154,13 +33102,15 @@
33154 if( (zHistory = malloc(nHistory))!=0 ){
33155 sqlite3_snprintf(nHistory, zHistory,"%s/.sqlite_history", zHome);
33156 }
33157 }
33158 if( zHistory ){ shell_read_history(zHistory); }
33159 #if HAVE_READLINE || HAVE_EDITLINE
33160 rl_attempted_completion_function = readline_completion;
33161 #elif HAVE_LINENOISE
 
 
33162 linenoiseSetCompletionCallback(linenoise_completion, NULL);
33163 #endif
33164 data.in = 0;
33165 rc = process_input(&data);
33166 if( zHistory ){
33167
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -120,13 +120,10 @@
120 #include <math.h>
121 #include "sqlite3.h"
122 typedef sqlite3_int64 i64;
123 typedef sqlite3_uint64 u64;
124 typedef unsigned char u8;
 
 
 
125 #include <ctype.h>
126 #include <stdarg.h>
127
128 #if !defined(_WIN32) && !defined(WIN32)
129 # include <signal.h>
@@ -408,21 +405,21 @@
405 wchar_t *b1, *b2;
406 int sz1, sz2;
407
408 sz1 = (int)strlen(zFilename);
409 sz2 = (int)strlen(zMode);
410 b1 = sqlite3_malloc( (sz1+1)*sizeof(b1[0]) );
411 b2 = sqlite3_malloc( (sz2+1)*sizeof(b1[0]) );
412 if( b1 && b2 ){
413 sz1 = MultiByteToWideChar(CP_UTF8, 0, zFilename, sz1, b1, sz1);
414 b1[sz1] = 0;
415 sz2 = MultiByteToWideChar(CP_UTF8, 0, zMode, sz2, b2, sz2);
416 b2[sz2] = 0;
417 fp = _wfopen(b1, b2);
418 }
419 sqlite3_free(b1);
420 sqlite3_free(b2);
421 simBinaryOther = 0;
422 return fp;
423 }
424
425
@@ -434,21 +431,21 @@
431 wchar_t *b1, *b2;
432 int sz1, sz2;
433
434 sz1 = (int)strlen(zCommand);
435 sz2 = (int)strlen(zMode);
436 b1 = sqlite3_malloc( (sz1+1)*sizeof(b1[0]) );
437 b2 = sqlite3_malloc( (sz2+1)*sizeof(b1[0]) );
438 if( b1 && b2 ){
439 sz1 = MultiByteToWideChar(CP_UTF8, 0, zCommand, sz1, b1, sz1);
440 b1[sz1] = 0;
441 sz2 = MultiByteToWideChar(CP_UTF8, 0, zMode, sz2, b2, sz2);
442 b2[sz2] = 0;
443 fp = _wpopen(b1, b2);
444 }
445 sqlite3_free(b1);
446 sqlite3_free(b2);
447 return fp;
448 }
449
450 /*
451 ** Work-alike for fgets() from the standard C library.
@@ -458,11 +455,11 @@
455 /* When reading from the command-prompt in Windows, it is necessary
456 ** to use _O_WTEXT input mode to read UTF-16 characters, then translate
457 ** that into UTF-8. Otherwise, non-ASCII characters all get translated
458 ** into '?'.
459 */
460 wchar_t *b1 = sqlite3_malloc( sz*sizeof(wchar_t) );
461 if( b1==0 ) return 0;
462 _setmode(_fileno(in), IsConsole(in) ? _O_WTEXT : _O_U8TEXT);
463 if( fgetws(b1, sz/4, in)==0 ){
464 sqlite3_free(b1);
465 return 0;
@@ -524,11 +521,11 @@
521 /* When writing to the command-prompt in Windows, it is necessary
522 ** to use O_U8TEXT to render Unicode U+0080 and greater. Go ahead
523 ** use O_U8TEXT for everything in text mode.
524 */
525 int sz = (int)strlen(z);
526 wchar_t *b1 = sqlite3_malloc( (sz+1)*sizeof(wchar_t) );
527 if( b1==0 ) return 0;
528 sz = MultiByteToWideChar(CP_UTF8, 0, z, sz, b1, sz);
529 b1[sz] = 0;
530 _setmode(_fileno(out), _O_U8TEXT);
531 if( UseBinaryWText(out) ){
@@ -5070,14 +5067,14 @@
5067 char **pzErrMsg,
5068 const sqlite3_api_routines *pApi
5069 ){
5070 int rc = SQLITE_OK;
5071 unsigned int i;
5072 #ifdef SQLITE3EXT_H
 
 
5073 SQLITE_EXTENSION_INIT2(pApi);
5074 #else
5075 (void)pApi; /* Unused parameter */
5076 #endif
5077 (void)pzErrMsg; /* Unused parameter */
5078 for(i=0; i<sizeof(aPercentFunc)/sizeof(aPercentFunc[0]); i++){
5079 rc = sqlite3_create_window_function(db,
5080 aPercentFunc[i].zName,
@@ -6831,35 +6828,41 @@
6828 idxNum |= 0x40;
6829 }
6830 continue;
6831 }
6832 if( pConstraint->iColumn<SERIES_COLUMN_START ){
6833 if( pConstraint->iColumn==SERIES_COLUMN_VALUE && pConstraint->usable ){
6834 switch( op ){
6835 case SQLITE_INDEX_CONSTRAINT_EQ:
6836 case SQLITE_INDEX_CONSTRAINT_IS: {
6837 idxNum |= 0x0080;
6838 idxNum &= ~0x3300;
6839 aIdx[5] = i;
6840 aIdx[6] = -1;
6841 #ifndef ZERO_ARGUMENT_GENERATE_SERIES
6842 bStartSeen = 1;
6843 #endif
6844 break;
6845 }
6846 case SQLITE_INDEX_CONSTRAINT_GE: {
6847 if( idxNum & 0x0080 ) break;
6848 idxNum |= 0x0100;
6849 idxNum &= ~0x0200;
6850 aIdx[5] = i;
6851 #ifndef ZERO_ARGUMENT_GENERATE_SERIES
6852 bStartSeen = 1;
6853 #endif
6854 break;
6855 }
6856 case SQLITE_INDEX_CONSTRAINT_GT: {
6857 if( idxNum & 0x0080 ) break;
6858 idxNum |= 0x0200;
6859 idxNum &= ~0x0100;
6860 aIdx[5] = i;
6861 #ifndef ZERO_ARGUMENT_GENERATE_SERIES
6862 bStartSeen = 1;
6863 #endif
6864 break;
6865 }
6866 case SQLITE_INDEX_CONSTRAINT_LE: {
6867 if( idxNum & 0x0080 ) break;
6868 idxNum |= 0x1000;
@@ -21935,12 +21938,12 @@
21938 const char *zSkipValidUtf8(const char *z, int nAccept, long ccm){
21939 int ng = (nAccept<0)? -nAccept : 0;
21940 const char *pcLimit = (nAccept>=0)? z+nAccept : 0;
21941 assert(z!=0);
21942 while( (pcLimit)? (z<pcLimit) : (ng-- != 0) ){
21943 unsigned char c = *(u8*)z;
21944 if( c<0x7f ){
21945 if( ccm != 0L && c < 0x20 && ((1L<<c) & ccm) != 0 ) return z;
21946 ++z; /* ASCII */
21947 }else if( (c & 0xC0) != 0xC0 ) return z; /* not a lead byte */
21948 else{
21949 const char *zt = z+1; /* Got lead byte, look at trail bytes.*/
@@ -22004,11 +22007,11 @@
22007 }
22008 sqlite3_fputs(zq, out);
22009 }
22010
22011 /*
22012 ** Output the given string as quoted according to JSON quoting rules.
22013 */
22014 static void output_json_string(FILE *out, const char *z, i64 n){
22015 char c;
22016 static const char *zq = "\"";
22017 static long ctrlMask = ~0L;
@@ -22042,12 +22045,12 @@
22045 default: cbsSay = 0; break;
22046 }
22047 if( cbsSay ){
22048 ace[1] = cbsSay;
22049 sqlite3_fputs(ace, out);
22050 }else if( c<=0x1f || c==0x7f ){
22051 sqlite3_fprintf(out, "\\u%04x", c);
22052 }else{
22053 ace[1] = (char)c;
22054 sqlite3_fputs(ace+1, out);
22055 }
22056 }
@@ -25654,11 +25657,12 @@
25657 sqlite3_fprintf(stderr,
25658 "Error: sqlite3_close() returns %d: %s\n", rc, sqlite3_errmsg(db));
25659 }
25660 }
25661
25662 #if (HAVE_READLINE || HAVE_EDITLINE) \
25663 && !defined(SQLITE_OMIT_READLINE_COMPLETION)
25664 /*
25665 ** Readline completion callbacks
25666 */
25667 static char *readline_completion_generator(const char *text, int state){
25668 static sqlite3_stmt *pStmt = 0;
@@ -25692,19 +25696,26 @@
25696 #elif HAVE_LINENOISE
25697 /*
25698 ** Linenoise completion callback. Note that the 3rd argument is from
25699 ** the "msteveb" version of linenoise, not the "antirez" version.
25700 */
25701 static void linenoise_completion(
25702 const char *zLine,
25703 linenoiseCompletions *lc
25704 #if HAVE_LINENOISE==2
25705 ,void *pUserData
25706 #endif
25707 ){
25708 i64 nLine = strlen(zLine);
25709 i64 i, iStart;
25710 sqlite3_stmt *pStmt = 0;
25711 char *zSql;
25712 char zBuf[1000];
25713
25714 #if HAVE_LINENOISE==2
25715 UNUSED_PARAMETER(pUserData);
25716 #endif
25717 if( nLine>(i64)sizeof(zBuf)-30 ) return;
25718 if( zLine[0]=='.' || zLine[0]=='#') return;
25719 for(i=nLine-1; i>=0 && (isalnum(zLine[i]) || zLine[i]=='_'); i--){}
25720 if( i==nLine-1 ) return;
25721 iStart = i+1;
@@ -31652,73 +31663,10 @@
31663 }
31664 }
31665 }else
31666 #endif
31667
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31668 if( c=='v' && cli_strncmp(azArg[0], "version", n)==0 ){
31669 char *zPtrSz = sizeof(void*)==8 ? "64-bit" : "32-bit";
31670 sqlite3_fprintf(p->out, "SQLite %s %s\n" /*extra-version-info*/,
31671 sqlite3_libversion(), sqlite3_sourceid());
31672 #if SQLITE_HAVE_ZLIB
@@ -33154,13 +33102,15 @@
33102 if( (zHistory = malloc(nHistory))!=0 ){
33103 sqlite3_snprintf(nHistory, zHistory,"%s/.sqlite_history", zHome);
33104 }
33105 }
33106 if( zHistory ){ shell_read_history(zHistory); }
33107 #if (HAVE_READLINE || HAVE_EDITLINE) && !defined(SQLITE_OMIT_READLINE_COMPLETION)
33108 rl_attempted_completion_function = readline_completion;
33109 #elif HAVE_LINENOISE==1
33110 linenoiseSetCompletionCallback(linenoise_completion);
33111 #elif HAVE_LINENOISE==2
33112 linenoiseSetCompletionCallback(linenoise_completion, NULL);
33113 #endif
33114 data.in = 0;
33115 rc = process_input(&data);
33116 if( zHistory ){
33117
+1060 -209
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3
-** version 3.47.0. By combining all the individual C code files into this
3
+** version 3.48.0. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% or more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -16,18 +16,22 @@
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
-** 03a9703e27c44437c39363d0baf82db4ebc9.
21
+** 5495b12569c318d5020b4b5a625a392ef8e7 with changes in files:
22
+**
23
+**
2224
*/
25
+#ifndef SQLITE_AMALGAMATION
2326
#define SQLITE_CORE 1
2427
#define SQLITE_AMALGAMATION 1
2528
#ifndef SQLITE_PRIVATE
2629
# define SQLITE_PRIVATE static
2730
#endif
2831
/************** Begin file sqliteInt.h ***************************************/
32
+#line 1 "tsrc/sqliteInt.h"
2933
/*
3034
** 2001 September 15
3135
**
3236
** The author disclaims copyright to this source code. In place of
3337
** a legal notice, here is a blessing:
@@ -84,10 +88,11 @@
8488
** compiler warnings due to subsequent content in this file and other files
8589
** that are included by this file.
8690
*/
8791
/************** Include msvc.h in the middle of sqliteInt.h ******************/
8892
/************** Begin file msvc.h ********************************************/
93
+#line 1 "tsrc/msvc.h"
8994
/*
9095
** 2015 January 12
9196
**
9297
** The author disclaims copyright to this source code. In place of
9398
** a legal notice, here is a blessing:
@@ -132,16 +137,18 @@
132137
133138
#endif /* SQLITE_MSVC_H */
134139
135140
/************** End of msvc.h ************************************************/
136141
/************** Continuing where we left off in sqliteInt.h ******************/
142
+#line 60 "tsrc/sqliteInt.h"
137143
138144
/*
139145
** Special setup for VxWorks
140146
*/
141147
/************** Include vxworks.h in the middle of sqliteInt.h ***************/
142148
/************** Begin file vxworks.h *****************************************/
149
+#line 1 "tsrc/vxworks.h"
143150
/*
144151
** 2015-03-02
145152
**
146153
** The author disclaims copyright to this source code. In place of
147154
** a legal notice, here is a blessing:
@@ -173,10 +180,11 @@
173180
#define HAVE_LSTAT 1
174181
#endif /* defined(_WRS_KERNEL) */
175182
176183
/************** End of vxworks.h *********************************************/
177184
/************** Continuing where we left off in sqliteInt.h ******************/
185
+#line 65 "tsrc/sqliteInt.h"
178186
179187
/*
180188
** These #defines should enable >2GB file support on POSIX if the
181189
** underlying operating system supports it. If the OS lacks
182190
** large file support, or if the OS is windows, these should be no-ops.
@@ -312,10 +320,11 @@
312320
** first in QNX. Also, the _USE_32BIT_TIME_T macro must appear first for
313321
** MinGW.
314322
*/
315323
/************** Include sqlite3.h in the middle of sqliteInt.h ***************/
316324
/************** Begin file sqlite3.h *****************************************/
325
+#line 1 "tsrc/sqlite3.h"
317326
/*
318327
** 2001-09-15
319328
**
320329
** The author disclaims copyright to this source code. In place of
321330
** a legal notice, here is a blessing:
@@ -460,13 +469,13 @@
460469
**
461470
** See also: [sqlite3_libversion()],
462471
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
463472
** [sqlite_version()] and [sqlite_source_id()].
464473
*/
465
-#define SQLITE_VERSION "3.47.0"
466
-#define SQLITE_VERSION_NUMBER 3047000
467
-#define SQLITE_SOURCE_ID "2024-10-21 16:30:22 03a9703e27c44437c39363d0baf82db4ebc94538a0f28411c85dda156f82636e"
474
+#define SQLITE_VERSION "3.48.0"
475
+#define SQLITE_VERSION_NUMBER 3048000
476
+#define SQLITE_SOURCE_ID "2024-11-06 12:58:31 5495b12569c318d5020b4b5a625a392ef8e777b81c0200624fbbc2a6b5eddef9"
468477
469478
/*
470479
** CAPI3REF: Run-Time Library Version Numbers
471480
** KEYWORDS: sqlite3_version sqlite3_sourceid
472481
**
@@ -966,10 +975,17 @@
966975
**
967976
** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
968977
** filesystem supports doing multiple write operations atomically when those
969978
** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
970979
** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
980
+**
981
+** The SQLITE_IOCAP_SUBPAGE_READ property means that it is ok to read
982
+** from the database file in amounts that are not a multiple of the
983
+** page size and that do not begin at a page boundary. Without this
984
+** property, SQLite is careful to only do full-page reads and write
985
+** on aligned pages, with the one exception that it will do a sub-page
986
+** read of the first page to access the database header.
971987
*/
972988
#define SQLITE_IOCAP_ATOMIC 0x00000001
973989
#define SQLITE_IOCAP_ATOMIC512 0x00000002
974990
#define SQLITE_IOCAP_ATOMIC1K 0x00000004
975991
#define SQLITE_IOCAP_ATOMIC2K 0x00000008
@@ -982,10 +998,11 @@
982998
#define SQLITE_IOCAP_SEQUENTIAL 0x00000400
983999
#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800
9841000
#define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000
9851001
#define SQLITE_IOCAP_IMMUTABLE 0x00002000
9861002
#define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000
1003
+#define SQLITE_IOCAP_SUBPAGE_READ 0x00008000
9871004
9881005
/*
9891006
** CAPI3REF: File Locking Levels
9901007
**
9911008
** SQLite uses one of these integer values as the second
@@ -1128,10 +1145,11 @@
11281145
** <li> [SQLITE_IOCAP_SEQUENTIAL]
11291146
** <li> [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN]
11301147
** <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
11311148
** <li> [SQLITE_IOCAP_IMMUTABLE]
11321149
** <li> [SQLITE_IOCAP_BATCH_ATOMIC]
1150
+** <li> [SQLITE_IOCAP_SUBPAGE_READ]
11331151
** </ul>
11341152
**
11351153
** The SQLITE_IOCAP_ATOMIC property means that all writes of
11361154
** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values
11371155
** mean that writes of blocks that are nnn bytes in size and
@@ -11194,11 +11212,11 @@
1119411212
#endif
1119511213
1119611214
#if 0
1119711215
} /* End of the 'extern "C"' block */
1119811216
#endif
11199
-#endif /* SQLITE3_H */
11217
+/* #endif for SQLITE3_H will be added by mksqlite3.tcl */
1120011218
1120111219
/******** Begin file sqlite3rtree.h *********/
1120211220
/*
1120311221
** 2010 August 30
1120411222
**
@@ -13886,13 +13904,15 @@
1388613904
#endif
1388713905
1388813906
#endif /* _FTS5_H */
1388913907
1389013908
/******** End of fts5.h *********/
13909
+#endif /* SQLITE3_H */
1389113910
1389213911
/************** End of sqlite3.h *********************************************/
1389313912
/************** Continuing where we left off in sqliteInt.h ******************/
13913
+#line 203 "tsrc/sqliteInt.h"
1389413914
1389513915
/*
1389613916
** Reuse the STATIC_LRU for mutex access to sqlite3_temp_directory.
1389713917
*/
1389813918
#define SQLITE_MUTEX_STATIC_TEMPDIR SQLITE_MUTEX_STATIC_VFS1
@@ -13906,10 +13926,11 @@
1390613926
#define SQLITECONFIG_H 1
1390713927
#endif
1390813928
1390913929
/************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
1391013930
/************** Begin file sqliteLimit.h *************************************/
13931
+#line 1 "tsrc/sqliteLimit.h"
1391113932
/*
1391213933
** 2007 May 7
1391313934
**
1391413935
** The author disclaims copyright to this source code. In place of
1391513936
** a legal notice, here is a blessing:
@@ -14119,10 +14140,11 @@
1411914140
# define SQLITE_MAX_TRIGGER_DEPTH 1000
1412014141
#endif
1412114142
1412214143
/************** End of sqliteLimit.h *****************************************/
1412314144
/************** Continuing where we left off in sqliteInt.h ******************/
14145
+#line 219 "tsrc/sqliteInt.h"
1412414146
1412514147
/* Disable nuisance warnings on Borland compilers */
1412614148
#if defined(__BORLANDC__)
1412714149
#pragma warn -rch /* unreachable code */
1412814150
#pragma warn -ccc /* Condition is always true or false */
@@ -14536,10 +14558,11 @@
1453614558
#define likely(X) (X)
1453714559
#define unlikely(X) (X)
1453814560
1453914561
/************** Include hash.h in the middle of sqliteInt.h ******************/
1454014562
/************** Begin file hash.h ********************************************/
14563
+#line 1 "tsrc/hash.h"
1454114564
/*
1454214565
** 2001 September 22
1454314566
**
1454414567
** The author disclaims copyright to this source code. In place of
1454514568
** a legal notice, here is a blessing:
@@ -14635,12 +14658,14 @@
1463514658
1463614659
#endif /* SQLITE_HASH_H */
1463714660
1463814661
/************** End of hash.h ************************************************/
1463914662
/************** Continuing where we left off in sqliteInt.h ******************/
14663
+#line 635 "tsrc/sqliteInt.h"
1464014664
/************** Include parse.h in the middle of sqliteInt.h *****************/
1464114665
/************** Begin file parse.h *******************************************/
14666
+#line 1 "tsrc/parse.h"
1464214667
#define TK_SEMI 1
1464314668
#define TK_EXPLAIN 2
1464414669
#define TK_QUERY 3
1464514670
#define TK_PLAN 4
1464614671
#define TK_BEGIN 5
@@ -14825,10 +14850,11 @@
1482514850
#define TK_SPACE 184
1482614851
#define TK_ILLEGAL 185
1482714852
1482814853
/************** End of parse.h ***********************************************/
1482914854
/************** Continuing where we left off in sqliteInt.h ******************/
14855
+#line 636 "tsrc/sqliteInt.h"
1483014856
#include <stdio.h>
1483114857
#include <stdlib.h>
1483214858
#include <string.h>
1483314859
#include <assert.h>
1483414860
#include <stddef.h>
@@ -15590,10 +15616,11 @@
1559015616
** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
1559115617
** pointer types (i.e. FuncDef) defined above.
1559215618
*/
1559315619
/************** Include os.h in the middle of sqliteInt.h ********************/
1559415620
/************** Begin file os.h **********************************************/
15621
+#line 1 "tsrc/os.h"
1559515622
/*
1559615623
** 2001 September 16
1559715624
**
1559815625
** The author disclaims copyright to this source code. In place of
1559915626
** a legal notice, here is a blessing:
@@ -15618,10 +15645,11 @@
1561815645
** Attempt to automatically detect the operating system and setup the
1561915646
** necessary pre-processor macros for it.
1562015647
*/
1562115648
/************** Include os_setup.h in the middle of os.h *********************/
1562215649
/************** Begin file os_setup.h ****************************************/
15650
+#line 1 "tsrc/os_setup.h"
1562315651
/*
1562415652
** 2013 November 25
1562515653
**
1562615654
** The author disclaims copyright to this source code. In place of
1562715655
** a legal notice, here is a blessing:
@@ -15712,10 +15740,11 @@
1571215740
1571315741
#endif /* SQLITE_OS_SETUP_H */
1571415742
1571515743
/************** End of os_setup.h ********************************************/
1571615744
/************** Continuing where we left off in os.h *************************/
15745
+#line 28 "tsrc/os.h"
1571715746
1571815747
/* If the SET_FULLSYNC macro is not defined above, then make it
1571915748
** a no-op
1572015749
*/
1572115750
#ifndef SET_FULLSYNC
@@ -15913,12 +15942,14 @@
1591315942
1591415943
#endif /* _SQLITE_OS_H_ */
1591515944
1591615945
/************** End of os.h **************************************************/
1591715946
/************** Continuing where we left off in sqliteInt.h ******************/
15947
+#line 1400 "tsrc/sqliteInt.h"
1591815948
/************** Include pager.h in the middle of sqliteInt.h *****************/
1591915949
/************** Begin file pager.h *******************************************/
15950
+#line 1 "tsrc/pager.h"
1592015951
/*
1592115952
** 2001 September 15
1592215953
**
1592315954
** The author disclaims copyright to this source code. In place of
1592415955
** a legal notice, here is a blessing:
@@ -16165,12 +16196,14 @@
1616516196
1616616197
#endif /* SQLITE_PAGER_H */
1616716198
1616816199
/************** End of pager.h ***********************************************/
1616916200
/************** Continuing where we left off in sqliteInt.h ******************/
16201
+#line 1401 "tsrc/sqliteInt.h"
1617016202
/************** Include btree.h in the middle of sqliteInt.h *****************/
1617116203
/************** Begin file btree.h *******************************************/
16204
+#line 1 "tsrc/btree.h"
1617216205
/*
1617316206
** 2001 September 15
1617416207
**
1617516208
** The author disclaims copyright to this source code. In place of
1617616209
** a legal notice, here is a blessing:
@@ -16594,12 +16627,14 @@
1659416627
1659516628
#endif /* SQLITE_BTREE_H */
1659616629
1659716630
/************** End of btree.h ***********************************************/
1659816631
/************** Continuing where we left off in sqliteInt.h ******************/
16632
+#line 1402 "tsrc/sqliteInt.h"
1659916633
/************** Include vdbe.h in the middle of sqliteInt.h ******************/
1660016634
/************** Begin file vdbe.h ********************************************/
16635
+#line 1 "tsrc/vdbe.h"
1660116636
/*
1660216637
** 2001 September 15
1660316638
**
1660416639
** The author disclaims copyright to this source code. In place of
1660516640
** a legal notice, here is a blessing:
@@ -16779,10 +16814,11 @@
1677916814
** The makefile scans the vdbe.c source file and creates the "opcodes.h"
1678016815
** header file that defines a number for each opcode used by the VDBE.
1678116816
*/
1678216817
/************** Include opcodes.h in the middle of vdbe.h ********************/
1678316818
/************** Begin file opcodes.h *****************************************/
16819
+#line 1 "tsrc/opcodes.h"
1678416820
/* Automatically generated. Do not edit */
1678516821
/* See the tool/mkopcodeh.tcl script for details */
1678616822
#define OP_Savepoint 0
1678716823
#define OP_AutoCommit 1
1678816824
#define OP_Transaction 2
@@ -17020,10 +17056,11 @@
1702017056
*/
1702117057
#define SQLITE_MX_JUMP_OPCODE 64 /* Maximum JUMP opcode */
1702217058
1702317059
/************** End of opcodes.h *********************************************/
1702417060
/************** Continuing where we left off in vdbe.h ***********************/
17061
+#line 183 "tsrc/vdbe.h"
1702517062
1702617063
/*
1702717064
** Additional non-public SQLITE_PREPARE_* flags
1702817065
*/
1702917066
#define SQLITE_PREPARE_SAVESQL 0x80 /* Preserve SQL text */
@@ -17269,12 +17306,14 @@
1726917306
1727017307
#endif /* SQLITE_VDBE_H */
1727117308
1727217309
/************** End of vdbe.h ************************************************/
1727317310
/************** Continuing where we left off in sqliteInt.h ******************/
17311
+#line 1403 "tsrc/sqliteInt.h"
1727417312
/************** Include pcache.h in the middle of sqliteInt.h ****************/
1727517313
/************** Begin file pcache.h ******************************************/
17314
+#line 1 "tsrc/pcache.h"
1727617315
/*
1727717316
** 2008 August 05
1727817317
**
1727917318
** The author disclaims copyright to this source code. In place of
1728017319
** a legal notice, here is a blessing:
@@ -17464,12 +17503,14 @@
1746417503
1746517504
#endif /* _PCACHE_H_ */
1746617505
1746717506
/************** End of pcache.h **********************************************/
1746817507
/************** Continuing where we left off in sqliteInt.h ******************/
17508
+#line 1404 "tsrc/sqliteInt.h"
1746917509
/************** Include mutex.h in the middle of sqliteInt.h *****************/
1747017510
/************** Begin file mutex.h *******************************************/
17511
+#line 1 "tsrc/mutex.h"
1747117512
/*
1747217513
** 2007 August 28
1747317514
**
1747417515
** The author disclaims copyright to this source code. In place of
1747517516
** a legal notice, here is a blessing:
@@ -17540,10 +17581,11 @@
1754017581
SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
1754117582
#endif /* defined(SQLITE_MUTEX_OMIT) */
1754217583
1754317584
/************** End of mutex.h ***********************************************/
1754417585
/************** Continuing where we left off in sqliteInt.h ******************/
17586
+#line 1405 "tsrc/sqliteInt.h"
1754517587
1754617588
/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default
1754717589
** synchronous setting to EXTRA. It is no longer supported.
1754817590
*/
1754917591
#ifdef SQLITE_EXTRA_DURABLE
@@ -17740,51 +17782,15 @@
1774017782
struct FuncDefHash {
1774117783
FuncDef *a[SQLITE_FUNC_HASH_SZ]; /* Hash table for functions */
1774217784
};
1774317785
#define SQLITE_FUNC_HASH(C,L) (((C)+(L))%SQLITE_FUNC_HASH_SZ)
1774417786
17745
-#if defined(SQLITE_USER_AUTHENTICATION)
17746
-# warning "The SQLITE_USER_AUTHENTICATION extension is deprecated. \
17747
- See ext/userauth/user-auth.txt for details."
17748
-#endif
17749
-#ifdef SQLITE_USER_AUTHENTICATION
17750
-/*
17751
-** Information held in the "sqlite3" database connection object and used
17752
-** to manage user authentication.
17753
-*/
17754
-typedef struct sqlite3_userauth sqlite3_userauth;
17755
-struct sqlite3_userauth {
17756
- u8 authLevel; /* Current authentication level */
17757
- int nAuthPW; /* Size of the zAuthPW in bytes */
17758
- char *zAuthPW; /* Password used to authenticate */
17759
- char *zAuthUser; /* User name used to authenticate */
17760
-};
17761
-
17762
-/* Allowed values for sqlite3_userauth.authLevel */
17763
-#define UAUTH_Unknown 0 /* Authentication not yet checked */
17764
-#define UAUTH_Fail 1 /* User authentication failed */
17765
-#define UAUTH_User 2 /* Authenticated as a normal user */
17766
-#define UAUTH_Admin 3 /* Authenticated as an administrator */
17767
-
17768
-/* Functions used only by user authorization logic */
17769
-SQLITE_PRIVATE int sqlite3UserAuthTable(const char*);
17770
-SQLITE_PRIVATE int sqlite3UserAuthCheckLogin(sqlite3*,const char*,u8*);
17771
-SQLITE_PRIVATE void sqlite3UserAuthInit(sqlite3*);
17772
-SQLITE_PRIVATE void sqlite3CryptFunc(sqlite3_context*,int,sqlite3_value**);
17773
-
17774
-#endif /* SQLITE_USER_AUTHENTICATION */
17775
-
1777617787
/*
1777717788
** typedef for the authorization callback function.
1777817789
*/
17779
-#ifdef SQLITE_USER_AUTHENTICATION
17780
- typedef int (*sqlite3_xauth)(void*,int,const char*,const char*,const char*,
17781
- const char*, const char*);
17782
-#else
17783
- typedef int (*sqlite3_xauth)(void*,int,const char*,const char*,const char*,
17784
- const char*);
17785
-#endif
17790
+typedef int (*sqlite3_xauth)(void*,int,const char*,const char*,const char*,
17791
+ const char*);
1778617792
1778717793
#ifndef SQLITE_OMIT_DEPRECATED
1778817794
/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing
1778917795
** in the style of sqlite3_trace()
1779017796
*/
@@ -17941,13 +17947,10 @@
1794117947
sqlite3 *pUnlockConnection; /* Connection to watch for unlock */
1794217948
void *pUnlockArg; /* Argument to xUnlockNotify */
1794317949
void (*xUnlockNotify)(void **, int); /* Unlock notify callback */
1794417950
sqlite3 *pNextBlocked; /* Next in list of all blocked connections */
1794517951
#endif
17946
-#ifdef SQLITE_USER_AUTHENTICATION
17947
- sqlite3_userauth auth; /* User authentication information */
17948
-#endif
1794917952
};
1795017953
1795117954
/*
1795217955
** A macro to discover the encoding of a database.
1795317956
*/
@@ -21979,10 +21982,11 @@
2197921982
2198021983
#endif /* SQLITEINT_H */
2198121984
2198221985
/************** End of sqliteInt.h *******************************************/
2198321986
/************** Begin file os_common.h ***************************************/
21987
+#line 1 "tsrc/os_common.h"
2198421988
/*
2198521989
** 2004 May 22
2198621990
**
2198721991
** The author disclaims copyright to this source code. In place of
2198821992
** a legal notice, here is a blessing:
@@ -22081,10 +22085,11 @@
2208122085
2208222086
#endif /* !defined(_OS_COMMON_H_) */
2208322087
2208422088
/************** End of os_common.h *******************************************/
2208522089
/************** Begin file ctime.c *******************************************/
22090
+#line 1 "tsrc/ctime.c"
2208622091
/* DO NOT EDIT!
2208722092
** This file is automatically generated by the script in the canonical
2208822093
** SQLite source tree at tool/mkctimec.tcl.
2208922094
**
2209022095
** To modify this header, edit any of the various lists in that script
@@ -22850,13 +22855,10 @@
2285022855
"UNLINK_AFTER_CLOSE",
2285122856
#endif
2285222857
#ifdef SQLITE_UNTESTABLE
2285322858
"UNTESTABLE",
2285422859
#endif
22855
-#ifdef SQLITE_USER_AUTHENTICATION
22856
- "USER_AUTHENTICATION",
22857
-#endif
2285822860
#ifdef SQLITE_USE_ALLOCA
2285922861
"USE_ALLOCA",
2286022862
#endif
2286122863
#ifdef SQLITE_USE_FCNTL_TRACE
2286222864
"USE_FCNTL_TRACE",
@@ -22883,10 +22885,11 @@
2288322885
2288422886
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
2288522887
2288622888
/************** End of ctime.c ***********************************************/
2288722889
/************** Begin file global.c ******************************************/
22890
+#line 1 "tsrc/global.c"
2288822891
/*
2288922892
** 2008 June 13
2289022893
**
2289122894
** The author disclaims copyright to this source code. In place of
2289222895
** a legal notice, here is a blessing:
@@ -23287,10 +23290,11 @@
2328723290
"TEXT"
2328823291
};
2328923292
2329023293
/************** End of global.c **********************************************/
2329123294
/************** Begin file status.c ******************************************/
23295
+#line 1 "tsrc/status.c"
2329223296
/*
2329323297
** 2008 June 18
2329423298
**
2329523299
** The author disclaims copyright to this source code. In place of
2329623300
** a legal notice, here is a blessing:
@@ -23305,10 +23309,11 @@
2330523309
** functionality.
2330623310
*/
2330723311
/* #include "sqliteInt.h" */
2330823312
/************** Include vdbeInt.h in the middle of status.c ******************/
2330923313
/************** Begin file vdbeInt.h *****************************************/
23314
+#line 1 "tsrc/vdbeInt.h"
2331023315
/*
2331123316
** 2003 September 6
2331223317
**
2331323318
** The author disclaims copyright to this source code. In place of
2331423319
** a legal notice, here is a blessing:
@@ -23847,10 +23852,11 @@
2384723852
UnpackedRecord *pNewUnpacked; /* Unpacked version of new.* record */
2384823853
int iNewReg; /* Register for new.* values */
2384923854
int iBlobWrite; /* Value returned by preupdate_blobwrite() */
2385023855
i64 iKey1; /* First key value passed to hook */
2385123856
i64 iKey2; /* Second key value passed to hook */
23857
+ Mem oldipk; /* Memory cell holding "old" IPK value */
2385223858
Mem *aNew; /* Array of new.* values */
2385323859
Table *pTab; /* Schema object being updated */
2385423860
Index *pPk; /* PK index if pTab is WITHOUT ROWID */
2385523861
sqlite3_value **apDflt; /* Array of default values, if required */
2385623862
};
@@ -24040,10 +24046,11 @@
2404024046
2404124047
#endif /* !defined(SQLITE_VDBEINT_H) */
2404224048
2404324049
/************** End of vdbeInt.h *********************************************/
2404424050
/************** Continuing where we left off in status.c *********************/
24051
+#line 18 "tsrc/status.c"
2404524052
2404624053
/*
2404724054
** Variables in which to record status information.
2404824055
*/
2404924056
#if SQLITE_PTRSIZE>4
@@ -24424,10 +24431,11 @@
2442424431
return rc;
2442524432
}
2442624433
2442724434
/************** End of status.c **********************************************/
2442824435
/************** Begin file date.c ********************************************/
24436
+#line 1 "tsrc/date.c"
2442924437
/*
2443024438
** 2003 October 31
2443124439
**
2443224440
** The author disclaims copyright to this source code. In place of
2443324441
** a legal notice, here is a blessing:
@@ -26242,10 +26250,11 @@
2624226250
sqlite3InsertBuiltinFuncs(aDateTimeFuncs, ArraySize(aDateTimeFuncs));
2624326251
}
2624426252
2624526253
/************** End of date.c ************************************************/
2624626254
/************** Begin file os.c **********************************************/
26255
+#line 1 "tsrc/os.c"
2624726256
/*
2624826257
** 2005 November 29
2624926258
**
2625026259
** The author disclaims copyright to this source code. In place of
2625126260
** a legal notice, here is a blessing:
@@ -26692,10 +26701,11 @@
2669226701
return SQLITE_OK;
2669326702
}
2669426703
2669526704
/************** End of os.c **************************************************/
2669626705
/************** Begin file fault.c *******************************************/
26706
+#line 1 "tsrc/fault.c"
2669726707
/*
2669826708
** 2008 Jan 22
2669926709
**
2670026710
** The author disclaims copyright to this source code. In place of
2670126711
** a legal notice, here is a blessing:
@@ -26782,10 +26792,11 @@
2678226792
2678326793
#endif /* #ifndef SQLITE_UNTESTABLE */
2678426794
2678526795
/************** End of fault.c ***********************************************/
2678626796
/************** Begin file mem0.c ********************************************/
26797
+#line 1 "tsrc/mem0.c"
2678726798
/*
2678826799
** 2008 October 28
2678926800
**
2679026801
** The author disclaims copyright to this source code. In place of
2679126802
** a legal notice, here is a blessing:
@@ -26844,10 +26855,11 @@
2684426855
2684526856
#endif /* SQLITE_ZERO_MALLOC */
2684626857
2684726858
/************** End of mem0.c ************************************************/
2684826859
/************** Begin file mem1.c ********************************************/
26860
+#line 1 "tsrc/mem1.c"
2684926861
/*
2685026862
** 2007 August 14
2685126863
**
2685226864
** The author disclaims copyright to this source code. In place of
2685326865
** a legal notice, here is a blessing:
@@ -27138,10 +27150,11 @@
2713827150
2713927151
#endif /* SQLITE_SYSTEM_MALLOC */
2714027152
2714127153
/************** End of mem1.c ************************************************/
2714227154
/************** Begin file mem2.c ********************************************/
27155
+#line 1 "tsrc/mem2.c"
2714327156
/*
2714427157
** 2007 August 15
2714527158
**
2714627159
** The author disclaims copyright to this source code. In place of
2714727160
** a legal notice, here is a blessing:
@@ -27669,10 +27682,11 @@
2766927682
2767027683
#endif /* SQLITE_MEMDEBUG */
2767127684
2767227685
/************** End of mem2.c ************************************************/
2767327686
/************** Begin file mem3.c ********************************************/
27687
+#line 1 "tsrc/mem3.c"
2767427688
/*
2767527689
** 2007 October 14
2767627690
**
2767727691
** The author disclaims copyright to this source code. In place of
2767827692
** a legal notice, here is a blessing:
@@ -28359,10 +28373,11 @@
2835928373
2836028374
#endif /* SQLITE_ENABLE_MEMSYS3 */
2836128375
2836228376
/************** End of mem3.c ************************************************/
2836328377
/************** Begin file mem5.c ********************************************/
28378
+#line 1 "tsrc/mem5.c"
2836428379
/*
2836528380
** 2007 October 14
2836628381
**
2836728382
** The author disclaims copyright to this source code. In place of
2836828383
** a legal notice, here is a blessing:
@@ -28947,10 +28962,11 @@
2894728962
2894828963
#endif /* SQLITE_ENABLE_MEMSYS5 */
2894928964
2895028965
/************** End of mem5.c ************************************************/
2895128966
/************** Begin file mutex.c *******************************************/
28967
+#line 1 "tsrc/mutex.c"
2895228968
/*
2895328969
** 2007 August 14
2895428970
**
2895528971
** The author disclaims copyright to this source code. In place of
2895628972
** a legal notice, here is a blessing:
@@ -29324,10 +29340,11 @@
2932429340
2932529341
#endif /* !defined(SQLITE_MUTEX_OMIT) */
2932629342
2932729343
/************** End of mutex.c ***********************************************/
2932829344
/************** Begin file mutex_noop.c **************************************/
29345
+#line 1 "tsrc/mutex_noop.c"
2932929346
/*
2933029347
** 2008 October 07
2933129348
**
2933229349
** The author disclaims copyright to this source code. In place of
2933329350
** a legal notice, here is a blessing:
@@ -29542,10 +29559,11 @@
2954229559
#endif /* defined(SQLITE_MUTEX_NOOP) */
2954329560
#endif /* !defined(SQLITE_MUTEX_OMIT) */
2954429561
2954529562
/************** End of mutex_noop.c ******************************************/
2954629563
/************** Begin file mutex_unix.c **************************************/
29564
+#line 1 "tsrc/mutex_unix.c"
2954729565
/*
2954829566
** 2007 August 28
2954929567
**
2955029568
** The author disclaims copyright to this source code. In place of
2955129569
** a legal notice, here is a blessing:
@@ -29939,10 +29957,11 @@
2993929957
2994029958
#endif /* SQLITE_MUTEX_PTHREADS */
2994129959
2994229960
/************** End of mutex_unix.c ******************************************/
2994329961
/************** Begin file mutex_w32.c ***************************************/
29962
+#line 1 "tsrc/mutex_w32.c"
2994429963
/*
2994529964
** 2007 August 14
2994629965
**
2994729966
** The author disclaims copyright to this source code. In place of
2994829967
** a legal notice, here is a blessing:
@@ -29965,10 +29984,11 @@
2996529984
/*
2996629985
** Include the header file for the Windows VFS.
2996729986
*/
2996829987
/************** Include os_win.h in the middle of mutex_w32.c ****************/
2996929988
/************** Begin file os_win.h ******************************************/
29989
+#line 1 "tsrc/os_win.h"
2997029990
/*
2997129991
** 2013 November 25
2997229992
**
2997329993
** The author disclaims copyright to this source code. In place of
2997429994
** a legal notice, here is a blessing:
@@ -30056,10 +30076,11 @@
3005630076
3005730077
#endif /* SQLITE_OS_WIN_H */
3005830078
3005930079
/************** End of os_win.h **********************************************/
3006030080
/************** Continuing where we left off in mutex_w32.c ******************/
30081
+#line 26 "tsrc/mutex_w32.c"
3006130082
#endif
3006230083
3006330084
/*
3006430085
** The code in this file is only used if we are compiling multithreaded
3006530086
** on a Win32 system.
@@ -30433,10 +30454,11 @@
3043330454
3043430455
#endif /* SQLITE_MUTEX_W32 */
3043530456
3043630457
/************** End of mutex_w32.c *******************************************/
3043730458
/************** Begin file malloc.c ******************************************/
30459
+#line 1 "tsrc/malloc.c"
3043830460
/*
3043930461
** 2001 September 15
3044030462
**
3044130463
** The author disclaims copyright to this source code. In place of
3044230464
** a legal notice, here is a blessing:
@@ -31356,10 +31378,11 @@
3135631378
return 0;
3135731379
}
3135831380
3135931381
/************** End of malloc.c **********************************************/
3136031382
/************** Begin file printf.c ******************************************/
31383
+#line 1 "tsrc/printf.c"
3136131384
/*
3136231385
** The "printf" code that follows dates from the 1980's. It is in
3136331386
** the public domain.
3136431387
**
3136531388
**************************************************************************
@@ -32805,10 +32828,11 @@
3280532828
}
3280632829
}
3280732830
3280832831
/************** End of printf.c **********************************************/
3280932832
/************** Begin file treeview.c ****************************************/
32833
+#line 1 "tsrc/treeview.c"
3281032834
/*
3281132835
** 2015-06-08
3281232836
**
3281332837
** The author disclaims copyright to this source code. In place of
3281432838
** a legal notice, here is a blessing:
@@ -34136,10 +34160,11 @@
3413634160
3413734161
#endif /* SQLITE_DEBUG */
3413834162
3413934163
/************** End of treeview.c ********************************************/
3414034164
/************** Begin file random.c ******************************************/
34165
+#line 1 "tsrc/random.c"
3414134166
/*
3414234167
** 2001 September 15
3414334168
**
3414434169
** The author disclaims copyright to this source code. In place of
3414534170
** a legal notice, here is a blessing:
@@ -34296,10 +34321,11 @@
3429634321
}
3429734322
#endif /* SQLITE_UNTESTABLE */
3429834323
3429934324
/************** End of random.c **********************************************/
3430034325
/************** Begin file threads.c *****************************************/
34326
+#line 1 "tsrc/threads.c"
3430134327
/*
3430234328
** 2012 July 21
3430334329
**
3430434330
** The author disclaims copyright to this source code. In place of
3430534331
** a legal notice, here is a blessing:
@@ -34573,10 +34599,11 @@
3457334599
/****************************** End Single-Threaded *************************/
3457434600
#endif /* SQLITE_MAX_WORKER_THREADS>0 */
3457534601
3457634602
/************** End of threads.c *********************************************/
3457734603
/************** Begin file utf.c *********************************************/
34604
+#line 1 "tsrc/utf.c"
3457834605
/*
3457934606
** 2004 April 13
3458034607
**
3458134608
** The author disclaims copyright to this source code. In place of
3458234609
** a legal notice, here is a blessing:
@@ -35144,10 +35171,11 @@
3514435171
#endif /* SQLITE_TEST */
3514535172
#endif /* SQLITE_OMIT_UTF16 */
3514635173
3514735174
/************** End of utf.c *************************************************/
3514835175
/************** Begin file util.c ********************************************/
35176
+#line 1 "tsrc/util.c"
3514935177
/*
3515035178
** 2001 September 15
3515135179
**
3515235180
** The author disclaims copyright to this source code. In place of
3515335181
** a legal notice, here is a blessing:
@@ -36995,10 +37023,11 @@
3699537023
return 0;
3699637024
}
3699737025
3699837026
/************** End of util.c ************************************************/
3699937027
/************** Begin file hash.c ********************************************/
37028
+#line 1 "tsrc/hash.c"
3700037029
/*
3700137030
** 2001 September 22
3700237031
**
3700337032
** The author disclaims copyright to this source code. In place of
3700437033
** a legal notice, here is a blessing:
@@ -37268,10 +37297,11 @@
3726837297
return 0;
3726937298
}
3727037299
3727137300
/************** End of hash.c ************************************************/
3727237301
/************** Begin file opcodes.c *****************************************/
37302
+#line 1 "tsrc/opcodes.c"
3727337303
/* Automatically generated. Do not edit */
3727437304
/* See the tool/mkopcodec.tcl script for details. */
3727537305
#if !defined(SQLITE_OMIT_EXPLAIN) \
3727637306
|| defined(VDBE_PROFILE) \
3727737307
|| defined(SQLITE_DEBUG)
@@ -37477,10 +37507,11 @@
3747737507
}
3747837508
#endif
3747937509
3748037510
/************** End of opcodes.c *********************************************/
3748137511
/************** Begin file os_kv.c *******************************************/
37512
+#line 1 "tsrc/os_kv.c"
3748237513
/*
3748337514
** 2022-09-06
3748437515
**
3748537516
** The author disclaims copyright to this source code. In place of
3748637517
** a legal notice, here is a blessing:
@@ -38459,10 +38490,11 @@
3845938490
}
3846038491
#endif
3846138492
3846238493
/************** End of os_kv.c ***********************************************/
3846338494
/************** Begin file os_unix.c *****************************************/
38495
+#line 1 "tsrc/os_unix.c"
3846438496
/*
3846538497
** 2004 May 22
3846638498
**
3846738499
** The author disclaims copyright to this source code. In place of
3846838500
** a legal notice, here is a blessing:
@@ -38674,11 +38706,11 @@
3867438706
# define F_SETLKW 7
3867538707
# endif
3867638708
# endif
3867738709
#else /* !SQLITE_WASI */
3867838710
# ifndef HAVE_FCHMOD
38679
-# define HAVE_FCHMOD
38711
+# define HAVE_FCHMOD 1
3868038712
# endif
3868138713
#endif /* SQLITE_WASI */
3868238714
3868338715
#ifdef SQLITE_WASI
3868438716
# define osGetpid(X) (pid_t)1
@@ -42589,10 +42621,11 @@
4258942621
4259042622
/* Set the POWERSAFE_OVERWRITE flag if requested. */
4259142623
if( pFd->ctrlFlags & UNIXFILE_PSOW ){
4259242624
pFd->deviceCharacteristics |= SQLITE_IOCAP_POWERSAFE_OVERWRITE;
4259342625
}
42626
+ pFd->deviceCharacteristics |= SQLITE_IOCAP_SUBPAGE_READ;
4259442627
4259542628
pFd->sectorSize = SQLITE_DEFAULT_SECTOR_SIZE;
4259642629
}
4259742630
}
4259842631
#else
@@ -46727,10 +46760,11 @@
4672746760
4672846761
#endif /* SQLITE_OS_UNIX */
4672946762
4673046763
/************** End of os_unix.c *********************************************/
4673146764
/************** Begin file os_win.c ******************************************/
46765
+#line 1 "tsrc/os_win.c"
4673246766
/*
4673346767
** 2004 May 22
4673446768
**
4673546769
** The author disclaims copyright to this source code. In place of
4673646770
** a legal notice, here is a blessing:
@@ -50389,11 +50423,11 @@
5038950423
/*
5039050424
** Return a vector of device characteristics.
5039150425
*/
5039250426
static int winDeviceCharacteristics(sqlite3_file *id){
5039350427
winFile *p = (winFile*)id;
50394
- return SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN |
50428
+ return SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN | SQLITE_IOCAP_SUBPAGE_READ |
5039550429
((p->ctrlFlags & WINFILE_PSOW)?SQLITE_IOCAP_POWERSAFE_OVERWRITE:0);
5039650430
}
5039750431
5039850432
/*
5039950433
** Windows will only let you create file view mappings
@@ -52941,10 +52975,11 @@
5294152975
5294252976
#endif /* SQLITE_OS_WIN */
5294352977
5294452978
/************** End of os_win.c **********************************************/
5294552979
/************** Begin file memdb.c *******************************************/
52980
+#line 1 "tsrc/memdb.c"
5294652981
/*
5294752982
** 2016-09-07
5294852983
**
5294952984
** The author disclaims copyright to this source code. In place of
5295052985
** a legal notice, here is a blessing:
@@ -53880,10 +53915,11 @@
5388053915
}
5388153916
#endif /* SQLITE_OMIT_DESERIALIZE */
5388253917
5388353918
/************** End of memdb.c ***********************************************/
5388453919
/************** Begin file bitvec.c ******************************************/
53920
+#line 1 "tsrc/bitvec.c"
5388553921
/*
5388653922
** 2008 February 16
5388753923
**
5388853924
** The author disclaims copyright to this source code. In place of
5388953925
** a legal notice, here is a blessing:
@@ -54294,10 +54330,11 @@
5429454330
}
5429554331
#endif /* SQLITE_UNTESTABLE */
5429654332
5429754333
/************** End of bitvec.c **********************************************/
5429854334
/************** Begin file pcache.c ******************************************/
54335
+#line 1 "tsrc/pcache.c"
5429954336
/*
5430054337
** 2008 August 05
5430154338
**
5430254339
** The author disclaims copyright to this source code. In place of
5430354340
** a legal notice, here is a blessing:
@@ -55233,10 +55270,11 @@
5523355270
}
5523455271
#endif
5523555272
5523655273
/************** End of pcache.c **********************************************/
5523755274
/************** Begin file pcache1.c *****************************************/
55275
+#line 1 "tsrc/pcache1.c"
5523855276
/*
5523955277
** 2008 November 05
5524055278
**
5524155279
** The author disclaims copyright to this source code. In place of
5524255280
** a legal notice, here is a blessing:
@@ -56518,10 +56556,11 @@
5651856556
}
5651956557
#endif
5652056558
5652156559
/************** End of pcache1.c *********************************************/
5652256560
/************** Begin file rowset.c ******************************************/
56561
+#line 1 "tsrc/rowset.c"
5652356562
/*
5652456563
** 2008 December 3
5652556564
**
5652656565
** The author disclaims copyright to this source code. In place of
5652756566
** a legal notice, here is a blessing:
@@ -57023,10 +57062,11 @@
5702357062
return 0;
5702457063
}
5702557064
5702657065
/************** End of rowset.c **********************************************/
5702757066
/************** Begin file pager.c *******************************************/
57067
+#line 1 "tsrc/pager.c"
5702857068
/*
5702957069
** 2001 September 15
5703057070
**
5703157071
** The author disclaims copyright to this source code. In place of
5703257072
** a legal notice, here is a blessing:
@@ -57047,10 +57087,11 @@
5704757087
*/
5704857088
#ifndef SQLITE_OMIT_DISKIO
5704957089
/* #include "sqliteInt.h" */
5705057090
/************** Include wal.h in the middle of pager.c ***********************/
5705157091
/************** Begin file wal.h *********************************************/
57092
+#line 1 "tsrc/wal.h"
5705257093
/*
5705357094
** 2010 February 1
5705457095
**
5705557096
** The author disclaims copyright to this source code. In place of
5705657097
** a legal notice, here is a blessing:
@@ -57210,10 +57251,11 @@
5721057251
#endif /* ifndef SQLITE_OMIT_WAL */
5721157252
#endif /* SQLITE_WAL_H */
5721257253
5721357254
/************** End of wal.h *************************************************/
5721457255
/************** Continuing where we left off in pager.c **********************/
57256
+#line 24 "tsrc/pager.c"
5721557257
5721657258
5721757259
/******************* NOTES ON THE DESIGN OF THE PAGER ************************
5721857260
**
5721957261
** This comment block describes invariants that hold when using a rollback
@@ -57997,24 +58039,32 @@
5799758039
#ifdef SQLITE_DIRECT_OVERFLOW_READ
5799858040
/*
5799958041
** Return true if page pgno can be read directly from the database file
5800058042
** by the b-tree layer. This is the case if:
5800158043
**
58002
-** * the database file is open,
58003
-** * there are no dirty pages in the cache, and
58004
-** * the desired page is not currently in the wal file.
58044
+** (1) the database file is open
58045
+** (2) the VFS for the database is able to do unaligned sub-page reads
58046
+** (3) there are no dirty pages in the cache, and
58047
+** (4) the desired page is not currently in the wal file.
5800558048
*/
5800658049
SQLITE_PRIVATE int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno){
58007
- if( pPager->fd->pMethods==0 ) return 0;
58008
- if( sqlite3PCacheIsDirty(pPager->pPCache) ) return 0;
58050
+ assert( pPager!=0 );
58051
+ assert( pPager->fd!=0 );
58052
+ if( pPager->fd->pMethods==0 ) return 0; /* Case (1) */
58053
+ if( sqlite3PCacheIsDirty(pPager->pPCache) ) return 0; /* Failed (3) */
5800958054
#ifndef SQLITE_OMIT_WAL
5801058055
if( pPager->pWal ){
5801158056
u32 iRead = 0;
5801258057
(void)sqlite3WalFindFrame(pPager->pWal, pgno, &iRead);
58013
- return iRead==0;
58058
+ return iRead==0; /* Condition (4) */
5801458059
}
5801558060
#endif
58061
+ assert( pPager->fd->pMethods->xDeviceCharacteristics!=0 );
58062
+ if( (pPager->fd->pMethods->xDeviceCharacteristics(pPager->fd)
58063
+ & SQLITE_IOCAP_SUBPAGE_READ)==0 ){
58064
+ return 0; /* Case (2) */
58065
+ }
5801658066
return 1;
5801758067
}
5801858068
#endif
5801958069
5802058070
#ifndef SQLITE_OMIT_WAL
@@ -64991,10 +65041,11 @@
6499165041
6499265042
#endif /* SQLITE_OMIT_DISKIO */
6499365043
6499465044
/************** End of pager.c ***********************************************/
6499565045
/************** Begin file wal.c *********************************************/
65046
+#line 1 "tsrc/wal.c"
6499665047
/*
6499765048
** 2010 February 1
6499865049
**
6499965050
** The author disclaims copyright to this source code. In place of
6500065051
** a legal notice, here is a blessing:
@@ -69587,10 +69638,11 @@
6958769638
6958869639
#endif /* #ifndef SQLITE_OMIT_WAL */
6958969640
6959069641
/************** End of wal.c *************************************************/
6959169642
/************** Begin file btmutex.c *****************************************/
69643
+#line 1 "tsrc/btmutex.c"
6959269644
/*
6959369645
** 2007 August 27
6959469646
**
6959569647
** The author disclaims copyright to this source code. In place of
6959669648
** a legal notice, here is a blessing:
@@ -69606,10 +69658,11 @@
6960669658
** big and we want to break it down some. This packaged seemed like
6960769659
** a good breakout.
6960869660
*/
6960969661
/************** Include btreeInt.h in the middle of btmutex.c ****************/
6961069662
/************** Begin file btreeInt.h ****************************************/
69663
+#line 1 "tsrc/btreeInt.h"
6961169664
/*
6961269665
** 2004 April 6
6961369666
**
6961469667
** The author disclaims copyright to this source code. In place of
6961569668
** a legal notice, here is a blessing:
@@ -70343,10 +70396,11 @@
7034370396
# define get2byteAligned(x) ((x)[0]<<8 | (x)[1])
7034470397
#endif
7034570398
7034670399
/************** End of btreeInt.h ********************************************/
7034770400
/************** Continuing where we left off in btmutex.c ********************/
70401
+#line 19 "tsrc/btmutex.c"
7034870402
#ifndef SQLITE_OMIT_SHARED_CACHE
7034970403
#if SQLITE_THREADSAFE
7035070404
7035170405
/*
7035270406
** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -70637,10 +70691,11 @@
7063770691
7063870692
#endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
7063970693
7064070694
/************** End of btmutex.c *********************************************/
7064170695
/************** Begin file btree.c *******************************************/
70696
+#line 1 "tsrc/btree.c"
7064270697
/*
7064370698
** 2004 April 6
7064470699
**
7064570700
** The author disclaims copyright to this source code. In place of
7064670701
** a legal notice, here is a blessing:
@@ -82131,10 +82186,11 @@
8213182186
}
8213282187
#endif
8213382188
8213482189
/************** End of btree.c ***********************************************/
8213582190
/************** Begin file backup.c ******************************************/
82191
+#line 1 "tsrc/backup.c"
8213682192
/*
8213782193
** 2009 January 28
8213882194
**
8213982195
** The author disclaims copyright to this source code. In place of
8214082196
** a legal notice, here is a blessing:
@@ -82901,10 +82957,11 @@
8290182957
}
8290282958
#endif /* SQLITE_OMIT_VACUUM */
8290382959
8290482960
/************** End of backup.c **********************************************/
8290582961
/************** Begin file vdbemem.c *****************************************/
82962
+#line 1 "tsrc/vdbemem.c"
8290682963
/*
8290782964
** 2004 May 26
8290882965
**
8290982966
** The author disclaims copyright to this source code. In place of
8291082967
** a legal notice, here is a blessing:
@@ -84957,10 +85014,11 @@
8495785014
return valueBytes(pVal, enc);
8495885015
}
8495985016
8496085017
/************** End of vdbemem.c *********************************************/
8496185018
/************** Begin file vdbeaux.c *****************************************/
85019
+#line 1 "tsrc/vdbeaux.c"
8496285020
/*
8496385021
** 2003 September 6
8496485022
**
8496585023
** The author disclaims copyright to this source code. In place of
8496685024
** a legal notice, here is a blessing:
@@ -90488,10 +90546,11 @@
9048890546
db->xPreUpdateCallback(db->pPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2);
9048990547
db->pPreUpdate = 0;
9049090548
sqlite3DbFree(db, preupdate.aRecord);
9049190549
vdbeFreeUnpacked(db, preupdate.keyinfo.nKeyField+1, preupdate.pUnpacked);
9049290550
vdbeFreeUnpacked(db, preupdate.keyinfo.nKeyField+1, preupdate.pNewUnpacked);
90551
+ sqlite3VdbeMemRelease(&preupdate.oldipk);
9049390552
if( preupdate.aNew ){
9049490553
int i;
9049590554
for(i=0; i<pCsr->nField; i++){
9049690555
sqlite3VdbeMemRelease(&preupdate.aNew[i]);
9049790556
}
@@ -90507,10 +90566,11 @@
9050790566
}
9050890567
#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
9050990568
9051090569
/************** End of vdbeaux.c *********************************************/
9051190570
/************** Begin file vdbeapi.c *****************************************/
90571
+#line 1 "tsrc/vdbeapi.c"
9051290572
/*
9051390573
** 2004 May 26
9051490574
**
9051590575
** The author disclaims copyright to this source code. In place of
9051690576
** a legal notice, here is a blessing:
@@ -92706,64 +92766,68 @@
9270692766
if( iIdx>=p->pCsr->nField || iIdx<0 ){
9270792767
rc = SQLITE_RANGE;
9270892768
goto preupdate_old_out;
9270992769
}
9271092770
92711
- /* If the old.* record has not yet been loaded into memory, do so now. */
92712
- if( p->pUnpacked==0 ){
92713
- u32 nRec;
92714
- u8 *aRec;
92715
-
92716
- assert( p->pCsr->eCurType==CURTYPE_BTREE );
92717
- nRec = sqlite3BtreePayloadSize(p->pCsr->uc.pCursor);
92718
- aRec = sqlite3DbMallocRaw(db, nRec);
92719
- if( !aRec ) goto preupdate_old_out;
92720
- rc = sqlite3BtreePayload(p->pCsr->uc.pCursor, 0, nRec, aRec);
92721
- if( rc==SQLITE_OK ){
92722
- p->pUnpacked = vdbeUnpackRecord(&p->keyinfo, nRec, aRec);
92723
- if( !p->pUnpacked ) rc = SQLITE_NOMEM;
92724
- }
92725
- if( rc!=SQLITE_OK ){
92726
- sqlite3DbFree(db, aRec);
92727
- goto preupdate_old_out;
92728
- }
92729
- p->aRecord = aRec;
92730
- }
92731
-
92732
- pMem = *ppValue = &p->pUnpacked->aMem[iIdx];
9273392771
if( iIdx==p->pTab->iPKey ){
92772
+ *ppValue = pMem = &p->oldipk;
9273492773
sqlite3VdbeMemSetInt64(pMem, p->iKey1);
92735
- }else if( iIdx>=p->pUnpacked->nField ){
92736
- /* This occurs when the table has been extended using ALTER TABLE
92737
- ** ADD COLUMN. The value to return is the default value of the column. */
92738
- Column *pCol = &p->pTab->aCol[iIdx];
92739
- if( pCol->iDflt>0 ){
92740
- if( p->apDflt==0 ){
92741
- int nByte = sizeof(sqlite3_value*)*p->pTab->nCol;
92742
- p->apDflt = (sqlite3_value**)sqlite3DbMallocZero(db, nByte);
92743
- if( p->apDflt==0 ) goto preupdate_old_out;
92744
- }
92745
- if( p->apDflt[iIdx]==0 ){
92746
- sqlite3_value *pVal = 0;
92747
- Expr *pDflt;
92748
- assert( p->pTab!=0 && IsOrdinaryTable(p->pTab) );
92749
- pDflt = p->pTab->u.tab.pDfltList->a[pCol->iDflt-1].pExpr;
92750
- rc = sqlite3ValueFromExpr(db, pDflt, ENC(db), pCol->affinity, &pVal);
92751
- if( rc==SQLITE_OK && pVal==0 ){
92752
- rc = SQLITE_CORRUPT_BKPT;
92753
- }
92754
- p->apDflt[iIdx] = pVal;
92755
- }
92756
- *ppValue = p->apDflt[iIdx];
92757
- }else{
92758
- *ppValue = (sqlite3_value *)columnNullValue();
92759
- }
92760
- }else if( p->pTab->aCol[iIdx].affinity==SQLITE_AFF_REAL ){
92761
- if( pMem->flags & (MEM_Int|MEM_IntReal) ){
92762
- testcase( pMem->flags & MEM_Int );
92763
- testcase( pMem->flags & MEM_IntReal );
92764
- sqlite3VdbeMemRealify(pMem);
92774
+ }else{
92775
+
92776
+ /* If the old.* record has not yet been loaded into memory, do so now. */
92777
+ if( p->pUnpacked==0 ){
92778
+ u32 nRec;
92779
+ u8 *aRec;
92780
+
92781
+ assert( p->pCsr->eCurType==CURTYPE_BTREE );
92782
+ nRec = sqlite3BtreePayloadSize(p->pCsr->uc.pCursor);
92783
+ aRec = sqlite3DbMallocRaw(db, nRec);
92784
+ if( !aRec ) goto preupdate_old_out;
92785
+ rc = sqlite3BtreePayload(p->pCsr->uc.pCursor, 0, nRec, aRec);
92786
+ if( rc==SQLITE_OK ){
92787
+ p->pUnpacked = vdbeUnpackRecord(&p->keyinfo, nRec, aRec);
92788
+ if( !p->pUnpacked ) rc = SQLITE_NOMEM;
92789
+ }
92790
+ if( rc!=SQLITE_OK ){
92791
+ sqlite3DbFree(db, aRec);
92792
+ goto preupdate_old_out;
92793
+ }
92794
+ p->aRecord = aRec;
92795
+ }
92796
+
92797
+ pMem = *ppValue = &p->pUnpacked->aMem[iIdx];
92798
+ if( iIdx>=p->pUnpacked->nField ){
92799
+ /* This occurs when the table has been extended using ALTER TABLE
92800
+ ** ADD COLUMN. The value to return is the default value of the column. */
92801
+ Column *pCol = &p->pTab->aCol[iIdx];
92802
+ if( pCol->iDflt>0 ){
92803
+ if( p->apDflt==0 ){
92804
+ int nByte = sizeof(sqlite3_value*)*p->pTab->nCol;
92805
+ p->apDflt = (sqlite3_value**)sqlite3DbMallocZero(db, nByte);
92806
+ if( p->apDflt==0 ) goto preupdate_old_out;
92807
+ }
92808
+ if( p->apDflt[iIdx]==0 ){
92809
+ sqlite3_value *pVal = 0;
92810
+ Expr *pDflt;
92811
+ assert( p->pTab!=0 && IsOrdinaryTable(p->pTab) );
92812
+ pDflt = p->pTab->u.tab.pDfltList->a[pCol->iDflt-1].pExpr;
92813
+ rc = sqlite3ValueFromExpr(db, pDflt, ENC(db), pCol->affinity, &pVal);
92814
+ if( rc==SQLITE_OK && pVal==0 ){
92815
+ rc = SQLITE_CORRUPT_BKPT;
92816
+ }
92817
+ p->apDflt[iIdx] = pVal;
92818
+ }
92819
+ *ppValue = p->apDflt[iIdx];
92820
+ }else{
92821
+ *ppValue = (sqlite3_value *)columnNullValue();
92822
+ }
92823
+ }else if( p->pTab->aCol[iIdx].affinity==SQLITE_AFF_REAL ){
92824
+ if( pMem->flags & (MEM_Int|MEM_IntReal) ){
92825
+ testcase( pMem->flags & MEM_Int );
92826
+ testcase( pMem->flags & MEM_IntReal );
92827
+ sqlite3VdbeMemRealify(pMem);
92828
+ }
9276592829
}
9276692830
}
9276792831
9276892832
preupdate_old_out:
9276992833
sqlite3Error(db, rc);
@@ -93089,10 +93153,11 @@
9308993153
}
9309093154
#endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
9309193155
9309293156
/************** End of vdbeapi.c *********************************************/
9309393157
/************** Begin file vdbetrace.c ***************************************/
93158
+#line 1 "tsrc/vdbetrace.c"
9309493159
/*
9309593160
** 2009 November 25
9309693161
**
9309793162
** The author disclaims copyright to this source code. In place of
9309893163
** a legal notice, here is a blessing:
@@ -93284,10 +93349,11 @@
9328493349
9328593350
#endif /* #ifndef SQLITE_OMIT_TRACE */
9328693351
9328793352
/************** End of vdbetrace.c *******************************************/
9328893353
/************** Begin file vdbe.c ********************************************/
93354
+#line 1 "tsrc/vdbe.c"
9328993355
/*
9329093356
** 2001 September 15
9329193357
**
9329293358
** The author disclaims copyright to this source code. In place of
9329393359
** a legal notice, here is a blessing:
@@ -93315,10 +93381,11 @@
9331593381
#if defined(VDBE_PROFILE) \
9331693382
|| defined(SQLITE_PERFORMANCE_TRACE) \
9331793383
|| defined(SQLITE_ENABLE_STMT_SCANSTATUS)
9331893384
/************** Include hwtime.h in the middle of vdbe.c *********************/
9331993385
/************** Begin file hwtime.h ******************************************/
93386
+#line 1 "tsrc/hwtime.h"
9332093387
/*
9332193388
** 2008 May 27
9332293389
**
9332393390
** The author disclaims copyright to this source code. In place of
9332493391
** a legal notice, here is a blessing:
@@ -93403,10 +93470,11 @@
9340393470
9340493471
#endif /* !defined(SQLITE_HWTIME_H) */
9340593472
9340693473
/************** End of hwtime.h **********************************************/
9340793474
/************** Continuing where we left off in vdbe.c ***********************/
93475
+#line 31 "tsrc/vdbe.c"
9340893476
#endif
9340993477
9341093478
/*
9341193479
** Invoke this macro on memory cells just prior to changing the
9341293480
** value of the cell. This macro verifies that shallow copies are
@@ -97913,13 +97981,15 @@
9791397981
0, pCx->uc.pCursor);
9791497982
pCx->isTable = 1;
9791597983
}
9791697984
}
9791797985
pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
97986
+ assert( p->apCsr[pOp->p1]==pCx );
9791897987
if( rc ){
9791997988
assert( !sqlite3BtreeClosesWithCursor(pCx->ub.pBtx, pCx->uc.pCursor) );
9792097989
sqlite3BtreeClose(pCx->ub.pBtx);
97990
+ p->apCsr[pOp->p1] = 0; /* Not required; helps with static analysis */
9792197991
}else{
9792297992
assert( sqlite3BtreeClosesWithCursor(pCx->ub.pBtx, pCx->uc.pCursor) );
9792397993
}
9792497994
}
9792597995
}
@@ -102594,10 +102664,11 @@
102594102664
}
102595102665
102596102666
102597102667
/************** End of vdbe.c ************************************************/
102598102668
/************** Begin file vdbeblob.c ****************************************/
102669
+#line 1 "tsrc/vdbeblob.c"
102599102670
/*
102600102671
** 2007 May 1
102601102672
**
102602102673
** The author disclaims copyright to this source code. In place of
102603102674
** a legal notice, here is a blessing:
@@ -103117,10 +103188,11 @@
103117103188
103118103189
#endif /* #ifndef SQLITE_OMIT_INCRBLOB */
103119103190
103120103191
/************** End of vdbeblob.c ********************************************/
103121103192
/************** Begin file vdbesort.c ****************************************/
103193
+#line 1 "tsrc/vdbesort.c"
103122103194
/*
103123103195
** 2011-07-09
103124103196
**
103125103197
** The author disclaims copyright to this source code. In place of
103126103198
** a legal notice, here is a blessing:
@@ -105887,10 +105959,11 @@
105887105959
return SQLITE_OK;
105888105960
}
105889105961
105890105962
/************** End of vdbesort.c ********************************************/
105891105963
/************** Begin file vdbevtab.c ****************************************/
105964
+#line 1 "tsrc/vdbevtab.c"
105892105965
/*
105893105966
** 2020-03-23
105894105967
**
105895105968
** The author disclaims copyright to this source code. In place of
105896105969
** a legal notice, here is a blessing:
@@ -106336,10 +106409,11 @@
106336106409
SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3 *db){ return SQLITE_OK; }
106337106410
#endif /* SQLITE_ENABLE_BYTECODE_VTAB */
106338106411
106339106412
/************** End of vdbevtab.c ********************************************/
106340106413
/************** Begin file memjournal.c **************************************/
106414
+#line 1 "tsrc/memjournal.c"
106341106415
/*
106342106416
** 2008 October 7
106343106417
**
106344106418
** The author disclaims copyright to this source code. In place of
106345106419
** a legal notice, here is a blessing:
@@ -106779,10 +106853,11 @@
106779106853
return MAX(pVfs->szOsFile, (int)sizeof(MemJournal));
106780106854
}
106781106855
106782106856
/************** End of memjournal.c ******************************************/
106783106857
/************** Begin file walker.c ******************************************/
106858
+#line 1 "tsrc/walker.c"
106784106859
/*
106785106860
** 2008 August 16
106786106861
**
106787106862
** The author disclaims copyright to this source code. In place of
106788106863
** a legal notice, here is a blessing:
@@ -107043,10 +107118,11 @@
107043107118
return WRC_Continue;
107044107119
}
107045107120
107046107121
/************** End of walker.c **********************************************/
107047107122
/************** Begin file resolve.c *****************************************/
107123
+#line 1 "tsrc/resolve.c"
107048107124
/*
107049107125
** 2008 August 18
107050107126
**
107051107127
** The author disclaims copyright to this source code. In place of
107052107128
** a legal notice, here is a blessing:
@@ -109364,10 +109440,11 @@
109364109440
return rc;
109365109441
}
109366109442
109367109443
/************** End of resolve.c *********************************************/
109368109444
/************** Begin file expr.c ********************************************/
109445
+#line 1 "tsrc/expr.c"
109369109446
/*
109370109447
** 2001 September 15
109371109448
**
109372109449
** The author disclaims copyright to this source code. In place of
109373109450
** a legal notice, here is a blessing:
@@ -116693,10 +116770,11 @@
116693116770
}
116694116771
#endif /* SQLITE_DEBUG */
116695116772
116696116773
/************** End of expr.c ************************************************/
116697116774
/************** Begin file alter.c *******************************************/
116775
+#line 1 "tsrc/alter.c"
116698116776
/*
116699116777
** 2005 February 15
116700116778
**
116701116779
** The author disclaims copyright to this source code. In place of
116702116780
** a legal notice, here is a blessing:
@@ -119012,10 +119090,11 @@
119012119090
}
119013119091
#endif /* SQLITE_ALTER_TABLE */
119014119092
119015119093
/************** End of alter.c ***********************************************/
119016119094
/************** Begin file analyze.c *****************************************/
119095
+#line 1 "tsrc/analyze.c"
119017119096
/*
119018119097
** 2005-07-08
119019119098
**
119020119099
** The author disclaims copyright to this source code. In place of
119021119100
** a legal notice, here is a blessing:
@@ -121036,10 +121115,11 @@
121036121115
121037121116
#endif /* SQLITE_OMIT_ANALYZE */
121038121117
121039121118
/************** End of analyze.c *********************************************/
121040121119
/************** Begin file attach.c ******************************************/
121120
+#line 1 "tsrc/attach.c"
121041121121
/*
121042121122
** 2003 April 6
121043121123
**
121044121124
** The author disclaims copyright to this source code. In place of
121045121125
** a legal notice, here is a blessing:
@@ -121265,19 +121345,10 @@
121265121345
rc = sqlite3Init(db, &zErrDyn);
121266121346
}
121267121347
sqlite3BtreeLeaveAll(db);
121268121348
assert( zErrDyn==0 || rc!=SQLITE_OK );
121269121349
}
121270
-#ifdef SQLITE_USER_AUTHENTICATION
121271
- if( rc==SQLITE_OK && !REOPEN_AS_MEMDB(db) ){
121272
- u8 newAuth = 0;
121273
- rc = sqlite3UserAuthCheckLogin(db, zName, &newAuth);
121274
- if( newAuth<db->auth.authLevel ){
121275
- rc = SQLITE_AUTH_USER;
121276
- }
121277
- }
121278
-#endif
121279121350
if( rc ){
121280121351
if( ALWAYS(!REOPEN_AS_MEMDB(db)) ){
121281121352
int iDb = db->nDb - 1;
121282121353
assert( iDb>=2 );
121283121354
if( db->aDb[iDb].pBt ){
@@ -121657,10 +121728,11 @@
121657121728
}
121658121729
#endif
121659121730
121660121731
/************** End of attach.c **********************************************/
121661121732
/************** Begin file auth.c ********************************************/
121733
+#line 1 "tsrc/auth.c"
121662121734
/*
121663121735
** 2003 January 11
121664121736
**
121665121737
** The author disclaims copyright to this source code. In place of
121666121738
** a legal notice, here is a blessing:
@@ -121771,15 +121843,11 @@
121771121843
sqlite3 *db = pParse->db; /* Database handle */
121772121844
char *zDb = db->aDb[iDb].zDbSName; /* Schema name of attached database */
121773121845
int rc; /* Auth callback return code */
121774121846
121775121847
if( db->init.busy ) return SQLITE_OK;
121776
- rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext
121777
-#ifdef SQLITE_USER_AUTHENTICATION
121778
- ,db->auth.zAuthUser
121779
-#endif
121780
- );
121848
+ rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext);
121781121849
if( rc==SQLITE_DENY ){
121782121850
char *z = sqlite3_mprintf("%s.%s", zTab, zCol);
121783121851
if( db->nDb>2 || iDb!=0 ) z = sqlite3_mprintf("%s.%z", zDb, z);
121784121852
sqlite3ErrorMsg(pParse, "access to %z is prohibited", z);
121785121853
pParse->rc = SQLITE_AUTH;
@@ -121882,15 +121950,11 @@
121882121950
testcase( zArg1==0 );
121883121951
testcase( zArg2==0 );
121884121952
testcase( zArg3==0 );
121885121953
testcase( pParse->zAuthContext==0 );
121886121954
121887
- rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext
121888
-#ifdef SQLITE_USER_AUTHENTICATION
121889
- ,db->auth.zAuthUser
121890
-#endif
121891
- );
121955
+ rc = db->xAuth(db->pAuthArg,code,zArg1,zArg2,zArg3,pParse->zAuthContext);
121892121956
if( rc==SQLITE_DENY ){
121893121957
sqlite3ErrorMsg(pParse, "not authorized");
121894121958
pParse->rc = SQLITE_AUTH;
121895121959
}else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
121896121960
rc = SQLITE_DENY;
@@ -121928,10 +121992,11 @@
121928121992
121929121993
#endif /* SQLITE_OMIT_AUTHORIZATION */
121930121994
121931121995
/************** End of auth.c ************************************************/
121932121996
/************** Begin file build.c *******************************************/
121997
+#line 1 "tsrc/build.c"
121933121998
/*
121934121999
** 2001 September 15
121935122000
**
121936122001
** The author disclaims copyright to this source code. In place of
121937122002
** a legal notice, here is a blessing:
@@ -122119,21 +122184,10 @@
122119122184
sqlite3VdbeJumpHere(v, addrRewind);
122120122185
}
122121122186
}
122122122187
sqlite3VdbeAddOp0(v, OP_Halt);
122123122188
122124
-#if SQLITE_USER_AUTHENTICATION && !defined(SQLITE_OMIT_SHARED_CACHE)
122125
- if( pParse->nTableLock>0 && db->init.busy==0 ){
122126
- sqlite3UserAuthInit(db);
122127
- if( db->auth.authLevel<UAUTH_User ){
122128
- sqlite3ErrorMsg(pParse, "user not authenticated");
122129
- pParse->rc = SQLITE_AUTH_USER;
122130
- return;
122131
- }
122132
- }
122133
-#endif
122134
-
122135122189
/* The cookie mask contains one bit for each database file open.
122136122190
** (Bit 0 is for main, bit 1 is for temp, and so forth.) Bits are
122137122191
** set for each database that is used. Generate code to start a
122138122192
** transaction on each used database and to verify the schema cookie
122139122193
** on each used database.
@@ -122258,20 +122312,10 @@
122258122312
sqlite3DbFree(db, zSql);
122259122313
memcpy(PARSE_TAIL(pParse), saveBuf, PARSE_TAIL_SZ);
122260122314
pParse->nested--;
122261122315
}
122262122316
122263
-#if SQLITE_USER_AUTHENTICATION
122264
-/*
122265
-** Return TRUE if zTable is the name of the system table that stores the
122266
-** list of users and their access credentials.
122267
-*/
122268
-SQLITE_PRIVATE int sqlite3UserAuthTable(const char *zTable){
122269
- return sqlite3_stricmp(zTable, "sqlite_user")==0;
122270
-}
122271
-#endif
122272
-
122273122317
/*
122274122318
** Locate the in-memory structure that describes a particular database
122275122319
** table given the name of that table and (optionally) the name of the
122276122320
** database containing the table. Return NULL if not found.
122277122321
**
@@ -122286,17 +122330,10 @@
122286122330
Table *p = 0;
122287122331
int i;
122288122332
122289122333
/* All mutexes are required for schema access. Make sure we hold them. */
122290122334
assert( zDatabase!=0 || sqlite3BtreeHoldsAllMutexes(db) );
122291
-#if SQLITE_USER_AUTHENTICATION
122292
- /* Only the admin user is allowed to know that the sqlite_user table
122293
- ** exists */
122294
- if( db->auth.authLevel<UAUTH_Admin && sqlite3UserAuthTable(zName)!=0 ){
122295
- return 0;
122296
- }
122297
-#endif
122298122335
if( zDatabase ){
122299122336
for(i=0; i<db->nDb; i++){
122300122337
if( sqlite3StrICmp(zDatabase, db->aDb[i].zDbSName)==0 ) break;
122301122338
}
122302122339
if( i>=db->nDb ){
@@ -125951,13 +125988,10 @@
125951125988
125952125989
assert( pTab!=0 );
125953125990
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0
125954125991
&& db->init.busy==0
125955125992
&& pTblName!=0
125956
-#if SQLITE_USER_AUTHENTICATION
125957
- && sqlite3UserAuthTable(pTab->zName)==0
125958
-#endif
125959125993
){
125960125994
sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName);
125961125995
goto exit_create_index;
125962125996
}
125963125997
#ifndef SQLITE_OMIT_VIEW
@@ -127729,10 +127763,11 @@
127729127763
}
127730127764
#endif /* !defined(SQLITE_OMIT_CTE) */
127731127765
127732127766
/************** End of build.c ***********************************************/
127733127767
/************** Begin file callback.c ****************************************/
127768
+#line 1 "tsrc/callback.c"
127734127769
/*
127735127770
** 2005 May 23
127736127771
**
127737127772
** The author disclaims copyright to this source code. In place of
127738127773
** a legal notice, here is a blessing:
@@ -128272,10 +128307,11 @@
128272128307
return p;
128273128308
}
128274128309
128275128310
/************** End of callback.c ********************************************/
128276128311
/************** Begin file delete.c ******************************************/
128312
+#line 1 "tsrc/delete.c"
128277128313
/*
128278128314
** 2001 September 15
128279128315
**
128280128316
** The author disclaims copyright to this source code. In place of
128281128317
** a legal notice, here is a blessing:
@@ -129305,10 +129341,11 @@
129305129341
}
129306129342
}
129307129343
129308129344
/************** End of delete.c **********************************************/
129309129345
/************** Begin file func.c ********************************************/
129346
+#line 1 "tsrc/func.c"
129310129347
/*
129311129348
** 2002 February 23
129312129349
**
129313129350
** The author disclaims copyright to this source code. In place of
129314129351
** a legal notice, here is a blessing:
@@ -131985,13 +132022,10 @@
131985132022
#endif
131986132023
#ifndef SQLITE_OMIT_LOAD_EXTENSION
131987132024
SFUNCTION(load_extension, 1, 0, 0, loadExt ),
131988132025
SFUNCTION(load_extension, 2, 0, 0, loadExt ),
131989132026
#endif
131990
-#if SQLITE_USER_AUTHENTICATION
131991
- FUNCTION(sqlite_crypt, 2, 0, 0, sqlite3CryptFunc ),
131992
-#endif
131993132027
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
131994132028
DFUNCTION(sqlite_compileoption_used,1, 0, 0, compileoptionusedFunc ),
131995132029
DFUNCTION(sqlite_compileoption_get, 1, 0, 0, compileoptiongetFunc ),
131996132030
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
131997132031
INLINE_FUNC(unlikely, 1, INLINEFUNC_unlikely, SQLITE_FUNC_UNLIKELY),
@@ -132154,10 +132188,11 @@
132154132188
#endif
132155132189
}
132156132190
132157132191
/************** End of func.c ************************************************/
132158132192
/************** Begin file fkey.c ********************************************/
132193
+#line 1 "tsrc/fkey.c"
132159132194
/*
132160132195
**
132161132196
** The author disclaims copyright to this source code. In place of
132162132197
** a legal notice, here is a blessing:
132163132198
**
@@ -133641,10 +133676,11 @@
133641133676
}
133642133677
#endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
133643133678
133644133679
/************** End of fkey.c ************************************************/
133645133680
/************** Begin file insert.c ******************************************/
133681
+#line 1 "tsrc/insert.c"
133646133682
/*
133647133683
** 2001 September 15
133648133684
**
133649133685
** The author disclaims copyright to this source code. In place of
133650133686
** a legal notice, here is a blessing:
@@ -137036,10 +137072,11 @@
137036137072
}
137037137073
#endif /* SQLITE_OMIT_XFER_OPT */
137038137074
137039137075
/************** End of insert.c **********************************************/
137040137076
/************** Begin file legacy.c ******************************************/
137077
+#line 1 "tsrc/legacy.c"
137041137078
/*
137042137079
** 2001 September 15
137043137080
**
137044137081
** The author disclaims copyright to this source code. In place of
137045137082
** a legal notice, here is a blessing:
@@ -137180,10 +137217,11 @@
137180137217
return rc;
137181137218
}
137182137219
137183137220
/************** End of legacy.c **********************************************/
137184137221
/************** Begin file loadext.c *****************************************/
137222
+#line 1 "tsrc/loadext.c"
137185137223
/*
137186137224
** 2006 June 7
137187137225
**
137188137226
** The author disclaims copyright to this source code. In place of
137189137227
** a legal notice, here is a blessing:
@@ -137200,10 +137238,11 @@
137200137238
#ifndef SQLITE_CORE
137201137239
#define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
137202137240
#endif
137203137241
/************** Include sqlite3ext.h in the middle of loadext.c **************/
137204137242
/************** Begin file sqlite3ext.h **************************************/
137243
+#line 1 "tsrc/sqlite3ext.h"
137205137244
/*
137206137245
** 2006 June 7
137207137246
**
137208137247
** The author disclaims copyright to this source code. In place of
137209137248
** a legal notice, here is a blessing:
@@ -137922,10 +137961,11 @@
137922137961
137923137962
#endif /* SQLITE3EXT_H */
137924137963
137925137964
/************** End of sqlite3ext.h ******************************************/
137926137965
/************** Continuing where we left off in loadext.c ********************/
137966
+#line 20 "tsrc/loadext.c"
137927137967
/* #include "sqliteInt.h" */
137928137968
137929137969
#ifndef SQLITE_OMIT_LOAD_EXTENSION
137930137970
/*
137931137971
** Some API routines are omitted when various features are
@@ -138827,10 +138867,11 @@
138827138867
}
138828138868
}
138829138869
138830138870
/************** End of loadext.c *********************************************/
138831138871
/************** Begin file pragma.c ******************************************/
138872
+#line 1 "tsrc/pragma.c"
138832138873
/*
138833138874
** 2003 April 6
138834138875
**
138835138876
** The author disclaims copyright to this source code. In place of
138836138877
** a legal notice, here is a blessing:
@@ -138859,10 +138900,11 @@
138859138900
** lexicographical order to facility a binary search of the pragma name.
138860138901
** Do not edit pragma.h directly. Edit and rerun the script in at
138861138902
** ../tool/mkpragmatab.tcl. */
138862138903
/************** Include pragma.h in the middle of pragma.c *******************/
138863138904
/************** Begin file pragma.h ******************************************/
138905
+#line 1 "tsrc/pragma.h"
138864138906
/* DO NOT EDIT!
138865138907
** This file is automatically generated by the script at
138866138908
** ../tool/mkpragmatab.tcl. To update the set of pragmas, edit
138867138909
** that script and rerun it.
138868138910
*/
@@ -139522,10 +139564,11 @@
139522139564
};
139523139565
/* Number of pragmas: 68 on by default, 78 total. */
139524139566
139525139567
/************** End of pragma.h **********************************************/
139526139568
/************** Continuing where we left off in pragma.c *********************/
139569
+#line 32 "tsrc/pragma.c"
139527139570
139528139571
/*
139529139572
** When the 0x10 bit of PRAGMA optimize is set, any ANALYZE commands
139530139573
** will be run with an analysis_limit set to the lessor of the value of
139531139574
** the following macro or to the actual analysis_limit if it is non-zero,
@@ -140637,16 +140680,10 @@
140637140680
if( db->autoCommit==0 ){
140638140681
/* Foreign key support may not be enabled or disabled while not
140639140682
** in auto-commit mode. */
140640140683
mask &= ~(SQLITE_ForeignKeys);
140641140684
}
140642
-#if SQLITE_USER_AUTHENTICATION
140643
- if( db->auth.authLevel==UAUTH_User ){
140644
- /* Do not allow non-admin users to modify the schema arbitrarily */
140645
- mask &= ~(SQLITE_WriteSchema);
140646
- }
140647
-#endif
140648140685
140649140686
if( sqlite3GetBoolean(zRight, 0) ){
140650140687
if( (mask & SQLITE_WriteSchema)==0
140651140688
|| (db->flags & SQLITE_Defensive)==0
140652140689
){
@@ -142571,10 +142608,11 @@
142571142608
142572142609
#endif /* SQLITE_OMIT_PRAGMA */
142573142610
142574142611
/************** End of pragma.c **********************************************/
142575142612
/************** Begin file prepare.c *****************************************/
142613
+#line 1 "tsrc/prepare.c"
142576142614
/*
142577142615
** 2005 May 25
142578142616
**
142579142617
** The author disclaims copyright to this source code. In place of
142580142618
** a legal notice, here is a blessing:
@@ -142879,18 +142917,11 @@
142879142917
encoding = (u8)meta[BTREE_TEXT_ENCODING-1] & 3;
142880142918
if( encoding==0 ) encoding = SQLITE_UTF8;
142881142919
#else
142882142920
encoding = SQLITE_UTF8;
142883142921
#endif
142884
- if( db->nVdbeActive>0 && encoding!=ENC(db)
142885
- && (db->mDbFlags & DBFLAG_Vacuum)==0
142886
- ){
142887
- rc = SQLITE_LOCKED;
142888
- goto initone_error_out;
142889
- }else{
142890
- sqlite3SetTextEncoding(db, encoding);
142891
- }
142922
+ sqlite3SetTextEncoding(db, encoding);
142892142923
}else{
142893142924
/* If opening an attached database, the encoding much match ENC(db) */
142894142925
if( (meta[BTREE_TEXT_ENCODING-1] & 3)!=ENC(db) ){
142895142926
sqlite3SetString(pzErrMsg, db, "attached databases must use the same"
142896142927
" text encoding as main database");
@@ -143671,10 +143702,11 @@
143671143702
143672143703
#endif /* SQLITE_OMIT_UTF16 */
143673143704
143674143705
/************** End of prepare.c *********************************************/
143675143706
/************** Begin file select.c ******************************************/
143707
+#line 1 "tsrc/select.c"
143676143708
/*
143677143709
** 2001 September 15
143678143710
**
143679143711
** The author disclaims copyright to this source code. In place of
143680143712
** a legal notice, here is a blessing:
@@ -152443,10 +152475,11 @@
152443152475
return rc;
152444152476
}
152445152477
152446152478
/************** End of select.c **********************************************/
152447152479
/************** Begin file table.c *******************************************/
152480
+#line 1 "tsrc/table.c"
152448152481
/*
152449152482
** 2001 September 15
152450152483
**
152451152484
** The author disclaims copyright to this source code. In place of
152452152485
** a legal notice, here is a blessing:
@@ -152644,10 +152677,11 @@
152644152677
152645152678
#endif /* SQLITE_OMIT_GET_TABLE */
152646152679
152647152680
/************** End of table.c ***********************************************/
152648152681
/************** Begin file trigger.c *****************************************/
152682
+#line 1 "tsrc/trigger.c"
152649152683
/*
152650152684
**
152651152685
** The author disclaims copyright to this source code. In place of
152652152686
** a legal notice, here is a blessing:
152653152687
**
@@ -154210,10 +154244,11 @@
154210154244
154211154245
#endif /* !defined(SQLITE_OMIT_TRIGGER) */
154212154246
154213154247
/************** End of trigger.c *********************************************/
154214154248
/************** Begin file update.c ******************************************/
154249
+#line 1 "tsrc/update.c"
154215154250
/*
154216154251
** 2001 September 15
154217154252
**
154218154253
** The author disclaims copyright to this source code. In place of
154219154254
** a legal notice, here is a blessing:
@@ -155581,10 +155616,11 @@
155581155616
}
155582155617
#endif /* SQLITE_OMIT_VIRTUALTABLE */
155583155618
155584155619
/************** End of update.c **********************************************/
155585155620
/************** Begin file upsert.c ******************************************/
155621
+#line 1 "tsrc/upsert.c"
155586155622
/*
155587155623
** 2018-04-12
155588155624
**
155589155625
** The author disclaims copyright to this source code. In place of
155590155626
** a legal notice, here is a blessing:
@@ -155913,10 +155949,11 @@
155913155949
155914155950
#endif /* SQLITE_OMIT_UPSERT */
155915155951
155916155952
/************** End of upsert.c **********************************************/
155917155953
/************** Begin file vacuum.c ******************************************/
155954
+#line 1 "tsrc/vacuum.c"
155918155955
/*
155919155956
** 2003 April 6
155920155957
**
155921155958
** The author disclaims copyright to this source code. In place of
155922155959
** a legal notice, here is a blessing:
@@ -156334,10 +156371,11 @@
156334156371
156335156372
#endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
156336156373
156337156374
/************** End of vacuum.c **********************************************/
156338156375
/************** Begin file vtab.c ********************************************/
156376
+#line 1 "tsrc/vtab.c"
156339156377
/*
156340156378
** 2006 June 10
156341156379
**
156342156380
** The author disclaims copyright to this source code. In place of
156343156381
** a legal notice, here is a blessing:
@@ -157711,10 +157749,11 @@
157711157749
157712157750
#endif /* SQLITE_OMIT_VIRTUALTABLE */
157713157751
157714157752
/************** End of vtab.c ************************************************/
157715157753
/************** Begin file wherecode.c ***************************************/
157754
+#line 1 "tsrc/wherecode.c"
157716157755
/*
157717157756
** 2015-06-06
157718157757
**
157719157758
** The author disclaims copyright to this source code. In place of
157720157759
** a legal notice, here is a blessing:
@@ -157733,10 +157772,11 @@
157733157772
** file retains the code that does query planning and analysis.
157734157773
*/
157735157774
/* #include "sqliteInt.h" */
157736157775
/************** Include whereInt.h in the middle of wherecode.c **************/
157737157776
/************** Begin file whereInt.h ****************************************/
157777
+#line 1 "tsrc/whereInt.h"
157738157778
/*
157739157779
** 2013-11-12
157740157780
**
157741157781
** The author disclaims copyright to this source code. In place of
157742157782
** a legal notice, here is a blessing:
@@ -158268,13 +158308,21 @@
158268158308
SQLITE_PRIVATE int sqlite3WhereExplainBloomFilter(
158269158309
const Parse *pParse, /* Parse context */
158270158310
const WhereInfo *pWInfo, /* WHERE clause */
158271158311
const WhereLevel *pLevel /* Bloom filter on this level */
158272158312
);
158313
+SQLITE_PRIVATE void sqlite3WhereAddExplainText(
158314
+ Parse *pParse, /* Parse context */
158315
+ int addr,
158316
+ SrcList *pTabList, /* Table list this loop refers to */
158317
+ WhereLevel *pLevel, /* Scan to write OP_Explain opcode for */
158318
+ u16 wctrlFlags /* Flags passed to sqlite3WhereBegin() */
158319
+);
158273158320
#else
158274158321
# define sqlite3WhereExplainOneScan(u,v,w,x) 0
158275158322
# define sqlite3WhereExplainBloomFilter(u,v,w) 0
158323
+# define sqlite3WhereAddExplainText(u,v,w,x,y)
158276158324
#endif /* SQLITE_OMIT_EXPLAIN */
158277158325
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
158278158326
SQLITE_PRIVATE void sqlite3WhereAddScanStatus(
158279158327
Vdbe *v, /* Vdbe to add scanstatus entry to */
158280158328
SrcList *pSrclist, /* FROM clause pLvl reads data from */
@@ -158381,10 +158429,11 @@
158381158429
158382158430
#endif /* !defined(SQLITE_WHEREINT_H) */
158383158431
158384158432
/************** End of whereInt.h ********************************************/
158385158433
/************** Continuing where we left off in wherecode.c ******************/
158434
+#line 22 "tsrc/wherecode.c"
158386158435
158387158436
#ifndef SQLITE_OMIT_EXPLAIN
158388158437
158389158438
/*
158390158439
** Return the name of the i-th column of the pIdx index.
@@ -158472,42 +158521,42 @@
158472158521
}
158473158522
sqlite3_str_append(pStr, ")", 1);
158474158523
}
158475158524
158476158525
/*
158477
-** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
158478
-** command, or if stmt_scanstatus_v2() stats are enabled, or if SQLITE_DEBUG
158479
-** was defined at compile-time. If it is not a no-op, a single OP_Explain
158480
-** opcode is added to the output to describe the table scan strategy in pLevel.
158481
-**
158482
-** If an OP_Explain opcode is added to the VM, its address is returned.
158483
-** Otherwise, if no OP_Explain is coded, zero is returned.
158526
+** This function sets the P4 value of an existing OP_Explain opcode to
158527
+** text describing the loop in pLevel. If the OP_Explain opcode already has
158528
+** a P4 value, it is freed before it is overwritten.
158484158529
*/
158485
-SQLITE_PRIVATE int sqlite3WhereExplainOneScan(
158530
+SQLITE_PRIVATE void sqlite3WhereAddExplainText(
158486158531
Parse *pParse, /* Parse context */
158532
+ int addr, /* Address of OP_Explain opcode */
158487158533
SrcList *pTabList, /* Table list this loop refers to */
158488158534
WhereLevel *pLevel, /* Scan to write OP_Explain opcode for */
158489158535
u16 wctrlFlags /* Flags passed to sqlite3WhereBegin() */
158490158536
){
158491
- int ret = 0;
158492158537
#if !defined(SQLITE_DEBUG)
158493158538
if( sqlite3ParseToplevel(pParse)->explain==2 || IS_STMT_SCANSTATUS(pParse->db) )
158494158539
#endif
158495158540
{
158541
+ VdbeOp *pOp = sqlite3VdbeGetOp(pParse->pVdbe, addr);
158542
+
158496158543
SrcItem *pItem = &pTabList->a[pLevel->iFrom];
158497
- Vdbe *v = pParse->pVdbe; /* VM being constructed */
158498158544
sqlite3 *db = pParse->db; /* Database handle */
158499158545
int isSearch; /* True for a SEARCH. False for SCAN. */
158500158546
WhereLoop *pLoop; /* The controlling WhereLoop object */
158501158547
u32 flags; /* Flags that describe this loop */
158548
+#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_EXPLAIN)
158502158549
char *zMsg; /* Text to add to EQP output */
158550
+#endif
158503158551
StrAccum str; /* EQP output string */
158504158552
char zBuf[100]; /* Initial space for EQP output string */
158505158553
158554
+ if( db->mallocFailed ) return;
158555
+
158506158556
pLoop = pLevel->pWLoop;
158507158557
flags = pLoop->wsFlags;
158508
- if( (flags&WHERE_MULTI_OR) || (wctrlFlags&WHERE_OR_SUBCLAUSE) ) return 0;
158509158558
158510158559
isSearch = (flags&(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0
158511158560
|| ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0))
158512158561
|| (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX));
158513158562
@@ -158527,11 +158576,11 @@
158527158576
}
158528158577
}else if( flags & WHERE_PARTIALIDX ){
158529158578
zFmt = "AUTOMATIC PARTIAL COVERING INDEX";
158530158579
}else if( flags & WHERE_AUTO_INDEX ){
158531158580
zFmt = "AUTOMATIC COVERING INDEX";
158532
- }else if( flags & WHERE_IDX_ONLY ){
158581
+ }else if( flags & (WHERE_IDX_ONLY|WHERE_EXPRIDX) ){
158533158582
zFmt = "COVERING INDEX %s";
158534158583
}else{
158535158584
zFmt = "INDEX %s";
158536158585
}
158537158586
if( zFmt ){
@@ -158579,15 +158628,54 @@
158579158628
sqlite3LogEstToInt(pLoop->nOut));
158580158629
}else{
158581158630
sqlite3_str_append(&str, " (~1 row)", 9);
158582158631
}
158583158632
#endif
158633
+#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_EXPLAIN)
158584158634
zMsg = sqlite3StrAccumFinish(&str);
158585158635
sqlite3ExplainBreakpoint("",zMsg);
158586
- ret = sqlite3VdbeAddOp4(v, OP_Explain, sqlite3VdbeCurrentAddr(v),
158587
- pParse->addrExplain, pLoop->rRun,
158588
- zMsg, P4_DYNAMIC);
158636
+#endif
158637
+
158638
+ assert( pOp->opcode==OP_Explain );
158639
+ assert( pOp->p4type==P4_DYNAMIC || pOp->p4.z==0 );
158640
+ sqlite3DbFree(db, pOp->p4.z);
158641
+ pOp->p4type = P4_DYNAMIC;
158642
+ pOp->p4.z = sqlite3StrAccumFinish(&str);
158643
+ }
158644
+}
158645
+
158646
+
158647
+/*
158648
+** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
158649
+** command, or if stmt_scanstatus_v2() stats are enabled, or if SQLITE_DEBUG
158650
+** was defined at compile-time. If it is not a no-op, a single OP_Explain
158651
+** opcode is added to the output to describe the table scan strategy in pLevel.
158652
+**
158653
+** If an OP_Explain opcode is added to the VM, its address is returned.
158654
+** Otherwise, if no OP_Explain is coded, zero is returned.
158655
+*/
158656
+SQLITE_PRIVATE int sqlite3WhereExplainOneScan(
158657
+ Parse *pParse, /* Parse context */
158658
+ SrcList *pTabList, /* Table list this loop refers to */
158659
+ WhereLevel *pLevel, /* Scan to write OP_Explain opcode for */
158660
+ u16 wctrlFlags /* Flags passed to sqlite3WhereBegin() */
158661
+){
158662
+ int ret = 0;
158663
+#if !defined(SQLITE_DEBUG)
158664
+ if( sqlite3ParseToplevel(pParse)->explain==2 || IS_STMT_SCANSTATUS(pParse->db) )
158665
+#endif
158666
+ {
158667
+ if( (pLevel->pWLoop->wsFlags & WHERE_MULTI_OR)==0
158668
+ && (wctrlFlags & WHERE_OR_SUBCLAUSE)==0
158669
+ ){
158670
+ Vdbe *v = pParse->pVdbe;
158671
+ int addr = sqlite3VdbeCurrentAddr(v);
158672
+ ret = sqlite3VdbeAddOp3(
158673
+ v, OP_Explain, addr, pParse->addrExplain, pLevel->pWLoop->rRun
158674
+ );
158675
+ sqlite3WhereAddExplainText(pParse, addr, pTabList, pLevel, wctrlFlags);
158676
+ }
158589158677
}
158590158678
return ret;
158591158679
}
158592158680
158593158681
/*
@@ -158682,13 +158770,14 @@
158682158770
if( wsFlags & WHERE_INDEXED ){
158683158771
sqlite3VdbeScanStatusRange(v, addrExplain, -1, pLvl->iIdxCur);
158684158772
}
158685158773
}else{
158686158774
int addr;
158775
+ VdbeOp *pOp;
158687158776
assert( pSrclist->a[pLvl->iFrom].fg.isSubquery );
158688158777
addr = pSrclist->a[pLvl->iFrom].u4.pSubq->addrFillSub;
158689
- VdbeOp *pOp = sqlite3VdbeGetOp(v, addr-1);
158778
+ pOp = sqlite3VdbeGetOp(v, addr-1);
158690158779
assert( sqlite3VdbeDb(v)->mallocFailed || pOp->opcode==OP_InitCoroutine );
158691158780
assert( sqlite3VdbeDb(v)->mallocFailed || pOp->p2>addr );
158692158781
sqlite3VdbeScanStatusRange(v, addrExplain, addr, pOp->p2-1);
158693158782
}
158694158783
}
@@ -161263,10 +161352,11 @@
161263161352
pParse->withinRJSubrtn--;
161264161353
}
161265161354
161266161355
/************** End of wherecode.c *******************************************/
161267161356
/************** Begin file whereexpr.c ***************************************/
161357
+#line 1 "tsrc/whereexpr.c"
161268161358
/*
161269161359
** 2015-06-08
161270161360
**
161271161361
** The author disclaims copyright to this source code. In place of
161272161362
** a legal notice, here is a blessing:
@@ -163168,10 +163258,11 @@
163168163258
}
163169163259
}
163170163260
163171163261
/************** End of whereexpr.c *******************************************/
163172163262
/************** Begin file where.c *******************************************/
163263
+#line 1 "tsrc/where.c"
163173163264
/*
163174163265
** 2001 September 15
163175163266
**
163176163267
** The author disclaims copyright to this source code. In place of
163177163268
** a legal notice, here is a blessing:
@@ -170611,18 +170702,32 @@
170611170702
x = sqlite3TableColumnToIndex(pIdx, x);
170612170703
if( x>=0 ){
170613170704
pOp->p2 = x;
170614170705
pOp->p1 = pLevel->iIdxCur;
170615170706
OpcodeRewriteTrace(db, k, pOp);
170616
- }else{
170617
- /* Unable to translate the table reference into an index
170618
- ** reference. Verify that this is harmless - that the
170619
- ** table being referenced really is open.
170620
- */
170707
+ }else if( pLoop->wsFlags & (WHERE_IDX_ONLY|WHERE_EXPRIDX) ){
170621170708
if( pLoop->wsFlags & WHERE_IDX_ONLY ){
170709
+ /* An error. pLoop is supposed to be a covering index loop,
170710
+ ** and yet the VM code refers to a column of the table that
170711
+ ** is not part of the index. */
170622170712
sqlite3ErrorMsg(pParse, "internal query planner error");
170623170713
pParse->rc = SQLITE_INTERNAL;
170714
+ }else{
170715
+ /* The WHERE_EXPRIDX flag is set by the planner when it is likely
170716
+ ** that pLoop is a covering index loop, but it is not possible
170717
+ ** to be 100% sure. In this case, any OP_Explain opcode
170718
+ ** corresponding to this loop describes the index as a "COVERING
170719
+ ** INDEX". But, pOp proves that pLoop is not actually a covering
170720
+ ** index loop. So clear the WHERE_EXPRIDX flag and rewrite the
170721
+ ** text that accompanies the OP_Explain opcode, if any. */
170722
+ pLoop->wsFlags &= ~WHERE_EXPRIDX;
170723
+ sqlite3WhereAddExplainText(pParse,
170724
+ pLevel->addrBody-1,
170725
+ pTabList,
170726
+ pLevel,
170727
+ pWInfo->wctrlFlags
170728
+ );
170624170729
}
170625170730
}
170626170731
}else if( pOp->opcode==OP_Rowid ){
170627170732
pOp->p1 = pLevel->iIdxCur;
170628170733
pOp->opcode = OP_IdxRowid;
@@ -170654,10 +170759,11 @@
170654170759
return;
170655170760
}
170656170761
170657170762
/************** End of where.c ***********************************************/
170658170763
/************** Begin file window.c ******************************************/
170764
+#line 1 "tsrc/window.c"
170659170765
/*
170660170766
** 2018 May 08
170661170767
**
170662170768
** The author disclaims copyright to this source code. In place of
170663170769
** a legal notice, here is a blessing:
@@ -173763,10 +173869,11 @@
173763173869
173764173870
#endif /* SQLITE_OMIT_WINDOWFUNC */
173765173871
173766173872
/************** End of window.c **********************************************/
173767173873
/************** Begin file parse.c *******************************************/
173874
+#line 1 "tsrc/parse.c"
173768173875
/* This file is automatically generated by Lemon from input grammar
173769173876
** source file "parse.y".
173770173877
*/
173771173878
/*
173772173879
** 2001-09-15
@@ -173786,10 +173893,11 @@
173786173893
** That input file is processed by Lemon to generate a C-language
173787173894
** implementation of a parser for the given grammar. You might be reading
173788173895
** this comment as part of the translated C-code. Edits should be made
173789173896
** to the original parse.y sources.
173790173897
*/
173898
+#line 62 "parse.y"
173791173899
173792173900
/* #include "sqliteInt.h" */
173793173901
173794173902
/*
173795173903
** Disable all error recovery processing in the parser push-down
@@ -173869,10 +173977,11 @@
173869173977
sqlite3ExprListDelete(pParse->db, pOrderBy);
173870173978
sqlite3ExprDelete(pParse->db, pLimit);
173871173979
}
173872173980
#endif /* SQLITE_ENABLE_UPDATE_DELETE_LIMIT */
173873173981
173982
+#line 517 "parse.y"
173874173983
173875173984
/*
173876173985
** For a compound SELECT statement, make sure p->pPrior->pNext==p for
173877173986
** all elements in the list. And make sure list length does not exceed
173878173987
** SQLITE_LIMIT_COMPOUND_SELECT.
@@ -173923,10 +174032,11 @@
173923174032
** testing.
173924174033
*/
173925174034
static void *parserStackRealloc(void *pOld, sqlite3_uint64 newSize){
173926174035
return sqlite3FaultSim(700) ? 0 : sqlite3_realloc(pOld, newSize);
173927174036
}
174037
+#line 1085 "parse.y"
173928174038
173929174039
173930174040
/* Construct a new Expr object from a single token */
173931174041
static Expr *tokenExpr(Parse *pParse, int op, Token t){
173932174042
Expr *p = sqlite3DbMallocRawNN(pParse->db, sizeof(Expr)+t.n+1);
@@ -173959,10 +174069,11 @@
173959174069
}
173960174070
}
173961174071
return p;
173962174072
}
173963174073
174074
+#line 1329 "parse.y"
173964174075
173965174076
/* A routine to convert a binary TK_IS or TK_ISNOT expression into a
173966174077
** unary TK_ISNULL or TK_NOTNULL expression. */
173967174078
static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
173968174079
sqlite3 *db = pParse->db;
@@ -173970,10 +174081,11 @@
173970174081
pA->op = (u8)op;
173971174082
sqlite3ExprDelete(db, pA->pRight);
173972174083
pA->pRight = 0;
173973174084
}
173974174085
}
174086
+#line 1564 "parse.y"
173975174087
173976174088
/* Add a single new term to an ExprList that is used to store a
173977174089
** list of identifiers. Report an error if the ID list contains
173978174090
** a COLLATE clause or an ASC or DESC keyword, except ignore the
173979174091
** error while parsing a legacy schema.
@@ -173993,14 +174105,16 @@
173993174105
pIdToken->n, pIdToken->z);
173994174106
}
173995174107
sqlite3ExprListSetName(pParse, p, pIdToken, 1);
173996174108
return p;
173997174109
}
174110
+#line 2048 "parse.y"
173998174111
173999174112
#if TK_SPAN>255
174000174113
# error too many tokens in the grammar
174001174114
#endif
174115
+#line 267 "parse.sql"
174002174116
/**************** End of %include directives **********************************/
174003174117
/* These constants specify the various numeric values for terminal symbols.
174004174118
***************** Begin token definitions *************************************/
174005174119
#ifndef TK_SEMI
174006174120
#define TK_SEMI 1
@@ -176181,11 +176295,13 @@
176181176295
case 240: /* selectnowith */
176182176296
case 241: /* oneselect */
176183176297
case 253: /* values */
176184176298
case 255: /* mvalues */
176185176299
{
176300
+#line 511 "parse.y"
176186176301
sqlite3SelectDelete(pParse->db, (yypminor->yy555));
176302
+#line 2453 "parse.sql"
176187176303
}
176188176304
break;
176189176305
case 217: /* term */
176190176306
case 218: /* expr */
176191176307
case 247: /* where_opt */
@@ -176196,11 +176312,13 @@
176196176312
case 285: /* vinto */
176197176313
case 292: /* when_clause */
176198176314
case 297: /* key_opt */
176199176315
case 314: /* filter_clause */
176200176316
{
176317
+#line 1083 "parse.y"
176201176318
sqlite3ExprDelete(pParse->db, (yypminor->yy454));
176319
+#line 2470 "parse.sql"
176202176320
}
176203176321
break;
176204176322
case 222: /* eidlist_opt */
176205176323
case 232: /* sortlist */
176206176324
case 233: /* eidlist */
@@ -176213,64 +176331,82 @@
176213176331
case 270: /* setlist */
176214176332
case 279: /* paren_exprlist */
176215176333
case 281: /* case_exprlist */
176216176334
case 313: /* part_opt */
176217176335
{
176336
+#line 1562 "parse.y"
176218176337
sqlite3ExprListDelete(pParse->db, (yypminor->yy14));
176338
+#line 2489 "parse.sql"
176219176339
}
176220176340
break;
176221176341
case 239: /* fullname */
176222176342
case 246: /* from */
176223176343
case 258: /* seltablist */
176224176344
case 259: /* stl_prefix */
176225176345
case 264: /* xfullname */
176226176346
{
176347
+#line 789 "parse.y"
176227176348
sqlite3SrcListDelete(pParse->db, (yypminor->yy203));
176349
+#line 2500 "parse.sql"
176228176350
}
176229176351
break;
176230176352
case 242: /* wqlist */
176231176353
{
176354
+#line 1849 "parse.y"
176232176355
sqlite3WithDelete(pParse->db, (yypminor->yy59));
176356
+#line 2507 "parse.sql"
176233176357
}
176234176358
break;
176235176359
case 252: /* window_clause */
176236176360
case 309: /* windowdefn_list */
176237176361
{
176362
+#line 1977 "parse.y"
176238176363
sqlite3WindowListDelete(pParse->db, (yypminor->yy211));
176364
+#line 2515 "parse.sql"
176239176365
}
176240176366
break;
176241176367
case 265: /* idlist */
176242176368
case 272: /* idlist_opt */
176243176369
{
176370
+#line 1068 "parse.y"
176244176371
sqlite3IdListDelete(pParse->db, (yypminor->yy132));
176372
+#line 2523 "parse.sql"
176245176373
}
176246176374
break;
176247176375
case 275: /* filter_over */
176248176376
case 310: /* windowdefn */
176249176377
case 311: /* window */
176250176378
case 312: /* frame_opt */
176251176379
case 315: /* over_clause */
176252176380
{
176381
+#line 1916 "parse.y"
176253176382
sqlite3WindowDelete(pParse->db, (yypminor->yy211));
176383
+#line 2534 "parse.sql"
176254176384
}
176255176385
break;
176256176386
case 288: /* trigger_cmd_list */
176257176387
case 293: /* trigger_cmd */
176258176388
{
176389
+#line 1677 "parse.y"
176259176390
sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy427));
176391
+#line 2542 "parse.sql"
176260176392
}
176261176393
break;
176262176394
case 290: /* trigger_event */
176263176395
{
176396
+#line 1663 "parse.y"
176264176397
sqlite3IdListDelete(pParse->db, (yypminor->yy286).b);
176398
+#line 2549 "parse.sql"
176265176399
}
176266176400
break;
176267176401
case 317: /* frame_bound */
176268176402
case 318: /* frame_bound_s */
176269176403
case 319: /* frame_bound_e */
176270176404
{
176405
+#line 1921 "parse.y"
176271176406
sqlite3ExprDelete(pParse->db, (yypminor->yy509).pExpr);
176407
+#line 2558 "parse.sql"
176272176408
}
176273176409
break;
176274176410
/********* End destructor definitions *****************************************/
176275176411
default: break; /* If no destructor action specified: do nothing */
176276176412
}
@@ -176501,12 +176637,14 @@
176501176637
#endif
176502176638
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
176503176639
/* Here code is inserted which will execute if the parser
176504176640
** stack every overflows */
176505176641
/******** Begin %stack_overflow code ******************************************/
176642
+#line 51 "parse.y"
176506176643
176507176644
sqlite3OomFault(pParse->db);
176645
+#line 2796 "parse.sql"
176508176646
/******** End %stack_overflow code ********************************************/
176509176647
sqlite3ParserARG_STORE /* Suppress warning about unused %extra_argument var */
176510176648
sqlite3ParserCTX_STORE
176511176649
}
176512176650
@@ -177433,326 +177571,481 @@
177433177571
** break;
177434177572
*/
177435177573
/********** Begin reduce actions **********************************************/
177436177574
YYMINORTYPE yylhsminor;
177437177575
case 0: /* explain ::= EXPLAIN */
177576
+#line 155 "parse.y"
177438177577
{ if( pParse->pReprepare==0 ) pParse->explain = 1; }
177578
+#line 3729 "parse.sql"
177439177579
break;
177440177580
case 1: /* explain ::= EXPLAIN QUERY PLAN */
177581
+#line 156 "parse.y"
177441177582
{ if( pParse->pReprepare==0 ) pParse->explain = 2; }
177583
+#line 3734 "parse.sql"
177442177584
break;
177443177585
case 2: /* cmdx ::= cmd */
177586
+#line 158 "parse.y"
177444177587
{ sqlite3FinishCoding(pParse); }
177588
+#line 3739 "parse.sql"
177445177589
break;
177446177590
case 3: /* cmd ::= BEGIN transtype trans_opt */
177591
+#line 163 "parse.y"
177447177592
{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy144);}
177593
+#line 3744 "parse.sql"
177448177594
break;
177449177595
case 4: /* transtype ::= */
177596
+#line 168 "parse.y"
177450177597
{yymsp[1].minor.yy144 = TK_DEFERRED;}
177598
+#line 3749 "parse.sql"
177451177599
break;
177452177600
case 5: /* transtype ::= DEFERRED */
177453177601
case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
177454177602
case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
177455177603
case 324: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==324);
177604
+#line 169 "parse.y"
177456177605
{yymsp[0].minor.yy144 = yymsp[0].major; /*A-overwrites-X*/}
177606
+#line 3757 "parse.sql"
177457177607
break;
177458177608
case 8: /* cmd ::= COMMIT|END trans_opt */
177459177609
case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
177610
+#line 172 "parse.y"
177460177611
{sqlite3EndTransaction(pParse,yymsp[-1].major);}
177612
+#line 3763 "parse.sql"
177461177613
break;
177462177614
case 10: /* cmd ::= SAVEPOINT nm */
177615
+#line 177 "parse.y"
177463177616
{
177464177617
sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
177465177618
}
177619
+#line 3770 "parse.sql"
177466177620
break;
177467177621
case 11: /* cmd ::= RELEASE savepoint_opt nm */
177622
+#line 180 "parse.y"
177468177623
{
177469177624
sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
177470177625
}
177626
+#line 3777 "parse.sql"
177471177627
break;
177472177628
case 12: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
177629
+#line 183 "parse.y"
177473177630
{
177474177631
sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
177475177632
}
177633
+#line 3784 "parse.sql"
177476177634
break;
177477177635
case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
177636
+#line 190 "parse.y"
177478177637
{
177479177638
sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy144,0,0,yymsp[-2].minor.yy144);
177480177639
}
177640
+#line 3791 "parse.sql"
177481177641
break;
177482177642
case 14: /* createkw ::= CREATE */
177643
+#line 193 "parse.y"
177483177644
{disableLookaside(pParse);}
177645
+#line 3796 "parse.sql"
177484177646
break;
177485177647
case 15: /* ifnotexists ::= */
177486177648
case 18: /* temp ::= */ yytestcase(yyruleno==18);
177487177649
case 47: /* autoinc ::= */ yytestcase(yyruleno==47);
177488177650
case 62: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==62);
177489177651
case 72: /* defer_subclause_opt ::= */ yytestcase(yyruleno==72);
177490177652
case 81: /* ifexists ::= */ yytestcase(yyruleno==81);
177491177653
case 100: /* distinct ::= */ yytestcase(yyruleno==100);
177492177654
case 246: /* collate ::= */ yytestcase(yyruleno==246);
177655
+#line 196 "parse.y"
177493177656
{yymsp[1].minor.yy144 = 0;}
177657
+#line 3808 "parse.sql"
177494177658
break;
177495177659
case 16: /* ifnotexists ::= IF NOT EXISTS */
177660
+#line 197 "parse.y"
177496177661
{yymsp[-2].minor.yy144 = 1;}
177662
+#line 3813 "parse.sql"
177497177663
break;
177498177664
case 17: /* temp ::= TEMP */
177665
+#line 200 "parse.y"
177499177666
{yymsp[0].minor.yy144 = pParse->db->init.busy==0;}
177667
+#line 3818 "parse.sql"
177500177668
break;
177501177669
case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_option_set */
177670
+#line 203 "parse.y"
177502177671
{
177503177672
sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy391,0);
177504177673
}
177674
+#line 3825 "parse.sql"
177505177675
break;
177506177676
case 20: /* create_table_args ::= AS select */
177677
+#line 206 "parse.y"
177507177678
{
177508177679
sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy555);
177509177680
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy555);
177510177681
}
177682
+#line 3833 "parse.sql"
177511177683
break;
177512177684
case 21: /* table_option_set ::= */
177685
+#line 212 "parse.y"
177513177686
{yymsp[1].minor.yy391 = 0;}
177687
+#line 3838 "parse.sql"
177514177688
break;
177515177689
case 22: /* table_option_set ::= table_option_set COMMA table_option */
177690
+#line 214 "parse.y"
177516177691
{yylhsminor.yy391 = yymsp[-2].minor.yy391|yymsp[0].minor.yy391;}
177692
+#line 3843 "parse.sql"
177517177693
yymsp[-2].minor.yy391 = yylhsminor.yy391;
177518177694
break;
177519177695
case 23: /* table_option ::= WITHOUT nm */
177696
+#line 215 "parse.y"
177520177697
{
177521177698
if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
177522177699
yymsp[-1].minor.yy391 = TF_WithoutRowid | TF_NoVisibleRowid;
177523177700
}else{
177524177701
yymsp[-1].minor.yy391 = 0;
177525177702
sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
177526177703
}
177527177704
}
177705
+#line 3856 "parse.sql"
177528177706
break;
177529177707
case 24: /* table_option ::= nm */
177708
+#line 223 "parse.y"
177530177709
{
177531177710
if( yymsp[0].minor.yy0.n==6 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"strict",6)==0 ){
177532177711
yylhsminor.yy391 = TF_Strict;
177533177712
}else{
177534177713
yylhsminor.yy391 = 0;
177535177714
sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
177536177715
}
177537177716
}
177717
+#line 3868 "parse.sql"
177538177718
yymsp[0].minor.yy391 = yylhsminor.yy391;
177539177719
break;
177540177720
case 25: /* columnname ::= nm typetoken */
177721
+#line 233 "parse.y"
177541177722
{sqlite3AddColumn(pParse,yymsp[-1].minor.yy0,yymsp[0].minor.yy0);}
177723
+#line 3874 "parse.sql"
177542177724
break;
177543177725
case 26: /* typetoken ::= */
177544177726
case 65: /* conslist_opt ::= */ yytestcase(yyruleno==65);
177545177727
case 106: /* as ::= */ yytestcase(yyruleno==106);
177728
+#line 327 "parse.y"
177546177729
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = 0;}
177730
+#line 3881 "parse.sql"
177547177731
break;
177548177732
case 27: /* typetoken ::= typename LP signed RP */
177733
+#line 329 "parse.y"
177549177734
{
177550177735
yymsp[-3].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
177551177736
}
177737
+#line 3888 "parse.sql"
177552177738
break;
177553177739
case 28: /* typetoken ::= typename LP signed COMMA signed RP */
177740
+#line 332 "parse.y"
177554177741
{
177555177742
yymsp[-5].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
177556177743
}
177744
+#line 3895 "parse.sql"
177557177745
break;
177558177746
case 29: /* typename ::= typename ID|STRING */
177747
+#line 337 "parse.y"
177559177748
{yymsp[-1].minor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
177749
+#line 3900 "parse.sql"
177560177750
break;
177561177751
case 30: /* scanpt ::= */
177752
+#line 355 "parse.y"
177562177753
{
177563177754
assert( yyLookahead!=YYNOCODE );
177564177755
yymsp[1].minor.yy168 = yyLookaheadToken.z;
177565177756
}
177757
+#line 3908 "parse.sql"
177566177758
break;
177567177759
case 31: /* scantok ::= */
177760
+#line 359 "parse.y"
177568177761
{
177569177762
assert( yyLookahead!=YYNOCODE );
177570177763
yymsp[1].minor.yy0 = yyLookaheadToken;
177571177764
}
177765
+#line 3916 "parse.sql"
177572177766
break;
177573177767
case 32: /* ccons ::= CONSTRAINT nm */
177574177768
case 67: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==67);
177769
+#line 369 "parse.y"
177575177770
{pParse->constraintName = yymsp[0].minor.yy0;}
177771
+#line 3922 "parse.sql"
177576177772
break;
177577177773
case 33: /* ccons ::= DEFAULT scantok term */
177774
+#line 371 "parse.y"
177578177775
{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy454,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
177776
+#line 3927 "parse.sql"
177579177777
break;
177580177778
case 34: /* ccons ::= DEFAULT LP expr RP */
177779
+#line 373 "parse.y"
177581177780
{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy454,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
177781
+#line 3932 "parse.sql"
177582177782
break;
177583177783
case 35: /* ccons ::= DEFAULT PLUS scantok term */
177784
+#line 375 "parse.y"
177584177785
{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy454,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
177786
+#line 3937 "parse.sql"
177585177787
break;
177586177788
case 36: /* ccons ::= DEFAULT MINUS scantok term */
177789
+#line 376 "parse.y"
177587177790
{
177588177791
Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy454, 0);
177589177792
sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);
177590177793
}
177794
+#line 3945 "parse.sql"
177591177795
break;
177592177796
case 37: /* ccons ::= DEFAULT scantok ID|INDEXED */
177797
+#line 380 "parse.y"
177593177798
{
177594177799
Expr *p = tokenExpr(pParse, TK_STRING, yymsp[0].minor.yy0);
177595177800
if( p ){
177596177801
sqlite3ExprIdToTrueFalse(p);
177597177802
testcase( p->op==TK_TRUEFALSE && sqlite3ExprTruthValue(p) );
177598177803
}
177599177804
sqlite3AddDefaultValue(pParse,p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.z+yymsp[0].minor.yy0.n);
177600177805
}
177806
+#line 3957 "parse.sql"
177601177807
break;
177602177808
case 38: /* ccons ::= NOT NULL onconf */
177809
+#line 393 "parse.y"
177603177810
{sqlite3AddNotNull(pParse, yymsp[0].minor.yy144);}
177811
+#line 3962 "parse.sql"
177604177812
break;
177605177813
case 39: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
177814
+#line 395 "parse.y"
177606177815
{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy144,yymsp[0].minor.yy144,yymsp[-2].minor.yy144);}
177816
+#line 3967 "parse.sql"
177607177817
break;
177608177818
case 40: /* ccons ::= UNIQUE onconf */
177819
+#line 396 "parse.y"
177609177820
{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy144,0,0,0,0,
177610177821
SQLITE_IDXTYPE_UNIQUE);}
177822
+#line 3973 "parse.sql"
177611177823
break;
177612177824
case 41: /* ccons ::= CHECK LP expr RP */
177825
+#line 398 "parse.y"
177613177826
{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy454,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
177827
+#line 3978 "parse.sql"
177614177828
break;
177615177829
case 42: /* ccons ::= REFERENCES nm eidlist_opt refargs */
177830
+#line 400 "parse.y"
177616177831
{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy14,yymsp[0].minor.yy144);}
177832
+#line 3983 "parse.sql"
177617177833
break;
177618177834
case 43: /* ccons ::= defer_subclause */
177835
+#line 401 "parse.y"
177619177836
{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy144);}
177837
+#line 3988 "parse.sql"
177620177838
break;
177621177839
case 44: /* ccons ::= COLLATE ID|STRING */
177840
+#line 402 "parse.y"
177622177841
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
177842
+#line 3993 "parse.sql"
177623177843
break;
177624177844
case 45: /* generated ::= LP expr RP */
177845
+#line 405 "parse.y"
177625177846
{sqlite3AddGenerated(pParse,yymsp[-1].minor.yy454,0);}
177847
+#line 3998 "parse.sql"
177626177848
break;
177627177849
case 46: /* generated ::= LP expr RP ID */
177850
+#line 406 "parse.y"
177628177851
{sqlite3AddGenerated(pParse,yymsp[-2].minor.yy454,&yymsp[0].minor.yy0);}
177852
+#line 4003 "parse.sql"
177629177853
break;
177630177854
case 48: /* autoinc ::= AUTOINCR */
177855
+#line 411 "parse.y"
177631177856
{yymsp[0].minor.yy144 = 1;}
177857
+#line 4008 "parse.sql"
177632177858
break;
177633177859
case 49: /* refargs ::= */
177860
+#line 419 "parse.y"
177634177861
{ yymsp[1].minor.yy144 = OE_None*0x0101; /* EV: R-19803-45884 */}
177862
+#line 4013 "parse.sql"
177635177863
break;
177636177864
case 50: /* refargs ::= refargs refarg */
177865
+#line 420 "parse.y"
177637177866
{ yymsp[-1].minor.yy144 = (yymsp[-1].minor.yy144 & ~yymsp[0].minor.yy383.mask) | yymsp[0].minor.yy383.value; }
177867
+#line 4018 "parse.sql"
177638177868
break;
177639177869
case 51: /* refarg ::= MATCH nm */
177870
+#line 422 "parse.y"
177640177871
{ yymsp[-1].minor.yy383.value = 0; yymsp[-1].minor.yy383.mask = 0x000000; }
177872
+#line 4023 "parse.sql"
177641177873
break;
177642177874
case 52: /* refarg ::= ON INSERT refact */
177875
+#line 423 "parse.y"
177643177876
{ yymsp[-2].minor.yy383.value = 0; yymsp[-2].minor.yy383.mask = 0x000000; }
177877
+#line 4028 "parse.sql"
177644177878
break;
177645177879
case 53: /* refarg ::= ON DELETE refact */
177880
+#line 424 "parse.y"
177646177881
{ yymsp[-2].minor.yy383.value = yymsp[0].minor.yy144; yymsp[-2].minor.yy383.mask = 0x0000ff; }
177882
+#line 4033 "parse.sql"
177647177883
break;
177648177884
case 54: /* refarg ::= ON UPDATE refact */
177885
+#line 425 "parse.y"
177649177886
{ yymsp[-2].minor.yy383.value = yymsp[0].minor.yy144<<8; yymsp[-2].minor.yy383.mask = 0x00ff00; }
177887
+#line 4038 "parse.sql"
177650177888
break;
177651177889
case 55: /* refact ::= SET NULL */
177890
+#line 427 "parse.y"
177652177891
{ yymsp[-1].minor.yy144 = OE_SetNull; /* EV: R-33326-45252 */}
177892
+#line 4043 "parse.sql"
177653177893
break;
177654177894
case 56: /* refact ::= SET DEFAULT */
177895
+#line 428 "parse.y"
177655177896
{ yymsp[-1].minor.yy144 = OE_SetDflt; /* EV: R-33326-45252 */}
177897
+#line 4048 "parse.sql"
177656177898
break;
177657177899
case 57: /* refact ::= CASCADE */
177900
+#line 429 "parse.y"
177658177901
{ yymsp[0].minor.yy144 = OE_Cascade; /* EV: R-33326-45252 */}
177902
+#line 4053 "parse.sql"
177659177903
break;
177660177904
case 58: /* refact ::= RESTRICT */
177905
+#line 430 "parse.y"
177661177906
{ yymsp[0].minor.yy144 = OE_Restrict; /* EV: R-33326-45252 */}
177907
+#line 4058 "parse.sql"
177662177908
break;
177663177909
case 59: /* refact ::= NO ACTION */
177910
+#line 431 "parse.y"
177664177911
{ yymsp[-1].minor.yy144 = OE_None; /* EV: R-33326-45252 */}
177912
+#line 4063 "parse.sql"
177665177913
break;
177666177914
case 60: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
177915
+#line 433 "parse.y"
177667177916
{yymsp[-2].minor.yy144 = 0;}
177917
+#line 4068 "parse.sql"
177668177918
break;
177669177919
case 61: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
177670177920
case 76: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==76);
177671177921
case 173: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==173);
177922
+#line 434 "parse.y"
177672177923
{yymsp[-1].minor.yy144 = yymsp[0].minor.yy144;}
177924
+#line 4075 "parse.sql"
177673177925
break;
177674177926
case 63: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
177675177927
case 80: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==80);
177676177928
case 219: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==219);
177677177929
case 222: /* in_op ::= NOT IN */ yytestcase(yyruleno==222);
177678177930
case 247: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==247);
177931
+#line 437 "parse.y"
177679177932
{yymsp[-1].minor.yy144 = 1;}
177933
+#line 4084 "parse.sql"
177680177934
break;
177681177935
case 64: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
177936
+#line 438 "parse.y"
177682177937
{yymsp[-1].minor.yy144 = 0;}
177938
+#line 4089 "parse.sql"
177683177939
break;
177684177940
case 66: /* tconscomma ::= COMMA */
177941
+#line 444 "parse.y"
177685177942
{pParse->constraintName.n = 0;}
177943
+#line 4094 "parse.sql"
177686177944
break;
177687177945
case 68: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
177946
+#line 448 "parse.y"
177688177947
{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy14,yymsp[0].minor.yy144,yymsp[-2].minor.yy144,0);}
177948
+#line 4099 "parse.sql"
177689177949
break;
177690177950
case 69: /* tcons ::= UNIQUE LP sortlist RP onconf */
177951
+#line 450 "parse.y"
177691177952
{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy14,yymsp[0].minor.yy144,0,0,0,0,
177692177953
SQLITE_IDXTYPE_UNIQUE);}
177954
+#line 4105 "parse.sql"
177693177955
break;
177694177956
case 70: /* tcons ::= CHECK LP expr RP onconf */
177957
+#line 453 "parse.y"
177695177958
{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy454,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
177959
+#line 4110 "parse.sql"
177696177960
break;
177697177961
case 71: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
177962
+#line 455 "parse.y"
177698177963
{
177699177964
sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy14, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy14, yymsp[-1].minor.yy144);
177700177965
sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy144);
177701177966
}
177967
+#line 4118 "parse.sql"
177702177968
break;
177703177969
case 73: /* onconf ::= */
177704177970
case 75: /* orconf ::= */ yytestcase(yyruleno==75);
177971
+#line 469 "parse.y"
177705177972
{yymsp[1].minor.yy144 = OE_Default;}
177973
+#line 4124 "parse.sql"
177706177974
break;
177707177975
case 74: /* onconf ::= ON CONFLICT resolvetype */
177976
+#line 470 "parse.y"
177708177977
{yymsp[-2].minor.yy144 = yymsp[0].minor.yy144;}
177978
+#line 4129 "parse.sql"
177709177979
break;
177710177980
case 77: /* resolvetype ::= IGNORE */
177981
+#line 474 "parse.y"
177711177982
{yymsp[0].minor.yy144 = OE_Ignore;}
177983
+#line 4134 "parse.sql"
177712177984
break;
177713177985
case 78: /* resolvetype ::= REPLACE */
177714177986
case 174: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==174);
177987
+#line 475 "parse.y"
177715177988
{yymsp[0].minor.yy144 = OE_Replace;}
177989
+#line 4140 "parse.sql"
177716177990
break;
177717177991
case 79: /* cmd ::= DROP TABLE ifexists fullname */
177992
+#line 479 "parse.y"
177718177993
{
177719177994
sqlite3DropTable(pParse, yymsp[0].minor.yy203, 0, yymsp[-1].minor.yy144);
177720177995
}
177996
+#line 4147 "parse.sql"
177721177997
break;
177722177998
case 82: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
177999
+#line 490 "parse.y"
177723178000
{
177724178001
sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy14, yymsp[0].minor.yy555, yymsp[-7].minor.yy144, yymsp[-5].minor.yy144);
177725178002
}
178003
+#line 4154 "parse.sql"
177726178004
break;
177727178005
case 83: /* cmd ::= DROP VIEW ifexists fullname */
178006
+#line 493 "parse.y"
177728178007
{
177729178008
sqlite3DropTable(pParse, yymsp[0].minor.yy203, 1, yymsp[-1].minor.yy144);
177730178009
}
178010
+#line 4161 "parse.sql"
177731178011
break;
177732178012
case 84: /* cmd ::= select */
178013
+#line 500 "parse.y"
177733178014
{
177734178015
SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0, 0};
177735
- sqlite3Select(pParse, yymsp[0].minor.yy555, &dest);
178016
+ if( (pParse->db->mDbFlags & DBFLAG_EncodingFixed)!=0
178017
+ || sqlite3ReadSchema(pParse)==SQLITE_OK
178018
+ ){
178019
+ sqlite3Select(pParse, yymsp[0].minor.yy555, &dest);
178020
+ }
177736178021
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy555);
177737178022
}
178023
+#line 4174 "parse.sql"
177738178024
break;
177739178025
case 85: /* select ::= WITH wqlist selectnowith */
178026
+#line 574 "parse.y"
177740178027
{yymsp[-2].minor.yy555 = attachWithToSelect(pParse,yymsp[0].minor.yy555,yymsp[-1].minor.yy59);}
178028
+#line 4179 "parse.sql"
177741178029
break;
177742178030
case 86: /* select ::= WITH RECURSIVE wqlist selectnowith */
178031
+#line 576 "parse.y"
177743178032
{yymsp[-3].minor.yy555 = attachWithToSelect(pParse,yymsp[0].minor.yy555,yymsp[-1].minor.yy59);}
178033
+#line 4184 "parse.sql"
177744178034
break;
177745178035
case 87: /* select ::= selectnowith */
178036
+#line 579 "parse.y"
177746178037
{
177747178038
Select *p = yymsp[0].minor.yy555;
177748178039
if( p ){
177749178040
parserDoubleLinkSelect(pParse, p);
177750178041
}
177751178042
}
178043
+#line 4194 "parse.sql"
177752178044
break;
177753178045
case 88: /* selectnowith ::= selectnowith multiselect_op oneselect */
178046
+#line 588 "parse.y"
177754178047
{
177755178048
Select *pRhs = yymsp[0].minor.yy555;
177756178049
Select *pLhs = yymsp[-2].minor.yy555;
177757178050
if( pRhs && pRhs->pPrior ){
177758178051
SrcList *pFrom;
@@ -177771,131 +178064,175 @@
177771178064
}else{
177772178065
sqlite3SelectDelete(pParse->db, pLhs);
177773178066
}
177774178067
yymsp[-2].minor.yy555 = pRhs;
177775178068
}
178069
+#line 4220 "parse.sql"
177776178070
break;
177777178071
case 89: /* multiselect_op ::= UNION */
177778178072
case 91: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==91);
178073
+#line 611 "parse.y"
177779178074
{yymsp[0].minor.yy144 = yymsp[0].major; /*A-overwrites-OP*/}
178075
+#line 4226 "parse.sql"
177780178076
break;
177781178077
case 90: /* multiselect_op ::= UNION ALL */
178078
+#line 612 "parse.y"
177782178079
{yymsp[-1].minor.yy144 = TK_ALL;}
178080
+#line 4231 "parse.sql"
177783178081
break;
177784178082
case 92: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
178083
+#line 618 "parse.y"
177785178084
{
177786178085
yymsp[-8].minor.yy555 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy14,yymsp[-5].minor.yy203,yymsp[-4].minor.yy454,yymsp[-3].minor.yy14,yymsp[-2].minor.yy454,yymsp[-1].minor.yy14,yymsp[-7].minor.yy144,yymsp[0].minor.yy454);
177787178086
}
178087
+#line 4238 "parse.sql"
177788178088
break;
177789178089
case 93: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
178090
+#line 624 "parse.y"
177790178091
{
177791178092
yymsp[-9].minor.yy555 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy14,yymsp[-6].minor.yy203,yymsp[-5].minor.yy454,yymsp[-4].minor.yy14,yymsp[-3].minor.yy454,yymsp[-1].minor.yy14,yymsp[-8].minor.yy144,yymsp[0].minor.yy454);
177792178093
if( yymsp[-9].minor.yy555 ){
177793178094
yymsp[-9].minor.yy555->pWinDefn = yymsp[-2].minor.yy211;
177794178095
}else{
177795178096
sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy211);
177796178097
}
177797178098
}
178099
+#line 4250 "parse.sql"
177798178100
break;
177799178101
case 94: /* values ::= VALUES LP nexprlist RP */
178102
+#line 640 "parse.y"
177800178103
{
177801178104
yymsp[-3].minor.yy555 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy14,0,0,0,0,0,SF_Values,0);
177802178105
}
178106
+#line 4257 "parse.sql"
177803178107
break;
177804178108
case 95: /* oneselect ::= mvalues */
178109
+#line 647 "parse.y"
177805178110
{
177806178111
sqlite3MultiValuesEnd(pParse, yymsp[0].minor.yy555);
177807178112
}
178113
+#line 4264 "parse.sql"
177808178114
break;
177809178115
case 96: /* mvalues ::= values COMMA LP nexprlist RP */
177810178116
case 97: /* mvalues ::= mvalues COMMA LP nexprlist RP */ yytestcase(yyruleno==97);
178117
+#line 651 "parse.y"
177811178118
{
177812178119
yymsp[-4].minor.yy555 = sqlite3MultiValues(pParse, yymsp[-4].minor.yy555, yymsp[-1].minor.yy14);
177813178120
}
178121
+#line 4272 "parse.sql"
177814178122
break;
177815178123
case 98: /* distinct ::= DISTINCT */
178124
+#line 662 "parse.y"
177816178125
{yymsp[0].minor.yy144 = SF_Distinct;}
178126
+#line 4277 "parse.sql"
177817178127
break;
177818178128
case 99: /* distinct ::= ALL */
178129
+#line 663 "parse.y"
177819178130
{yymsp[0].minor.yy144 = SF_All;}
178131
+#line 4282 "parse.sql"
177820178132
break;
177821178133
case 101: /* sclp ::= */
177822178134
case 134: /* orderby_opt ::= */ yytestcase(yyruleno==134);
177823178135
case 144: /* groupby_opt ::= */ yytestcase(yyruleno==144);
177824178136
case 234: /* exprlist ::= */ yytestcase(yyruleno==234);
177825178137
case 237: /* paren_exprlist ::= */ yytestcase(yyruleno==237);
177826178138
case 242: /* eidlist_opt ::= */ yytestcase(yyruleno==242);
178139
+#line 676 "parse.y"
177827178140
{yymsp[1].minor.yy14 = 0;}
178141
+#line 4292 "parse.sql"
177828178142
break;
177829178143
case 102: /* selcollist ::= sclp scanpt expr scanpt as */
178144
+#line 677 "parse.y"
177830178145
{
177831178146
yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy14, yymsp[-2].minor.yy454);
177832178147
if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy14, &yymsp[0].minor.yy0, 1);
177833178148
sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy14,yymsp[-3].minor.yy168,yymsp[-1].minor.yy168);
177834178149
}
178150
+#line 4301 "parse.sql"
177835178151
break;
177836178152
case 103: /* selcollist ::= sclp scanpt STAR */
178153
+#line 682 "parse.y"
177837178154
{
177838178155
Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
177839178156
sqlite3ExprSetErrorOffset(p, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
177840178157
yymsp[-2].minor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy14, p);
177841178158
}
178159
+#line 4310 "parse.sql"
177842178160
break;
177843178161
case 104: /* selcollist ::= sclp scanpt nm DOT STAR */
178162
+#line 687 "parse.y"
177844178163
{
177845178164
Expr *pRight, *pLeft, *pDot;
177846178165
pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
177847178166
sqlite3ExprSetErrorOffset(pRight, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
177848178167
pLeft = tokenExpr(pParse, TK_ID, yymsp[-2].minor.yy0);
177849178168
pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
177850178169
yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, pDot);
177851178170
}
178171
+#line 4322 "parse.sql"
177852178172
break;
177853178173
case 105: /* as ::= AS nm */
177854178174
case 117: /* dbnm ::= DOT nm */ yytestcase(yyruleno==117);
177855178175
case 258: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==258);
177856178176
case 259: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==259);
178177
+#line 700 "parse.y"
177857178178
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
178179
+#line 4330 "parse.sql"
177858178180
break;
177859178181
case 107: /* from ::= */
177860178182
case 110: /* stl_prefix ::= */ yytestcase(yyruleno==110);
178183
+#line 714 "parse.y"
177861178184
{yymsp[1].minor.yy203 = 0;}
178185
+#line 4336 "parse.sql"
177862178186
break;
177863178187
case 108: /* from ::= FROM seltablist */
178188
+#line 715 "parse.y"
177864178189
{
177865178190
yymsp[-1].minor.yy203 = yymsp[0].minor.yy203;
177866178191
sqlite3SrcListShiftJoinType(pParse,yymsp[-1].minor.yy203);
177867178192
}
178193
+#line 4344 "parse.sql"
177868178194
break;
177869178195
case 109: /* stl_prefix ::= seltablist joinop */
178196
+#line 723 "parse.y"
177870178197
{
177871178198
if( ALWAYS(yymsp[-1].minor.yy203 && yymsp[-1].minor.yy203->nSrc>0) ) yymsp[-1].minor.yy203->a[yymsp[-1].minor.yy203->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy144;
177872178199
}
178200
+#line 4351 "parse.sql"
177873178201
break;
177874178202
case 111: /* seltablist ::= stl_prefix nm dbnm as on_using */
178203
+#line 727 "parse.y"
177875178204
{
177876178205
yymsp[-4].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-4].minor.yy203,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy269);
177877178206
}
178207
+#line 4358 "parse.sql"
177878178208
break;
177879178209
case 112: /* seltablist ::= stl_prefix nm dbnm as indexed_by on_using */
178210
+#line 730 "parse.y"
177880178211
{
177881178212
yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,0,&yymsp[0].minor.yy269);
177882178213
sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy203, &yymsp[-1].minor.yy0);
177883178214
}
178215
+#line 4366 "parse.sql"
177884178216
break;
177885178217
case 113: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_using */
178218
+#line 734 "parse.y"
177886178219
{
177887178220
yymsp[-7].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-7].minor.yy203,&yymsp[-6].minor.yy0,&yymsp[-5].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy269);
177888178221
sqlite3SrcListFuncArgs(pParse, yymsp[-7].minor.yy203, yymsp[-3].minor.yy14);
177889178222
}
178223
+#line 4374 "parse.sql"
177890178224
break;
177891178225
case 114: /* seltablist ::= stl_prefix LP select RP as on_using */
178226
+#line 739 "parse.y"
177892178227
{
177893178228
yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,0,0,&yymsp[-1].minor.yy0,yymsp[-3].minor.yy555,&yymsp[0].minor.yy269);
177894178229
}
178230
+#line 4381 "parse.sql"
177895178231
break;
177896178232
case 115: /* seltablist ::= stl_prefix LP seltablist RP as on_using */
178233
+#line 742 "parse.y"
177897178234
{
177898178235
if( yymsp[-5].minor.yy203==0 && yymsp[-1].minor.yy0.n==0 && yymsp[0].minor.yy269.pOn==0 && yymsp[0].minor.yy269.pUsing==0 ){
177899178236
yymsp[-5].minor.yy203 = yymsp[-3].minor.yy203;
177900178237
}else if( ALWAYS(yymsp[-3].minor.yy203!=0) && yymsp[-3].minor.yy203->nSrc==1 ){
177901178238
yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,0,0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy269);
@@ -177932,144 +178269,210 @@
177932178269
sqlite3SrcListShiftJoinType(pParse,yymsp[-3].minor.yy203);
177933178270
pSubquery = sqlite3SelectNew(pParse,0,yymsp[-3].minor.yy203,0,0,0,0,SF_NestedFrom,0);
177934178271
yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,0,0,&yymsp[-1].minor.yy0,pSubquery,&yymsp[0].minor.yy269);
177935178272
}
177936178273
}
178274
+#line 4425 "parse.sql"
177937178275
break;
177938178276
case 116: /* dbnm ::= */
177939178277
case 131: /* indexed_opt ::= */ yytestcase(yyruleno==131);
178278
+#line 785 "parse.y"
177940178279
{yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
178280
+#line 4431 "parse.sql"
177941178281
break;
177942178282
case 118: /* fullname ::= nm */
178283
+#line 790 "parse.y"
177943178284
{
177944178285
yylhsminor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
177945178286
if( IN_RENAME_OBJECT && yylhsminor.yy203 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy203->a[0].zName, &yymsp[0].minor.yy0);
177946178287
}
178288
+#line 4439 "parse.sql"
177947178289
yymsp[0].minor.yy203 = yylhsminor.yy203;
177948178290
break;
177949178291
case 119: /* fullname ::= nm DOT nm */
178292
+#line 794 "parse.y"
177950178293
{
177951178294
yylhsminor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
177952178295
if( IN_RENAME_OBJECT && yylhsminor.yy203 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy203->a[0].zName, &yymsp[0].minor.yy0);
177953178296
}
178297
+#line 4448 "parse.sql"
177954178298
yymsp[-2].minor.yy203 = yylhsminor.yy203;
177955178299
break;
177956178300
case 120: /* xfullname ::= nm */
178301
+#line 802 "parse.y"
177957178302
{yymsp[0].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
178303
+#line 4454 "parse.sql"
177958178304
break;
177959178305
case 121: /* xfullname ::= nm DOT nm */
178306
+#line 804 "parse.y"
177960178307
{yymsp[-2].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
178308
+#line 4459 "parse.sql"
177961178309
break;
177962178310
case 122: /* xfullname ::= nm DOT nm AS nm */
178311
+#line 805 "parse.y"
177963178312
{
177964178313
yymsp[-4].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
177965178314
if( yymsp[-4].minor.yy203 ) yymsp[-4].minor.yy203->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
177966178315
}
178316
+#line 4467 "parse.sql"
177967178317
break;
177968178318
case 123: /* xfullname ::= nm AS nm */
178319
+#line 809 "parse.y"
177969178320
{
177970178321
yymsp[-2].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
177971178322
if( yymsp[-2].minor.yy203 ) yymsp[-2].minor.yy203->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
177972178323
}
178324
+#line 4475 "parse.sql"
177973178325
break;
177974178326
case 124: /* joinop ::= COMMA|JOIN */
178327
+#line 815 "parse.y"
177975178328
{ yymsp[0].minor.yy144 = JT_INNER; }
178329
+#line 4480 "parse.sql"
177976178330
break;
177977178331
case 125: /* joinop ::= JOIN_KW JOIN */
178332
+#line 817 "parse.y"
177978178333
{yymsp[-1].minor.yy144 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
178334
+#line 4485 "parse.sql"
177979178335
break;
177980178336
case 126: /* joinop ::= JOIN_KW nm JOIN */
178337
+#line 819 "parse.y"
177981178338
{yymsp[-2].minor.yy144 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
178339
+#line 4490 "parse.sql"
177982178340
break;
177983178341
case 127: /* joinop ::= JOIN_KW nm nm JOIN */
178342
+#line 821 "parse.y"
177984178343
{yymsp[-3].minor.yy144 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
178344
+#line 4495 "parse.sql"
177985178345
break;
177986178346
case 128: /* on_using ::= ON expr */
178347
+#line 842 "parse.y"
177987178348
{yymsp[-1].minor.yy269.pOn = yymsp[0].minor.yy454; yymsp[-1].minor.yy269.pUsing = 0;}
178349
+#line 4500 "parse.sql"
177988178350
break;
177989178351
case 129: /* on_using ::= USING LP idlist RP */
178352
+#line 843 "parse.y"
177990178353
{yymsp[-3].minor.yy269.pOn = 0; yymsp[-3].minor.yy269.pUsing = yymsp[-1].minor.yy132;}
178354
+#line 4505 "parse.sql"
177991178355
break;
177992178356
case 130: /* on_using ::= */
178357
+#line 844 "parse.y"
177993178358
{yymsp[1].minor.yy269.pOn = 0; yymsp[1].minor.yy269.pUsing = 0;}
178359
+#line 4510 "parse.sql"
177994178360
break;
177995178361
case 132: /* indexed_by ::= INDEXED BY nm */
178362
+#line 860 "parse.y"
177996178363
{yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
178364
+#line 4515 "parse.sql"
177997178365
break;
177998178366
case 133: /* indexed_by ::= NOT INDEXED */
178367
+#line 861 "parse.y"
177999178368
{yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
178369
+#line 4520 "parse.sql"
178000178370
break;
178001178371
case 135: /* orderby_opt ::= ORDER BY sortlist */
178002178372
case 145: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==145);
178373
+#line 874 "parse.y"
178003178374
{yymsp[-2].minor.yy14 = yymsp[0].minor.yy14;}
178375
+#line 4526 "parse.sql"
178004178376
break;
178005178377
case 136: /* sortlist ::= sortlist COMMA expr sortorder nulls */
178378
+#line 875 "parse.y"
178006178379
{
178007178380
yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14,yymsp[-2].minor.yy454);
178008178381
sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy14,yymsp[-1].minor.yy144,yymsp[0].minor.yy144);
178009178382
}
178383
+#line 4534 "parse.sql"
178010178384
break;
178011178385
case 137: /* sortlist ::= expr sortorder nulls */
178386
+#line 879 "parse.y"
178012178387
{
178013178388
yymsp[-2].minor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy454); /*A-overwrites-Y*/
178014178389
sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy14,yymsp[-1].minor.yy144,yymsp[0].minor.yy144);
178015178390
}
178391
+#line 4542 "parse.sql"
178016178392
break;
178017178393
case 138: /* sortorder ::= ASC */
178394
+#line 886 "parse.y"
178018178395
{yymsp[0].minor.yy144 = SQLITE_SO_ASC;}
178396
+#line 4547 "parse.sql"
178019178397
break;
178020178398
case 139: /* sortorder ::= DESC */
178399
+#line 887 "parse.y"
178021178400
{yymsp[0].minor.yy144 = SQLITE_SO_DESC;}
178401
+#line 4552 "parse.sql"
178022178402
break;
178023178403
case 140: /* sortorder ::= */
178024178404
case 143: /* nulls ::= */ yytestcase(yyruleno==143);
178405
+#line 888 "parse.y"
178025178406
{yymsp[1].minor.yy144 = SQLITE_SO_UNDEFINED;}
178407
+#line 4558 "parse.sql"
178026178408
break;
178027178409
case 141: /* nulls ::= NULLS FIRST */
178410
+#line 891 "parse.y"
178028178411
{yymsp[-1].minor.yy144 = SQLITE_SO_ASC;}
178412
+#line 4563 "parse.sql"
178029178413
break;
178030178414
case 142: /* nulls ::= NULLS LAST */
178415
+#line 892 "parse.y"
178031178416
{yymsp[-1].minor.yy144 = SQLITE_SO_DESC;}
178417
+#line 4568 "parse.sql"
178032178418
break;
178033178419
case 146: /* having_opt ::= */
178034178420
case 148: /* limit_opt ::= */ yytestcase(yyruleno==148);
178035178421
case 153: /* where_opt ::= */ yytestcase(yyruleno==153);
178036178422
case 155: /* where_opt_ret ::= */ yytestcase(yyruleno==155);
178037178423
case 232: /* case_else ::= */ yytestcase(yyruleno==232);
178038178424
case 233: /* case_operand ::= */ yytestcase(yyruleno==233);
178039178425
case 252: /* vinto ::= */ yytestcase(yyruleno==252);
178426
+#line 902 "parse.y"
178040178427
{yymsp[1].minor.yy454 = 0;}
178428
+#line 4579 "parse.sql"
178041178429
break;
178042178430
case 147: /* having_opt ::= HAVING expr */
178043178431
case 154: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==154);
178044178432
case 156: /* where_opt_ret ::= WHERE expr */ yytestcase(yyruleno==156);
178045178433
case 231: /* case_else ::= ELSE expr */ yytestcase(yyruleno==231);
178046178434
case 251: /* vinto ::= INTO expr */ yytestcase(yyruleno==251);
178435
+#line 903 "parse.y"
178047178436
{yymsp[-1].minor.yy454 = yymsp[0].minor.yy454;}
178437
+#line 4588 "parse.sql"
178048178438
break;
178049178439
case 149: /* limit_opt ::= LIMIT expr */
178440
+#line 917 "parse.y"
178050178441
{yymsp[-1].minor.yy454 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy454,0);}
178442
+#line 4593 "parse.sql"
178051178443
break;
178052178444
case 150: /* limit_opt ::= LIMIT expr OFFSET expr */
178445
+#line 919 "parse.y"
178053178446
{yymsp[-3].minor.yy454 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);}
178447
+#line 4598 "parse.sql"
178054178448
break;
178055178449
case 151: /* limit_opt ::= LIMIT expr COMMA expr */
178450
+#line 921 "parse.y"
178056178451
{yymsp[-3].minor.yy454 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy454,yymsp[-2].minor.yy454);}
178452
+#line 4603 "parse.sql"
178057178453
break;
178058178454
case 152: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
178455
+#line 939 "parse.y"
178059178456
{
178060178457
sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy203, &yymsp[-1].minor.yy0);
178061178458
sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy203,yymsp[0].minor.yy454,0,0);
178062178459
}
178460
+#line 4611 "parse.sql"
178063178461
break;
178064178462
case 157: /* where_opt_ret ::= RETURNING selcollist */
178463
+#line 955 "parse.y"
178065178464
{sqlite3AddReturning(pParse,yymsp[0].minor.yy14); yymsp[-1].minor.yy454 = 0;}
178465
+#line 4616 "parse.sql"
178066178466
break;
178067178467
case 158: /* where_opt_ret ::= WHERE expr RETURNING selcollist */
178468
+#line 957 "parse.y"
178068178469
{sqlite3AddReturning(pParse,yymsp[0].minor.yy14); yymsp[-3].minor.yy454 = yymsp[-2].minor.yy454;}
178470
+#line 4621 "parse.sql"
178069178471
break;
178070178472
case 159: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
178473
+#line 989 "parse.y"
178071178474
{
178072178475
sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy203, &yymsp[-4].minor.yy0);
178073178476
sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy14,"set list");
178074178477
if( yymsp[-1].minor.yy203 ){
178075178478
SrcList *pFromClause = yymsp[-1].minor.yy203;
@@ -178083,92 +178486,134 @@
178083178486
}
178084178487
yymsp[-5].minor.yy203 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy203, pFromClause);
178085178488
}
178086178489
sqlite3Update(pParse,yymsp[-5].minor.yy203,yymsp[-2].minor.yy14,yymsp[0].minor.yy454,yymsp[-6].minor.yy144,0,0,0);
178087178490
}
178491
+#line 4642 "parse.sql"
178088178492
break;
178089178493
case 160: /* setlist ::= setlist COMMA nm EQ expr */
178494
+#line 1013 "parse.y"
178090178495
{
178091178496
yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy14, yymsp[0].minor.yy454);
178092178497
sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy14, &yymsp[-2].minor.yy0, 1);
178093178498
}
178499
+#line 4650 "parse.sql"
178094178500
break;
178095178501
case 161: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
178502
+#line 1017 "parse.y"
178096178503
{
178097178504
yymsp[-6].minor.yy14 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy14, yymsp[-3].minor.yy132, yymsp[0].minor.yy454);
178098178505
}
178506
+#line 4657 "parse.sql"
178099178507
break;
178100178508
case 162: /* setlist ::= nm EQ expr */
178509
+#line 1020 "parse.y"
178101178510
{
178102178511
yylhsminor.yy14 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy454);
178103178512
sqlite3ExprListSetName(pParse, yylhsminor.yy14, &yymsp[-2].minor.yy0, 1);
178104178513
}
178514
+#line 4665 "parse.sql"
178105178515
yymsp[-2].minor.yy14 = yylhsminor.yy14;
178106178516
break;
178107178517
case 163: /* setlist ::= LP idlist RP EQ expr */
178518
+#line 1024 "parse.y"
178108178519
{
178109178520
yymsp[-4].minor.yy14 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy132, yymsp[0].minor.yy454);
178110178521
}
178522
+#line 4673 "parse.sql"
178111178523
break;
178112178524
case 164: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
178525
+#line 1031 "parse.y"
178113178526
{
178114178527
sqlite3Insert(pParse, yymsp[-3].minor.yy203, yymsp[-1].minor.yy555, yymsp[-2].minor.yy132, yymsp[-5].minor.yy144, yymsp[0].minor.yy122);
178115178528
}
178529
+#line 4680 "parse.sql"
178116178530
break;
178117178531
case 165: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
178532
+#line 1035 "parse.y"
178118178533
{
178119178534
sqlite3Insert(pParse, yymsp[-4].minor.yy203, 0, yymsp[-3].minor.yy132, yymsp[-6].minor.yy144, 0);
178120178535
}
178536
+#line 4687 "parse.sql"
178121178537
break;
178122178538
case 166: /* upsert ::= */
178539
+#line 1046 "parse.y"
178123178540
{ yymsp[1].minor.yy122 = 0; }
178541
+#line 4692 "parse.sql"
178124178542
break;
178125178543
case 167: /* upsert ::= RETURNING selcollist */
178544
+#line 1047 "parse.y"
178126178545
{ yymsp[-1].minor.yy122 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy14); }
178546
+#line 4697 "parse.sql"
178127178547
break;
178128178548
case 168: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
178549
+#line 1050 "parse.y"
178129178550
{ yymsp[-11].minor.yy122 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy14,yymsp[-6].minor.yy454,yymsp[-2].minor.yy14,yymsp[-1].minor.yy454,yymsp[0].minor.yy122);}
178551
+#line 4702 "parse.sql"
178130178552
break;
178131178553
case 169: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
178554
+#line 1052 "parse.y"
178132178555
{ yymsp[-8].minor.yy122 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy14,yymsp[-3].minor.yy454,0,0,yymsp[0].minor.yy122); }
178556
+#line 4707 "parse.sql"
178133178557
break;
178134178558
case 170: /* upsert ::= ON CONFLICT DO NOTHING returning */
178559
+#line 1054 "parse.y"
178135178560
{ yymsp[-4].minor.yy122 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
178561
+#line 4712 "parse.sql"
178136178562
break;
178137178563
case 171: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
178564
+#line 1056 "parse.y"
178138178565
{ yymsp[-7].minor.yy122 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy14,yymsp[-1].minor.yy454,0);}
178566
+#line 4717 "parse.sql"
178139178567
break;
178140178568
case 172: /* returning ::= RETURNING selcollist */
178569
+#line 1058 "parse.y"
178141178570
{sqlite3AddReturning(pParse,yymsp[0].minor.yy14);}
178571
+#line 4722 "parse.sql"
178142178572
break;
178143178573
case 175: /* idlist_opt ::= */
178574
+#line 1070 "parse.y"
178144178575
{yymsp[1].minor.yy132 = 0;}
178576
+#line 4727 "parse.sql"
178145178577
break;
178146178578
case 176: /* idlist_opt ::= LP idlist RP */
178579
+#line 1071 "parse.y"
178147178580
{yymsp[-2].minor.yy132 = yymsp[-1].minor.yy132;}
178581
+#line 4732 "parse.sql"
178148178582
break;
178149178583
case 177: /* idlist ::= idlist COMMA nm */
178584
+#line 1073 "parse.y"
178150178585
{yymsp[-2].minor.yy132 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy132,&yymsp[0].minor.yy0);}
178586
+#line 4737 "parse.sql"
178151178587
break;
178152178588
case 178: /* idlist ::= nm */
178589
+#line 1075 "parse.y"
178153178590
{yymsp[0].minor.yy132 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
178591
+#line 4742 "parse.sql"
178154178592
break;
178155178593
case 179: /* expr ::= LP expr RP */
178594
+#line 1124 "parse.y"
178156178595
{yymsp[-2].minor.yy454 = yymsp[-1].minor.yy454;}
178596
+#line 4747 "parse.sql"
178157178597
break;
178158178598
case 180: /* expr ::= ID|INDEXED|JOIN_KW */
178599
+#line 1125 "parse.y"
178159178600
{yymsp[0].minor.yy454=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
178601
+#line 4752 "parse.sql"
178160178602
break;
178161178603
case 181: /* expr ::= nm DOT nm */
178604
+#line 1126 "parse.y"
178162178605
{
178163178606
Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
178164178607
Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
178165178608
yylhsminor.yy454 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
178166178609
}
178610
+#line 4761 "parse.sql"
178167178611
yymsp[-2].minor.yy454 = yylhsminor.yy454;
178168178612
break;
178169178613
case 182: /* expr ::= nm DOT nm DOT nm */
178614
+#line 1131 "parse.y"
178170178615
{
178171178616
Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-4].minor.yy0);
178172178617
Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
178173178618
Expr *temp3 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
178174178619
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
@@ -178175,24 +178620,30 @@
178175178620
if( IN_RENAME_OBJECT ){
178176178621
sqlite3RenameTokenRemap(pParse, 0, temp1);
178177178622
}
178178178623
yylhsminor.yy454 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
178179178624
}
178625
+#line 4776 "parse.sql"
178180178626
yymsp[-4].minor.yy454 = yylhsminor.yy454;
178181178627
break;
178182178628
case 183: /* term ::= NULL|FLOAT|BLOB */
178183178629
case 184: /* term ::= STRING */ yytestcase(yyruleno==184);
178630
+#line 1141 "parse.y"
178184178631
{yymsp[0].minor.yy454=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
178632
+#line 4783 "parse.sql"
178185178633
break;
178186178634
case 185: /* term ::= INTEGER */
178635
+#line 1143 "parse.y"
178187178636
{
178188178637
yylhsminor.yy454 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
178189178638
if( yylhsminor.yy454 ) yylhsminor.yy454->w.iOfst = (int)(yymsp[0].minor.yy0.z - pParse->zTail);
178190178639
}
178640
+#line 4791 "parse.sql"
178191178641
yymsp[0].minor.yy454 = yylhsminor.yy454;
178192178642
break;
178193178643
case 186: /* expr ::= VARIABLE */
178644
+#line 1147 "parse.y"
178194178645
{
178195178646
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
178196178647
u32 n = yymsp[0].minor.yy0.n;
178197178648
yymsp[0].minor.yy454 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
178198178649
sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy454, n);
@@ -178209,70 +178660,90 @@
178209178660
yymsp[0].minor.yy454 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
178210178661
if( yymsp[0].minor.yy454 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy454->iTable);
178211178662
}
178212178663
}
178213178664
}
178665
+#line 4816 "parse.sql"
178214178666
break;
178215178667
case 187: /* expr ::= expr COLLATE ID|STRING */
178668
+#line 1167 "parse.y"
178216178669
{
178217178670
yymsp[-2].minor.yy454 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy454, &yymsp[0].minor.yy0, 1);
178218178671
}
178672
+#line 4823 "parse.sql"
178219178673
break;
178220178674
case 188: /* expr ::= CAST LP expr AS typetoken RP */
178675
+#line 1171 "parse.y"
178221178676
{
178222178677
yymsp[-5].minor.yy454 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
178223178678
sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy454, yymsp[-3].minor.yy454, 0);
178224178679
}
178680
+#line 4831 "parse.sql"
178225178681
break;
178226178682
case 189: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
178683
+#line 1178 "parse.y"
178227178684
{
178228178685
yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy14, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy144);
178229178686
}
178687
+#line 4838 "parse.sql"
178230178688
yymsp[-4].minor.yy454 = yylhsminor.yy454;
178231178689
break;
178232178690
case 190: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
178691
+#line 1181 "parse.y"
178233178692
{
178234178693
yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-4].minor.yy14, &yymsp[-7].minor.yy0, yymsp[-5].minor.yy144);
178235178694
sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy454, yymsp[-1].minor.yy14);
178236178695
}
178696
+#line 4847 "parse.sql"
178237178697
yymsp[-7].minor.yy454 = yylhsminor.yy454;
178238178698
break;
178239178699
case 191: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP */
178700
+#line 1185 "parse.y"
178240178701
{
178241178702
yylhsminor.yy454 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
178242178703
}
178704
+#line 4855 "parse.sql"
178243178705
yymsp[-3].minor.yy454 = yylhsminor.yy454;
178244178706
break;
178245178707
case 192: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
178708
+#line 1249 "parse.y"
178246178709
{
178247178710
yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy14, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy144);
178248178711
sqlite3WindowAttach(pParse, yylhsminor.yy454, yymsp[0].minor.yy211);
178249178712
}
178713
+#line 4864 "parse.sql"
178250178714
yymsp[-5].minor.yy454 = yylhsminor.yy454;
178251178715
break;
178252178716
case 193: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
178717
+#line 1253 "parse.y"
178253178718
{
178254178719
yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-5].minor.yy14, &yymsp[-8].minor.yy0, yymsp[-6].minor.yy144);
178255178720
sqlite3WindowAttach(pParse, yylhsminor.yy454, yymsp[0].minor.yy211);
178256178721
sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy454, yymsp[-2].minor.yy14);
178257178722
}
178723
+#line 4874 "parse.sql"
178258178724
yymsp[-8].minor.yy454 = yylhsminor.yy454;
178259178725
break;
178260178726
case 194: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP filter_over */
178727
+#line 1258 "parse.y"
178261178728
{
178262178729
yylhsminor.yy454 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
178263178730
sqlite3WindowAttach(pParse, yylhsminor.yy454, yymsp[0].minor.yy211);
178264178731
}
178732
+#line 4883 "parse.sql"
178265178733
yymsp[-4].minor.yy454 = yylhsminor.yy454;
178266178734
break;
178267178735
case 195: /* term ::= CTIME_KW */
178736
+#line 1272 "parse.y"
178268178737
{
178269178738
yylhsminor.yy454 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
178270178739
}
178740
+#line 4891 "parse.sql"
178271178741
yymsp[0].minor.yy454 = yylhsminor.yy454;
178272178742
break;
178273178743
case 196: /* expr ::= LP nexprlist COMMA expr RP */
178744
+#line 1276 "parse.y"
178274178745
{
178275178746
ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy14, yymsp[-1].minor.yy454);
178276178747
yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
178277178748
if( yymsp[-4].minor.yy454 ){
178278178749
yymsp[-4].minor.yy454->x.pList = pList;
@@ -178281,27 +178752,35 @@
178281178752
}
178282178753
}else{
178283178754
sqlite3ExprListDelete(pParse->db, pList);
178284178755
}
178285178756
}
178757
+#line 4908 "parse.sql"
178286178758
break;
178287178759
case 197: /* expr ::= expr AND expr */
178760
+#line 1289 "parse.y"
178288178761
{yymsp[-2].minor.yy454=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);}
178762
+#line 4913 "parse.sql"
178289178763
break;
178290178764
case 198: /* expr ::= expr OR expr */
178291178765
case 199: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==199);
178292178766
case 200: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==200);
178293178767
case 201: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==201);
178294178768
case 202: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==202);
178295178769
case 203: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==203);
178296178770
case 204: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==204);
178771
+#line 1290 "parse.y"
178297178772
{yymsp[-2].minor.yy454=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);}
178773
+#line 4924 "parse.sql"
178298178774
break;
178299178775
case 205: /* likeop ::= NOT LIKE_KW|MATCH */
178776
+#line 1303 "parse.y"
178300178777
{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
178778
+#line 4929 "parse.sql"
178301178779
break;
178302178780
case 206: /* expr ::= expr likeop expr */
178781
+#line 1304 "parse.y"
178303178782
{
178304178783
ExprList *pList;
178305178784
int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
178306178785
yymsp[-1].minor.yy0.n &= 0x7fffffff;
178307178786
pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy454);
@@ -178308,12 +178787,14 @@
178308178787
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy454);
178309178788
yymsp[-2].minor.yy454 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
178310178789
if( bNot ) yymsp[-2].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy454, 0);
178311178790
if( yymsp[-2].minor.yy454 ) yymsp[-2].minor.yy454->flags |= EP_InfixFunc;
178312178791
}
178792
+#line 4943 "parse.sql"
178313178793
break;
178314178794
case 207: /* expr ::= expr likeop expr ESCAPE expr */
178795
+#line 1314 "parse.y"
178315178796
{
178316178797
ExprList *pList;
178317178798
int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
178318178799
yymsp[-3].minor.yy0.n &= 0x7fffffff;
178319178800
pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy454);
@@ -178321,46 +178802,62 @@
178321178802
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy454);
178322178803
yymsp[-4].minor.yy454 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
178323178804
if( bNot ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178324178805
if( yymsp[-4].minor.yy454 ) yymsp[-4].minor.yy454->flags |= EP_InfixFunc;
178325178806
}
178807
+#line 4958 "parse.sql"
178326178808
break;
178327178809
case 208: /* expr ::= expr ISNULL|NOTNULL */
178810
+#line 1326 "parse.y"
178328178811
{yymsp[-1].minor.yy454 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy454,0);}
178812
+#line 4963 "parse.sql"
178329178813
break;
178330178814
case 209: /* expr ::= expr NOT NULL */
178815
+#line 1327 "parse.y"
178331178816
{yymsp[-2].minor.yy454 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy454,0);}
178817
+#line 4968 "parse.sql"
178332178818
break;
178333178819
case 210: /* expr ::= expr IS expr */
178820
+#line 1348 "parse.y"
178334178821
{
178335178822
yymsp[-2].minor.yy454 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);
178336178823
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-2].minor.yy454, TK_ISNULL);
178337178824
}
178825
+#line 4976 "parse.sql"
178338178826
break;
178339178827
case 211: /* expr ::= expr IS NOT expr */
178828
+#line 1352 "parse.y"
178340178829
{
178341178830
yymsp[-3].minor.yy454 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy454,yymsp[0].minor.yy454);
178342178831
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-3].minor.yy454, TK_NOTNULL);
178343178832
}
178833
+#line 4984 "parse.sql"
178344178834
break;
178345178835
case 212: /* expr ::= expr IS NOT DISTINCT FROM expr */
178836
+#line 1356 "parse.y"
178346178837
{
178347178838
yymsp[-5].minor.yy454 = sqlite3PExpr(pParse,TK_IS,yymsp[-5].minor.yy454,yymsp[0].minor.yy454);
178348178839
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-5].minor.yy454, TK_ISNULL);
178349178840
}
178841
+#line 4992 "parse.sql"
178350178842
break;
178351178843
case 213: /* expr ::= expr IS DISTINCT FROM expr */
178844
+#line 1360 "parse.y"
178352178845
{
178353178846
yymsp[-4].minor.yy454 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-4].minor.yy454,yymsp[0].minor.yy454);
178354178847
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-4].minor.yy454, TK_NOTNULL);
178355178848
}
178849
+#line 5000 "parse.sql"
178356178850
break;
178357178851
case 214: /* expr ::= NOT expr */
178358178852
case 215: /* expr ::= BITNOT expr */ yytestcase(yyruleno==215);
178853
+#line 1366 "parse.y"
178359178854
{yymsp[-1].minor.yy454 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy454, 0);/*A-overwrites-B*/}
178855
+#line 5006 "parse.sql"
178360178856
break;
178361178857
case 216: /* expr ::= PLUS|MINUS expr */
178858
+#line 1369 "parse.y"
178362178859
{
178363178860
Expr *p = yymsp[0].minor.yy454;
178364178861
u8 op = yymsp[-1].major + (TK_UPLUS-TK_PLUS);
178365178862
assert( TK_UPLUS>TK_PLUS );
178366178863
assert( TK_UMINUS == TK_MINUS + (TK_UPLUS - TK_PLUS) );
@@ -178370,24 +178867,30 @@
178370178867
}else{
178371178868
yymsp[-1].minor.yy454 = sqlite3PExpr(pParse, op, p, 0);
178372178869
/*A-overwrites-B*/
178373178870
}
178374178871
}
178872
+#line 5023 "parse.sql"
178375178873
break;
178376178874
case 217: /* expr ::= expr PTR expr */
178875
+#line 1383 "parse.y"
178377178876
{
178378178877
ExprList *pList = sqlite3ExprListAppend(pParse, 0, yymsp[-2].minor.yy454);
178379178878
pList = sqlite3ExprListAppend(pParse, pList, yymsp[0].minor.yy454);
178380178879
yylhsminor.yy454 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
178381178880
}
178881
+#line 5032 "parse.sql"
178382178882
yymsp[-2].minor.yy454 = yylhsminor.yy454;
178383178883
break;
178384178884
case 218: /* between_op ::= BETWEEN */
178385178885
case 221: /* in_op ::= IN */ yytestcase(yyruleno==221);
178886
+#line 1390 "parse.y"
178386178887
{yymsp[0].minor.yy144 = 0;}
178888
+#line 5039 "parse.sql"
178387178889
break;
178388178890
case 220: /* expr ::= expr between_op expr AND expr */
178891
+#line 1392 "parse.y"
178389178892
{
178390178893
ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy454);
178391178894
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy454);
178392178895
yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy454, 0);
178393178896
if( yymsp[-4].minor.yy454 ){
@@ -178395,12 +178898,14 @@
178395178898
}else{
178396178899
sqlite3ExprListDelete(pParse->db, pList);
178397178900
}
178398178901
if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178399178902
}
178903
+#line 5054 "parse.sql"
178400178904
break;
178401178905
case 223: /* expr ::= expr in_op LP exprlist RP */
178906
+#line 1407 "parse.y"
178402178907
{
178403178908
if( yymsp[-1].minor.yy14==0 ){
178404178909
/* Expressions of the form
178405178910
**
178406178911
** expr1 IN ()
@@ -178441,42 +178946,52 @@
178441178946
}
178442178947
}
178443178948
if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178444178949
}
178445178950
}
178951
+#line 5102 "parse.sql"
178446178952
break;
178447178953
case 224: /* expr ::= LP select RP */
178954
+#line 1451 "parse.y"
178448178955
{
178449178956
yymsp[-2].minor.yy454 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
178450178957
sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy454, yymsp[-1].minor.yy555);
178451178958
}
178959
+#line 5110 "parse.sql"
178452178960
break;
178453178961
case 225: /* expr ::= expr in_op LP select RP */
178962
+#line 1455 "parse.y"
178454178963
{
178455178964
yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy454, 0);
178456178965
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy454, yymsp[-1].minor.yy555);
178457178966
if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178458178967
}
178968
+#line 5119 "parse.sql"
178459178969
break;
178460178970
case 226: /* expr ::= expr in_op nm dbnm paren_exprlist */
178971
+#line 1460 "parse.y"
178461178972
{
178462178973
SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
178463178974
Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
178464178975
if( yymsp[0].minor.yy14 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy14);
178465178976
yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy454, 0);
178466178977
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy454, pSelect);
178467178978
if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178468178979
}
178980
+#line 5131 "parse.sql"
178469178981
break;
178470178982
case 227: /* expr ::= EXISTS LP select RP */
178983
+#line 1468 "parse.y"
178471178984
{
178472178985
Expr *p;
178473178986
p = yymsp[-3].minor.yy454 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
178474178987
sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy555);
178475178988
}
178989
+#line 5140 "parse.sql"
178476178990
break;
178477178991
case 228: /* expr ::= CASE case_operand case_exprlist case_else END */
178992
+#line 1476 "parse.y"
178478178993
{
178479178994
yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy454, 0);
178480178995
if( yymsp[-4].minor.yy454 ){
178481178996
yymsp[-4].minor.yy454->x.pList = yymsp[-1].minor.yy454 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[-1].minor.yy454) : yymsp[-2].minor.yy14;
178482178997
sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy454);
@@ -178483,446 +178998,627 @@
178483178998
}else{
178484178999
sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy14);
178485179000
sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy454);
178486179001
}
178487179002
}
179003
+#line 5154 "parse.sql"
178488179004
break;
178489179005
case 229: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
179006
+#line 1488 "parse.y"
178490179007
{
178491179008
yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, yymsp[-2].minor.yy454);
178492179009
yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, yymsp[0].minor.yy454);
178493179010
}
179011
+#line 5162 "parse.sql"
178494179012
break;
178495179013
case 230: /* case_exprlist ::= WHEN expr THEN expr */
179014
+#line 1492 "parse.y"
178496179015
{
178497179016
yymsp[-3].minor.yy14 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy454);
178498179017
yymsp[-3].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy14, yymsp[0].minor.yy454);
178499179018
}
179019
+#line 5170 "parse.sql"
178500179020
break;
178501179021
case 235: /* nexprlist ::= nexprlist COMMA expr */
179022
+#line 1513 "parse.y"
178502179023
{yymsp[-2].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[0].minor.yy454);}
179024
+#line 5175 "parse.sql"
178503179025
break;
178504179026
case 236: /* nexprlist ::= expr */
179027
+#line 1515 "parse.y"
178505179028
{yymsp[0].minor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy454); /*A-overwrites-Y*/}
179029
+#line 5180 "parse.sql"
178506179030
break;
178507179031
case 238: /* paren_exprlist ::= LP exprlist RP */
178508179032
case 243: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==243);
179033
+#line 1523 "parse.y"
178509179034
{yymsp[-2].minor.yy14 = yymsp[-1].minor.yy14;}
179035
+#line 5186 "parse.sql"
178510179036
break;
178511179037
case 239: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
179038
+#line 1530 "parse.y"
178512179039
{
178513179040
sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
178514179041
sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy14, yymsp[-10].minor.yy144,
178515179042
&yymsp[-11].minor.yy0, yymsp[0].minor.yy454, SQLITE_SO_ASC, yymsp[-8].minor.yy144, SQLITE_IDXTYPE_APPDEF);
178516179043
if( IN_RENAME_OBJECT && pParse->pNewIndex ){
178517179044
sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
178518179045
}
178519179046
}
179047
+#line 5198 "parse.sql"
178520179048
break;
178521179049
case 240: /* uniqueflag ::= UNIQUE */
178522179050
case 282: /* raisetype ::= ABORT */ yytestcase(yyruleno==282);
179051
+#line 1540 "parse.y"
178523179052
{yymsp[0].minor.yy144 = OE_Abort;}
179053
+#line 5204 "parse.sql"
178524179054
break;
178525179055
case 241: /* uniqueflag ::= */
179056
+#line 1541 "parse.y"
178526179057
{yymsp[1].minor.yy144 = OE_None;}
179058
+#line 5209 "parse.sql"
178527179059
break;
178528179060
case 244: /* eidlist ::= eidlist COMMA nm collate sortorder */
179061
+#line 1591 "parse.y"
178529179062
{
178530179063
yymsp[-4].minor.yy14 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy14, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy144, yymsp[0].minor.yy144);
178531179064
}
179065
+#line 5216 "parse.sql"
178532179066
break;
178533179067
case 245: /* eidlist ::= nm collate sortorder */
179068
+#line 1594 "parse.y"
178534179069
{
178535179070
yymsp[-2].minor.yy14 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy144, yymsp[0].minor.yy144); /*A-overwrites-Y*/
178536179071
}
179072
+#line 5223 "parse.sql"
178537179073
break;
178538179074
case 248: /* cmd ::= DROP INDEX ifexists fullname */
179075
+#line 1605 "parse.y"
178539179076
{sqlite3DropIndex(pParse, yymsp[0].minor.yy203, yymsp[-1].minor.yy144);}
179077
+#line 5228 "parse.sql"
178540179078
break;
178541179079
case 249: /* cmd ::= VACUUM vinto */
179080
+#line 1612 "parse.y"
178542179081
{sqlite3Vacuum(pParse,0,yymsp[0].minor.yy454);}
179082
+#line 5233 "parse.sql"
178543179083
break;
178544179084
case 250: /* cmd ::= VACUUM nm vinto */
179085
+#line 1613 "parse.y"
178545179086
{sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy454);}
179087
+#line 5238 "parse.sql"
178546179088
break;
178547179089
case 253: /* cmd ::= PRAGMA nm dbnm */
179090
+#line 1621 "parse.y"
178548179091
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
179092
+#line 5243 "parse.sql"
178549179093
break;
178550179094
case 254: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
179095
+#line 1622 "parse.y"
178551179096
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
179097
+#line 5248 "parse.sql"
178552179098
break;
178553179099
case 255: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
179100
+#line 1623 "parse.y"
178554179101
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
179102
+#line 5253 "parse.sql"
178555179103
break;
178556179104
case 256: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
179105
+#line 1625 "parse.y"
178557179106
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
179107
+#line 5258 "parse.sql"
178558179108
break;
178559179109
case 257: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
179110
+#line 1627 "parse.y"
178560179111
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
179112
+#line 5263 "parse.sql"
178561179113
break;
178562179114
case 260: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
179115
+#line 1643 "parse.y"
178563179116
{
178564179117
Token all;
178565179118
all.z = yymsp[-3].minor.yy0.z;
178566179119
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
178567179120
sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy427, &all);
178568179121
}
179122
+#line 5273 "parse.sql"
178569179123
break;
178570179124
case 261: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
179125
+#line 1652 "parse.y"
178571179126
{
178572179127
sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy144, yymsp[-4].minor.yy286.a, yymsp[-4].minor.yy286.b, yymsp[-2].minor.yy203, yymsp[0].minor.yy454, yymsp[-10].minor.yy144, yymsp[-8].minor.yy144);
178573179128
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
178574179129
}
179130
+#line 5281 "parse.sql"
178575179131
break;
178576179132
case 262: /* trigger_time ::= BEFORE|AFTER */
179133
+#line 1658 "parse.y"
178577179134
{ yymsp[0].minor.yy144 = yymsp[0].major; /*A-overwrites-X*/ }
179135
+#line 5286 "parse.sql"
178578179136
break;
178579179137
case 263: /* trigger_time ::= INSTEAD OF */
179138
+#line 1659 "parse.y"
178580179139
{ yymsp[-1].minor.yy144 = TK_INSTEAD;}
179140
+#line 5291 "parse.sql"
178581179141
break;
178582179142
case 264: /* trigger_time ::= */
179143
+#line 1660 "parse.y"
178583179144
{ yymsp[1].minor.yy144 = TK_BEFORE; }
179145
+#line 5296 "parse.sql"
178584179146
break;
178585179147
case 265: /* trigger_event ::= DELETE|INSERT */
178586179148
case 266: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==266);
179149
+#line 1664 "parse.y"
178587179150
{yymsp[0].minor.yy286.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy286.b = 0;}
179151
+#line 5302 "parse.sql"
178588179152
break;
178589179153
case 267: /* trigger_event ::= UPDATE OF idlist */
179154
+#line 1666 "parse.y"
178590179155
{yymsp[-2].minor.yy286.a = TK_UPDATE; yymsp[-2].minor.yy286.b = yymsp[0].minor.yy132;}
179156
+#line 5307 "parse.sql"
178591179157
break;
178592179158
case 268: /* when_clause ::= */
178593179159
case 287: /* key_opt ::= */ yytestcase(yyruleno==287);
179160
+#line 1673 "parse.y"
178594179161
{ yymsp[1].minor.yy454 = 0; }
179162
+#line 5313 "parse.sql"
178595179163
break;
178596179164
case 269: /* when_clause ::= WHEN expr */
178597179165
case 288: /* key_opt ::= KEY expr */ yytestcase(yyruleno==288);
179166
+#line 1674 "parse.y"
178598179167
{ yymsp[-1].minor.yy454 = yymsp[0].minor.yy454; }
179168
+#line 5319 "parse.sql"
178599179169
break;
178600179170
case 270: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
179171
+#line 1678 "parse.y"
178601179172
{
178602179173
assert( yymsp[-2].minor.yy427!=0 );
178603179174
yymsp[-2].minor.yy427->pLast->pNext = yymsp[-1].minor.yy427;
178604179175
yymsp[-2].minor.yy427->pLast = yymsp[-1].minor.yy427;
178605179176
}
179177
+#line 5328 "parse.sql"
178606179178
break;
178607179179
case 271: /* trigger_cmd_list ::= trigger_cmd SEMI */
179180
+#line 1683 "parse.y"
178608179181
{
178609179182
assert( yymsp[-1].minor.yy427!=0 );
178610179183
yymsp[-1].minor.yy427->pLast = yymsp[-1].minor.yy427;
178611179184
}
179185
+#line 5336 "parse.sql"
178612179186
break;
178613179187
case 272: /* trnm ::= nm DOT nm */
179188
+#line 1694 "parse.y"
178614179189
{
178615179190
yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
178616179191
sqlite3ErrorMsg(pParse,
178617179192
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
178618179193
"statements within triggers");
178619179194
}
179195
+#line 5346 "parse.sql"
178620179196
break;
178621179197
case 273: /* tridxby ::= INDEXED BY nm */
179198
+#line 1706 "parse.y"
178622179199
{
178623179200
sqlite3ErrorMsg(pParse,
178624179201
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
178625179202
"within triggers");
178626179203
}
179204
+#line 5355 "parse.sql"
178627179205
break;
178628179206
case 274: /* tridxby ::= NOT INDEXED */
179207
+#line 1711 "parse.y"
178629179208
{
178630179209
sqlite3ErrorMsg(pParse,
178631179210
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
178632179211
"within triggers");
178633179212
}
179213
+#line 5364 "parse.sql"
178634179214
break;
178635179215
case 275: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
179216
+#line 1724 "parse.y"
178636179217
{yylhsminor.yy427 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy203, yymsp[-3].minor.yy14, yymsp[-1].minor.yy454, yymsp[-7].minor.yy144, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy168);}
179218
+#line 5369 "parse.sql"
178637179219
yymsp[-8].minor.yy427 = yylhsminor.yy427;
178638179220
break;
178639179221
case 276: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
179222
+#line 1728 "parse.y"
178640179223
{
178641179224
yylhsminor.yy427 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy132,yymsp[-2].minor.yy555,yymsp[-6].minor.yy144,yymsp[-1].minor.yy122,yymsp[-7].minor.yy168,yymsp[0].minor.yy168);/*yylhsminor.yy427-overwrites-yymsp[-6].minor.yy144*/
178642179225
}
179226
+#line 5377 "parse.sql"
178643179227
yymsp[-7].minor.yy427 = yylhsminor.yy427;
178644179228
break;
178645179229
case 277: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
179230
+#line 1733 "parse.y"
178646179231
{yylhsminor.yy427 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy454, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy168);}
179232
+#line 5383 "parse.sql"
178647179233
yymsp[-5].minor.yy427 = yylhsminor.yy427;
178648179234
break;
178649179235
case 278: /* trigger_cmd ::= scanpt select scanpt */
179236
+#line 1737 "parse.y"
178650179237
{yylhsminor.yy427 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy555, yymsp[-2].minor.yy168, yymsp[0].minor.yy168); /*yylhsminor.yy427-overwrites-yymsp[-1].minor.yy555*/}
179238
+#line 5389 "parse.sql"
178651179239
yymsp[-2].minor.yy427 = yylhsminor.yy427;
178652179240
break;
178653179241
case 279: /* expr ::= RAISE LP IGNORE RP */
179242
+#line 1740 "parse.y"
178654179243
{
178655179244
yymsp[-3].minor.yy454 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
178656179245
if( yymsp[-3].minor.yy454 ){
178657179246
yymsp[-3].minor.yy454->affExpr = OE_Ignore;
178658179247
}
178659179248
}
179249
+#line 5400 "parse.sql"
178660179250
break;
178661179251
case 280: /* expr ::= RAISE LP raisetype COMMA expr RP */
179252
+#line 1746 "parse.y"
178662179253
{
178663179254
yymsp[-5].minor.yy454 = sqlite3PExpr(pParse, TK_RAISE, yymsp[-1].minor.yy454, 0);
178664179255
if( yymsp[-5].minor.yy454 ) {
178665179256
yymsp[-5].minor.yy454->affExpr = (char)yymsp[-3].minor.yy144;
178666179257
}
178667179258
}
179259
+#line 5410 "parse.sql"
178668179260
break;
178669179261
case 281: /* raisetype ::= ROLLBACK */
179262
+#line 1755 "parse.y"
178670179263
{yymsp[0].minor.yy144 = OE_Rollback;}
179264
+#line 5415 "parse.sql"
178671179265
break;
178672179266
case 283: /* raisetype ::= FAIL */
179267
+#line 1757 "parse.y"
178673179268
{yymsp[0].minor.yy144 = OE_Fail;}
179269
+#line 5420 "parse.sql"
178674179270
break;
178675179271
case 284: /* cmd ::= DROP TRIGGER ifexists fullname */
179272
+#line 1762 "parse.y"
178676179273
{
178677179274
sqlite3DropTrigger(pParse,yymsp[0].minor.yy203,yymsp[-1].minor.yy144);
178678179275
}
179276
+#line 5427 "parse.sql"
178679179277
break;
178680179278
case 285: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
179279
+#line 1769 "parse.y"
178681179280
{
178682179281
sqlite3Attach(pParse, yymsp[-3].minor.yy454, yymsp[-1].minor.yy454, yymsp[0].minor.yy454);
178683179282
}
179283
+#line 5434 "parse.sql"
178684179284
break;
178685179285
case 286: /* cmd ::= DETACH database_kw_opt expr */
179286
+#line 1772 "parse.y"
178686179287
{
178687179288
sqlite3Detach(pParse, yymsp[0].minor.yy454);
178688179289
}
179290
+#line 5441 "parse.sql"
178689179291
break;
178690179292
case 289: /* cmd ::= REINDEX */
179293
+#line 1787 "parse.y"
178691179294
{sqlite3Reindex(pParse, 0, 0);}
179295
+#line 5446 "parse.sql"
178692179296
break;
178693179297
case 290: /* cmd ::= REINDEX nm dbnm */
179298
+#line 1788 "parse.y"
178694179299
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
179300
+#line 5451 "parse.sql"
178695179301
break;
178696179302
case 291: /* cmd ::= ANALYZE */
179303
+#line 1793 "parse.y"
178697179304
{sqlite3Analyze(pParse, 0, 0);}
179305
+#line 5456 "parse.sql"
178698179306
break;
178699179307
case 292: /* cmd ::= ANALYZE nm dbnm */
179308
+#line 1794 "parse.y"
178700179309
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
179310
+#line 5461 "parse.sql"
178701179311
break;
178702179312
case 293: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
179313
+#line 1800 "parse.y"
178703179314
{
178704179315
sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy203,&yymsp[0].minor.yy0);
178705179316
}
179317
+#line 5468 "parse.sql"
178706179318
break;
178707179319
case 294: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
179320
+#line 1804 "parse.y"
178708179321
{
178709179322
yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
178710179323
sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
178711179324
}
179325
+#line 5476 "parse.sql"
178712179326
break;
178713179327
case 295: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
179328
+#line 1808 "parse.y"
178714179329
{
178715179330
sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy203, &yymsp[0].minor.yy0);
178716179331
}
179332
+#line 5483 "parse.sql"
178717179333
break;
178718179334
case 296: /* add_column_fullname ::= fullname */
179335
+#line 1812 "parse.y"
178719179336
{
178720179337
disableLookaside(pParse);
178721179338
sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy203);
178722179339
}
179340
+#line 5491 "parse.sql"
178723179341
break;
178724179342
case 297: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
179343
+#line 1816 "parse.y"
178725179344
{
178726179345
sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy203, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
178727179346
}
179347
+#line 5498 "parse.sql"
178728179348
break;
178729179349
case 298: /* cmd ::= create_vtab */
179350
+#line 1828 "parse.y"
178730179351
{sqlite3VtabFinishParse(pParse,0);}
179352
+#line 5503 "parse.sql"
178731179353
break;
178732179354
case 299: /* cmd ::= create_vtab LP vtabarglist RP */
179355
+#line 1829 "parse.y"
178733179356
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
179357
+#line 5508 "parse.sql"
178734179358
break;
178735179359
case 300: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
179360
+#line 1831 "parse.y"
178736179361
{
178737179362
sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy144);
178738179363
}
179364
+#line 5515 "parse.sql"
178739179365
break;
178740179366
case 301: /* vtabarg ::= */
179367
+#line 1836 "parse.y"
178741179368
{sqlite3VtabArgInit(pParse);}
179369
+#line 5520 "parse.sql"
178742179370
break;
178743179371
case 302: /* vtabargtoken ::= ANY */
178744179372
case 303: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==303);
178745179373
case 304: /* lp ::= LP */ yytestcase(yyruleno==304);
179374
+#line 1838 "parse.y"
178746179375
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
179376
+#line 5527 "parse.sql"
178747179377
break;
178748179378
case 305: /* with ::= WITH wqlist */
178749179379
case 306: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==306);
179380
+#line 1855 "parse.y"
178750179381
{ sqlite3WithPush(pParse, yymsp[0].minor.yy59, 1); }
179382
+#line 5533 "parse.sql"
178751179383
break;
178752179384
case 307: /* wqas ::= AS */
179385
+#line 1859 "parse.y"
178753179386
{yymsp[0].minor.yy462 = M10d_Any;}
179387
+#line 5538 "parse.sql"
178754179388
break;
178755179389
case 308: /* wqas ::= AS MATERIALIZED */
179390
+#line 1860 "parse.y"
178756179391
{yymsp[-1].minor.yy462 = M10d_Yes;}
179392
+#line 5543 "parse.sql"
178757179393
break;
178758179394
case 309: /* wqas ::= AS NOT MATERIALIZED */
179395
+#line 1861 "parse.y"
178759179396
{yymsp[-2].minor.yy462 = M10d_No;}
179397
+#line 5548 "parse.sql"
178760179398
break;
178761179399
case 310: /* wqitem ::= withnm eidlist_opt wqas LP select RP */
179400
+#line 1862 "parse.y"
178762179401
{
178763179402
yymsp[-5].minor.yy67 = sqlite3CteNew(pParse, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy14, yymsp[-1].minor.yy555, yymsp[-3].minor.yy462); /*A-overwrites-X*/
178764179403
}
179404
+#line 5555 "parse.sql"
178765179405
break;
178766179406
case 311: /* withnm ::= nm */
179407
+#line 1865 "parse.y"
178767179408
{pParse->bHasWith = 1;}
179409
+#line 5560 "parse.sql"
178768179410
break;
178769179411
case 312: /* wqlist ::= wqitem */
179412
+#line 1866 "parse.y"
178770179413
{
178771179414
yymsp[0].minor.yy59 = sqlite3WithAdd(pParse, 0, yymsp[0].minor.yy67); /*A-overwrites-X*/
178772179415
}
179416
+#line 5567 "parse.sql"
178773179417
break;
178774179418
case 313: /* wqlist ::= wqlist COMMA wqitem */
179419
+#line 1869 "parse.y"
178775179420
{
178776179421
yymsp[-2].minor.yy59 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy59, yymsp[0].minor.yy67);
178777179422
}
179423
+#line 5574 "parse.sql"
178778179424
break;
178779179425
case 314: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
179426
+#line 1884 "parse.y"
178780179427
{
178781179428
assert( yymsp[0].minor.yy211!=0 );
178782179429
sqlite3WindowChain(pParse, yymsp[0].minor.yy211, yymsp[-2].minor.yy211);
178783179430
yymsp[0].minor.yy211->pNextWin = yymsp[-2].minor.yy211;
178784179431
yylhsminor.yy211 = yymsp[0].minor.yy211;
178785179432
}
179433
+#line 5584 "parse.sql"
178786179434
yymsp[-2].minor.yy211 = yylhsminor.yy211;
178787179435
break;
178788179436
case 315: /* windowdefn ::= nm AS LP window RP */
179437
+#line 1893 "parse.y"
178789179438
{
178790179439
if( ALWAYS(yymsp[-1].minor.yy211) ){
178791179440
yymsp[-1].minor.yy211->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
178792179441
}
178793179442
yylhsminor.yy211 = yymsp[-1].minor.yy211;
178794179443
}
179444
+#line 5595 "parse.sql"
178795179445
yymsp[-4].minor.yy211 = yylhsminor.yy211;
178796179446
break;
178797179447
case 316: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
179448
+#line 1927 "parse.y"
178798179449
{
178799179450
yymsp[-4].minor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, yymsp[-2].minor.yy14, yymsp[-1].minor.yy14, 0);
178800179451
}
179452
+#line 5603 "parse.sql"
178801179453
break;
178802179454
case 317: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
179455
+#line 1930 "parse.y"
178803179456
{
178804179457
yylhsminor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, yymsp[-2].minor.yy14, yymsp[-1].minor.yy14, &yymsp[-5].minor.yy0);
178805179458
}
179459
+#line 5610 "parse.sql"
178806179460
yymsp[-5].minor.yy211 = yylhsminor.yy211;
178807179461
break;
178808179462
case 318: /* window ::= ORDER BY sortlist frame_opt */
179463
+#line 1933 "parse.y"
178809179464
{
178810179465
yymsp[-3].minor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, 0, yymsp[-1].minor.yy14, 0);
178811179466
}
179467
+#line 5618 "parse.sql"
178812179468
break;
178813179469
case 319: /* window ::= nm ORDER BY sortlist frame_opt */
179470
+#line 1936 "parse.y"
178814179471
{
178815179472
yylhsminor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, 0, yymsp[-1].minor.yy14, &yymsp[-4].minor.yy0);
178816179473
}
179474
+#line 5625 "parse.sql"
178817179475
yymsp[-4].minor.yy211 = yylhsminor.yy211;
178818179476
break;
178819179477
case 320: /* window ::= nm frame_opt */
179478
+#line 1940 "parse.y"
178820179479
{
178821179480
yylhsminor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, 0, 0, &yymsp[-1].minor.yy0);
178822179481
}
179482
+#line 5633 "parse.sql"
178823179483
yymsp[-1].minor.yy211 = yylhsminor.yy211;
178824179484
break;
178825179485
case 321: /* frame_opt ::= */
179486
+#line 1944 "parse.y"
178826179487
{
178827179488
yymsp[1].minor.yy211 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
178828179489
}
179490
+#line 5641 "parse.sql"
178829179491
break;
178830179492
case 322: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
179493
+#line 1947 "parse.y"
178831179494
{
178832179495
yylhsminor.yy211 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy144, yymsp[-1].minor.yy509.eType, yymsp[-1].minor.yy509.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy462);
178833179496
}
179497
+#line 5648 "parse.sql"
178834179498
yymsp[-2].minor.yy211 = yylhsminor.yy211;
178835179499
break;
178836179500
case 323: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
179501
+#line 1951 "parse.y"
178837179502
{
178838179503
yylhsminor.yy211 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy144, yymsp[-3].minor.yy509.eType, yymsp[-3].minor.yy509.pExpr, yymsp[-1].minor.yy509.eType, yymsp[-1].minor.yy509.pExpr, yymsp[0].minor.yy462);
178839179504
}
179505
+#line 5656 "parse.sql"
178840179506
yymsp[-5].minor.yy211 = yylhsminor.yy211;
178841179507
break;
178842179508
case 325: /* frame_bound_s ::= frame_bound */
178843179509
case 327: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==327);
179510
+#line 1957 "parse.y"
178844179511
{yylhsminor.yy509 = yymsp[0].minor.yy509;}
179512
+#line 5663 "parse.sql"
178845179513
yymsp[0].minor.yy509 = yylhsminor.yy509;
178846179514
break;
178847179515
case 326: /* frame_bound_s ::= UNBOUNDED PRECEDING */
178848179516
case 328: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==328);
178849179517
case 330: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==330);
179518
+#line 1958 "parse.y"
178850179519
{yylhsminor.yy509.eType = yymsp[-1].major; yylhsminor.yy509.pExpr = 0;}
179520
+#line 5671 "parse.sql"
178851179521
yymsp[-1].minor.yy509 = yylhsminor.yy509;
178852179522
break;
178853179523
case 329: /* frame_bound ::= expr PRECEDING|FOLLOWING */
179524
+#line 1963 "parse.y"
178854179525
{yylhsminor.yy509.eType = yymsp[0].major; yylhsminor.yy509.pExpr = yymsp[-1].minor.yy454;}
179526
+#line 5677 "parse.sql"
178855179527
yymsp[-1].minor.yy509 = yylhsminor.yy509;
178856179528
break;
178857179529
case 331: /* frame_exclude_opt ::= */
179530
+#line 1967 "parse.y"
178858179531
{yymsp[1].minor.yy462 = 0;}
179532
+#line 5683 "parse.sql"
178859179533
break;
178860179534
case 332: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
179535
+#line 1968 "parse.y"
178861179536
{yymsp[-1].minor.yy462 = yymsp[0].minor.yy462;}
179537
+#line 5688 "parse.sql"
178862179538
break;
178863179539
case 333: /* frame_exclude ::= NO OTHERS */
178864179540
case 334: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==334);
179541
+#line 1971 "parse.y"
178865179542
{yymsp[-1].minor.yy462 = yymsp[-1].major; /*A-overwrites-X*/}
179543
+#line 5694 "parse.sql"
178866179544
break;
178867179545
case 335: /* frame_exclude ::= GROUP|TIES */
179546
+#line 1973 "parse.y"
178868179547
{yymsp[0].minor.yy462 = yymsp[0].major; /*A-overwrites-X*/}
179548
+#line 5699 "parse.sql"
178869179549
break;
178870179550
case 336: /* window_clause ::= WINDOW windowdefn_list */
179551
+#line 1978 "parse.y"
178871179552
{ yymsp[-1].minor.yy211 = yymsp[0].minor.yy211; }
179553
+#line 5704 "parse.sql"
178872179554
break;
178873179555
case 337: /* filter_over ::= filter_clause over_clause */
179556
+#line 1980 "parse.y"
178874179557
{
178875179558
if( yymsp[0].minor.yy211 ){
178876179559
yymsp[0].minor.yy211->pFilter = yymsp[-1].minor.yy454;
178877179560
}else{
178878179561
sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy454);
178879179562
}
178880179563
yylhsminor.yy211 = yymsp[0].minor.yy211;
178881179564
}
179565
+#line 5716 "parse.sql"
178882179566
yymsp[-1].minor.yy211 = yylhsminor.yy211;
178883179567
break;
178884179568
case 338: /* filter_over ::= over_clause */
179569
+#line 1988 "parse.y"
178885179570
{
178886179571
yylhsminor.yy211 = yymsp[0].minor.yy211;
178887179572
}
179573
+#line 5724 "parse.sql"
178888179574
yymsp[0].minor.yy211 = yylhsminor.yy211;
178889179575
break;
178890179576
case 339: /* filter_over ::= filter_clause */
179577
+#line 1991 "parse.y"
178891179578
{
178892179579
yylhsminor.yy211 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
178893179580
if( yylhsminor.yy211 ){
178894179581
yylhsminor.yy211->eFrmType = TK_FILTER;
178895179582
yylhsminor.yy211->pFilter = yymsp[0].minor.yy454;
178896179583
}else{
178897179584
sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy454);
178898179585
}
178899179586
}
179587
+#line 5738 "parse.sql"
178900179588
yymsp[0].minor.yy211 = yylhsminor.yy211;
178901179589
break;
178902179590
case 340: /* over_clause ::= OVER LP window RP */
179591
+#line 2001 "parse.y"
178903179592
{
178904179593
yymsp[-3].minor.yy211 = yymsp[-1].minor.yy211;
178905179594
assert( yymsp[-3].minor.yy211!=0 );
178906179595
}
179596
+#line 5747 "parse.sql"
178907179597
break;
178908179598
case 341: /* over_clause ::= OVER nm */
179599
+#line 2005 "parse.y"
178909179600
{
178910179601
yymsp[-1].minor.yy211 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
178911179602
if( yymsp[-1].minor.yy211 ){
178912179603
yymsp[-1].minor.yy211->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
178913179604
}
178914179605
}
179606
+#line 5757 "parse.sql"
178915179607
break;
178916179608
case 342: /* filter_clause ::= FILTER LP WHERE expr RP */
179609
+#line 2012 "parse.y"
178917179610
{ yymsp[-4].minor.yy454 = yymsp[-1].minor.yy454; }
179611
+#line 5762 "parse.sql"
178918179612
break;
178919179613
case 343: /* term ::= QNUMBER */
179614
+#line 2038 "parse.y"
178920179615
{
178921179616
yylhsminor.yy454=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0);
178922179617
sqlite3DequoteNumber(pParse, yylhsminor.yy454);
178923179618
}
179619
+#line 5770 "parse.sql"
178924179620
yymsp[0].minor.yy454 = yylhsminor.yy454;
178925179621
break;
178926179622
default:
178927179623
/* (344) input ::= cmdlist */ yytestcase(yyruleno==344);
178928179624
/* (345) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==345);
@@ -179046,17 +179742,19 @@
179046179742
){
179047179743
sqlite3ParserARG_FETCH
179048179744
sqlite3ParserCTX_FETCH
179049179745
#define TOKEN yyminor
179050179746
/************ Begin %syntax_error code ****************************************/
179747
+#line 43 "parse.y"
179051179748
179052179749
UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
179053179750
if( TOKEN.z[0] ){
179054179751
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
179055179752
}else{
179056179753
sqlite3ErrorMsg(pParse, "incomplete input");
179057179754
}
179755
+#line 5906 "parse.sql"
179058179756
/************ End %syntax_error code ******************************************/
179059179757
sqlite3ParserARG_STORE /* Suppress warning about unused %extra_argument variable */
179060179758
sqlite3ParserCTX_STORE
179061179759
}
179062179760
@@ -179324,10 +180022,11 @@
179324180022
#endif
179325180023
}
179326180024
179327180025
/************** End of parse.c ***********************************************/
179328180026
/************** Begin file tokenize.c ****************************************/
180027
+#line 1 "tsrc/tokenize.c"
179329180028
/*
179330180029
** 2001 September 15
179331180030
**
179332180031
** The author disclaims copyright to this source code. In place of
179333180032
** a legal notice, here is a blessing:
@@ -179473,10 +180172,11 @@
179473180172
** named keywordhash.h and then included into this source file by
179474180173
** the #include below.
179475180174
*/
179476180175
/************** Include keywordhash.h in the middle of tokenize.c ************/
179477180176
/************** Begin file keywordhash.h *************************************/
180177
+#line 1 "tsrc/keywordhash.h"
179478180178
/***** This file contains automatically generated code ******
179479180179
**
179480180180
** The code in this file has been automatically generated by
179481180181
**
179482180182
** sqlite/tool/mkkeywordhash.c
@@ -179958,10 +180658,11 @@
179958180658
return TK_ID!=sqlite3KeywordCode((const u8*)zName, nName);
179959180659
}
179960180660
179961180661
/************** End of keywordhash.h *****************************************/
179962180662
/************** Continuing where we left off in tokenize.c *******************/
180663
+#line 149 "tsrc/tokenize.c"
179963180664
179964180665
179965180666
/*
179966180667
** If X is a character that can be used in an identifier then
179967180668
** IdChar(X) will be true. Otherwise it is false.
@@ -180701,10 +181402,11 @@
180701181402
}
180702181403
#endif /* SQLITE_ENABLE_NORMALIZE */
180703181404
180704181405
/************** End of tokenize.c ********************************************/
180705181406
/************** Begin file complete.c ****************************************/
181407
+#line 1 "tsrc/complete.c"
180706181408
/*
180707181409
** 2001 September 15
180708181410
**
180709181411
** The author disclaims copyright to this source code. In place of
180710181412
** a legal notice, here is a blessing:
@@ -180994,10 +181696,11 @@
180994181696
#endif /* SQLITE_OMIT_UTF16 */
180995181697
#endif /* SQLITE_OMIT_COMPLETE */
180996181698
180997181699
/************** End of complete.c ********************************************/
180998181700
/************** Begin file main.c ********************************************/
181701
+#line 1 "tsrc/main.c"
180999181702
/*
181000181703
** 2001 September 15
181001181704
**
181002181705
** The author disclaims copyright to this source code. In place of
181003181706
** a legal notice, here is a blessing:
@@ -181015,10 +181718,11 @@
181015181718
/* #include "sqliteInt.h" */
181016181719
181017181720
#ifdef SQLITE_ENABLE_FTS3
181018181721
/************** Include fts3.h in the middle of main.c ***********************/
181019181722
/************** Begin file fts3.h ********************************************/
181723
+#line 1 "tsrc/fts3.h"
181020181724
/*
181021181725
** 2006 Oct 10
181022181726
**
181023181727
** The author disclaims copyright to this source code. In place of
181024181728
** a legal notice, here is a blessing:
@@ -181044,14 +181748,16 @@
181044181748
} /* extern "C" */
181045181749
#endif /* __cplusplus */
181046181750
181047181751
/************** End of fts3.h ************************************************/
181048181752
/************** Continuing where we left off in main.c ***********************/
181753
+#line 21 "tsrc/main.c"
181049181754
#endif
181050181755
#ifdef SQLITE_ENABLE_RTREE
181051181756
/************** Include rtree.h in the middle of main.c **********************/
181052181757
/************** Begin file rtree.h *******************************************/
181758
+#line 1 "tsrc/rtree.h"
181053181759
/*
181054181760
** 2008 May 26
181055181761
**
181056181762
** The author disclaims copyright to this source code. In place of
181057181763
** a legal notice, here is a blessing:
@@ -181081,14 +181787,16 @@
181081181787
} /* extern "C" */
181082181788
#endif /* __cplusplus */
181083181789
181084181790
/************** End of rtree.h ***********************************************/
181085181791
/************** Continuing where we left off in main.c ***********************/
181792
+#line 24 "tsrc/main.c"
181086181793
#endif
181087181794
#if defined(SQLITE_ENABLE_ICU) || defined(SQLITE_ENABLE_ICU_COLLATIONS)
181088181795
/************** Include sqliteicu.h in the middle of main.c ******************/
181089181796
/************** Begin file sqliteicu.h ***************************************/
181797
+#line 1 "tsrc/sqliteicu.h"
181090181798
/*
181091181799
** 2008 May 26
181092181800
**
181093181801
** The author disclaims copyright to this source code. In place of
181094181802
** a legal notice, here is a blessing:
@@ -181114,10 +181822,11 @@
181114181822
} /* extern "C" */
181115181823
#endif /* __cplusplus */
181116181824
181117181825
/************** End of sqliteicu.h *******************************************/
181118181826
/************** Continuing where we left off in main.c ***********************/
181827
+#line 27 "tsrc/main.c"
181119181828
#endif
181120181829
181121181830
/*
181122181831
** This is an extension initializer that is a no-op and always
181123181832
** succeeds, except that it fails if the fault-simulation is set
@@ -182513,14 +183222,10 @@
182513183222
#endif
182514183223
182515183224
sqlite3Error(db, SQLITE_OK); /* Deallocates any cached error strings. */
182516183225
sqlite3ValueFree(db->pErr);
182517183226
sqlite3CloseExtensions(db);
182518
-#if SQLITE_USER_AUTHENTICATION
182519
- sqlite3_free(db->auth.zAuthUser);
182520
- sqlite3_free(db->auth.zAuthPW);
182521
-#endif
182522183227
182523183228
db->eOpenState = SQLITE_STATE_ERROR;
182524183229
182525183230
/* The temp-database schema is allocated differently from the other schema
182526183231
** objects (using sqliteMalloc() directly, instead of sqlite3BtreeSchema()).
@@ -186168,10 +186873,11 @@
186168186873
}
186169186874
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
186170186875
186171186876
/************** End of main.c ************************************************/
186172186877
/************** Begin file notify.c ******************************************/
186878
+#line 1 "tsrc/notify.c"
186173186879
/*
186174186880
** 2009 March 3
186175186881
**
186176186882
** The author disclaims copyright to this source code. In place of
186177186883
** a legal notice, here is a blessing:
@@ -186506,10 +187212,11 @@
186506187212
}
186507187213
#endif
186508187214
186509187215
/************** End of notify.c **********************************************/
186510187216
/************** Begin file fts3.c ********************************************/
187217
+#line 1 "tsrc/fts3.c"
186511187218
/*
186512187219
** 2006 Oct 10
186513187220
**
186514187221
** The author disclaims copyright to this source code. In place of
186515187222
** a legal notice, here is a blessing:
@@ -186798,10 +187505,11 @@
186798187505
** older data.
186799187506
*/
186800187507
186801187508
/************** Include fts3Int.h in the middle of fts3.c ********************/
186802187509
/************** Begin file fts3Int.h *****************************************/
187510
+#line 1 "tsrc/fts3Int.h"
186803187511
/*
186804187512
** 2009 Nov 12
186805187513
**
186806187514
** The author disclaims copyright to this source code. In place of
186807187515
** a legal notice, here is a blessing:
@@ -186844,10 +187552,11 @@
186844187552
#endif
186845187553
186846187554
/* #include "sqlite3.h" */
186847187555
/************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
186848187556
/************** Begin file fts3_tokenizer.h **********************************/
187557
+#line 1 "tsrc/fts3_tokenizer.h"
186849187558
/*
186850187559
** 2006 July 10
186851187560
**
186852187561
** The author disclaims copyright to this source code.
186853187562
**
@@ -187008,12 +187717,14 @@
187008187717
187009187718
#endif /* _FTS3_TOKENIZER_H_ */
187010187719
187011187720
/************** End of fts3_tokenizer.h **************************************/
187012187721
/************** Continuing where we left off in fts3Int.h ********************/
187722
+#line 46 "tsrc/fts3Int.h"
187013187723
/************** Include fts3_hash.h in the middle of fts3Int.h ***************/
187014187724
/************** Begin file fts3_hash.h ***************************************/
187725
+#line 1 "tsrc/fts3_hash.h"
187015187726
/*
187016187727
** 2001 September 22
187017187728
**
187018187729
** The author disclaims copyright to this source code. In place of
187019187730
** a legal notice, here is a blessing:
@@ -187125,10 +187836,11 @@
187125187836
187126187837
#endif /* _FTS3_HASH_H_ */
187127187838
187128187839
/************** End of fts3_hash.h *******************************************/
187129187840
/************** Continuing where we left off in fts3Int.h ********************/
187841
+#line 47 "tsrc/fts3Int.h"
187130187842
187131187843
/*
187132187844
** This constant determines the maximum depth of an FTS expression tree
187133187845
** that the library will create and use. FTS uses recursion to perform
187134187846
** various operations on the query tree, so the disadvantage of a large
@@ -187741,10 +188453,11 @@
187741188453
#endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
187742188454
#endif /* _FTSINT_H */
187743188455
187744188456
/************** End of fts3Int.h *********************************************/
187745188457
/************** Continuing where we left off in fts3.c ***********************/
188458
+#line 292 "tsrc/fts3.c"
187746188459
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
187747188460
187748188461
#if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
187749188462
# define SQLITE_CORE 1
187750188463
#endif
@@ -193621,11 +194334,11 @@
193621194334
SQLITE_PRIVATE int sqlite3Fts3Corrupt(){
193622194335
return SQLITE_CORRUPT_VTAB;
193623194336
}
193624194337
#endif
193625194338
193626
-#if !SQLITE_CORE
194339
+#if !defined(SQLITE_CORE)
193627194340
/*
193628194341
** Initialize API pointer table, if required.
193629194342
*/
193630194343
#ifdef _WIN32
193631194344
__declspec(dllexport)
@@ -193642,10 +194355,11 @@
193642194355
193643194356
#endif
193644194357
193645194358
/************** End of fts3.c ************************************************/
193646194359
/************** Begin file fts3_aux.c ****************************************/
194360
+#line 1 "tsrc/fts3_aux.c"
193647194361
/*
193648194362
** 2011 Jan 27
193649194363
**
193650194364
** The author disclaims copyright to this source code. In place of
193651194365
** a legal notice, here is a blessing:
@@ -194202,10 +194916,11 @@
194202194916
194203194917
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
194204194918
194205194919
/************** End of fts3_aux.c ********************************************/
194206194920
/************** Begin file fts3_expr.c ***************************************/
194921
+#line 1 "tsrc/fts3_expr.c"
194207194922
/*
194208194923
** 2008 Nov 28
194209194924
**
194210194925
** The author disclaims copyright to this source code. In place of
194211194926
** a legal notice, here is a blessing:
@@ -195498,10 +196213,11 @@
195498196213
#endif
195499196214
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
195500196215
195501196216
/************** End of fts3_expr.c *******************************************/
195502196217
/************** Begin file fts3_hash.c ***************************************/
196218
+#line 1 "tsrc/fts3_hash.c"
195503196219
/*
195504196220
** 2001 September 22
195505196221
**
195506196222
** The author disclaims copyright to this source code. In place of
195507196223
** a legal notice, here is a blessing:
@@ -195884,10 +196600,11 @@
195884196600
195885196601
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
195886196602
195887196603
/************** End of fts3_hash.c *******************************************/
195888196604
/************** Begin file fts3_porter.c *************************************/
196605
+#line 1 "tsrc/fts3_porter.c"
195889196606
/*
195890196607
** 2006 September 30
195891196608
**
195892196609
** The author disclaims copyright to this source code. In place of
195893196610
** a legal notice, here is a blessing:
@@ -196549,10 +197266,11 @@
196549197266
196550197267
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
196551197268
196552197269
/************** End of fts3_porter.c *****************************************/
196553197270
/************** Begin file fts3_tokenizer.c **********************************/
197271
+#line 1 "tsrc/fts3_tokenizer.c"
196554197272
/*
196555197273
** 2007 June 22
196556197274
**
196557197275
** The author disclaims copyright to this source code. In place of
196558197276
** a legal notice, here is a blessing:
@@ -197068,10 +197786,11 @@
197068197786
197069197787
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
197070197788
197071197789
/************** End of fts3_tokenizer.c **************************************/
197072197790
/************** Begin file fts3_tokenizer1.c *********************************/
197791
+#line 1 "tsrc/fts3_tokenizer1.c"
197073197792
/*
197074197793
** 2006 Oct 10
197075197794
**
197076197795
** The author disclaims copyright to this source code. In place of
197077197796
** a legal notice, here is a blessing:
@@ -197305,10 +198024,11 @@
197305198024
197306198025
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
197307198026
197308198027
/************** End of fts3_tokenizer1.c *************************************/
197309198028
/************** Begin file fts3_tokenize_vtab.c ******************************/
198029
+#line 1 "tsrc/fts3_tokenize_vtab.c"
197310198030
/*
197311198031
** 2013 Apr 22
197312198032
**
197313198033
** The author disclaims copyright to this source code. In place of
197314198034
** a legal notice, here is a blessing:
@@ -197767,10 +198487,11 @@
197767198487
197768198488
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
197769198489
197770198490
/************** End of fts3_tokenize_vtab.c **********************************/
197771198491
/************** Begin file fts3_write.c **************************************/
198492
+#line 1 "tsrc/fts3_write.c"
197772198493
/*
197773198494
** 2009 Oct 23
197774198495
**
197775198496
** The author disclaims copyright to this source code. In place of
197776198497
** a legal notice, here is a blessing:
@@ -203604,10 +204325,11 @@
203604204325
203605204326
#endif
203606204327
203607204328
/************** End of fts3_write.c ******************************************/
203608204329
/************** Begin file fts3_snippet.c ************************************/
204330
+#line 1 "tsrc/fts3_snippet.c"
203609204331
/*
203610204332
** 2009 Oct 23
203611204333
**
203612204334
** The author disclaims copyright to this source code. In place of
203613204335
** a legal notice, here is a blessing:
@@ -205363,10 +206085,11 @@
205363206085
205364206086
#endif
205365206087
205366206088
/************** End of fts3_snippet.c ****************************************/
205367206089
/************** Begin file fts3_unicode.c ************************************/
206090
+#line 1 "tsrc/fts3_unicode.c"
205368206091
/*
205369206092
** 2012 May 24
205370206093
**
205371206094
** The author disclaims copyright to this source code. In place of
205372206095
** a legal notice, here is a blessing:
@@ -205763,10 +206486,11 @@
205763206486
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
205764206487
#endif /* ifndef SQLITE_DISABLE_FTS3_UNICODE */
205765206488
205766206489
/************** End of fts3_unicode.c ****************************************/
205767206490
/************** Begin file fts3_unicode2.c ***********************************/
206491
+#line 1 "tsrc/fts3_unicode2.c"
205768206492
/*
205769206493
** 2012-05-25
205770206494
**
205771206495
** The author disclaims copyright to this source code. In place of
205772206496
** a legal notice, here is a blessing:
@@ -206149,10 +206873,11 @@
206149206873
#endif /* defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4) */
206150206874
#endif /* !defined(SQLITE_DISABLE_FTS3_UNICODE) */
206151206875
206152206876
/************** End of fts3_unicode2.c ***************************************/
206153206877
/************** Begin file json.c ********************************************/
206878
+#line 1 "tsrc/json.c"
206154206879
/*
206155206880
** 2015-08-12
206156206881
**
206157206882
** The author disclaims copyright to this source code. In place of
206158206883
** a legal notice, here is a blessing:
@@ -211618,10 +212343,11 @@
211618212343
}
211619212344
#endif /* !defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_OMIT_JSON) */
211620212345
211621212346
/************** End of json.c ************************************************/
211622212347
/************** Begin file rtree.c *******************************************/
212348
+#line 1 "tsrc/rtree.c"
211623212349
/*
211624212350
** 2001 September 15
211625212351
**
211626212352
** The author disclaims copyright to this source code. In place of
211627212353
** a legal notice, here is a blessing:
@@ -215906,10 +216632,11 @@
215906216632
215907216633
/* Conditionally include the geopoly code */
215908216634
#ifdef SQLITE_ENABLE_GEOPOLY
215909216635
/************** Include geopoly.c in the middle of rtree.c *******************/
215910216636
/************** Begin file geopoly.c *****************************************/
216637
+#line 1 "tsrc/geopoly.c"
215911216638
/*
215912216639
** 2018-05-25
215913216640
**
215914216641
** The author disclaims copyright to this source code. In place of
215915216642
** a legal notice, here is a blessing:
@@ -217748,10 +218475,11 @@
217748218475
return rc;
217749218476
}
217750218477
217751218478
/************** End of geopoly.c *********************************************/
217752218479
/************** Continuing where we left off in rtree.c **********************/
218480
+#line 4288 "tsrc/rtree.c"
217753218481
#endif
217754218482
217755218483
/*
217756218484
** Register the r-tree module with database handle db. This creates the
217757218485
** virtual table module "rtree" and the debugging/analysis scalar
@@ -217912,11 +218640,11 @@
217912218640
return sqlite3_create_function_v2(db, zQueryFunc, -1, SQLITE_ANY,
217913218641
(void *)pGeomCtx, geomCallback, 0, 0, rtreeFreeCallback
217914218642
);
217915218643
}
217916218644
217917
-#if !SQLITE_CORE
218645
+#ifndef SQLITE_CORE
217918218646
#ifdef _WIN32
217919218647
__declspec(dllexport)
217920218648
#endif
217921218649
SQLITE_API int sqlite3_rtree_init(
217922218650
sqlite3 *db,
@@ -217930,10 +218658,11 @@
217930218658
217931218659
#endif
217932218660
217933218661
/************** End of rtree.c ***********************************************/
217934218662
/************** Begin file icu.c *********************************************/
218663
+#line 1 "tsrc/icu.c"
217935218664
/*
217936218665
** 2007 May 6
217937218666
**
217938218667
** The author disclaims copyright to this source code. In place of
217939218668
** a legal notice, here is a blessing:
@@ -218503,11 +219232,11 @@
218503219232
}
218504219233
218505219234
return rc;
218506219235
}
218507219236
218508
-#if !SQLITE_CORE
219237
+#ifndef SQLITE_CORE
218509219238
#ifdef _WIN32
218510219239
__declspec(dllexport)
218511219240
#endif
218512219241
SQLITE_API int sqlite3_icu_init(
218513219242
sqlite3 *db,
@@ -218521,10 +219250,11 @@
218521219250
218522219251
#endif
218523219252
218524219253
/************** End of icu.c *************************************************/
218525219254
/************** Begin file fts3_icu.c ****************************************/
219255
+#line 1 "tsrc/fts3_icu.c"
218526219256
/*
218527219257
** 2007 June 22
218528219258
**
218529219259
** The author disclaims copyright to this source code. In place of
218530219260
** a legal notice, here is a blessing:
@@ -218786,10 +219516,11 @@
218786219516
#endif /* defined(SQLITE_ENABLE_ICU) */
218787219517
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
218788219518
218789219519
/************** End of fts3_icu.c ********************************************/
218790219520
/************** Begin file sqlite3rbu.c **************************************/
219521
+#line 1 "tsrc/sqlite3rbu.c"
218791219522
/*
218792219523
** 2014 August 30
218793219524
**
218794219525
** The author disclaims copyright to this source code. In place of
218795219526
** a legal notice, here is a blessing:
@@ -218877,10 +219608,11 @@
218877219608
/* #include "sqlite3.h" */
218878219609
218879219610
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU)
218880219611
/************** Include sqlite3rbu.h in the middle of sqlite3rbu.c ***********/
218881219612
/************** Begin file sqlite3rbu.h **************************************/
219613
+#line 1 "tsrc/sqlite3rbu.h"
218882219614
/*
218883219615
** 2014 August 30
218884219616
**
218885219617
** The author disclaims copyright to this source code. In place of
218886219618
** a legal notice, here is a blessing:
@@ -219513,10 +220245,11 @@
219513220245
219514220246
#endif /* _SQLITE3RBU_H */
219515220247
219516220248
/************** End of sqlite3rbu.h ******************************************/
219517220249
/************** Continuing where we left off in sqlite3rbu.c *****************/
220250
+#line 91 "tsrc/sqlite3rbu.c"
219518220251
219519220252
#if defined(_WIN32_WCE)
219520220253
/* #include "windows.h" */
219521220254
#endif
219522220255
@@ -224873,10 +225606,11 @@
224873225606
224874225607
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) */
224875225608
224876225609
/************** End of sqlite3rbu.c ******************************************/
224877225610
/************** Begin file dbstat.c ******************************************/
225611
+#line 1 "tsrc/dbstat.c"
224878225612
/*
224879225613
** 2010 July 12
224880225614
**
224881225615
** The author disclaims copyright to this source code. In place of
224882225616
** a legal notice, here is a blessing:
@@ -225782,10 +226516,11 @@
225782226516
SQLITE_PRIVATE int sqlite3DbstatRegister(sqlite3 *db){ return SQLITE_OK; }
225783226517
#endif /* SQLITE_ENABLE_DBSTAT_VTAB */
225784226518
225785226519
/************** End of dbstat.c **********************************************/
225786226520
/************** Begin file dbpage.c ******************************************/
226521
+#line 1 "tsrc/dbpage.c"
225787226522
/*
225788226523
** 2017-10-11
225789226524
**
225790226525
** The author disclaims copyright to this source code. In place of
225791226526
** a legal notice, here is a blessing:
@@ -226264,10 +226999,11 @@
226264226999
SQLITE_PRIVATE int sqlite3DbpageRegister(sqlite3 *db){ return SQLITE_OK; }
226265227000
#endif /* SQLITE_ENABLE_DBSTAT_VTAB */
226266227001
226267227002
/************** End of dbpage.c **********************************************/
226268227003
/************** Begin file sqlite3session.c **********************************/
227004
+#line 1 "tsrc/sqlite3session.c"
226269227005
226270227006
#if defined(SQLITE_ENABLE_SESSION) && defined(SQLITE_ENABLE_PREUPDATE_HOOK)
226271227007
/* #include "sqlite3session.h" */
226272227008
/* #include <assert.h> */
226273227009
/* #include <string.h> */
@@ -232803,21 +233539,49 @@
232803233539
232804233540
#endif /* SQLITE_ENABLE_SESSION && SQLITE_ENABLE_PREUPDATE_HOOK */
232805233541
232806233542
/************** End of sqlite3session.c **************************************/
232807233543
/************** Begin file fts5.c ********************************************/
233544
+#line 1 "tsrc/fts5.c"
232808233545
232809
-
233546
+/*
233547
+** This, the "fts5.c" source file, is a composite file that is itself
233548
+** assembled from the following files:
233549
+**
233550
+** fts5.h
233551
+** fts5Int.h
233552
+** fts5parse.h <--- Generated from fts5parse.y by Lemon
233553
+** fts5parse.c <--- Generated from fts5parse.y by Lemon
233554
+** fts5_aux.c
233555
+** fts5_buffer.c
233556
+** fts5_config.c
233557
+** fts5_expr.c
233558
+** fts5_hash.c
233559
+** fts5_index.c
233560
+** fts5_main.c
233561
+** fts5_storage.c
233562
+** fts5_tokenize.c
233563
+** fts5_unicode2.c
233564
+** fts5_varint.c
233565
+** fts5_vocab.c
233566
+*/
232810233567
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5)
232811233568
232812233569
#if !defined(NDEBUG) && !defined(SQLITE_DEBUG)
232813233570
# define NDEBUG 1
232814233571
#endif
232815233572
#if defined(NDEBUG) && defined(SQLITE_DEBUG)
232816233573
# undef NDEBUG
232817233574
#endif
232818233575
233576
+#ifdef HAVE_STDINT_H
233577
+/* #include <stdint.h> */
233578
+#endif
233579
+#ifdef HAVE_INTTYPES_H
233580
+/* #include <inttypes.h> */
233581
+#endif
233582
+#line 1 "fts5.h"
232819233583
/*
232820233584
** 2014 May 31
232821233585
**
232822233586
** The author disclaims copyright to this source code. In place of
232823233587
** a legal notice, here is a blessing:
@@ -233554,10 +234318,11 @@
233554234318
} /* end of the 'extern "C"' block */
233555234319
#endif
233556234320
233557234321
#endif /* _FTS5_H */
233558234322
234323
+#line 1 "fts5Int.h"
233559234324
/*
233560234325
** 2014 May 31
233561234326
**
233562234327
** The author disclaims copyright to this source code. In place of
233563234328
** a legal notice, here is a blessing:
@@ -234493,10 +235258,11 @@
234493235258
** End of interface to code in fts5_unicode2.c.
234494235259
**************************************************************************/
234495235260
234496235261
#endif
234497235262
235263
+#line 1 "fts5parse.h"
234498235264
#define FTS5_OR 1
234499235265
#define FTS5_AND 2
234500235266
#define FTS5_NOT 3
234501235267
#define FTS5_TERM 4
234502235268
#define FTS5_COLON 5
@@ -234509,10 +235275,11 @@
234509235275
#define FTS5_CARET 12
234510235276
#define FTS5_COMMA 13
234511235277
#define FTS5_PLUS 14
234512235278
#define FTS5_STAR 15
234513235279
235280
+#line 1 "fts5parse.c"
234514235281
/* This file is automatically generated by Lemon from input grammar
234515235282
** source file "fts5parse.y".
234516235283
*/
234517235284
/*
234518235285
** 2000-05-29
@@ -234537,10 +235304,11 @@
234537235304
**
234538235305
** The following is the concatenation of all %include directives from the
234539235306
** input grammar file:
234540235307
*/
234541235308
/************ Begin %include sections from the grammar ************************/
235309
+#line 47 "fts5parse.y"
234542235310
234543235311
/* #include "fts5Int.h" */
234544235312
/* #include "fts5parse.h" */
234545235313
234546235314
/*
@@ -234564,10 +235332,11 @@
234564235332
** Alternative datatype for the argument to the malloc() routine passed
234565235333
** into sqlite3ParserAlloc(). The default is size_t.
234566235334
*/
234567235335
#define fts5YYMALLOCARGTYPE u64
234568235336
235337
+#line 58 "fts5parse.sql"
234569235338
/**************** End of %include directives **********************************/
234570235339
/* These constants specify the various numeric values for terminal symbols.
234571235340
***************** Begin token definitions *************************************/
234572235341
#ifndef FTS5_OR
234573235342
#define FTS5_OR 1
@@ -235110,35 +235879,45 @@
235110235879
** inside the C code.
235111235880
*/
235112235881
/********* Begin destructor definitions ***************************************/
235113235882
case 16: /* input */
235114235883
{
235884
+#line 83 "fts5parse.y"
235115235885
(void)pParse;
235886
+#line 606 "fts5parse.sql"
235116235887
}
235117235888
break;
235118235889
case 17: /* expr */
235119235890
case 18: /* cnearset */
235120235891
case 19: /* exprlist */
235121235892
{
235893
+#line 89 "fts5parse.y"
235122235894
sqlite3Fts5ParseNodeFree((fts5yypminor->fts5yy24));
235895
+#line 615 "fts5parse.sql"
235123235896
}
235124235897
break;
235125235898
case 20: /* colset */
235126235899
case 21: /* colsetlist */
235127235900
{
235901
+#line 93 "fts5parse.y"
235128235902
sqlite3_free((fts5yypminor->fts5yy11));
235903
+#line 623 "fts5parse.sql"
235129235904
}
235130235905
break;
235131235906
case 22: /* nearset */
235132235907
case 23: /* nearphrases */
235133235908
{
235909
+#line 148 "fts5parse.y"
235134235910
sqlite3Fts5ParseNearsetFree((fts5yypminor->fts5yy46));
235911
+#line 631 "fts5parse.sql"
235135235912
}
235136235913
break;
235137235914
case 24: /* phrase */
235138235915
{
235916
+#line 183 "fts5parse.y"
235139235917
sqlite3Fts5ParsePhraseFree((fts5yypminor->fts5yy53));
235918
+#line 638 "fts5parse.sql"
235140235919
}
235141235920
break;
235142235921
/********* End destructor definitions *****************************************/
235143235922
default: break; /* If no destructor action specified: do nothing */
235144235923
}
@@ -235369,12 +236148,14 @@
235369236148
#endif
235370236149
while( fts5yypParser->fts5yytos>fts5yypParser->fts5yystack ) fts5yy_pop_parser_stack(fts5yypParser);
235371236150
/* Here code is inserted which will execute if the parser
235372236151
** stack every overflows */
235373236152
/******** Begin %stack_overflow code ******************************************/
236153
+#line 36 "fts5parse.y"
235374236154
235375236155
sqlite3Fts5ParseError(pParse, "fts5: parser stack overflow");
236156
+#line 876 "fts5parse.sql"
235376236157
/******** End %stack_overflow code ********************************************/
235377236158
sqlite3Fts5ParserARG_STORE /* Suppress warning about unused %extra_argument var */
235378236159
sqlite3Fts5ParserCTX_STORE
235379236160
}
235380236161
@@ -235539,148 +236320,202 @@
235539236320
** break;
235540236321
*/
235541236322
/********** Begin reduce actions **********************************************/
235542236323
fts5YYMINORTYPE fts5yylhsminor;
235543236324
case 0: /* input ::= expr */
236325
+#line 82 "fts5parse.y"
235544236326
{ sqlite3Fts5ParseFinished(pParse, fts5yymsp[0].minor.fts5yy24); }
236327
+#line 1047 "fts5parse.sql"
235545236328
break;
235546236329
case 1: /* colset ::= MINUS LCP colsetlist RCP */
236330
+#line 97 "fts5parse.y"
235547236331
{
235548236332
fts5yymsp[-3].minor.fts5yy11 = sqlite3Fts5ParseColsetInvert(pParse, fts5yymsp[-1].minor.fts5yy11);
235549236333
}
236334
+#line 1054 "fts5parse.sql"
235550236335
break;
235551236336
case 2: /* colset ::= LCP colsetlist RCP */
236337
+#line 100 "fts5parse.y"
235552236338
{ fts5yymsp[-2].minor.fts5yy11 = fts5yymsp[-1].minor.fts5yy11; }
236339
+#line 1059 "fts5parse.sql"
235553236340
break;
235554236341
case 3: /* colset ::= STRING */
236342
+#line 101 "fts5parse.y"
235555236343
{
235556236344
fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
235557236345
}
236346
+#line 1066 "fts5parse.sql"
235558236347
fts5yymsp[0].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
235559236348
break;
235560236349
case 4: /* colset ::= MINUS STRING */
236350
+#line 104 "fts5parse.y"
235561236351
{
235562236352
fts5yymsp[-1].minor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
235563236353
fts5yymsp[-1].minor.fts5yy11 = sqlite3Fts5ParseColsetInvert(pParse, fts5yymsp[-1].minor.fts5yy11);
235564236354
}
236355
+#line 1075 "fts5parse.sql"
235565236356
break;
235566236357
case 5: /* colsetlist ::= colsetlist STRING */
236358
+#line 109 "fts5parse.y"
235567236359
{
235568236360
fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, fts5yymsp[-1].minor.fts5yy11, &fts5yymsp[0].minor.fts5yy0); }
236361
+#line 1081 "fts5parse.sql"
235569236362
fts5yymsp[-1].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
235570236363
break;
235571236364
case 6: /* colsetlist ::= STRING */
236365
+#line 111 "fts5parse.y"
235572236366
{
235573236367
fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
235574236368
}
236369
+#line 1089 "fts5parse.sql"
235575236370
fts5yymsp[0].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
235576236371
break;
235577236372
case 7: /* expr ::= expr AND expr */
236373
+#line 115 "fts5parse.y"
235578236374
{
235579236375
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_AND, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0);
235580236376
}
236377
+#line 1097 "fts5parse.sql"
235581236378
fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235582236379
break;
235583236380
case 8: /* expr ::= expr OR expr */
236381
+#line 118 "fts5parse.y"
235584236382
{
235585236383
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_OR, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0);
235586236384
}
236385
+#line 1105 "fts5parse.sql"
235587236386
fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235588236387
break;
235589236388
case 9: /* expr ::= expr NOT expr */
236389
+#line 121 "fts5parse.y"
235590236390
{
235591236391
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_NOT, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0);
235592236392
}
236393
+#line 1113 "fts5parse.sql"
235593236394
fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235594236395
break;
235595236396
case 10: /* expr ::= colset COLON LP expr RP */
236397
+#line 125 "fts5parse.y"
235596236398
{
235597236399
sqlite3Fts5ParseSetColset(pParse, fts5yymsp[-1].minor.fts5yy24, fts5yymsp[-4].minor.fts5yy11);
235598236400
fts5yylhsminor.fts5yy24 = fts5yymsp[-1].minor.fts5yy24;
235599236401
}
236402
+#line 1122 "fts5parse.sql"
235600236403
fts5yymsp[-4].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235601236404
break;
235602236405
case 11: /* expr ::= LP expr RP */
236406
+#line 129 "fts5parse.y"
235603236407
{fts5yymsp[-2].minor.fts5yy24 = fts5yymsp[-1].minor.fts5yy24;}
236408
+#line 1128 "fts5parse.sql"
235604236409
break;
235605236410
case 12: /* expr ::= exprlist */
235606236411
case 13: /* exprlist ::= cnearset */ fts5yytestcase(fts5yyruleno==13);
236412
+#line 130 "fts5parse.y"
235607236413
{fts5yylhsminor.fts5yy24 = fts5yymsp[0].minor.fts5yy24;}
236414
+#line 1134 "fts5parse.sql"
235608236415
fts5yymsp[0].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235609236416
break;
235610236417
case 14: /* exprlist ::= exprlist cnearset */
236418
+#line 133 "fts5parse.y"
235611236419
{
235612236420
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseImplicitAnd(pParse, fts5yymsp[-1].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24);
235613236421
}
236422
+#line 1142 "fts5parse.sql"
235614236423
fts5yymsp[-1].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235615236424
break;
235616236425
case 15: /* cnearset ::= nearset */
236426
+#line 137 "fts5parse.y"
235617236427
{
235618236428
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46);
235619236429
}
236430
+#line 1150 "fts5parse.sql"
235620236431
fts5yymsp[0].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235621236432
break;
235622236433
case 16: /* cnearset ::= colset COLON nearset */
236434
+#line 140 "fts5parse.y"
235623236435
{
235624236436
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46);
235625236437
sqlite3Fts5ParseSetColset(pParse, fts5yylhsminor.fts5yy24, fts5yymsp[-2].minor.fts5yy11);
235626236438
}
236439
+#line 1159 "fts5parse.sql"
235627236440
fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235628236441
break;
235629236442
case 17: /* nearset ::= phrase */
236443
+#line 151 "fts5parse.y"
235630236444
{ fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53); }
236445
+#line 1165 "fts5parse.sql"
235631236446
fts5yymsp[0].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
235632236447
break;
235633236448
case 18: /* nearset ::= CARET phrase */
236449
+#line 152 "fts5parse.y"
235634236450
{
235635236451
sqlite3Fts5ParseSetCaret(fts5yymsp[0].minor.fts5yy53);
235636236452
fts5yymsp[-1].minor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53);
235637236453
}
236454
+#line 1174 "fts5parse.sql"
235638236455
break;
235639236456
case 19: /* nearset ::= STRING LP nearphrases neardist_opt RP */
236457
+#line 156 "fts5parse.y"
235640236458
{
235641236459
sqlite3Fts5ParseNear(pParse, &fts5yymsp[-4].minor.fts5yy0);
235642236460
sqlite3Fts5ParseSetDistance(pParse, fts5yymsp[-2].minor.fts5yy46, &fts5yymsp[-1].minor.fts5yy0);
235643236461
fts5yylhsminor.fts5yy46 = fts5yymsp[-2].minor.fts5yy46;
235644236462
}
236463
+#line 1183 "fts5parse.sql"
235645236464
fts5yymsp[-4].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
235646236465
break;
235647236466
case 20: /* nearphrases ::= phrase */
236467
+#line 162 "fts5parse.y"
235648236468
{
235649236469
fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53);
235650236470
}
236471
+#line 1191 "fts5parse.sql"
235651236472
fts5yymsp[0].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
235652236473
break;
235653236474
case 21: /* nearphrases ::= nearphrases phrase */
236475
+#line 165 "fts5parse.y"
235654236476
{
235655236477
fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, fts5yymsp[-1].minor.fts5yy46, fts5yymsp[0].minor.fts5yy53);
235656236478
}
236479
+#line 1199 "fts5parse.sql"
235657236480
fts5yymsp[-1].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
235658236481
break;
235659236482
case 22: /* neardist_opt ::= */
236483
+#line 172 "fts5parse.y"
235660236484
{ fts5yymsp[1].minor.fts5yy0.p = 0; fts5yymsp[1].minor.fts5yy0.n = 0; }
236485
+#line 1205 "fts5parse.sql"
235661236486
break;
235662236487
case 23: /* neardist_opt ::= COMMA STRING */
236488
+#line 173 "fts5parse.y"
235663236489
{ fts5yymsp[-1].minor.fts5yy0 = fts5yymsp[0].minor.fts5yy0; }
236490
+#line 1210 "fts5parse.sql"
235664236491
break;
235665236492
case 24: /* phrase ::= phrase PLUS STRING star_opt */
236493
+#line 185 "fts5parse.y"
235666236494
{
235667236495
fts5yylhsminor.fts5yy53 = sqlite3Fts5ParseTerm(pParse, fts5yymsp[-3].minor.fts5yy53, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy4);
235668236496
}
236497
+#line 1217 "fts5parse.sql"
235669236498
fts5yymsp[-3].minor.fts5yy53 = fts5yylhsminor.fts5yy53;
235670236499
break;
235671236500
case 25: /* phrase ::= STRING star_opt */
236501
+#line 188 "fts5parse.y"
235672236502
{
235673236503
fts5yylhsminor.fts5yy53 = sqlite3Fts5ParseTerm(pParse, 0, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy4);
235674236504
}
236505
+#line 1225 "fts5parse.sql"
235675236506
fts5yymsp[-1].minor.fts5yy53 = fts5yylhsminor.fts5yy53;
235676236507
break;
235677236508
case 26: /* star_opt ::= STAR */
236509
+#line 196 "fts5parse.y"
235678236510
{ fts5yymsp[0].minor.fts5yy4 = 1; }
236511
+#line 1231 "fts5parse.sql"
235679236512
break;
235680236513
case 27: /* star_opt ::= */
236514
+#line 197 "fts5parse.y"
235681236515
{ fts5yymsp[1].minor.fts5yy4 = 0; }
236516
+#line 1236 "fts5parse.sql"
235682236517
break;
235683236518
default:
235684236519
break;
235685236520
/********** End reduce actions ************************************************/
235686236521
};
@@ -235738,15 +236573,17 @@
235738236573
){
235739236574
sqlite3Fts5ParserARG_FETCH
235740236575
sqlite3Fts5ParserCTX_FETCH
235741236576
#define FTS5TOKEN fts5yyminor
235742236577
/************ Begin %syntax_error code ****************************************/
236578
+#line 30 "fts5parse.y"
235743236579
235744236580
UNUSED_PARAM(fts5yymajor); /* Silence a compiler warning */
235745236581
sqlite3Fts5ParseError(
235746236582
pParse, "fts5: syntax error near \"%.*s\"",FTS5TOKEN.n,FTS5TOKEN.p
235747236583
);
236584
+#line 1304 "fts5parse.sql"
235748236585
/************ End %syntax_error code ******************************************/
235749236586
sqlite3Fts5ParserARG_STORE /* Suppress warning about unused %extra_argument variable */
235750236587
sqlite3Fts5ParserCTX_STORE
235751236588
}
235752236589
@@ -236012,10 +236849,11 @@
236012236849
(void)iToken;
236013236850
return 0;
236014236851
#endif
236015236852
}
236016236853
236854
+#line 1 "fts5_aux.c"
236017236855
/*
236018236856
** 2014 May 31
236019236857
**
236020236858
** The author disclaims copyright to this source code. In place of
236021236859
** a legal notice, here is a blessing:
@@ -236834,10 +237672,11 @@
236834237672
}
236835237673
236836237674
return rc;
236837237675
}
236838237676
237677
+#line 1 "fts5_buffer.c"
236839237678
/*
236840237679
** 2014 May 31
236841237680
**
236842237681
** The author disclaims copyright to this source code. In place of
236843237682
** a legal notice, here is a blessing:
@@ -237246,10 +238085,11 @@
237246238085
}
237247238086
sqlite3_free(p);
237248238087
}
237249238088
}
237250238089
238090
+#line 1 "fts5_config.c"
237251238091
/*
237252238092
** 2014 Jun 09
237253238093
**
237254238094
** The author disclaims copyright to this source code. In place of
237255238095
** a legal notice, here is a blessing:
@@ -238361,10 +239201,11 @@
238361239201
va_end(ap);
238362239202
}
238363239203
238364239204
238365239205
239206
+#line 1 "fts5_expr.c"
238366239207
/*
238367239208
** 2014 May 31
238368239209
**
238369239210
** The author disclaims copyright to this source code. In place of
238370239211
** a legal notice, here is a blessing:
@@ -241629,10 +242470,11 @@
241629242470
sqlite3Fts5IndexIterClearTokendata(pT->pIter);
241630242471
}
241631242472
}
241632242473
}
241633242474
242475
+#line 1 "fts5_hash.c"
241634242476
/*
241635242477
** 2014 August 11
241636242478
**
241637242479
** The author disclaims copyright to this source code. In place of
241638242480
** a legal notice, here is a blessing:
@@ -242220,10 +243062,11 @@
242220243062
*ppDoclist = 0;
242221243063
*pnDoclist = 0;
242222243064
}
242223243065
}
242224243066
243067
+#line 1 "fts5_index.c"
242225243068
/*
242226243069
** 2014 May 31
242227243070
**
242228243071
** The author disclaims copyright to this source code. In place of
242229243072
** a legal notice, here is a blessing:
@@ -251297,10 +252140,11 @@
251297252140
fts5StructureInvalidate(p);
251298252141
}
251299252142
return fts5IndexReturn(p);
251300252143
}
251301252144
252145
+#line 1 "fts5_main.c"
251302252146
/*
251303252147
** 2014 Jun 09
251304252148
**
251305252149
** The author disclaims copyright to this source code. In place of
251306252150
** a legal notice, here is a blessing:
@@ -254886,11 +255730,11 @@
254886255730
int nArg, /* Number of args */
254887255731
sqlite3_value **apUnused /* Function arguments */
254888255732
){
254889255733
assert( nArg==0 );
254890255734
UNUSED_PARAM2(nArg, apUnused);
254891
- sqlite3_result_text(pCtx, "fts5: 2024-10-21 16:30:22 03a9703e27c44437c39363d0baf82db4ebc94538a0f28411c85dda156f82636e", -1, SQLITE_TRANSIENT);
255735
+ sqlite3_result_text(pCtx, "fts5: 2024-11-06 12:58:31 5495b12569c318d5020b4b5a625a392ef8e777b81c0200624fbbc2a6b5eddef9", -1, SQLITE_TRANSIENT);
254892255736
}
254893255737
254894255738
/*
254895255739
** Implementation of fts5_locale(LOCALE, TEXT) function.
254896255740
**
@@ -255139,10 +255983,11 @@
255139255983
SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3 *db){
255140255984
return fts5Init(db);
255141255985
}
255142255986
#endif
255143255987
255988
+#line 1 "fts5_storage.c"
255144255989
/*
255145255990
** 2014 May 31
255146255991
**
255147255992
** The author disclaims copyright to this source code. In place of
255148255993
** a legal notice, here is a blessing:
@@ -256652,10 +257497,11 @@
256652257497
}
256653257498
}
256654257499
return rc;
256655257500
}
256656257501
257502
+#line 1 "fts5_tokenize.c"
256657257503
/*
256658257504
** 2014 May 31
256659257505
**
256660257506
** The author disclaims copyright to this source code. In place of
256661257507
** a legal notice, here is a blessing:
@@ -258140,10 +258986,11 @@
258140258986
);
258141258987
}
258142258988
return rc;
258143258989
}
258144258990
258991
+#line 1 "fts5_unicode2.c"
258145258992
/*
258146258993
** 2012-05-25
258147258994
**
258148258995
** The author disclaims copyright to this source code. In place of
258149258996
** a legal notice, here is a blessing:
@@ -258922,10 +259769,11 @@
258922259769
}
258923259770
aAscii[0] = 0; /* 0x00 is never a token character */
258924259771
}
258925259772
258926259773
259774
+#line 1 "fts5_varint.c"
258927259775
/*
258928259776
** 2015 May 30
258929259777
**
258930259778
** The author disclaims copyright to this source code. In place of
258931259779
** a legal notice, here is a blessing:
@@ -259267,10 +260115,11 @@
259267260115
if( iVal<(1 << 21) ) return 3;
259268260116
if( iVal<(1 << 28) ) return 4;
259269260117
return 5;
259270260118
}
259271260119
260120
+#line 1 "fts5_vocab.c"
259272260121
/*
259273260122
** 2015 May 08
259274260123
**
259275260124
** The author disclaims copyright to this source code. In place of
259276260125
** a legal notice, here is a blessing:
@@ -260077,15 +260926,16 @@
260077260926
260078260927
return sqlite3_create_module_v2(db, "fts5vocab", &fts5Vocab, p, 0);
260079260928
}
260080260929
260081260930
260082
-
260931
+/* Here ends the fts5.c composite file. */
260083260932
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */
260084260933
260085260934
/************** End of fts5.c ************************************************/
260086260935
/************** Begin file stmt.c ********************************************/
260936
+#line 1 "tsrc/stmt.c"
260087260937
/*
260088260938
** 2017-05-31
260089260939
**
260090260940
** The author disclaims copyright to this source code. In place of
260091260941
** a legal notice, here is a blessing:
@@ -260433,6 +261283,7 @@
260433261283
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
260434261284
260435261285
/************** End of stmt.c ************************************************/
260436261286
/* Return the source-id for this library */
260437261287
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
261288
+#endif /* SQLITE_AMALGAMATION */
260438261289
/************************** End of sqlite3.c ******************************/
260439261290
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.47.0. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -16,18 +16,22 @@
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 ** 03a9703e27c44437c39363d0baf82db4ebc9.
 
 
22 */
 
23 #define SQLITE_CORE 1
24 #define SQLITE_AMALGAMATION 1
25 #ifndef SQLITE_PRIVATE
26 # define SQLITE_PRIVATE static
27 #endif
28 /************** Begin file sqliteInt.h ***************************************/
 
29 /*
30 ** 2001 September 15
31 **
32 ** The author disclaims copyright to this source code. In place of
33 ** a legal notice, here is a blessing:
@@ -84,10 +88,11 @@
84 ** compiler warnings due to subsequent content in this file and other files
85 ** that are included by this file.
86 */
87 /************** Include msvc.h in the middle of sqliteInt.h ******************/
88 /************** Begin file msvc.h ********************************************/
 
89 /*
90 ** 2015 January 12
91 **
92 ** The author disclaims copyright to this source code. In place of
93 ** a legal notice, here is a blessing:
@@ -132,16 +137,18 @@
132
133 #endif /* SQLITE_MSVC_H */
134
135 /************** End of msvc.h ************************************************/
136 /************** Continuing where we left off in sqliteInt.h ******************/
 
137
138 /*
139 ** Special setup for VxWorks
140 */
141 /************** Include vxworks.h in the middle of sqliteInt.h ***************/
142 /************** Begin file vxworks.h *****************************************/
 
143 /*
144 ** 2015-03-02
145 **
146 ** The author disclaims copyright to this source code. In place of
147 ** a legal notice, here is a blessing:
@@ -173,10 +180,11 @@
173 #define HAVE_LSTAT 1
174 #endif /* defined(_WRS_KERNEL) */
175
176 /************** End of vxworks.h *********************************************/
177 /************** Continuing where we left off in sqliteInt.h ******************/
 
178
179 /*
180 ** These #defines should enable >2GB file support on POSIX if the
181 ** underlying operating system supports it. If the OS lacks
182 ** large file support, or if the OS is windows, these should be no-ops.
@@ -312,10 +320,11 @@
312 ** first in QNX. Also, the _USE_32BIT_TIME_T macro must appear first for
313 ** MinGW.
314 */
315 /************** Include sqlite3.h in the middle of sqliteInt.h ***************/
316 /************** Begin file sqlite3.h *****************************************/
 
317 /*
318 ** 2001-09-15
319 **
320 ** The author disclaims copyright to this source code. In place of
321 ** a legal notice, here is a blessing:
@@ -460,13 +469,13 @@
460 **
461 ** See also: [sqlite3_libversion()],
462 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
463 ** [sqlite_version()] and [sqlite_source_id()].
464 */
465 #define SQLITE_VERSION "3.47.0"
466 #define SQLITE_VERSION_NUMBER 3047000
467 #define SQLITE_SOURCE_ID "2024-10-21 16:30:22 03a9703e27c44437c39363d0baf82db4ebc94538a0f28411c85dda156f82636e"
468
469 /*
470 ** CAPI3REF: Run-Time Library Version Numbers
471 ** KEYWORDS: sqlite3_version sqlite3_sourceid
472 **
@@ -966,10 +975,17 @@
966 **
967 ** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
968 ** filesystem supports doing multiple write operations atomically when those
969 ** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
970 ** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
 
 
 
 
 
 
 
971 */
972 #define SQLITE_IOCAP_ATOMIC 0x00000001
973 #define SQLITE_IOCAP_ATOMIC512 0x00000002
974 #define SQLITE_IOCAP_ATOMIC1K 0x00000004
975 #define SQLITE_IOCAP_ATOMIC2K 0x00000008
@@ -982,10 +998,11 @@
982 #define SQLITE_IOCAP_SEQUENTIAL 0x00000400
983 #define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800
984 #define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000
985 #define SQLITE_IOCAP_IMMUTABLE 0x00002000
986 #define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000
 
987
988 /*
989 ** CAPI3REF: File Locking Levels
990 **
991 ** SQLite uses one of these integer values as the second
@@ -1128,10 +1145,11 @@
1128 ** <li> [SQLITE_IOCAP_SEQUENTIAL]
1129 ** <li> [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN]
1130 ** <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
1131 ** <li> [SQLITE_IOCAP_IMMUTABLE]
1132 ** <li> [SQLITE_IOCAP_BATCH_ATOMIC]
 
1133 ** </ul>
1134 **
1135 ** The SQLITE_IOCAP_ATOMIC property means that all writes of
1136 ** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values
1137 ** mean that writes of blocks that are nnn bytes in size and
@@ -11194,11 +11212,11 @@
11194 #endif
11195
11196 #if 0
11197 } /* End of the 'extern "C"' block */
11198 #endif
11199 #endif /* SQLITE3_H */
11200
11201 /******** Begin file sqlite3rtree.h *********/
11202 /*
11203 ** 2010 August 30
11204 **
@@ -13886,13 +13904,15 @@
13886 #endif
13887
13888 #endif /* _FTS5_H */
13889
13890 /******** End of fts5.h *********/
 
13891
13892 /************** End of sqlite3.h *********************************************/
13893 /************** Continuing where we left off in sqliteInt.h ******************/
 
13894
13895 /*
13896 ** Reuse the STATIC_LRU for mutex access to sqlite3_temp_directory.
13897 */
13898 #define SQLITE_MUTEX_STATIC_TEMPDIR SQLITE_MUTEX_STATIC_VFS1
@@ -13906,10 +13926,11 @@
13906 #define SQLITECONFIG_H 1
13907 #endif
13908
13909 /************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
13910 /************** Begin file sqliteLimit.h *************************************/
 
13911 /*
13912 ** 2007 May 7
13913 **
13914 ** The author disclaims copyright to this source code. In place of
13915 ** a legal notice, here is a blessing:
@@ -14119,10 +14140,11 @@
14119 # define SQLITE_MAX_TRIGGER_DEPTH 1000
14120 #endif
14121
14122 /************** End of sqliteLimit.h *****************************************/
14123 /************** Continuing where we left off in sqliteInt.h ******************/
 
14124
14125 /* Disable nuisance warnings on Borland compilers */
14126 #if defined(__BORLANDC__)
14127 #pragma warn -rch /* unreachable code */
14128 #pragma warn -ccc /* Condition is always true or false */
@@ -14536,10 +14558,11 @@
14536 #define likely(X) (X)
14537 #define unlikely(X) (X)
14538
14539 /************** Include hash.h in the middle of sqliteInt.h ******************/
14540 /************** Begin file hash.h ********************************************/
 
14541 /*
14542 ** 2001 September 22
14543 **
14544 ** The author disclaims copyright to this source code. In place of
14545 ** a legal notice, here is a blessing:
@@ -14635,12 +14658,14 @@
14635
14636 #endif /* SQLITE_HASH_H */
14637
14638 /************** End of hash.h ************************************************/
14639 /************** Continuing where we left off in sqliteInt.h ******************/
 
14640 /************** Include parse.h in the middle of sqliteInt.h *****************/
14641 /************** Begin file parse.h *******************************************/
 
14642 #define TK_SEMI 1
14643 #define TK_EXPLAIN 2
14644 #define TK_QUERY 3
14645 #define TK_PLAN 4
14646 #define TK_BEGIN 5
@@ -14825,10 +14850,11 @@
14825 #define TK_SPACE 184
14826 #define TK_ILLEGAL 185
14827
14828 /************** End of parse.h ***********************************************/
14829 /************** Continuing where we left off in sqliteInt.h ******************/
 
14830 #include <stdio.h>
14831 #include <stdlib.h>
14832 #include <string.h>
14833 #include <assert.h>
14834 #include <stddef.h>
@@ -15590,10 +15616,11 @@
15590 ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
15591 ** pointer types (i.e. FuncDef) defined above.
15592 */
15593 /************** Include os.h in the middle of sqliteInt.h ********************/
15594 /************** Begin file os.h **********************************************/
 
15595 /*
15596 ** 2001 September 16
15597 **
15598 ** The author disclaims copyright to this source code. In place of
15599 ** a legal notice, here is a blessing:
@@ -15618,10 +15645,11 @@
15618 ** Attempt to automatically detect the operating system and setup the
15619 ** necessary pre-processor macros for it.
15620 */
15621 /************** Include os_setup.h in the middle of os.h *********************/
15622 /************** Begin file os_setup.h ****************************************/
 
15623 /*
15624 ** 2013 November 25
15625 **
15626 ** The author disclaims copyright to this source code. In place of
15627 ** a legal notice, here is a blessing:
@@ -15712,10 +15740,11 @@
15712
15713 #endif /* SQLITE_OS_SETUP_H */
15714
15715 /************** End of os_setup.h ********************************************/
15716 /************** Continuing where we left off in os.h *************************/
 
15717
15718 /* If the SET_FULLSYNC macro is not defined above, then make it
15719 ** a no-op
15720 */
15721 #ifndef SET_FULLSYNC
@@ -15913,12 +15942,14 @@
15913
15914 #endif /* _SQLITE_OS_H_ */
15915
15916 /************** End of os.h **************************************************/
15917 /************** Continuing where we left off in sqliteInt.h ******************/
 
15918 /************** Include pager.h in the middle of sqliteInt.h *****************/
15919 /************** Begin file pager.h *******************************************/
 
15920 /*
15921 ** 2001 September 15
15922 **
15923 ** The author disclaims copyright to this source code. In place of
15924 ** a legal notice, here is a blessing:
@@ -16165,12 +16196,14 @@
16165
16166 #endif /* SQLITE_PAGER_H */
16167
16168 /************** End of pager.h ***********************************************/
16169 /************** Continuing where we left off in sqliteInt.h ******************/
 
16170 /************** Include btree.h in the middle of sqliteInt.h *****************/
16171 /************** Begin file btree.h *******************************************/
 
16172 /*
16173 ** 2001 September 15
16174 **
16175 ** The author disclaims copyright to this source code. In place of
16176 ** a legal notice, here is a blessing:
@@ -16594,12 +16627,14 @@
16594
16595 #endif /* SQLITE_BTREE_H */
16596
16597 /************** End of btree.h ***********************************************/
16598 /************** Continuing where we left off in sqliteInt.h ******************/
 
16599 /************** Include vdbe.h in the middle of sqliteInt.h ******************/
16600 /************** Begin file vdbe.h ********************************************/
 
16601 /*
16602 ** 2001 September 15
16603 **
16604 ** The author disclaims copyright to this source code. In place of
16605 ** a legal notice, here is a blessing:
@@ -16779,10 +16814,11 @@
16779 ** The makefile scans the vdbe.c source file and creates the "opcodes.h"
16780 ** header file that defines a number for each opcode used by the VDBE.
16781 */
16782 /************** Include opcodes.h in the middle of vdbe.h ********************/
16783 /************** Begin file opcodes.h *****************************************/
 
16784 /* Automatically generated. Do not edit */
16785 /* See the tool/mkopcodeh.tcl script for details */
16786 #define OP_Savepoint 0
16787 #define OP_AutoCommit 1
16788 #define OP_Transaction 2
@@ -17020,10 +17056,11 @@
17020 */
17021 #define SQLITE_MX_JUMP_OPCODE 64 /* Maximum JUMP opcode */
17022
17023 /************** End of opcodes.h *********************************************/
17024 /************** Continuing where we left off in vdbe.h ***********************/
 
17025
17026 /*
17027 ** Additional non-public SQLITE_PREPARE_* flags
17028 */
17029 #define SQLITE_PREPARE_SAVESQL 0x80 /* Preserve SQL text */
@@ -17269,12 +17306,14 @@
17269
17270 #endif /* SQLITE_VDBE_H */
17271
17272 /************** End of vdbe.h ************************************************/
17273 /************** Continuing where we left off in sqliteInt.h ******************/
 
17274 /************** Include pcache.h in the middle of sqliteInt.h ****************/
17275 /************** Begin file pcache.h ******************************************/
 
17276 /*
17277 ** 2008 August 05
17278 **
17279 ** The author disclaims copyright to this source code. In place of
17280 ** a legal notice, here is a blessing:
@@ -17464,12 +17503,14 @@
17464
17465 #endif /* _PCACHE_H_ */
17466
17467 /************** End of pcache.h **********************************************/
17468 /************** Continuing where we left off in sqliteInt.h ******************/
 
17469 /************** Include mutex.h in the middle of sqliteInt.h *****************/
17470 /************** Begin file mutex.h *******************************************/
 
17471 /*
17472 ** 2007 August 28
17473 **
17474 ** The author disclaims copyright to this source code. In place of
17475 ** a legal notice, here is a blessing:
@@ -17540,10 +17581,11 @@
17540 SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
17541 #endif /* defined(SQLITE_MUTEX_OMIT) */
17542
17543 /************** End of mutex.h ***********************************************/
17544 /************** Continuing where we left off in sqliteInt.h ******************/
 
17545
17546 /* The SQLITE_EXTRA_DURABLE compile-time option used to set the default
17547 ** synchronous setting to EXTRA. It is no longer supported.
17548 */
17549 #ifdef SQLITE_EXTRA_DURABLE
@@ -17740,51 +17782,15 @@
17740 struct FuncDefHash {
17741 FuncDef *a[SQLITE_FUNC_HASH_SZ]; /* Hash table for functions */
17742 };
17743 #define SQLITE_FUNC_HASH(C,L) (((C)+(L))%SQLITE_FUNC_HASH_SZ)
17744
17745 #if defined(SQLITE_USER_AUTHENTICATION)
17746 # warning "The SQLITE_USER_AUTHENTICATION extension is deprecated. \
17747 See ext/userauth/user-auth.txt for details."
17748 #endif
17749 #ifdef SQLITE_USER_AUTHENTICATION
17750 /*
17751 ** Information held in the "sqlite3" database connection object and used
17752 ** to manage user authentication.
17753 */
17754 typedef struct sqlite3_userauth sqlite3_userauth;
17755 struct sqlite3_userauth {
17756 u8 authLevel; /* Current authentication level */
17757 int nAuthPW; /* Size of the zAuthPW in bytes */
17758 char *zAuthPW; /* Password used to authenticate */
17759 char *zAuthUser; /* User name used to authenticate */
17760 };
17761
17762 /* Allowed values for sqlite3_userauth.authLevel */
17763 #define UAUTH_Unknown 0 /* Authentication not yet checked */
17764 #define UAUTH_Fail 1 /* User authentication failed */
17765 #define UAUTH_User 2 /* Authenticated as a normal user */
17766 #define UAUTH_Admin 3 /* Authenticated as an administrator */
17767
17768 /* Functions used only by user authorization logic */
17769 SQLITE_PRIVATE int sqlite3UserAuthTable(const char*);
17770 SQLITE_PRIVATE int sqlite3UserAuthCheckLogin(sqlite3*,const char*,u8*);
17771 SQLITE_PRIVATE void sqlite3UserAuthInit(sqlite3*);
17772 SQLITE_PRIVATE void sqlite3CryptFunc(sqlite3_context*,int,sqlite3_value**);
17773
17774 #endif /* SQLITE_USER_AUTHENTICATION */
17775
17776 /*
17777 ** typedef for the authorization callback function.
17778 */
17779 #ifdef SQLITE_USER_AUTHENTICATION
17780 typedef int (*sqlite3_xauth)(void*,int,const char*,const char*,const char*,
17781 const char*, const char*);
17782 #else
17783 typedef int (*sqlite3_xauth)(void*,int,const char*,const char*,const char*,
17784 const char*);
17785 #endif
17786
17787 #ifndef SQLITE_OMIT_DEPRECATED
17788 /* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing
17789 ** in the style of sqlite3_trace()
17790 */
@@ -17941,13 +17947,10 @@
17941 sqlite3 *pUnlockConnection; /* Connection to watch for unlock */
17942 void *pUnlockArg; /* Argument to xUnlockNotify */
17943 void (*xUnlockNotify)(void **, int); /* Unlock notify callback */
17944 sqlite3 *pNextBlocked; /* Next in list of all blocked connections */
17945 #endif
17946 #ifdef SQLITE_USER_AUTHENTICATION
17947 sqlite3_userauth auth; /* User authentication information */
17948 #endif
17949 };
17950
17951 /*
17952 ** A macro to discover the encoding of a database.
17953 */
@@ -21979,10 +21982,11 @@
21979
21980 #endif /* SQLITEINT_H */
21981
21982 /************** End of sqliteInt.h *******************************************/
21983 /************** Begin file os_common.h ***************************************/
 
21984 /*
21985 ** 2004 May 22
21986 **
21987 ** The author disclaims copyright to this source code. In place of
21988 ** a legal notice, here is a blessing:
@@ -22081,10 +22085,11 @@
22081
22082 #endif /* !defined(_OS_COMMON_H_) */
22083
22084 /************** End of os_common.h *******************************************/
22085 /************** Begin file ctime.c *******************************************/
 
22086 /* DO NOT EDIT!
22087 ** This file is automatically generated by the script in the canonical
22088 ** SQLite source tree at tool/mkctimec.tcl.
22089 **
22090 ** To modify this header, edit any of the various lists in that script
@@ -22850,13 +22855,10 @@
22850 "UNLINK_AFTER_CLOSE",
22851 #endif
22852 #ifdef SQLITE_UNTESTABLE
22853 "UNTESTABLE",
22854 #endif
22855 #ifdef SQLITE_USER_AUTHENTICATION
22856 "USER_AUTHENTICATION",
22857 #endif
22858 #ifdef SQLITE_USE_ALLOCA
22859 "USE_ALLOCA",
22860 #endif
22861 #ifdef SQLITE_USE_FCNTL_TRACE
22862 "USE_FCNTL_TRACE",
@@ -22883,10 +22885,11 @@
22883
22884 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
22885
22886 /************** End of ctime.c ***********************************************/
22887 /************** Begin file global.c ******************************************/
 
22888 /*
22889 ** 2008 June 13
22890 **
22891 ** The author disclaims copyright to this source code. In place of
22892 ** a legal notice, here is a blessing:
@@ -23287,10 +23290,11 @@
23287 "TEXT"
23288 };
23289
23290 /************** End of global.c **********************************************/
23291 /************** Begin file status.c ******************************************/
 
23292 /*
23293 ** 2008 June 18
23294 **
23295 ** The author disclaims copyright to this source code. In place of
23296 ** a legal notice, here is a blessing:
@@ -23305,10 +23309,11 @@
23305 ** functionality.
23306 */
23307 /* #include "sqliteInt.h" */
23308 /************** Include vdbeInt.h in the middle of status.c ******************/
23309 /************** Begin file vdbeInt.h *****************************************/
 
23310 /*
23311 ** 2003 September 6
23312 **
23313 ** The author disclaims copyright to this source code. In place of
23314 ** a legal notice, here is a blessing:
@@ -23847,10 +23852,11 @@
23847 UnpackedRecord *pNewUnpacked; /* Unpacked version of new.* record */
23848 int iNewReg; /* Register for new.* values */
23849 int iBlobWrite; /* Value returned by preupdate_blobwrite() */
23850 i64 iKey1; /* First key value passed to hook */
23851 i64 iKey2; /* Second key value passed to hook */
 
23852 Mem *aNew; /* Array of new.* values */
23853 Table *pTab; /* Schema object being updated */
23854 Index *pPk; /* PK index if pTab is WITHOUT ROWID */
23855 sqlite3_value **apDflt; /* Array of default values, if required */
23856 };
@@ -24040,10 +24046,11 @@
24040
24041 #endif /* !defined(SQLITE_VDBEINT_H) */
24042
24043 /************** End of vdbeInt.h *********************************************/
24044 /************** Continuing where we left off in status.c *********************/
 
24045
24046 /*
24047 ** Variables in which to record status information.
24048 */
24049 #if SQLITE_PTRSIZE>4
@@ -24424,10 +24431,11 @@
24424 return rc;
24425 }
24426
24427 /************** End of status.c **********************************************/
24428 /************** Begin file date.c ********************************************/
 
24429 /*
24430 ** 2003 October 31
24431 **
24432 ** The author disclaims copyright to this source code. In place of
24433 ** a legal notice, here is a blessing:
@@ -26242,10 +26250,11 @@
26242 sqlite3InsertBuiltinFuncs(aDateTimeFuncs, ArraySize(aDateTimeFuncs));
26243 }
26244
26245 /************** End of date.c ************************************************/
26246 /************** Begin file os.c **********************************************/
 
26247 /*
26248 ** 2005 November 29
26249 **
26250 ** The author disclaims copyright to this source code. In place of
26251 ** a legal notice, here is a blessing:
@@ -26692,10 +26701,11 @@
26692 return SQLITE_OK;
26693 }
26694
26695 /************** End of os.c **************************************************/
26696 /************** Begin file fault.c *******************************************/
 
26697 /*
26698 ** 2008 Jan 22
26699 **
26700 ** The author disclaims copyright to this source code. In place of
26701 ** a legal notice, here is a blessing:
@@ -26782,10 +26792,11 @@
26782
26783 #endif /* #ifndef SQLITE_UNTESTABLE */
26784
26785 /************** End of fault.c ***********************************************/
26786 /************** Begin file mem0.c ********************************************/
 
26787 /*
26788 ** 2008 October 28
26789 **
26790 ** The author disclaims copyright to this source code. In place of
26791 ** a legal notice, here is a blessing:
@@ -26844,10 +26855,11 @@
26844
26845 #endif /* SQLITE_ZERO_MALLOC */
26846
26847 /************** End of mem0.c ************************************************/
26848 /************** Begin file mem1.c ********************************************/
 
26849 /*
26850 ** 2007 August 14
26851 **
26852 ** The author disclaims copyright to this source code. In place of
26853 ** a legal notice, here is a blessing:
@@ -27138,10 +27150,11 @@
27138
27139 #endif /* SQLITE_SYSTEM_MALLOC */
27140
27141 /************** End of mem1.c ************************************************/
27142 /************** Begin file mem2.c ********************************************/
 
27143 /*
27144 ** 2007 August 15
27145 **
27146 ** The author disclaims copyright to this source code. In place of
27147 ** a legal notice, here is a blessing:
@@ -27669,10 +27682,11 @@
27669
27670 #endif /* SQLITE_MEMDEBUG */
27671
27672 /************** End of mem2.c ************************************************/
27673 /************** Begin file mem3.c ********************************************/
 
27674 /*
27675 ** 2007 October 14
27676 **
27677 ** The author disclaims copyright to this source code. In place of
27678 ** a legal notice, here is a blessing:
@@ -28359,10 +28373,11 @@
28359
28360 #endif /* SQLITE_ENABLE_MEMSYS3 */
28361
28362 /************** End of mem3.c ************************************************/
28363 /************** Begin file mem5.c ********************************************/
 
28364 /*
28365 ** 2007 October 14
28366 **
28367 ** The author disclaims copyright to this source code. In place of
28368 ** a legal notice, here is a blessing:
@@ -28947,10 +28962,11 @@
28947
28948 #endif /* SQLITE_ENABLE_MEMSYS5 */
28949
28950 /************** End of mem5.c ************************************************/
28951 /************** Begin file mutex.c *******************************************/
 
28952 /*
28953 ** 2007 August 14
28954 **
28955 ** The author disclaims copyright to this source code. In place of
28956 ** a legal notice, here is a blessing:
@@ -29324,10 +29340,11 @@
29324
29325 #endif /* !defined(SQLITE_MUTEX_OMIT) */
29326
29327 /************** End of mutex.c ***********************************************/
29328 /************** Begin file mutex_noop.c **************************************/
 
29329 /*
29330 ** 2008 October 07
29331 **
29332 ** The author disclaims copyright to this source code. In place of
29333 ** a legal notice, here is a blessing:
@@ -29542,10 +29559,11 @@
29542 #endif /* defined(SQLITE_MUTEX_NOOP) */
29543 #endif /* !defined(SQLITE_MUTEX_OMIT) */
29544
29545 /************** End of mutex_noop.c ******************************************/
29546 /************** Begin file mutex_unix.c **************************************/
 
29547 /*
29548 ** 2007 August 28
29549 **
29550 ** The author disclaims copyright to this source code. In place of
29551 ** a legal notice, here is a blessing:
@@ -29939,10 +29957,11 @@
29939
29940 #endif /* SQLITE_MUTEX_PTHREADS */
29941
29942 /************** End of mutex_unix.c ******************************************/
29943 /************** Begin file mutex_w32.c ***************************************/
 
29944 /*
29945 ** 2007 August 14
29946 **
29947 ** The author disclaims copyright to this source code. In place of
29948 ** a legal notice, here is a blessing:
@@ -29965,10 +29984,11 @@
29965 /*
29966 ** Include the header file for the Windows VFS.
29967 */
29968 /************** Include os_win.h in the middle of mutex_w32.c ****************/
29969 /************** Begin file os_win.h ******************************************/
 
29970 /*
29971 ** 2013 November 25
29972 **
29973 ** The author disclaims copyright to this source code. In place of
29974 ** a legal notice, here is a blessing:
@@ -30056,10 +30076,11 @@
30056
30057 #endif /* SQLITE_OS_WIN_H */
30058
30059 /************** End of os_win.h **********************************************/
30060 /************** Continuing where we left off in mutex_w32.c ******************/
 
30061 #endif
30062
30063 /*
30064 ** The code in this file is only used if we are compiling multithreaded
30065 ** on a Win32 system.
@@ -30433,10 +30454,11 @@
30433
30434 #endif /* SQLITE_MUTEX_W32 */
30435
30436 /************** End of mutex_w32.c *******************************************/
30437 /************** Begin file malloc.c ******************************************/
 
30438 /*
30439 ** 2001 September 15
30440 **
30441 ** The author disclaims copyright to this source code. In place of
30442 ** a legal notice, here is a blessing:
@@ -31356,10 +31378,11 @@
31356 return 0;
31357 }
31358
31359 /************** End of malloc.c **********************************************/
31360 /************** Begin file printf.c ******************************************/
 
31361 /*
31362 ** The "printf" code that follows dates from the 1980's. It is in
31363 ** the public domain.
31364 **
31365 **************************************************************************
@@ -32805,10 +32828,11 @@
32805 }
32806 }
32807
32808 /************** End of printf.c **********************************************/
32809 /************** Begin file treeview.c ****************************************/
 
32810 /*
32811 ** 2015-06-08
32812 **
32813 ** The author disclaims copyright to this source code. In place of
32814 ** a legal notice, here is a blessing:
@@ -34136,10 +34160,11 @@
34136
34137 #endif /* SQLITE_DEBUG */
34138
34139 /************** End of treeview.c ********************************************/
34140 /************** Begin file random.c ******************************************/
 
34141 /*
34142 ** 2001 September 15
34143 **
34144 ** The author disclaims copyright to this source code. In place of
34145 ** a legal notice, here is a blessing:
@@ -34296,10 +34321,11 @@
34296 }
34297 #endif /* SQLITE_UNTESTABLE */
34298
34299 /************** End of random.c **********************************************/
34300 /************** Begin file threads.c *****************************************/
 
34301 /*
34302 ** 2012 July 21
34303 **
34304 ** The author disclaims copyright to this source code. In place of
34305 ** a legal notice, here is a blessing:
@@ -34573,10 +34599,11 @@
34573 /****************************** End Single-Threaded *************************/
34574 #endif /* SQLITE_MAX_WORKER_THREADS>0 */
34575
34576 /************** End of threads.c *********************************************/
34577 /************** Begin file utf.c *********************************************/
 
34578 /*
34579 ** 2004 April 13
34580 **
34581 ** The author disclaims copyright to this source code. In place of
34582 ** a legal notice, here is a blessing:
@@ -35144,10 +35171,11 @@
35144 #endif /* SQLITE_TEST */
35145 #endif /* SQLITE_OMIT_UTF16 */
35146
35147 /************** End of utf.c *************************************************/
35148 /************** Begin file util.c ********************************************/
 
35149 /*
35150 ** 2001 September 15
35151 **
35152 ** The author disclaims copyright to this source code. In place of
35153 ** a legal notice, here is a blessing:
@@ -36995,10 +37023,11 @@
36995 return 0;
36996 }
36997
36998 /************** End of util.c ************************************************/
36999 /************** Begin file hash.c ********************************************/
 
37000 /*
37001 ** 2001 September 22
37002 **
37003 ** The author disclaims copyright to this source code. In place of
37004 ** a legal notice, here is a blessing:
@@ -37268,10 +37297,11 @@
37268 return 0;
37269 }
37270
37271 /************** End of hash.c ************************************************/
37272 /************** Begin file opcodes.c *****************************************/
 
37273 /* Automatically generated. Do not edit */
37274 /* See the tool/mkopcodec.tcl script for details. */
37275 #if !defined(SQLITE_OMIT_EXPLAIN) \
37276 || defined(VDBE_PROFILE) \
37277 || defined(SQLITE_DEBUG)
@@ -37477,10 +37507,11 @@
37477 }
37478 #endif
37479
37480 /************** End of opcodes.c *********************************************/
37481 /************** Begin file os_kv.c *******************************************/
 
37482 /*
37483 ** 2022-09-06
37484 **
37485 ** The author disclaims copyright to this source code. In place of
37486 ** a legal notice, here is a blessing:
@@ -38459,10 +38490,11 @@
38459 }
38460 #endif
38461
38462 /************** End of os_kv.c ***********************************************/
38463 /************** Begin file os_unix.c *****************************************/
 
38464 /*
38465 ** 2004 May 22
38466 **
38467 ** The author disclaims copyright to this source code. In place of
38468 ** a legal notice, here is a blessing:
@@ -38674,11 +38706,11 @@
38674 # define F_SETLKW 7
38675 # endif
38676 # endif
38677 #else /* !SQLITE_WASI */
38678 # ifndef HAVE_FCHMOD
38679 # define HAVE_FCHMOD
38680 # endif
38681 #endif /* SQLITE_WASI */
38682
38683 #ifdef SQLITE_WASI
38684 # define osGetpid(X) (pid_t)1
@@ -42589,10 +42621,11 @@
42589
42590 /* Set the POWERSAFE_OVERWRITE flag if requested. */
42591 if( pFd->ctrlFlags & UNIXFILE_PSOW ){
42592 pFd->deviceCharacteristics |= SQLITE_IOCAP_POWERSAFE_OVERWRITE;
42593 }
 
42594
42595 pFd->sectorSize = SQLITE_DEFAULT_SECTOR_SIZE;
42596 }
42597 }
42598 #else
@@ -46727,10 +46760,11 @@
46727
46728 #endif /* SQLITE_OS_UNIX */
46729
46730 /************** End of os_unix.c *********************************************/
46731 /************** Begin file os_win.c ******************************************/
 
46732 /*
46733 ** 2004 May 22
46734 **
46735 ** The author disclaims copyright to this source code. In place of
46736 ** a legal notice, here is a blessing:
@@ -50389,11 +50423,11 @@
50389 /*
50390 ** Return a vector of device characteristics.
50391 */
50392 static int winDeviceCharacteristics(sqlite3_file *id){
50393 winFile *p = (winFile*)id;
50394 return SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN |
50395 ((p->ctrlFlags & WINFILE_PSOW)?SQLITE_IOCAP_POWERSAFE_OVERWRITE:0);
50396 }
50397
50398 /*
50399 ** Windows will only let you create file view mappings
@@ -52941,10 +52975,11 @@
52941
52942 #endif /* SQLITE_OS_WIN */
52943
52944 /************** End of os_win.c **********************************************/
52945 /************** Begin file memdb.c *******************************************/
 
52946 /*
52947 ** 2016-09-07
52948 **
52949 ** The author disclaims copyright to this source code. In place of
52950 ** a legal notice, here is a blessing:
@@ -53880,10 +53915,11 @@
53880 }
53881 #endif /* SQLITE_OMIT_DESERIALIZE */
53882
53883 /************** End of memdb.c ***********************************************/
53884 /************** Begin file bitvec.c ******************************************/
 
53885 /*
53886 ** 2008 February 16
53887 **
53888 ** The author disclaims copyright to this source code. In place of
53889 ** a legal notice, here is a blessing:
@@ -54294,10 +54330,11 @@
54294 }
54295 #endif /* SQLITE_UNTESTABLE */
54296
54297 /************** End of bitvec.c **********************************************/
54298 /************** Begin file pcache.c ******************************************/
 
54299 /*
54300 ** 2008 August 05
54301 **
54302 ** The author disclaims copyright to this source code. In place of
54303 ** a legal notice, here is a blessing:
@@ -55233,10 +55270,11 @@
55233 }
55234 #endif
55235
55236 /************** End of pcache.c **********************************************/
55237 /************** Begin file pcache1.c *****************************************/
 
55238 /*
55239 ** 2008 November 05
55240 **
55241 ** The author disclaims copyright to this source code. In place of
55242 ** a legal notice, here is a blessing:
@@ -56518,10 +56556,11 @@
56518 }
56519 #endif
56520
56521 /************** End of pcache1.c *********************************************/
56522 /************** Begin file rowset.c ******************************************/
 
56523 /*
56524 ** 2008 December 3
56525 **
56526 ** The author disclaims copyright to this source code. In place of
56527 ** a legal notice, here is a blessing:
@@ -57023,10 +57062,11 @@
57023 return 0;
57024 }
57025
57026 /************** End of rowset.c **********************************************/
57027 /************** Begin file pager.c *******************************************/
 
57028 /*
57029 ** 2001 September 15
57030 **
57031 ** The author disclaims copyright to this source code. In place of
57032 ** a legal notice, here is a blessing:
@@ -57047,10 +57087,11 @@
57047 */
57048 #ifndef SQLITE_OMIT_DISKIO
57049 /* #include "sqliteInt.h" */
57050 /************** Include wal.h in the middle of pager.c ***********************/
57051 /************** Begin file wal.h *********************************************/
 
57052 /*
57053 ** 2010 February 1
57054 **
57055 ** The author disclaims copyright to this source code. In place of
57056 ** a legal notice, here is a blessing:
@@ -57210,10 +57251,11 @@
57210 #endif /* ifndef SQLITE_OMIT_WAL */
57211 #endif /* SQLITE_WAL_H */
57212
57213 /************** End of wal.h *************************************************/
57214 /************** Continuing where we left off in pager.c **********************/
 
57215
57216
57217 /******************* NOTES ON THE DESIGN OF THE PAGER ************************
57218 **
57219 ** This comment block describes invariants that hold when using a rollback
@@ -57997,24 +58039,32 @@
57997 #ifdef SQLITE_DIRECT_OVERFLOW_READ
57998 /*
57999 ** Return true if page pgno can be read directly from the database file
58000 ** by the b-tree layer. This is the case if:
58001 **
58002 ** * the database file is open,
58003 ** * there are no dirty pages in the cache, and
58004 ** * the desired page is not currently in the wal file.
 
58005 */
58006 SQLITE_PRIVATE int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno){
58007 if( pPager->fd->pMethods==0 ) return 0;
58008 if( sqlite3PCacheIsDirty(pPager->pPCache) ) return 0;
 
 
58009 #ifndef SQLITE_OMIT_WAL
58010 if( pPager->pWal ){
58011 u32 iRead = 0;
58012 (void)sqlite3WalFindFrame(pPager->pWal, pgno, &iRead);
58013 return iRead==0;
58014 }
58015 #endif
 
 
 
 
 
58016 return 1;
58017 }
58018 #endif
58019
58020 #ifndef SQLITE_OMIT_WAL
@@ -64991,10 +65041,11 @@
64991
64992 #endif /* SQLITE_OMIT_DISKIO */
64993
64994 /************** End of pager.c ***********************************************/
64995 /************** Begin file wal.c *********************************************/
 
64996 /*
64997 ** 2010 February 1
64998 **
64999 ** The author disclaims copyright to this source code. In place of
65000 ** a legal notice, here is a blessing:
@@ -69587,10 +69638,11 @@
69587
69588 #endif /* #ifndef SQLITE_OMIT_WAL */
69589
69590 /************** End of wal.c *************************************************/
69591 /************** Begin file btmutex.c *****************************************/
 
69592 /*
69593 ** 2007 August 27
69594 **
69595 ** The author disclaims copyright to this source code. In place of
69596 ** a legal notice, here is a blessing:
@@ -69606,10 +69658,11 @@
69606 ** big and we want to break it down some. This packaged seemed like
69607 ** a good breakout.
69608 */
69609 /************** Include btreeInt.h in the middle of btmutex.c ****************/
69610 /************** Begin file btreeInt.h ****************************************/
 
69611 /*
69612 ** 2004 April 6
69613 **
69614 ** The author disclaims copyright to this source code. In place of
69615 ** a legal notice, here is a blessing:
@@ -70343,10 +70396,11 @@
70343 # define get2byteAligned(x) ((x)[0]<<8 | (x)[1])
70344 #endif
70345
70346 /************** End of btreeInt.h ********************************************/
70347 /************** Continuing where we left off in btmutex.c ********************/
 
70348 #ifndef SQLITE_OMIT_SHARED_CACHE
70349 #if SQLITE_THREADSAFE
70350
70351 /*
70352 ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -70637,10 +70691,11 @@
70637
70638 #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
70639
70640 /************** End of btmutex.c *********************************************/
70641 /************** Begin file btree.c *******************************************/
 
70642 /*
70643 ** 2004 April 6
70644 **
70645 ** The author disclaims copyright to this source code. In place of
70646 ** a legal notice, here is a blessing:
@@ -82131,10 +82186,11 @@
82131 }
82132 #endif
82133
82134 /************** End of btree.c ***********************************************/
82135 /************** Begin file backup.c ******************************************/
 
82136 /*
82137 ** 2009 January 28
82138 **
82139 ** The author disclaims copyright to this source code. In place of
82140 ** a legal notice, here is a blessing:
@@ -82901,10 +82957,11 @@
82901 }
82902 #endif /* SQLITE_OMIT_VACUUM */
82903
82904 /************** End of backup.c **********************************************/
82905 /************** Begin file vdbemem.c *****************************************/
 
82906 /*
82907 ** 2004 May 26
82908 **
82909 ** The author disclaims copyright to this source code. In place of
82910 ** a legal notice, here is a blessing:
@@ -84957,10 +85014,11 @@
84957 return valueBytes(pVal, enc);
84958 }
84959
84960 /************** End of vdbemem.c *********************************************/
84961 /************** Begin file vdbeaux.c *****************************************/
 
84962 /*
84963 ** 2003 September 6
84964 **
84965 ** The author disclaims copyright to this source code. In place of
84966 ** a legal notice, here is a blessing:
@@ -90488,10 +90546,11 @@
90488 db->xPreUpdateCallback(db->pPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2);
90489 db->pPreUpdate = 0;
90490 sqlite3DbFree(db, preupdate.aRecord);
90491 vdbeFreeUnpacked(db, preupdate.keyinfo.nKeyField+1, preupdate.pUnpacked);
90492 vdbeFreeUnpacked(db, preupdate.keyinfo.nKeyField+1, preupdate.pNewUnpacked);
 
90493 if( preupdate.aNew ){
90494 int i;
90495 for(i=0; i<pCsr->nField; i++){
90496 sqlite3VdbeMemRelease(&preupdate.aNew[i]);
90497 }
@@ -90507,10 +90566,11 @@
90507 }
90508 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
90509
90510 /************** End of vdbeaux.c *********************************************/
90511 /************** Begin file vdbeapi.c *****************************************/
 
90512 /*
90513 ** 2004 May 26
90514 **
90515 ** The author disclaims copyright to this source code. In place of
90516 ** a legal notice, here is a blessing:
@@ -92706,64 +92766,68 @@
92706 if( iIdx>=p->pCsr->nField || iIdx<0 ){
92707 rc = SQLITE_RANGE;
92708 goto preupdate_old_out;
92709 }
92710
92711 /* If the old.* record has not yet been loaded into memory, do so now. */
92712 if( p->pUnpacked==0 ){
92713 u32 nRec;
92714 u8 *aRec;
92715
92716 assert( p->pCsr->eCurType==CURTYPE_BTREE );
92717 nRec = sqlite3BtreePayloadSize(p->pCsr->uc.pCursor);
92718 aRec = sqlite3DbMallocRaw(db, nRec);
92719 if( !aRec ) goto preupdate_old_out;
92720 rc = sqlite3BtreePayload(p->pCsr->uc.pCursor, 0, nRec, aRec);
92721 if( rc==SQLITE_OK ){
92722 p->pUnpacked = vdbeUnpackRecord(&p->keyinfo, nRec, aRec);
92723 if( !p->pUnpacked ) rc = SQLITE_NOMEM;
92724 }
92725 if( rc!=SQLITE_OK ){
92726 sqlite3DbFree(db, aRec);
92727 goto preupdate_old_out;
92728 }
92729 p->aRecord = aRec;
92730 }
92731
92732 pMem = *ppValue = &p->pUnpacked->aMem[iIdx];
92733 if( iIdx==p->pTab->iPKey ){
 
92734 sqlite3VdbeMemSetInt64(pMem, p->iKey1);
92735 }else if( iIdx>=p->pUnpacked->nField ){
92736 /* This occurs when the table has been extended using ALTER TABLE
92737 ** ADD COLUMN. The value to return is the default value of the column. */
92738 Column *pCol = &p->pTab->aCol[iIdx];
92739 if( pCol->iDflt>0 ){
92740 if( p->apDflt==0 ){
92741 int nByte = sizeof(sqlite3_value*)*p->pTab->nCol;
92742 p->apDflt = (sqlite3_value**)sqlite3DbMallocZero(db, nByte);
92743 if( p->apDflt==0 ) goto preupdate_old_out;
92744 }
92745 if( p->apDflt[iIdx]==0 ){
92746 sqlite3_value *pVal = 0;
92747 Expr *pDflt;
92748 assert( p->pTab!=0 && IsOrdinaryTable(p->pTab) );
92749 pDflt = p->pTab->u.tab.pDfltList->a[pCol->iDflt-1].pExpr;
92750 rc = sqlite3ValueFromExpr(db, pDflt, ENC(db), pCol->affinity, &pVal);
92751 if( rc==SQLITE_OK && pVal==0 ){
92752 rc = SQLITE_CORRUPT_BKPT;
92753 }
92754 p->apDflt[iIdx] = pVal;
92755 }
92756 *ppValue = p->apDflt[iIdx];
92757 }else{
92758 *ppValue = (sqlite3_value *)columnNullValue();
92759 }
92760 }else if( p->pTab->aCol[iIdx].affinity==SQLITE_AFF_REAL ){
92761 if( pMem->flags & (MEM_Int|MEM_IntReal) ){
92762 testcase( pMem->flags & MEM_Int );
92763 testcase( pMem->flags & MEM_IntReal );
92764 sqlite3VdbeMemRealify(pMem);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92765 }
92766 }
92767
92768 preupdate_old_out:
92769 sqlite3Error(db, rc);
@@ -93089,10 +93153,11 @@
93089 }
93090 #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
93091
93092 /************** End of vdbeapi.c *********************************************/
93093 /************** Begin file vdbetrace.c ***************************************/
 
93094 /*
93095 ** 2009 November 25
93096 **
93097 ** The author disclaims copyright to this source code. In place of
93098 ** a legal notice, here is a blessing:
@@ -93284,10 +93349,11 @@
93284
93285 #endif /* #ifndef SQLITE_OMIT_TRACE */
93286
93287 /************** End of vdbetrace.c *******************************************/
93288 /************** Begin file vdbe.c ********************************************/
 
93289 /*
93290 ** 2001 September 15
93291 **
93292 ** The author disclaims copyright to this source code. In place of
93293 ** a legal notice, here is a blessing:
@@ -93315,10 +93381,11 @@
93315 #if defined(VDBE_PROFILE) \
93316 || defined(SQLITE_PERFORMANCE_TRACE) \
93317 || defined(SQLITE_ENABLE_STMT_SCANSTATUS)
93318 /************** Include hwtime.h in the middle of vdbe.c *********************/
93319 /************** Begin file hwtime.h ******************************************/
 
93320 /*
93321 ** 2008 May 27
93322 **
93323 ** The author disclaims copyright to this source code. In place of
93324 ** a legal notice, here is a blessing:
@@ -93403,10 +93470,11 @@
93403
93404 #endif /* !defined(SQLITE_HWTIME_H) */
93405
93406 /************** End of hwtime.h **********************************************/
93407 /************** Continuing where we left off in vdbe.c ***********************/
 
93408 #endif
93409
93410 /*
93411 ** Invoke this macro on memory cells just prior to changing the
93412 ** value of the cell. This macro verifies that shallow copies are
@@ -97913,13 +97981,15 @@
97913 0, pCx->uc.pCursor);
97914 pCx->isTable = 1;
97915 }
97916 }
97917 pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
 
97918 if( rc ){
97919 assert( !sqlite3BtreeClosesWithCursor(pCx->ub.pBtx, pCx->uc.pCursor) );
97920 sqlite3BtreeClose(pCx->ub.pBtx);
 
97921 }else{
97922 assert( sqlite3BtreeClosesWithCursor(pCx->ub.pBtx, pCx->uc.pCursor) );
97923 }
97924 }
97925 }
@@ -102594,10 +102664,11 @@
102594 }
102595
102596
102597 /************** End of vdbe.c ************************************************/
102598 /************** Begin file vdbeblob.c ****************************************/
 
102599 /*
102600 ** 2007 May 1
102601 **
102602 ** The author disclaims copyright to this source code. In place of
102603 ** a legal notice, here is a blessing:
@@ -103117,10 +103188,11 @@
103117
103118 #endif /* #ifndef SQLITE_OMIT_INCRBLOB */
103119
103120 /************** End of vdbeblob.c ********************************************/
103121 /************** Begin file vdbesort.c ****************************************/
 
103122 /*
103123 ** 2011-07-09
103124 **
103125 ** The author disclaims copyright to this source code. In place of
103126 ** a legal notice, here is a blessing:
@@ -105887,10 +105959,11 @@
105887 return SQLITE_OK;
105888 }
105889
105890 /************** End of vdbesort.c ********************************************/
105891 /************** Begin file vdbevtab.c ****************************************/
 
105892 /*
105893 ** 2020-03-23
105894 **
105895 ** The author disclaims copyright to this source code. In place of
105896 ** a legal notice, here is a blessing:
@@ -106336,10 +106409,11 @@
106336 SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3 *db){ return SQLITE_OK; }
106337 #endif /* SQLITE_ENABLE_BYTECODE_VTAB */
106338
106339 /************** End of vdbevtab.c ********************************************/
106340 /************** Begin file memjournal.c **************************************/
 
106341 /*
106342 ** 2008 October 7
106343 **
106344 ** The author disclaims copyright to this source code. In place of
106345 ** a legal notice, here is a blessing:
@@ -106779,10 +106853,11 @@
106779 return MAX(pVfs->szOsFile, (int)sizeof(MemJournal));
106780 }
106781
106782 /************** End of memjournal.c ******************************************/
106783 /************** Begin file walker.c ******************************************/
 
106784 /*
106785 ** 2008 August 16
106786 **
106787 ** The author disclaims copyright to this source code. In place of
106788 ** a legal notice, here is a blessing:
@@ -107043,10 +107118,11 @@
107043 return WRC_Continue;
107044 }
107045
107046 /************** End of walker.c **********************************************/
107047 /************** Begin file resolve.c *****************************************/
 
107048 /*
107049 ** 2008 August 18
107050 **
107051 ** The author disclaims copyright to this source code. In place of
107052 ** a legal notice, here is a blessing:
@@ -109364,10 +109440,11 @@
109364 return rc;
109365 }
109366
109367 /************** End of resolve.c *********************************************/
109368 /************** Begin file expr.c ********************************************/
 
109369 /*
109370 ** 2001 September 15
109371 **
109372 ** The author disclaims copyright to this source code. In place of
109373 ** a legal notice, here is a blessing:
@@ -116693,10 +116770,11 @@
116693 }
116694 #endif /* SQLITE_DEBUG */
116695
116696 /************** End of expr.c ************************************************/
116697 /************** Begin file alter.c *******************************************/
 
116698 /*
116699 ** 2005 February 15
116700 **
116701 ** The author disclaims copyright to this source code. In place of
116702 ** a legal notice, here is a blessing:
@@ -119012,10 +119090,11 @@
119012 }
119013 #endif /* SQLITE_ALTER_TABLE */
119014
119015 /************** End of alter.c ***********************************************/
119016 /************** Begin file analyze.c *****************************************/
 
119017 /*
119018 ** 2005-07-08
119019 **
119020 ** The author disclaims copyright to this source code. In place of
119021 ** a legal notice, here is a blessing:
@@ -121036,10 +121115,11 @@
121036
121037 #endif /* SQLITE_OMIT_ANALYZE */
121038
121039 /************** End of analyze.c *********************************************/
121040 /************** Begin file attach.c ******************************************/
 
121041 /*
121042 ** 2003 April 6
121043 **
121044 ** The author disclaims copyright to this source code. In place of
121045 ** a legal notice, here is a blessing:
@@ -121265,19 +121345,10 @@
121265 rc = sqlite3Init(db, &zErrDyn);
121266 }
121267 sqlite3BtreeLeaveAll(db);
121268 assert( zErrDyn==0 || rc!=SQLITE_OK );
121269 }
121270 #ifdef SQLITE_USER_AUTHENTICATION
121271 if( rc==SQLITE_OK && !REOPEN_AS_MEMDB(db) ){
121272 u8 newAuth = 0;
121273 rc = sqlite3UserAuthCheckLogin(db, zName, &newAuth);
121274 if( newAuth<db->auth.authLevel ){
121275 rc = SQLITE_AUTH_USER;
121276 }
121277 }
121278 #endif
121279 if( rc ){
121280 if( ALWAYS(!REOPEN_AS_MEMDB(db)) ){
121281 int iDb = db->nDb - 1;
121282 assert( iDb>=2 );
121283 if( db->aDb[iDb].pBt ){
@@ -121657,10 +121728,11 @@
121657 }
121658 #endif
121659
121660 /************** End of attach.c **********************************************/
121661 /************** Begin file auth.c ********************************************/
 
121662 /*
121663 ** 2003 January 11
121664 **
121665 ** The author disclaims copyright to this source code. In place of
121666 ** a legal notice, here is a blessing:
@@ -121771,15 +121843,11 @@
121771 sqlite3 *db = pParse->db; /* Database handle */
121772 char *zDb = db->aDb[iDb].zDbSName; /* Schema name of attached database */
121773 int rc; /* Auth callback return code */
121774
121775 if( db->init.busy ) return SQLITE_OK;
121776 rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext
121777 #ifdef SQLITE_USER_AUTHENTICATION
121778 ,db->auth.zAuthUser
121779 #endif
121780 );
121781 if( rc==SQLITE_DENY ){
121782 char *z = sqlite3_mprintf("%s.%s", zTab, zCol);
121783 if( db->nDb>2 || iDb!=0 ) z = sqlite3_mprintf("%s.%z", zDb, z);
121784 sqlite3ErrorMsg(pParse, "access to %z is prohibited", z);
121785 pParse->rc = SQLITE_AUTH;
@@ -121882,15 +121950,11 @@
121882 testcase( zArg1==0 );
121883 testcase( zArg2==0 );
121884 testcase( zArg3==0 );
121885 testcase( pParse->zAuthContext==0 );
121886
121887 rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext
121888 #ifdef SQLITE_USER_AUTHENTICATION
121889 ,db->auth.zAuthUser
121890 #endif
121891 );
121892 if( rc==SQLITE_DENY ){
121893 sqlite3ErrorMsg(pParse, "not authorized");
121894 pParse->rc = SQLITE_AUTH;
121895 }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
121896 rc = SQLITE_DENY;
@@ -121928,10 +121992,11 @@
121928
121929 #endif /* SQLITE_OMIT_AUTHORIZATION */
121930
121931 /************** End of auth.c ************************************************/
121932 /************** Begin file build.c *******************************************/
 
121933 /*
121934 ** 2001 September 15
121935 **
121936 ** The author disclaims copyright to this source code. In place of
121937 ** a legal notice, here is a blessing:
@@ -122119,21 +122184,10 @@
122119 sqlite3VdbeJumpHere(v, addrRewind);
122120 }
122121 }
122122 sqlite3VdbeAddOp0(v, OP_Halt);
122123
122124 #if SQLITE_USER_AUTHENTICATION && !defined(SQLITE_OMIT_SHARED_CACHE)
122125 if( pParse->nTableLock>0 && db->init.busy==0 ){
122126 sqlite3UserAuthInit(db);
122127 if( db->auth.authLevel<UAUTH_User ){
122128 sqlite3ErrorMsg(pParse, "user not authenticated");
122129 pParse->rc = SQLITE_AUTH_USER;
122130 return;
122131 }
122132 }
122133 #endif
122134
122135 /* The cookie mask contains one bit for each database file open.
122136 ** (Bit 0 is for main, bit 1 is for temp, and so forth.) Bits are
122137 ** set for each database that is used. Generate code to start a
122138 ** transaction on each used database and to verify the schema cookie
122139 ** on each used database.
@@ -122258,20 +122312,10 @@
122258 sqlite3DbFree(db, zSql);
122259 memcpy(PARSE_TAIL(pParse), saveBuf, PARSE_TAIL_SZ);
122260 pParse->nested--;
122261 }
122262
122263 #if SQLITE_USER_AUTHENTICATION
122264 /*
122265 ** Return TRUE if zTable is the name of the system table that stores the
122266 ** list of users and their access credentials.
122267 */
122268 SQLITE_PRIVATE int sqlite3UserAuthTable(const char *zTable){
122269 return sqlite3_stricmp(zTable, "sqlite_user")==0;
122270 }
122271 #endif
122272
122273 /*
122274 ** Locate the in-memory structure that describes a particular database
122275 ** table given the name of that table and (optionally) the name of the
122276 ** database containing the table. Return NULL if not found.
122277 **
@@ -122286,17 +122330,10 @@
122286 Table *p = 0;
122287 int i;
122288
122289 /* All mutexes are required for schema access. Make sure we hold them. */
122290 assert( zDatabase!=0 || sqlite3BtreeHoldsAllMutexes(db) );
122291 #if SQLITE_USER_AUTHENTICATION
122292 /* Only the admin user is allowed to know that the sqlite_user table
122293 ** exists */
122294 if( db->auth.authLevel<UAUTH_Admin && sqlite3UserAuthTable(zName)!=0 ){
122295 return 0;
122296 }
122297 #endif
122298 if( zDatabase ){
122299 for(i=0; i<db->nDb; i++){
122300 if( sqlite3StrICmp(zDatabase, db->aDb[i].zDbSName)==0 ) break;
122301 }
122302 if( i>=db->nDb ){
@@ -125951,13 +125988,10 @@
125951
125952 assert( pTab!=0 );
125953 if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0
125954 && db->init.busy==0
125955 && pTblName!=0
125956 #if SQLITE_USER_AUTHENTICATION
125957 && sqlite3UserAuthTable(pTab->zName)==0
125958 #endif
125959 ){
125960 sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName);
125961 goto exit_create_index;
125962 }
125963 #ifndef SQLITE_OMIT_VIEW
@@ -127729,10 +127763,11 @@
127729 }
127730 #endif /* !defined(SQLITE_OMIT_CTE) */
127731
127732 /************** End of build.c ***********************************************/
127733 /************** Begin file callback.c ****************************************/
 
127734 /*
127735 ** 2005 May 23
127736 **
127737 ** The author disclaims copyright to this source code. In place of
127738 ** a legal notice, here is a blessing:
@@ -128272,10 +128307,11 @@
128272 return p;
128273 }
128274
128275 /************** End of callback.c ********************************************/
128276 /************** Begin file delete.c ******************************************/
 
128277 /*
128278 ** 2001 September 15
128279 **
128280 ** The author disclaims copyright to this source code. In place of
128281 ** a legal notice, here is a blessing:
@@ -129305,10 +129341,11 @@
129305 }
129306 }
129307
129308 /************** End of delete.c **********************************************/
129309 /************** Begin file func.c ********************************************/
 
129310 /*
129311 ** 2002 February 23
129312 **
129313 ** The author disclaims copyright to this source code. In place of
129314 ** a legal notice, here is a blessing:
@@ -131985,13 +132022,10 @@
131985 #endif
131986 #ifndef SQLITE_OMIT_LOAD_EXTENSION
131987 SFUNCTION(load_extension, 1, 0, 0, loadExt ),
131988 SFUNCTION(load_extension, 2, 0, 0, loadExt ),
131989 #endif
131990 #if SQLITE_USER_AUTHENTICATION
131991 FUNCTION(sqlite_crypt, 2, 0, 0, sqlite3CryptFunc ),
131992 #endif
131993 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
131994 DFUNCTION(sqlite_compileoption_used,1, 0, 0, compileoptionusedFunc ),
131995 DFUNCTION(sqlite_compileoption_get, 1, 0, 0, compileoptiongetFunc ),
131996 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
131997 INLINE_FUNC(unlikely, 1, INLINEFUNC_unlikely, SQLITE_FUNC_UNLIKELY),
@@ -132154,10 +132188,11 @@
132154 #endif
132155 }
132156
132157 /************** End of func.c ************************************************/
132158 /************** Begin file fkey.c ********************************************/
 
132159 /*
132160 **
132161 ** The author disclaims copyright to this source code. In place of
132162 ** a legal notice, here is a blessing:
132163 **
@@ -133641,10 +133676,11 @@
133641 }
133642 #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
133643
133644 /************** End of fkey.c ************************************************/
133645 /************** Begin file insert.c ******************************************/
 
133646 /*
133647 ** 2001 September 15
133648 **
133649 ** The author disclaims copyright to this source code. In place of
133650 ** a legal notice, here is a blessing:
@@ -137036,10 +137072,11 @@
137036 }
137037 #endif /* SQLITE_OMIT_XFER_OPT */
137038
137039 /************** End of insert.c **********************************************/
137040 /************** Begin file legacy.c ******************************************/
 
137041 /*
137042 ** 2001 September 15
137043 **
137044 ** The author disclaims copyright to this source code. In place of
137045 ** a legal notice, here is a blessing:
@@ -137180,10 +137217,11 @@
137180 return rc;
137181 }
137182
137183 /************** End of legacy.c **********************************************/
137184 /************** Begin file loadext.c *****************************************/
 
137185 /*
137186 ** 2006 June 7
137187 **
137188 ** The author disclaims copyright to this source code. In place of
137189 ** a legal notice, here is a blessing:
@@ -137200,10 +137238,11 @@
137200 #ifndef SQLITE_CORE
137201 #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
137202 #endif
137203 /************** Include sqlite3ext.h in the middle of loadext.c **************/
137204 /************** Begin file sqlite3ext.h **************************************/
 
137205 /*
137206 ** 2006 June 7
137207 **
137208 ** The author disclaims copyright to this source code. In place of
137209 ** a legal notice, here is a blessing:
@@ -137922,10 +137961,11 @@
137922
137923 #endif /* SQLITE3EXT_H */
137924
137925 /************** End of sqlite3ext.h ******************************************/
137926 /************** Continuing where we left off in loadext.c ********************/
 
137927 /* #include "sqliteInt.h" */
137928
137929 #ifndef SQLITE_OMIT_LOAD_EXTENSION
137930 /*
137931 ** Some API routines are omitted when various features are
@@ -138827,10 +138867,11 @@
138827 }
138828 }
138829
138830 /************** End of loadext.c *********************************************/
138831 /************** Begin file pragma.c ******************************************/
 
138832 /*
138833 ** 2003 April 6
138834 **
138835 ** The author disclaims copyright to this source code. In place of
138836 ** a legal notice, here is a blessing:
@@ -138859,10 +138900,11 @@
138859 ** lexicographical order to facility a binary search of the pragma name.
138860 ** Do not edit pragma.h directly. Edit and rerun the script in at
138861 ** ../tool/mkpragmatab.tcl. */
138862 /************** Include pragma.h in the middle of pragma.c *******************/
138863 /************** Begin file pragma.h ******************************************/
 
138864 /* DO NOT EDIT!
138865 ** This file is automatically generated by the script at
138866 ** ../tool/mkpragmatab.tcl. To update the set of pragmas, edit
138867 ** that script and rerun it.
138868 */
@@ -139522,10 +139564,11 @@
139522 };
139523 /* Number of pragmas: 68 on by default, 78 total. */
139524
139525 /************** End of pragma.h **********************************************/
139526 /************** Continuing where we left off in pragma.c *********************/
 
139527
139528 /*
139529 ** When the 0x10 bit of PRAGMA optimize is set, any ANALYZE commands
139530 ** will be run with an analysis_limit set to the lessor of the value of
139531 ** the following macro or to the actual analysis_limit if it is non-zero,
@@ -140637,16 +140680,10 @@
140637 if( db->autoCommit==0 ){
140638 /* Foreign key support may not be enabled or disabled while not
140639 ** in auto-commit mode. */
140640 mask &= ~(SQLITE_ForeignKeys);
140641 }
140642 #if SQLITE_USER_AUTHENTICATION
140643 if( db->auth.authLevel==UAUTH_User ){
140644 /* Do not allow non-admin users to modify the schema arbitrarily */
140645 mask &= ~(SQLITE_WriteSchema);
140646 }
140647 #endif
140648
140649 if( sqlite3GetBoolean(zRight, 0) ){
140650 if( (mask & SQLITE_WriteSchema)==0
140651 || (db->flags & SQLITE_Defensive)==0
140652 ){
@@ -142571,10 +142608,11 @@
142571
142572 #endif /* SQLITE_OMIT_PRAGMA */
142573
142574 /************** End of pragma.c **********************************************/
142575 /************** Begin file prepare.c *****************************************/
 
142576 /*
142577 ** 2005 May 25
142578 **
142579 ** The author disclaims copyright to this source code. In place of
142580 ** a legal notice, here is a blessing:
@@ -142879,18 +142917,11 @@
142879 encoding = (u8)meta[BTREE_TEXT_ENCODING-1] & 3;
142880 if( encoding==0 ) encoding = SQLITE_UTF8;
142881 #else
142882 encoding = SQLITE_UTF8;
142883 #endif
142884 if( db->nVdbeActive>0 && encoding!=ENC(db)
142885 && (db->mDbFlags & DBFLAG_Vacuum)==0
142886 ){
142887 rc = SQLITE_LOCKED;
142888 goto initone_error_out;
142889 }else{
142890 sqlite3SetTextEncoding(db, encoding);
142891 }
142892 }else{
142893 /* If opening an attached database, the encoding much match ENC(db) */
142894 if( (meta[BTREE_TEXT_ENCODING-1] & 3)!=ENC(db) ){
142895 sqlite3SetString(pzErrMsg, db, "attached databases must use the same"
142896 " text encoding as main database");
@@ -143671,10 +143702,11 @@
143671
143672 #endif /* SQLITE_OMIT_UTF16 */
143673
143674 /************** End of prepare.c *********************************************/
143675 /************** Begin file select.c ******************************************/
 
143676 /*
143677 ** 2001 September 15
143678 **
143679 ** The author disclaims copyright to this source code. In place of
143680 ** a legal notice, here is a blessing:
@@ -152443,10 +152475,11 @@
152443 return rc;
152444 }
152445
152446 /************** End of select.c **********************************************/
152447 /************** Begin file table.c *******************************************/
 
152448 /*
152449 ** 2001 September 15
152450 **
152451 ** The author disclaims copyright to this source code. In place of
152452 ** a legal notice, here is a blessing:
@@ -152644,10 +152677,11 @@
152644
152645 #endif /* SQLITE_OMIT_GET_TABLE */
152646
152647 /************** End of table.c ***********************************************/
152648 /************** Begin file trigger.c *****************************************/
 
152649 /*
152650 **
152651 ** The author disclaims copyright to this source code. In place of
152652 ** a legal notice, here is a blessing:
152653 **
@@ -154210,10 +154244,11 @@
154210
154211 #endif /* !defined(SQLITE_OMIT_TRIGGER) */
154212
154213 /************** End of trigger.c *********************************************/
154214 /************** Begin file update.c ******************************************/
 
154215 /*
154216 ** 2001 September 15
154217 **
154218 ** The author disclaims copyright to this source code. In place of
154219 ** a legal notice, here is a blessing:
@@ -155581,10 +155616,11 @@
155581 }
155582 #endif /* SQLITE_OMIT_VIRTUALTABLE */
155583
155584 /************** End of update.c **********************************************/
155585 /************** Begin file upsert.c ******************************************/
 
155586 /*
155587 ** 2018-04-12
155588 **
155589 ** The author disclaims copyright to this source code. In place of
155590 ** a legal notice, here is a blessing:
@@ -155913,10 +155949,11 @@
155913
155914 #endif /* SQLITE_OMIT_UPSERT */
155915
155916 /************** End of upsert.c **********************************************/
155917 /************** Begin file vacuum.c ******************************************/
 
155918 /*
155919 ** 2003 April 6
155920 **
155921 ** The author disclaims copyright to this source code. In place of
155922 ** a legal notice, here is a blessing:
@@ -156334,10 +156371,11 @@
156334
156335 #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
156336
156337 /************** End of vacuum.c **********************************************/
156338 /************** Begin file vtab.c ********************************************/
 
156339 /*
156340 ** 2006 June 10
156341 **
156342 ** The author disclaims copyright to this source code. In place of
156343 ** a legal notice, here is a blessing:
@@ -157711,10 +157749,11 @@
157711
157712 #endif /* SQLITE_OMIT_VIRTUALTABLE */
157713
157714 /************** End of vtab.c ************************************************/
157715 /************** Begin file wherecode.c ***************************************/
 
157716 /*
157717 ** 2015-06-06
157718 **
157719 ** The author disclaims copyright to this source code. In place of
157720 ** a legal notice, here is a blessing:
@@ -157733,10 +157772,11 @@
157733 ** file retains the code that does query planning and analysis.
157734 */
157735 /* #include "sqliteInt.h" */
157736 /************** Include whereInt.h in the middle of wherecode.c **************/
157737 /************** Begin file whereInt.h ****************************************/
 
157738 /*
157739 ** 2013-11-12
157740 **
157741 ** The author disclaims copyright to this source code. In place of
157742 ** a legal notice, here is a blessing:
@@ -158268,13 +158308,21 @@
158268 SQLITE_PRIVATE int sqlite3WhereExplainBloomFilter(
158269 const Parse *pParse, /* Parse context */
158270 const WhereInfo *pWInfo, /* WHERE clause */
158271 const WhereLevel *pLevel /* Bloom filter on this level */
158272 );
 
 
 
 
 
 
 
158273 #else
158274 # define sqlite3WhereExplainOneScan(u,v,w,x) 0
158275 # define sqlite3WhereExplainBloomFilter(u,v,w) 0
 
158276 #endif /* SQLITE_OMIT_EXPLAIN */
158277 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
158278 SQLITE_PRIVATE void sqlite3WhereAddScanStatus(
158279 Vdbe *v, /* Vdbe to add scanstatus entry to */
158280 SrcList *pSrclist, /* FROM clause pLvl reads data from */
@@ -158381,10 +158429,11 @@
158381
158382 #endif /* !defined(SQLITE_WHEREINT_H) */
158383
158384 /************** End of whereInt.h ********************************************/
158385 /************** Continuing where we left off in wherecode.c ******************/
 
158386
158387 #ifndef SQLITE_OMIT_EXPLAIN
158388
158389 /*
158390 ** Return the name of the i-th column of the pIdx index.
@@ -158472,42 +158521,42 @@
158472 }
158473 sqlite3_str_append(pStr, ")", 1);
158474 }
158475
158476 /*
158477 ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
158478 ** command, or if stmt_scanstatus_v2() stats are enabled, or if SQLITE_DEBUG
158479 ** was defined at compile-time. If it is not a no-op, a single OP_Explain
158480 ** opcode is added to the output to describe the table scan strategy in pLevel.
158481 **
158482 ** If an OP_Explain opcode is added to the VM, its address is returned.
158483 ** Otherwise, if no OP_Explain is coded, zero is returned.
158484 */
158485 SQLITE_PRIVATE int sqlite3WhereExplainOneScan(
158486 Parse *pParse, /* Parse context */
 
158487 SrcList *pTabList, /* Table list this loop refers to */
158488 WhereLevel *pLevel, /* Scan to write OP_Explain opcode for */
158489 u16 wctrlFlags /* Flags passed to sqlite3WhereBegin() */
158490 ){
158491 int ret = 0;
158492 #if !defined(SQLITE_DEBUG)
158493 if( sqlite3ParseToplevel(pParse)->explain==2 || IS_STMT_SCANSTATUS(pParse->db) )
158494 #endif
158495 {
 
 
158496 SrcItem *pItem = &pTabList->a[pLevel->iFrom];
158497 Vdbe *v = pParse->pVdbe; /* VM being constructed */
158498 sqlite3 *db = pParse->db; /* Database handle */
158499 int isSearch; /* True for a SEARCH. False for SCAN. */
158500 WhereLoop *pLoop; /* The controlling WhereLoop object */
158501 u32 flags; /* Flags that describe this loop */
 
158502 char *zMsg; /* Text to add to EQP output */
 
158503 StrAccum str; /* EQP output string */
158504 char zBuf[100]; /* Initial space for EQP output string */
158505
 
 
158506 pLoop = pLevel->pWLoop;
158507 flags = pLoop->wsFlags;
158508 if( (flags&WHERE_MULTI_OR) || (wctrlFlags&WHERE_OR_SUBCLAUSE) ) return 0;
158509
158510 isSearch = (flags&(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0
158511 || ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0))
158512 || (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX));
158513
@@ -158527,11 +158576,11 @@
158527 }
158528 }else if( flags & WHERE_PARTIALIDX ){
158529 zFmt = "AUTOMATIC PARTIAL COVERING INDEX";
158530 }else if( flags & WHERE_AUTO_INDEX ){
158531 zFmt = "AUTOMATIC COVERING INDEX";
158532 }else if( flags & WHERE_IDX_ONLY ){
158533 zFmt = "COVERING INDEX %s";
158534 }else{
158535 zFmt = "INDEX %s";
158536 }
158537 if( zFmt ){
@@ -158579,15 +158628,54 @@
158579 sqlite3LogEstToInt(pLoop->nOut));
158580 }else{
158581 sqlite3_str_append(&str, " (~1 row)", 9);
158582 }
158583 #endif
 
158584 zMsg = sqlite3StrAccumFinish(&str);
158585 sqlite3ExplainBreakpoint("",zMsg);
158586 ret = sqlite3VdbeAddOp4(v, OP_Explain, sqlite3VdbeCurrentAddr(v),
158587 pParse->addrExplain, pLoop->rRun,
158588 zMsg, P4_DYNAMIC);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158589 }
158590 return ret;
158591 }
158592
158593 /*
@@ -158682,13 +158770,14 @@
158682 if( wsFlags & WHERE_INDEXED ){
158683 sqlite3VdbeScanStatusRange(v, addrExplain, -1, pLvl->iIdxCur);
158684 }
158685 }else{
158686 int addr;
 
158687 assert( pSrclist->a[pLvl->iFrom].fg.isSubquery );
158688 addr = pSrclist->a[pLvl->iFrom].u4.pSubq->addrFillSub;
158689 VdbeOp *pOp = sqlite3VdbeGetOp(v, addr-1);
158690 assert( sqlite3VdbeDb(v)->mallocFailed || pOp->opcode==OP_InitCoroutine );
158691 assert( sqlite3VdbeDb(v)->mallocFailed || pOp->p2>addr );
158692 sqlite3VdbeScanStatusRange(v, addrExplain, addr, pOp->p2-1);
158693 }
158694 }
@@ -161263,10 +161352,11 @@
161263 pParse->withinRJSubrtn--;
161264 }
161265
161266 /************** End of wherecode.c *******************************************/
161267 /************** Begin file whereexpr.c ***************************************/
 
161268 /*
161269 ** 2015-06-08
161270 **
161271 ** The author disclaims copyright to this source code. In place of
161272 ** a legal notice, here is a blessing:
@@ -163168,10 +163258,11 @@
163168 }
163169 }
163170
163171 /************** End of whereexpr.c *******************************************/
163172 /************** Begin file where.c *******************************************/
 
163173 /*
163174 ** 2001 September 15
163175 **
163176 ** The author disclaims copyright to this source code. In place of
163177 ** a legal notice, here is a blessing:
@@ -170611,18 +170702,32 @@
170611 x = sqlite3TableColumnToIndex(pIdx, x);
170612 if( x>=0 ){
170613 pOp->p2 = x;
170614 pOp->p1 = pLevel->iIdxCur;
170615 OpcodeRewriteTrace(db, k, pOp);
170616 }else{
170617 /* Unable to translate the table reference into an index
170618 ** reference. Verify that this is harmless - that the
170619 ** table being referenced really is open.
170620 */
170621 if( pLoop->wsFlags & WHERE_IDX_ONLY ){
 
 
 
170622 sqlite3ErrorMsg(pParse, "internal query planner error");
170623 pParse->rc = SQLITE_INTERNAL;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170624 }
170625 }
170626 }else if( pOp->opcode==OP_Rowid ){
170627 pOp->p1 = pLevel->iIdxCur;
170628 pOp->opcode = OP_IdxRowid;
@@ -170654,10 +170759,11 @@
170654 return;
170655 }
170656
170657 /************** End of where.c ***********************************************/
170658 /************** Begin file window.c ******************************************/
 
170659 /*
170660 ** 2018 May 08
170661 **
170662 ** The author disclaims copyright to this source code. In place of
170663 ** a legal notice, here is a blessing:
@@ -173763,10 +173869,11 @@
173763
173764 #endif /* SQLITE_OMIT_WINDOWFUNC */
173765
173766 /************** End of window.c **********************************************/
173767 /************** Begin file parse.c *******************************************/
 
173768 /* This file is automatically generated by Lemon from input grammar
173769 ** source file "parse.y".
173770 */
173771 /*
173772 ** 2001-09-15
@@ -173786,10 +173893,11 @@
173786 ** That input file is processed by Lemon to generate a C-language
173787 ** implementation of a parser for the given grammar. You might be reading
173788 ** this comment as part of the translated C-code. Edits should be made
173789 ** to the original parse.y sources.
173790 */
 
173791
173792 /* #include "sqliteInt.h" */
173793
173794 /*
173795 ** Disable all error recovery processing in the parser push-down
@@ -173869,10 +173977,11 @@
173869 sqlite3ExprListDelete(pParse->db, pOrderBy);
173870 sqlite3ExprDelete(pParse->db, pLimit);
173871 }
173872 #endif /* SQLITE_ENABLE_UPDATE_DELETE_LIMIT */
173873
 
173874
173875 /*
173876 ** For a compound SELECT statement, make sure p->pPrior->pNext==p for
173877 ** all elements in the list. And make sure list length does not exceed
173878 ** SQLITE_LIMIT_COMPOUND_SELECT.
@@ -173923,10 +174032,11 @@
173923 ** testing.
173924 */
173925 static void *parserStackRealloc(void *pOld, sqlite3_uint64 newSize){
173926 return sqlite3FaultSim(700) ? 0 : sqlite3_realloc(pOld, newSize);
173927 }
 
173928
173929
173930 /* Construct a new Expr object from a single token */
173931 static Expr *tokenExpr(Parse *pParse, int op, Token t){
173932 Expr *p = sqlite3DbMallocRawNN(pParse->db, sizeof(Expr)+t.n+1);
@@ -173959,10 +174069,11 @@
173959 }
173960 }
173961 return p;
173962 }
173963
 
173964
173965 /* A routine to convert a binary TK_IS or TK_ISNOT expression into a
173966 ** unary TK_ISNULL or TK_NOTNULL expression. */
173967 static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
173968 sqlite3 *db = pParse->db;
@@ -173970,10 +174081,11 @@
173970 pA->op = (u8)op;
173971 sqlite3ExprDelete(db, pA->pRight);
173972 pA->pRight = 0;
173973 }
173974 }
 
173975
173976 /* Add a single new term to an ExprList that is used to store a
173977 ** list of identifiers. Report an error if the ID list contains
173978 ** a COLLATE clause or an ASC or DESC keyword, except ignore the
173979 ** error while parsing a legacy schema.
@@ -173993,14 +174105,16 @@
173993 pIdToken->n, pIdToken->z);
173994 }
173995 sqlite3ExprListSetName(pParse, p, pIdToken, 1);
173996 return p;
173997 }
 
173998
173999 #if TK_SPAN>255
174000 # error too many tokens in the grammar
174001 #endif
 
174002 /**************** End of %include directives **********************************/
174003 /* These constants specify the various numeric values for terminal symbols.
174004 ***************** Begin token definitions *************************************/
174005 #ifndef TK_SEMI
174006 #define TK_SEMI 1
@@ -176181,11 +176295,13 @@
176181 case 240: /* selectnowith */
176182 case 241: /* oneselect */
176183 case 253: /* values */
176184 case 255: /* mvalues */
176185 {
 
176186 sqlite3SelectDelete(pParse->db, (yypminor->yy555));
 
176187 }
176188 break;
176189 case 217: /* term */
176190 case 218: /* expr */
176191 case 247: /* where_opt */
@@ -176196,11 +176312,13 @@
176196 case 285: /* vinto */
176197 case 292: /* when_clause */
176198 case 297: /* key_opt */
176199 case 314: /* filter_clause */
176200 {
 
176201 sqlite3ExprDelete(pParse->db, (yypminor->yy454));
 
176202 }
176203 break;
176204 case 222: /* eidlist_opt */
176205 case 232: /* sortlist */
176206 case 233: /* eidlist */
@@ -176213,64 +176331,82 @@
176213 case 270: /* setlist */
176214 case 279: /* paren_exprlist */
176215 case 281: /* case_exprlist */
176216 case 313: /* part_opt */
176217 {
 
176218 sqlite3ExprListDelete(pParse->db, (yypminor->yy14));
 
176219 }
176220 break;
176221 case 239: /* fullname */
176222 case 246: /* from */
176223 case 258: /* seltablist */
176224 case 259: /* stl_prefix */
176225 case 264: /* xfullname */
176226 {
 
176227 sqlite3SrcListDelete(pParse->db, (yypminor->yy203));
 
176228 }
176229 break;
176230 case 242: /* wqlist */
176231 {
 
176232 sqlite3WithDelete(pParse->db, (yypminor->yy59));
 
176233 }
176234 break;
176235 case 252: /* window_clause */
176236 case 309: /* windowdefn_list */
176237 {
 
176238 sqlite3WindowListDelete(pParse->db, (yypminor->yy211));
 
176239 }
176240 break;
176241 case 265: /* idlist */
176242 case 272: /* idlist_opt */
176243 {
 
176244 sqlite3IdListDelete(pParse->db, (yypminor->yy132));
 
176245 }
176246 break;
176247 case 275: /* filter_over */
176248 case 310: /* windowdefn */
176249 case 311: /* window */
176250 case 312: /* frame_opt */
176251 case 315: /* over_clause */
176252 {
 
176253 sqlite3WindowDelete(pParse->db, (yypminor->yy211));
 
176254 }
176255 break;
176256 case 288: /* trigger_cmd_list */
176257 case 293: /* trigger_cmd */
176258 {
 
176259 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy427));
 
176260 }
176261 break;
176262 case 290: /* trigger_event */
176263 {
 
176264 sqlite3IdListDelete(pParse->db, (yypminor->yy286).b);
 
176265 }
176266 break;
176267 case 317: /* frame_bound */
176268 case 318: /* frame_bound_s */
176269 case 319: /* frame_bound_e */
176270 {
 
176271 sqlite3ExprDelete(pParse->db, (yypminor->yy509).pExpr);
 
176272 }
176273 break;
176274 /********* End destructor definitions *****************************************/
176275 default: break; /* If no destructor action specified: do nothing */
176276 }
@@ -176501,12 +176637,14 @@
176501 #endif
176502 while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
176503 /* Here code is inserted which will execute if the parser
176504 ** stack every overflows */
176505 /******** Begin %stack_overflow code ******************************************/
 
176506
176507 sqlite3OomFault(pParse->db);
 
176508 /******** End %stack_overflow code ********************************************/
176509 sqlite3ParserARG_STORE /* Suppress warning about unused %extra_argument var */
176510 sqlite3ParserCTX_STORE
176511 }
176512
@@ -177433,326 +177571,481 @@
177433 ** break;
177434 */
177435 /********** Begin reduce actions **********************************************/
177436 YYMINORTYPE yylhsminor;
177437 case 0: /* explain ::= EXPLAIN */
 
177438 { if( pParse->pReprepare==0 ) pParse->explain = 1; }
 
177439 break;
177440 case 1: /* explain ::= EXPLAIN QUERY PLAN */
 
177441 { if( pParse->pReprepare==0 ) pParse->explain = 2; }
 
177442 break;
177443 case 2: /* cmdx ::= cmd */
 
177444 { sqlite3FinishCoding(pParse); }
 
177445 break;
177446 case 3: /* cmd ::= BEGIN transtype trans_opt */
 
177447 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy144);}
 
177448 break;
177449 case 4: /* transtype ::= */
 
177450 {yymsp[1].minor.yy144 = TK_DEFERRED;}
 
177451 break;
177452 case 5: /* transtype ::= DEFERRED */
177453 case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
177454 case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
177455 case 324: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==324);
 
177456 {yymsp[0].minor.yy144 = yymsp[0].major; /*A-overwrites-X*/}
 
177457 break;
177458 case 8: /* cmd ::= COMMIT|END trans_opt */
177459 case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
 
177460 {sqlite3EndTransaction(pParse,yymsp[-1].major);}
 
177461 break;
177462 case 10: /* cmd ::= SAVEPOINT nm */
 
177463 {
177464 sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
177465 }
 
177466 break;
177467 case 11: /* cmd ::= RELEASE savepoint_opt nm */
 
177468 {
177469 sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
177470 }
 
177471 break;
177472 case 12: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
 
177473 {
177474 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
177475 }
 
177476 break;
177477 case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
 
177478 {
177479 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy144,0,0,yymsp[-2].minor.yy144);
177480 }
 
177481 break;
177482 case 14: /* createkw ::= CREATE */
 
177483 {disableLookaside(pParse);}
 
177484 break;
177485 case 15: /* ifnotexists ::= */
177486 case 18: /* temp ::= */ yytestcase(yyruleno==18);
177487 case 47: /* autoinc ::= */ yytestcase(yyruleno==47);
177488 case 62: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==62);
177489 case 72: /* defer_subclause_opt ::= */ yytestcase(yyruleno==72);
177490 case 81: /* ifexists ::= */ yytestcase(yyruleno==81);
177491 case 100: /* distinct ::= */ yytestcase(yyruleno==100);
177492 case 246: /* collate ::= */ yytestcase(yyruleno==246);
 
177493 {yymsp[1].minor.yy144 = 0;}
 
177494 break;
177495 case 16: /* ifnotexists ::= IF NOT EXISTS */
 
177496 {yymsp[-2].minor.yy144 = 1;}
 
177497 break;
177498 case 17: /* temp ::= TEMP */
 
177499 {yymsp[0].minor.yy144 = pParse->db->init.busy==0;}
 
177500 break;
177501 case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_option_set */
 
177502 {
177503 sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy391,0);
177504 }
 
177505 break;
177506 case 20: /* create_table_args ::= AS select */
 
177507 {
177508 sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy555);
177509 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy555);
177510 }
 
177511 break;
177512 case 21: /* table_option_set ::= */
 
177513 {yymsp[1].minor.yy391 = 0;}
 
177514 break;
177515 case 22: /* table_option_set ::= table_option_set COMMA table_option */
 
177516 {yylhsminor.yy391 = yymsp[-2].minor.yy391|yymsp[0].minor.yy391;}
 
177517 yymsp[-2].minor.yy391 = yylhsminor.yy391;
177518 break;
177519 case 23: /* table_option ::= WITHOUT nm */
 
177520 {
177521 if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
177522 yymsp[-1].minor.yy391 = TF_WithoutRowid | TF_NoVisibleRowid;
177523 }else{
177524 yymsp[-1].minor.yy391 = 0;
177525 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
177526 }
177527 }
 
177528 break;
177529 case 24: /* table_option ::= nm */
 
177530 {
177531 if( yymsp[0].minor.yy0.n==6 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"strict",6)==0 ){
177532 yylhsminor.yy391 = TF_Strict;
177533 }else{
177534 yylhsminor.yy391 = 0;
177535 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
177536 }
177537 }
 
177538 yymsp[0].minor.yy391 = yylhsminor.yy391;
177539 break;
177540 case 25: /* columnname ::= nm typetoken */
 
177541 {sqlite3AddColumn(pParse,yymsp[-1].minor.yy0,yymsp[0].minor.yy0);}
 
177542 break;
177543 case 26: /* typetoken ::= */
177544 case 65: /* conslist_opt ::= */ yytestcase(yyruleno==65);
177545 case 106: /* as ::= */ yytestcase(yyruleno==106);
 
177546 {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = 0;}
 
177547 break;
177548 case 27: /* typetoken ::= typename LP signed RP */
 
177549 {
177550 yymsp[-3].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
177551 }
 
177552 break;
177553 case 28: /* typetoken ::= typename LP signed COMMA signed RP */
 
177554 {
177555 yymsp[-5].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
177556 }
 
177557 break;
177558 case 29: /* typename ::= typename ID|STRING */
 
177559 {yymsp[-1].minor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
 
177560 break;
177561 case 30: /* scanpt ::= */
 
177562 {
177563 assert( yyLookahead!=YYNOCODE );
177564 yymsp[1].minor.yy168 = yyLookaheadToken.z;
177565 }
 
177566 break;
177567 case 31: /* scantok ::= */
 
177568 {
177569 assert( yyLookahead!=YYNOCODE );
177570 yymsp[1].minor.yy0 = yyLookaheadToken;
177571 }
 
177572 break;
177573 case 32: /* ccons ::= CONSTRAINT nm */
177574 case 67: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==67);
 
177575 {pParse->constraintName = yymsp[0].minor.yy0;}
 
177576 break;
177577 case 33: /* ccons ::= DEFAULT scantok term */
 
177578 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy454,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
 
177579 break;
177580 case 34: /* ccons ::= DEFAULT LP expr RP */
 
177581 {sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy454,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
 
177582 break;
177583 case 35: /* ccons ::= DEFAULT PLUS scantok term */
 
177584 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy454,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
 
177585 break;
177586 case 36: /* ccons ::= DEFAULT MINUS scantok term */
 
177587 {
177588 Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy454, 0);
177589 sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);
177590 }
 
177591 break;
177592 case 37: /* ccons ::= DEFAULT scantok ID|INDEXED */
 
177593 {
177594 Expr *p = tokenExpr(pParse, TK_STRING, yymsp[0].minor.yy0);
177595 if( p ){
177596 sqlite3ExprIdToTrueFalse(p);
177597 testcase( p->op==TK_TRUEFALSE && sqlite3ExprTruthValue(p) );
177598 }
177599 sqlite3AddDefaultValue(pParse,p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.z+yymsp[0].minor.yy0.n);
177600 }
 
177601 break;
177602 case 38: /* ccons ::= NOT NULL onconf */
 
177603 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy144);}
 
177604 break;
177605 case 39: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
 
177606 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy144,yymsp[0].minor.yy144,yymsp[-2].minor.yy144);}
 
177607 break;
177608 case 40: /* ccons ::= UNIQUE onconf */
 
177609 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy144,0,0,0,0,
177610 SQLITE_IDXTYPE_UNIQUE);}
 
177611 break;
177612 case 41: /* ccons ::= CHECK LP expr RP */
 
177613 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy454,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
 
177614 break;
177615 case 42: /* ccons ::= REFERENCES nm eidlist_opt refargs */
 
177616 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy14,yymsp[0].minor.yy144);}
 
177617 break;
177618 case 43: /* ccons ::= defer_subclause */
 
177619 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy144);}
 
177620 break;
177621 case 44: /* ccons ::= COLLATE ID|STRING */
 
177622 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
 
177623 break;
177624 case 45: /* generated ::= LP expr RP */
 
177625 {sqlite3AddGenerated(pParse,yymsp[-1].minor.yy454,0);}
 
177626 break;
177627 case 46: /* generated ::= LP expr RP ID */
 
177628 {sqlite3AddGenerated(pParse,yymsp[-2].minor.yy454,&yymsp[0].minor.yy0);}
 
177629 break;
177630 case 48: /* autoinc ::= AUTOINCR */
 
177631 {yymsp[0].minor.yy144 = 1;}
 
177632 break;
177633 case 49: /* refargs ::= */
 
177634 { yymsp[1].minor.yy144 = OE_None*0x0101; /* EV: R-19803-45884 */}
 
177635 break;
177636 case 50: /* refargs ::= refargs refarg */
 
177637 { yymsp[-1].minor.yy144 = (yymsp[-1].minor.yy144 & ~yymsp[0].minor.yy383.mask) | yymsp[0].minor.yy383.value; }
 
177638 break;
177639 case 51: /* refarg ::= MATCH nm */
 
177640 { yymsp[-1].minor.yy383.value = 0; yymsp[-1].minor.yy383.mask = 0x000000; }
 
177641 break;
177642 case 52: /* refarg ::= ON INSERT refact */
 
177643 { yymsp[-2].minor.yy383.value = 0; yymsp[-2].minor.yy383.mask = 0x000000; }
 
177644 break;
177645 case 53: /* refarg ::= ON DELETE refact */
 
177646 { yymsp[-2].minor.yy383.value = yymsp[0].minor.yy144; yymsp[-2].minor.yy383.mask = 0x0000ff; }
 
177647 break;
177648 case 54: /* refarg ::= ON UPDATE refact */
 
177649 { yymsp[-2].minor.yy383.value = yymsp[0].minor.yy144<<8; yymsp[-2].minor.yy383.mask = 0x00ff00; }
 
177650 break;
177651 case 55: /* refact ::= SET NULL */
 
177652 { yymsp[-1].minor.yy144 = OE_SetNull; /* EV: R-33326-45252 */}
 
177653 break;
177654 case 56: /* refact ::= SET DEFAULT */
 
177655 { yymsp[-1].minor.yy144 = OE_SetDflt; /* EV: R-33326-45252 */}
 
177656 break;
177657 case 57: /* refact ::= CASCADE */
 
177658 { yymsp[0].minor.yy144 = OE_Cascade; /* EV: R-33326-45252 */}
 
177659 break;
177660 case 58: /* refact ::= RESTRICT */
 
177661 { yymsp[0].minor.yy144 = OE_Restrict; /* EV: R-33326-45252 */}
 
177662 break;
177663 case 59: /* refact ::= NO ACTION */
 
177664 { yymsp[-1].minor.yy144 = OE_None; /* EV: R-33326-45252 */}
 
177665 break;
177666 case 60: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
 
177667 {yymsp[-2].minor.yy144 = 0;}
 
177668 break;
177669 case 61: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
177670 case 76: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==76);
177671 case 173: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==173);
 
177672 {yymsp[-1].minor.yy144 = yymsp[0].minor.yy144;}
 
177673 break;
177674 case 63: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
177675 case 80: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==80);
177676 case 219: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==219);
177677 case 222: /* in_op ::= NOT IN */ yytestcase(yyruleno==222);
177678 case 247: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==247);
 
177679 {yymsp[-1].minor.yy144 = 1;}
 
177680 break;
177681 case 64: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
 
177682 {yymsp[-1].minor.yy144 = 0;}
 
177683 break;
177684 case 66: /* tconscomma ::= COMMA */
 
177685 {pParse->constraintName.n = 0;}
 
177686 break;
177687 case 68: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
 
177688 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy14,yymsp[0].minor.yy144,yymsp[-2].minor.yy144,0);}
 
177689 break;
177690 case 69: /* tcons ::= UNIQUE LP sortlist RP onconf */
 
177691 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy14,yymsp[0].minor.yy144,0,0,0,0,
177692 SQLITE_IDXTYPE_UNIQUE);}
 
177693 break;
177694 case 70: /* tcons ::= CHECK LP expr RP onconf */
 
177695 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy454,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
 
177696 break;
177697 case 71: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
 
177698 {
177699 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy14, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy14, yymsp[-1].minor.yy144);
177700 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy144);
177701 }
 
177702 break;
177703 case 73: /* onconf ::= */
177704 case 75: /* orconf ::= */ yytestcase(yyruleno==75);
 
177705 {yymsp[1].minor.yy144 = OE_Default;}
 
177706 break;
177707 case 74: /* onconf ::= ON CONFLICT resolvetype */
 
177708 {yymsp[-2].minor.yy144 = yymsp[0].minor.yy144;}
 
177709 break;
177710 case 77: /* resolvetype ::= IGNORE */
 
177711 {yymsp[0].minor.yy144 = OE_Ignore;}
 
177712 break;
177713 case 78: /* resolvetype ::= REPLACE */
177714 case 174: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==174);
 
177715 {yymsp[0].minor.yy144 = OE_Replace;}
 
177716 break;
177717 case 79: /* cmd ::= DROP TABLE ifexists fullname */
 
177718 {
177719 sqlite3DropTable(pParse, yymsp[0].minor.yy203, 0, yymsp[-1].minor.yy144);
177720 }
 
177721 break;
177722 case 82: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
 
177723 {
177724 sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy14, yymsp[0].minor.yy555, yymsp[-7].minor.yy144, yymsp[-5].minor.yy144);
177725 }
 
177726 break;
177727 case 83: /* cmd ::= DROP VIEW ifexists fullname */
 
177728 {
177729 sqlite3DropTable(pParse, yymsp[0].minor.yy203, 1, yymsp[-1].minor.yy144);
177730 }
 
177731 break;
177732 case 84: /* cmd ::= select */
 
177733 {
177734 SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0, 0};
177735 sqlite3Select(pParse, yymsp[0].minor.yy555, &dest);
 
 
 
 
177736 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy555);
177737 }
 
177738 break;
177739 case 85: /* select ::= WITH wqlist selectnowith */
 
177740 {yymsp[-2].minor.yy555 = attachWithToSelect(pParse,yymsp[0].minor.yy555,yymsp[-1].minor.yy59);}
 
177741 break;
177742 case 86: /* select ::= WITH RECURSIVE wqlist selectnowith */
 
177743 {yymsp[-3].minor.yy555 = attachWithToSelect(pParse,yymsp[0].minor.yy555,yymsp[-1].minor.yy59);}
 
177744 break;
177745 case 87: /* select ::= selectnowith */
 
177746 {
177747 Select *p = yymsp[0].minor.yy555;
177748 if( p ){
177749 parserDoubleLinkSelect(pParse, p);
177750 }
177751 }
 
177752 break;
177753 case 88: /* selectnowith ::= selectnowith multiselect_op oneselect */
 
177754 {
177755 Select *pRhs = yymsp[0].minor.yy555;
177756 Select *pLhs = yymsp[-2].minor.yy555;
177757 if( pRhs && pRhs->pPrior ){
177758 SrcList *pFrom;
@@ -177771,131 +178064,175 @@
177771 }else{
177772 sqlite3SelectDelete(pParse->db, pLhs);
177773 }
177774 yymsp[-2].minor.yy555 = pRhs;
177775 }
 
177776 break;
177777 case 89: /* multiselect_op ::= UNION */
177778 case 91: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==91);
 
177779 {yymsp[0].minor.yy144 = yymsp[0].major; /*A-overwrites-OP*/}
 
177780 break;
177781 case 90: /* multiselect_op ::= UNION ALL */
 
177782 {yymsp[-1].minor.yy144 = TK_ALL;}
 
177783 break;
177784 case 92: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
 
177785 {
177786 yymsp[-8].minor.yy555 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy14,yymsp[-5].minor.yy203,yymsp[-4].minor.yy454,yymsp[-3].minor.yy14,yymsp[-2].minor.yy454,yymsp[-1].minor.yy14,yymsp[-7].minor.yy144,yymsp[0].minor.yy454);
177787 }
 
177788 break;
177789 case 93: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
 
177790 {
177791 yymsp[-9].minor.yy555 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy14,yymsp[-6].minor.yy203,yymsp[-5].minor.yy454,yymsp[-4].minor.yy14,yymsp[-3].minor.yy454,yymsp[-1].minor.yy14,yymsp[-8].minor.yy144,yymsp[0].minor.yy454);
177792 if( yymsp[-9].minor.yy555 ){
177793 yymsp[-9].minor.yy555->pWinDefn = yymsp[-2].minor.yy211;
177794 }else{
177795 sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy211);
177796 }
177797 }
 
177798 break;
177799 case 94: /* values ::= VALUES LP nexprlist RP */
 
177800 {
177801 yymsp[-3].minor.yy555 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy14,0,0,0,0,0,SF_Values,0);
177802 }
 
177803 break;
177804 case 95: /* oneselect ::= mvalues */
 
177805 {
177806 sqlite3MultiValuesEnd(pParse, yymsp[0].minor.yy555);
177807 }
 
177808 break;
177809 case 96: /* mvalues ::= values COMMA LP nexprlist RP */
177810 case 97: /* mvalues ::= mvalues COMMA LP nexprlist RP */ yytestcase(yyruleno==97);
 
177811 {
177812 yymsp[-4].minor.yy555 = sqlite3MultiValues(pParse, yymsp[-4].minor.yy555, yymsp[-1].minor.yy14);
177813 }
 
177814 break;
177815 case 98: /* distinct ::= DISTINCT */
 
177816 {yymsp[0].minor.yy144 = SF_Distinct;}
 
177817 break;
177818 case 99: /* distinct ::= ALL */
 
177819 {yymsp[0].minor.yy144 = SF_All;}
 
177820 break;
177821 case 101: /* sclp ::= */
177822 case 134: /* orderby_opt ::= */ yytestcase(yyruleno==134);
177823 case 144: /* groupby_opt ::= */ yytestcase(yyruleno==144);
177824 case 234: /* exprlist ::= */ yytestcase(yyruleno==234);
177825 case 237: /* paren_exprlist ::= */ yytestcase(yyruleno==237);
177826 case 242: /* eidlist_opt ::= */ yytestcase(yyruleno==242);
 
177827 {yymsp[1].minor.yy14 = 0;}
 
177828 break;
177829 case 102: /* selcollist ::= sclp scanpt expr scanpt as */
 
177830 {
177831 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy14, yymsp[-2].minor.yy454);
177832 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy14, &yymsp[0].minor.yy0, 1);
177833 sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy14,yymsp[-3].minor.yy168,yymsp[-1].minor.yy168);
177834 }
 
177835 break;
177836 case 103: /* selcollist ::= sclp scanpt STAR */
 
177837 {
177838 Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
177839 sqlite3ExprSetErrorOffset(p, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
177840 yymsp[-2].minor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy14, p);
177841 }
 
177842 break;
177843 case 104: /* selcollist ::= sclp scanpt nm DOT STAR */
 
177844 {
177845 Expr *pRight, *pLeft, *pDot;
177846 pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
177847 sqlite3ExprSetErrorOffset(pRight, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
177848 pLeft = tokenExpr(pParse, TK_ID, yymsp[-2].minor.yy0);
177849 pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
177850 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, pDot);
177851 }
 
177852 break;
177853 case 105: /* as ::= AS nm */
177854 case 117: /* dbnm ::= DOT nm */ yytestcase(yyruleno==117);
177855 case 258: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==258);
177856 case 259: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==259);
 
177857 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
 
177858 break;
177859 case 107: /* from ::= */
177860 case 110: /* stl_prefix ::= */ yytestcase(yyruleno==110);
 
177861 {yymsp[1].minor.yy203 = 0;}
 
177862 break;
177863 case 108: /* from ::= FROM seltablist */
 
177864 {
177865 yymsp[-1].minor.yy203 = yymsp[0].minor.yy203;
177866 sqlite3SrcListShiftJoinType(pParse,yymsp[-1].minor.yy203);
177867 }
 
177868 break;
177869 case 109: /* stl_prefix ::= seltablist joinop */
 
177870 {
177871 if( ALWAYS(yymsp[-1].minor.yy203 && yymsp[-1].minor.yy203->nSrc>0) ) yymsp[-1].minor.yy203->a[yymsp[-1].minor.yy203->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy144;
177872 }
 
177873 break;
177874 case 111: /* seltablist ::= stl_prefix nm dbnm as on_using */
 
177875 {
177876 yymsp[-4].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-4].minor.yy203,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy269);
177877 }
 
177878 break;
177879 case 112: /* seltablist ::= stl_prefix nm dbnm as indexed_by on_using */
 
177880 {
177881 yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,0,&yymsp[0].minor.yy269);
177882 sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy203, &yymsp[-1].minor.yy0);
177883 }
 
177884 break;
177885 case 113: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_using */
 
177886 {
177887 yymsp[-7].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-7].minor.yy203,&yymsp[-6].minor.yy0,&yymsp[-5].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy269);
177888 sqlite3SrcListFuncArgs(pParse, yymsp[-7].minor.yy203, yymsp[-3].minor.yy14);
177889 }
 
177890 break;
177891 case 114: /* seltablist ::= stl_prefix LP select RP as on_using */
 
177892 {
177893 yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,0,0,&yymsp[-1].minor.yy0,yymsp[-3].minor.yy555,&yymsp[0].minor.yy269);
177894 }
 
177895 break;
177896 case 115: /* seltablist ::= stl_prefix LP seltablist RP as on_using */
 
177897 {
177898 if( yymsp[-5].minor.yy203==0 && yymsp[-1].minor.yy0.n==0 && yymsp[0].minor.yy269.pOn==0 && yymsp[0].minor.yy269.pUsing==0 ){
177899 yymsp[-5].minor.yy203 = yymsp[-3].minor.yy203;
177900 }else if( ALWAYS(yymsp[-3].minor.yy203!=0) && yymsp[-3].minor.yy203->nSrc==1 ){
177901 yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,0,0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy269);
@@ -177932,144 +178269,210 @@
177932 sqlite3SrcListShiftJoinType(pParse,yymsp[-3].minor.yy203);
177933 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-3].minor.yy203,0,0,0,0,SF_NestedFrom,0);
177934 yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,0,0,&yymsp[-1].minor.yy0,pSubquery,&yymsp[0].minor.yy269);
177935 }
177936 }
 
177937 break;
177938 case 116: /* dbnm ::= */
177939 case 131: /* indexed_opt ::= */ yytestcase(yyruleno==131);
 
177940 {yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
 
177941 break;
177942 case 118: /* fullname ::= nm */
 
177943 {
177944 yylhsminor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
177945 if( IN_RENAME_OBJECT && yylhsminor.yy203 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy203->a[0].zName, &yymsp[0].minor.yy0);
177946 }
 
177947 yymsp[0].minor.yy203 = yylhsminor.yy203;
177948 break;
177949 case 119: /* fullname ::= nm DOT nm */
 
177950 {
177951 yylhsminor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
177952 if( IN_RENAME_OBJECT && yylhsminor.yy203 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy203->a[0].zName, &yymsp[0].minor.yy0);
177953 }
 
177954 yymsp[-2].minor.yy203 = yylhsminor.yy203;
177955 break;
177956 case 120: /* xfullname ::= nm */
 
177957 {yymsp[0].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
 
177958 break;
177959 case 121: /* xfullname ::= nm DOT nm */
 
177960 {yymsp[-2].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
 
177961 break;
177962 case 122: /* xfullname ::= nm DOT nm AS nm */
 
177963 {
177964 yymsp[-4].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
177965 if( yymsp[-4].minor.yy203 ) yymsp[-4].minor.yy203->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
177966 }
 
177967 break;
177968 case 123: /* xfullname ::= nm AS nm */
 
177969 {
177970 yymsp[-2].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
177971 if( yymsp[-2].minor.yy203 ) yymsp[-2].minor.yy203->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
177972 }
 
177973 break;
177974 case 124: /* joinop ::= COMMA|JOIN */
 
177975 { yymsp[0].minor.yy144 = JT_INNER; }
 
177976 break;
177977 case 125: /* joinop ::= JOIN_KW JOIN */
 
177978 {yymsp[-1].minor.yy144 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
 
177979 break;
177980 case 126: /* joinop ::= JOIN_KW nm JOIN */
 
177981 {yymsp[-2].minor.yy144 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
 
177982 break;
177983 case 127: /* joinop ::= JOIN_KW nm nm JOIN */
 
177984 {yymsp[-3].minor.yy144 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
 
177985 break;
177986 case 128: /* on_using ::= ON expr */
 
177987 {yymsp[-1].minor.yy269.pOn = yymsp[0].minor.yy454; yymsp[-1].minor.yy269.pUsing = 0;}
 
177988 break;
177989 case 129: /* on_using ::= USING LP idlist RP */
 
177990 {yymsp[-3].minor.yy269.pOn = 0; yymsp[-3].minor.yy269.pUsing = yymsp[-1].minor.yy132;}
 
177991 break;
177992 case 130: /* on_using ::= */
 
177993 {yymsp[1].minor.yy269.pOn = 0; yymsp[1].minor.yy269.pUsing = 0;}
 
177994 break;
177995 case 132: /* indexed_by ::= INDEXED BY nm */
 
177996 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
 
177997 break;
177998 case 133: /* indexed_by ::= NOT INDEXED */
 
177999 {yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
 
178000 break;
178001 case 135: /* orderby_opt ::= ORDER BY sortlist */
178002 case 145: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==145);
 
178003 {yymsp[-2].minor.yy14 = yymsp[0].minor.yy14;}
 
178004 break;
178005 case 136: /* sortlist ::= sortlist COMMA expr sortorder nulls */
 
178006 {
178007 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14,yymsp[-2].minor.yy454);
178008 sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy14,yymsp[-1].minor.yy144,yymsp[0].minor.yy144);
178009 }
 
178010 break;
178011 case 137: /* sortlist ::= expr sortorder nulls */
 
178012 {
178013 yymsp[-2].minor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy454); /*A-overwrites-Y*/
178014 sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy14,yymsp[-1].minor.yy144,yymsp[0].minor.yy144);
178015 }
 
178016 break;
178017 case 138: /* sortorder ::= ASC */
 
178018 {yymsp[0].minor.yy144 = SQLITE_SO_ASC;}
 
178019 break;
178020 case 139: /* sortorder ::= DESC */
 
178021 {yymsp[0].minor.yy144 = SQLITE_SO_DESC;}
 
178022 break;
178023 case 140: /* sortorder ::= */
178024 case 143: /* nulls ::= */ yytestcase(yyruleno==143);
 
178025 {yymsp[1].minor.yy144 = SQLITE_SO_UNDEFINED;}
 
178026 break;
178027 case 141: /* nulls ::= NULLS FIRST */
 
178028 {yymsp[-1].minor.yy144 = SQLITE_SO_ASC;}
 
178029 break;
178030 case 142: /* nulls ::= NULLS LAST */
 
178031 {yymsp[-1].minor.yy144 = SQLITE_SO_DESC;}
 
178032 break;
178033 case 146: /* having_opt ::= */
178034 case 148: /* limit_opt ::= */ yytestcase(yyruleno==148);
178035 case 153: /* where_opt ::= */ yytestcase(yyruleno==153);
178036 case 155: /* where_opt_ret ::= */ yytestcase(yyruleno==155);
178037 case 232: /* case_else ::= */ yytestcase(yyruleno==232);
178038 case 233: /* case_operand ::= */ yytestcase(yyruleno==233);
178039 case 252: /* vinto ::= */ yytestcase(yyruleno==252);
 
178040 {yymsp[1].minor.yy454 = 0;}
 
178041 break;
178042 case 147: /* having_opt ::= HAVING expr */
178043 case 154: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==154);
178044 case 156: /* where_opt_ret ::= WHERE expr */ yytestcase(yyruleno==156);
178045 case 231: /* case_else ::= ELSE expr */ yytestcase(yyruleno==231);
178046 case 251: /* vinto ::= INTO expr */ yytestcase(yyruleno==251);
 
178047 {yymsp[-1].minor.yy454 = yymsp[0].minor.yy454;}
 
178048 break;
178049 case 149: /* limit_opt ::= LIMIT expr */
 
178050 {yymsp[-1].minor.yy454 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy454,0);}
 
178051 break;
178052 case 150: /* limit_opt ::= LIMIT expr OFFSET expr */
 
178053 {yymsp[-3].minor.yy454 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);}
 
178054 break;
178055 case 151: /* limit_opt ::= LIMIT expr COMMA expr */
 
178056 {yymsp[-3].minor.yy454 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy454,yymsp[-2].minor.yy454);}
 
178057 break;
178058 case 152: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
 
178059 {
178060 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy203, &yymsp[-1].minor.yy0);
178061 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy203,yymsp[0].minor.yy454,0,0);
178062 }
 
178063 break;
178064 case 157: /* where_opt_ret ::= RETURNING selcollist */
 
178065 {sqlite3AddReturning(pParse,yymsp[0].minor.yy14); yymsp[-1].minor.yy454 = 0;}
 
178066 break;
178067 case 158: /* where_opt_ret ::= WHERE expr RETURNING selcollist */
 
178068 {sqlite3AddReturning(pParse,yymsp[0].minor.yy14); yymsp[-3].minor.yy454 = yymsp[-2].minor.yy454;}
 
178069 break;
178070 case 159: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
 
178071 {
178072 sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy203, &yymsp[-4].minor.yy0);
178073 sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy14,"set list");
178074 if( yymsp[-1].minor.yy203 ){
178075 SrcList *pFromClause = yymsp[-1].minor.yy203;
@@ -178083,92 +178486,134 @@
178083 }
178084 yymsp[-5].minor.yy203 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy203, pFromClause);
178085 }
178086 sqlite3Update(pParse,yymsp[-5].minor.yy203,yymsp[-2].minor.yy14,yymsp[0].minor.yy454,yymsp[-6].minor.yy144,0,0,0);
178087 }
 
178088 break;
178089 case 160: /* setlist ::= setlist COMMA nm EQ expr */
 
178090 {
178091 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy14, yymsp[0].minor.yy454);
178092 sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy14, &yymsp[-2].minor.yy0, 1);
178093 }
 
178094 break;
178095 case 161: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
 
178096 {
178097 yymsp[-6].minor.yy14 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy14, yymsp[-3].minor.yy132, yymsp[0].minor.yy454);
178098 }
 
178099 break;
178100 case 162: /* setlist ::= nm EQ expr */
 
178101 {
178102 yylhsminor.yy14 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy454);
178103 sqlite3ExprListSetName(pParse, yylhsminor.yy14, &yymsp[-2].minor.yy0, 1);
178104 }
 
178105 yymsp[-2].minor.yy14 = yylhsminor.yy14;
178106 break;
178107 case 163: /* setlist ::= LP idlist RP EQ expr */
 
178108 {
178109 yymsp[-4].minor.yy14 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy132, yymsp[0].minor.yy454);
178110 }
 
178111 break;
178112 case 164: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
 
178113 {
178114 sqlite3Insert(pParse, yymsp[-3].minor.yy203, yymsp[-1].minor.yy555, yymsp[-2].minor.yy132, yymsp[-5].minor.yy144, yymsp[0].minor.yy122);
178115 }
 
178116 break;
178117 case 165: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
 
178118 {
178119 sqlite3Insert(pParse, yymsp[-4].minor.yy203, 0, yymsp[-3].minor.yy132, yymsp[-6].minor.yy144, 0);
178120 }
 
178121 break;
178122 case 166: /* upsert ::= */
 
178123 { yymsp[1].minor.yy122 = 0; }
 
178124 break;
178125 case 167: /* upsert ::= RETURNING selcollist */
 
178126 { yymsp[-1].minor.yy122 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy14); }
 
178127 break;
178128 case 168: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
 
178129 { yymsp[-11].minor.yy122 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy14,yymsp[-6].minor.yy454,yymsp[-2].minor.yy14,yymsp[-1].minor.yy454,yymsp[0].minor.yy122);}
 
178130 break;
178131 case 169: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
 
178132 { yymsp[-8].minor.yy122 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy14,yymsp[-3].minor.yy454,0,0,yymsp[0].minor.yy122); }
 
178133 break;
178134 case 170: /* upsert ::= ON CONFLICT DO NOTHING returning */
 
178135 { yymsp[-4].minor.yy122 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
 
178136 break;
178137 case 171: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
 
178138 { yymsp[-7].minor.yy122 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy14,yymsp[-1].minor.yy454,0);}
 
178139 break;
178140 case 172: /* returning ::= RETURNING selcollist */
 
178141 {sqlite3AddReturning(pParse,yymsp[0].minor.yy14);}
 
178142 break;
178143 case 175: /* idlist_opt ::= */
 
178144 {yymsp[1].minor.yy132 = 0;}
 
178145 break;
178146 case 176: /* idlist_opt ::= LP idlist RP */
 
178147 {yymsp[-2].minor.yy132 = yymsp[-1].minor.yy132;}
 
178148 break;
178149 case 177: /* idlist ::= idlist COMMA nm */
 
178150 {yymsp[-2].minor.yy132 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy132,&yymsp[0].minor.yy0);}
 
178151 break;
178152 case 178: /* idlist ::= nm */
 
178153 {yymsp[0].minor.yy132 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
 
178154 break;
178155 case 179: /* expr ::= LP expr RP */
 
178156 {yymsp[-2].minor.yy454 = yymsp[-1].minor.yy454;}
 
178157 break;
178158 case 180: /* expr ::= ID|INDEXED|JOIN_KW */
 
178159 {yymsp[0].minor.yy454=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
 
178160 break;
178161 case 181: /* expr ::= nm DOT nm */
 
178162 {
178163 Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
178164 Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
178165 yylhsminor.yy454 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
178166 }
 
178167 yymsp[-2].minor.yy454 = yylhsminor.yy454;
178168 break;
178169 case 182: /* expr ::= nm DOT nm DOT nm */
 
178170 {
178171 Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-4].minor.yy0);
178172 Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
178173 Expr *temp3 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
178174 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
@@ -178175,24 +178620,30 @@
178175 if( IN_RENAME_OBJECT ){
178176 sqlite3RenameTokenRemap(pParse, 0, temp1);
178177 }
178178 yylhsminor.yy454 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
178179 }
 
178180 yymsp[-4].minor.yy454 = yylhsminor.yy454;
178181 break;
178182 case 183: /* term ::= NULL|FLOAT|BLOB */
178183 case 184: /* term ::= STRING */ yytestcase(yyruleno==184);
 
178184 {yymsp[0].minor.yy454=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
 
178185 break;
178186 case 185: /* term ::= INTEGER */
 
178187 {
178188 yylhsminor.yy454 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
178189 if( yylhsminor.yy454 ) yylhsminor.yy454->w.iOfst = (int)(yymsp[0].minor.yy0.z - pParse->zTail);
178190 }
 
178191 yymsp[0].minor.yy454 = yylhsminor.yy454;
178192 break;
178193 case 186: /* expr ::= VARIABLE */
 
178194 {
178195 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
178196 u32 n = yymsp[0].minor.yy0.n;
178197 yymsp[0].minor.yy454 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
178198 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy454, n);
@@ -178209,70 +178660,90 @@
178209 yymsp[0].minor.yy454 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
178210 if( yymsp[0].minor.yy454 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy454->iTable);
178211 }
178212 }
178213 }
 
178214 break;
178215 case 187: /* expr ::= expr COLLATE ID|STRING */
 
178216 {
178217 yymsp[-2].minor.yy454 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy454, &yymsp[0].minor.yy0, 1);
178218 }
 
178219 break;
178220 case 188: /* expr ::= CAST LP expr AS typetoken RP */
 
178221 {
178222 yymsp[-5].minor.yy454 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
178223 sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy454, yymsp[-3].minor.yy454, 0);
178224 }
 
178225 break;
178226 case 189: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
 
178227 {
178228 yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy14, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy144);
178229 }
 
178230 yymsp[-4].minor.yy454 = yylhsminor.yy454;
178231 break;
178232 case 190: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
 
178233 {
178234 yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-4].minor.yy14, &yymsp[-7].minor.yy0, yymsp[-5].minor.yy144);
178235 sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy454, yymsp[-1].minor.yy14);
178236 }
 
178237 yymsp[-7].minor.yy454 = yylhsminor.yy454;
178238 break;
178239 case 191: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP */
 
178240 {
178241 yylhsminor.yy454 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
178242 }
 
178243 yymsp[-3].minor.yy454 = yylhsminor.yy454;
178244 break;
178245 case 192: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
 
178246 {
178247 yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy14, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy144);
178248 sqlite3WindowAttach(pParse, yylhsminor.yy454, yymsp[0].minor.yy211);
178249 }
 
178250 yymsp[-5].minor.yy454 = yylhsminor.yy454;
178251 break;
178252 case 193: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
 
178253 {
178254 yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-5].minor.yy14, &yymsp[-8].minor.yy0, yymsp[-6].minor.yy144);
178255 sqlite3WindowAttach(pParse, yylhsminor.yy454, yymsp[0].minor.yy211);
178256 sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy454, yymsp[-2].minor.yy14);
178257 }
 
178258 yymsp[-8].minor.yy454 = yylhsminor.yy454;
178259 break;
178260 case 194: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP filter_over */
 
178261 {
178262 yylhsminor.yy454 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
178263 sqlite3WindowAttach(pParse, yylhsminor.yy454, yymsp[0].minor.yy211);
178264 }
 
178265 yymsp[-4].minor.yy454 = yylhsminor.yy454;
178266 break;
178267 case 195: /* term ::= CTIME_KW */
 
178268 {
178269 yylhsminor.yy454 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
178270 }
 
178271 yymsp[0].minor.yy454 = yylhsminor.yy454;
178272 break;
178273 case 196: /* expr ::= LP nexprlist COMMA expr RP */
 
178274 {
178275 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy14, yymsp[-1].minor.yy454);
178276 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
178277 if( yymsp[-4].minor.yy454 ){
178278 yymsp[-4].minor.yy454->x.pList = pList;
@@ -178281,27 +178752,35 @@
178281 }
178282 }else{
178283 sqlite3ExprListDelete(pParse->db, pList);
178284 }
178285 }
 
178286 break;
178287 case 197: /* expr ::= expr AND expr */
 
178288 {yymsp[-2].minor.yy454=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);}
 
178289 break;
178290 case 198: /* expr ::= expr OR expr */
178291 case 199: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==199);
178292 case 200: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==200);
178293 case 201: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==201);
178294 case 202: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==202);
178295 case 203: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==203);
178296 case 204: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==204);
 
178297 {yymsp[-2].minor.yy454=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);}
 
178298 break;
178299 case 205: /* likeop ::= NOT LIKE_KW|MATCH */
 
178300 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
 
178301 break;
178302 case 206: /* expr ::= expr likeop expr */
 
178303 {
178304 ExprList *pList;
178305 int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
178306 yymsp[-1].minor.yy0.n &= 0x7fffffff;
178307 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy454);
@@ -178308,12 +178787,14 @@
178308 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy454);
178309 yymsp[-2].minor.yy454 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
178310 if( bNot ) yymsp[-2].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy454, 0);
178311 if( yymsp[-2].minor.yy454 ) yymsp[-2].minor.yy454->flags |= EP_InfixFunc;
178312 }
 
178313 break;
178314 case 207: /* expr ::= expr likeop expr ESCAPE expr */
 
178315 {
178316 ExprList *pList;
178317 int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
178318 yymsp[-3].minor.yy0.n &= 0x7fffffff;
178319 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy454);
@@ -178321,46 +178802,62 @@
178321 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy454);
178322 yymsp[-4].minor.yy454 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
178323 if( bNot ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178324 if( yymsp[-4].minor.yy454 ) yymsp[-4].minor.yy454->flags |= EP_InfixFunc;
178325 }
 
178326 break;
178327 case 208: /* expr ::= expr ISNULL|NOTNULL */
 
178328 {yymsp[-1].minor.yy454 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy454,0);}
 
178329 break;
178330 case 209: /* expr ::= expr NOT NULL */
 
178331 {yymsp[-2].minor.yy454 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy454,0);}
 
178332 break;
178333 case 210: /* expr ::= expr IS expr */
 
178334 {
178335 yymsp[-2].minor.yy454 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);
178336 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-2].minor.yy454, TK_ISNULL);
178337 }
 
178338 break;
178339 case 211: /* expr ::= expr IS NOT expr */
 
178340 {
178341 yymsp[-3].minor.yy454 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy454,yymsp[0].minor.yy454);
178342 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-3].minor.yy454, TK_NOTNULL);
178343 }
 
178344 break;
178345 case 212: /* expr ::= expr IS NOT DISTINCT FROM expr */
 
178346 {
178347 yymsp[-5].minor.yy454 = sqlite3PExpr(pParse,TK_IS,yymsp[-5].minor.yy454,yymsp[0].minor.yy454);
178348 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-5].minor.yy454, TK_ISNULL);
178349 }
 
178350 break;
178351 case 213: /* expr ::= expr IS DISTINCT FROM expr */
 
178352 {
178353 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-4].minor.yy454,yymsp[0].minor.yy454);
178354 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-4].minor.yy454, TK_NOTNULL);
178355 }
 
178356 break;
178357 case 214: /* expr ::= NOT expr */
178358 case 215: /* expr ::= BITNOT expr */ yytestcase(yyruleno==215);
 
178359 {yymsp[-1].minor.yy454 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy454, 0);/*A-overwrites-B*/}
 
178360 break;
178361 case 216: /* expr ::= PLUS|MINUS expr */
 
178362 {
178363 Expr *p = yymsp[0].minor.yy454;
178364 u8 op = yymsp[-1].major + (TK_UPLUS-TK_PLUS);
178365 assert( TK_UPLUS>TK_PLUS );
178366 assert( TK_UMINUS == TK_MINUS + (TK_UPLUS - TK_PLUS) );
@@ -178370,24 +178867,30 @@
178370 }else{
178371 yymsp[-1].minor.yy454 = sqlite3PExpr(pParse, op, p, 0);
178372 /*A-overwrites-B*/
178373 }
178374 }
 
178375 break;
178376 case 217: /* expr ::= expr PTR expr */
 
178377 {
178378 ExprList *pList = sqlite3ExprListAppend(pParse, 0, yymsp[-2].minor.yy454);
178379 pList = sqlite3ExprListAppend(pParse, pList, yymsp[0].minor.yy454);
178380 yylhsminor.yy454 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
178381 }
 
178382 yymsp[-2].minor.yy454 = yylhsminor.yy454;
178383 break;
178384 case 218: /* between_op ::= BETWEEN */
178385 case 221: /* in_op ::= IN */ yytestcase(yyruleno==221);
 
178386 {yymsp[0].minor.yy144 = 0;}
 
178387 break;
178388 case 220: /* expr ::= expr between_op expr AND expr */
 
178389 {
178390 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy454);
178391 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy454);
178392 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy454, 0);
178393 if( yymsp[-4].minor.yy454 ){
@@ -178395,12 +178898,14 @@
178395 }else{
178396 sqlite3ExprListDelete(pParse->db, pList);
178397 }
178398 if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178399 }
 
178400 break;
178401 case 223: /* expr ::= expr in_op LP exprlist RP */
 
178402 {
178403 if( yymsp[-1].minor.yy14==0 ){
178404 /* Expressions of the form
178405 **
178406 ** expr1 IN ()
@@ -178441,42 +178946,52 @@
178441 }
178442 }
178443 if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178444 }
178445 }
 
178446 break;
178447 case 224: /* expr ::= LP select RP */
 
178448 {
178449 yymsp[-2].minor.yy454 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
178450 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy454, yymsp[-1].minor.yy555);
178451 }
 
178452 break;
178453 case 225: /* expr ::= expr in_op LP select RP */
 
178454 {
178455 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy454, 0);
178456 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy454, yymsp[-1].minor.yy555);
178457 if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178458 }
 
178459 break;
178460 case 226: /* expr ::= expr in_op nm dbnm paren_exprlist */
 
178461 {
178462 SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
178463 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
178464 if( yymsp[0].minor.yy14 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy14);
178465 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy454, 0);
178466 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy454, pSelect);
178467 if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178468 }
 
178469 break;
178470 case 227: /* expr ::= EXISTS LP select RP */
 
178471 {
178472 Expr *p;
178473 p = yymsp[-3].minor.yy454 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
178474 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy555);
178475 }
 
178476 break;
178477 case 228: /* expr ::= CASE case_operand case_exprlist case_else END */
 
178478 {
178479 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy454, 0);
178480 if( yymsp[-4].minor.yy454 ){
178481 yymsp[-4].minor.yy454->x.pList = yymsp[-1].minor.yy454 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[-1].minor.yy454) : yymsp[-2].minor.yy14;
178482 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy454);
@@ -178483,446 +178998,627 @@
178483 }else{
178484 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy14);
178485 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy454);
178486 }
178487 }
 
178488 break;
178489 case 229: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
 
178490 {
178491 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, yymsp[-2].minor.yy454);
178492 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, yymsp[0].minor.yy454);
178493 }
 
178494 break;
178495 case 230: /* case_exprlist ::= WHEN expr THEN expr */
 
178496 {
178497 yymsp[-3].minor.yy14 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy454);
178498 yymsp[-3].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy14, yymsp[0].minor.yy454);
178499 }
 
178500 break;
178501 case 235: /* nexprlist ::= nexprlist COMMA expr */
 
178502 {yymsp[-2].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[0].minor.yy454);}
 
178503 break;
178504 case 236: /* nexprlist ::= expr */
 
178505 {yymsp[0].minor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy454); /*A-overwrites-Y*/}
 
178506 break;
178507 case 238: /* paren_exprlist ::= LP exprlist RP */
178508 case 243: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==243);
 
178509 {yymsp[-2].minor.yy14 = yymsp[-1].minor.yy14;}
 
178510 break;
178511 case 239: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
 
178512 {
178513 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
178514 sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy14, yymsp[-10].minor.yy144,
178515 &yymsp[-11].minor.yy0, yymsp[0].minor.yy454, SQLITE_SO_ASC, yymsp[-8].minor.yy144, SQLITE_IDXTYPE_APPDEF);
178516 if( IN_RENAME_OBJECT && pParse->pNewIndex ){
178517 sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
178518 }
178519 }
 
178520 break;
178521 case 240: /* uniqueflag ::= UNIQUE */
178522 case 282: /* raisetype ::= ABORT */ yytestcase(yyruleno==282);
 
178523 {yymsp[0].minor.yy144 = OE_Abort;}
 
178524 break;
178525 case 241: /* uniqueflag ::= */
 
178526 {yymsp[1].minor.yy144 = OE_None;}
 
178527 break;
178528 case 244: /* eidlist ::= eidlist COMMA nm collate sortorder */
 
178529 {
178530 yymsp[-4].minor.yy14 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy14, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy144, yymsp[0].minor.yy144);
178531 }
 
178532 break;
178533 case 245: /* eidlist ::= nm collate sortorder */
 
178534 {
178535 yymsp[-2].minor.yy14 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy144, yymsp[0].minor.yy144); /*A-overwrites-Y*/
178536 }
 
178537 break;
178538 case 248: /* cmd ::= DROP INDEX ifexists fullname */
 
178539 {sqlite3DropIndex(pParse, yymsp[0].minor.yy203, yymsp[-1].minor.yy144);}
 
178540 break;
178541 case 249: /* cmd ::= VACUUM vinto */
 
178542 {sqlite3Vacuum(pParse,0,yymsp[0].minor.yy454);}
 
178543 break;
178544 case 250: /* cmd ::= VACUUM nm vinto */
 
178545 {sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy454);}
 
178546 break;
178547 case 253: /* cmd ::= PRAGMA nm dbnm */
 
178548 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
 
178549 break;
178550 case 254: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
 
178551 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
 
178552 break;
178553 case 255: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
 
178554 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
 
178555 break;
178556 case 256: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
 
178557 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
 
178558 break;
178559 case 257: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
 
178560 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
 
178561 break;
178562 case 260: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
 
178563 {
178564 Token all;
178565 all.z = yymsp[-3].minor.yy0.z;
178566 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
178567 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy427, &all);
178568 }
 
178569 break;
178570 case 261: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
 
178571 {
178572 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy144, yymsp[-4].minor.yy286.a, yymsp[-4].minor.yy286.b, yymsp[-2].minor.yy203, yymsp[0].minor.yy454, yymsp[-10].minor.yy144, yymsp[-8].minor.yy144);
178573 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
178574 }
 
178575 break;
178576 case 262: /* trigger_time ::= BEFORE|AFTER */
 
178577 { yymsp[0].minor.yy144 = yymsp[0].major; /*A-overwrites-X*/ }
 
178578 break;
178579 case 263: /* trigger_time ::= INSTEAD OF */
 
178580 { yymsp[-1].minor.yy144 = TK_INSTEAD;}
 
178581 break;
178582 case 264: /* trigger_time ::= */
 
178583 { yymsp[1].minor.yy144 = TK_BEFORE; }
 
178584 break;
178585 case 265: /* trigger_event ::= DELETE|INSERT */
178586 case 266: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==266);
 
178587 {yymsp[0].minor.yy286.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy286.b = 0;}
 
178588 break;
178589 case 267: /* trigger_event ::= UPDATE OF idlist */
 
178590 {yymsp[-2].minor.yy286.a = TK_UPDATE; yymsp[-2].minor.yy286.b = yymsp[0].minor.yy132;}
 
178591 break;
178592 case 268: /* when_clause ::= */
178593 case 287: /* key_opt ::= */ yytestcase(yyruleno==287);
 
178594 { yymsp[1].minor.yy454 = 0; }
 
178595 break;
178596 case 269: /* when_clause ::= WHEN expr */
178597 case 288: /* key_opt ::= KEY expr */ yytestcase(yyruleno==288);
 
178598 { yymsp[-1].minor.yy454 = yymsp[0].minor.yy454; }
 
178599 break;
178600 case 270: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
 
178601 {
178602 assert( yymsp[-2].minor.yy427!=0 );
178603 yymsp[-2].minor.yy427->pLast->pNext = yymsp[-1].minor.yy427;
178604 yymsp[-2].minor.yy427->pLast = yymsp[-1].minor.yy427;
178605 }
 
178606 break;
178607 case 271: /* trigger_cmd_list ::= trigger_cmd SEMI */
 
178608 {
178609 assert( yymsp[-1].minor.yy427!=0 );
178610 yymsp[-1].minor.yy427->pLast = yymsp[-1].minor.yy427;
178611 }
 
178612 break;
178613 case 272: /* trnm ::= nm DOT nm */
 
178614 {
178615 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
178616 sqlite3ErrorMsg(pParse,
178617 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
178618 "statements within triggers");
178619 }
 
178620 break;
178621 case 273: /* tridxby ::= INDEXED BY nm */
 
178622 {
178623 sqlite3ErrorMsg(pParse,
178624 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
178625 "within triggers");
178626 }
 
178627 break;
178628 case 274: /* tridxby ::= NOT INDEXED */
 
178629 {
178630 sqlite3ErrorMsg(pParse,
178631 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
178632 "within triggers");
178633 }
 
178634 break;
178635 case 275: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
 
178636 {yylhsminor.yy427 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy203, yymsp[-3].minor.yy14, yymsp[-1].minor.yy454, yymsp[-7].minor.yy144, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy168);}
 
178637 yymsp[-8].minor.yy427 = yylhsminor.yy427;
178638 break;
178639 case 276: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
 
178640 {
178641 yylhsminor.yy427 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy132,yymsp[-2].minor.yy555,yymsp[-6].minor.yy144,yymsp[-1].minor.yy122,yymsp[-7].minor.yy168,yymsp[0].minor.yy168);/*yylhsminor.yy427-overwrites-yymsp[-6].minor.yy144*/
178642 }
 
178643 yymsp[-7].minor.yy427 = yylhsminor.yy427;
178644 break;
178645 case 277: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
 
178646 {yylhsminor.yy427 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy454, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy168);}
 
178647 yymsp[-5].minor.yy427 = yylhsminor.yy427;
178648 break;
178649 case 278: /* trigger_cmd ::= scanpt select scanpt */
 
178650 {yylhsminor.yy427 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy555, yymsp[-2].minor.yy168, yymsp[0].minor.yy168); /*yylhsminor.yy427-overwrites-yymsp[-1].minor.yy555*/}
 
178651 yymsp[-2].minor.yy427 = yylhsminor.yy427;
178652 break;
178653 case 279: /* expr ::= RAISE LP IGNORE RP */
 
178654 {
178655 yymsp[-3].minor.yy454 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
178656 if( yymsp[-3].minor.yy454 ){
178657 yymsp[-3].minor.yy454->affExpr = OE_Ignore;
178658 }
178659 }
 
178660 break;
178661 case 280: /* expr ::= RAISE LP raisetype COMMA expr RP */
 
178662 {
178663 yymsp[-5].minor.yy454 = sqlite3PExpr(pParse, TK_RAISE, yymsp[-1].minor.yy454, 0);
178664 if( yymsp[-5].minor.yy454 ) {
178665 yymsp[-5].minor.yy454->affExpr = (char)yymsp[-3].minor.yy144;
178666 }
178667 }
 
178668 break;
178669 case 281: /* raisetype ::= ROLLBACK */
 
178670 {yymsp[0].minor.yy144 = OE_Rollback;}
 
178671 break;
178672 case 283: /* raisetype ::= FAIL */
 
178673 {yymsp[0].minor.yy144 = OE_Fail;}
 
178674 break;
178675 case 284: /* cmd ::= DROP TRIGGER ifexists fullname */
 
178676 {
178677 sqlite3DropTrigger(pParse,yymsp[0].minor.yy203,yymsp[-1].minor.yy144);
178678 }
 
178679 break;
178680 case 285: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
 
178681 {
178682 sqlite3Attach(pParse, yymsp[-3].minor.yy454, yymsp[-1].minor.yy454, yymsp[0].minor.yy454);
178683 }
 
178684 break;
178685 case 286: /* cmd ::= DETACH database_kw_opt expr */
 
178686 {
178687 sqlite3Detach(pParse, yymsp[0].minor.yy454);
178688 }
 
178689 break;
178690 case 289: /* cmd ::= REINDEX */
 
178691 {sqlite3Reindex(pParse, 0, 0);}
 
178692 break;
178693 case 290: /* cmd ::= REINDEX nm dbnm */
 
178694 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
 
178695 break;
178696 case 291: /* cmd ::= ANALYZE */
 
178697 {sqlite3Analyze(pParse, 0, 0);}
 
178698 break;
178699 case 292: /* cmd ::= ANALYZE nm dbnm */
 
178700 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
 
178701 break;
178702 case 293: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
 
178703 {
178704 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy203,&yymsp[0].minor.yy0);
178705 }
 
178706 break;
178707 case 294: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
 
178708 {
178709 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
178710 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
178711 }
 
178712 break;
178713 case 295: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
 
178714 {
178715 sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy203, &yymsp[0].minor.yy0);
178716 }
 
178717 break;
178718 case 296: /* add_column_fullname ::= fullname */
 
178719 {
178720 disableLookaside(pParse);
178721 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy203);
178722 }
 
178723 break;
178724 case 297: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
 
178725 {
178726 sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy203, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
178727 }
 
178728 break;
178729 case 298: /* cmd ::= create_vtab */
 
178730 {sqlite3VtabFinishParse(pParse,0);}
 
178731 break;
178732 case 299: /* cmd ::= create_vtab LP vtabarglist RP */
 
178733 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
 
178734 break;
178735 case 300: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
 
178736 {
178737 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy144);
178738 }
 
178739 break;
178740 case 301: /* vtabarg ::= */
 
178741 {sqlite3VtabArgInit(pParse);}
 
178742 break;
178743 case 302: /* vtabargtoken ::= ANY */
178744 case 303: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==303);
178745 case 304: /* lp ::= LP */ yytestcase(yyruleno==304);
 
178746 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
 
178747 break;
178748 case 305: /* with ::= WITH wqlist */
178749 case 306: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==306);
 
178750 { sqlite3WithPush(pParse, yymsp[0].minor.yy59, 1); }
 
178751 break;
178752 case 307: /* wqas ::= AS */
 
178753 {yymsp[0].minor.yy462 = M10d_Any;}
 
178754 break;
178755 case 308: /* wqas ::= AS MATERIALIZED */
 
178756 {yymsp[-1].minor.yy462 = M10d_Yes;}
 
178757 break;
178758 case 309: /* wqas ::= AS NOT MATERIALIZED */
 
178759 {yymsp[-2].minor.yy462 = M10d_No;}
 
178760 break;
178761 case 310: /* wqitem ::= withnm eidlist_opt wqas LP select RP */
 
178762 {
178763 yymsp[-5].minor.yy67 = sqlite3CteNew(pParse, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy14, yymsp[-1].minor.yy555, yymsp[-3].minor.yy462); /*A-overwrites-X*/
178764 }
 
178765 break;
178766 case 311: /* withnm ::= nm */
 
178767 {pParse->bHasWith = 1;}
 
178768 break;
178769 case 312: /* wqlist ::= wqitem */
 
178770 {
178771 yymsp[0].minor.yy59 = sqlite3WithAdd(pParse, 0, yymsp[0].minor.yy67); /*A-overwrites-X*/
178772 }
 
178773 break;
178774 case 313: /* wqlist ::= wqlist COMMA wqitem */
 
178775 {
178776 yymsp[-2].minor.yy59 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy59, yymsp[0].minor.yy67);
178777 }
 
178778 break;
178779 case 314: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
 
178780 {
178781 assert( yymsp[0].minor.yy211!=0 );
178782 sqlite3WindowChain(pParse, yymsp[0].minor.yy211, yymsp[-2].minor.yy211);
178783 yymsp[0].minor.yy211->pNextWin = yymsp[-2].minor.yy211;
178784 yylhsminor.yy211 = yymsp[0].minor.yy211;
178785 }
 
178786 yymsp[-2].minor.yy211 = yylhsminor.yy211;
178787 break;
178788 case 315: /* windowdefn ::= nm AS LP window RP */
 
178789 {
178790 if( ALWAYS(yymsp[-1].minor.yy211) ){
178791 yymsp[-1].minor.yy211->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
178792 }
178793 yylhsminor.yy211 = yymsp[-1].minor.yy211;
178794 }
 
178795 yymsp[-4].minor.yy211 = yylhsminor.yy211;
178796 break;
178797 case 316: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
 
178798 {
178799 yymsp[-4].minor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, yymsp[-2].minor.yy14, yymsp[-1].minor.yy14, 0);
178800 }
 
178801 break;
178802 case 317: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
 
178803 {
178804 yylhsminor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, yymsp[-2].minor.yy14, yymsp[-1].minor.yy14, &yymsp[-5].minor.yy0);
178805 }
 
178806 yymsp[-5].minor.yy211 = yylhsminor.yy211;
178807 break;
178808 case 318: /* window ::= ORDER BY sortlist frame_opt */
 
178809 {
178810 yymsp[-3].minor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, 0, yymsp[-1].minor.yy14, 0);
178811 }
 
178812 break;
178813 case 319: /* window ::= nm ORDER BY sortlist frame_opt */
 
178814 {
178815 yylhsminor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, 0, yymsp[-1].minor.yy14, &yymsp[-4].minor.yy0);
178816 }
 
178817 yymsp[-4].minor.yy211 = yylhsminor.yy211;
178818 break;
178819 case 320: /* window ::= nm frame_opt */
 
178820 {
178821 yylhsminor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, 0, 0, &yymsp[-1].minor.yy0);
178822 }
 
178823 yymsp[-1].minor.yy211 = yylhsminor.yy211;
178824 break;
178825 case 321: /* frame_opt ::= */
 
178826 {
178827 yymsp[1].minor.yy211 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
178828 }
 
178829 break;
178830 case 322: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
 
178831 {
178832 yylhsminor.yy211 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy144, yymsp[-1].minor.yy509.eType, yymsp[-1].minor.yy509.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy462);
178833 }
 
178834 yymsp[-2].minor.yy211 = yylhsminor.yy211;
178835 break;
178836 case 323: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
 
178837 {
178838 yylhsminor.yy211 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy144, yymsp[-3].minor.yy509.eType, yymsp[-3].minor.yy509.pExpr, yymsp[-1].minor.yy509.eType, yymsp[-1].minor.yy509.pExpr, yymsp[0].minor.yy462);
178839 }
 
178840 yymsp[-5].minor.yy211 = yylhsminor.yy211;
178841 break;
178842 case 325: /* frame_bound_s ::= frame_bound */
178843 case 327: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==327);
 
178844 {yylhsminor.yy509 = yymsp[0].minor.yy509;}
 
178845 yymsp[0].minor.yy509 = yylhsminor.yy509;
178846 break;
178847 case 326: /* frame_bound_s ::= UNBOUNDED PRECEDING */
178848 case 328: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==328);
178849 case 330: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==330);
 
178850 {yylhsminor.yy509.eType = yymsp[-1].major; yylhsminor.yy509.pExpr = 0;}
 
178851 yymsp[-1].minor.yy509 = yylhsminor.yy509;
178852 break;
178853 case 329: /* frame_bound ::= expr PRECEDING|FOLLOWING */
 
178854 {yylhsminor.yy509.eType = yymsp[0].major; yylhsminor.yy509.pExpr = yymsp[-1].minor.yy454;}
 
178855 yymsp[-1].minor.yy509 = yylhsminor.yy509;
178856 break;
178857 case 331: /* frame_exclude_opt ::= */
 
178858 {yymsp[1].minor.yy462 = 0;}
 
178859 break;
178860 case 332: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
 
178861 {yymsp[-1].minor.yy462 = yymsp[0].minor.yy462;}
 
178862 break;
178863 case 333: /* frame_exclude ::= NO OTHERS */
178864 case 334: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==334);
 
178865 {yymsp[-1].minor.yy462 = yymsp[-1].major; /*A-overwrites-X*/}
 
178866 break;
178867 case 335: /* frame_exclude ::= GROUP|TIES */
 
178868 {yymsp[0].minor.yy462 = yymsp[0].major; /*A-overwrites-X*/}
 
178869 break;
178870 case 336: /* window_clause ::= WINDOW windowdefn_list */
 
178871 { yymsp[-1].minor.yy211 = yymsp[0].minor.yy211; }
 
178872 break;
178873 case 337: /* filter_over ::= filter_clause over_clause */
 
178874 {
178875 if( yymsp[0].minor.yy211 ){
178876 yymsp[0].minor.yy211->pFilter = yymsp[-1].minor.yy454;
178877 }else{
178878 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy454);
178879 }
178880 yylhsminor.yy211 = yymsp[0].minor.yy211;
178881 }
 
178882 yymsp[-1].minor.yy211 = yylhsminor.yy211;
178883 break;
178884 case 338: /* filter_over ::= over_clause */
 
178885 {
178886 yylhsminor.yy211 = yymsp[0].minor.yy211;
178887 }
 
178888 yymsp[0].minor.yy211 = yylhsminor.yy211;
178889 break;
178890 case 339: /* filter_over ::= filter_clause */
 
178891 {
178892 yylhsminor.yy211 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
178893 if( yylhsminor.yy211 ){
178894 yylhsminor.yy211->eFrmType = TK_FILTER;
178895 yylhsminor.yy211->pFilter = yymsp[0].minor.yy454;
178896 }else{
178897 sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy454);
178898 }
178899 }
 
178900 yymsp[0].minor.yy211 = yylhsminor.yy211;
178901 break;
178902 case 340: /* over_clause ::= OVER LP window RP */
 
178903 {
178904 yymsp[-3].minor.yy211 = yymsp[-1].minor.yy211;
178905 assert( yymsp[-3].minor.yy211!=0 );
178906 }
 
178907 break;
178908 case 341: /* over_clause ::= OVER nm */
 
178909 {
178910 yymsp[-1].minor.yy211 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
178911 if( yymsp[-1].minor.yy211 ){
178912 yymsp[-1].minor.yy211->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
178913 }
178914 }
 
178915 break;
178916 case 342: /* filter_clause ::= FILTER LP WHERE expr RP */
 
178917 { yymsp[-4].minor.yy454 = yymsp[-1].minor.yy454; }
 
178918 break;
178919 case 343: /* term ::= QNUMBER */
 
178920 {
178921 yylhsminor.yy454=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0);
178922 sqlite3DequoteNumber(pParse, yylhsminor.yy454);
178923 }
 
178924 yymsp[0].minor.yy454 = yylhsminor.yy454;
178925 break;
178926 default:
178927 /* (344) input ::= cmdlist */ yytestcase(yyruleno==344);
178928 /* (345) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==345);
@@ -179046,17 +179742,19 @@
179046 ){
179047 sqlite3ParserARG_FETCH
179048 sqlite3ParserCTX_FETCH
179049 #define TOKEN yyminor
179050 /************ Begin %syntax_error code ****************************************/
 
179051
179052 UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
179053 if( TOKEN.z[0] ){
179054 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
179055 }else{
179056 sqlite3ErrorMsg(pParse, "incomplete input");
179057 }
 
179058 /************ End %syntax_error code ******************************************/
179059 sqlite3ParserARG_STORE /* Suppress warning about unused %extra_argument variable */
179060 sqlite3ParserCTX_STORE
179061 }
179062
@@ -179324,10 +180022,11 @@
179324 #endif
179325 }
179326
179327 /************** End of parse.c ***********************************************/
179328 /************** Begin file tokenize.c ****************************************/
 
179329 /*
179330 ** 2001 September 15
179331 **
179332 ** The author disclaims copyright to this source code. In place of
179333 ** a legal notice, here is a blessing:
@@ -179473,10 +180172,11 @@
179473 ** named keywordhash.h and then included into this source file by
179474 ** the #include below.
179475 */
179476 /************** Include keywordhash.h in the middle of tokenize.c ************/
179477 /************** Begin file keywordhash.h *************************************/
 
179478 /***** This file contains automatically generated code ******
179479 **
179480 ** The code in this file has been automatically generated by
179481 **
179482 ** sqlite/tool/mkkeywordhash.c
@@ -179958,10 +180658,11 @@
179958 return TK_ID!=sqlite3KeywordCode((const u8*)zName, nName);
179959 }
179960
179961 /************** End of keywordhash.h *****************************************/
179962 /************** Continuing where we left off in tokenize.c *******************/
 
179963
179964
179965 /*
179966 ** If X is a character that can be used in an identifier then
179967 ** IdChar(X) will be true. Otherwise it is false.
@@ -180701,10 +181402,11 @@
180701 }
180702 #endif /* SQLITE_ENABLE_NORMALIZE */
180703
180704 /************** End of tokenize.c ********************************************/
180705 /************** Begin file complete.c ****************************************/
 
180706 /*
180707 ** 2001 September 15
180708 **
180709 ** The author disclaims copyright to this source code. In place of
180710 ** a legal notice, here is a blessing:
@@ -180994,10 +181696,11 @@
180994 #endif /* SQLITE_OMIT_UTF16 */
180995 #endif /* SQLITE_OMIT_COMPLETE */
180996
180997 /************** End of complete.c ********************************************/
180998 /************** Begin file main.c ********************************************/
 
180999 /*
181000 ** 2001 September 15
181001 **
181002 ** The author disclaims copyright to this source code. In place of
181003 ** a legal notice, here is a blessing:
@@ -181015,10 +181718,11 @@
181015 /* #include "sqliteInt.h" */
181016
181017 #ifdef SQLITE_ENABLE_FTS3
181018 /************** Include fts3.h in the middle of main.c ***********************/
181019 /************** Begin file fts3.h ********************************************/
 
181020 /*
181021 ** 2006 Oct 10
181022 **
181023 ** The author disclaims copyright to this source code. In place of
181024 ** a legal notice, here is a blessing:
@@ -181044,14 +181748,16 @@
181044 } /* extern "C" */
181045 #endif /* __cplusplus */
181046
181047 /************** End of fts3.h ************************************************/
181048 /************** Continuing where we left off in main.c ***********************/
 
181049 #endif
181050 #ifdef SQLITE_ENABLE_RTREE
181051 /************** Include rtree.h in the middle of main.c **********************/
181052 /************** Begin file rtree.h *******************************************/
 
181053 /*
181054 ** 2008 May 26
181055 **
181056 ** The author disclaims copyright to this source code. In place of
181057 ** a legal notice, here is a blessing:
@@ -181081,14 +181787,16 @@
181081 } /* extern "C" */
181082 #endif /* __cplusplus */
181083
181084 /************** End of rtree.h ***********************************************/
181085 /************** Continuing where we left off in main.c ***********************/
 
181086 #endif
181087 #if defined(SQLITE_ENABLE_ICU) || defined(SQLITE_ENABLE_ICU_COLLATIONS)
181088 /************** Include sqliteicu.h in the middle of main.c ******************/
181089 /************** Begin file sqliteicu.h ***************************************/
 
181090 /*
181091 ** 2008 May 26
181092 **
181093 ** The author disclaims copyright to this source code. In place of
181094 ** a legal notice, here is a blessing:
@@ -181114,10 +181822,11 @@
181114 } /* extern "C" */
181115 #endif /* __cplusplus */
181116
181117 /************** End of sqliteicu.h *******************************************/
181118 /************** Continuing where we left off in main.c ***********************/
 
181119 #endif
181120
181121 /*
181122 ** This is an extension initializer that is a no-op and always
181123 ** succeeds, except that it fails if the fault-simulation is set
@@ -182513,14 +183222,10 @@
182513 #endif
182514
182515 sqlite3Error(db, SQLITE_OK); /* Deallocates any cached error strings. */
182516 sqlite3ValueFree(db->pErr);
182517 sqlite3CloseExtensions(db);
182518 #if SQLITE_USER_AUTHENTICATION
182519 sqlite3_free(db->auth.zAuthUser);
182520 sqlite3_free(db->auth.zAuthPW);
182521 #endif
182522
182523 db->eOpenState = SQLITE_STATE_ERROR;
182524
182525 /* The temp-database schema is allocated differently from the other schema
182526 ** objects (using sqliteMalloc() directly, instead of sqlite3BtreeSchema()).
@@ -186168,10 +186873,11 @@
186168 }
186169 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
186170
186171 /************** End of main.c ************************************************/
186172 /************** Begin file notify.c ******************************************/
 
186173 /*
186174 ** 2009 March 3
186175 **
186176 ** The author disclaims copyright to this source code. In place of
186177 ** a legal notice, here is a blessing:
@@ -186506,10 +187212,11 @@
186506 }
186507 #endif
186508
186509 /************** End of notify.c **********************************************/
186510 /************** Begin file fts3.c ********************************************/
 
186511 /*
186512 ** 2006 Oct 10
186513 **
186514 ** The author disclaims copyright to this source code. In place of
186515 ** a legal notice, here is a blessing:
@@ -186798,10 +187505,11 @@
186798 ** older data.
186799 */
186800
186801 /************** Include fts3Int.h in the middle of fts3.c ********************/
186802 /************** Begin file fts3Int.h *****************************************/
 
186803 /*
186804 ** 2009 Nov 12
186805 **
186806 ** The author disclaims copyright to this source code. In place of
186807 ** a legal notice, here is a blessing:
@@ -186844,10 +187552,11 @@
186844 #endif
186845
186846 /* #include "sqlite3.h" */
186847 /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
186848 /************** Begin file fts3_tokenizer.h **********************************/
 
186849 /*
186850 ** 2006 July 10
186851 **
186852 ** The author disclaims copyright to this source code.
186853 **
@@ -187008,12 +187717,14 @@
187008
187009 #endif /* _FTS3_TOKENIZER_H_ */
187010
187011 /************** End of fts3_tokenizer.h **************************************/
187012 /************** Continuing where we left off in fts3Int.h ********************/
 
187013 /************** Include fts3_hash.h in the middle of fts3Int.h ***************/
187014 /************** Begin file fts3_hash.h ***************************************/
 
187015 /*
187016 ** 2001 September 22
187017 **
187018 ** The author disclaims copyright to this source code. In place of
187019 ** a legal notice, here is a blessing:
@@ -187125,10 +187836,11 @@
187125
187126 #endif /* _FTS3_HASH_H_ */
187127
187128 /************** End of fts3_hash.h *******************************************/
187129 /************** Continuing where we left off in fts3Int.h ********************/
 
187130
187131 /*
187132 ** This constant determines the maximum depth of an FTS expression tree
187133 ** that the library will create and use. FTS uses recursion to perform
187134 ** various operations on the query tree, so the disadvantage of a large
@@ -187741,10 +188453,11 @@
187741 #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
187742 #endif /* _FTSINT_H */
187743
187744 /************** End of fts3Int.h *********************************************/
187745 /************** Continuing where we left off in fts3.c ***********************/
 
187746 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
187747
187748 #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
187749 # define SQLITE_CORE 1
187750 #endif
@@ -193621,11 +194334,11 @@
193621 SQLITE_PRIVATE int sqlite3Fts3Corrupt(){
193622 return SQLITE_CORRUPT_VTAB;
193623 }
193624 #endif
193625
193626 #if !SQLITE_CORE
193627 /*
193628 ** Initialize API pointer table, if required.
193629 */
193630 #ifdef _WIN32
193631 __declspec(dllexport)
@@ -193642,10 +194355,11 @@
193642
193643 #endif
193644
193645 /************** End of fts3.c ************************************************/
193646 /************** Begin file fts3_aux.c ****************************************/
 
193647 /*
193648 ** 2011 Jan 27
193649 **
193650 ** The author disclaims copyright to this source code. In place of
193651 ** a legal notice, here is a blessing:
@@ -194202,10 +194916,11 @@
194202
194203 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
194204
194205 /************** End of fts3_aux.c ********************************************/
194206 /************** Begin file fts3_expr.c ***************************************/
 
194207 /*
194208 ** 2008 Nov 28
194209 **
194210 ** The author disclaims copyright to this source code. In place of
194211 ** a legal notice, here is a blessing:
@@ -195498,10 +196213,11 @@
195498 #endif
195499 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
195500
195501 /************** End of fts3_expr.c *******************************************/
195502 /************** Begin file fts3_hash.c ***************************************/
 
195503 /*
195504 ** 2001 September 22
195505 **
195506 ** The author disclaims copyright to this source code. In place of
195507 ** a legal notice, here is a blessing:
@@ -195884,10 +196600,11 @@
195884
195885 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
195886
195887 /************** End of fts3_hash.c *******************************************/
195888 /************** Begin file fts3_porter.c *************************************/
 
195889 /*
195890 ** 2006 September 30
195891 **
195892 ** The author disclaims copyright to this source code. In place of
195893 ** a legal notice, here is a blessing:
@@ -196549,10 +197266,11 @@
196549
196550 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
196551
196552 /************** End of fts3_porter.c *****************************************/
196553 /************** Begin file fts3_tokenizer.c **********************************/
 
196554 /*
196555 ** 2007 June 22
196556 **
196557 ** The author disclaims copyright to this source code. In place of
196558 ** a legal notice, here is a blessing:
@@ -197068,10 +197786,11 @@
197068
197069 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
197070
197071 /************** End of fts3_tokenizer.c **************************************/
197072 /************** Begin file fts3_tokenizer1.c *********************************/
 
197073 /*
197074 ** 2006 Oct 10
197075 **
197076 ** The author disclaims copyright to this source code. In place of
197077 ** a legal notice, here is a blessing:
@@ -197305,10 +198024,11 @@
197305
197306 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
197307
197308 /************** End of fts3_tokenizer1.c *************************************/
197309 /************** Begin file fts3_tokenize_vtab.c ******************************/
 
197310 /*
197311 ** 2013 Apr 22
197312 **
197313 ** The author disclaims copyright to this source code. In place of
197314 ** a legal notice, here is a blessing:
@@ -197767,10 +198487,11 @@
197767
197768 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
197769
197770 /************** End of fts3_tokenize_vtab.c **********************************/
197771 /************** Begin file fts3_write.c **************************************/
 
197772 /*
197773 ** 2009 Oct 23
197774 **
197775 ** The author disclaims copyright to this source code. In place of
197776 ** a legal notice, here is a blessing:
@@ -203604,10 +204325,11 @@
203604
203605 #endif
203606
203607 /************** End of fts3_write.c ******************************************/
203608 /************** Begin file fts3_snippet.c ************************************/
 
203609 /*
203610 ** 2009 Oct 23
203611 **
203612 ** The author disclaims copyright to this source code. In place of
203613 ** a legal notice, here is a blessing:
@@ -205363,10 +206085,11 @@
205363
205364 #endif
205365
205366 /************** End of fts3_snippet.c ****************************************/
205367 /************** Begin file fts3_unicode.c ************************************/
 
205368 /*
205369 ** 2012 May 24
205370 **
205371 ** The author disclaims copyright to this source code. In place of
205372 ** a legal notice, here is a blessing:
@@ -205763,10 +206486,11 @@
205763 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
205764 #endif /* ifndef SQLITE_DISABLE_FTS3_UNICODE */
205765
205766 /************** End of fts3_unicode.c ****************************************/
205767 /************** Begin file fts3_unicode2.c ***********************************/
 
205768 /*
205769 ** 2012-05-25
205770 **
205771 ** The author disclaims copyright to this source code. In place of
205772 ** a legal notice, here is a blessing:
@@ -206149,10 +206873,11 @@
206149 #endif /* defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4) */
206150 #endif /* !defined(SQLITE_DISABLE_FTS3_UNICODE) */
206151
206152 /************** End of fts3_unicode2.c ***************************************/
206153 /************** Begin file json.c ********************************************/
 
206154 /*
206155 ** 2015-08-12
206156 **
206157 ** The author disclaims copyright to this source code. In place of
206158 ** a legal notice, here is a blessing:
@@ -211618,10 +212343,11 @@
211618 }
211619 #endif /* !defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_OMIT_JSON) */
211620
211621 /************** End of json.c ************************************************/
211622 /************** Begin file rtree.c *******************************************/
 
211623 /*
211624 ** 2001 September 15
211625 **
211626 ** The author disclaims copyright to this source code. In place of
211627 ** a legal notice, here is a blessing:
@@ -215906,10 +216632,11 @@
215906
215907 /* Conditionally include the geopoly code */
215908 #ifdef SQLITE_ENABLE_GEOPOLY
215909 /************** Include geopoly.c in the middle of rtree.c *******************/
215910 /************** Begin file geopoly.c *****************************************/
 
215911 /*
215912 ** 2018-05-25
215913 **
215914 ** The author disclaims copyright to this source code. In place of
215915 ** a legal notice, here is a blessing:
@@ -217748,10 +218475,11 @@
217748 return rc;
217749 }
217750
217751 /************** End of geopoly.c *********************************************/
217752 /************** Continuing where we left off in rtree.c **********************/
 
217753 #endif
217754
217755 /*
217756 ** Register the r-tree module with database handle db. This creates the
217757 ** virtual table module "rtree" and the debugging/analysis scalar
@@ -217912,11 +218640,11 @@
217912 return sqlite3_create_function_v2(db, zQueryFunc, -1, SQLITE_ANY,
217913 (void *)pGeomCtx, geomCallback, 0, 0, rtreeFreeCallback
217914 );
217915 }
217916
217917 #if !SQLITE_CORE
217918 #ifdef _WIN32
217919 __declspec(dllexport)
217920 #endif
217921 SQLITE_API int sqlite3_rtree_init(
217922 sqlite3 *db,
@@ -217930,10 +218658,11 @@
217930
217931 #endif
217932
217933 /************** End of rtree.c ***********************************************/
217934 /************** Begin file icu.c *********************************************/
 
217935 /*
217936 ** 2007 May 6
217937 **
217938 ** The author disclaims copyright to this source code. In place of
217939 ** a legal notice, here is a blessing:
@@ -218503,11 +219232,11 @@
218503 }
218504
218505 return rc;
218506 }
218507
218508 #if !SQLITE_CORE
218509 #ifdef _WIN32
218510 __declspec(dllexport)
218511 #endif
218512 SQLITE_API int sqlite3_icu_init(
218513 sqlite3 *db,
@@ -218521,10 +219250,11 @@
218521
218522 #endif
218523
218524 /************** End of icu.c *************************************************/
218525 /************** Begin file fts3_icu.c ****************************************/
 
218526 /*
218527 ** 2007 June 22
218528 **
218529 ** The author disclaims copyright to this source code. In place of
218530 ** a legal notice, here is a blessing:
@@ -218786,10 +219516,11 @@
218786 #endif /* defined(SQLITE_ENABLE_ICU) */
218787 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
218788
218789 /************** End of fts3_icu.c ********************************************/
218790 /************** Begin file sqlite3rbu.c **************************************/
 
218791 /*
218792 ** 2014 August 30
218793 **
218794 ** The author disclaims copyright to this source code. In place of
218795 ** a legal notice, here is a blessing:
@@ -218877,10 +219608,11 @@
218877 /* #include "sqlite3.h" */
218878
218879 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU)
218880 /************** Include sqlite3rbu.h in the middle of sqlite3rbu.c ***********/
218881 /************** Begin file sqlite3rbu.h **************************************/
 
218882 /*
218883 ** 2014 August 30
218884 **
218885 ** The author disclaims copyright to this source code. In place of
218886 ** a legal notice, here is a blessing:
@@ -219513,10 +220245,11 @@
219513
219514 #endif /* _SQLITE3RBU_H */
219515
219516 /************** End of sqlite3rbu.h ******************************************/
219517 /************** Continuing where we left off in sqlite3rbu.c *****************/
 
219518
219519 #if defined(_WIN32_WCE)
219520 /* #include "windows.h" */
219521 #endif
219522
@@ -224873,10 +225606,11 @@
224873
224874 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) */
224875
224876 /************** End of sqlite3rbu.c ******************************************/
224877 /************** Begin file dbstat.c ******************************************/
 
224878 /*
224879 ** 2010 July 12
224880 **
224881 ** The author disclaims copyright to this source code. In place of
224882 ** a legal notice, here is a blessing:
@@ -225782,10 +226516,11 @@
225782 SQLITE_PRIVATE int sqlite3DbstatRegister(sqlite3 *db){ return SQLITE_OK; }
225783 #endif /* SQLITE_ENABLE_DBSTAT_VTAB */
225784
225785 /************** End of dbstat.c **********************************************/
225786 /************** Begin file dbpage.c ******************************************/
 
225787 /*
225788 ** 2017-10-11
225789 **
225790 ** The author disclaims copyright to this source code. In place of
225791 ** a legal notice, here is a blessing:
@@ -226264,10 +226999,11 @@
226264 SQLITE_PRIVATE int sqlite3DbpageRegister(sqlite3 *db){ return SQLITE_OK; }
226265 #endif /* SQLITE_ENABLE_DBSTAT_VTAB */
226266
226267 /************** End of dbpage.c **********************************************/
226268 /************** Begin file sqlite3session.c **********************************/
 
226269
226270 #if defined(SQLITE_ENABLE_SESSION) && defined(SQLITE_ENABLE_PREUPDATE_HOOK)
226271 /* #include "sqlite3session.h" */
226272 /* #include <assert.h> */
226273 /* #include <string.h> */
@@ -232803,21 +233539,49 @@
232803
232804 #endif /* SQLITE_ENABLE_SESSION && SQLITE_ENABLE_PREUPDATE_HOOK */
232805
232806 /************** End of sqlite3session.c **************************************/
232807 /************** Begin file fts5.c ********************************************/
 
232808
232809
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232810 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5)
232811
232812 #if !defined(NDEBUG) && !defined(SQLITE_DEBUG)
232813 # define NDEBUG 1
232814 #endif
232815 #if defined(NDEBUG) && defined(SQLITE_DEBUG)
232816 # undef NDEBUG
232817 #endif
232818
 
 
 
 
 
 
 
232819 /*
232820 ** 2014 May 31
232821 **
232822 ** The author disclaims copyright to this source code. In place of
232823 ** a legal notice, here is a blessing:
@@ -233554,10 +234318,11 @@
233554 } /* end of the 'extern "C"' block */
233555 #endif
233556
233557 #endif /* _FTS5_H */
233558
 
233559 /*
233560 ** 2014 May 31
233561 **
233562 ** The author disclaims copyright to this source code. In place of
233563 ** a legal notice, here is a blessing:
@@ -234493,10 +235258,11 @@
234493 ** End of interface to code in fts5_unicode2.c.
234494 **************************************************************************/
234495
234496 #endif
234497
 
234498 #define FTS5_OR 1
234499 #define FTS5_AND 2
234500 #define FTS5_NOT 3
234501 #define FTS5_TERM 4
234502 #define FTS5_COLON 5
@@ -234509,10 +235275,11 @@
234509 #define FTS5_CARET 12
234510 #define FTS5_COMMA 13
234511 #define FTS5_PLUS 14
234512 #define FTS5_STAR 15
234513
 
234514 /* This file is automatically generated by Lemon from input grammar
234515 ** source file "fts5parse.y".
234516 */
234517 /*
234518 ** 2000-05-29
@@ -234537,10 +235304,11 @@
234537 **
234538 ** The following is the concatenation of all %include directives from the
234539 ** input grammar file:
234540 */
234541 /************ Begin %include sections from the grammar ************************/
 
234542
234543 /* #include "fts5Int.h" */
234544 /* #include "fts5parse.h" */
234545
234546 /*
@@ -234564,10 +235332,11 @@
234564 ** Alternative datatype for the argument to the malloc() routine passed
234565 ** into sqlite3ParserAlloc(). The default is size_t.
234566 */
234567 #define fts5YYMALLOCARGTYPE u64
234568
 
234569 /**************** End of %include directives **********************************/
234570 /* These constants specify the various numeric values for terminal symbols.
234571 ***************** Begin token definitions *************************************/
234572 #ifndef FTS5_OR
234573 #define FTS5_OR 1
@@ -235110,35 +235879,45 @@
235110 ** inside the C code.
235111 */
235112 /********* Begin destructor definitions ***************************************/
235113 case 16: /* input */
235114 {
 
235115 (void)pParse;
 
235116 }
235117 break;
235118 case 17: /* expr */
235119 case 18: /* cnearset */
235120 case 19: /* exprlist */
235121 {
 
235122 sqlite3Fts5ParseNodeFree((fts5yypminor->fts5yy24));
 
235123 }
235124 break;
235125 case 20: /* colset */
235126 case 21: /* colsetlist */
235127 {
 
235128 sqlite3_free((fts5yypminor->fts5yy11));
 
235129 }
235130 break;
235131 case 22: /* nearset */
235132 case 23: /* nearphrases */
235133 {
 
235134 sqlite3Fts5ParseNearsetFree((fts5yypminor->fts5yy46));
 
235135 }
235136 break;
235137 case 24: /* phrase */
235138 {
 
235139 sqlite3Fts5ParsePhraseFree((fts5yypminor->fts5yy53));
 
235140 }
235141 break;
235142 /********* End destructor definitions *****************************************/
235143 default: break; /* If no destructor action specified: do nothing */
235144 }
@@ -235369,12 +236148,14 @@
235369 #endif
235370 while( fts5yypParser->fts5yytos>fts5yypParser->fts5yystack ) fts5yy_pop_parser_stack(fts5yypParser);
235371 /* Here code is inserted which will execute if the parser
235372 ** stack every overflows */
235373 /******** Begin %stack_overflow code ******************************************/
 
235374
235375 sqlite3Fts5ParseError(pParse, "fts5: parser stack overflow");
 
235376 /******** End %stack_overflow code ********************************************/
235377 sqlite3Fts5ParserARG_STORE /* Suppress warning about unused %extra_argument var */
235378 sqlite3Fts5ParserCTX_STORE
235379 }
235380
@@ -235539,148 +236320,202 @@
235539 ** break;
235540 */
235541 /********** Begin reduce actions **********************************************/
235542 fts5YYMINORTYPE fts5yylhsminor;
235543 case 0: /* input ::= expr */
 
235544 { sqlite3Fts5ParseFinished(pParse, fts5yymsp[0].minor.fts5yy24); }
 
235545 break;
235546 case 1: /* colset ::= MINUS LCP colsetlist RCP */
 
235547 {
235548 fts5yymsp[-3].minor.fts5yy11 = sqlite3Fts5ParseColsetInvert(pParse, fts5yymsp[-1].minor.fts5yy11);
235549 }
 
235550 break;
235551 case 2: /* colset ::= LCP colsetlist RCP */
 
235552 { fts5yymsp[-2].minor.fts5yy11 = fts5yymsp[-1].minor.fts5yy11; }
 
235553 break;
235554 case 3: /* colset ::= STRING */
 
235555 {
235556 fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
235557 }
 
235558 fts5yymsp[0].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
235559 break;
235560 case 4: /* colset ::= MINUS STRING */
 
235561 {
235562 fts5yymsp[-1].minor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
235563 fts5yymsp[-1].minor.fts5yy11 = sqlite3Fts5ParseColsetInvert(pParse, fts5yymsp[-1].minor.fts5yy11);
235564 }
 
235565 break;
235566 case 5: /* colsetlist ::= colsetlist STRING */
 
235567 {
235568 fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, fts5yymsp[-1].minor.fts5yy11, &fts5yymsp[0].minor.fts5yy0); }
 
235569 fts5yymsp[-1].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
235570 break;
235571 case 6: /* colsetlist ::= STRING */
 
235572 {
235573 fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
235574 }
 
235575 fts5yymsp[0].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
235576 break;
235577 case 7: /* expr ::= expr AND expr */
 
235578 {
235579 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_AND, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0);
235580 }
 
235581 fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235582 break;
235583 case 8: /* expr ::= expr OR expr */
 
235584 {
235585 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_OR, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0);
235586 }
 
235587 fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235588 break;
235589 case 9: /* expr ::= expr NOT expr */
 
235590 {
235591 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_NOT, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0);
235592 }
 
235593 fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235594 break;
235595 case 10: /* expr ::= colset COLON LP expr RP */
 
235596 {
235597 sqlite3Fts5ParseSetColset(pParse, fts5yymsp[-1].minor.fts5yy24, fts5yymsp[-4].minor.fts5yy11);
235598 fts5yylhsminor.fts5yy24 = fts5yymsp[-1].minor.fts5yy24;
235599 }
 
235600 fts5yymsp[-4].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235601 break;
235602 case 11: /* expr ::= LP expr RP */
 
235603 {fts5yymsp[-2].minor.fts5yy24 = fts5yymsp[-1].minor.fts5yy24;}
 
235604 break;
235605 case 12: /* expr ::= exprlist */
235606 case 13: /* exprlist ::= cnearset */ fts5yytestcase(fts5yyruleno==13);
 
235607 {fts5yylhsminor.fts5yy24 = fts5yymsp[0].minor.fts5yy24;}
 
235608 fts5yymsp[0].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235609 break;
235610 case 14: /* exprlist ::= exprlist cnearset */
 
235611 {
235612 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseImplicitAnd(pParse, fts5yymsp[-1].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24);
235613 }
 
235614 fts5yymsp[-1].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235615 break;
235616 case 15: /* cnearset ::= nearset */
 
235617 {
235618 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46);
235619 }
 
235620 fts5yymsp[0].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235621 break;
235622 case 16: /* cnearset ::= colset COLON nearset */
 
235623 {
235624 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46);
235625 sqlite3Fts5ParseSetColset(pParse, fts5yylhsminor.fts5yy24, fts5yymsp[-2].minor.fts5yy11);
235626 }
 
235627 fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
235628 break;
235629 case 17: /* nearset ::= phrase */
 
235630 { fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53); }
 
235631 fts5yymsp[0].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
235632 break;
235633 case 18: /* nearset ::= CARET phrase */
 
235634 {
235635 sqlite3Fts5ParseSetCaret(fts5yymsp[0].minor.fts5yy53);
235636 fts5yymsp[-1].minor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53);
235637 }
 
235638 break;
235639 case 19: /* nearset ::= STRING LP nearphrases neardist_opt RP */
 
235640 {
235641 sqlite3Fts5ParseNear(pParse, &fts5yymsp[-4].minor.fts5yy0);
235642 sqlite3Fts5ParseSetDistance(pParse, fts5yymsp[-2].minor.fts5yy46, &fts5yymsp[-1].minor.fts5yy0);
235643 fts5yylhsminor.fts5yy46 = fts5yymsp[-2].minor.fts5yy46;
235644 }
 
235645 fts5yymsp[-4].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
235646 break;
235647 case 20: /* nearphrases ::= phrase */
 
235648 {
235649 fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53);
235650 }
 
235651 fts5yymsp[0].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
235652 break;
235653 case 21: /* nearphrases ::= nearphrases phrase */
 
235654 {
235655 fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, fts5yymsp[-1].minor.fts5yy46, fts5yymsp[0].minor.fts5yy53);
235656 }
 
235657 fts5yymsp[-1].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
235658 break;
235659 case 22: /* neardist_opt ::= */
 
235660 { fts5yymsp[1].minor.fts5yy0.p = 0; fts5yymsp[1].minor.fts5yy0.n = 0; }
 
235661 break;
235662 case 23: /* neardist_opt ::= COMMA STRING */
 
235663 { fts5yymsp[-1].minor.fts5yy0 = fts5yymsp[0].minor.fts5yy0; }
 
235664 break;
235665 case 24: /* phrase ::= phrase PLUS STRING star_opt */
 
235666 {
235667 fts5yylhsminor.fts5yy53 = sqlite3Fts5ParseTerm(pParse, fts5yymsp[-3].minor.fts5yy53, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy4);
235668 }
 
235669 fts5yymsp[-3].minor.fts5yy53 = fts5yylhsminor.fts5yy53;
235670 break;
235671 case 25: /* phrase ::= STRING star_opt */
 
235672 {
235673 fts5yylhsminor.fts5yy53 = sqlite3Fts5ParseTerm(pParse, 0, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy4);
235674 }
 
235675 fts5yymsp[-1].minor.fts5yy53 = fts5yylhsminor.fts5yy53;
235676 break;
235677 case 26: /* star_opt ::= STAR */
 
235678 { fts5yymsp[0].minor.fts5yy4 = 1; }
 
235679 break;
235680 case 27: /* star_opt ::= */
 
235681 { fts5yymsp[1].minor.fts5yy4 = 0; }
 
235682 break;
235683 default:
235684 break;
235685 /********** End reduce actions ************************************************/
235686 };
@@ -235738,15 +236573,17 @@
235738 ){
235739 sqlite3Fts5ParserARG_FETCH
235740 sqlite3Fts5ParserCTX_FETCH
235741 #define FTS5TOKEN fts5yyminor
235742 /************ Begin %syntax_error code ****************************************/
 
235743
235744 UNUSED_PARAM(fts5yymajor); /* Silence a compiler warning */
235745 sqlite3Fts5ParseError(
235746 pParse, "fts5: syntax error near \"%.*s\"",FTS5TOKEN.n,FTS5TOKEN.p
235747 );
 
235748 /************ End %syntax_error code ******************************************/
235749 sqlite3Fts5ParserARG_STORE /* Suppress warning about unused %extra_argument variable */
235750 sqlite3Fts5ParserCTX_STORE
235751 }
235752
@@ -236012,10 +236849,11 @@
236012 (void)iToken;
236013 return 0;
236014 #endif
236015 }
236016
 
236017 /*
236018 ** 2014 May 31
236019 **
236020 ** The author disclaims copyright to this source code. In place of
236021 ** a legal notice, here is a blessing:
@@ -236834,10 +237672,11 @@
236834 }
236835
236836 return rc;
236837 }
236838
 
236839 /*
236840 ** 2014 May 31
236841 **
236842 ** The author disclaims copyright to this source code. In place of
236843 ** a legal notice, here is a blessing:
@@ -237246,10 +238085,11 @@
237246 }
237247 sqlite3_free(p);
237248 }
237249 }
237250
 
237251 /*
237252 ** 2014 Jun 09
237253 **
237254 ** The author disclaims copyright to this source code. In place of
237255 ** a legal notice, here is a blessing:
@@ -238361,10 +239201,11 @@
238361 va_end(ap);
238362 }
238363
238364
238365
 
238366 /*
238367 ** 2014 May 31
238368 **
238369 ** The author disclaims copyright to this source code. In place of
238370 ** a legal notice, here is a blessing:
@@ -241629,10 +242470,11 @@
241629 sqlite3Fts5IndexIterClearTokendata(pT->pIter);
241630 }
241631 }
241632 }
241633
 
241634 /*
241635 ** 2014 August 11
241636 **
241637 ** The author disclaims copyright to this source code. In place of
241638 ** a legal notice, here is a blessing:
@@ -242220,10 +243062,11 @@
242220 *ppDoclist = 0;
242221 *pnDoclist = 0;
242222 }
242223 }
242224
 
242225 /*
242226 ** 2014 May 31
242227 **
242228 ** The author disclaims copyright to this source code. In place of
242229 ** a legal notice, here is a blessing:
@@ -251297,10 +252140,11 @@
251297 fts5StructureInvalidate(p);
251298 }
251299 return fts5IndexReturn(p);
251300 }
251301
 
251302 /*
251303 ** 2014 Jun 09
251304 **
251305 ** The author disclaims copyright to this source code. In place of
251306 ** a legal notice, here is a blessing:
@@ -254886,11 +255730,11 @@
254886 int nArg, /* Number of args */
254887 sqlite3_value **apUnused /* Function arguments */
254888 ){
254889 assert( nArg==0 );
254890 UNUSED_PARAM2(nArg, apUnused);
254891 sqlite3_result_text(pCtx, "fts5: 2024-10-21 16:30:22 03a9703e27c44437c39363d0baf82db4ebc94538a0f28411c85dda156f82636e", -1, SQLITE_TRANSIENT);
254892 }
254893
254894 /*
254895 ** Implementation of fts5_locale(LOCALE, TEXT) function.
254896 **
@@ -255139,10 +255983,11 @@
255139 SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3 *db){
255140 return fts5Init(db);
255141 }
255142 #endif
255143
 
255144 /*
255145 ** 2014 May 31
255146 **
255147 ** The author disclaims copyright to this source code. In place of
255148 ** a legal notice, here is a blessing:
@@ -256652,10 +257497,11 @@
256652 }
256653 }
256654 return rc;
256655 }
256656
 
256657 /*
256658 ** 2014 May 31
256659 **
256660 ** The author disclaims copyright to this source code. In place of
256661 ** a legal notice, here is a blessing:
@@ -258140,10 +258986,11 @@
258140 );
258141 }
258142 return rc;
258143 }
258144
 
258145 /*
258146 ** 2012-05-25
258147 **
258148 ** The author disclaims copyright to this source code. In place of
258149 ** a legal notice, here is a blessing:
@@ -258922,10 +259769,11 @@
258922 }
258923 aAscii[0] = 0; /* 0x00 is never a token character */
258924 }
258925
258926
 
258927 /*
258928 ** 2015 May 30
258929 **
258930 ** The author disclaims copyright to this source code. In place of
258931 ** a legal notice, here is a blessing:
@@ -259267,10 +260115,11 @@
259267 if( iVal<(1 << 21) ) return 3;
259268 if( iVal<(1 << 28) ) return 4;
259269 return 5;
259270 }
259271
 
259272 /*
259273 ** 2015 May 08
259274 **
259275 ** The author disclaims copyright to this source code. In place of
259276 ** a legal notice, here is a blessing:
@@ -260077,15 +260926,16 @@
260077
260078 return sqlite3_create_module_v2(db, "fts5vocab", &fts5Vocab, p, 0);
260079 }
260080
260081
260082
260083 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */
260084
260085 /************** End of fts5.c ************************************************/
260086 /************** Begin file stmt.c ********************************************/
 
260087 /*
260088 ** 2017-05-31
260089 **
260090 ** The author disclaims copyright to this source code. In place of
260091 ** a legal notice, here is a blessing:
@@ -260433,6 +261283,7 @@
260433 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
260434
260435 /************** End of stmt.c ************************************************/
260436 /* Return the source-id for this library */
260437 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
 
260438 /************************** End of sqlite3.c ******************************/
260439
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.48.0. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -16,18 +16,22 @@
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 ** 5495b12569c318d5020b4b5a625a392ef8e7 with changes in files:
22 **
23 **
24 */
25 #ifndef SQLITE_AMALGAMATION
26 #define SQLITE_CORE 1
27 #define SQLITE_AMALGAMATION 1
28 #ifndef SQLITE_PRIVATE
29 # define SQLITE_PRIVATE static
30 #endif
31 /************** Begin file sqliteInt.h ***************************************/
32 #line 1 "tsrc/sqliteInt.h"
33 /*
34 ** 2001 September 15
35 **
36 ** The author disclaims copyright to this source code. In place of
37 ** a legal notice, here is a blessing:
@@ -84,10 +88,11 @@
88 ** compiler warnings due to subsequent content in this file and other files
89 ** that are included by this file.
90 */
91 /************** Include msvc.h in the middle of sqliteInt.h ******************/
92 /************** Begin file msvc.h ********************************************/
93 #line 1 "tsrc/msvc.h"
94 /*
95 ** 2015 January 12
96 **
97 ** The author disclaims copyright to this source code. In place of
98 ** a legal notice, here is a blessing:
@@ -132,16 +137,18 @@
137
138 #endif /* SQLITE_MSVC_H */
139
140 /************** End of msvc.h ************************************************/
141 /************** Continuing where we left off in sqliteInt.h ******************/
142 #line 60 "tsrc/sqliteInt.h"
143
144 /*
145 ** Special setup for VxWorks
146 */
147 /************** Include vxworks.h in the middle of sqliteInt.h ***************/
148 /************** Begin file vxworks.h *****************************************/
149 #line 1 "tsrc/vxworks.h"
150 /*
151 ** 2015-03-02
152 **
153 ** The author disclaims copyright to this source code. In place of
154 ** a legal notice, here is a blessing:
@@ -173,10 +180,11 @@
180 #define HAVE_LSTAT 1
181 #endif /* defined(_WRS_KERNEL) */
182
183 /************** End of vxworks.h *********************************************/
184 /************** Continuing where we left off in sqliteInt.h ******************/
185 #line 65 "tsrc/sqliteInt.h"
186
187 /*
188 ** These #defines should enable >2GB file support on POSIX if the
189 ** underlying operating system supports it. If the OS lacks
190 ** large file support, or if the OS is windows, these should be no-ops.
@@ -312,10 +320,11 @@
320 ** first in QNX. Also, the _USE_32BIT_TIME_T macro must appear first for
321 ** MinGW.
322 */
323 /************** Include sqlite3.h in the middle of sqliteInt.h ***************/
324 /************** Begin file sqlite3.h *****************************************/
325 #line 1 "tsrc/sqlite3.h"
326 /*
327 ** 2001-09-15
328 **
329 ** The author disclaims copyright to this source code. In place of
330 ** a legal notice, here is a blessing:
@@ -460,13 +469,13 @@
469 **
470 ** See also: [sqlite3_libversion()],
471 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
472 ** [sqlite_version()] and [sqlite_source_id()].
473 */
474 #define SQLITE_VERSION "3.48.0"
475 #define SQLITE_VERSION_NUMBER 3048000
476 #define SQLITE_SOURCE_ID "2024-11-06 12:58:31 5495b12569c318d5020b4b5a625a392ef8e777b81c0200624fbbc2a6b5eddef9"
477
478 /*
479 ** CAPI3REF: Run-Time Library Version Numbers
480 ** KEYWORDS: sqlite3_version sqlite3_sourceid
481 **
@@ -966,10 +975,17 @@
975 **
976 ** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
977 ** filesystem supports doing multiple write operations atomically when those
978 ** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
979 ** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
980 **
981 ** The SQLITE_IOCAP_SUBPAGE_READ property means that it is ok to read
982 ** from the database file in amounts that are not a multiple of the
983 ** page size and that do not begin at a page boundary. Without this
984 ** property, SQLite is careful to only do full-page reads and write
985 ** on aligned pages, with the one exception that it will do a sub-page
986 ** read of the first page to access the database header.
987 */
988 #define SQLITE_IOCAP_ATOMIC 0x00000001
989 #define SQLITE_IOCAP_ATOMIC512 0x00000002
990 #define SQLITE_IOCAP_ATOMIC1K 0x00000004
991 #define SQLITE_IOCAP_ATOMIC2K 0x00000008
@@ -982,10 +998,11 @@
998 #define SQLITE_IOCAP_SEQUENTIAL 0x00000400
999 #define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800
1000 #define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000
1001 #define SQLITE_IOCAP_IMMUTABLE 0x00002000
1002 #define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000
1003 #define SQLITE_IOCAP_SUBPAGE_READ 0x00008000
1004
1005 /*
1006 ** CAPI3REF: File Locking Levels
1007 **
1008 ** SQLite uses one of these integer values as the second
@@ -1128,10 +1145,11 @@
1145 ** <li> [SQLITE_IOCAP_SEQUENTIAL]
1146 ** <li> [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN]
1147 ** <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
1148 ** <li> [SQLITE_IOCAP_IMMUTABLE]
1149 ** <li> [SQLITE_IOCAP_BATCH_ATOMIC]
1150 ** <li> [SQLITE_IOCAP_SUBPAGE_READ]
1151 ** </ul>
1152 **
1153 ** The SQLITE_IOCAP_ATOMIC property means that all writes of
1154 ** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values
1155 ** mean that writes of blocks that are nnn bytes in size and
@@ -11194,11 +11212,11 @@
11212 #endif
11213
11214 #if 0
11215 } /* End of the 'extern "C"' block */
11216 #endif
11217 /* #endif for SQLITE3_H will be added by mksqlite3.tcl */
11218
11219 /******** Begin file sqlite3rtree.h *********/
11220 /*
11221 ** 2010 August 30
11222 **
@@ -13886,13 +13904,15 @@
13904 #endif
13905
13906 #endif /* _FTS5_H */
13907
13908 /******** End of fts5.h *********/
13909 #endif /* SQLITE3_H */
13910
13911 /************** End of sqlite3.h *********************************************/
13912 /************** Continuing where we left off in sqliteInt.h ******************/
13913 #line 203 "tsrc/sqliteInt.h"
13914
13915 /*
13916 ** Reuse the STATIC_LRU for mutex access to sqlite3_temp_directory.
13917 */
13918 #define SQLITE_MUTEX_STATIC_TEMPDIR SQLITE_MUTEX_STATIC_VFS1
@@ -13906,10 +13926,11 @@
13926 #define SQLITECONFIG_H 1
13927 #endif
13928
13929 /************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
13930 /************** Begin file sqliteLimit.h *************************************/
13931 #line 1 "tsrc/sqliteLimit.h"
13932 /*
13933 ** 2007 May 7
13934 **
13935 ** The author disclaims copyright to this source code. In place of
13936 ** a legal notice, here is a blessing:
@@ -14119,10 +14140,11 @@
14140 # define SQLITE_MAX_TRIGGER_DEPTH 1000
14141 #endif
14142
14143 /************** End of sqliteLimit.h *****************************************/
14144 /************** Continuing where we left off in sqliteInt.h ******************/
14145 #line 219 "tsrc/sqliteInt.h"
14146
14147 /* Disable nuisance warnings on Borland compilers */
14148 #if defined(__BORLANDC__)
14149 #pragma warn -rch /* unreachable code */
14150 #pragma warn -ccc /* Condition is always true or false */
@@ -14536,10 +14558,11 @@
14558 #define likely(X) (X)
14559 #define unlikely(X) (X)
14560
14561 /************** Include hash.h in the middle of sqliteInt.h ******************/
14562 /************** Begin file hash.h ********************************************/
14563 #line 1 "tsrc/hash.h"
14564 /*
14565 ** 2001 September 22
14566 **
14567 ** The author disclaims copyright to this source code. In place of
14568 ** a legal notice, here is a blessing:
@@ -14635,12 +14658,14 @@
14658
14659 #endif /* SQLITE_HASH_H */
14660
14661 /************** End of hash.h ************************************************/
14662 /************** Continuing where we left off in sqliteInt.h ******************/
14663 #line 635 "tsrc/sqliteInt.h"
14664 /************** Include parse.h in the middle of sqliteInt.h *****************/
14665 /************** Begin file parse.h *******************************************/
14666 #line 1 "tsrc/parse.h"
14667 #define TK_SEMI 1
14668 #define TK_EXPLAIN 2
14669 #define TK_QUERY 3
14670 #define TK_PLAN 4
14671 #define TK_BEGIN 5
@@ -14825,10 +14850,11 @@
14850 #define TK_SPACE 184
14851 #define TK_ILLEGAL 185
14852
14853 /************** End of parse.h ***********************************************/
14854 /************** Continuing where we left off in sqliteInt.h ******************/
14855 #line 636 "tsrc/sqliteInt.h"
14856 #include <stdio.h>
14857 #include <stdlib.h>
14858 #include <string.h>
14859 #include <assert.h>
14860 #include <stddef.h>
@@ -15590,10 +15616,11 @@
15616 ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
15617 ** pointer types (i.e. FuncDef) defined above.
15618 */
15619 /************** Include os.h in the middle of sqliteInt.h ********************/
15620 /************** Begin file os.h **********************************************/
15621 #line 1 "tsrc/os.h"
15622 /*
15623 ** 2001 September 16
15624 **
15625 ** The author disclaims copyright to this source code. In place of
15626 ** a legal notice, here is a blessing:
@@ -15618,10 +15645,11 @@
15645 ** Attempt to automatically detect the operating system and setup the
15646 ** necessary pre-processor macros for it.
15647 */
15648 /************** Include os_setup.h in the middle of os.h *********************/
15649 /************** Begin file os_setup.h ****************************************/
15650 #line 1 "tsrc/os_setup.h"
15651 /*
15652 ** 2013 November 25
15653 **
15654 ** The author disclaims copyright to this source code. In place of
15655 ** a legal notice, here is a blessing:
@@ -15712,10 +15740,11 @@
15740
15741 #endif /* SQLITE_OS_SETUP_H */
15742
15743 /************** End of os_setup.h ********************************************/
15744 /************** Continuing where we left off in os.h *************************/
15745 #line 28 "tsrc/os.h"
15746
15747 /* If the SET_FULLSYNC macro is not defined above, then make it
15748 ** a no-op
15749 */
15750 #ifndef SET_FULLSYNC
@@ -15913,12 +15942,14 @@
15942
15943 #endif /* _SQLITE_OS_H_ */
15944
15945 /************** End of os.h **************************************************/
15946 /************** Continuing where we left off in sqliteInt.h ******************/
15947 #line 1400 "tsrc/sqliteInt.h"
15948 /************** Include pager.h in the middle of sqliteInt.h *****************/
15949 /************** Begin file pager.h *******************************************/
15950 #line 1 "tsrc/pager.h"
15951 /*
15952 ** 2001 September 15
15953 **
15954 ** The author disclaims copyright to this source code. In place of
15955 ** a legal notice, here is a blessing:
@@ -16165,12 +16196,14 @@
16196
16197 #endif /* SQLITE_PAGER_H */
16198
16199 /************** End of pager.h ***********************************************/
16200 /************** Continuing where we left off in sqliteInt.h ******************/
16201 #line 1401 "tsrc/sqliteInt.h"
16202 /************** Include btree.h in the middle of sqliteInt.h *****************/
16203 /************** Begin file btree.h *******************************************/
16204 #line 1 "tsrc/btree.h"
16205 /*
16206 ** 2001 September 15
16207 **
16208 ** The author disclaims copyright to this source code. In place of
16209 ** a legal notice, here is a blessing:
@@ -16594,12 +16627,14 @@
16627
16628 #endif /* SQLITE_BTREE_H */
16629
16630 /************** End of btree.h ***********************************************/
16631 /************** Continuing where we left off in sqliteInt.h ******************/
16632 #line 1402 "tsrc/sqliteInt.h"
16633 /************** Include vdbe.h in the middle of sqliteInt.h ******************/
16634 /************** Begin file vdbe.h ********************************************/
16635 #line 1 "tsrc/vdbe.h"
16636 /*
16637 ** 2001 September 15
16638 **
16639 ** The author disclaims copyright to this source code. In place of
16640 ** a legal notice, here is a blessing:
@@ -16779,10 +16814,11 @@
16814 ** The makefile scans the vdbe.c source file and creates the "opcodes.h"
16815 ** header file that defines a number for each opcode used by the VDBE.
16816 */
16817 /************** Include opcodes.h in the middle of vdbe.h ********************/
16818 /************** Begin file opcodes.h *****************************************/
16819 #line 1 "tsrc/opcodes.h"
16820 /* Automatically generated. Do not edit */
16821 /* See the tool/mkopcodeh.tcl script for details */
16822 #define OP_Savepoint 0
16823 #define OP_AutoCommit 1
16824 #define OP_Transaction 2
@@ -17020,10 +17056,11 @@
17056 */
17057 #define SQLITE_MX_JUMP_OPCODE 64 /* Maximum JUMP opcode */
17058
17059 /************** End of opcodes.h *********************************************/
17060 /************** Continuing where we left off in vdbe.h ***********************/
17061 #line 183 "tsrc/vdbe.h"
17062
17063 /*
17064 ** Additional non-public SQLITE_PREPARE_* flags
17065 */
17066 #define SQLITE_PREPARE_SAVESQL 0x80 /* Preserve SQL text */
@@ -17269,12 +17306,14 @@
17306
17307 #endif /* SQLITE_VDBE_H */
17308
17309 /************** End of vdbe.h ************************************************/
17310 /************** Continuing where we left off in sqliteInt.h ******************/
17311 #line 1403 "tsrc/sqliteInt.h"
17312 /************** Include pcache.h in the middle of sqliteInt.h ****************/
17313 /************** Begin file pcache.h ******************************************/
17314 #line 1 "tsrc/pcache.h"
17315 /*
17316 ** 2008 August 05
17317 **
17318 ** The author disclaims copyright to this source code. In place of
17319 ** a legal notice, here is a blessing:
@@ -17464,12 +17503,14 @@
17503
17504 #endif /* _PCACHE_H_ */
17505
17506 /************** End of pcache.h **********************************************/
17507 /************** Continuing where we left off in sqliteInt.h ******************/
17508 #line 1404 "tsrc/sqliteInt.h"
17509 /************** Include mutex.h in the middle of sqliteInt.h *****************/
17510 /************** Begin file mutex.h *******************************************/
17511 #line 1 "tsrc/mutex.h"
17512 /*
17513 ** 2007 August 28
17514 **
17515 ** The author disclaims copyright to this source code. In place of
17516 ** a legal notice, here is a blessing:
@@ -17540,10 +17581,11 @@
17581 SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
17582 #endif /* defined(SQLITE_MUTEX_OMIT) */
17583
17584 /************** End of mutex.h ***********************************************/
17585 /************** Continuing where we left off in sqliteInt.h ******************/
17586 #line 1405 "tsrc/sqliteInt.h"
17587
17588 /* The SQLITE_EXTRA_DURABLE compile-time option used to set the default
17589 ** synchronous setting to EXTRA. It is no longer supported.
17590 */
17591 #ifdef SQLITE_EXTRA_DURABLE
@@ -17740,51 +17782,15 @@
17782 struct FuncDefHash {
17783 FuncDef *a[SQLITE_FUNC_HASH_SZ]; /* Hash table for functions */
17784 };
17785 #define SQLITE_FUNC_HASH(C,L) (((C)+(L))%SQLITE_FUNC_HASH_SZ)
17786
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17787 /*
17788 ** typedef for the authorization callback function.
17789 */
17790 typedef int (*sqlite3_xauth)(void*,int,const char*,const char*,const char*,
17791 const char*);
 
 
 
 
 
17792
17793 #ifndef SQLITE_OMIT_DEPRECATED
17794 /* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing
17795 ** in the style of sqlite3_trace()
17796 */
@@ -17941,13 +17947,10 @@
17947 sqlite3 *pUnlockConnection; /* Connection to watch for unlock */
17948 void *pUnlockArg; /* Argument to xUnlockNotify */
17949 void (*xUnlockNotify)(void **, int); /* Unlock notify callback */
17950 sqlite3 *pNextBlocked; /* Next in list of all blocked connections */
17951 #endif
 
 
 
17952 };
17953
17954 /*
17955 ** A macro to discover the encoding of a database.
17956 */
@@ -21979,10 +21982,11 @@
21982
21983 #endif /* SQLITEINT_H */
21984
21985 /************** End of sqliteInt.h *******************************************/
21986 /************** Begin file os_common.h ***************************************/
21987 #line 1 "tsrc/os_common.h"
21988 /*
21989 ** 2004 May 22
21990 **
21991 ** The author disclaims copyright to this source code. In place of
21992 ** a legal notice, here is a blessing:
@@ -22081,10 +22085,11 @@
22085
22086 #endif /* !defined(_OS_COMMON_H_) */
22087
22088 /************** End of os_common.h *******************************************/
22089 /************** Begin file ctime.c *******************************************/
22090 #line 1 "tsrc/ctime.c"
22091 /* DO NOT EDIT!
22092 ** This file is automatically generated by the script in the canonical
22093 ** SQLite source tree at tool/mkctimec.tcl.
22094 **
22095 ** To modify this header, edit any of the various lists in that script
@@ -22850,13 +22855,10 @@
22855 "UNLINK_AFTER_CLOSE",
22856 #endif
22857 #ifdef SQLITE_UNTESTABLE
22858 "UNTESTABLE",
22859 #endif
 
 
 
22860 #ifdef SQLITE_USE_ALLOCA
22861 "USE_ALLOCA",
22862 #endif
22863 #ifdef SQLITE_USE_FCNTL_TRACE
22864 "USE_FCNTL_TRACE",
@@ -22883,10 +22885,11 @@
22885
22886 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
22887
22888 /************** End of ctime.c ***********************************************/
22889 /************** Begin file global.c ******************************************/
22890 #line 1 "tsrc/global.c"
22891 /*
22892 ** 2008 June 13
22893 **
22894 ** The author disclaims copyright to this source code. In place of
22895 ** a legal notice, here is a blessing:
@@ -23287,10 +23290,11 @@
23290 "TEXT"
23291 };
23292
23293 /************** End of global.c **********************************************/
23294 /************** Begin file status.c ******************************************/
23295 #line 1 "tsrc/status.c"
23296 /*
23297 ** 2008 June 18
23298 **
23299 ** The author disclaims copyright to this source code. In place of
23300 ** a legal notice, here is a blessing:
@@ -23305,10 +23309,11 @@
23309 ** functionality.
23310 */
23311 /* #include "sqliteInt.h" */
23312 /************** Include vdbeInt.h in the middle of status.c ******************/
23313 /************** Begin file vdbeInt.h *****************************************/
23314 #line 1 "tsrc/vdbeInt.h"
23315 /*
23316 ** 2003 September 6
23317 **
23318 ** The author disclaims copyright to this source code. In place of
23319 ** a legal notice, here is a blessing:
@@ -23847,10 +23852,11 @@
23852 UnpackedRecord *pNewUnpacked; /* Unpacked version of new.* record */
23853 int iNewReg; /* Register for new.* values */
23854 int iBlobWrite; /* Value returned by preupdate_blobwrite() */
23855 i64 iKey1; /* First key value passed to hook */
23856 i64 iKey2; /* Second key value passed to hook */
23857 Mem oldipk; /* Memory cell holding "old" IPK value */
23858 Mem *aNew; /* Array of new.* values */
23859 Table *pTab; /* Schema object being updated */
23860 Index *pPk; /* PK index if pTab is WITHOUT ROWID */
23861 sqlite3_value **apDflt; /* Array of default values, if required */
23862 };
@@ -24040,10 +24046,11 @@
24046
24047 #endif /* !defined(SQLITE_VDBEINT_H) */
24048
24049 /************** End of vdbeInt.h *********************************************/
24050 /************** Continuing where we left off in status.c *********************/
24051 #line 18 "tsrc/status.c"
24052
24053 /*
24054 ** Variables in which to record status information.
24055 */
24056 #if SQLITE_PTRSIZE>4
@@ -24424,10 +24431,11 @@
24431 return rc;
24432 }
24433
24434 /************** End of status.c **********************************************/
24435 /************** Begin file date.c ********************************************/
24436 #line 1 "tsrc/date.c"
24437 /*
24438 ** 2003 October 31
24439 **
24440 ** The author disclaims copyright to this source code. In place of
24441 ** a legal notice, here is a blessing:
@@ -26242,10 +26250,11 @@
26250 sqlite3InsertBuiltinFuncs(aDateTimeFuncs, ArraySize(aDateTimeFuncs));
26251 }
26252
26253 /************** End of date.c ************************************************/
26254 /************** Begin file os.c **********************************************/
26255 #line 1 "tsrc/os.c"
26256 /*
26257 ** 2005 November 29
26258 **
26259 ** The author disclaims copyright to this source code. In place of
26260 ** a legal notice, here is a blessing:
@@ -26692,10 +26701,11 @@
26701 return SQLITE_OK;
26702 }
26703
26704 /************** End of os.c **************************************************/
26705 /************** Begin file fault.c *******************************************/
26706 #line 1 "tsrc/fault.c"
26707 /*
26708 ** 2008 Jan 22
26709 **
26710 ** The author disclaims copyright to this source code. In place of
26711 ** a legal notice, here is a blessing:
@@ -26782,10 +26792,11 @@
26792
26793 #endif /* #ifndef SQLITE_UNTESTABLE */
26794
26795 /************** End of fault.c ***********************************************/
26796 /************** Begin file mem0.c ********************************************/
26797 #line 1 "tsrc/mem0.c"
26798 /*
26799 ** 2008 October 28
26800 **
26801 ** The author disclaims copyright to this source code. In place of
26802 ** a legal notice, here is a blessing:
@@ -26844,10 +26855,11 @@
26855
26856 #endif /* SQLITE_ZERO_MALLOC */
26857
26858 /************** End of mem0.c ************************************************/
26859 /************** Begin file mem1.c ********************************************/
26860 #line 1 "tsrc/mem1.c"
26861 /*
26862 ** 2007 August 14
26863 **
26864 ** The author disclaims copyright to this source code. In place of
26865 ** a legal notice, here is a blessing:
@@ -27138,10 +27150,11 @@
27150
27151 #endif /* SQLITE_SYSTEM_MALLOC */
27152
27153 /************** End of mem1.c ************************************************/
27154 /************** Begin file mem2.c ********************************************/
27155 #line 1 "tsrc/mem2.c"
27156 /*
27157 ** 2007 August 15
27158 **
27159 ** The author disclaims copyright to this source code. In place of
27160 ** a legal notice, here is a blessing:
@@ -27669,10 +27682,11 @@
27682
27683 #endif /* SQLITE_MEMDEBUG */
27684
27685 /************** End of mem2.c ************************************************/
27686 /************** Begin file mem3.c ********************************************/
27687 #line 1 "tsrc/mem3.c"
27688 /*
27689 ** 2007 October 14
27690 **
27691 ** The author disclaims copyright to this source code. In place of
27692 ** a legal notice, here is a blessing:
@@ -28359,10 +28373,11 @@
28373
28374 #endif /* SQLITE_ENABLE_MEMSYS3 */
28375
28376 /************** End of mem3.c ************************************************/
28377 /************** Begin file mem5.c ********************************************/
28378 #line 1 "tsrc/mem5.c"
28379 /*
28380 ** 2007 October 14
28381 **
28382 ** The author disclaims copyright to this source code. In place of
28383 ** a legal notice, here is a blessing:
@@ -28947,10 +28962,11 @@
28962
28963 #endif /* SQLITE_ENABLE_MEMSYS5 */
28964
28965 /************** End of mem5.c ************************************************/
28966 /************** Begin file mutex.c *******************************************/
28967 #line 1 "tsrc/mutex.c"
28968 /*
28969 ** 2007 August 14
28970 **
28971 ** The author disclaims copyright to this source code. In place of
28972 ** a legal notice, here is a blessing:
@@ -29324,10 +29340,11 @@
29340
29341 #endif /* !defined(SQLITE_MUTEX_OMIT) */
29342
29343 /************** End of mutex.c ***********************************************/
29344 /************** Begin file mutex_noop.c **************************************/
29345 #line 1 "tsrc/mutex_noop.c"
29346 /*
29347 ** 2008 October 07
29348 **
29349 ** The author disclaims copyright to this source code. In place of
29350 ** a legal notice, here is a blessing:
@@ -29542,10 +29559,11 @@
29559 #endif /* defined(SQLITE_MUTEX_NOOP) */
29560 #endif /* !defined(SQLITE_MUTEX_OMIT) */
29561
29562 /************** End of mutex_noop.c ******************************************/
29563 /************** Begin file mutex_unix.c **************************************/
29564 #line 1 "tsrc/mutex_unix.c"
29565 /*
29566 ** 2007 August 28
29567 **
29568 ** The author disclaims copyright to this source code. In place of
29569 ** a legal notice, here is a blessing:
@@ -29939,10 +29957,11 @@
29957
29958 #endif /* SQLITE_MUTEX_PTHREADS */
29959
29960 /************** End of mutex_unix.c ******************************************/
29961 /************** Begin file mutex_w32.c ***************************************/
29962 #line 1 "tsrc/mutex_w32.c"
29963 /*
29964 ** 2007 August 14
29965 **
29966 ** The author disclaims copyright to this source code. In place of
29967 ** a legal notice, here is a blessing:
@@ -29965,10 +29984,11 @@
29984 /*
29985 ** Include the header file for the Windows VFS.
29986 */
29987 /************** Include os_win.h in the middle of mutex_w32.c ****************/
29988 /************** Begin file os_win.h ******************************************/
29989 #line 1 "tsrc/os_win.h"
29990 /*
29991 ** 2013 November 25
29992 **
29993 ** The author disclaims copyright to this source code. In place of
29994 ** a legal notice, here is a blessing:
@@ -30056,10 +30076,11 @@
30076
30077 #endif /* SQLITE_OS_WIN_H */
30078
30079 /************** End of os_win.h **********************************************/
30080 /************** Continuing where we left off in mutex_w32.c ******************/
30081 #line 26 "tsrc/mutex_w32.c"
30082 #endif
30083
30084 /*
30085 ** The code in this file is only used if we are compiling multithreaded
30086 ** on a Win32 system.
@@ -30433,10 +30454,11 @@
30454
30455 #endif /* SQLITE_MUTEX_W32 */
30456
30457 /************** End of mutex_w32.c *******************************************/
30458 /************** Begin file malloc.c ******************************************/
30459 #line 1 "tsrc/malloc.c"
30460 /*
30461 ** 2001 September 15
30462 **
30463 ** The author disclaims copyright to this source code. In place of
30464 ** a legal notice, here is a blessing:
@@ -31356,10 +31378,11 @@
31378 return 0;
31379 }
31380
31381 /************** End of malloc.c **********************************************/
31382 /************** Begin file printf.c ******************************************/
31383 #line 1 "tsrc/printf.c"
31384 /*
31385 ** The "printf" code that follows dates from the 1980's. It is in
31386 ** the public domain.
31387 **
31388 **************************************************************************
@@ -32805,10 +32828,11 @@
32828 }
32829 }
32830
32831 /************** End of printf.c **********************************************/
32832 /************** Begin file treeview.c ****************************************/
32833 #line 1 "tsrc/treeview.c"
32834 /*
32835 ** 2015-06-08
32836 **
32837 ** The author disclaims copyright to this source code. In place of
32838 ** a legal notice, here is a blessing:
@@ -34136,10 +34160,11 @@
34160
34161 #endif /* SQLITE_DEBUG */
34162
34163 /************** End of treeview.c ********************************************/
34164 /************** Begin file random.c ******************************************/
34165 #line 1 "tsrc/random.c"
34166 /*
34167 ** 2001 September 15
34168 **
34169 ** The author disclaims copyright to this source code. In place of
34170 ** a legal notice, here is a blessing:
@@ -34296,10 +34321,11 @@
34321 }
34322 #endif /* SQLITE_UNTESTABLE */
34323
34324 /************** End of random.c **********************************************/
34325 /************** Begin file threads.c *****************************************/
34326 #line 1 "tsrc/threads.c"
34327 /*
34328 ** 2012 July 21
34329 **
34330 ** The author disclaims copyright to this source code. In place of
34331 ** a legal notice, here is a blessing:
@@ -34573,10 +34599,11 @@
34599 /****************************** End Single-Threaded *************************/
34600 #endif /* SQLITE_MAX_WORKER_THREADS>0 */
34601
34602 /************** End of threads.c *********************************************/
34603 /************** Begin file utf.c *********************************************/
34604 #line 1 "tsrc/utf.c"
34605 /*
34606 ** 2004 April 13
34607 **
34608 ** The author disclaims copyright to this source code. In place of
34609 ** a legal notice, here is a blessing:
@@ -35144,10 +35171,11 @@
35171 #endif /* SQLITE_TEST */
35172 #endif /* SQLITE_OMIT_UTF16 */
35173
35174 /************** End of utf.c *************************************************/
35175 /************** Begin file util.c ********************************************/
35176 #line 1 "tsrc/util.c"
35177 /*
35178 ** 2001 September 15
35179 **
35180 ** The author disclaims copyright to this source code. In place of
35181 ** a legal notice, here is a blessing:
@@ -36995,10 +37023,11 @@
37023 return 0;
37024 }
37025
37026 /************** End of util.c ************************************************/
37027 /************** Begin file hash.c ********************************************/
37028 #line 1 "tsrc/hash.c"
37029 /*
37030 ** 2001 September 22
37031 **
37032 ** The author disclaims copyright to this source code. In place of
37033 ** a legal notice, here is a blessing:
@@ -37268,10 +37297,11 @@
37297 return 0;
37298 }
37299
37300 /************** End of hash.c ************************************************/
37301 /************** Begin file opcodes.c *****************************************/
37302 #line 1 "tsrc/opcodes.c"
37303 /* Automatically generated. Do not edit */
37304 /* See the tool/mkopcodec.tcl script for details. */
37305 #if !defined(SQLITE_OMIT_EXPLAIN) \
37306 || defined(VDBE_PROFILE) \
37307 || defined(SQLITE_DEBUG)
@@ -37477,10 +37507,11 @@
37507 }
37508 #endif
37509
37510 /************** End of opcodes.c *********************************************/
37511 /************** Begin file os_kv.c *******************************************/
37512 #line 1 "tsrc/os_kv.c"
37513 /*
37514 ** 2022-09-06
37515 **
37516 ** The author disclaims copyright to this source code. In place of
37517 ** a legal notice, here is a blessing:
@@ -38459,10 +38490,11 @@
38490 }
38491 #endif
38492
38493 /************** End of os_kv.c ***********************************************/
38494 /************** Begin file os_unix.c *****************************************/
38495 #line 1 "tsrc/os_unix.c"
38496 /*
38497 ** 2004 May 22
38498 **
38499 ** The author disclaims copyright to this source code. In place of
38500 ** a legal notice, here is a blessing:
@@ -38674,11 +38706,11 @@
38706 # define F_SETLKW 7
38707 # endif
38708 # endif
38709 #else /* !SQLITE_WASI */
38710 # ifndef HAVE_FCHMOD
38711 # define HAVE_FCHMOD 1
38712 # endif
38713 #endif /* SQLITE_WASI */
38714
38715 #ifdef SQLITE_WASI
38716 # define osGetpid(X) (pid_t)1
@@ -42589,10 +42621,11 @@
42621
42622 /* Set the POWERSAFE_OVERWRITE flag if requested. */
42623 if( pFd->ctrlFlags & UNIXFILE_PSOW ){
42624 pFd->deviceCharacteristics |= SQLITE_IOCAP_POWERSAFE_OVERWRITE;
42625 }
42626 pFd->deviceCharacteristics |= SQLITE_IOCAP_SUBPAGE_READ;
42627
42628 pFd->sectorSize = SQLITE_DEFAULT_SECTOR_SIZE;
42629 }
42630 }
42631 #else
@@ -46727,10 +46760,11 @@
46760
46761 #endif /* SQLITE_OS_UNIX */
46762
46763 /************** End of os_unix.c *********************************************/
46764 /************** Begin file os_win.c ******************************************/
46765 #line 1 "tsrc/os_win.c"
46766 /*
46767 ** 2004 May 22
46768 **
46769 ** The author disclaims copyright to this source code. In place of
46770 ** a legal notice, here is a blessing:
@@ -50389,11 +50423,11 @@
50423 /*
50424 ** Return a vector of device characteristics.
50425 */
50426 static int winDeviceCharacteristics(sqlite3_file *id){
50427 winFile *p = (winFile*)id;
50428 return SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN | SQLITE_IOCAP_SUBPAGE_READ |
50429 ((p->ctrlFlags & WINFILE_PSOW)?SQLITE_IOCAP_POWERSAFE_OVERWRITE:0);
50430 }
50431
50432 /*
50433 ** Windows will only let you create file view mappings
@@ -52941,10 +52975,11 @@
52975
52976 #endif /* SQLITE_OS_WIN */
52977
52978 /************** End of os_win.c **********************************************/
52979 /************** Begin file memdb.c *******************************************/
52980 #line 1 "tsrc/memdb.c"
52981 /*
52982 ** 2016-09-07
52983 **
52984 ** The author disclaims copyright to this source code. In place of
52985 ** a legal notice, here is a blessing:
@@ -53880,10 +53915,11 @@
53915 }
53916 #endif /* SQLITE_OMIT_DESERIALIZE */
53917
53918 /************** End of memdb.c ***********************************************/
53919 /************** Begin file bitvec.c ******************************************/
53920 #line 1 "tsrc/bitvec.c"
53921 /*
53922 ** 2008 February 16
53923 **
53924 ** The author disclaims copyright to this source code. In place of
53925 ** a legal notice, here is a blessing:
@@ -54294,10 +54330,11 @@
54330 }
54331 #endif /* SQLITE_UNTESTABLE */
54332
54333 /************** End of bitvec.c **********************************************/
54334 /************** Begin file pcache.c ******************************************/
54335 #line 1 "tsrc/pcache.c"
54336 /*
54337 ** 2008 August 05
54338 **
54339 ** The author disclaims copyright to this source code. In place of
54340 ** a legal notice, here is a blessing:
@@ -55233,10 +55270,11 @@
55270 }
55271 #endif
55272
55273 /************** End of pcache.c **********************************************/
55274 /************** Begin file pcache1.c *****************************************/
55275 #line 1 "tsrc/pcache1.c"
55276 /*
55277 ** 2008 November 05
55278 **
55279 ** The author disclaims copyright to this source code. In place of
55280 ** a legal notice, here is a blessing:
@@ -56518,10 +56556,11 @@
56556 }
56557 #endif
56558
56559 /************** End of pcache1.c *********************************************/
56560 /************** Begin file rowset.c ******************************************/
56561 #line 1 "tsrc/rowset.c"
56562 /*
56563 ** 2008 December 3
56564 **
56565 ** The author disclaims copyright to this source code. In place of
56566 ** a legal notice, here is a blessing:
@@ -57023,10 +57062,11 @@
57062 return 0;
57063 }
57064
57065 /************** End of rowset.c **********************************************/
57066 /************** Begin file pager.c *******************************************/
57067 #line 1 "tsrc/pager.c"
57068 /*
57069 ** 2001 September 15
57070 **
57071 ** The author disclaims copyright to this source code. In place of
57072 ** a legal notice, here is a blessing:
@@ -57047,10 +57087,11 @@
57087 */
57088 #ifndef SQLITE_OMIT_DISKIO
57089 /* #include "sqliteInt.h" */
57090 /************** Include wal.h in the middle of pager.c ***********************/
57091 /************** Begin file wal.h *********************************************/
57092 #line 1 "tsrc/wal.h"
57093 /*
57094 ** 2010 February 1
57095 **
57096 ** The author disclaims copyright to this source code. In place of
57097 ** a legal notice, here is a blessing:
@@ -57210,10 +57251,11 @@
57251 #endif /* ifndef SQLITE_OMIT_WAL */
57252 #endif /* SQLITE_WAL_H */
57253
57254 /************** End of wal.h *************************************************/
57255 /************** Continuing where we left off in pager.c **********************/
57256 #line 24 "tsrc/pager.c"
57257
57258
57259 /******************* NOTES ON THE DESIGN OF THE PAGER ************************
57260 **
57261 ** This comment block describes invariants that hold when using a rollback
@@ -57997,24 +58039,32 @@
58039 #ifdef SQLITE_DIRECT_OVERFLOW_READ
58040 /*
58041 ** Return true if page pgno can be read directly from the database file
58042 ** by the b-tree layer. This is the case if:
58043 **
58044 ** (1) the database file is open
58045 ** (2) the VFS for the database is able to do unaligned sub-page reads
58046 ** (3) there are no dirty pages in the cache, and
58047 ** (4) the desired page is not currently in the wal file.
58048 */
58049 SQLITE_PRIVATE int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno){
58050 assert( pPager!=0 );
58051 assert( pPager->fd!=0 );
58052 if( pPager->fd->pMethods==0 ) return 0; /* Case (1) */
58053 if( sqlite3PCacheIsDirty(pPager->pPCache) ) return 0; /* Failed (3) */
58054 #ifndef SQLITE_OMIT_WAL
58055 if( pPager->pWal ){
58056 u32 iRead = 0;
58057 (void)sqlite3WalFindFrame(pPager->pWal, pgno, &iRead);
58058 return iRead==0; /* Condition (4) */
58059 }
58060 #endif
58061 assert( pPager->fd->pMethods->xDeviceCharacteristics!=0 );
58062 if( (pPager->fd->pMethods->xDeviceCharacteristics(pPager->fd)
58063 & SQLITE_IOCAP_SUBPAGE_READ)==0 ){
58064 return 0; /* Case (2) */
58065 }
58066 return 1;
58067 }
58068 #endif
58069
58070 #ifndef SQLITE_OMIT_WAL
@@ -64991,10 +65041,11 @@
65041
65042 #endif /* SQLITE_OMIT_DISKIO */
65043
65044 /************** End of pager.c ***********************************************/
65045 /************** Begin file wal.c *********************************************/
65046 #line 1 "tsrc/wal.c"
65047 /*
65048 ** 2010 February 1
65049 **
65050 ** The author disclaims copyright to this source code. In place of
65051 ** a legal notice, here is a blessing:
@@ -69587,10 +69638,11 @@
69638
69639 #endif /* #ifndef SQLITE_OMIT_WAL */
69640
69641 /************** End of wal.c *************************************************/
69642 /************** Begin file btmutex.c *****************************************/
69643 #line 1 "tsrc/btmutex.c"
69644 /*
69645 ** 2007 August 27
69646 **
69647 ** The author disclaims copyright to this source code. In place of
69648 ** a legal notice, here is a blessing:
@@ -69606,10 +69658,11 @@
69658 ** big and we want to break it down some. This packaged seemed like
69659 ** a good breakout.
69660 */
69661 /************** Include btreeInt.h in the middle of btmutex.c ****************/
69662 /************** Begin file btreeInt.h ****************************************/
69663 #line 1 "tsrc/btreeInt.h"
69664 /*
69665 ** 2004 April 6
69666 **
69667 ** The author disclaims copyright to this source code. In place of
69668 ** a legal notice, here is a blessing:
@@ -70343,10 +70396,11 @@
70396 # define get2byteAligned(x) ((x)[0]<<8 | (x)[1])
70397 #endif
70398
70399 /************** End of btreeInt.h ********************************************/
70400 /************** Continuing where we left off in btmutex.c ********************/
70401 #line 19 "tsrc/btmutex.c"
70402 #ifndef SQLITE_OMIT_SHARED_CACHE
70403 #if SQLITE_THREADSAFE
70404
70405 /*
70406 ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -70637,10 +70691,11 @@
70691
70692 #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
70693
70694 /************** End of btmutex.c *********************************************/
70695 /************** Begin file btree.c *******************************************/
70696 #line 1 "tsrc/btree.c"
70697 /*
70698 ** 2004 April 6
70699 **
70700 ** The author disclaims copyright to this source code. In place of
70701 ** a legal notice, here is a blessing:
@@ -82131,10 +82186,11 @@
82186 }
82187 #endif
82188
82189 /************** End of btree.c ***********************************************/
82190 /************** Begin file backup.c ******************************************/
82191 #line 1 "tsrc/backup.c"
82192 /*
82193 ** 2009 January 28
82194 **
82195 ** The author disclaims copyright to this source code. In place of
82196 ** a legal notice, here is a blessing:
@@ -82901,10 +82957,11 @@
82957 }
82958 #endif /* SQLITE_OMIT_VACUUM */
82959
82960 /************** End of backup.c **********************************************/
82961 /************** Begin file vdbemem.c *****************************************/
82962 #line 1 "tsrc/vdbemem.c"
82963 /*
82964 ** 2004 May 26
82965 **
82966 ** The author disclaims copyright to this source code. In place of
82967 ** a legal notice, here is a blessing:
@@ -84957,10 +85014,11 @@
85014 return valueBytes(pVal, enc);
85015 }
85016
85017 /************** End of vdbemem.c *********************************************/
85018 /************** Begin file vdbeaux.c *****************************************/
85019 #line 1 "tsrc/vdbeaux.c"
85020 /*
85021 ** 2003 September 6
85022 **
85023 ** The author disclaims copyright to this source code. In place of
85024 ** a legal notice, here is a blessing:
@@ -90488,10 +90546,11 @@
90546 db->xPreUpdateCallback(db->pPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2);
90547 db->pPreUpdate = 0;
90548 sqlite3DbFree(db, preupdate.aRecord);
90549 vdbeFreeUnpacked(db, preupdate.keyinfo.nKeyField+1, preupdate.pUnpacked);
90550 vdbeFreeUnpacked(db, preupdate.keyinfo.nKeyField+1, preupdate.pNewUnpacked);
90551 sqlite3VdbeMemRelease(&preupdate.oldipk);
90552 if( preupdate.aNew ){
90553 int i;
90554 for(i=0; i<pCsr->nField; i++){
90555 sqlite3VdbeMemRelease(&preupdate.aNew[i]);
90556 }
@@ -90507,10 +90566,11 @@
90566 }
90567 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
90568
90569 /************** End of vdbeaux.c *********************************************/
90570 /************** Begin file vdbeapi.c *****************************************/
90571 #line 1 "tsrc/vdbeapi.c"
90572 /*
90573 ** 2004 May 26
90574 **
90575 ** The author disclaims copyright to this source code. In place of
90576 ** a legal notice, here is a blessing:
@@ -92706,64 +92766,68 @@
92766 if( iIdx>=p->pCsr->nField || iIdx<0 ){
92767 rc = SQLITE_RANGE;
92768 goto preupdate_old_out;
92769 }
92770
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92771 if( iIdx==p->pTab->iPKey ){
92772 *ppValue = pMem = &p->oldipk;
92773 sqlite3VdbeMemSetInt64(pMem, p->iKey1);
92774 }else{
92775
92776 /* If the old.* record has not yet been loaded into memory, do so now. */
92777 if( p->pUnpacked==0 ){
92778 u32 nRec;
92779 u8 *aRec;
92780
92781 assert( p->pCsr->eCurType==CURTYPE_BTREE );
92782 nRec = sqlite3BtreePayloadSize(p->pCsr->uc.pCursor);
92783 aRec = sqlite3DbMallocRaw(db, nRec);
92784 if( !aRec ) goto preupdate_old_out;
92785 rc = sqlite3BtreePayload(p->pCsr->uc.pCursor, 0, nRec, aRec);
92786 if( rc==SQLITE_OK ){
92787 p->pUnpacked = vdbeUnpackRecord(&p->keyinfo, nRec, aRec);
92788 if( !p->pUnpacked ) rc = SQLITE_NOMEM;
92789 }
92790 if( rc!=SQLITE_OK ){
92791 sqlite3DbFree(db, aRec);
92792 goto preupdate_old_out;
92793 }
92794 p->aRecord = aRec;
92795 }
92796
92797 pMem = *ppValue = &p->pUnpacked->aMem[iIdx];
92798 if( iIdx>=p->pUnpacked->nField ){
92799 /* This occurs when the table has been extended using ALTER TABLE
92800 ** ADD COLUMN. The value to return is the default value of the column. */
92801 Column *pCol = &p->pTab->aCol[iIdx];
92802 if( pCol->iDflt>0 ){
92803 if( p->apDflt==0 ){
92804 int nByte = sizeof(sqlite3_value*)*p->pTab->nCol;
92805 p->apDflt = (sqlite3_value**)sqlite3DbMallocZero(db, nByte);
92806 if( p->apDflt==0 ) goto preupdate_old_out;
92807 }
92808 if( p->apDflt[iIdx]==0 ){
92809 sqlite3_value *pVal = 0;
92810 Expr *pDflt;
92811 assert( p->pTab!=0 && IsOrdinaryTable(p->pTab) );
92812 pDflt = p->pTab->u.tab.pDfltList->a[pCol->iDflt-1].pExpr;
92813 rc = sqlite3ValueFromExpr(db, pDflt, ENC(db), pCol->affinity, &pVal);
92814 if( rc==SQLITE_OK && pVal==0 ){
92815 rc = SQLITE_CORRUPT_BKPT;
92816 }
92817 p->apDflt[iIdx] = pVal;
92818 }
92819 *ppValue = p->apDflt[iIdx];
92820 }else{
92821 *ppValue = (sqlite3_value *)columnNullValue();
92822 }
92823 }else if( p->pTab->aCol[iIdx].affinity==SQLITE_AFF_REAL ){
92824 if( pMem->flags & (MEM_Int|MEM_IntReal) ){
92825 testcase( pMem->flags & MEM_Int );
92826 testcase( pMem->flags & MEM_IntReal );
92827 sqlite3VdbeMemRealify(pMem);
92828 }
92829 }
92830 }
92831
92832 preupdate_old_out:
92833 sqlite3Error(db, rc);
@@ -93089,10 +93153,11 @@
93153 }
93154 #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */
93155
93156 /************** End of vdbeapi.c *********************************************/
93157 /************** Begin file vdbetrace.c ***************************************/
93158 #line 1 "tsrc/vdbetrace.c"
93159 /*
93160 ** 2009 November 25
93161 **
93162 ** The author disclaims copyright to this source code. In place of
93163 ** a legal notice, here is a blessing:
@@ -93284,10 +93349,11 @@
93349
93350 #endif /* #ifndef SQLITE_OMIT_TRACE */
93351
93352 /************** End of vdbetrace.c *******************************************/
93353 /************** Begin file vdbe.c ********************************************/
93354 #line 1 "tsrc/vdbe.c"
93355 /*
93356 ** 2001 September 15
93357 **
93358 ** The author disclaims copyright to this source code. In place of
93359 ** a legal notice, here is a blessing:
@@ -93315,10 +93381,11 @@
93381 #if defined(VDBE_PROFILE) \
93382 || defined(SQLITE_PERFORMANCE_TRACE) \
93383 || defined(SQLITE_ENABLE_STMT_SCANSTATUS)
93384 /************** Include hwtime.h in the middle of vdbe.c *********************/
93385 /************** Begin file hwtime.h ******************************************/
93386 #line 1 "tsrc/hwtime.h"
93387 /*
93388 ** 2008 May 27
93389 **
93390 ** The author disclaims copyright to this source code. In place of
93391 ** a legal notice, here is a blessing:
@@ -93403,10 +93470,11 @@
93470
93471 #endif /* !defined(SQLITE_HWTIME_H) */
93472
93473 /************** End of hwtime.h **********************************************/
93474 /************** Continuing where we left off in vdbe.c ***********************/
93475 #line 31 "tsrc/vdbe.c"
93476 #endif
93477
93478 /*
93479 ** Invoke this macro on memory cells just prior to changing the
93480 ** value of the cell. This macro verifies that shallow copies are
@@ -97913,13 +97981,15 @@
97981 0, pCx->uc.pCursor);
97982 pCx->isTable = 1;
97983 }
97984 }
97985 pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
97986 assert( p->apCsr[pOp->p1]==pCx );
97987 if( rc ){
97988 assert( !sqlite3BtreeClosesWithCursor(pCx->ub.pBtx, pCx->uc.pCursor) );
97989 sqlite3BtreeClose(pCx->ub.pBtx);
97990 p->apCsr[pOp->p1] = 0; /* Not required; helps with static analysis */
97991 }else{
97992 assert( sqlite3BtreeClosesWithCursor(pCx->ub.pBtx, pCx->uc.pCursor) );
97993 }
97994 }
97995 }
@@ -102594,10 +102664,11 @@
102664 }
102665
102666
102667 /************** End of vdbe.c ************************************************/
102668 /************** Begin file vdbeblob.c ****************************************/
102669 #line 1 "tsrc/vdbeblob.c"
102670 /*
102671 ** 2007 May 1
102672 **
102673 ** The author disclaims copyright to this source code. In place of
102674 ** a legal notice, here is a blessing:
@@ -103117,10 +103188,11 @@
103188
103189 #endif /* #ifndef SQLITE_OMIT_INCRBLOB */
103190
103191 /************** End of vdbeblob.c ********************************************/
103192 /************** Begin file vdbesort.c ****************************************/
103193 #line 1 "tsrc/vdbesort.c"
103194 /*
103195 ** 2011-07-09
103196 **
103197 ** The author disclaims copyright to this source code. In place of
103198 ** a legal notice, here is a blessing:
@@ -105887,10 +105959,11 @@
105959 return SQLITE_OK;
105960 }
105961
105962 /************** End of vdbesort.c ********************************************/
105963 /************** Begin file vdbevtab.c ****************************************/
105964 #line 1 "tsrc/vdbevtab.c"
105965 /*
105966 ** 2020-03-23
105967 **
105968 ** The author disclaims copyright to this source code. In place of
105969 ** a legal notice, here is a blessing:
@@ -106336,10 +106409,11 @@
106409 SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3 *db){ return SQLITE_OK; }
106410 #endif /* SQLITE_ENABLE_BYTECODE_VTAB */
106411
106412 /************** End of vdbevtab.c ********************************************/
106413 /************** Begin file memjournal.c **************************************/
106414 #line 1 "tsrc/memjournal.c"
106415 /*
106416 ** 2008 October 7
106417 **
106418 ** The author disclaims copyright to this source code. In place of
106419 ** a legal notice, here is a blessing:
@@ -106779,10 +106853,11 @@
106853 return MAX(pVfs->szOsFile, (int)sizeof(MemJournal));
106854 }
106855
106856 /************** End of memjournal.c ******************************************/
106857 /************** Begin file walker.c ******************************************/
106858 #line 1 "tsrc/walker.c"
106859 /*
106860 ** 2008 August 16
106861 **
106862 ** The author disclaims copyright to this source code. In place of
106863 ** a legal notice, here is a blessing:
@@ -107043,10 +107118,11 @@
107118 return WRC_Continue;
107119 }
107120
107121 /************** End of walker.c **********************************************/
107122 /************** Begin file resolve.c *****************************************/
107123 #line 1 "tsrc/resolve.c"
107124 /*
107125 ** 2008 August 18
107126 **
107127 ** The author disclaims copyright to this source code. In place of
107128 ** a legal notice, here is a blessing:
@@ -109364,10 +109440,11 @@
109440 return rc;
109441 }
109442
109443 /************** End of resolve.c *********************************************/
109444 /************** Begin file expr.c ********************************************/
109445 #line 1 "tsrc/expr.c"
109446 /*
109447 ** 2001 September 15
109448 **
109449 ** The author disclaims copyright to this source code. In place of
109450 ** a legal notice, here is a blessing:
@@ -116693,10 +116770,11 @@
116770 }
116771 #endif /* SQLITE_DEBUG */
116772
116773 /************** End of expr.c ************************************************/
116774 /************** Begin file alter.c *******************************************/
116775 #line 1 "tsrc/alter.c"
116776 /*
116777 ** 2005 February 15
116778 **
116779 ** The author disclaims copyright to this source code. In place of
116780 ** a legal notice, here is a blessing:
@@ -119012,10 +119090,11 @@
119090 }
119091 #endif /* SQLITE_ALTER_TABLE */
119092
119093 /************** End of alter.c ***********************************************/
119094 /************** Begin file analyze.c *****************************************/
119095 #line 1 "tsrc/analyze.c"
119096 /*
119097 ** 2005-07-08
119098 **
119099 ** The author disclaims copyright to this source code. In place of
119100 ** a legal notice, here is a blessing:
@@ -121036,10 +121115,11 @@
121115
121116 #endif /* SQLITE_OMIT_ANALYZE */
121117
121118 /************** End of analyze.c *********************************************/
121119 /************** Begin file attach.c ******************************************/
121120 #line 1 "tsrc/attach.c"
121121 /*
121122 ** 2003 April 6
121123 **
121124 ** The author disclaims copyright to this source code. In place of
121125 ** a legal notice, here is a blessing:
@@ -121265,19 +121345,10 @@
121345 rc = sqlite3Init(db, &zErrDyn);
121346 }
121347 sqlite3BtreeLeaveAll(db);
121348 assert( zErrDyn==0 || rc!=SQLITE_OK );
121349 }
 
 
 
 
 
 
 
 
 
121350 if( rc ){
121351 if( ALWAYS(!REOPEN_AS_MEMDB(db)) ){
121352 int iDb = db->nDb - 1;
121353 assert( iDb>=2 );
121354 if( db->aDb[iDb].pBt ){
@@ -121657,10 +121728,11 @@
121728 }
121729 #endif
121730
121731 /************** End of attach.c **********************************************/
121732 /************** Begin file auth.c ********************************************/
121733 #line 1 "tsrc/auth.c"
121734 /*
121735 ** 2003 January 11
121736 **
121737 ** The author disclaims copyright to this source code. In place of
121738 ** a legal notice, here is a blessing:
@@ -121771,15 +121843,11 @@
121843 sqlite3 *db = pParse->db; /* Database handle */
121844 char *zDb = db->aDb[iDb].zDbSName; /* Schema name of attached database */
121845 int rc; /* Auth callback return code */
121846
121847 if( db->init.busy ) return SQLITE_OK;
121848 rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext);
 
 
 
 
121849 if( rc==SQLITE_DENY ){
121850 char *z = sqlite3_mprintf("%s.%s", zTab, zCol);
121851 if( db->nDb>2 || iDb!=0 ) z = sqlite3_mprintf("%s.%z", zDb, z);
121852 sqlite3ErrorMsg(pParse, "access to %z is prohibited", z);
121853 pParse->rc = SQLITE_AUTH;
@@ -121882,15 +121950,11 @@
121950 testcase( zArg1==0 );
121951 testcase( zArg2==0 );
121952 testcase( zArg3==0 );
121953 testcase( pParse->zAuthContext==0 );
121954
121955 rc = db->xAuth(db->pAuthArg,code,zArg1,zArg2,zArg3,pParse->zAuthContext);
 
 
 
 
121956 if( rc==SQLITE_DENY ){
121957 sqlite3ErrorMsg(pParse, "not authorized");
121958 pParse->rc = SQLITE_AUTH;
121959 }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
121960 rc = SQLITE_DENY;
@@ -121928,10 +121992,11 @@
121992
121993 #endif /* SQLITE_OMIT_AUTHORIZATION */
121994
121995 /************** End of auth.c ************************************************/
121996 /************** Begin file build.c *******************************************/
121997 #line 1 "tsrc/build.c"
121998 /*
121999 ** 2001 September 15
122000 **
122001 ** The author disclaims copyright to this source code. In place of
122002 ** a legal notice, here is a blessing:
@@ -122119,21 +122184,10 @@
122184 sqlite3VdbeJumpHere(v, addrRewind);
122185 }
122186 }
122187 sqlite3VdbeAddOp0(v, OP_Halt);
122188
 
 
 
 
 
 
 
 
 
 
 
122189 /* The cookie mask contains one bit for each database file open.
122190 ** (Bit 0 is for main, bit 1 is for temp, and so forth.) Bits are
122191 ** set for each database that is used. Generate code to start a
122192 ** transaction on each used database and to verify the schema cookie
122193 ** on each used database.
@@ -122258,20 +122312,10 @@
122312 sqlite3DbFree(db, zSql);
122313 memcpy(PARSE_TAIL(pParse), saveBuf, PARSE_TAIL_SZ);
122314 pParse->nested--;
122315 }
122316
 
 
 
 
 
 
 
 
 
 
122317 /*
122318 ** Locate the in-memory structure that describes a particular database
122319 ** table given the name of that table and (optionally) the name of the
122320 ** database containing the table. Return NULL if not found.
122321 **
@@ -122286,17 +122330,10 @@
122330 Table *p = 0;
122331 int i;
122332
122333 /* All mutexes are required for schema access. Make sure we hold them. */
122334 assert( zDatabase!=0 || sqlite3BtreeHoldsAllMutexes(db) );
 
 
 
 
 
 
 
122335 if( zDatabase ){
122336 for(i=0; i<db->nDb; i++){
122337 if( sqlite3StrICmp(zDatabase, db->aDb[i].zDbSName)==0 ) break;
122338 }
122339 if( i>=db->nDb ){
@@ -125951,13 +125988,10 @@
125988
125989 assert( pTab!=0 );
125990 if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0
125991 && db->init.busy==0
125992 && pTblName!=0
 
 
 
125993 ){
125994 sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName);
125995 goto exit_create_index;
125996 }
125997 #ifndef SQLITE_OMIT_VIEW
@@ -127729,10 +127763,11 @@
127763 }
127764 #endif /* !defined(SQLITE_OMIT_CTE) */
127765
127766 /************** End of build.c ***********************************************/
127767 /************** Begin file callback.c ****************************************/
127768 #line 1 "tsrc/callback.c"
127769 /*
127770 ** 2005 May 23
127771 **
127772 ** The author disclaims copyright to this source code. In place of
127773 ** a legal notice, here is a blessing:
@@ -128272,10 +128307,11 @@
128307 return p;
128308 }
128309
128310 /************** End of callback.c ********************************************/
128311 /************** Begin file delete.c ******************************************/
128312 #line 1 "tsrc/delete.c"
128313 /*
128314 ** 2001 September 15
128315 **
128316 ** The author disclaims copyright to this source code. In place of
128317 ** a legal notice, here is a blessing:
@@ -129305,10 +129341,11 @@
129341 }
129342 }
129343
129344 /************** End of delete.c **********************************************/
129345 /************** Begin file func.c ********************************************/
129346 #line 1 "tsrc/func.c"
129347 /*
129348 ** 2002 February 23
129349 **
129350 ** The author disclaims copyright to this source code. In place of
129351 ** a legal notice, here is a blessing:
@@ -131985,13 +132022,10 @@
132022 #endif
132023 #ifndef SQLITE_OMIT_LOAD_EXTENSION
132024 SFUNCTION(load_extension, 1, 0, 0, loadExt ),
132025 SFUNCTION(load_extension, 2, 0, 0, loadExt ),
132026 #endif
 
 
 
132027 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
132028 DFUNCTION(sqlite_compileoption_used,1, 0, 0, compileoptionusedFunc ),
132029 DFUNCTION(sqlite_compileoption_get, 1, 0, 0, compileoptiongetFunc ),
132030 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
132031 INLINE_FUNC(unlikely, 1, INLINEFUNC_unlikely, SQLITE_FUNC_UNLIKELY),
@@ -132154,10 +132188,11 @@
132188 #endif
132189 }
132190
132191 /************** End of func.c ************************************************/
132192 /************** Begin file fkey.c ********************************************/
132193 #line 1 "tsrc/fkey.c"
132194 /*
132195 **
132196 ** The author disclaims copyright to this source code. In place of
132197 ** a legal notice, here is a blessing:
132198 **
@@ -133641,10 +133676,11 @@
133676 }
133677 #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
133678
133679 /************** End of fkey.c ************************************************/
133680 /************** Begin file insert.c ******************************************/
133681 #line 1 "tsrc/insert.c"
133682 /*
133683 ** 2001 September 15
133684 **
133685 ** The author disclaims copyright to this source code. In place of
133686 ** a legal notice, here is a blessing:
@@ -137036,10 +137072,11 @@
137072 }
137073 #endif /* SQLITE_OMIT_XFER_OPT */
137074
137075 /************** End of insert.c **********************************************/
137076 /************** Begin file legacy.c ******************************************/
137077 #line 1 "tsrc/legacy.c"
137078 /*
137079 ** 2001 September 15
137080 **
137081 ** The author disclaims copyright to this source code. In place of
137082 ** a legal notice, here is a blessing:
@@ -137180,10 +137217,11 @@
137217 return rc;
137218 }
137219
137220 /************** End of legacy.c **********************************************/
137221 /************** Begin file loadext.c *****************************************/
137222 #line 1 "tsrc/loadext.c"
137223 /*
137224 ** 2006 June 7
137225 **
137226 ** The author disclaims copyright to this source code. In place of
137227 ** a legal notice, here is a blessing:
@@ -137200,10 +137238,11 @@
137238 #ifndef SQLITE_CORE
137239 #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
137240 #endif
137241 /************** Include sqlite3ext.h in the middle of loadext.c **************/
137242 /************** Begin file sqlite3ext.h **************************************/
137243 #line 1 "tsrc/sqlite3ext.h"
137244 /*
137245 ** 2006 June 7
137246 **
137247 ** The author disclaims copyright to this source code. In place of
137248 ** a legal notice, here is a blessing:
@@ -137922,10 +137961,11 @@
137961
137962 #endif /* SQLITE3EXT_H */
137963
137964 /************** End of sqlite3ext.h ******************************************/
137965 /************** Continuing where we left off in loadext.c ********************/
137966 #line 20 "tsrc/loadext.c"
137967 /* #include "sqliteInt.h" */
137968
137969 #ifndef SQLITE_OMIT_LOAD_EXTENSION
137970 /*
137971 ** Some API routines are omitted when various features are
@@ -138827,10 +138867,11 @@
138867 }
138868 }
138869
138870 /************** End of loadext.c *********************************************/
138871 /************** Begin file pragma.c ******************************************/
138872 #line 1 "tsrc/pragma.c"
138873 /*
138874 ** 2003 April 6
138875 **
138876 ** The author disclaims copyright to this source code. In place of
138877 ** a legal notice, here is a blessing:
@@ -138859,10 +138900,11 @@
138900 ** lexicographical order to facility a binary search of the pragma name.
138901 ** Do not edit pragma.h directly. Edit and rerun the script in at
138902 ** ../tool/mkpragmatab.tcl. */
138903 /************** Include pragma.h in the middle of pragma.c *******************/
138904 /************** Begin file pragma.h ******************************************/
138905 #line 1 "tsrc/pragma.h"
138906 /* DO NOT EDIT!
138907 ** This file is automatically generated by the script at
138908 ** ../tool/mkpragmatab.tcl. To update the set of pragmas, edit
138909 ** that script and rerun it.
138910 */
@@ -139522,10 +139564,11 @@
139564 };
139565 /* Number of pragmas: 68 on by default, 78 total. */
139566
139567 /************** End of pragma.h **********************************************/
139568 /************** Continuing where we left off in pragma.c *********************/
139569 #line 32 "tsrc/pragma.c"
139570
139571 /*
139572 ** When the 0x10 bit of PRAGMA optimize is set, any ANALYZE commands
139573 ** will be run with an analysis_limit set to the lessor of the value of
139574 ** the following macro or to the actual analysis_limit if it is non-zero,
@@ -140637,16 +140680,10 @@
140680 if( db->autoCommit==0 ){
140681 /* Foreign key support may not be enabled or disabled while not
140682 ** in auto-commit mode. */
140683 mask &= ~(SQLITE_ForeignKeys);
140684 }
 
 
 
 
 
 
140685
140686 if( sqlite3GetBoolean(zRight, 0) ){
140687 if( (mask & SQLITE_WriteSchema)==0
140688 || (db->flags & SQLITE_Defensive)==0
140689 ){
@@ -142571,10 +142608,11 @@
142608
142609 #endif /* SQLITE_OMIT_PRAGMA */
142610
142611 /************** End of pragma.c **********************************************/
142612 /************** Begin file prepare.c *****************************************/
142613 #line 1 "tsrc/prepare.c"
142614 /*
142615 ** 2005 May 25
142616 **
142617 ** The author disclaims copyright to this source code. In place of
142618 ** a legal notice, here is a blessing:
@@ -142879,18 +142917,11 @@
142917 encoding = (u8)meta[BTREE_TEXT_ENCODING-1] & 3;
142918 if( encoding==0 ) encoding = SQLITE_UTF8;
142919 #else
142920 encoding = SQLITE_UTF8;
142921 #endif
142922 sqlite3SetTextEncoding(db, encoding);
 
 
 
 
 
 
 
142923 }else{
142924 /* If opening an attached database, the encoding much match ENC(db) */
142925 if( (meta[BTREE_TEXT_ENCODING-1] & 3)!=ENC(db) ){
142926 sqlite3SetString(pzErrMsg, db, "attached databases must use the same"
142927 " text encoding as main database");
@@ -143671,10 +143702,11 @@
143702
143703 #endif /* SQLITE_OMIT_UTF16 */
143704
143705 /************** End of prepare.c *********************************************/
143706 /************** Begin file select.c ******************************************/
143707 #line 1 "tsrc/select.c"
143708 /*
143709 ** 2001 September 15
143710 **
143711 ** The author disclaims copyright to this source code. In place of
143712 ** a legal notice, here is a blessing:
@@ -152443,10 +152475,11 @@
152475 return rc;
152476 }
152477
152478 /************** End of select.c **********************************************/
152479 /************** Begin file table.c *******************************************/
152480 #line 1 "tsrc/table.c"
152481 /*
152482 ** 2001 September 15
152483 **
152484 ** The author disclaims copyright to this source code. In place of
152485 ** a legal notice, here is a blessing:
@@ -152644,10 +152677,11 @@
152677
152678 #endif /* SQLITE_OMIT_GET_TABLE */
152679
152680 /************** End of table.c ***********************************************/
152681 /************** Begin file trigger.c *****************************************/
152682 #line 1 "tsrc/trigger.c"
152683 /*
152684 **
152685 ** The author disclaims copyright to this source code. In place of
152686 ** a legal notice, here is a blessing:
152687 **
@@ -154210,10 +154244,11 @@
154244
154245 #endif /* !defined(SQLITE_OMIT_TRIGGER) */
154246
154247 /************** End of trigger.c *********************************************/
154248 /************** Begin file update.c ******************************************/
154249 #line 1 "tsrc/update.c"
154250 /*
154251 ** 2001 September 15
154252 **
154253 ** The author disclaims copyright to this source code. In place of
154254 ** a legal notice, here is a blessing:
@@ -155581,10 +155616,11 @@
155616 }
155617 #endif /* SQLITE_OMIT_VIRTUALTABLE */
155618
155619 /************** End of update.c **********************************************/
155620 /************** Begin file upsert.c ******************************************/
155621 #line 1 "tsrc/upsert.c"
155622 /*
155623 ** 2018-04-12
155624 **
155625 ** The author disclaims copyright to this source code. In place of
155626 ** a legal notice, here is a blessing:
@@ -155913,10 +155949,11 @@
155949
155950 #endif /* SQLITE_OMIT_UPSERT */
155951
155952 /************** End of upsert.c **********************************************/
155953 /************** Begin file vacuum.c ******************************************/
155954 #line 1 "tsrc/vacuum.c"
155955 /*
155956 ** 2003 April 6
155957 **
155958 ** The author disclaims copyright to this source code. In place of
155959 ** a legal notice, here is a blessing:
@@ -156334,10 +156371,11 @@
156371
156372 #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
156373
156374 /************** End of vacuum.c **********************************************/
156375 /************** Begin file vtab.c ********************************************/
156376 #line 1 "tsrc/vtab.c"
156377 /*
156378 ** 2006 June 10
156379 **
156380 ** The author disclaims copyright to this source code. In place of
156381 ** a legal notice, here is a blessing:
@@ -157711,10 +157749,11 @@
157749
157750 #endif /* SQLITE_OMIT_VIRTUALTABLE */
157751
157752 /************** End of vtab.c ************************************************/
157753 /************** Begin file wherecode.c ***************************************/
157754 #line 1 "tsrc/wherecode.c"
157755 /*
157756 ** 2015-06-06
157757 **
157758 ** The author disclaims copyright to this source code. In place of
157759 ** a legal notice, here is a blessing:
@@ -157733,10 +157772,11 @@
157772 ** file retains the code that does query planning and analysis.
157773 */
157774 /* #include "sqliteInt.h" */
157775 /************** Include whereInt.h in the middle of wherecode.c **************/
157776 /************** Begin file whereInt.h ****************************************/
157777 #line 1 "tsrc/whereInt.h"
157778 /*
157779 ** 2013-11-12
157780 **
157781 ** The author disclaims copyright to this source code. In place of
157782 ** a legal notice, here is a blessing:
@@ -158268,13 +158308,21 @@
158308 SQLITE_PRIVATE int sqlite3WhereExplainBloomFilter(
158309 const Parse *pParse, /* Parse context */
158310 const WhereInfo *pWInfo, /* WHERE clause */
158311 const WhereLevel *pLevel /* Bloom filter on this level */
158312 );
158313 SQLITE_PRIVATE void sqlite3WhereAddExplainText(
158314 Parse *pParse, /* Parse context */
158315 int addr,
158316 SrcList *pTabList, /* Table list this loop refers to */
158317 WhereLevel *pLevel, /* Scan to write OP_Explain opcode for */
158318 u16 wctrlFlags /* Flags passed to sqlite3WhereBegin() */
158319 );
158320 #else
158321 # define sqlite3WhereExplainOneScan(u,v,w,x) 0
158322 # define sqlite3WhereExplainBloomFilter(u,v,w) 0
158323 # define sqlite3WhereAddExplainText(u,v,w,x,y)
158324 #endif /* SQLITE_OMIT_EXPLAIN */
158325 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
158326 SQLITE_PRIVATE void sqlite3WhereAddScanStatus(
158327 Vdbe *v, /* Vdbe to add scanstatus entry to */
158328 SrcList *pSrclist, /* FROM clause pLvl reads data from */
@@ -158381,10 +158429,11 @@
158429
158430 #endif /* !defined(SQLITE_WHEREINT_H) */
158431
158432 /************** End of whereInt.h ********************************************/
158433 /************** Continuing where we left off in wherecode.c ******************/
158434 #line 22 "tsrc/wherecode.c"
158435
158436 #ifndef SQLITE_OMIT_EXPLAIN
158437
158438 /*
158439 ** Return the name of the i-th column of the pIdx index.
@@ -158472,42 +158521,42 @@
158521 }
158522 sqlite3_str_append(pStr, ")", 1);
158523 }
158524
158525 /*
158526 ** This function sets the P4 value of an existing OP_Explain opcode to
158527 ** text describing the loop in pLevel. If the OP_Explain opcode already has
158528 ** a P4 value, it is freed before it is overwritten.
 
 
 
 
158529 */
158530 SQLITE_PRIVATE void sqlite3WhereAddExplainText(
158531 Parse *pParse, /* Parse context */
158532 int addr, /* Address of OP_Explain opcode */
158533 SrcList *pTabList, /* Table list this loop refers to */
158534 WhereLevel *pLevel, /* Scan to write OP_Explain opcode for */
158535 u16 wctrlFlags /* Flags passed to sqlite3WhereBegin() */
158536 ){
 
158537 #if !defined(SQLITE_DEBUG)
158538 if( sqlite3ParseToplevel(pParse)->explain==2 || IS_STMT_SCANSTATUS(pParse->db) )
158539 #endif
158540 {
158541 VdbeOp *pOp = sqlite3VdbeGetOp(pParse->pVdbe, addr);
158542
158543 SrcItem *pItem = &pTabList->a[pLevel->iFrom];
 
158544 sqlite3 *db = pParse->db; /* Database handle */
158545 int isSearch; /* True for a SEARCH. False for SCAN. */
158546 WhereLoop *pLoop; /* The controlling WhereLoop object */
158547 u32 flags; /* Flags that describe this loop */
158548 #if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_EXPLAIN)
158549 char *zMsg; /* Text to add to EQP output */
158550 #endif
158551 StrAccum str; /* EQP output string */
158552 char zBuf[100]; /* Initial space for EQP output string */
158553
158554 if( db->mallocFailed ) return;
158555
158556 pLoop = pLevel->pWLoop;
158557 flags = pLoop->wsFlags;
 
158558
158559 isSearch = (flags&(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0
158560 || ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0))
158561 || (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX));
158562
@@ -158527,11 +158576,11 @@
158576 }
158577 }else if( flags & WHERE_PARTIALIDX ){
158578 zFmt = "AUTOMATIC PARTIAL COVERING INDEX";
158579 }else if( flags & WHERE_AUTO_INDEX ){
158580 zFmt = "AUTOMATIC COVERING INDEX";
158581 }else if( flags & (WHERE_IDX_ONLY|WHERE_EXPRIDX) ){
158582 zFmt = "COVERING INDEX %s";
158583 }else{
158584 zFmt = "INDEX %s";
158585 }
158586 if( zFmt ){
@@ -158579,15 +158628,54 @@
158628 sqlite3LogEstToInt(pLoop->nOut));
158629 }else{
158630 sqlite3_str_append(&str, " (~1 row)", 9);
158631 }
158632 #endif
158633 #if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_EXPLAIN)
158634 zMsg = sqlite3StrAccumFinish(&str);
158635 sqlite3ExplainBreakpoint("",zMsg);
158636 #endif
158637
158638 assert( pOp->opcode==OP_Explain );
158639 assert( pOp->p4type==P4_DYNAMIC || pOp->p4.z==0 );
158640 sqlite3DbFree(db, pOp->p4.z);
158641 pOp->p4type = P4_DYNAMIC;
158642 pOp->p4.z = sqlite3StrAccumFinish(&str);
158643 }
158644 }
158645
158646
158647 /*
158648 ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
158649 ** command, or if stmt_scanstatus_v2() stats are enabled, or if SQLITE_DEBUG
158650 ** was defined at compile-time. If it is not a no-op, a single OP_Explain
158651 ** opcode is added to the output to describe the table scan strategy in pLevel.
158652 **
158653 ** If an OP_Explain opcode is added to the VM, its address is returned.
158654 ** Otherwise, if no OP_Explain is coded, zero is returned.
158655 */
158656 SQLITE_PRIVATE int sqlite3WhereExplainOneScan(
158657 Parse *pParse, /* Parse context */
158658 SrcList *pTabList, /* Table list this loop refers to */
158659 WhereLevel *pLevel, /* Scan to write OP_Explain opcode for */
158660 u16 wctrlFlags /* Flags passed to sqlite3WhereBegin() */
158661 ){
158662 int ret = 0;
158663 #if !defined(SQLITE_DEBUG)
158664 if( sqlite3ParseToplevel(pParse)->explain==2 || IS_STMT_SCANSTATUS(pParse->db) )
158665 #endif
158666 {
158667 if( (pLevel->pWLoop->wsFlags & WHERE_MULTI_OR)==0
158668 && (wctrlFlags & WHERE_OR_SUBCLAUSE)==0
158669 ){
158670 Vdbe *v = pParse->pVdbe;
158671 int addr = sqlite3VdbeCurrentAddr(v);
158672 ret = sqlite3VdbeAddOp3(
158673 v, OP_Explain, addr, pParse->addrExplain, pLevel->pWLoop->rRun
158674 );
158675 sqlite3WhereAddExplainText(pParse, addr, pTabList, pLevel, wctrlFlags);
158676 }
158677 }
158678 return ret;
158679 }
158680
158681 /*
@@ -158682,13 +158770,14 @@
158770 if( wsFlags & WHERE_INDEXED ){
158771 sqlite3VdbeScanStatusRange(v, addrExplain, -1, pLvl->iIdxCur);
158772 }
158773 }else{
158774 int addr;
158775 VdbeOp *pOp;
158776 assert( pSrclist->a[pLvl->iFrom].fg.isSubquery );
158777 addr = pSrclist->a[pLvl->iFrom].u4.pSubq->addrFillSub;
158778 pOp = sqlite3VdbeGetOp(v, addr-1);
158779 assert( sqlite3VdbeDb(v)->mallocFailed || pOp->opcode==OP_InitCoroutine );
158780 assert( sqlite3VdbeDb(v)->mallocFailed || pOp->p2>addr );
158781 sqlite3VdbeScanStatusRange(v, addrExplain, addr, pOp->p2-1);
158782 }
158783 }
@@ -161263,10 +161352,11 @@
161352 pParse->withinRJSubrtn--;
161353 }
161354
161355 /************** End of wherecode.c *******************************************/
161356 /************** Begin file whereexpr.c ***************************************/
161357 #line 1 "tsrc/whereexpr.c"
161358 /*
161359 ** 2015-06-08
161360 **
161361 ** The author disclaims copyright to this source code. In place of
161362 ** a legal notice, here is a blessing:
@@ -163168,10 +163258,11 @@
163258 }
163259 }
163260
163261 /************** End of whereexpr.c *******************************************/
163262 /************** Begin file where.c *******************************************/
163263 #line 1 "tsrc/where.c"
163264 /*
163265 ** 2001 September 15
163266 **
163267 ** The author disclaims copyright to this source code. In place of
163268 ** a legal notice, here is a blessing:
@@ -170611,18 +170702,32 @@
170702 x = sqlite3TableColumnToIndex(pIdx, x);
170703 if( x>=0 ){
170704 pOp->p2 = x;
170705 pOp->p1 = pLevel->iIdxCur;
170706 OpcodeRewriteTrace(db, k, pOp);
170707 }else if( pLoop->wsFlags & (WHERE_IDX_ONLY|WHERE_EXPRIDX) ){
 
 
 
 
170708 if( pLoop->wsFlags & WHERE_IDX_ONLY ){
170709 /* An error. pLoop is supposed to be a covering index loop,
170710 ** and yet the VM code refers to a column of the table that
170711 ** is not part of the index. */
170712 sqlite3ErrorMsg(pParse, "internal query planner error");
170713 pParse->rc = SQLITE_INTERNAL;
170714 }else{
170715 /* The WHERE_EXPRIDX flag is set by the planner when it is likely
170716 ** that pLoop is a covering index loop, but it is not possible
170717 ** to be 100% sure. In this case, any OP_Explain opcode
170718 ** corresponding to this loop describes the index as a "COVERING
170719 ** INDEX". But, pOp proves that pLoop is not actually a covering
170720 ** index loop. So clear the WHERE_EXPRIDX flag and rewrite the
170721 ** text that accompanies the OP_Explain opcode, if any. */
170722 pLoop->wsFlags &= ~WHERE_EXPRIDX;
170723 sqlite3WhereAddExplainText(pParse,
170724 pLevel->addrBody-1,
170725 pTabList,
170726 pLevel,
170727 pWInfo->wctrlFlags
170728 );
170729 }
170730 }
170731 }else if( pOp->opcode==OP_Rowid ){
170732 pOp->p1 = pLevel->iIdxCur;
170733 pOp->opcode = OP_IdxRowid;
@@ -170654,10 +170759,11 @@
170759 return;
170760 }
170761
170762 /************** End of where.c ***********************************************/
170763 /************** Begin file window.c ******************************************/
170764 #line 1 "tsrc/window.c"
170765 /*
170766 ** 2018 May 08
170767 **
170768 ** The author disclaims copyright to this source code. In place of
170769 ** a legal notice, here is a blessing:
@@ -173763,10 +173869,11 @@
173869
173870 #endif /* SQLITE_OMIT_WINDOWFUNC */
173871
173872 /************** End of window.c **********************************************/
173873 /************** Begin file parse.c *******************************************/
173874 #line 1 "tsrc/parse.c"
173875 /* This file is automatically generated by Lemon from input grammar
173876 ** source file "parse.y".
173877 */
173878 /*
173879 ** 2001-09-15
@@ -173786,10 +173893,11 @@
173893 ** That input file is processed by Lemon to generate a C-language
173894 ** implementation of a parser for the given grammar. You might be reading
173895 ** this comment as part of the translated C-code. Edits should be made
173896 ** to the original parse.y sources.
173897 */
173898 #line 62 "parse.y"
173899
173900 /* #include "sqliteInt.h" */
173901
173902 /*
173903 ** Disable all error recovery processing in the parser push-down
@@ -173869,10 +173977,11 @@
173977 sqlite3ExprListDelete(pParse->db, pOrderBy);
173978 sqlite3ExprDelete(pParse->db, pLimit);
173979 }
173980 #endif /* SQLITE_ENABLE_UPDATE_DELETE_LIMIT */
173981
173982 #line 517 "parse.y"
173983
173984 /*
173985 ** For a compound SELECT statement, make sure p->pPrior->pNext==p for
173986 ** all elements in the list. And make sure list length does not exceed
173987 ** SQLITE_LIMIT_COMPOUND_SELECT.
@@ -173923,10 +174032,11 @@
174032 ** testing.
174033 */
174034 static void *parserStackRealloc(void *pOld, sqlite3_uint64 newSize){
174035 return sqlite3FaultSim(700) ? 0 : sqlite3_realloc(pOld, newSize);
174036 }
174037 #line 1085 "parse.y"
174038
174039
174040 /* Construct a new Expr object from a single token */
174041 static Expr *tokenExpr(Parse *pParse, int op, Token t){
174042 Expr *p = sqlite3DbMallocRawNN(pParse->db, sizeof(Expr)+t.n+1);
@@ -173959,10 +174069,11 @@
174069 }
174070 }
174071 return p;
174072 }
174073
174074 #line 1329 "parse.y"
174075
174076 /* A routine to convert a binary TK_IS or TK_ISNOT expression into a
174077 ** unary TK_ISNULL or TK_NOTNULL expression. */
174078 static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
174079 sqlite3 *db = pParse->db;
@@ -173970,10 +174081,11 @@
174081 pA->op = (u8)op;
174082 sqlite3ExprDelete(db, pA->pRight);
174083 pA->pRight = 0;
174084 }
174085 }
174086 #line 1564 "parse.y"
174087
174088 /* Add a single new term to an ExprList that is used to store a
174089 ** list of identifiers. Report an error if the ID list contains
174090 ** a COLLATE clause or an ASC or DESC keyword, except ignore the
174091 ** error while parsing a legacy schema.
@@ -173993,14 +174105,16 @@
174105 pIdToken->n, pIdToken->z);
174106 }
174107 sqlite3ExprListSetName(pParse, p, pIdToken, 1);
174108 return p;
174109 }
174110 #line 2048 "parse.y"
174111
174112 #if TK_SPAN>255
174113 # error too many tokens in the grammar
174114 #endif
174115 #line 267 "parse.sql"
174116 /**************** End of %include directives **********************************/
174117 /* These constants specify the various numeric values for terminal symbols.
174118 ***************** Begin token definitions *************************************/
174119 #ifndef TK_SEMI
174120 #define TK_SEMI 1
@@ -176181,11 +176295,13 @@
176295 case 240: /* selectnowith */
176296 case 241: /* oneselect */
176297 case 253: /* values */
176298 case 255: /* mvalues */
176299 {
176300 #line 511 "parse.y"
176301 sqlite3SelectDelete(pParse->db, (yypminor->yy555));
176302 #line 2453 "parse.sql"
176303 }
176304 break;
176305 case 217: /* term */
176306 case 218: /* expr */
176307 case 247: /* where_opt */
@@ -176196,11 +176312,13 @@
176312 case 285: /* vinto */
176313 case 292: /* when_clause */
176314 case 297: /* key_opt */
176315 case 314: /* filter_clause */
176316 {
176317 #line 1083 "parse.y"
176318 sqlite3ExprDelete(pParse->db, (yypminor->yy454));
176319 #line 2470 "parse.sql"
176320 }
176321 break;
176322 case 222: /* eidlist_opt */
176323 case 232: /* sortlist */
176324 case 233: /* eidlist */
@@ -176213,64 +176331,82 @@
176331 case 270: /* setlist */
176332 case 279: /* paren_exprlist */
176333 case 281: /* case_exprlist */
176334 case 313: /* part_opt */
176335 {
176336 #line 1562 "parse.y"
176337 sqlite3ExprListDelete(pParse->db, (yypminor->yy14));
176338 #line 2489 "parse.sql"
176339 }
176340 break;
176341 case 239: /* fullname */
176342 case 246: /* from */
176343 case 258: /* seltablist */
176344 case 259: /* stl_prefix */
176345 case 264: /* xfullname */
176346 {
176347 #line 789 "parse.y"
176348 sqlite3SrcListDelete(pParse->db, (yypminor->yy203));
176349 #line 2500 "parse.sql"
176350 }
176351 break;
176352 case 242: /* wqlist */
176353 {
176354 #line 1849 "parse.y"
176355 sqlite3WithDelete(pParse->db, (yypminor->yy59));
176356 #line 2507 "parse.sql"
176357 }
176358 break;
176359 case 252: /* window_clause */
176360 case 309: /* windowdefn_list */
176361 {
176362 #line 1977 "parse.y"
176363 sqlite3WindowListDelete(pParse->db, (yypminor->yy211));
176364 #line 2515 "parse.sql"
176365 }
176366 break;
176367 case 265: /* idlist */
176368 case 272: /* idlist_opt */
176369 {
176370 #line 1068 "parse.y"
176371 sqlite3IdListDelete(pParse->db, (yypminor->yy132));
176372 #line 2523 "parse.sql"
176373 }
176374 break;
176375 case 275: /* filter_over */
176376 case 310: /* windowdefn */
176377 case 311: /* window */
176378 case 312: /* frame_opt */
176379 case 315: /* over_clause */
176380 {
176381 #line 1916 "parse.y"
176382 sqlite3WindowDelete(pParse->db, (yypminor->yy211));
176383 #line 2534 "parse.sql"
176384 }
176385 break;
176386 case 288: /* trigger_cmd_list */
176387 case 293: /* trigger_cmd */
176388 {
176389 #line 1677 "parse.y"
176390 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy427));
176391 #line 2542 "parse.sql"
176392 }
176393 break;
176394 case 290: /* trigger_event */
176395 {
176396 #line 1663 "parse.y"
176397 sqlite3IdListDelete(pParse->db, (yypminor->yy286).b);
176398 #line 2549 "parse.sql"
176399 }
176400 break;
176401 case 317: /* frame_bound */
176402 case 318: /* frame_bound_s */
176403 case 319: /* frame_bound_e */
176404 {
176405 #line 1921 "parse.y"
176406 sqlite3ExprDelete(pParse->db, (yypminor->yy509).pExpr);
176407 #line 2558 "parse.sql"
176408 }
176409 break;
176410 /********* End destructor definitions *****************************************/
176411 default: break; /* If no destructor action specified: do nothing */
176412 }
@@ -176501,12 +176637,14 @@
176637 #endif
176638 while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
176639 /* Here code is inserted which will execute if the parser
176640 ** stack every overflows */
176641 /******** Begin %stack_overflow code ******************************************/
176642 #line 51 "parse.y"
176643
176644 sqlite3OomFault(pParse->db);
176645 #line 2796 "parse.sql"
176646 /******** End %stack_overflow code ********************************************/
176647 sqlite3ParserARG_STORE /* Suppress warning about unused %extra_argument var */
176648 sqlite3ParserCTX_STORE
176649 }
176650
@@ -177433,326 +177571,481 @@
177571 ** break;
177572 */
177573 /********** Begin reduce actions **********************************************/
177574 YYMINORTYPE yylhsminor;
177575 case 0: /* explain ::= EXPLAIN */
177576 #line 155 "parse.y"
177577 { if( pParse->pReprepare==0 ) pParse->explain = 1; }
177578 #line 3729 "parse.sql"
177579 break;
177580 case 1: /* explain ::= EXPLAIN QUERY PLAN */
177581 #line 156 "parse.y"
177582 { if( pParse->pReprepare==0 ) pParse->explain = 2; }
177583 #line 3734 "parse.sql"
177584 break;
177585 case 2: /* cmdx ::= cmd */
177586 #line 158 "parse.y"
177587 { sqlite3FinishCoding(pParse); }
177588 #line 3739 "parse.sql"
177589 break;
177590 case 3: /* cmd ::= BEGIN transtype trans_opt */
177591 #line 163 "parse.y"
177592 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy144);}
177593 #line 3744 "parse.sql"
177594 break;
177595 case 4: /* transtype ::= */
177596 #line 168 "parse.y"
177597 {yymsp[1].minor.yy144 = TK_DEFERRED;}
177598 #line 3749 "parse.sql"
177599 break;
177600 case 5: /* transtype ::= DEFERRED */
177601 case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
177602 case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
177603 case 324: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==324);
177604 #line 169 "parse.y"
177605 {yymsp[0].minor.yy144 = yymsp[0].major; /*A-overwrites-X*/}
177606 #line 3757 "parse.sql"
177607 break;
177608 case 8: /* cmd ::= COMMIT|END trans_opt */
177609 case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
177610 #line 172 "parse.y"
177611 {sqlite3EndTransaction(pParse,yymsp[-1].major);}
177612 #line 3763 "parse.sql"
177613 break;
177614 case 10: /* cmd ::= SAVEPOINT nm */
177615 #line 177 "parse.y"
177616 {
177617 sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
177618 }
177619 #line 3770 "parse.sql"
177620 break;
177621 case 11: /* cmd ::= RELEASE savepoint_opt nm */
177622 #line 180 "parse.y"
177623 {
177624 sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
177625 }
177626 #line 3777 "parse.sql"
177627 break;
177628 case 12: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
177629 #line 183 "parse.y"
177630 {
177631 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
177632 }
177633 #line 3784 "parse.sql"
177634 break;
177635 case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
177636 #line 190 "parse.y"
177637 {
177638 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy144,0,0,yymsp[-2].minor.yy144);
177639 }
177640 #line 3791 "parse.sql"
177641 break;
177642 case 14: /* createkw ::= CREATE */
177643 #line 193 "parse.y"
177644 {disableLookaside(pParse);}
177645 #line 3796 "parse.sql"
177646 break;
177647 case 15: /* ifnotexists ::= */
177648 case 18: /* temp ::= */ yytestcase(yyruleno==18);
177649 case 47: /* autoinc ::= */ yytestcase(yyruleno==47);
177650 case 62: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==62);
177651 case 72: /* defer_subclause_opt ::= */ yytestcase(yyruleno==72);
177652 case 81: /* ifexists ::= */ yytestcase(yyruleno==81);
177653 case 100: /* distinct ::= */ yytestcase(yyruleno==100);
177654 case 246: /* collate ::= */ yytestcase(yyruleno==246);
177655 #line 196 "parse.y"
177656 {yymsp[1].minor.yy144 = 0;}
177657 #line 3808 "parse.sql"
177658 break;
177659 case 16: /* ifnotexists ::= IF NOT EXISTS */
177660 #line 197 "parse.y"
177661 {yymsp[-2].minor.yy144 = 1;}
177662 #line 3813 "parse.sql"
177663 break;
177664 case 17: /* temp ::= TEMP */
177665 #line 200 "parse.y"
177666 {yymsp[0].minor.yy144 = pParse->db->init.busy==0;}
177667 #line 3818 "parse.sql"
177668 break;
177669 case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_option_set */
177670 #line 203 "parse.y"
177671 {
177672 sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy391,0);
177673 }
177674 #line 3825 "parse.sql"
177675 break;
177676 case 20: /* create_table_args ::= AS select */
177677 #line 206 "parse.y"
177678 {
177679 sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy555);
177680 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy555);
177681 }
177682 #line 3833 "parse.sql"
177683 break;
177684 case 21: /* table_option_set ::= */
177685 #line 212 "parse.y"
177686 {yymsp[1].minor.yy391 = 0;}
177687 #line 3838 "parse.sql"
177688 break;
177689 case 22: /* table_option_set ::= table_option_set COMMA table_option */
177690 #line 214 "parse.y"
177691 {yylhsminor.yy391 = yymsp[-2].minor.yy391|yymsp[0].minor.yy391;}
177692 #line 3843 "parse.sql"
177693 yymsp[-2].minor.yy391 = yylhsminor.yy391;
177694 break;
177695 case 23: /* table_option ::= WITHOUT nm */
177696 #line 215 "parse.y"
177697 {
177698 if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
177699 yymsp[-1].minor.yy391 = TF_WithoutRowid | TF_NoVisibleRowid;
177700 }else{
177701 yymsp[-1].minor.yy391 = 0;
177702 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
177703 }
177704 }
177705 #line 3856 "parse.sql"
177706 break;
177707 case 24: /* table_option ::= nm */
177708 #line 223 "parse.y"
177709 {
177710 if( yymsp[0].minor.yy0.n==6 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"strict",6)==0 ){
177711 yylhsminor.yy391 = TF_Strict;
177712 }else{
177713 yylhsminor.yy391 = 0;
177714 sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
177715 }
177716 }
177717 #line 3868 "parse.sql"
177718 yymsp[0].minor.yy391 = yylhsminor.yy391;
177719 break;
177720 case 25: /* columnname ::= nm typetoken */
177721 #line 233 "parse.y"
177722 {sqlite3AddColumn(pParse,yymsp[-1].minor.yy0,yymsp[0].minor.yy0);}
177723 #line 3874 "parse.sql"
177724 break;
177725 case 26: /* typetoken ::= */
177726 case 65: /* conslist_opt ::= */ yytestcase(yyruleno==65);
177727 case 106: /* as ::= */ yytestcase(yyruleno==106);
177728 #line 327 "parse.y"
177729 {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = 0;}
177730 #line 3881 "parse.sql"
177731 break;
177732 case 27: /* typetoken ::= typename LP signed RP */
177733 #line 329 "parse.y"
177734 {
177735 yymsp[-3].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
177736 }
177737 #line 3888 "parse.sql"
177738 break;
177739 case 28: /* typetoken ::= typename LP signed COMMA signed RP */
177740 #line 332 "parse.y"
177741 {
177742 yymsp[-5].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
177743 }
177744 #line 3895 "parse.sql"
177745 break;
177746 case 29: /* typename ::= typename ID|STRING */
177747 #line 337 "parse.y"
177748 {yymsp[-1].minor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
177749 #line 3900 "parse.sql"
177750 break;
177751 case 30: /* scanpt ::= */
177752 #line 355 "parse.y"
177753 {
177754 assert( yyLookahead!=YYNOCODE );
177755 yymsp[1].minor.yy168 = yyLookaheadToken.z;
177756 }
177757 #line 3908 "parse.sql"
177758 break;
177759 case 31: /* scantok ::= */
177760 #line 359 "parse.y"
177761 {
177762 assert( yyLookahead!=YYNOCODE );
177763 yymsp[1].minor.yy0 = yyLookaheadToken;
177764 }
177765 #line 3916 "parse.sql"
177766 break;
177767 case 32: /* ccons ::= CONSTRAINT nm */
177768 case 67: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==67);
177769 #line 369 "parse.y"
177770 {pParse->constraintName = yymsp[0].minor.yy0;}
177771 #line 3922 "parse.sql"
177772 break;
177773 case 33: /* ccons ::= DEFAULT scantok term */
177774 #line 371 "parse.y"
177775 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy454,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
177776 #line 3927 "parse.sql"
177777 break;
177778 case 34: /* ccons ::= DEFAULT LP expr RP */
177779 #line 373 "parse.y"
177780 {sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy454,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
177781 #line 3932 "parse.sql"
177782 break;
177783 case 35: /* ccons ::= DEFAULT PLUS scantok term */
177784 #line 375 "parse.y"
177785 {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy454,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
177786 #line 3937 "parse.sql"
177787 break;
177788 case 36: /* ccons ::= DEFAULT MINUS scantok term */
177789 #line 376 "parse.y"
177790 {
177791 Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy454, 0);
177792 sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);
177793 }
177794 #line 3945 "parse.sql"
177795 break;
177796 case 37: /* ccons ::= DEFAULT scantok ID|INDEXED */
177797 #line 380 "parse.y"
177798 {
177799 Expr *p = tokenExpr(pParse, TK_STRING, yymsp[0].minor.yy0);
177800 if( p ){
177801 sqlite3ExprIdToTrueFalse(p);
177802 testcase( p->op==TK_TRUEFALSE && sqlite3ExprTruthValue(p) );
177803 }
177804 sqlite3AddDefaultValue(pParse,p,yymsp[0].minor.yy0.z,yymsp[0].minor.yy0.z+yymsp[0].minor.yy0.n);
177805 }
177806 #line 3957 "parse.sql"
177807 break;
177808 case 38: /* ccons ::= NOT NULL onconf */
177809 #line 393 "parse.y"
177810 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy144);}
177811 #line 3962 "parse.sql"
177812 break;
177813 case 39: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
177814 #line 395 "parse.y"
177815 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy144,yymsp[0].minor.yy144,yymsp[-2].minor.yy144);}
177816 #line 3967 "parse.sql"
177817 break;
177818 case 40: /* ccons ::= UNIQUE onconf */
177819 #line 396 "parse.y"
177820 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy144,0,0,0,0,
177821 SQLITE_IDXTYPE_UNIQUE);}
177822 #line 3973 "parse.sql"
177823 break;
177824 case 41: /* ccons ::= CHECK LP expr RP */
177825 #line 398 "parse.y"
177826 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy454,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy0.z);}
177827 #line 3978 "parse.sql"
177828 break;
177829 case 42: /* ccons ::= REFERENCES nm eidlist_opt refargs */
177830 #line 400 "parse.y"
177831 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy14,yymsp[0].minor.yy144);}
177832 #line 3983 "parse.sql"
177833 break;
177834 case 43: /* ccons ::= defer_subclause */
177835 #line 401 "parse.y"
177836 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy144);}
177837 #line 3988 "parse.sql"
177838 break;
177839 case 44: /* ccons ::= COLLATE ID|STRING */
177840 #line 402 "parse.y"
177841 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
177842 #line 3993 "parse.sql"
177843 break;
177844 case 45: /* generated ::= LP expr RP */
177845 #line 405 "parse.y"
177846 {sqlite3AddGenerated(pParse,yymsp[-1].minor.yy454,0);}
177847 #line 3998 "parse.sql"
177848 break;
177849 case 46: /* generated ::= LP expr RP ID */
177850 #line 406 "parse.y"
177851 {sqlite3AddGenerated(pParse,yymsp[-2].minor.yy454,&yymsp[0].minor.yy0);}
177852 #line 4003 "parse.sql"
177853 break;
177854 case 48: /* autoinc ::= AUTOINCR */
177855 #line 411 "parse.y"
177856 {yymsp[0].minor.yy144 = 1;}
177857 #line 4008 "parse.sql"
177858 break;
177859 case 49: /* refargs ::= */
177860 #line 419 "parse.y"
177861 { yymsp[1].minor.yy144 = OE_None*0x0101; /* EV: R-19803-45884 */}
177862 #line 4013 "parse.sql"
177863 break;
177864 case 50: /* refargs ::= refargs refarg */
177865 #line 420 "parse.y"
177866 { yymsp[-1].minor.yy144 = (yymsp[-1].minor.yy144 & ~yymsp[0].minor.yy383.mask) | yymsp[0].minor.yy383.value; }
177867 #line 4018 "parse.sql"
177868 break;
177869 case 51: /* refarg ::= MATCH nm */
177870 #line 422 "parse.y"
177871 { yymsp[-1].minor.yy383.value = 0; yymsp[-1].minor.yy383.mask = 0x000000; }
177872 #line 4023 "parse.sql"
177873 break;
177874 case 52: /* refarg ::= ON INSERT refact */
177875 #line 423 "parse.y"
177876 { yymsp[-2].minor.yy383.value = 0; yymsp[-2].minor.yy383.mask = 0x000000; }
177877 #line 4028 "parse.sql"
177878 break;
177879 case 53: /* refarg ::= ON DELETE refact */
177880 #line 424 "parse.y"
177881 { yymsp[-2].minor.yy383.value = yymsp[0].minor.yy144; yymsp[-2].minor.yy383.mask = 0x0000ff; }
177882 #line 4033 "parse.sql"
177883 break;
177884 case 54: /* refarg ::= ON UPDATE refact */
177885 #line 425 "parse.y"
177886 { yymsp[-2].minor.yy383.value = yymsp[0].minor.yy144<<8; yymsp[-2].minor.yy383.mask = 0x00ff00; }
177887 #line 4038 "parse.sql"
177888 break;
177889 case 55: /* refact ::= SET NULL */
177890 #line 427 "parse.y"
177891 { yymsp[-1].minor.yy144 = OE_SetNull; /* EV: R-33326-45252 */}
177892 #line 4043 "parse.sql"
177893 break;
177894 case 56: /* refact ::= SET DEFAULT */
177895 #line 428 "parse.y"
177896 { yymsp[-1].minor.yy144 = OE_SetDflt; /* EV: R-33326-45252 */}
177897 #line 4048 "parse.sql"
177898 break;
177899 case 57: /* refact ::= CASCADE */
177900 #line 429 "parse.y"
177901 { yymsp[0].minor.yy144 = OE_Cascade; /* EV: R-33326-45252 */}
177902 #line 4053 "parse.sql"
177903 break;
177904 case 58: /* refact ::= RESTRICT */
177905 #line 430 "parse.y"
177906 { yymsp[0].minor.yy144 = OE_Restrict; /* EV: R-33326-45252 */}
177907 #line 4058 "parse.sql"
177908 break;
177909 case 59: /* refact ::= NO ACTION */
177910 #line 431 "parse.y"
177911 { yymsp[-1].minor.yy144 = OE_None; /* EV: R-33326-45252 */}
177912 #line 4063 "parse.sql"
177913 break;
177914 case 60: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
177915 #line 433 "parse.y"
177916 {yymsp[-2].minor.yy144 = 0;}
177917 #line 4068 "parse.sql"
177918 break;
177919 case 61: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
177920 case 76: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==76);
177921 case 173: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==173);
177922 #line 434 "parse.y"
177923 {yymsp[-1].minor.yy144 = yymsp[0].minor.yy144;}
177924 #line 4075 "parse.sql"
177925 break;
177926 case 63: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
177927 case 80: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==80);
177928 case 219: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==219);
177929 case 222: /* in_op ::= NOT IN */ yytestcase(yyruleno==222);
177930 case 247: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==247);
177931 #line 437 "parse.y"
177932 {yymsp[-1].minor.yy144 = 1;}
177933 #line 4084 "parse.sql"
177934 break;
177935 case 64: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
177936 #line 438 "parse.y"
177937 {yymsp[-1].minor.yy144 = 0;}
177938 #line 4089 "parse.sql"
177939 break;
177940 case 66: /* tconscomma ::= COMMA */
177941 #line 444 "parse.y"
177942 {pParse->constraintName.n = 0;}
177943 #line 4094 "parse.sql"
177944 break;
177945 case 68: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
177946 #line 448 "parse.y"
177947 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy14,yymsp[0].minor.yy144,yymsp[-2].minor.yy144,0);}
177948 #line 4099 "parse.sql"
177949 break;
177950 case 69: /* tcons ::= UNIQUE LP sortlist RP onconf */
177951 #line 450 "parse.y"
177952 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy14,yymsp[0].minor.yy144,0,0,0,0,
177953 SQLITE_IDXTYPE_UNIQUE);}
177954 #line 4105 "parse.sql"
177955 break;
177956 case 70: /* tcons ::= CHECK LP expr RP onconf */
177957 #line 453 "parse.y"
177958 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy454,yymsp[-3].minor.yy0.z,yymsp[-1].minor.yy0.z);}
177959 #line 4110 "parse.sql"
177960 break;
177961 case 71: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
177962 #line 455 "parse.y"
177963 {
177964 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy14, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy14, yymsp[-1].minor.yy144);
177965 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy144);
177966 }
177967 #line 4118 "parse.sql"
177968 break;
177969 case 73: /* onconf ::= */
177970 case 75: /* orconf ::= */ yytestcase(yyruleno==75);
177971 #line 469 "parse.y"
177972 {yymsp[1].minor.yy144 = OE_Default;}
177973 #line 4124 "parse.sql"
177974 break;
177975 case 74: /* onconf ::= ON CONFLICT resolvetype */
177976 #line 470 "parse.y"
177977 {yymsp[-2].minor.yy144 = yymsp[0].minor.yy144;}
177978 #line 4129 "parse.sql"
177979 break;
177980 case 77: /* resolvetype ::= IGNORE */
177981 #line 474 "parse.y"
177982 {yymsp[0].minor.yy144 = OE_Ignore;}
177983 #line 4134 "parse.sql"
177984 break;
177985 case 78: /* resolvetype ::= REPLACE */
177986 case 174: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==174);
177987 #line 475 "parse.y"
177988 {yymsp[0].minor.yy144 = OE_Replace;}
177989 #line 4140 "parse.sql"
177990 break;
177991 case 79: /* cmd ::= DROP TABLE ifexists fullname */
177992 #line 479 "parse.y"
177993 {
177994 sqlite3DropTable(pParse, yymsp[0].minor.yy203, 0, yymsp[-1].minor.yy144);
177995 }
177996 #line 4147 "parse.sql"
177997 break;
177998 case 82: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
177999 #line 490 "parse.y"
178000 {
178001 sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy14, yymsp[0].minor.yy555, yymsp[-7].minor.yy144, yymsp[-5].minor.yy144);
178002 }
178003 #line 4154 "parse.sql"
178004 break;
178005 case 83: /* cmd ::= DROP VIEW ifexists fullname */
178006 #line 493 "parse.y"
178007 {
178008 sqlite3DropTable(pParse, yymsp[0].minor.yy203, 1, yymsp[-1].minor.yy144);
178009 }
178010 #line 4161 "parse.sql"
178011 break;
178012 case 84: /* cmd ::= select */
178013 #line 500 "parse.y"
178014 {
178015 SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0, 0};
178016 if( (pParse->db->mDbFlags & DBFLAG_EncodingFixed)!=0
178017 || sqlite3ReadSchema(pParse)==SQLITE_OK
178018 ){
178019 sqlite3Select(pParse, yymsp[0].minor.yy555, &dest);
178020 }
178021 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy555);
178022 }
178023 #line 4174 "parse.sql"
178024 break;
178025 case 85: /* select ::= WITH wqlist selectnowith */
178026 #line 574 "parse.y"
178027 {yymsp[-2].minor.yy555 = attachWithToSelect(pParse,yymsp[0].minor.yy555,yymsp[-1].minor.yy59);}
178028 #line 4179 "parse.sql"
178029 break;
178030 case 86: /* select ::= WITH RECURSIVE wqlist selectnowith */
178031 #line 576 "parse.y"
178032 {yymsp[-3].minor.yy555 = attachWithToSelect(pParse,yymsp[0].minor.yy555,yymsp[-1].minor.yy59);}
178033 #line 4184 "parse.sql"
178034 break;
178035 case 87: /* select ::= selectnowith */
178036 #line 579 "parse.y"
178037 {
178038 Select *p = yymsp[0].minor.yy555;
178039 if( p ){
178040 parserDoubleLinkSelect(pParse, p);
178041 }
178042 }
178043 #line 4194 "parse.sql"
178044 break;
178045 case 88: /* selectnowith ::= selectnowith multiselect_op oneselect */
178046 #line 588 "parse.y"
178047 {
178048 Select *pRhs = yymsp[0].minor.yy555;
178049 Select *pLhs = yymsp[-2].minor.yy555;
178050 if( pRhs && pRhs->pPrior ){
178051 SrcList *pFrom;
@@ -177771,131 +178064,175 @@
178064 }else{
178065 sqlite3SelectDelete(pParse->db, pLhs);
178066 }
178067 yymsp[-2].minor.yy555 = pRhs;
178068 }
178069 #line 4220 "parse.sql"
178070 break;
178071 case 89: /* multiselect_op ::= UNION */
178072 case 91: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==91);
178073 #line 611 "parse.y"
178074 {yymsp[0].minor.yy144 = yymsp[0].major; /*A-overwrites-OP*/}
178075 #line 4226 "parse.sql"
178076 break;
178077 case 90: /* multiselect_op ::= UNION ALL */
178078 #line 612 "parse.y"
178079 {yymsp[-1].minor.yy144 = TK_ALL;}
178080 #line 4231 "parse.sql"
178081 break;
178082 case 92: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
178083 #line 618 "parse.y"
178084 {
178085 yymsp[-8].minor.yy555 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy14,yymsp[-5].minor.yy203,yymsp[-4].minor.yy454,yymsp[-3].minor.yy14,yymsp[-2].minor.yy454,yymsp[-1].minor.yy14,yymsp[-7].minor.yy144,yymsp[0].minor.yy454);
178086 }
178087 #line 4238 "parse.sql"
178088 break;
178089 case 93: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
178090 #line 624 "parse.y"
178091 {
178092 yymsp[-9].minor.yy555 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy14,yymsp[-6].minor.yy203,yymsp[-5].minor.yy454,yymsp[-4].minor.yy14,yymsp[-3].minor.yy454,yymsp[-1].minor.yy14,yymsp[-8].minor.yy144,yymsp[0].minor.yy454);
178093 if( yymsp[-9].minor.yy555 ){
178094 yymsp[-9].minor.yy555->pWinDefn = yymsp[-2].minor.yy211;
178095 }else{
178096 sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy211);
178097 }
178098 }
178099 #line 4250 "parse.sql"
178100 break;
178101 case 94: /* values ::= VALUES LP nexprlist RP */
178102 #line 640 "parse.y"
178103 {
178104 yymsp[-3].minor.yy555 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy14,0,0,0,0,0,SF_Values,0);
178105 }
178106 #line 4257 "parse.sql"
178107 break;
178108 case 95: /* oneselect ::= mvalues */
178109 #line 647 "parse.y"
178110 {
178111 sqlite3MultiValuesEnd(pParse, yymsp[0].minor.yy555);
178112 }
178113 #line 4264 "parse.sql"
178114 break;
178115 case 96: /* mvalues ::= values COMMA LP nexprlist RP */
178116 case 97: /* mvalues ::= mvalues COMMA LP nexprlist RP */ yytestcase(yyruleno==97);
178117 #line 651 "parse.y"
178118 {
178119 yymsp[-4].minor.yy555 = sqlite3MultiValues(pParse, yymsp[-4].minor.yy555, yymsp[-1].minor.yy14);
178120 }
178121 #line 4272 "parse.sql"
178122 break;
178123 case 98: /* distinct ::= DISTINCT */
178124 #line 662 "parse.y"
178125 {yymsp[0].minor.yy144 = SF_Distinct;}
178126 #line 4277 "parse.sql"
178127 break;
178128 case 99: /* distinct ::= ALL */
178129 #line 663 "parse.y"
178130 {yymsp[0].minor.yy144 = SF_All;}
178131 #line 4282 "parse.sql"
178132 break;
178133 case 101: /* sclp ::= */
178134 case 134: /* orderby_opt ::= */ yytestcase(yyruleno==134);
178135 case 144: /* groupby_opt ::= */ yytestcase(yyruleno==144);
178136 case 234: /* exprlist ::= */ yytestcase(yyruleno==234);
178137 case 237: /* paren_exprlist ::= */ yytestcase(yyruleno==237);
178138 case 242: /* eidlist_opt ::= */ yytestcase(yyruleno==242);
178139 #line 676 "parse.y"
178140 {yymsp[1].minor.yy14 = 0;}
178141 #line 4292 "parse.sql"
178142 break;
178143 case 102: /* selcollist ::= sclp scanpt expr scanpt as */
178144 #line 677 "parse.y"
178145 {
178146 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy14, yymsp[-2].minor.yy454);
178147 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy14, &yymsp[0].minor.yy0, 1);
178148 sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy14,yymsp[-3].minor.yy168,yymsp[-1].minor.yy168);
178149 }
178150 #line 4301 "parse.sql"
178151 break;
178152 case 103: /* selcollist ::= sclp scanpt STAR */
178153 #line 682 "parse.y"
178154 {
178155 Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
178156 sqlite3ExprSetErrorOffset(p, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
178157 yymsp[-2].minor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy14, p);
178158 }
178159 #line 4310 "parse.sql"
178160 break;
178161 case 104: /* selcollist ::= sclp scanpt nm DOT STAR */
178162 #line 687 "parse.y"
178163 {
178164 Expr *pRight, *pLeft, *pDot;
178165 pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
178166 sqlite3ExprSetErrorOffset(pRight, (int)(yymsp[0].minor.yy0.z - pParse->zTail));
178167 pLeft = tokenExpr(pParse, TK_ID, yymsp[-2].minor.yy0);
178168 pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
178169 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, pDot);
178170 }
178171 #line 4322 "parse.sql"
178172 break;
178173 case 105: /* as ::= AS nm */
178174 case 117: /* dbnm ::= DOT nm */ yytestcase(yyruleno==117);
178175 case 258: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==258);
178176 case 259: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==259);
178177 #line 700 "parse.y"
178178 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
178179 #line 4330 "parse.sql"
178180 break;
178181 case 107: /* from ::= */
178182 case 110: /* stl_prefix ::= */ yytestcase(yyruleno==110);
178183 #line 714 "parse.y"
178184 {yymsp[1].minor.yy203 = 0;}
178185 #line 4336 "parse.sql"
178186 break;
178187 case 108: /* from ::= FROM seltablist */
178188 #line 715 "parse.y"
178189 {
178190 yymsp[-1].minor.yy203 = yymsp[0].minor.yy203;
178191 sqlite3SrcListShiftJoinType(pParse,yymsp[-1].minor.yy203);
178192 }
178193 #line 4344 "parse.sql"
178194 break;
178195 case 109: /* stl_prefix ::= seltablist joinop */
178196 #line 723 "parse.y"
178197 {
178198 if( ALWAYS(yymsp[-1].minor.yy203 && yymsp[-1].minor.yy203->nSrc>0) ) yymsp[-1].minor.yy203->a[yymsp[-1].minor.yy203->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy144;
178199 }
178200 #line 4351 "parse.sql"
178201 break;
178202 case 111: /* seltablist ::= stl_prefix nm dbnm as on_using */
178203 #line 727 "parse.y"
178204 {
178205 yymsp[-4].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-4].minor.yy203,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy269);
178206 }
178207 #line 4358 "parse.sql"
178208 break;
178209 case 112: /* seltablist ::= stl_prefix nm dbnm as indexed_by on_using */
178210 #line 730 "parse.y"
178211 {
178212 yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,0,&yymsp[0].minor.yy269);
178213 sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy203, &yymsp[-1].minor.yy0);
178214 }
178215 #line 4366 "parse.sql"
178216 break;
178217 case 113: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_using */
178218 #line 734 "parse.y"
178219 {
178220 yymsp[-7].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-7].minor.yy203,&yymsp[-6].minor.yy0,&yymsp[-5].minor.yy0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy269);
178221 sqlite3SrcListFuncArgs(pParse, yymsp[-7].minor.yy203, yymsp[-3].minor.yy14);
178222 }
178223 #line 4374 "parse.sql"
178224 break;
178225 case 114: /* seltablist ::= stl_prefix LP select RP as on_using */
178226 #line 739 "parse.y"
178227 {
178228 yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,0,0,&yymsp[-1].minor.yy0,yymsp[-3].minor.yy555,&yymsp[0].minor.yy269);
178229 }
178230 #line 4381 "parse.sql"
178231 break;
178232 case 115: /* seltablist ::= stl_prefix LP seltablist RP as on_using */
178233 #line 742 "parse.y"
178234 {
178235 if( yymsp[-5].minor.yy203==0 && yymsp[-1].minor.yy0.n==0 && yymsp[0].minor.yy269.pOn==0 && yymsp[0].minor.yy269.pUsing==0 ){
178236 yymsp[-5].minor.yy203 = yymsp[-3].minor.yy203;
178237 }else if( ALWAYS(yymsp[-3].minor.yy203!=0) && yymsp[-3].minor.yy203->nSrc==1 ){
178238 yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,0,0,&yymsp[-1].minor.yy0,0,&yymsp[0].minor.yy269);
@@ -177932,144 +178269,210 @@
178269 sqlite3SrcListShiftJoinType(pParse,yymsp[-3].minor.yy203);
178270 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-3].minor.yy203,0,0,0,0,SF_NestedFrom,0);
178271 yymsp[-5].minor.yy203 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-5].minor.yy203,0,0,&yymsp[-1].minor.yy0,pSubquery,&yymsp[0].minor.yy269);
178272 }
178273 }
178274 #line 4425 "parse.sql"
178275 break;
178276 case 116: /* dbnm ::= */
178277 case 131: /* indexed_opt ::= */ yytestcase(yyruleno==131);
178278 #line 785 "parse.y"
178279 {yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
178280 #line 4431 "parse.sql"
178281 break;
178282 case 118: /* fullname ::= nm */
178283 #line 790 "parse.y"
178284 {
178285 yylhsminor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
178286 if( IN_RENAME_OBJECT && yylhsminor.yy203 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy203->a[0].zName, &yymsp[0].minor.yy0);
178287 }
178288 #line 4439 "parse.sql"
178289 yymsp[0].minor.yy203 = yylhsminor.yy203;
178290 break;
178291 case 119: /* fullname ::= nm DOT nm */
178292 #line 794 "parse.y"
178293 {
178294 yylhsminor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
178295 if( IN_RENAME_OBJECT && yylhsminor.yy203 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy203->a[0].zName, &yymsp[0].minor.yy0);
178296 }
178297 #line 4448 "parse.sql"
178298 yymsp[-2].minor.yy203 = yylhsminor.yy203;
178299 break;
178300 case 120: /* xfullname ::= nm */
178301 #line 802 "parse.y"
178302 {yymsp[0].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
178303 #line 4454 "parse.sql"
178304 break;
178305 case 121: /* xfullname ::= nm DOT nm */
178306 #line 804 "parse.y"
178307 {yymsp[-2].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
178308 #line 4459 "parse.sql"
178309 break;
178310 case 122: /* xfullname ::= nm DOT nm AS nm */
178311 #line 805 "parse.y"
178312 {
178313 yymsp[-4].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
178314 if( yymsp[-4].minor.yy203 ) yymsp[-4].minor.yy203->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
178315 }
178316 #line 4467 "parse.sql"
178317 break;
178318 case 123: /* xfullname ::= nm AS nm */
178319 #line 809 "parse.y"
178320 {
178321 yymsp[-2].minor.yy203 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
178322 if( yymsp[-2].minor.yy203 ) yymsp[-2].minor.yy203->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
178323 }
178324 #line 4475 "parse.sql"
178325 break;
178326 case 124: /* joinop ::= COMMA|JOIN */
178327 #line 815 "parse.y"
178328 { yymsp[0].minor.yy144 = JT_INNER; }
178329 #line 4480 "parse.sql"
178330 break;
178331 case 125: /* joinop ::= JOIN_KW JOIN */
178332 #line 817 "parse.y"
178333 {yymsp[-1].minor.yy144 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
178334 #line 4485 "parse.sql"
178335 break;
178336 case 126: /* joinop ::= JOIN_KW nm JOIN */
178337 #line 819 "parse.y"
178338 {yymsp[-2].minor.yy144 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
178339 #line 4490 "parse.sql"
178340 break;
178341 case 127: /* joinop ::= JOIN_KW nm nm JOIN */
178342 #line 821 "parse.y"
178343 {yymsp[-3].minor.yy144 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
178344 #line 4495 "parse.sql"
178345 break;
178346 case 128: /* on_using ::= ON expr */
178347 #line 842 "parse.y"
178348 {yymsp[-1].minor.yy269.pOn = yymsp[0].minor.yy454; yymsp[-1].minor.yy269.pUsing = 0;}
178349 #line 4500 "parse.sql"
178350 break;
178351 case 129: /* on_using ::= USING LP idlist RP */
178352 #line 843 "parse.y"
178353 {yymsp[-3].minor.yy269.pOn = 0; yymsp[-3].minor.yy269.pUsing = yymsp[-1].minor.yy132;}
178354 #line 4505 "parse.sql"
178355 break;
178356 case 130: /* on_using ::= */
178357 #line 844 "parse.y"
178358 {yymsp[1].minor.yy269.pOn = 0; yymsp[1].minor.yy269.pUsing = 0;}
178359 #line 4510 "parse.sql"
178360 break;
178361 case 132: /* indexed_by ::= INDEXED BY nm */
178362 #line 860 "parse.y"
178363 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
178364 #line 4515 "parse.sql"
178365 break;
178366 case 133: /* indexed_by ::= NOT INDEXED */
178367 #line 861 "parse.y"
178368 {yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
178369 #line 4520 "parse.sql"
178370 break;
178371 case 135: /* orderby_opt ::= ORDER BY sortlist */
178372 case 145: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==145);
178373 #line 874 "parse.y"
178374 {yymsp[-2].minor.yy14 = yymsp[0].minor.yy14;}
178375 #line 4526 "parse.sql"
178376 break;
178377 case 136: /* sortlist ::= sortlist COMMA expr sortorder nulls */
178378 #line 875 "parse.y"
178379 {
178380 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14,yymsp[-2].minor.yy454);
178381 sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy14,yymsp[-1].minor.yy144,yymsp[0].minor.yy144);
178382 }
178383 #line 4534 "parse.sql"
178384 break;
178385 case 137: /* sortlist ::= expr sortorder nulls */
178386 #line 879 "parse.y"
178387 {
178388 yymsp[-2].minor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy454); /*A-overwrites-Y*/
178389 sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy14,yymsp[-1].minor.yy144,yymsp[0].minor.yy144);
178390 }
178391 #line 4542 "parse.sql"
178392 break;
178393 case 138: /* sortorder ::= ASC */
178394 #line 886 "parse.y"
178395 {yymsp[0].minor.yy144 = SQLITE_SO_ASC;}
178396 #line 4547 "parse.sql"
178397 break;
178398 case 139: /* sortorder ::= DESC */
178399 #line 887 "parse.y"
178400 {yymsp[0].minor.yy144 = SQLITE_SO_DESC;}
178401 #line 4552 "parse.sql"
178402 break;
178403 case 140: /* sortorder ::= */
178404 case 143: /* nulls ::= */ yytestcase(yyruleno==143);
178405 #line 888 "parse.y"
178406 {yymsp[1].minor.yy144 = SQLITE_SO_UNDEFINED;}
178407 #line 4558 "parse.sql"
178408 break;
178409 case 141: /* nulls ::= NULLS FIRST */
178410 #line 891 "parse.y"
178411 {yymsp[-1].minor.yy144 = SQLITE_SO_ASC;}
178412 #line 4563 "parse.sql"
178413 break;
178414 case 142: /* nulls ::= NULLS LAST */
178415 #line 892 "parse.y"
178416 {yymsp[-1].minor.yy144 = SQLITE_SO_DESC;}
178417 #line 4568 "parse.sql"
178418 break;
178419 case 146: /* having_opt ::= */
178420 case 148: /* limit_opt ::= */ yytestcase(yyruleno==148);
178421 case 153: /* where_opt ::= */ yytestcase(yyruleno==153);
178422 case 155: /* where_opt_ret ::= */ yytestcase(yyruleno==155);
178423 case 232: /* case_else ::= */ yytestcase(yyruleno==232);
178424 case 233: /* case_operand ::= */ yytestcase(yyruleno==233);
178425 case 252: /* vinto ::= */ yytestcase(yyruleno==252);
178426 #line 902 "parse.y"
178427 {yymsp[1].minor.yy454 = 0;}
178428 #line 4579 "parse.sql"
178429 break;
178430 case 147: /* having_opt ::= HAVING expr */
178431 case 154: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==154);
178432 case 156: /* where_opt_ret ::= WHERE expr */ yytestcase(yyruleno==156);
178433 case 231: /* case_else ::= ELSE expr */ yytestcase(yyruleno==231);
178434 case 251: /* vinto ::= INTO expr */ yytestcase(yyruleno==251);
178435 #line 903 "parse.y"
178436 {yymsp[-1].minor.yy454 = yymsp[0].minor.yy454;}
178437 #line 4588 "parse.sql"
178438 break;
178439 case 149: /* limit_opt ::= LIMIT expr */
178440 #line 917 "parse.y"
178441 {yymsp[-1].minor.yy454 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy454,0);}
178442 #line 4593 "parse.sql"
178443 break;
178444 case 150: /* limit_opt ::= LIMIT expr OFFSET expr */
178445 #line 919 "parse.y"
178446 {yymsp[-3].minor.yy454 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);}
178447 #line 4598 "parse.sql"
178448 break;
178449 case 151: /* limit_opt ::= LIMIT expr COMMA expr */
178450 #line 921 "parse.y"
178451 {yymsp[-3].minor.yy454 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy454,yymsp[-2].minor.yy454);}
178452 #line 4603 "parse.sql"
178453 break;
178454 case 152: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt_ret */
178455 #line 939 "parse.y"
178456 {
178457 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy203, &yymsp[-1].minor.yy0);
178458 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy203,yymsp[0].minor.yy454,0,0);
178459 }
178460 #line 4611 "parse.sql"
178461 break;
178462 case 157: /* where_opt_ret ::= RETURNING selcollist */
178463 #line 955 "parse.y"
178464 {sqlite3AddReturning(pParse,yymsp[0].minor.yy14); yymsp[-1].minor.yy454 = 0;}
178465 #line 4616 "parse.sql"
178466 break;
178467 case 158: /* where_opt_ret ::= WHERE expr RETURNING selcollist */
178468 #line 957 "parse.y"
178469 {sqlite3AddReturning(pParse,yymsp[0].minor.yy14); yymsp[-3].minor.yy454 = yymsp[-2].minor.yy454;}
178470 #line 4621 "parse.sql"
178471 break;
178472 case 159: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */
178473 #line 989 "parse.y"
178474 {
178475 sqlite3SrcListIndexedBy(pParse, yymsp[-5].minor.yy203, &yymsp[-4].minor.yy0);
178476 sqlite3ExprListCheckLength(pParse,yymsp[-2].minor.yy14,"set list");
178477 if( yymsp[-1].minor.yy203 ){
178478 SrcList *pFromClause = yymsp[-1].minor.yy203;
@@ -178083,92 +178486,134 @@
178486 }
178487 yymsp[-5].minor.yy203 = sqlite3SrcListAppendList(pParse, yymsp[-5].minor.yy203, pFromClause);
178488 }
178489 sqlite3Update(pParse,yymsp[-5].minor.yy203,yymsp[-2].minor.yy14,yymsp[0].minor.yy454,yymsp[-6].minor.yy144,0,0,0);
178490 }
178491 #line 4642 "parse.sql"
178492 break;
178493 case 160: /* setlist ::= setlist COMMA nm EQ expr */
178494 #line 1013 "parse.y"
178495 {
178496 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy14, yymsp[0].minor.yy454);
178497 sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy14, &yymsp[-2].minor.yy0, 1);
178498 }
178499 #line 4650 "parse.sql"
178500 break;
178501 case 161: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
178502 #line 1017 "parse.y"
178503 {
178504 yymsp[-6].minor.yy14 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy14, yymsp[-3].minor.yy132, yymsp[0].minor.yy454);
178505 }
178506 #line 4657 "parse.sql"
178507 break;
178508 case 162: /* setlist ::= nm EQ expr */
178509 #line 1020 "parse.y"
178510 {
178511 yylhsminor.yy14 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy454);
178512 sqlite3ExprListSetName(pParse, yylhsminor.yy14, &yymsp[-2].minor.yy0, 1);
178513 }
178514 #line 4665 "parse.sql"
178515 yymsp[-2].minor.yy14 = yylhsminor.yy14;
178516 break;
178517 case 163: /* setlist ::= LP idlist RP EQ expr */
178518 #line 1024 "parse.y"
178519 {
178520 yymsp[-4].minor.yy14 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy132, yymsp[0].minor.yy454);
178521 }
178522 #line 4673 "parse.sql"
178523 break;
178524 case 164: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
178525 #line 1031 "parse.y"
178526 {
178527 sqlite3Insert(pParse, yymsp[-3].minor.yy203, yymsp[-1].minor.yy555, yymsp[-2].minor.yy132, yymsp[-5].minor.yy144, yymsp[0].minor.yy122);
178528 }
178529 #line 4680 "parse.sql"
178530 break;
178531 case 165: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES returning */
178532 #line 1035 "parse.y"
178533 {
178534 sqlite3Insert(pParse, yymsp[-4].minor.yy203, 0, yymsp[-3].minor.yy132, yymsp[-6].minor.yy144, 0);
178535 }
178536 #line 4687 "parse.sql"
178537 break;
178538 case 166: /* upsert ::= */
178539 #line 1046 "parse.y"
178540 { yymsp[1].minor.yy122 = 0; }
178541 #line 4692 "parse.sql"
178542 break;
178543 case 167: /* upsert ::= RETURNING selcollist */
178544 #line 1047 "parse.y"
178545 { yymsp[-1].minor.yy122 = 0; sqlite3AddReturning(pParse,yymsp[0].minor.yy14); }
178546 #line 4697 "parse.sql"
178547 break;
178548 case 168: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt upsert */
178549 #line 1050 "parse.y"
178550 { yymsp[-11].minor.yy122 = sqlite3UpsertNew(pParse->db,yymsp[-8].minor.yy14,yymsp[-6].minor.yy454,yymsp[-2].minor.yy14,yymsp[-1].minor.yy454,yymsp[0].minor.yy122);}
178551 #line 4702 "parse.sql"
178552 break;
178553 case 169: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING upsert */
178554 #line 1052 "parse.y"
178555 { yymsp[-8].minor.yy122 = sqlite3UpsertNew(pParse->db,yymsp[-5].minor.yy14,yymsp[-3].minor.yy454,0,0,yymsp[0].minor.yy122); }
178556 #line 4707 "parse.sql"
178557 break;
178558 case 170: /* upsert ::= ON CONFLICT DO NOTHING returning */
178559 #line 1054 "parse.y"
178560 { yymsp[-4].minor.yy122 = sqlite3UpsertNew(pParse->db,0,0,0,0,0); }
178561 #line 4712 "parse.sql"
178562 break;
178563 case 171: /* upsert ::= ON CONFLICT DO UPDATE SET setlist where_opt returning */
178564 #line 1056 "parse.y"
178565 { yymsp[-7].minor.yy122 = sqlite3UpsertNew(pParse->db,0,0,yymsp[-2].minor.yy14,yymsp[-1].minor.yy454,0);}
178566 #line 4717 "parse.sql"
178567 break;
178568 case 172: /* returning ::= RETURNING selcollist */
178569 #line 1058 "parse.y"
178570 {sqlite3AddReturning(pParse,yymsp[0].minor.yy14);}
178571 #line 4722 "parse.sql"
178572 break;
178573 case 175: /* idlist_opt ::= */
178574 #line 1070 "parse.y"
178575 {yymsp[1].minor.yy132 = 0;}
178576 #line 4727 "parse.sql"
178577 break;
178578 case 176: /* idlist_opt ::= LP idlist RP */
178579 #line 1071 "parse.y"
178580 {yymsp[-2].minor.yy132 = yymsp[-1].minor.yy132;}
178581 #line 4732 "parse.sql"
178582 break;
178583 case 177: /* idlist ::= idlist COMMA nm */
178584 #line 1073 "parse.y"
178585 {yymsp[-2].minor.yy132 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy132,&yymsp[0].minor.yy0);}
178586 #line 4737 "parse.sql"
178587 break;
178588 case 178: /* idlist ::= nm */
178589 #line 1075 "parse.y"
178590 {yymsp[0].minor.yy132 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
178591 #line 4742 "parse.sql"
178592 break;
178593 case 179: /* expr ::= LP expr RP */
178594 #line 1124 "parse.y"
178595 {yymsp[-2].minor.yy454 = yymsp[-1].minor.yy454;}
178596 #line 4747 "parse.sql"
178597 break;
178598 case 180: /* expr ::= ID|INDEXED|JOIN_KW */
178599 #line 1125 "parse.y"
178600 {yymsp[0].minor.yy454=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
178601 #line 4752 "parse.sql"
178602 break;
178603 case 181: /* expr ::= nm DOT nm */
178604 #line 1126 "parse.y"
178605 {
178606 Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
178607 Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
178608 yylhsminor.yy454 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
178609 }
178610 #line 4761 "parse.sql"
178611 yymsp[-2].minor.yy454 = yylhsminor.yy454;
178612 break;
178613 case 182: /* expr ::= nm DOT nm DOT nm */
178614 #line 1131 "parse.y"
178615 {
178616 Expr *temp1 = tokenExpr(pParse,TK_ID,yymsp[-4].minor.yy0);
178617 Expr *temp2 = tokenExpr(pParse,TK_ID,yymsp[-2].minor.yy0);
178618 Expr *temp3 = tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0);
178619 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
@@ -178175,24 +178620,30 @@
178620 if( IN_RENAME_OBJECT ){
178621 sqlite3RenameTokenRemap(pParse, 0, temp1);
178622 }
178623 yylhsminor.yy454 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
178624 }
178625 #line 4776 "parse.sql"
178626 yymsp[-4].minor.yy454 = yylhsminor.yy454;
178627 break;
178628 case 183: /* term ::= NULL|FLOAT|BLOB */
178629 case 184: /* term ::= STRING */ yytestcase(yyruleno==184);
178630 #line 1141 "parse.y"
178631 {yymsp[0].minor.yy454=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
178632 #line 4783 "parse.sql"
178633 break;
178634 case 185: /* term ::= INTEGER */
178635 #line 1143 "parse.y"
178636 {
178637 yylhsminor.yy454 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
178638 if( yylhsminor.yy454 ) yylhsminor.yy454->w.iOfst = (int)(yymsp[0].minor.yy0.z - pParse->zTail);
178639 }
178640 #line 4791 "parse.sql"
178641 yymsp[0].minor.yy454 = yylhsminor.yy454;
178642 break;
178643 case 186: /* expr ::= VARIABLE */
178644 #line 1147 "parse.y"
178645 {
178646 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
178647 u32 n = yymsp[0].minor.yy0.n;
178648 yymsp[0].minor.yy454 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
178649 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy454, n);
@@ -178209,70 +178660,90 @@
178660 yymsp[0].minor.yy454 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
178661 if( yymsp[0].minor.yy454 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy454->iTable);
178662 }
178663 }
178664 }
178665 #line 4816 "parse.sql"
178666 break;
178667 case 187: /* expr ::= expr COLLATE ID|STRING */
178668 #line 1167 "parse.y"
178669 {
178670 yymsp[-2].minor.yy454 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy454, &yymsp[0].minor.yy0, 1);
178671 }
178672 #line 4823 "parse.sql"
178673 break;
178674 case 188: /* expr ::= CAST LP expr AS typetoken RP */
178675 #line 1171 "parse.y"
178676 {
178677 yymsp[-5].minor.yy454 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
178678 sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy454, yymsp[-3].minor.yy454, 0);
178679 }
178680 #line 4831 "parse.sql"
178681 break;
178682 case 189: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
178683 #line 1178 "parse.y"
178684 {
178685 yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy14, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy144);
178686 }
178687 #line 4838 "parse.sql"
178688 yymsp[-4].minor.yy454 = yylhsminor.yy454;
178689 break;
178690 case 190: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
178691 #line 1181 "parse.y"
178692 {
178693 yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-4].minor.yy14, &yymsp[-7].minor.yy0, yymsp[-5].minor.yy144);
178694 sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy454, yymsp[-1].minor.yy14);
178695 }
178696 #line 4847 "parse.sql"
178697 yymsp[-7].minor.yy454 = yylhsminor.yy454;
178698 break;
178699 case 191: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP */
178700 #line 1185 "parse.y"
178701 {
178702 yylhsminor.yy454 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
178703 }
178704 #line 4855 "parse.sql"
178705 yymsp[-3].minor.yy454 = yylhsminor.yy454;
178706 break;
178707 case 192: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
178708 #line 1249 "parse.y"
178709 {
178710 yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy14, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy144);
178711 sqlite3WindowAttach(pParse, yylhsminor.yy454, yymsp[0].minor.yy211);
178712 }
178713 #line 4864 "parse.sql"
178714 yymsp[-5].minor.yy454 = yylhsminor.yy454;
178715 break;
178716 case 193: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
178717 #line 1253 "parse.y"
178718 {
178719 yylhsminor.yy454 = sqlite3ExprFunction(pParse, yymsp[-5].minor.yy14, &yymsp[-8].minor.yy0, yymsp[-6].minor.yy144);
178720 sqlite3WindowAttach(pParse, yylhsminor.yy454, yymsp[0].minor.yy211);
178721 sqlite3ExprAddFunctionOrderBy(pParse, yylhsminor.yy454, yymsp[-2].minor.yy14);
178722 }
178723 #line 4874 "parse.sql"
178724 yymsp[-8].minor.yy454 = yylhsminor.yy454;
178725 break;
178726 case 194: /* expr ::= ID|INDEXED|JOIN_KW LP STAR RP filter_over */
178727 #line 1258 "parse.y"
178728 {
178729 yylhsminor.yy454 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
178730 sqlite3WindowAttach(pParse, yylhsminor.yy454, yymsp[0].minor.yy211);
178731 }
178732 #line 4883 "parse.sql"
178733 yymsp[-4].minor.yy454 = yylhsminor.yy454;
178734 break;
178735 case 195: /* term ::= CTIME_KW */
178736 #line 1272 "parse.y"
178737 {
178738 yylhsminor.yy454 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
178739 }
178740 #line 4891 "parse.sql"
178741 yymsp[0].minor.yy454 = yylhsminor.yy454;
178742 break;
178743 case 196: /* expr ::= LP nexprlist COMMA expr RP */
178744 #line 1276 "parse.y"
178745 {
178746 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy14, yymsp[-1].minor.yy454);
178747 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
178748 if( yymsp[-4].minor.yy454 ){
178749 yymsp[-4].minor.yy454->x.pList = pList;
@@ -178281,27 +178752,35 @@
178752 }
178753 }else{
178754 sqlite3ExprListDelete(pParse->db, pList);
178755 }
178756 }
178757 #line 4908 "parse.sql"
178758 break;
178759 case 197: /* expr ::= expr AND expr */
178760 #line 1289 "parse.y"
178761 {yymsp[-2].minor.yy454=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);}
178762 #line 4913 "parse.sql"
178763 break;
178764 case 198: /* expr ::= expr OR expr */
178765 case 199: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==199);
178766 case 200: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==200);
178767 case 201: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==201);
178768 case 202: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==202);
178769 case 203: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==203);
178770 case 204: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==204);
178771 #line 1290 "parse.y"
178772 {yymsp[-2].minor.yy454=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);}
178773 #line 4924 "parse.sql"
178774 break;
178775 case 205: /* likeop ::= NOT LIKE_KW|MATCH */
178776 #line 1303 "parse.y"
178777 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
178778 #line 4929 "parse.sql"
178779 break;
178780 case 206: /* expr ::= expr likeop expr */
178781 #line 1304 "parse.y"
178782 {
178783 ExprList *pList;
178784 int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
178785 yymsp[-1].minor.yy0.n &= 0x7fffffff;
178786 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy454);
@@ -178308,12 +178787,14 @@
178787 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy454);
178788 yymsp[-2].minor.yy454 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
178789 if( bNot ) yymsp[-2].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy454, 0);
178790 if( yymsp[-2].minor.yy454 ) yymsp[-2].minor.yy454->flags |= EP_InfixFunc;
178791 }
178792 #line 4943 "parse.sql"
178793 break;
178794 case 207: /* expr ::= expr likeop expr ESCAPE expr */
178795 #line 1314 "parse.y"
178796 {
178797 ExprList *pList;
178798 int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
178799 yymsp[-3].minor.yy0.n &= 0x7fffffff;
178800 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy454);
@@ -178321,46 +178802,62 @@
178802 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy454);
178803 yymsp[-4].minor.yy454 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
178804 if( bNot ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178805 if( yymsp[-4].minor.yy454 ) yymsp[-4].minor.yy454->flags |= EP_InfixFunc;
178806 }
178807 #line 4958 "parse.sql"
178808 break;
178809 case 208: /* expr ::= expr ISNULL|NOTNULL */
178810 #line 1326 "parse.y"
178811 {yymsp[-1].minor.yy454 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy454,0);}
178812 #line 4963 "parse.sql"
178813 break;
178814 case 209: /* expr ::= expr NOT NULL */
178815 #line 1327 "parse.y"
178816 {yymsp[-2].minor.yy454 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy454,0);}
178817 #line 4968 "parse.sql"
178818 break;
178819 case 210: /* expr ::= expr IS expr */
178820 #line 1348 "parse.y"
178821 {
178822 yymsp[-2].minor.yy454 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy454,yymsp[0].minor.yy454);
178823 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-2].minor.yy454, TK_ISNULL);
178824 }
178825 #line 4976 "parse.sql"
178826 break;
178827 case 211: /* expr ::= expr IS NOT expr */
178828 #line 1352 "parse.y"
178829 {
178830 yymsp[-3].minor.yy454 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy454,yymsp[0].minor.yy454);
178831 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-3].minor.yy454, TK_NOTNULL);
178832 }
178833 #line 4984 "parse.sql"
178834 break;
178835 case 212: /* expr ::= expr IS NOT DISTINCT FROM expr */
178836 #line 1356 "parse.y"
178837 {
178838 yymsp[-5].minor.yy454 = sqlite3PExpr(pParse,TK_IS,yymsp[-5].minor.yy454,yymsp[0].minor.yy454);
178839 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-5].minor.yy454, TK_ISNULL);
178840 }
178841 #line 4992 "parse.sql"
178842 break;
178843 case 213: /* expr ::= expr IS DISTINCT FROM expr */
178844 #line 1360 "parse.y"
178845 {
178846 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-4].minor.yy454,yymsp[0].minor.yy454);
178847 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy454, yymsp[-4].minor.yy454, TK_NOTNULL);
178848 }
178849 #line 5000 "parse.sql"
178850 break;
178851 case 214: /* expr ::= NOT expr */
178852 case 215: /* expr ::= BITNOT expr */ yytestcase(yyruleno==215);
178853 #line 1366 "parse.y"
178854 {yymsp[-1].minor.yy454 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy454, 0);/*A-overwrites-B*/}
178855 #line 5006 "parse.sql"
178856 break;
178857 case 216: /* expr ::= PLUS|MINUS expr */
178858 #line 1369 "parse.y"
178859 {
178860 Expr *p = yymsp[0].minor.yy454;
178861 u8 op = yymsp[-1].major + (TK_UPLUS-TK_PLUS);
178862 assert( TK_UPLUS>TK_PLUS );
178863 assert( TK_UMINUS == TK_MINUS + (TK_UPLUS - TK_PLUS) );
@@ -178370,24 +178867,30 @@
178867 }else{
178868 yymsp[-1].minor.yy454 = sqlite3PExpr(pParse, op, p, 0);
178869 /*A-overwrites-B*/
178870 }
178871 }
178872 #line 5023 "parse.sql"
178873 break;
178874 case 217: /* expr ::= expr PTR expr */
178875 #line 1383 "parse.y"
178876 {
178877 ExprList *pList = sqlite3ExprListAppend(pParse, 0, yymsp[-2].minor.yy454);
178878 pList = sqlite3ExprListAppend(pParse, pList, yymsp[0].minor.yy454);
178879 yylhsminor.yy454 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
178880 }
178881 #line 5032 "parse.sql"
178882 yymsp[-2].minor.yy454 = yylhsminor.yy454;
178883 break;
178884 case 218: /* between_op ::= BETWEEN */
178885 case 221: /* in_op ::= IN */ yytestcase(yyruleno==221);
178886 #line 1390 "parse.y"
178887 {yymsp[0].minor.yy144 = 0;}
178888 #line 5039 "parse.sql"
178889 break;
178890 case 220: /* expr ::= expr between_op expr AND expr */
178891 #line 1392 "parse.y"
178892 {
178893 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy454);
178894 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy454);
178895 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy454, 0);
178896 if( yymsp[-4].minor.yy454 ){
@@ -178395,12 +178898,14 @@
178898 }else{
178899 sqlite3ExprListDelete(pParse->db, pList);
178900 }
178901 if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178902 }
178903 #line 5054 "parse.sql"
178904 break;
178905 case 223: /* expr ::= expr in_op LP exprlist RP */
178906 #line 1407 "parse.y"
178907 {
178908 if( yymsp[-1].minor.yy14==0 ){
178909 /* Expressions of the form
178910 **
178911 ** expr1 IN ()
@@ -178441,42 +178946,52 @@
178946 }
178947 }
178948 if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178949 }
178950 }
178951 #line 5102 "parse.sql"
178952 break;
178953 case 224: /* expr ::= LP select RP */
178954 #line 1451 "parse.y"
178955 {
178956 yymsp[-2].minor.yy454 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
178957 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy454, yymsp[-1].minor.yy555);
178958 }
178959 #line 5110 "parse.sql"
178960 break;
178961 case 225: /* expr ::= expr in_op LP select RP */
178962 #line 1455 "parse.y"
178963 {
178964 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy454, 0);
178965 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy454, yymsp[-1].minor.yy555);
178966 if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178967 }
178968 #line 5119 "parse.sql"
178969 break;
178970 case 226: /* expr ::= expr in_op nm dbnm paren_exprlist */
178971 #line 1460 "parse.y"
178972 {
178973 SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
178974 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
178975 if( yymsp[0].minor.yy14 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy14);
178976 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy454, 0);
178977 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy454, pSelect);
178978 if( yymsp[-3].minor.yy144 ) yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy454, 0);
178979 }
178980 #line 5131 "parse.sql"
178981 break;
178982 case 227: /* expr ::= EXISTS LP select RP */
178983 #line 1468 "parse.y"
178984 {
178985 Expr *p;
178986 p = yymsp[-3].minor.yy454 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
178987 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy555);
178988 }
178989 #line 5140 "parse.sql"
178990 break;
178991 case 228: /* expr ::= CASE case_operand case_exprlist case_else END */
178992 #line 1476 "parse.y"
178993 {
178994 yymsp[-4].minor.yy454 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy454, 0);
178995 if( yymsp[-4].minor.yy454 ){
178996 yymsp[-4].minor.yy454->x.pList = yymsp[-1].minor.yy454 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[-1].minor.yy454) : yymsp[-2].minor.yy14;
178997 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy454);
@@ -178483,446 +178998,627 @@
178998 }else{
178999 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy14);
179000 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy454);
179001 }
179002 }
179003 #line 5154 "parse.sql"
179004 break;
179005 case 229: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
179006 #line 1488 "parse.y"
179007 {
179008 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, yymsp[-2].minor.yy454);
179009 yymsp[-4].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy14, yymsp[0].minor.yy454);
179010 }
179011 #line 5162 "parse.sql"
179012 break;
179013 case 230: /* case_exprlist ::= WHEN expr THEN expr */
179014 #line 1492 "parse.y"
179015 {
179016 yymsp[-3].minor.yy14 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy454);
179017 yymsp[-3].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy14, yymsp[0].minor.yy454);
179018 }
179019 #line 5170 "parse.sql"
179020 break;
179021 case 235: /* nexprlist ::= nexprlist COMMA expr */
179022 #line 1513 "parse.y"
179023 {yymsp[-2].minor.yy14 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy14,yymsp[0].minor.yy454);}
179024 #line 5175 "parse.sql"
179025 break;
179026 case 236: /* nexprlist ::= expr */
179027 #line 1515 "parse.y"
179028 {yymsp[0].minor.yy14 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy454); /*A-overwrites-Y*/}
179029 #line 5180 "parse.sql"
179030 break;
179031 case 238: /* paren_exprlist ::= LP exprlist RP */
179032 case 243: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==243);
179033 #line 1523 "parse.y"
179034 {yymsp[-2].minor.yy14 = yymsp[-1].minor.yy14;}
179035 #line 5186 "parse.sql"
179036 break;
179037 case 239: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
179038 #line 1530 "parse.y"
179039 {
179040 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
179041 sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy14, yymsp[-10].minor.yy144,
179042 &yymsp[-11].minor.yy0, yymsp[0].minor.yy454, SQLITE_SO_ASC, yymsp[-8].minor.yy144, SQLITE_IDXTYPE_APPDEF);
179043 if( IN_RENAME_OBJECT && pParse->pNewIndex ){
179044 sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
179045 }
179046 }
179047 #line 5198 "parse.sql"
179048 break;
179049 case 240: /* uniqueflag ::= UNIQUE */
179050 case 282: /* raisetype ::= ABORT */ yytestcase(yyruleno==282);
179051 #line 1540 "parse.y"
179052 {yymsp[0].minor.yy144 = OE_Abort;}
179053 #line 5204 "parse.sql"
179054 break;
179055 case 241: /* uniqueflag ::= */
179056 #line 1541 "parse.y"
179057 {yymsp[1].minor.yy144 = OE_None;}
179058 #line 5209 "parse.sql"
179059 break;
179060 case 244: /* eidlist ::= eidlist COMMA nm collate sortorder */
179061 #line 1591 "parse.y"
179062 {
179063 yymsp[-4].minor.yy14 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy14, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy144, yymsp[0].minor.yy144);
179064 }
179065 #line 5216 "parse.sql"
179066 break;
179067 case 245: /* eidlist ::= nm collate sortorder */
179068 #line 1594 "parse.y"
179069 {
179070 yymsp[-2].minor.yy14 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy144, yymsp[0].minor.yy144); /*A-overwrites-Y*/
179071 }
179072 #line 5223 "parse.sql"
179073 break;
179074 case 248: /* cmd ::= DROP INDEX ifexists fullname */
179075 #line 1605 "parse.y"
179076 {sqlite3DropIndex(pParse, yymsp[0].minor.yy203, yymsp[-1].minor.yy144);}
179077 #line 5228 "parse.sql"
179078 break;
179079 case 249: /* cmd ::= VACUUM vinto */
179080 #line 1612 "parse.y"
179081 {sqlite3Vacuum(pParse,0,yymsp[0].minor.yy454);}
179082 #line 5233 "parse.sql"
179083 break;
179084 case 250: /* cmd ::= VACUUM nm vinto */
179085 #line 1613 "parse.y"
179086 {sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy454);}
179087 #line 5238 "parse.sql"
179088 break;
179089 case 253: /* cmd ::= PRAGMA nm dbnm */
179090 #line 1621 "parse.y"
179091 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
179092 #line 5243 "parse.sql"
179093 break;
179094 case 254: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
179095 #line 1622 "parse.y"
179096 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
179097 #line 5248 "parse.sql"
179098 break;
179099 case 255: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
179100 #line 1623 "parse.y"
179101 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
179102 #line 5253 "parse.sql"
179103 break;
179104 case 256: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
179105 #line 1625 "parse.y"
179106 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
179107 #line 5258 "parse.sql"
179108 break;
179109 case 257: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
179110 #line 1627 "parse.y"
179111 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
179112 #line 5263 "parse.sql"
179113 break;
179114 case 260: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
179115 #line 1643 "parse.y"
179116 {
179117 Token all;
179118 all.z = yymsp[-3].minor.yy0.z;
179119 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
179120 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy427, &all);
179121 }
179122 #line 5273 "parse.sql"
179123 break;
179124 case 261: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
179125 #line 1652 "parse.y"
179126 {
179127 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy144, yymsp[-4].minor.yy286.a, yymsp[-4].minor.yy286.b, yymsp[-2].minor.yy203, yymsp[0].minor.yy454, yymsp[-10].minor.yy144, yymsp[-8].minor.yy144);
179128 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
179129 }
179130 #line 5281 "parse.sql"
179131 break;
179132 case 262: /* trigger_time ::= BEFORE|AFTER */
179133 #line 1658 "parse.y"
179134 { yymsp[0].minor.yy144 = yymsp[0].major; /*A-overwrites-X*/ }
179135 #line 5286 "parse.sql"
179136 break;
179137 case 263: /* trigger_time ::= INSTEAD OF */
179138 #line 1659 "parse.y"
179139 { yymsp[-1].minor.yy144 = TK_INSTEAD;}
179140 #line 5291 "parse.sql"
179141 break;
179142 case 264: /* trigger_time ::= */
179143 #line 1660 "parse.y"
179144 { yymsp[1].minor.yy144 = TK_BEFORE; }
179145 #line 5296 "parse.sql"
179146 break;
179147 case 265: /* trigger_event ::= DELETE|INSERT */
179148 case 266: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==266);
179149 #line 1664 "parse.y"
179150 {yymsp[0].minor.yy286.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy286.b = 0;}
179151 #line 5302 "parse.sql"
179152 break;
179153 case 267: /* trigger_event ::= UPDATE OF idlist */
179154 #line 1666 "parse.y"
179155 {yymsp[-2].minor.yy286.a = TK_UPDATE; yymsp[-2].minor.yy286.b = yymsp[0].minor.yy132;}
179156 #line 5307 "parse.sql"
179157 break;
179158 case 268: /* when_clause ::= */
179159 case 287: /* key_opt ::= */ yytestcase(yyruleno==287);
179160 #line 1673 "parse.y"
179161 { yymsp[1].minor.yy454 = 0; }
179162 #line 5313 "parse.sql"
179163 break;
179164 case 269: /* when_clause ::= WHEN expr */
179165 case 288: /* key_opt ::= KEY expr */ yytestcase(yyruleno==288);
179166 #line 1674 "parse.y"
179167 { yymsp[-1].minor.yy454 = yymsp[0].minor.yy454; }
179168 #line 5319 "parse.sql"
179169 break;
179170 case 270: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
179171 #line 1678 "parse.y"
179172 {
179173 assert( yymsp[-2].minor.yy427!=0 );
179174 yymsp[-2].minor.yy427->pLast->pNext = yymsp[-1].minor.yy427;
179175 yymsp[-2].minor.yy427->pLast = yymsp[-1].minor.yy427;
179176 }
179177 #line 5328 "parse.sql"
179178 break;
179179 case 271: /* trigger_cmd_list ::= trigger_cmd SEMI */
179180 #line 1683 "parse.y"
179181 {
179182 assert( yymsp[-1].minor.yy427!=0 );
179183 yymsp[-1].minor.yy427->pLast = yymsp[-1].minor.yy427;
179184 }
179185 #line 5336 "parse.sql"
179186 break;
179187 case 272: /* trnm ::= nm DOT nm */
179188 #line 1694 "parse.y"
179189 {
179190 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
179191 sqlite3ErrorMsg(pParse,
179192 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
179193 "statements within triggers");
179194 }
179195 #line 5346 "parse.sql"
179196 break;
179197 case 273: /* tridxby ::= INDEXED BY nm */
179198 #line 1706 "parse.y"
179199 {
179200 sqlite3ErrorMsg(pParse,
179201 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
179202 "within triggers");
179203 }
179204 #line 5355 "parse.sql"
179205 break;
179206 case 274: /* tridxby ::= NOT INDEXED */
179207 #line 1711 "parse.y"
179208 {
179209 sqlite3ErrorMsg(pParse,
179210 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
179211 "within triggers");
179212 }
179213 #line 5364 "parse.sql"
179214 break;
179215 case 275: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
179216 #line 1724 "parse.y"
179217 {yylhsminor.yy427 = sqlite3TriggerUpdateStep(pParse, &yymsp[-6].minor.yy0, yymsp[-2].minor.yy203, yymsp[-3].minor.yy14, yymsp[-1].minor.yy454, yymsp[-7].minor.yy144, yymsp[-8].minor.yy0.z, yymsp[0].minor.yy168);}
179218 #line 5369 "parse.sql"
179219 yymsp[-8].minor.yy427 = yylhsminor.yy427;
179220 break;
179221 case 276: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
179222 #line 1728 "parse.y"
179223 {
179224 yylhsminor.yy427 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy132,yymsp[-2].minor.yy555,yymsp[-6].minor.yy144,yymsp[-1].minor.yy122,yymsp[-7].minor.yy168,yymsp[0].minor.yy168);/*yylhsminor.yy427-overwrites-yymsp[-6].minor.yy144*/
179225 }
179226 #line 5377 "parse.sql"
179227 yymsp[-7].minor.yy427 = yylhsminor.yy427;
179228 break;
179229 case 277: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
179230 #line 1733 "parse.y"
179231 {yylhsminor.yy427 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy454, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy168);}
179232 #line 5383 "parse.sql"
179233 yymsp[-5].minor.yy427 = yylhsminor.yy427;
179234 break;
179235 case 278: /* trigger_cmd ::= scanpt select scanpt */
179236 #line 1737 "parse.y"
179237 {yylhsminor.yy427 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy555, yymsp[-2].minor.yy168, yymsp[0].minor.yy168); /*yylhsminor.yy427-overwrites-yymsp[-1].minor.yy555*/}
179238 #line 5389 "parse.sql"
179239 yymsp[-2].minor.yy427 = yylhsminor.yy427;
179240 break;
179241 case 279: /* expr ::= RAISE LP IGNORE RP */
179242 #line 1740 "parse.y"
179243 {
179244 yymsp[-3].minor.yy454 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
179245 if( yymsp[-3].minor.yy454 ){
179246 yymsp[-3].minor.yy454->affExpr = OE_Ignore;
179247 }
179248 }
179249 #line 5400 "parse.sql"
179250 break;
179251 case 280: /* expr ::= RAISE LP raisetype COMMA expr RP */
179252 #line 1746 "parse.y"
179253 {
179254 yymsp[-5].minor.yy454 = sqlite3PExpr(pParse, TK_RAISE, yymsp[-1].minor.yy454, 0);
179255 if( yymsp[-5].minor.yy454 ) {
179256 yymsp[-5].minor.yy454->affExpr = (char)yymsp[-3].minor.yy144;
179257 }
179258 }
179259 #line 5410 "parse.sql"
179260 break;
179261 case 281: /* raisetype ::= ROLLBACK */
179262 #line 1755 "parse.y"
179263 {yymsp[0].minor.yy144 = OE_Rollback;}
179264 #line 5415 "parse.sql"
179265 break;
179266 case 283: /* raisetype ::= FAIL */
179267 #line 1757 "parse.y"
179268 {yymsp[0].minor.yy144 = OE_Fail;}
179269 #line 5420 "parse.sql"
179270 break;
179271 case 284: /* cmd ::= DROP TRIGGER ifexists fullname */
179272 #line 1762 "parse.y"
179273 {
179274 sqlite3DropTrigger(pParse,yymsp[0].minor.yy203,yymsp[-1].minor.yy144);
179275 }
179276 #line 5427 "parse.sql"
179277 break;
179278 case 285: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
179279 #line 1769 "parse.y"
179280 {
179281 sqlite3Attach(pParse, yymsp[-3].minor.yy454, yymsp[-1].minor.yy454, yymsp[0].minor.yy454);
179282 }
179283 #line 5434 "parse.sql"
179284 break;
179285 case 286: /* cmd ::= DETACH database_kw_opt expr */
179286 #line 1772 "parse.y"
179287 {
179288 sqlite3Detach(pParse, yymsp[0].minor.yy454);
179289 }
179290 #line 5441 "parse.sql"
179291 break;
179292 case 289: /* cmd ::= REINDEX */
179293 #line 1787 "parse.y"
179294 {sqlite3Reindex(pParse, 0, 0);}
179295 #line 5446 "parse.sql"
179296 break;
179297 case 290: /* cmd ::= REINDEX nm dbnm */
179298 #line 1788 "parse.y"
179299 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
179300 #line 5451 "parse.sql"
179301 break;
179302 case 291: /* cmd ::= ANALYZE */
179303 #line 1793 "parse.y"
179304 {sqlite3Analyze(pParse, 0, 0);}
179305 #line 5456 "parse.sql"
179306 break;
179307 case 292: /* cmd ::= ANALYZE nm dbnm */
179308 #line 1794 "parse.y"
179309 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
179310 #line 5461 "parse.sql"
179311 break;
179312 case 293: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
179313 #line 1800 "parse.y"
179314 {
179315 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy203,&yymsp[0].minor.yy0);
179316 }
179317 #line 5468 "parse.sql"
179318 break;
179319 case 294: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
179320 #line 1804 "parse.y"
179321 {
179322 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
179323 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
179324 }
179325 #line 5476 "parse.sql"
179326 break;
179327 case 295: /* cmd ::= ALTER TABLE fullname DROP kwcolumn_opt nm */
179328 #line 1808 "parse.y"
179329 {
179330 sqlite3AlterDropColumn(pParse, yymsp[-3].minor.yy203, &yymsp[0].minor.yy0);
179331 }
179332 #line 5483 "parse.sql"
179333 break;
179334 case 296: /* add_column_fullname ::= fullname */
179335 #line 1812 "parse.y"
179336 {
179337 disableLookaside(pParse);
179338 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy203);
179339 }
179340 #line 5491 "parse.sql"
179341 break;
179342 case 297: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
179343 #line 1816 "parse.y"
179344 {
179345 sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy203, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
179346 }
179347 #line 5498 "parse.sql"
179348 break;
179349 case 298: /* cmd ::= create_vtab */
179350 #line 1828 "parse.y"
179351 {sqlite3VtabFinishParse(pParse,0);}
179352 #line 5503 "parse.sql"
179353 break;
179354 case 299: /* cmd ::= create_vtab LP vtabarglist RP */
179355 #line 1829 "parse.y"
179356 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
179357 #line 5508 "parse.sql"
179358 break;
179359 case 300: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
179360 #line 1831 "parse.y"
179361 {
179362 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy144);
179363 }
179364 #line 5515 "parse.sql"
179365 break;
179366 case 301: /* vtabarg ::= */
179367 #line 1836 "parse.y"
179368 {sqlite3VtabArgInit(pParse);}
179369 #line 5520 "parse.sql"
179370 break;
179371 case 302: /* vtabargtoken ::= ANY */
179372 case 303: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==303);
179373 case 304: /* lp ::= LP */ yytestcase(yyruleno==304);
179374 #line 1838 "parse.y"
179375 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
179376 #line 5527 "parse.sql"
179377 break;
179378 case 305: /* with ::= WITH wqlist */
179379 case 306: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==306);
179380 #line 1855 "parse.y"
179381 { sqlite3WithPush(pParse, yymsp[0].minor.yy59, 1); }
179382 #line 5533 "parse.sql"
179383 break;
179384 case 307: /* wqas ::= AS */
179385 #line 1859 "parse.y"
179386 {yymsp[0].minor.yy462 = M10d_Any;}
179387 #line 5538 "parse.sql"
179388 break;
179389 case 308: /* wqas ::= AS MATERIALIZED */
179390 #line 1860 "parse.y"
179391 {yymsp[-1].minor.yy462 = M10d_Yes;}
179392 #line 5543 "parse.sql"
179393 break;
179394 case 309: /* wqas ::= AS NOT MATERIALIZED */
179395 #line 1861 "parse.y"
179396 {yymsp[-2].minor.yy462 = M10d_No;}
179397 #line 5548 "parse.sql"
179398 break;
179399 case 310: /* wqitem ::= withnm eidlist_opt wqas LP select RP */
179400 #line 1862 "parse.y"
179401 {
179402 yymsp[-5].minor.yy67 = sqlite3CteNew(pParse, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy14, yymsp[-1].minor.yy555, yymsp[-3].minor.yy462); /*A-overwrites-X*/
179403 }
179404 #line 5555 "parse.sql"
179405 break;
179406 case 311: /* withnm ::= nm */
179407 #line 1865 "parse.y"
179408 {pParse->bHasWith = 1;}
179409 #line 5560 "parse.sql"
179410 break;
179411 case 312: /* wqlist ::= wqitem */
179412 #line 1866 "parse.y"
179413 {
179414 yymsp[0].minor.yy59 = sqlite3WithAdd(pParse, 0, yymsp[0].minor.yy67); /*A-overwrites-X*/
179415 }
179416 #line 5567 "parse.sql"
179417 break;
179418 case 313: /* wqlist ::= wqlist COMMA wqitem */
179419 #line 1869 "parse.y"
179420 {
179421 yymsp[-2].minor.yy59 = sqlite3WithAdd(pParse, yymsp[-2].minor.yy59, yymsp[0].minor.yy67);
179422 }
179423 #line 5574 "parse.sql"
179424 break;
179425 case 314: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
179426 #line 1884 "parse.y"
179427 {
179428 assert( yymsp[0].minor.yy211!=0 );
179429 sqlite3WindowChain(pParse, yymsp[0].minor.yy211, yymsp[-2].minor.yy211);
179430 yymsp[0].minor.yy211->pNextWin = yymsp[-2].minor.yy211;
179431 yylhsminor.yy211 = yymsp[0].minor.yy211;
179432 }
179433 #line 5584 "parse.sql"
179434 yymsp[-2].minor.yy211 = yylhsminor.yy211;
179435 break;
179436 case 315: /* windowdefn ::= nm AS LP window RP */
179437 #line 1893 "parse.y"
179438 {
179439 if( ALWAYS(yymsp[-1].minor.yy211) ){
179440 yymsp[-1].minor.yy211->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
179441 }
179442 yylhsminor.yy211 = yymsp[-1].minor.yy211;
179443 }
179444 #line 5595 "parse.sql"
179445 yymsp[-4].minor.yy211 = yylhsminor.yy211;
179446 break;
179447 case 316: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
179448 #line 1927 "parse.y"
179449 {
179450 yymsp[-4].minor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, yymsp[-2].minor.yy14, yymsp[-1].minor.yy14, 0);
179451 }
179452 #line 5603 "parse.sql"
179453 break;
179454 case 317: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
179455 #line 1930 "parse.y"
179456 {
179457 yylhsminor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, yymsp[-2].minor.yy14, yymsp[-1].minor.yy14, &yymsp[-5].minor.yy0);
179458 }
179459 #line 5610 "parse.sql"
179460 yymsp[-5].minor.yy211 = yylhsminor.yy211;
179461 break;
179462 case 318: /* window ::= ORDER BY sortlist frame_opt */
179463 #line 1933 "parse.y"
179464 {
179465 yymsp[-3].minor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, 0, yymsp[-1].minor.yy14, 0);
179466 }
179467 #line 5618 "parse.sql"
179468 break;
179469 case 319: /* window ::= nm ORDER BY sortlist frame_opt */
179470 #line 1936 "parse.y"
179471 {
179472 yylhsminor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, 0, yymsp[-1].minor.yy14, &yymsp[-4].minor.yy0);
179473 }
179474 #line 5625 "parse.sql"
179475 yymsp[-4].minor.yy211 = yylhsminor.yy211;
179476 break;
179477 case 320: /* window ::= nm frame_opt */
179478 #line 1940 "parse.y"
179479 {
179480 yylhsminor.yy211 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy211, 0, 0, &yymsp[-1].minor.yy0);
179481 }
179482 #line 5633 "parse.sql"
179483 yymsp[-1].minor.yy211 = yylhsminor.yy211;
179484 break;
179485 case 321: /* frame_opt ::= */
179486 #line 1944 "parse.y"
179487 {
179488 yymsp[1].minor.yy211 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
179489 }
179490 #line 5641 "parse.sql"
179491 break;
179492 case 322: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
179493 #line 1947 "parse.y"
179494 {
179495 yylhsminor.yy211 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy144, yymsp[-1].minor.yy509.eType, yymsp[-1].minor.yy509.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy462);
179496 }
179497 #line 5648 "parse.sql"
179498 yymsp[-2].minor.yy211 = yylhsminor.yy211;
179499 break;
179500 case 323: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
179501 #line 1951 "parse.y"
179502 {
179503 yylhsminor.yy211 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy144, yymsp[-3].minor.yy509.eType, yymsp[-3].minor.yy509.pExpr, yymsp[-1].minor.yy509.eType, yymsp[-1].minor.yy509.pExpr, yymsp[0].minor.yy462);
179504 }
179505 #line 5656 "parse.sql"
179506 yymsp[-5].minor.yy211 = yylhsminor.yy211;
179507 break;
179508 case 325: /* frame_bound_s ::= frame_bound */
179509 case 327: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==327);
179510 #line 1957 "parse.y"
179511 {yylhsminor.yy509 = yymsp[0].minor.yy509;}
179512 #line 5663 "parse.sql"
179513 yymsp[0].minor.yy509 = yylhsminor.yy509;
179514 break;
179515 case 326: /* frame_bound_s ::= UNBOUNDED PRECEDING */
179516 case 328: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==328);
179517 case 330: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==330);
179518 #line 1958 "parse.y"
179519 {yylhsminor.yy509.eType = yymsp[-1].major; yylhsminor.yy509.pExpr = 0;}
179520 #line 5671 "parse.sql"
179521 yymsp[-1].minor.yy509 = yylhsminor.yy509;
179522 break;
179523 case 329: /* frame_bound ::= expr PRECEDING|FOLLOWING */
179524 #line 1963 "parse.y"
179525 {yylhsminor.yy509.eType = yymsp[0].major; yylhsminor.yy509.pExpr = yymsp[-1].minor.yy454;}
179526 #line 5677 "parse.sql"
179527 yymsp[-1].minor.yy509 = yylhsminor.yy509;
179528 break;
179529 case 331: /* frame_exclude_opt ::= */
179530 #line 1967 "parse.y"
179531 {yymsp[1].minor.yy462 = 0;}
179532 #line 5683 "parse.sql"
179533 break;
179534 case 332: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
179535 #line 1968 "parse.y"
179536 {yymsp[-1].minor.yy462 = yymsp[0].minor.yy462;}
179537 #line 5688 "parse.sql"
179538 break;
179539 case 333: /* frame_exclude ::= NO OTHERS */
179540 case 334: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==334);
179541 #line 1971 "parse.y"
179542 {yymsp[-1].minor.yy462 = yymsp[-1].major; /*A-overwrites-X*/}
179543 #line 5694 "parse.sql"
179544 break;
179545 case 335: /* frame_exclude ::= GROUP|TIES */
179546 #line 1973 "parse.y"
179547 {yymsp[0].minor.yy462 = yymsp[0].major; /*A-overwrites-X*/}
179548 #line 5699 "parse.sql"
179549 break;
179550 case 336: /* window_clause ::= WINDOW windowdefn_list */
179551 #line 1978 "parse.y"
179552 { yymsp[-1].minor.yy211 = yymsp[0].minor.yy211; }
179553 #line 5704 "parse.sql"
179554 break;
179555 case 337: /* filter_over ::= filter_clause over_clause */
179556 #line 1980 "parse.y"
179557 {
179558 if( yymsp[0].minor.yy211 ){
179559 yymsp[0].minor.yy211->pFilter = yymsp[-1].minor.yy454;
179560 }else{
179561 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy454);
179562 }
179563 yylhsminor.yy211 = yymsp[0].minor.yy211;
179564 }
179565 #line 5716 "parse.sql"
179566 yymsp[-1].minor.yy211 = yylhsminor.yy211;
179567 break;
179568 case 338: /* filter_over ::= over_clause */
179569 #line 1988 "parse.y"
179570 {
179571 yylhsminor.yy211 = yymsp[0].minor.yy211;
179572 }
179573 #line 5724 "parse.sql"
179574 yymsp[0].minor.yy211 = yylhsminor.yy211;
179575 break;
179576 case 339: /* filter_over ::= filter_clause */
179577 #line 1991 "parse.y"
179578 {
179579 yylhsminor.yy211 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
179580 if( yylhsminor.yy211 ){
179581 yylhsminor.yy211->eFrmType = TK_FILTER;
179582 yylhsminor.yy211->pFilter = yymsp[0].minor.yy454;
179583 }else{
179584 sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy454);
179585 }
179586 }
179587 #line 5738 "parse.sql"
179588 yymsp[0].minor.yy211 = yylhsminor.yy211;
179589 break;
179590 case 340: /* over_clause ::= OVER LP window RP */
179591 #line 2001 "parse.y"
179592 {
179593 yymsp[-3].minor.yy211 = yymsp[-1].minor.yy211;
179594 assert( yymsp[-3].minor.yy211!=0 );
179595 }
179596 #line 5747 "parse.sql"
179597 break;
179598 case 341: /* over_clause ::= OVER nm */
179599 #line 2005 "parse.y"
179600 {
179601 yymsp[-1].minor.yy211 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
179602 if( yymsp[-1].minor.yy211 ){
179603 yymsp[-1].minor.yy211->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
179604 }
179605 }
179606 #line 5757 "parse.sql"
179607 break;
179608 case 342: /* filter_clause ::= FILTER LP WHERE expr RP */
179609 #line 2012 "parse.y"
179610 { yymsp[-4].minor.yy454 = yymsp[-1].minor.yy454; }
179611 #line 5762 "parse.sql"
179612 break;
179613 case 343: /* term ::= QNUMBER */
179614 #line 2038 "parse.y"
179615 {
179616 yylhsminor.yy454=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0);
179617 sqlite3DequoteNumber(pParse, yylhsminor.yy454);
179618 }
179619 #line 5770 "parse.sql"
179620 yymsp[0].minor.yy454 = yylhsminor.yy454;
179621 break;
179622 default:
179623 /* (344) input ::= cmdlist */ yytestcase(yyruleno==344);
179624 /* (345) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==345);
@@ -179046,17 +179742,19 @@
179742 ){
179743 sqlite3ParserARG_FETCH
179744 sqlite3ParserCTX_FETCH
179745 #define TOKEN yyminor
179746 /************ Begin %syntax_error code ****************************************/
179747 #line 43 "parse.y"
179748
179749 UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
179750 if( TOKEN.z[0] ){
179751 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
179752 }else{
179753 sqlite3ErrorMsg(pParse, "incomplete input");
179754 }
179755 #line 5906 "parse.sql"
179756 /************ End %syntax_error code ******************************************/
179757 sqlite3ParserARG_STORE /* Suppress warning about unused %extra_argument variable */
179758 sqlite3ParserCTX_STORE
179759 }
179760
@@ -179324,10 +180022,11 @@
180022 #endif
180023 }
180024
180025 /************** End of parse.c ***********************************************/
180026 /************** Begin file tokenize.c ****************************************/
180027 #line 1 "tsrc/tokenize.c"
180028 /*
180029 ** 2001 September 15
180030 **
180031 ** The author disclaims copyright to this source code. In place of
180032 ** a legal notice, here is a blessing:
@@ -179473,10 +180172,11 @@
180172 ** named keywordhash.h and then included into this source file by
180173 ** the #include below.
180174 */
180175 /************** Include keywordhash.h in the middle of tokenize.c ************/
180176 /************** Begin file keywordhash.h *************************************/
180177 #line 1 "tsrc/keywordhash.h"
180178 /***** This file contains automatically generated code ******
180179 **
180180 ** The code in this file has been automatically generated by
180181 **
180182 ** sqlite/tool/mkkeywordhash.c
@@ -179958,10 +180658,11 @@
180658 return TK_ID!=sqlite3KeywordCode((const u8*)zName, nName);
180659 }
180660
180661 /************** End of keywordhash.h *****************************************/
180662 /************** Continuing where we left off in tokenize.c *******************/
180663 #line 149 "tsrc/tokenize.c"
180664
180665
180666 /*
180667 ** If X is a character that can be used in an identifier then
180668 ** IdChar(X) will be true. Otherwise it is false.
@@ -180701,10 +181402,11 @@
181402 }
181403 #endif /* SQLITE_ENABLE_NORMALIZE */
181404
181405 /************** End of tokenize.c ********************************************/
181406 /************** Begin file complete.c ****************************************/
181407 #line 1 "tsrc/complete.c"
181408 /*
181409 ** 2001 September 15
181410 **
181411 ** The author disclaims copyright to this source code. In place of
181412 ** a legal notice, here is a blessing:
@@ -180994,10 +181696,11 @@
181696 #endif /* SQLITE_OMIT_UTF16 */
181697 #endif /* SQLITE_OMIT_COMPLETE */
181698
181699 /************** End of complete.c ********************************************/
181700 /************** Begin file main.c ********************************************/
181701 #line 1 "tsrc/main.c"
181702 /*
181703 ** 2001 September 15
181704 **
181705 ** The author disclaims copyright to this source code. In place of
181706 ** a legal notice, here is a blessing:
@@ -181015,10 +181718,11 @@
181718 /* #include "sqliteInt.h" */
181719
181720 #ifdef SQLITE_ENABLE_FTS3
181721 /************** Include fts3.h in the middle of main.c ***********************/
181722 /************** Begin file fts3.h ********************************************/
181723 #line 1 "tsrc/fts3.h"
181724 /*
181725 ** 2006 Oct 10
181726 **
181727 ** The author disclaims copyright to this source code. In place of
181728 ** a legal notice, here is a blessing:
@@ -181044,14 +181748,16 @@
181748 } /* extern "C" */
181749 #endif /* __cplusplus */
181750
181751 /************** End of fts3.h ************************************************/
181752 /************** Continuing where we left off in main.c ***********************/
181753 #line 21 "tsrc/main.c"
181754 #endif
181755 #ifdef SQLITE_ENABLE_RTREE
181756 /************** Include rtree.h in the middle of main.c **********************/
181757 /************** Begin file rtree.h *******************************************/
181758 #line 1 "tsrc/rtree.h"
181759 /*
181760 ** 2008 May 26
181761 **
181762 ** The author disclaims copyright to this source code. In place of
181763 ** a legal notice, here is a blessing:
@@ -181081,14 +181787,16 @@
181787 } /* extern "C" */
181788 #endif /* __cplusplus */
181789
181790 /************** End of rtree.h ***********************************************/
181791 /************** Continuing where we left off in main.c ***********************/
181792 #line 24 "tsrc/main.c"
181793 #endif
181794 #if defined(SQLITE_ENABLE_ICU) || defined(SQLITE_ENABLE_ICU_COLLATIONS)
181795 /************** Include sqliteicu.h in the middle of main.c ******************/
181796 /************** Begin file sqliteicu.h ***************************************/
181797 #line 1 "tsrc/sqliteicu.h"
181798 /*
181799 ** 2008 May 26
181800 **
181801 ** The author disclaims copyright to this source code. In place of
181802 ** a legal notice, here is a blessing:
@@ -181114,10 +181822,11 @@
181822 } /* extern "C" */
181823 #endif /* __cplusplus */
181824
181825 /************** End of sqliteicu.h *******************************************/
181826 /************** Continuing where we left off in main.c ***********************/
181827 #line 27 "tsrc/main.c"
181828 #endif
181829
181830 /*
181831 ** This is an extension initializer that is a no-op and always
181832 ** succeeds, except that it fails if the fault-simulation is set
@@ -182513,14 +183222,10 @@
183222 #endif
183223
183224 sqlite3Error(db, SQLITE_OK); /* Deallocates any cached error strings. */
183225 sqlite3ValueFree(db->pErr);
183226 sqlite3CloseExtensions(db);
 
 
 
 
183227
183228 db->eOpenState = SQLITE_STATE_ERROR;
183229
183230 /* The temp-database schema is allocated differently from the other schema
183231 ** objects (using sqliteMalloc() directly, instead of sqlite3BtreeSchema()).
@@ -186168,10 +186873,11 @@
186873 }
186874 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
186875
186876 /************** End of main.c ************************************************/
186877 /************** Begin file notify.c ******************************************/
186878 #line 1 "tsrc/notify.c"
186879 /*
186880 ** 2009 March 3
186881 **
186882 ** The author disclaims copyright to this source code. In place of
186883 ** a legal notice, here is a blessing:
@@ -186506,10 +187212,11 @@
187212 }
187213 #endif
187214
187215 /************** End of notify.c **********************************************/
187216 /************** Begin file fts3.c ********************************************/
187217 #line 1 "tsrc/fts3.c"
187218 /*
187219 ** 2006 Oct 10
187220 **
187221 ** The author disclaims copyright to this source code. In place of
187222 ** a legal notice, here is a blessing:
@@ -186798,10 +187505,11 @@
187505 ** older data.
187506 */
187507
187508 /************** Include fts3Int.h in the middle of fts3.c ********************/
187509 /************** Begin file fts3Int.h *****************************************/
187510 #line 1 "tsrc/fts3Int.h"
187511 /*
187512 ** 2009 Nov 12
187513 **
187514 ** The author disclaims copyright to this source code. In place of
187515 ** a legal notice, here is a blessing:
@@ -186844,10 +187552,11 @@
187552 #endif
187553
187554 /* #include "sqlite3.h" */
187555 /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
187556 /************** Begin file fts3_tokenizer.h **********************************/
187557 #line 1 "tsrc/fts3_tokenizer.h"
187558 /*
187559 ** 2006 July 10
187560 **
187561 ** The author disclaims copyright to this source code.
187562 **
@@ -187008,12 +187717,14 @@
187717
187718 #endif /* _FTS3_TOKENIZER_H_ */
187719
187720 /************** End of fts3_tokenizer.h **************************************/
187721 /************** Continuing where we left off in fts3Int.h ********************/
187722 #line 46 "tsrc/fts3Int.h"
187723 /************** Include fts3_hash.h in the middle of fts3Int.h ***************/
187724 /************** Begin file fts3_hash.h ***************************************/
187725 #line 1 "tsrc/fts3_hash.h"
187726 /*
187727 ** 2001 September 22
187728 **
187729 ** The author disclaims copyright to this source code. In place of
187730 ** a legal notice, here is a blessing:
@@ -187125,10 +187836,11 @@
187836
187837 #endif /* _FTS3_HASH_H_ */
187838
187839 /************** End of fts3_hash.h *******************************************/
187840 /************** Continuing where we left off in fts3Int.h ********************/
187841 #line 47 "tsrc/fts3Int.h"
187842
187843 /*
187844 ** This constant determines the maximum depth of an FTS expression tree
187845 ** that the library will create and use. FTS uses recursion to perform
187846 ** various operations on the query tree, so the disadvantage of a large
@@ -187741,10 +188453,11 @@
188453 #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
188454 #endif /* _FTSINT_H */
188455
188456 /************** End of fts3Int.h *********************************************/
188457 /************** Continuing where we left off in fts3.c ***********************/
188458 #line 292 "tsrc/fts3.c"
188459 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
188460
188461 #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
188462 # define SQLITE_CORE 1
188463 #endif
@@ -193621,11 +194334,11 @@
194334 SQLITE_PRIVATE int sqlite3Fts3Corrupt(){
194335 return SQLITE_CORRUPT_VTAB;
194336 }
194337 #endif
194338
194339 #if !defined(SQLITE_CORE)
194340 /*
194341 ** Initialize API pointer table, if required.
194342 */
194343 #ifdef _WIN32
194344 __declspec(dllexport)
@@ -193642,10 +194355,11 @@
194355
194356 #endif
194357
194358 /************** End of fts3.c ************************************************/
194359 /************** Begin file fts3_aux.c ****************************************/
194360 #line 1 "tsrc/fts3_aux.c"
194361 /*
194362 ** 2011 Jan 27
194363 **
194364 ** The author disclaims copyright to this source code. In place of
194365 ** a legal notice, here is a blessing:
@@ -194202,10 +194916,11 @@
194916
194917 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
194918
194919 /************** End of fts3_aux.c ********************************************/
194920 /************** Begin file fts3_expr.c ***************************************/
194921 #line 1 "tsrc/fts3_expr.c"
194922 /*
194923 ** 2008 Nov 28
194924 **
194925 ** The author disclaims copyright to this source code. In place of
194926 ** a legal notice, here is a blessing:
@@ -195498,10 +196213,11 @@
196213 #endif
196214 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
196215
196216 /************** End of fts3_expr.c *******************************************/
196217 /************** Begin file fts3_hash.c ***************************************/
196218 #line 1 "tsrc/fts3_hash.c"
196219 /*
196220 ** 2001 September 22
196221 **
196222 ** The author disclaims copyright to this source code. In place of
196223 ** a legal notice, here is a blessing:
@@ -195884,10 +196600,11 @@
196600
196601 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
196602
196603 /************** End of fts3_hash.c *******************************************/
196604 /************** Begin file fts3_porter.c *************************************/
196605 #line 1 "tsrc/fts3_porter.c"
196606 /*
196607 ** 2006 September 30
196608 **
196609 ** The author disclaims copyright to this source code. In place of
196610 ** a legal notice, here is a blessing:
@@ -196549,10 +197266,11 @@
197266
197267 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
197268
197269 /************** End of fts3_porter.c *****************************************/
197270 /************** Begin file fts3_tokenizer.c **********************************/
197271 #line 1 "tsrc/fts3_tokenizer.c"
197272 /*
197273 ** 2007 June 22
197274 **
197275 ** The author disclaims copyright to this source code. In place of
197276 ** a legal notice, here is a blessing:
@@ -197068,10 +197786,11 @@
197786
197787 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
197788
197789 /************** End of fts3_tokenizer.c **************************************/
197790 /************** Begin file fts3_tokenizer1.c *********************************/
197791 #line 1 "tsrc/fts3_tokenizer1.c"
197792 /*
197793 ** 2006 Oct 10
197794 **
197795 ** The author disclaims copyright to this source code. In place of
197796 ** a legal notice, here is a blessing:
@@ -197305,10 +198024,11 @@
198024
198025 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
198026
198027 /************** End of fts3_tokenizer1.c *************************************/
198028 /************** Begin file fts3_tokenize_vtab.c ******************************/
198029 #line 1 "tsrc/fts3_tokenize_vtab.c"
198030 /*
198031 ** 2013 Apr 22
198032 **
198033 ** The author disclaims copyright to this source code. In place of
198034 ** a legal notice, here is a blessing:
@@ -197767,10 +198487,11 @@
198487
198488 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
198489
198490 /************** End of fts3_tokenize_vtab.c **********************************/
198491 /************** Begin file fts3_write.c **************************************/
198492 #line 1 "tsrc/fts3_write.c"
198493 /*
198494 ** 2009 Oct 23
198495 **
198496 ** The author disclaims copyright to this source code. In place of
198497 ** a legal notice, here is a blessing:
@@ -203604,10 +204325,11 @@
204325
204326 #endif
204327
204328 /************** End of fts3_write.c ******************************************/
204329 /************** Begin file fts3_snippet.c ************************************/
204330 #line 1 "tsrc/fts3_snippet.c"
204331 /*
204332 ** 2009 Oct 23
204333 **
204334 ** The author disclaims copyright to this source code. In place of
204335 ** a legal notice, here is a blessing:
@@ -205363,10 +206085,11 @@
206085
206086 #endif
206087
206088 /************** End of fts3_snippet.c ****************************************/
206089 /************** Begin file fts3_unicode.c ************************************/
206090 #line 1 "tsrc/fts3_unicode.c"
206091 /*
206092 ** 2012 May 24
206093 **
206094 ** The author disclaims copyright to this source code. In place of
206095 ** a legal notice, here is a blessing:
@@ -205763,10 +206486,11 @@
206486 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
206487 #endif /* ifndef SQLITE_DISABLE_FTS3_UNICODE */
206488
206489 /************** End of fts3_unicode.c ****************************************/
206490 /************** Begin file fts3_unicode2.c ***********************************/
206491 #line 1 "tsrc/fts3_unicode2.c"
206492 /*
206493 ** 2012-05-25
206494 **
206495 ** The author disclaims copyright to this source code. In place of
206496 ** a legal notice, here is a blessing:
@@ -206149,10 +206873,11 @@
206873 #endif /* defined(SQLITE_ENABLE_FTS3) || defined(SQLITE_ENABLE_FTS4) */
206874 #endif /* !defined(SQLITE_DISABLE_FTS3_UNICODE) */
206875
206876 /************** End of fts3_unicode2.c ***************************************/
206877 /************** Begin file json.c ********************************************/
206878 #line 1 "tsrc/json.c"
206879 /*
206880 ** 2015-08-12
206881 **
206882 ** The author disclaims copyright to this source code. In place of
206883 ** a legal notice, here is a blessing:
@@ -211618,10 +212343,11 @@
212343 }
212344 #endif /* !defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_OMIT_JSON) */
212345
212346 /************** End of json.c ************************************************/
212347 /************** Begin file rtree.c *******************************************/
212348 #line 1 "tsrc/rtree.c"
212349 /*
212350 ** 2001 September 15
212351 **
212352 ** The author disclaims copyright to this source code. In place of
212353 ** a legal notice, here is a blessing:
@@ -215906,10 +216632,11 @@
216632
216633 /* Conditionally include the geopoly code */
216634 #ifdef SQLITE_ENABLE_GEOPOLY
216635 /************** Include geopoly.c in the middle of rtree.c *******************/
216636 /************** Begin file geopoly.c *****************************************/
216637 #line 1 "tsrc/geopoly.c"
216638 /*
216639 ** 2018-05-25
216640 **
216641 ** The author disclaims copyright to this source code. In place of
216642 ** a legal notice, here is a blessing:
@@ -217748,10 +218475,11 @@
218475 return rc;
218476 }
218477
218478 /************** End of geopoly.c *********************************************/
218479 /************** Continuing where we left off in rtree.c **********************/
218480 #line 4288 "tsrc/rtree.c"
218481 #endif
218482
218483 /*
218484 ** Register the r-tree module with database handle db. This creates the
218485 ** virtual table module "rtree" and the debugging/analysis scalar
@@ -217912,11 +218640,11 @@
218640 return sqlite3_create_function_v2(db, zQueryFunc, -1, SQLITE_ANY,
218641 (void *)pGeomCtx, geomCallback, 0, 0, rtreeFreeCallback
218642 );
218643 }
218644
218645 #ifndef SQLITE_CORE
218646 #ifdef _WIN32
218647 __declspec(dllexport)
218648 #endif
218649 SQLITE_API int sqlite3_rtree_init(
218650 sqlite3 *db,
@@ -217930,10 +218658,11 @@
218658
218659 #endif
218660
218661 /************** End of rtree.c ***********************************************/
218662 /************** Begin file icu.c *********************************************/
218663 #line 1 "tsrc/icu.c"
218664 /*
218665 ** 2007 May 6
218666 **
218667 ** The author disclaims copyright to this source code. In place of
218668 ** a legal notice, here is a blessing:
@@ -218503,11 +219232,11 @@
219232 }
219233
219234 return rc;
219235 }
219236
219237 #ifndef SQLITE_CORE
219238 #ifdef _WIN32
219239 __declspec(dllexport)
219240 #endif
219241 SQLITE_API int sqlite3_icu_init(
219242 sqlite3 *db,
@@ -218521,10 +219250,11 @@
219250
219251 #endif
219252
219253 /************** End of icu.c *************************************************/
219254 /************** Begin file fts3_icu.c ****************************************/
219255 #line 1 "tsrc/fts3_icu.c"
219256 /*
219257 ** 2007 June 22
219258 **
219259 ** The author disclaims copyright to this source code. In place of
219260 ** a legal notice, here is a blessing:
@@ -218786,10 +219516,11 @@
219516 #endif /* defined(SQLITE_ENABLE_ICU) */
219517 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
219518
219519 /************** End of fts3_icu.c ********************************************/
219520 /************** Begin file sqlite3rbu.c **************************************/
219521 #line 1 "tsrc/sqlite3rbu.c"
219522 /*
219523 ** 2014 August 30
219524 **
219525 ** The author disclaims copyright to this source code. In place of
219526 ** a legal notice, here is a blessing:
@@ -218877,10 +219608,11 @@
219608 /* #include "sqlite3.h" */
219609
219610 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU)
219611 /************** Include sqlite3rbu.h in the middle of sqlite3rbu.c ***********/
219612 /************** Begin file sqlite3rbu.h **************************************/
219613 #line 1 "tsrc/sqlite3rbu.h"
219614 /*
219615 ** 2014 August 30
219616 **
219617 ** The author disclaims copyright to this source code. In place of
219618 ** a legal notice, here is a blessing:
@@ -219513,10 +220245,11 @@
220245
220246 #endif /* _SQLITE3RBU_H */
220247
220248 /************** End of sqlite3rbu.h ******************************************/
220249 /************** Continuing where we left off in sqlite3rbu.c *****************/
220250 #line 91 "tsrc/sqlite3rbu.c"
220251
220252 #if defined(_WIN32_WCE)
220253 /* #include "windows.h" */
220254 #endif
220255
@@ -224873,10 +225606,11 @@
225606
225607 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) */
225608
225609 /************** End of sqlite3rbu.c ******************************************/
225610 /************** Begin file dbstat.c ******************************************/
225611 #line 1 "tsrc/dbstat.c"
225612 /*
225613 ** 2010 July 12
225614 **
225615 ** The author disclaims copyright to this source code. In place of
225616 ** a legal notice, here is a blessing:
@@ -225782,10 +226516,11 @@
226516 SQLITE_PRIVATE int sqlite3DbstatRegister(sqlite3 *db){ return SQLITE_OK; }
226517 #endif /* SQLITE_ENABLE_DBSTAT_VTAB */
226518
226519 /************** End of dbstat.c **********************************************/
226520 /************** Begin file dbpage.c ******************************************/
226521 #line 1 "tsrc/dbpage.c"
226522 /*
226523 ** 2017-10-11
226524 **
226525 ** The author disclaims copyright to this source code. In place of
226526 ** a legal notice, here is a blessing:
@@ -226264,10 +226999,11 @@
226999 SQLITE_PRIVATE int sqlite3DbpageRegister(sqlite3 *db){ return SQLITE_OK; }
227000 #endif /* SQLITE_ENABLE_DBSTAT_VTAB */
227001
227002 /************** End of dbpage.c **********************************************/
227003 /************** Begin file sqlite3session.c **********************************/
227004 #line 1 "tsrc/sqlite3session.c"
227005
227006 #if defined(SQLITE_ENABLE_SESSION) && defined(SQLITE_ENABLE_PREUPDATE_HOOK)
227007 /* #include "sqlite3session.h" */
227008 /* #include <assert.h> */
227009 /* #include <string.h> */
@@ -232803,21 +233539,49 @@
233539
233540 #endif /* SQLITE_ENABLE_SESSION && SQLITE_ENABLE_PREUPDATE_HOOK */
233541
233542 /************** End of sqlite3session.c **************************************/
233543 /************** Begin file fts5.c ********************************************/
233544 #line 1 "tsrc/fts5.c"
233545
233546 /*
233547 ** This, the "fts5.c" source file, is a composite file that is itself
233548 ** assembled from the following files:
233549 **
233550 ** fts5.h
233551 ** fts5Int.h
233552 ** fts5parse.h <--- Generated from fts5parse.y by Lemon
233553 ** fts5parse.c <--- Generated from fts5parse.y by Lemon
233554 ** fts5_aux.c
233555 ** fts5_buffer.c
233556 ** fts5_config.c
233557 ** fts5_expr.c
233558 ** fts5_hash.c
233559 ** fts5_index.c
233560 ** fts5_main.c
233561 ** fts5_storage.c
233562 ** fts5_tokenize.c
233563 ** fts5_unicode2.c
233564 ** fts5_varint.c
233565 ** fts5_vocab.c
233566 */
233567 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5)
233568
233569 #if !defined(NDEBUG) && !defined(SQLITE_DEBUG)
233570 # define NDEBUG 1
233571 #endif
233572 #if defined(NDEBUG) && defined(SQLITE_DEBUG)
233573 # undef NDEBUG
233574 #endif
233575
233576 #ifdef HAVE_STDINT_H
233577 /* #include <stdint.h> */
233578 #endif
233579 #ifdef HAVE_INTTYPES_H
233580 /* #include <inttypes.h> */
233581 #endif
233582 #line 1 "fts5.h"
233583 /*
233584 ** 2014 May 31
233585 **
233586 ** The author disclaims copyright to this source code. In place of
233587 ** a legal notice, here is a blessing:
@@ -233554,10 +234318,11 @@
234318 } /* end of the 'extern "C"' block */
234319 #endif
234320
234321 #endif /* _FTS5_H */
234322
234323 #line 1 "fts5Int.h"
234324 /*
234325 ** 2014 May 31
234326 **
234327 ** The author disclaims copyright to this source code. In place of
234328 ** a legal notice, here is a blessing:
@@ -234493,10 +235258,11 @@
235258 ** End of interface to code in fts5_unicode2.c.
235259 **************************************************************************/
235260
235261 #endif
235262
235263 #line 1 "fts5parse.h"
235264 #define FTS5_OR 1
235265 #define FTS5_AND 2
235266 #define FTS5_NOT 3
235267 #define FTS5_TERM 4
235268 #define FTS5_COLON 5
@@ -234509,10 +235275,11 @@
235275 #define FTS5_CARET 12
235276 #define FTS5_COMMA 13
235277 #define FTS5_PLUS 14
235278 #define FTS5_STAR 15
235279
235280 #line 1 "fts5parse.c"
235281 /* This file is automatically generated by Lemon from input grammar
235282 ** source file "fts5parse.y".
235283 */
235284 /*
235285 ** 2000-05-29
@@ -234537,10 +235304,11 @@
235304 **
235305 ** The following is the concatenation of all %include directives from the
235306 ** input grammar file:
235307 */
235308 /************ Begin %include sections from the grammar ************************/
235309 #line 47 "fts5parse.y"
235310
235311 /* #include "fts5Int.h" */
235312 /* #include "fts5parse.h" */
235313
235314 /*
@@ -234564,10 +235332,11 @@
235332 ** Alternative datatype for the argument to the malloc() routine passed
235333 ** into sqlite3ParserAlloc(). The default is size_t.
235334 */
235335 #define fts5YYMALLOCARGTYPE u64
235336
235337 #line 58 "fts5parse.sql"
235338 /**************** End of %include directives **********************************/
235339 /* These constants specify the various numeric values for terminal symbols.
235340 ***************** Begin token definitions *************************************/
235341 #ifndef FTS5_OR
235342 #define FTS5_OR 1
@@ -235110,35 +235879,45 @@
235879 ** inside the C code.
235880 */
235881 /********* Begin destructor definitions ***************************************/
235882 case 16: /* input */
235883 {
235884 #line 83 "fts5parse.y"
235885 (void)pParse;
235886 #line 606 "fts5parse.sql"
235887 }
235888 break;
235889 case 17: /* expr */
235890 case 18: /* cnearset */
235891 case 19: /* exprlist */
235892 {
235893 #line 89 "fts5parse.y"
235894 sqlite3Fts5ParseNodeFree((fts5yypminor->fts5yy24));
235895 #line 615 "fts5parse.sql"
235896 }
235897 break;
235898 case 20: /* colset */
235899 case 21: /* colsetlist */
235900 {
235901 #line 93 "fts5parse.y"
235902 sqlite3_free((fts5yypminor->fts5yy11));
235903 #line 623 "fts5parse.sql"
235904 }
235905 break;
235906 case 22: /* nearset */
235907 case 23: /* nearphrases */
235908 {
235909 #line 148 "fts5parse.y"
235910 sqlite3Fts5ParseNearsetFree((fts5yypminor->fts5yy46));
235911 #line 631 "fts5parse.sql"
235912 }
235913 break;
235914 case 24: /* phrase */
235915 {
235916 #line 183 "fts5parse.y"
235917 sqlite3Fts5ParsePhraseFree((fts5yypminor->fts5yy53));
235918 #line 638 "fts5parse.sql"
235919 }
235920 break;
235921 /********* End destructor definitions *****************************************/
235922 default: break; /* If no destructor action specified: do nothing */
235923 }
@@ -235369,12 +236148,14 @@
236148 #endif
236149 while( fts5yypParser->fts5yytos>fts5yypParser->fts5yystack ) fts5yy_pop_parser_stack(fts5yypParser);
236150 /* Here code is inserted which will execute if the parser
236151 ** stack every overflows */
236152 /******** Begin %stack_overflow code ******************************************/
236153 #line 36 "fts5parse.y"
236154
236155 sqlite3Fts5ParseError(pParse, "fts5: parser stack overflow");
236156 #line 876 "fts5parse.sql"
236157 /******** End %stack_overflow code ********************************************/
236158 sqlite3Fts5ParserARG_STORE /* Suppress warning about unused %extra_argument var */
236159 sqlite3Fts5ParserCTX_STORE
236160 }
236161
@@ -235539,148 +236320,202 @@
236320 ** break;
236321 */
236322 /********** Begin reduce actions **********************************************/
236323 fts5YYMINORTYPE fts5yylhsminor;
236324 case 0: /* input ::= expr */
236325 #line 82 "fts5parse.y"
236326 { sqlite3Fts5ParseFinished(pParse, fts5yymsp[0].minor.fts5yy24); }
236327 #line 1047 "fts5parse.sql"
236328 break;
236329 case 1: /* colset ::= MINUS LCP colsetlist RCP */
236330 #line 97 "fts5parse.y"
236331 {
236332 fts5yymsp[-3].minor.fts5yy11 = sqlite3Fts5ParseColsetInvert(pParse, fts5yymsp[-1].minor.fts5yy11);
236333 }
236334 #line 1054 "fts5parse.sql"
236335 break;
236336 case 2: /* colset ::= LCP colsetlist RCP */
236337 #line 100 "fts5parse.y"
236338 { fts5yymsp[-2].minor.fts5yy11 = fts5yymsp[-1].minor.fts5yy11; }
236339 #line 1059 "fts5parse.sql"
236340 break;
236341 case 3: /* colset ::= STRING */
236342 #line 101 "fts5parse.y"
236343 {
236344 fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
236345 }
236346 #line 1066 "fts5parse.sql"
236347 fts5yymsp[0].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
236348 break;
236349 case 4: /* colset ::= MINUS STRING */
236350 #line 104 "fts5parse.y"
236351 {
236352 fts5yymsp[-1].minor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
236353 fts5yymsp[-1].minor.fts5yy11 = sqlite3Fts5ParseColsetInvert(pParse, fts5yymsp[-1].minor.fts5yy11);
236354 }
236355 #line 1075 "fts5parse.sql"
236356 break;
236357 case 5: /* colsetlist ::= colsetlist STRING */
236358 #line 109 "fts5parse.y"
236359 {
236360 fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, fts5yymsp[-1].minor.fts5yy11, &fts5yymsp[0].minor.fts5yy0); }
236361 #line 1081 "fts5parse.sql"
236362 fts5yymsp[-1].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
236363 break;
236364 case 6: /* colsetlist ::= STRING */
236365 #line 111 "fts5parse.y"
236366 {
236367 fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
236368 }
236369 #line 1089 "fts5parse.sql"
236370 fts5yymsp[0].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
236371 break;
236372 case 7: /* expr ::= expr AND expr */
236373 #line 115 "fts5parse.y"
236374 {
236375 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_AND, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0);
236376 }
236377 #line 1097 "fts5parse.sql"
236378 fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
236379 break;
236380 case 8: /* expr ::= expr OR expr */
236381 #line 118 "fts5parse.y"
236382 {
236383 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_OR, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0);
236384 }
236385 #line 1105 "fts5parse.sql"
236386 fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
236387 break;
236388 case 9: /* expr ::= expr NOT expr */
236389 #line 121 "fts5parse.y"
236390 {
236391 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_NOT, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0);
236392 }
236393 #line 1113 "fts5parse.sql"
236394 fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
236395 break;
236396 case 10: /* expr ::= colset COLON LP expr RP */
236397 #line 125 "fts5parse.y"
236398 {
236399 sqlite3Fts5ParseSetColset(pParse, fts5yymsp[-1].minor.fts5yy24, fts5yymsp[-4].minor.fts5yy11);
236400 fts5yylhsminor.fts5yy24 = fts5yymsp[-1].minor.fts5yy24;
236401 }
236402 #line 1122 "fts5parse.sql"
236403 fts5yymsp[-4].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
236404 break;
236405 case 11: /* expr ::= LP expr RP */
236406 #line 129 "fts5parse.y"
236407 {fts5yymsp[-2].minor.fts5yy24 = fts5yymsp[-1].minor.fts5yy24;}
236408 #line 1128 "fts5parse.sql"
236409 break;
236410 case 12: /* expr ::= exprlist */
236411 case 13: /* exprlist ::= cnearset */ fts5yytestcase(fts5yyruleno==13);
236412 #line 130 "fts5parse.y"
236413 {fts5yylhsminor.fts5yy24 = fts5yymsp[0].minor.fts5yy24;}
236414 #line 1134 "fts5parse.sql"
236415 fts5yymsp[0].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
236416 break;
236417 case 14: /* exprlist ::= exprlist cnearset */
236418 #line 133 "fts5parse.y"
236419 {
236420 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseImplicitAnd(pParse, fts5yymsp[-1].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24);
236421 }
236422 #line 1142 "fts5parse.sql"
236423 fts5yymsp[-1].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
236424 break;
236425 case 15: /* cnearset ::= nearset */
236426 #line 137 "fts5parse.y"
236427 {
236428 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46);
236429 }
236430 #line 1150 "fts5parse.sql"
236431 fts5yymsp[0].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
236432 break;
236433 case 16: /* cnearset ::= colset COLON nearset */
236434 #line 140 "fts5parse.y"
236435 {
236436 fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46);
236437 sqlite3Fts5ParseSetColset(pParse, fts5yylhsminor.fts5yy24, fts5yymsp[-2].minor.fts5yy11);
236438 }
236439 #line 1159 "fts5parse.sql"
236440 fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24;
236441 break;
236442 case 17: /* nearset ::= phrase */
236443 #line 151 "fts5parse.y"
236444 { fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53); }
236445 #line 1165 "fts5parse.sql"
236446 fts5yymsp[0].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
236447 break;
236448 case 18: /* nearset ::= CARET phrase */
236449 #line 152 "fts5parse.y"
236450 {
236451 sqlite3Fts5ParseSetCaret(fts5yymsp[0].minor.fts5yy53);
236452 fts5yymsp[-1].minor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53);
236453 }
236454 #line 1174 "fts5parse.sql"
236455 break;
236456 case 19: /* nearset ::= STRING LP nearphrases neardist_opt RP */
236457 #line 156 "fts5parse.y"
236458 {
236459 sqlite3Fts5ParseNear(pParse, &fts5yymsp[-4].minor.fts5yy0);
236460 sqlite3Fts5ParseSetDistance(pParse, fts5yymsp[-2].minor.fts5yy46, &fts5yymsp[-1].minor.fts5yy0);
236461 fts5yylhsminor.fts5yy46 = fts5yymsp[-2].minor.fts5yy46;
236462 }
236463 #line 1183 "fts5parse.sql"
236464 fts5yymsp[-4].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
236465 break;
236466 case 20: /* nearphrases ::= phrase */
236467 #line 162 "fts5parse.y"
236468 {
236469 fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53);
236470 }
236471 #line 1191 "fts5parse.sql"
236472 fts5yymsp[0].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
236473 break;
236474 case 21: /* nearphrases ::= nearphrases phrase */
236475 #line 165 "fts5parse.y"
236476 {
236477 fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, fts5yymsp[-1].minor.fts5yy46, fts5yymsp[0].minor.fts5yy53);
236478 }
236479 #line 1199 "fts5parse.sql"
236480 fts5yymsp[-1].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
236481 break;
236482 case 22: /* neardist_opt ::= */
236483 #line 172 "fts5parse.y"
236484 { fts5yymsp[1].minor.fts5yy0.p = 0; fts5yymsp[1].minor.fts5yy0.n = 0; }
236485 #line 1205 "fts5parse.sql"
236486 break;
236487 case 23: /* neardist_opt ::= COMMA STRING */
236488 #line 173 "fts5parse.y"
236489 { fts5yymsp[-1].minor.fts5yy0 = fts5yymsp[0].minor.fts5yy0; }
236490 #line 1210 "fts5parse.sql"
236491 break;
236492 case 24: /* phrase ::= phrase PLUS STRING star_opt */
236493 #line 185 "fts5parse.y"
236494 {
236495 fts5yylhsminor.fts5yy53 = sqlite3Fts5ParseTerm(pParse, fts5yymsp[-3].minor.fts5yy53, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy4);
236496 }
236497 #line 1217 "fts5parse.sql"
236498 fts5yymsp[-3].minor.fts5yy53 = fts5yylhsminor.fts5yy53;
236499 break;
236500 case 25: /* phrase ::= STRING star_opt */
236501 #line 188 "fts5parse.y"
236502 {
236503 fts5yylhsminor.fts5yy53 = sqlite3Fts5ParseTerm(pParse, 0, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy4);
236504 }
236505 #line 1225 "fts5parse.sql"
236506 fts5yymsp[-1].minor.fts5yy53 = fts5yylhsminor.fts5yy53;
236507 break;
236508 case 26: /* star_opt ::= STAR */
236509 #line 196 "fts5parse.y"
236510 { fts5yymsp[0].minor.fts5yy4 = 1; }
236511 #line 1231 "fts5parse.sql"
236512 break;
236513 case 27: /* star_opt ::= */
236514 #line 197 "fts5parse.y"
236515 { fts5yymsp[1].minor.fts5yy4 = 0; }
236516 #line 1236 "fts5parse.sql"
236517 break;
236518 default:
236519 break;
236520 /********** End reduce actions ************************************************/
236521 };
@@ -235738,15 +236573,17 @@
236573 ){
236574 sqlite3Fts5ParserARG_FETCH
236575 sqlite3Fts5ParserCTX_FETCH
236576 #define FTS5TOKEN fts5yyminor
236577 /************ Begin %syntax_error code ****************************************/
236578 #line 30 "fts5parse.y"
236579
236580 UNUSED_PARAM(fts5yymajor); /* Silence a compiler warning */
236581 sqlite3Fts5ParseError(
236582 pParse, "fts5: syntax error near \"%.*s\"",FTS5TOKEN.n,FTS5TOKEN.p
236583 );
236584 #line 1304 "fts5parse.sql"
236585 /************ End %syntax_error code ******************************************/
236586 sqlite3Fts5ParserARG_STORE /* Suppress warning about unused %extra_argument variable */
236587 sqlite3Fts5ParserCTX_STORE
236588 }
236589
@@ -236012,10 +236849,11 @@
236849 (void)iToken;
236850 return 0;
236851 #endif
236852 }
236853
236854 #line 1 "fts5_aux.c"
236855 /*
236856 ** 2014 May 31
236857 **
236858 ** The author disclaims copyright to this source code. In place of
236859 ** a legal notice, here is a blessing:
@@ -236834,10 +237672,11 @@
237672 }
237673
237674 return rc;
237675 }
237676
237677 #line 1 "fts5_buffer.c"
237678 /*
237679 ** 2014 May 31
237680 **
237681 ** The author disclaims copyright to this source code. In place of
237682 ** a legal notice, here is a blessing:
@@ -237246,10 +238085,11 @@
238085 }
238086 sqlite3_free(p);
238087 }
238088 }
238089
238090 #line 1 "fts5_config.c"
238091 /*
238092 ** 2014 Jun 09
238093 **
238094 ** The author disclaims copyright to this source code. In place of
238095 ** a legal notice, here is a blessing:
@@ -238361,10 +239201,11 @@
239201 va_end(ap);
239202 }
239203
239204
239205
239206 #line 1 "fts5_expr.c"
239207 /*
239208 ** 2014 May 31
239209 **
239210 ** The author disclaims copyright to this source code. In place of
239211 ** a legal notice, here is a blessing:
@@ -241629,10 +242470,11 @@
242470 sqlite3Fts5IndexIterClearTokendata(pT->pIter);
242471 }
242472 }
242473 }
242474
242475 #line 1 "fts5_hash.c"
242476 /*
242477 ** 2014 August 11
242478 **
242479 ** The author disclaims copyright to this source code. In place of
242480 ** a legal notice, here is a blessing:
@@ -242220,10 +243062,11 @@
243062 *ppDoclist = 0;
243063 *pnDoclist = 0;
243064 }
243065 }
243066
243067 #line 1 "fts5_index.c"
243068 /*
243069 ** 2014 May 31
243070 **
243071 ** The author disclaims copyright to this source code. In place of
243072 ** a legal notice, here is a blessing:
@@ -251297,10 +252140,11 @@
252140 fts5StructureInvalidate(p);
252141 }
252142 return fts5IndexReturn(p);
252143 }
252144
252145 #line 1 "fts5_main.c"
252146 /*
252147 ** 2014 Jun 09
252148 **
252149 ** The author disclaims copyright to this source code. In place of
252150 ** a legal notice, here is a blessing:
@@ -254886,11 +255730,11 @@
255730 int nArg, /* Number of args */
255731 sqlite3_value **apUnused /* Function arguments */
255732 ){
255733 assert( nArg==0 );
255734 UNUSED_PARAM2(nArg, apUnused);
255735 sqlite3_result_text(pCtx, "fts5: 2024-11-06 12:58:31 5495b12569c318d5020b4b5a625a392ef8e777b81c0200624fbbc2a6b5eddef9", -1, SQLITE_TRANSIENT);
255736 }
255737
255738 /*
255739 ** Implementation of fts5_locale(LOCALE, TEXT) function.
255740 **
@@ -255139,10 +255983,11 @@
255983 SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3 *db){
255984 return fts5Init(db);
255985 }
255986 #endif
255987
255988 #line 1 "fts5_storage.c"
255989 /*
255990 ** 2014 May 31
255991 **
255992 ** The author disclaims copyright to this source code. In place of
255993 ** a legal notice, here is a blessing:
@@ -256652,10 +257497,11 @@
257497 }
257498 }
257499 return rc;
257500 }
257501
257502 #line 1 "fts5_tokenize.c"
257503 /*
257504 ** 2014 May 31
257505 **
257506 ** The author disclaims copyright to this source code. In place of
257507 ** a legal notice, here is a blessing:
@@ -258140,10 +258986,11 @@
258986 );
258987 }
258988 return rc;
258989 }
258990
258991 #line 1 "fts5_unicode2.c"
258992 /*
258993 ** 2012-05-25
258994 **
258995 ** The author disclaims copyright to this source code. In place of
258996 ** a legal notice, here is a blessing:
@@ -258922,10 +259769,11 @@
259769 }
259770 aAscii[0] = 0; /* 0x00 is never a token character */
259771 }
259772
259773
259774 #line 1 "fts5_varint.c"
259775 /*
259776 ** 2015 May 30
259777 **
259778 ** The author disclaims copyright to this source code. In place of
259779 ** a legal notice, here is a blessing:
@@ -259267,10 +260115,11 @@
260115 if( iVal<(1 << 21) ) return 3;
260116 if( iVal<(1 << 28) ) return 4;
260117 return 5;
260118 }
260119
260120 #line 1 "fts5_vocab.c"
260121 /*
260122 ** 2015 May 08
260123 **
260124 ** The author disclaims copyright to this source code. In place of
260125 ** a legal notice, here is a blessing:
@@ -260077,15 +260926,16 @@
260926
260927 return sqlite3_create_module_v2(db, "fts5vocab", &fts5Vocab, p, 0);
260928 }
260929
260930
260931 /* Here ends the fts5.c composite file. */
260932 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */
260933
260934 /************** End of fts5.c ************************************************/
260935 /************** Begin file stmt.c ********************************************/
260936 #line 1 "tsrc/stmt.c"
260937 /*
260938 ** 2017-05-31
260939 **
260940 ** The author disclaims copyright to this source code. In place of
260941 ** a legal notice, here is a blessing:
@@ -260433,6 +261283,7 @@
261283 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
261284
261285 /************** End of stmt.c ************************************************/
261286 /* Return the source-id for this library */
261287 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
261288 #endif /* SQLITE_AMALGAMATION */
261289 /************************** End of sqlite3.c ******************************/
261290
+14 -4
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -144,13 +144,13 @@
144144
**
145145
** See also: [sqlite3_libversion()],
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149
-#define SQLITE_VERSION "3.47.0"
150
-#define SQLITE_VERSION_NUMBER 3047000
151
-#define SQLITE_SOURCE_ID "2024-10-21 16:30:22 03a9703e27c44437c39363d0baf82db4ebc94538a0f28411c85dda156f82636e"
149
+#define SQLITE_VERSION "3.48.0"
150
+#define SQLITE_VERSION_NUMBER 3048000
151
+#define SQLITE_SOURCE_ID "2024-11-06 12:58:31 5495b12569c318d5020b4b5a625a392ef8e777b81c0200624fbbc2a6b5eddef9"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
@@ -650,10 +650,17 @@
650650
**
651651
** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
652652
** filesystem supports doing multiple write operations atomically when those
653653
** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
654654
** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
655
+**
656
+** The SQLITE_IOCAP_SUBPAGE_READ property means that it is ok to read
657
+** from the database file in amounts that are not a multiple of the
658
+** page size and that do not begin at a page boundary. Without this
659
+** property, SQLite is careful to only do full-page reads and write
660
+** on aligned pages, with the one exception that it will do a sub-page
661
+** read of the first page to access the database header.
655662
*/
656663
#define SQLITE_IOCAP_ATOMIC 0x00000001
657664
#define SQLITE_IOCAP_ATOMIC512 0x00000002
658665
#define SQLITE_IOCAP_ATOMIC1K 0x00000004
659666
#define SQLITE_IOCAP_ATOMIC2K 0x00000008
@@ -666,10 +673,11 @@
666673
#define SQLITE_IOCAP_SEQUENTIAL 0x00000400
667674
#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800
668675
#define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000
669676
#define SQLITE_IOCAP_IMMUTABLE 0x00002000
670677
#define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000
678
+#define SQLITE_IOCAP_SUBPAGE_READ 0x00008000
671679
672680
/*
673681
** CAPI3REF: File Locking Levels
674682
**
675683
** SQLite uses one of these integer values as the second
@@ -812,10 +820,11 @@
812820
** <li> [SQLITE_IOCAP_SEQUENTIAL]
813821
** <li> [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN]
814822
** <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
815823
** <li> [SQLITE_IOCAP_IMMUTABLE]
816824
** <li> [SQLITE_IOCAP_BATCH_ATOMIC]
825
+** <li> [SQLITE_IOCAP_SUBPAGE_READ]
817826
** </ul>
818827
**
819828
** The SQLITE_IOCAP_ATOMIC property means that all writes of
820829
** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values
821830
** mean that writes of blocks that are nnn bytes in size and
@@ -10878,11 +10887,11 @@
1087810887
#endif
1087910888
1088010889
#ifdef __cplusplus
1088110890
} /* End of the 'extern "C"' block */
1088210891
#endif
10883
-#endif /* SQLITE3_H */
10892
+/* #endif for SQLITE3_H will be added by mksqlite3.tcl */
1088410893
1088510894
/******** Begin file sqlite3rtree.h *********/
1088610895
/*
1088710896
** 2010 August 30
1088810897
**
@@ -13570,5 +13579,6 @@
1357013579
#endif
1357113580
1357213581
#endif /* _FTS5_H */
1357313582
1357413583
/******** End of fts5.h *********/
13584
+#endif /* SQLITE3_H */
1357513585
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -144,13 +144,13 @@
144 **
145 ** See also: [sqlite3_libversion()],
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.47.0"
150 #define SQLITE_VERSION_NUMBER 3047000
151 #define SQLITE_SOURCE_ID "2024-10-21 16:30:22 03a9703e27c44437c39363d0baf82db4ebc94538a0f28411c85dda156f82636e"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
@@ -650,10 +650,17 @@
650 **
651 ** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
652 ** filesystem supports doing multiple write operations atomically when those
653 ** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
654 ** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
 
 
 
 
 
 
 
655 */
656 #define SQLITE_IOCAP_ATOMIC 0x00000001
657 #define SQLITE_IOCAP_ATOMIC512 0x00000002
658 #define SQLITE_IOCAP_ATOMIC1K 0x00000004
659 #define SQLITE_IOCAP_ATOMIC2K 0x00000008
@@ -666,10 +673,11 @@
666 #define SQLITE_IOCAP_SEQUENTIAL 0x00000400
667 #define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800
668 #define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000
669 #define SQLITE_IOCAP_IMMUTABLE 0x00002000
670 #define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000
 
671
672 /*
673 ** CAPI3REF: File Locking Levels
674 **
675 ** SQLite uses one of these integer values as the second
@@ -812,10 +820,11 @@
812 ** <li> [SQLITE_IOCAP_SEQUENTIAL]
813 ** <li> [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN]
814 ** <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
815 ** <li> [SQLITE_IOCAP_IMMUTABLE]
816 ** <li> [SQLITE_IOCAP_BATCH_ATOMIC]
 
817 ** </ul>
818 **
819 ** The SQLITE_IOCAP_ATOMIC property means that all writes of
820 ** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values
821 ** mean that writes of blocks that are nnn bytes in size and
@@ -10878,11 +10887,11 @@
10878 #endif
10879
10880 #ifdef __cplusplus
10881 } /* End of the 'extern "C"' block */
10882 #endif
10883 #endif /* SQLITE3_H */
10884
10885 /******** Begin file sqlite3rtree.h *********/
10886 /*
10887 ** 2010 August 30
10888 **
@@ -13570,5 +13579,6 @@
13570 #endif
13571
13572 #endif /* _FTS5_H */
13573
13574 /******** End of fts5.h *********/
 
13575
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -144,13 +144,13 @@
144 **
145 ** See also: [sqlite3_libversion()],
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.48.0"
150 #define SQLITE_VERSION_NUMBER 3048000
151 #define SQLITE_SOURCE_ID "2024-11-06 12:58:31 5495b12569c318d5020b4b5a625a392ef8e777b81c0200624fbbc2a6b5eddef9"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
@@ -650,10 +650,17 @@
650 **
651 ** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
652 ** filesystem supports doing multiple write operations atomically when those
653 ** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
654 ** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
655 **
656 ** The SQLITE_IOCAP_SUBPAGE_READ property means that it is ok to read
657 ** from the database file in amounts that are not a multiple of the
658 ** page size and that do not begin at a page boundary. Without this
659 ** property, SQLite is careful to only do full-page reads and write
660 ** on aligned pages, with the one exception that it will do a sub-page
661 ** read of the first page to access the database header.
662 */
663 #define SQLITE_IOCAP_ATOMIC 0x00000001
664 #define SQLITE_IOCAP_ATOMIC512 0x00000002
665 #define SQLITE_IOCAP_ATOMIC1K 0x00000004
666 #define SQLITE_IOCAP_ATOMIC2K 0x00000008
@@ -666,10 +673,11 @@
673 #define SQLITE_IOCAP_SEQUENTIAL 0x00000400
674 #define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN 0x00000800
675 #define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000
676 #define SQLITE_IOCAP_IMMUTABLE 0x00002000
677 #define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000
678 #define SQLITE_IOCAP_SUBPAGE_READ 0x00008000
679
680 /*
681 ** CAPI3REF: File Locking Levels
682 **
683 ** SQLite uses one of these integer values as the second
@@ -812,10 +820,11 @@
820 ** <li> [SQLITE_IOCAP_SEQUENTIAL]
821 ** <li> [SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN]
822 ** <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
823 ** <li> [SQLITE_IOCAP_IMMUTABLE]
824 ** <li> [SQLITE_IOCAP_BATCH_ATOMIC]
825 ** <li> [SQLITE_IOCAP_SUBPAGE_READ]
826 ** </ul>
827 **
828 ** The SQLITE_IOCAP_ATOMIC property means that all writes of
829 ** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values
830 ** mean that writes of blocks that are nnn bytes in size and
@@ -10878,11 +10887,11 @@
10887 #endif
10888
10889 #ifdef __cplusplus
10890 } /* End of the 'extern "C"' block */
10891 #endif
10892 /* #endif for SQLITE3_H will be added by mksqlite3.tcl */
10893
10894 /******** Begin file sqlite3rtree.h *********/
10895 /*
10896 ** 2010 August 30
10897 **
@@ -13570,5 +13579,6 @@
13579 #endif
13580
13581 #endif /* _FTS5_H */
13582
13583 /******** End of fts5.h *********/
13584 #endif /* SQLITE3_H */
13585
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -42,10 +42,11 @@
4242
.artifact h1.page-title,
4343
.dir h1.page-title,
4444
.doc h1.page-title,
4545
.wiki h1.page-title {
4646
display: block; /* …for potentially long doc titles… */
47
+ color: #444;
4748
}
4849
.artifact .title > .page-title,
4950
.dir .title > .page-title,
5051
.doc .title > .page-title,
5152
.wiki .title > .page-title {
@@ -725,16 +726,16 @@
725726
margin-left: 20pt; /* special case for MD in forum; need less indent */
726727
}
727728
728729
/* Fossil UI uses these, but in sufficiently constrained ways that we
729730
* don't have to be nearly as careful to avoid an overreach. */
730
- .doc > .content h1, .artifact h1, .dir h1, .fileedit h1, .wiki h1 { margin-left: 10pt; }
731
- .doc > .content h2, .artifact h2, .dir h2, .fileedit h2, .wiki h2 { margin-left: 20pt; }
732
- .doc > .content h3, .artifact h3, .dir h3, .fileedit h3, .wiki h3 { margin-left: 30pt; }
733
- .doc > .content h4, .artifact h4, .dir h4, .fileedit h4, .wiki h4 { margin-left: 40pt; }
734
- .doc > .content h5, .artifact h5, .dir h5, .fileedit h5, .wiki h5 { margin-left: 50pt; }
735
- .doc > .content hr, .artifact hr, .dir hr, .fileedit hr, .wiki hr { margin-left: 10pt; }
731
+ .doc > .content h1, .artifact .content h1, .dir .content h1, .fileedit .content h1, .wiki .content h1 { margin-left: 10pt; }
732
+ .doc > .content h2, .artifact .content h2, .dir .content h2, .fileedit .content h2, .wiki .content h2 { margin-left: 20pt; }
733
+ .doc > .content h3, .artifact .content h3, .dir .content h3, .fileedit .content h3, .wiki .content h3 { margin-left: 30pt; }
734
+ .doc > .content h4, .artifact .content h4, .dir .content h4, .fileedit .content h4, .wiki .content h4 { margin-left: 40pt; }
735
+ .doc > .content h5, .artifact .content h5, .dir .content h5, .fileedit .content h5, .wiki .content h5 { margin-left: 50pt; }
736
+ .doc > .content hr, .artifact .content hr, .dir .content hr, .fileedit .content hr, .wiki .content hr { margin-left: 10pt; }
736737
737738
/* Don't need to be nearly as careful with tags Fossil UI doesn't use. */
738739
.doc dd, .artifact dd, .dir dd, .fileedit dd, .wikiedit dd { margin-left: 30pt; margin-bottom: 1em; }
739740
.doc dl, .artifact dl, .dir dl, .fileedit dl, .wikiedit dl { margin-left: 60pt; }
740741
.doc dt, .artifact dt, .dir dt, .fileedit dt, .wikiedit dt { margin-left: 10pt; }
741742
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -42,10 +42,11 @@
42 .artifact h1.page-title,
43 .dir h1.page-title,
44 .doc h1.page-title,
45 .wiki h1.page-title {
46 display: block; /* …for potentially long doc titles… */
 
47 }
48 .artifact .title > .page-title,
49 .dir .title > .page-title,
50 .doc .title > .page-title,
51 .wiki .title > .page-title {
@@ -725,16 +726,16 @@
725 margin-left: 20pt; /* special case for MD in forum; need less indent */
726 }
727
728 /* Fossil UI uses these, but in sufficiently constrained ways that we
729 * don't have to be nearly as careful to avoid an overreach. */
730 .doc > .content h1, .artifact h1, .dir h1, .fileedit h1, .wiki h1 { margin-left: 10pt; }
731 .doc > .content h2, .artifact h2, .dir h2, .fileedit h2, .wiki h2 { margin-left: 20pt; }
732 .doc > .content h3, .artifact h3, .dir h3, .fileedit h3, .wiki h3 { margin-left: 30pt; }
733 .doc > .content h4, .artifact h4, .dir h4, .fileedit h4, .wiki h4 { margin-left: 40pt; }
734 .doc > .content h5, .artifact h5, .dir h5, .fileedit h5, .wiki h5 { margin-left: 50pt; }
735 .doc > .content hr, .artifact hr, .dir hr, .fileedit hr, .wiki hr { margin-left: 10pt; }
736
737 /* Don't need to be nearly as careful with tags Fossil UI doesn't use. */
738 .doc dd, .artifact dd, .dir dd, .fileedit dd, .wikiedit dd { margin-left: 30pt; margin-bottom: 1em; }
739 .doc dl, .artifact dl, .dir dl, .fileedit dl, .wikiedit dl { margin-left: 60pt; }
740 .doc dt, .artifact dt, .dir dt, .fileedit dt, .wikiedit dt { margin-left: 10pt; }
741
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -42,10 +42,11 @@
42 .artifact h1.page-title,
43 .dir h1.page-title,
44 .doc h1.page-title,
45 .wiki h1.page-title {
46 display: block; /* …for potentially long doc titles… */
47 color: #444;
48 }
49 .artifact .title > .page-title,
50 .dir .title > .page-title,
51 .doc .title > .page-title,
52 .wiki .title > .page-title {
@@ -725,16 +726,16 @@
726 margin-left: 20pt; /* special case for MD in forum; need less indent */
727 }
728
729 /* Fossil UI uses these, but in sufficiently constrained ways that we
730 * don't have to be nearly as careful to avoid an overreach. */
731 .doc > .content h1, .artifact .content h1, .dir .content h1, .fileedit .content h1, .wiki .content h1 { margin-left: 10pt; }
732 .doc > .content h2, .artifact .content h2, .dir .content h2, .fileedit .content h2, .wiki .content h2 { margin-left: 20pt; }
733 .doc > .content h3, .artifact .content h3, .dir .content h3, .fileedit .content h3, .wiki .content h3 { margin-left: 30pt; }
734 .doc > .content h4, .artifact .content h4, .dir .content h4, .fileedit .content h4, .wiki .content h4 { margin-left: 40pt; }
735 .doc > .content h5, .artifact .content h5, .dir .content h5, .fileedit .content h5, .wiki .content h5 { margin-left: 50pt; }
736 .doc > .content hr, .artifact .content hr, .dir .content hr, .fileedit .content hr, .wiki .content hr { margin-left: 10pt; }
737
738 /* Don't need to be nearly as careful with tags Fossil UI doesn't use. */
739 .doc dd, .artifact dd, .dir dd, .fileedit dd, .wikiedit dd { margin-left: 30pt; margin-bottom: 1em; }
740 .doc dl, .artifact dl, .dir dl, .fileedit dl, .wikiedit dl { margin-left: 60pt; }
741 .doc dt, .artifact dt, .dir dt, .fileedit dt, .wikiedit dt { margin-left: 10pt; }
742
+2 -2
--- src/checkin.c
+++ src/checkin.c
@@ -967,12 +967,12 @@
967967
/*
968968
** COMMAND: tree
969969
**
970970
** Usage: %fossil tree ?OPTIONS? ?PATHS ...?
971971
**
972
-** List all files in the current check-out in after the fashion of the
973
-** "tree" command. If PATHS is included, only the named files
972
+** List all files in the current check-out much like the "tree"
973
+** command does. If PATHS is included, only the named files
974974
** (or their children if directories) are shown.
975975
**
976976
** Options:
977977
** -r VERSION The specific check-in to list
978978
** -R|--repository REPO Extract info from repository REPO
979979
--- src/checkin.c
+++ src/checkin.c
@@ -967,12 +967,12 @@
967 /*
968 ** COMMAND: tree
969 **
970 ** Usage: %fossil tree ?OPTIONS? ?PATHS ...?
971 **
972 ** List all files in the current check-out in after the fashion of the
973 ** "tree" command. If PATHS is included, only the named files
974 ** (or their children if directories) are shown.
975 **
976 ** Options:
977 ** -r VERSION The specific check-in to list
978 ** -R|--repository REPO Extract info from repository REPO
979
--- src/checkin.c
+++ src/checkin.c
@@ -967,12 +967,12 @@
967 /*
968 ** COMMAND: tree
969 **
970 ** Usage: %fossil tree ?OPTIONS? ?PATHS ...?
971 **
972 ** List all files in the current check-out much like the "tree"
973 ** command does. If PATHS is included, only the named files
974 ** (or their children if directories) are shown.
975 **
976 ** Options:
977 ** -r VERSION The specific check-in to list
978 ** -R|--repository REPO Extract info from repository REPO
979
+1 -1
--- src/diff.c
+++ src/diff.c
@@ -2462,11 +2462,11 @@
24622462
int span; /* combined width of the input sequences */
24632463
int cutoff = 4; /* Max hash chain entries to follow */
24642464
int nextCutoff = -1; /* Value of cutoff for next iteration */
24652465
24662466
span = (iE1 - iS1) + (iE2 - iS2);
2467
- bestScore = -10000;
2467
+ bestScore = -9223300000*(sqlite3_int64)1000000000;
24682468
score = 0;
24692469
iSXb = iSXp = iS1;
24702470
iEXb = iEXp = iS1;
24712471
iSYb = iSYp = iS2;
24722472
iEYb = iEYp = iS2;
24732473
--- src/diff.c
+++ src/diff.c
@@ -2462,11 +2462,11 @@
2462 int span; /* combined width of the input sequences */
2463 int cutoff = 4; /* Max hash chain entries to follow */
2464 int nextCutoff = -1; /* Value of cutoff for next iteration */
2465
2466 span = (iE1 - iS1) + (iE2 - iS2);
2467 bestScore = -10000;
2468 score = 0;
2469 iSXb = iSXp = iS1;
2470 iEXb = iEXp = iS1;
2471 iSYb = iSYp = iS2;
2472 iEYb = iEYp = iS2;
2473
--- src/diff.c
+++ src/diff.c
@@ -2462,11 +2462,11 @@
2462 int span; /* combined width of the input sequences */
2463 int cutoff = 4; /* Max hash chain entries to follow */
2464 int nextCutoff = -1; /* Value of cutoff for next iteration */
2465
2466 span = (iE1 - iS1) + (iE2 - iS2);
2467 bestScore = -9223300000*(sqlite3_int64)1000000000;
2468 score = 0;
2469 iSXb = iSXp = iS1;
2470 iEXb = iEXp = iS1;
2471 iSYb = iSYp = iS2;
2472 iEYb = iEYp = iS2;
2473
+4
--- src/http.c
+++ src/http.c
@@ -768,10 +768,11 @@
768768
** a GET request where there is no PAYLOAD.
769769
**
770770
** Options:
771771
** --compress Use ZLIB compression on the payload
772772
** --mimetype TYPE Mimetype of the payload
773
+** --no-cert-verify Disable TLS cert verification
773774
** --out FILE Store the reply in FILE
774775
** -v Verbose output
775776
** --xfer PAYLOAD in a Fossil xfer protocol message
776777
*/
777778
void test_httpmsg_command(void){
@@ -783,10 +784,13 @@
783784
784785
zMimetype = find_option("mimetype",0,1);
785786
zOutFile = find_option("out","o",1);
786787
if( find_option("verbose","v",0)!=0 ) mHttpFlags |= HTTP_VERBOSE;
787788
if( find_option("compress",0,0)!=0 ) mHttpFlags &= ~HTTP_NOCOMPRESS;
789
+ if( find_option("no-cert-verify",0,0)!=0 ){
790
+ ssl_disable_cert_verification();
791
+ }
788792
if( find_option("xfer",0,0)!=0 ){
789793
mHttpFlags |= HTTP_USE_LOGIN;
790794
mHttpFlags &= ~HTTP_GENERIC;
791795
}
792796
verify_all_options();
793797
--- src/http.c
+++ src/http.c
@@ -768,10 +768,11 @@
768 ** a GET request where there is no PAYLOAD.
769 **
770 ** Options:
771 ** --compress Use ZLIB compression on the payload
772 ** --mimetype TYPE Mimetype of the payload
 
773 ** --out FILE Store the reply in FILE
774 ** -v Verbose output
775 ** --xfer PAYLOAD in a Fossil xfer protocol message
776 */
777 void test_httpmsg_command(void){
@@ -783,10 +784,13 @@
783
784 zMimetype = find_option("mimetype",0,1);
785 zOutFile = find_option("out","o",1);
786 if( find_option("verbose","v",0)!=0 ) mHttpFlags |= HTTP_VERBOSE;
787 if( find_option("compress",0,0)!=0 ) mHttpFlags &= ~HTTP_NOCOMPRESS;
 
 
 
788 if( find_option("xfer",0,0)!=0 ){
789 mHttpFlags |= HTTP_USE_LOGIN;
790 mHttpFlags &= ~HTTP_GENERIC;
791 }
792 verify_all_options();
793
--- src/http.c
+++ src/http.c
@@ -768,10 +768,11 @@
768 ** a GET request where there is no PAYLOAD.
769 **
770 ** Options:
771 ** --compress Use ZLIB compression on the payload
772 ** --mimetype TYPE Mimetype of the payload
773 ** --no-cert-verify Disable TLS cert verification
774 ** --out FILE Store the reply in FILE
775 ** -v Verbose output
776 ** --xfer PAYLOAD in a Fossil xfer protocol message
777 */
778 void test_httpmsg_command(void){
@@ -783,10 +784,13 @@
784
785 zMimetype = find_option("mimetype",0,1);
786 zOutFile = find_option("out","o",1);
787 if( find_option("verbose","v",0)!=0 ) mHttpFlags |= HTTP_VERBOSE;
788 if( find_option("compress",0,0)!=0 ) mHttpFlags &= ~HTTP_NOCOMPRESS;
789 if( find_option("no-cert-verify",0,0)!=0 ){
790 ssl_disable_cert_verification();
791 }
792 if( find_option("xfer",0,0)!=0 ){
793 mHttpFlags |= HTTP_USE_LOGIN;
794 mHttpFlags &= ~HTTP_GENERIC;
795 }
796 verify_all_options();
797
+1 -1
--- src/main.mk
+++ src/main.mk
@@ -704,11 +704,11 @@
704704
705705
# The USE_LINENOISE variable may be undefined, set to 0, or set
706706
# to 1. If it is set to 0, then there is no need to build or link
707707
# the linenoise.o object.
708708
LINENOISE_DEF.0 =
709
-LINENOISE_DEF.1 = -DHAVE_LINENOISE
709
+LINENOISE_DEF.1 = -DHAVE_LINENOISE=2
710710
LINENOISE_DEF. = $(LINENOISE_DEF.0)
711711
LINENOISE_OBJ.0 =
712712
LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
713713
LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
714714
715715
--- src/main.mk
+++ src/main.mk
@@ -704,11 +704,11 @@
704
705 # The USE_LINENOISE variable may be undefined, set to 0, or set
706 # to 1. If it is set to 0, then there is no need to build or link
707 # the linenoise.o object.
708 LINENOISE_DEF.0 =
709 LINENOISE_DEF.1 = -DHAVE_LINENOISE
710 LINENOISE_DEF. = $(LINENOISE_DEF.0)
711 LINENOISE_OBJ.0 =
712 LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
713 LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
714
715
--- src/main.mk
+++ src/main.mk
@@ -704,11 +704,11 @@
704
705 # The USE_LINENOISE variable may be undefined, set to 0, or set
706 # to 1. If it is set to 0, then there is no need to build or link
707 # the linenoise.o object.
708 LINENOISE_DEF.0 =
709 LINENOISE_DEF.1 = -DHAVE_LINENOISE=2
710 LINENOISE_DEF. = $(LINENOISE_DEF.0)
711 LINENOISE_OBJ.0 =
712 LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
713 LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
714
715
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -445,11 +445,11 @@
445445
446446
# The USE_LINENOISE variable may be undefined, set to 0, or set
447447
# to 1. If it is set to 0, then there is no need to build or link
448448
# the linenoise.o object.
449449
LINENOISE_DEF.0 =
450
-LINENOISE_DEF.1 = -DHAVE_LINENOISE
450
+LINENOISE_DEF.1 = -DHAVE_LINENOISE=2
451451
LINENOISE_DEF. = $(LINENOISE_DEF.0)
452452
LINENOISE_OBJ.0 =
453453
LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
454454
LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
455455
456456
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -445,11 +445,11 @@
445
446 # The USE_LINENOISE variable may be undefined, set to 0, or set
447 # to 1. If it is set to 0, then there is no need to build or link
448 # the linenoise.o object.
449 LINENOISE_DEF.0 =
450 LINENOISE_DEF.1 = -DHAVE_LINENOISE
451 LINENOISE_DEF. = $(LINENOISE_DEF.0)
452 LINENOISE_OBJ.0 =
453 LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
454 LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
455
456
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -445,11 +445,11 @@
445
446 # The USE_LINENOISE variable may be undefined, set to 0, or set
447 # to 1. If it is set to 0, then there is no need to build or link
448 # the linenoise.o object.
449 LINENOISE_DEF.0 =
450 LINENOISE_DEF.1 = -DHAVE_LINENOISE=2
451 LINENOISE_DEF. = $(LINENOISE_DEF.0)
452 LINENOISE_OBJ.0 =
453 LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
454 LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
455
456
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,8 +1,12 @@
11
<title>Change Log</title>
22
3
-<h2 id='v2_25'>Changes for version 2.25 (pending)</h2>
3
+<h2 id='v2_26'>Changes for version 2.26 (pending)</h2>
4
+
5
+ * <i>(pending)</i>
6
+
7
+<h2 id='v2_25'>Changes for version 2.25 (2024-11-06)</h2>
48
59
* The "[/help?cmd=ui|fossil ui /]" command now works even for repositories
610
that have non-ASCII filenames
711
* Add the [/help?cmd=tree|fossil tree] command.
812
* On case-insensitive filesystems, store files using the filesystem's
@@ -11,17 +15,20 @@
1115
which is more familiar to Git users. Retain the legacy name for
1216
compatibility.
1317
* Add new query parameters to the [/help?cmd=/timeline|/timeline page]:
1418
d2=, p2=, and dp2=.
1519
* Add options to the [/help?cmd=tag|fossil tag] command that will list tag values.
20
+ * Add the -b|--brief option to the [/help?cmd=status|fossil status] command.
1621
* Add ability to upload unversioned files via the [/help?cmd=/uvlist|/uvlist page].
1722
* Add history search to the [/help?cmd=/chat|/chat page].
1823
* Add Unix socket support to the [/help?cmd=server|server command].
1924
* On Windows, use the root certificates managed by the operating system
2025
(requires OpenSSL 3.2.0 or greater).
2126
* Take into account zero-width and double-width unicode characters when
2227
formatting the command-line timeline.
28
+ * Update the built-in SQLite to version 3.47.0. Precompiled binaries are
29
+ linked against OpenSSL 3.4.0.
2330
* Numerous minor fixes and additions.
2431
2532
2633
<h2 id='v2_24'>Changes for version 2.24 (2024-04-23)</h2>
2734
2835
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,8 +1,12 @@
1 <title>Change Log</title>
2
3 <h2 id='v2_25'>Changes for version 2.25 (pending)</h2>
 
 
 
 
4
5 * The "[/help?cmd=ui|fossil ui /]" command now works even for repositories
6 that have non-ASCII filenames
7 * Add the [/help?cmd=tree|fossil tree] command.
8 * On case-insensitive filesystems, store files using the filesystem's
@@ -11,17 +15,20 @@
11 which is more familiar to Git users. Retain the legacy name for
12 compatibility.
13 * Add new query parameters to the [/help?cmd=/timeline|/timeline page]:
14 d2=, p2=, and dp2=.
15 * Add options to the [/help?cmd=tag|fossil tag] command that will list tag values.
 
16 * Add ability to upload unversioned files via the [/help?cmd=/uvlist|/uvlist page].
17 * Add history search to the [/help?cmd=/chat|/chat page].
18 * Add Unix socket support to the [/help?cmd=server|server command].
19 * On Windows, use the root certificates managed by the operating system
20 (requires OpenSSL 3.2.0 or greater).
21 * Take into account zero-width and double-width unicode characters when
22 formatting the command-line timeline.
 
 
23 * Numerous minor fixes and additions.
24
25
26 <h2 id='v2_24'>Changes for version 2.24 (2024-04-23)</h2>
27
28
--- www/changes.wiki
+++ www/changes.wiki
@@ -1,8 +1,12 @@
1 <title>Change Log</title>
2
3 <h2 id='v2_26'>Changes for version 2.26 (pending)</h2>
4
5 * <i>(pending)</i>
6
7 <h2 id='v2_25'>Changes for version 2.25 (2024-11-06)</h2>
8
9 * The "[/help?cmd=ui|fossil ui /]" command now works even for repositories
10 that have non-ASCII filenames
11 * Add the [/help?cmd=tree|fossil tree] command.
12 * On case-insensitive filesystems, store files using the filesystem's
@@ -11,17 +15,20 @@
15 which is more familiar to Git users. Retain the legacy name for
16 compatibility.
17 * Add new query parameters to the [/help?cmd=/timeline|/timeline page]:
18 d2=, p2=, and dp2=.
19 * Add options to the [/help?cmd=tag|fossil tag] command that will list tag values.
20 * Add the -b|--brief option to the [/help?cmd=status|fossil status] command.
21 * Add ability to upload unversioned files via the [/help?cmd=/uvlist|/uvlist page].
22 * Add history search to the [/help?cmd=/chat|/chat page].
23 * Add Unix socket support to the [/help?cmd=server|server command].
24 * On Windows, use the root certificates managed by the operating system
25 (requires OpenSSL 3.2.0 or greater).
26 * Take into account zero-width and double-width unicode characters when
27 formatting the command-line timeline.
28 * Update the built-in SQLite to version 3.47.0. Precompiled binaries are
29 linked against OpenSSL 3.4.0.
30 * Numerous minor fixes and additions.
31
32
33 <h2 id='v2_24'>Changes for version 2.24 (2024-04-23)</h2>
34
35
+4 -4
--- www/index.wiki
+++ www/index.wiki
@@ -84,16 +84,16 @@
8484
the repository are consistent prior to each commit.
8585
8686
8. <b>Free and Open-Source</b> — [../COPYRIGHT-BSD2.txt|2-clause BSD license].
8787
8888
<hr>
89
-<h3>Latest Release: 2.24 ([/timeline?c=version-2.24|2024-04-23])</h3>
89
+<h3>Latest Release: 2.25 ([/timeline?c=version-2.25|2024-11-06])</h3>
9090
9191
* [/uv/download.html|Download]
92
- * [./changes.wiki#v2_24|Change Summary]
93
- * [/timeline?p=version-2.24&bt=version-2.23&y=ci|Check-ins in version 2.24]
94
- * [/timeline?df=version-2.24&y=ci|Check-ins derived from the 2.24 release]
92
+ * [./changes.wiki#v2_25|Change Summary]
93
+ * [/timeline?p=version-2.25&bt=version-2.24&y=ci|Check-ins in version 2.25]
94
+ * [/timeline?df=version-2.25&y=ci|Check-ins derived from the 2.25 release]
9595
* [/timeline?t=release|Timeline of all past releases]
9696
9797
<hr>
9898
<h3>Quick Start</h3>
9999
100100
--- www/index.wiki
+++ www/index.wiki
@@ -84,16 +84,16 @@
84 the repository are consistent prior to each commit.
85
86 8. <b>Free and Open-Source</b> — [../COPYRIGHT-BSD2.txt|2-clause BSD license].
87
88 <hr>
89 <h3>Latest Release: 2.24 ([/timeline?c=version-2.24|2024-04-23])</h3>
90
91 * [/uv/download.html|Download]
92 * [./changes.wiki#v2_24|Change Summary]
93 * [/timeline?p=version-2.24&bt=version-2.23&y=ci|Check-ins in version 2.24]
94 * [/timeline?df=version-2.24&y=ci|Check-ins derived from the 2.24 release]
95 * [/timeline?t=release|Timeline of all past releases]
96
97 <hr>
98 <h3>Quick Start</h3>
99
100
--- www/index.wiki
+++ www/index.wiki
@@ -84,16 +84,16 @@
84 the repository are consistent prior to each commit.
85
86 8. <b>Free and Open-Source</b> — [../COPYRIGHT-BSD2.txt|2-clause BSD license].
87
88 <hr>
89 <h3>Latest Release: 2.25 ([/timeline?c=version-2.25|2024-11-06])</h3>
90
91 * [/uv/download.html|Download]
92 * [./changes.wiki#v2_25|Change Summary]
93 * [/timeline?p=version-2.25&bt=version-2.24&y=ci|Check-ins in version 2.25]
94 * [/timeline?df=version-2.25&y=ci|Check-ins derived from the 2.25 release]
95 * [/timeline?t=release|Timeline of all past releases]
96
97 <hr>
98 <h3>Quick Start</h3>
99
100

Keyboard Shortcuts

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