Fossil SCM

Update the build-in SQLite and the SQLite-shell to the latest code from the trunk of the SQLite source tree - version 3.7.9 alpha.

drh 2011-10-11 20:46 trunk
Commit 55fb082ae5a265cc971c0a9a8b3b9439f6b6f1b4
3 files changed +44 -20 +102 -644 +3 -3
+44 -20
--- src/shell.c
+++ src/shell.c
@@ -10,11 +10,11 @@
1010
**
1111
*************************************************************************
1212
** This file contains code to implement the "sqlite" command line
1313
** utility for accessing SQLite databases.
1414
*/
15
-#if defined(_WIN32) || defined(WIN32)
15
+#if (defined(_WIN32) || defined(WIN32)) && !defined(_CRT_SECURE_NO_WARNINGS)
1616
/* This needs to come before any includes for MSVC compiler */
1717
#define _CRT_SECURE_NO_WARNINGS
1818
#endif
1919
2020
#include <stdlib.h>
@@ -71,10 +71,15 @@
7171
#define isatty(x) 1
7272
#endif
7373
7474
/* True if the timer is enabled */
7575
static int enableTimer = 0;
76
+
77
+/* ctype macros that work with signed characters */
78
+#define IsSpace(X) isspace((unsigned char)X)
79
+#define IsDigit(X) isdigit((unsigned char)X)
80
+#define ToLower(X) (char)tolower((unsigned char)X)
7681
7782
#if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(__RTP__) && !defined(_WRS_KERNEL)
7883
#include <sys/time.h>
7984
#include <sys/resource.h>
8085
@@ -263,27 +268,27 @@
263268
/*
264269
** Determines if a string is a number of not.
265270
*/
266271
static int isNumber(const char *z, int *realnum){
267272
if( *z=='-' || *z=='+' ) z++;
268
- if( !isdigit(*z) ){
273
+ if( !IsDigit(*z) ){
269274
return 0;
270275
}
271276
z++;
272277
if( realnum ) *realnum = 0;
273
- while( isdigit(*z) ){ z++; }
278
+ while( IsDigit(*z) ){ z++; }
274279
if( *z=='.' ){
275280
z++;
276
- if( !isdigit(*z) ) return 0;
277
- while( isdigit(*z) ){ z++; }
281
+ if( !IsDigit(*z) ) return 0;
282
+ while( IsDigit(*z) ){ z++; }
278283
if( realnum ) *realnum = 1;
279284
}
280285
if( *z=='e' || *z=='E' ){
281286
z++;
282287
if( *z=='+' || *z=='-' ) z++;
283
- if( !isdigit(*z) ) return 0;
284
- while( isdigit(*z) ){ z++; }
288
+ if( !IsDigit(*z) ) return 0;
289
+ while( IsDigit(*z) ){ z++; }
285290
if( realnum ) *realnum = 1;
286291
}
287292
return *z==0;
288293
}
289294
@@ -1027,11 +1032,16 @@
10271032
fprintf(pArg->out, "Lookaside failures due to size: %d\n", iHiwtr);
10281033
sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL, &iCur, &iHiwtr, bReset);
10291034
fprintf(pArg->out, "Lookaside failures due to OOM: %d\n", iHiwtr);
10301035
iHiwtr = iCur = -1;
10311036
sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_USED, &iCur, &iHiwtr, bReset);
1032
- fprintf(pArg->out, "Pager Heap Usage: %d bytes\n", iCur);
1037
+ fprintf(pArg->out, "Pager Heap Usage: %d bytes\n", iCur); iHiwtr = iCur = -1;
1038
+ sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_HIT, &iCur, &iHiwtr, 1);
1039
+ fprintf(pArg->out, "Page cache hits: %d\n", iCur);
1040
+ iHiwtr = iCur = -1;
1041
+ sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_MISS, &iCur, &iHiwtr, 1);
1042
+ fprintf(pArg->out, "Page cache misses: %d\n", iCur);
10331043
iHiwtr = iCur = -1;
10341044
sqlite3_db_status(db, SQLITE_DBSTATUS_SCHEMA_USED, &iCur, &iHiwtr, bReset);
10351045
fprintf(pArg->out, "Schema Heap Usage: %d bytes\n", iCur);
10361046
iHiwtr = iCur = -1;
10371047
sqlite3_db_status(db, SQLITE_DBSTATUS_STMT_USED, &iCur, &iHiwtr, bReset);
@@ -1083,11 +1093,11 @@
10831093
}
10841094
}else{
10851095
if( !pStmt ){
10861096
/* this happens for a comment or white-space */
10871097
zSql = zLeftover;
1088
- while( isspace(zSql[0]) ) zSql++;
1098
+ while( IsSpace(zSql[0]) ) zSql++;
10891099
continue;
10901100
}
10911101
10921102
/* save off the prepared statment handle and reset row count */
10931103
if( pArg ){
@@ -1163,11 +1173,11 @@
11631173
** copy of the error message. Otherwise, set zSql to point to the
11641174
** next statement to execute. */
11651175
rc = sqlite3_finalize(pStmt);
11661176
if( rc==SQLITE_OK ){
11671177
zSql = zLeftover;
1168
- while( isspace(zSql[0]) ) zSql++;
1178
+ while( IsSpace(zSql[0]) ) zSql++;
11691179
}else if( pzErrMsg ){
11701180
*pzErrMsg = save_err_msg(db);
11711181
}
11721182
11731183
/* clear saved stmt handle */
@@ -1434,11 +1444,11 @@
14341444
*/
14351445
static int booleanValue(char *zArg){
14361446
int val = atoi(zArg);
14371447
int j;
14381448
for(j=0; zArg[j]; j++){
1439
- zArg[j] = (char)tolower(zArg[j]);
1449
+ zArg[j] = ToLower(zArg[j]);
14401450
}
14411451
if( strcmp(zArg,"on")==0 ){
14421452
val = 1;
14431453
}else if( strcmp(zArg,"yes")==0 ){
14441454
val = 1;
@@ -1460,11 +1470,11 @@
14601470
char *azArg[50];
14611471
14621472
/* Parse the input line into tokens.
14631473
*/
14641474
while( zLine[i] && nArg<ArraySize(azArg) ){
1465
- while( isspace((unsigned char)zLine[i]) ){ i++; }
1475
+ while( IsSpace(zLine[i]) ){ i++; }
14661476
if( zLine[i]==0 ) break;
14671477
if( zLine[i]=='\'' || zLine[i]=='"' ){
14681478
int delim = zLine[i++];
14691479
azArg[nArg++] = &zLine[i];
14701480
while( zLine[i] && zLine[i]!=delim ){ i++; }
@@ -1472,11 +1482,11 @@
14721482
zLine[i++] = 0;
14731483
}
14741484
if( delim=='"' ) resolve_backslashes(azArg[nArg-1]);
14751485
}else{
14761486
azArg[nArg++] = &zLine[i];
1477
- while( zLine[i] && !isspace((unsigned char)zLine[i]) ){ i++; }
1487
+ while( zLine[i] && !IsSpace(zLine[i]) ){ i++; }
14781488
if( zLine[i] ) zLine[i++] = 0;
14791489
resolve_backslashes(azArg[nArg-1]);
14801490
}
14811491
}
14821492
@@ -1671,11 +1681,11 @@
16711681
nSep = strlen30(p->separator);
16721682
if( nSep==0 ){
16731683
fprintf(stderr, "Error: non-null separator required for import\n");
16741684
return 1;
16751685
}
1676
- zSql = sqlite3_mprintf("SELECT * FROM '%q'", zTable);
1686
+ zSql = sqlite3_mprintf("SELECT * FROM %s", zTable);
16771687
if( zSql==0 ){
16781688
fprintf(stderr, "Error: out of memory\n");
16791689
return 1;
16801690
}
16811691
nByte = strlen30(zSql);
@@ -1693,11 +1703,11 @@
16931703
zSql = malloc( nByte + 20 + nCol*2 );
16941704
if( zSql==0 ){
16951705
fprintf(stderr, "Error: out of memory\n");
16961706
return 1;
16971707
}
1698
- sqlite3_snprintf(nByte+20, zSql, "INSERT INTO '%q' VALUES(?", zTable);
1708
+ sqlite3_snprintf(nByte+20, zSql, "INSERT INTO %s VALUES(?", zTable);
16991709
j = strlen30(zSql);
17001710
for(i=1; i<nCol; i++){
17011711
zSql[j++] = ',';
17021712
zSql[j++] = '?';
17031713
}
@@ -2014,11 +2024,11 @@
20142024
memcpy(&data, p, sizeof(data));
20152025
data.showHeader = 0;
20162026
data.mode = MODE_Semi;
20172027
if( nArg>1 ){
20182028
int i;
2019
- for(i=0; azArg[1][i]; i++) azArg[1][i] = (char)tolower(azArg[1][i]);
2029
+ for(i=0; azArg[1][i]; i++) azArg[1][i] = ToLower(azArg[1][i]);
20202030
if( strcmp(azArg[1],"sqlite_master")==0 ){
20212031
char *new_argv[2], *new_colv[2];
20222032
new_argv[0] = "CREATE TABLE sqlite_master (\n"
20232033
" type text,\n"
20242034
" name text,\n"
@@ -2337,11 +2347,11 @@
23372347
/*
23382348
** Test to see if a line consists entirely of whitespace.
23392349
*/
23402350
static int _all_whitespace(const char *z){
23412351
for(; *z; z++){
2342
- if( isspace(*(unsigned char*)z) ) continue;
2352
+ if( IsSpace(z[0]) ) continue;
23432353
if( *z=='/' && z[1]=='*' ){
23442354
z += 2;
23452355
while( *z && (*z!='*' || z[1]!='/') ){ z++; }
23462356
if( *z==0 ) return 0;
23472357
z++;
@@ -2362,15 +2372,15 @@
23622372
** Return TRUE if the line typed in is an SQL command terminator other
23632373
** than a semi-colon. The SQL Server style "go" command is understood
23642374
** as is the Oracle "/".
23652375
*/
23662376
static int _is_command_terminator(const char *zLine){
2367
- while( isspace(*(unsigned char*)zLine) ){ zLine++; };
2377
+ while( IsSpace(zLine[0]) ){ zLine++; };
23682378
if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ){
23692379
return 1; /* Oracle */
23702380
}
2371
- if( tolower(zLine[0])=='g' && tolower(zLine[1])=='o'
2381
+ if( ToLower(zLine[0])=='g' && ToLower(zLine[1])=='o'
23722382
&& _all_whitespace(&zLine[2]) ){
23732383
return 1; /* SQL Server */
23742384
}
23752385
return 0;
23762386
}
@@ -2436,11 +2446,11 @@
24362446
memcpy(zLine,";",2);
24372447
}
24382448
nSqlPrior = nSql;
24392449
if( zSql==0 ){
24402450
int i;
2441
- for(i=0; zLine[i] && isspace((unsigned char)zLine[i]); i++){}
2451
+ for(i=0; zLine[i] && IsSpace(zLine[i]); i++){}
24422452
if( zLine[i]!=0 ){
24432453
nSql = strlen30(zLine);
24442454
zSql = malloc( nSql+3 );
24452455
if( zSql==0 ){
24462456
fprintf(stderr, "Error: out of memory\n");
@@ -2630,10 +2640,13 @@
26302640
" -version show SQLite version\n"
26312641
" -vfs NAME use NAME as the default VFS\n"
26322642
#ifdef SQLITE_ENABLE_VFSTRACE
26332643
" -vfstrace enable tracing of all VFS calls\n"
26342644
#endif
2645
+#ifdef SQLITE_ENABLE_MULTIPLEX
2646
+ " -multiplex enable the multiplexor VFS\n"
2647
+#endif
26352648
;
26362649
static void usage(int showDetail){
26372650
fprintf(stderr,
26382651
"Usage: %s [OPTIONS] FILENAME [SQL]\n"
26392652
"FILENAME is the name of an SQLite database. A new database is created\n"
@@ -2731,10 +2744,15 @@
27312744
void *pOutArg,
27322745
int makeDefault
27332746
);
27342747
vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1);
27352748
#endif
2749
+#ifdef SQLITE_ENABLE_MULTIPLEX
2750
+ }else if( strcmp(argv[i],"-multiplex")==0 ){
2751
+ extern int sqlite3_multiple_initialize(const char*,int);
2752
+ sqlite3_multiplex_initialize(0, 1);
2753
+#endif
27362754
}else if( strcmp(argv[i],"-vfs")==0 ){
27372755
sqlite3_vfs *pVfs = sqlite3_vfs_find(argv[++i]);
27382756
if( pVfs ){
27392757
sqlite3_vfs_register(pVfs, 1);
27402758
}else{
@@ -2855,12 +2873,18 @@
28552873
stdin_is_interactive = 0;
28562874
}else if( strcmp(z,"-heap")==0 ){
28572875
i++;
28582876
}else if( strcmp(z,"-vfs")==0 ){
28592877
i++;
2878
+#ifdef SQLITE_ENABLE_VFSTRACE
28602879
}else if( strcmp(z,"-vfstrace")==0 ){
28612880
i++;
2881
+#endif
2882
+#ifdef SQLITE_ENABLE_MULTIPLEX
2883
+ }else if( strcmp(z,"-multiplex")==0 ){
2884
+ i++;
2885
+#endif
28622886
}else if( strcmp(z,"-help")==0 || strcmp(z, "--help")==0 ){
28632887
usage(1);
28642888
}else{
28652889
fprintf(stderr,"%s: Error: unknown option: %s\n", Argv0, z);
28662890
fprintf(stderr,"Use -help for a list of options.\n");
28672891
--- src/shell.c
+++ src/shell.c
@@ -10,11 +10,11 @@
10 **
11 *************************************************************************
12 ** This file contains code to implement the "sqlite" command line
13 ** utility for accessing SQLite databases.
14 */
15 #if defined(_WIN32) || defined(WIN32)
16 /* This needs to come before any includes for MSVC compiler */
17 #define _CRT_SECURE_NO_WARNINGS
18 #endif
19
20 #include <stdlib.h>
@@ -71,10 +71,15 @@
71 #define isatty(x) 1
72 #endif
73
74 /* True if the timer is enabled */
75 static int enableTimer = 0;
 
 
 
 
 
76
77 #if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(__RTP__) && !defined(_WRS_KERNEL)
78 #include <sys/time.h>
79 #include <sys/resource.h>
80
@@ -263,27 +268,27 @@
263 /*
264 ** Determines if a string is a number of not.
265 */
266 static int isNumber(const char *z, int *realnum){
267 if( *z=='-' || *z=='+' ) z++;
268 if( !isdigit(*z) ){
269 return 0;
270 }
271 z++;
272 if( realnum ) *realnum = 0;
273 while( isdigit(*z) ){ z++; }
274 if( *z=='.' ){
275 z++;
276 if( !isdigit(*z) ) return 0;
277 while( isdigit(*z) ){ z++; }
278 if( realnum ) *realnum = 1;
279 }
280 if( *z=='e' || *z=='E' ){
281 z++;
282 if( *z=='+' || *z=='-' ) z++;
283 if( !isdigit(*z) ) return 0;
284 while( isdigit(*z) ){ z++; }
285 if( realnum ) *realnum = 1;
286 }
287 return *z==0;
288 }
289
@@ -1027,11 +1032,16 @@
1027 fprintf(pArg->out, "Lookaside failures due to size: %d\n", iHiwtr);
1028 sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL, &iCur, &iHiwtr, bReset);
1029 fprintf(pArg->out, "Lookaside failures due to OOM: %d\n", iHiwtr);
1030 iHiwtr = iCur = -1;
1031 sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_USED, &iCur, &iHiwtr, bReset);
1032 fprintf(pArg->out, "Pager Heap Usage: %d bytes\n", iCur);
 
 
 
 
 
1033 iHiwtr = iCur = -1;
1034 sqlite3_db_status(db, SQLITE_DBSTATUS_SCHEMA_USED, &iCur, &iHiwtr, bReset);
1035 fprintf(pArg->out, "Schema Heap Usage: %d bytes\n", iCur);
1036 iHiwtr = iCur = -1;
1037 sqlite3_db_status(db, SQLITE_DBSTATUS_STMT_USED, &iCur, &iHiwtr, bReset);
@@ -1083,11 +1093,11 @@
1083 }
1084 }else{
1085 if( !pStmt ){
1086 /* this happens for a comment or white-space */
1087 zSql = zLeftover;
1088 while( isspace(zSql[0]) ) zSql++;
1089 continue;
1090 }
1091
1092 /* save off the prepared statment handle and reset row count */
1093 if( pArg ){
@@ -1163,11 +1173,11 @@
1163 ** copy of the error message. Otherwise, set zSql to point to the
1164 ** next statement to execute. */
1165 rc = sqlite3_finalize(pStmt);
1166 if( rc==SQLITE_OK ){
1167 zSql = zLeftover;
1168 while( isspace(zSql[0]) ) zSql++;
1169 }else if( pzErrMsg ){
1170 *pzErrMsg = save_err_msg(db);
1171 }
1172
1173 /* clear saved stmt handle */
@@ -1434,11 +1444,11 @@
1434 */
1435 static int booleanValue(char *zArg){
1436 int val = atoi(zArg);
1437 int j;
1438 for(j=0; zArg[j]; j++){
1439 zArg[j] = (char)tolower(zArg[j]);
1440 }
1441 if( strcmp(zArg,"on")==0 ){
1442 val = 1;
1443 }else if( strcmp(zArg,"yes")==0 ){
1444 val = 1;
@@ -1460,11 +1470,11 @@
1460 char *azArg[50];
1461
1462 /* Parse the input line into tokens.
1463 */
1464 while( zLine[i] && nArg<ArraySize(azArg) ){
1465 while( isspace((unsigned char)zLine[i]) ){ i++; }
1466 if( zLine[i]==0 ) break;
1467 if( zLine[i]=='\'' || zLine[i]=='"' ){
1468 int delim = zLine[i++];
1469 azArg[nArg++] = &zLine[i];
1470 while( zLine[i] && zLine[i]!=delim ){ i++; }
@@ -1472,11 +1482,11 @@
1472 zLine[i++] = 0;
1473 }
1474 if( delim=='"' ) resolve_backslashes(azArg[nArg-1]);
1475 }else{
1476 azArg[nArg++] = &zLine[i];
1477 while( zLine[i] && !isspace((unsigned char)zLine[i]) ){ i++; }
1478 if( zLine[i] ) zLine[i++] = 0;
1479 resolve_backslashes(azArg[nArg-1]);
1480 }
1481 }
1482
@@ -1671,11 +1681,11 @@
1671 nSep = strlen30(p->separator);
1672 if( nSep==0 ){
1673 fprintf(stderr, "Error: non-null separator required for import\n");
1674 return 1;
1675 }
1676 zSql = sqlite3_mprintf("SELECT * FROM '%q'", zTable);
1677 if( zSql==0 ){
1678 fprintf(stderr, "Error: out of memory\n");
1679 return 1;
1680 }
1681 nByte = strlen30(zSql);
@@ -1693,11 +1703,11 @@
1693 zSql = malloc( nByte + 20 + nCol*2 );
1694 if( zSql==0 ){
1695 fprintf(stderr, "Error: out of memory\n");
1696 return 1;
1697 }
1698 sqlite3_snprintf(nByte+20, zSql, "INSERT INTO '%q' VALUES(?", zTable);
1699 j = strlen30(zSql);
1700 for(i=1; i<nCol; i++){
1701 zSql[j++] = ',';
1702 zSql[j++] = '?';
1703 }
@@ -2014,11 +2024,11 @@
2014 memcpy(&data, p, sizeof(data));
2015 data.showHeader = 0;
2016 data.mode = MODE_Semi;
2017 if( nArg>1 ){
2018 int i;
2019 for(i=0; azArg[1][i]; i++) azArg[1][i] = (char)tolower(azArg[1][i]);
2020 if( strcmp(azArg[1],"sqlite_master")==0 ){
2021 char *new_argv[2], *new_colv[2];
2022 new_argv[0] = "CREATE TABLE sqlite_master (\n"
2023 " type text,\n"
2024 " name text,\n"
@@ -2337,11 +2347,11 @@
2337 /*
2338 ** Test to see if a line consists entirely of whitespace.
2339 */
2340 static int _all_whitespace(const char *z){
2341 for(; *z; z++){
2342 if( isspace(*(unsigned char*)z) ) continue;
2343 if( *z=='/' && z[1]=='*' ){
2344 z += 2;
2345 while( *z && (*z!='*' || z[1]!='/') ){ z++; }
2346 if( *z==0 ) return 0;
2347 z++;
@@ -2362,15 +2372,15 @@
2362 ** Return TRUE if the line typed in is an SQL command terminator other
2363 ** than a semi-colon. The SQL Server style "go" command is understood
2364 ** as is the Oracle "/".
2365 */
2366 static int _is_command_terminator(const char *zLine){
2367 while( isspace(*(unsigned char*)zLine) ){ zLine++; };
2368 if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ){
2369 return 1; /* Oracle */
2370 }
2371 if( tolower(zLine[0])=='g' && tolower(zLine[1])=='o'
2372 && _all_whitespace(&zLine[2]) ){
2373 return 1; /* SQL Server */
2374 }
2375 return 0;
2376 }
@@ -2436,11 +2446,11 @@
2436 memcpy(zLine,";",2);
2437 }
2438 nSqlPrior = nSql;
2439 if( zSql==0 ){
2440 int i;
2441 for(i=0; zLine[i] && isspace((unsigned char)zLine[i]); i++){}
2442 if( zLine[i]!=0 ){
2443 nSql = strlen30(zLine);
2444 zSql = malloc( nSql+3 );
2445 if( zSql==0 ){
2446 fprintf(stderr, "Error: out of memory\n");
@@ -2630,10 +2640,13 @@
2630 " -version show SQLite version\n"
2631 " -vfs NAME use NAME as the default VFS\n"
2632 #ifdef SQLITE_ENABLE_VFSTRACE
2633 " -vfstrace enable tracing of all VFS calls\n"
2634 #endif
 
 
 
2635 ;
2636 static void usage(int showDetail){
2637 fprintf(stderr,
2638 "Usage: %s [OPTIONS] FILENAME [SQL]\n"
2639 "FILENAME is the name of an SQLite database. A new database is created\n"
@@ -2731,10 +2744,15 @@
2731 void *pOutArg,
2732 int makeDefault
2733 );
2734 vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1);
2735 #endif
 
 
 
 
 
2736 }else if( strcmp(argv[i],"-vfs")==0 ){
2737 sqlite3_vfs *pVfs = sqlite3_vfs_find(argv[++i]);
2738 if( pVfs ){
2739 sqlite3_vfs_register(pVfs, 1);
2740 }else{
@@ -2855,12 +2873,18 @@
2855 stdin_is_interactive = 0;
2856 }else if( strcmp(z,"-heap")==0 ){
2857 i++;
2858 }else if( strcmp(z,"-vfs")==0 ){
2859 i++;
 
2860 }else if( strcmp(z,"-vfstrace")==0 ){
2861 i++;
 
 
 
 
 
2862 }else if( strcmp(z,"-help")==0 || strcmp(z, "--help")==0 ){
2863 usage(1);
2864 }else{
2865 fprintf(stderr,"%s: Error: unknown option: %s\n", Argv0, z);
2866 fprintf(stderr,"Use -help for a list of options.\n");
2867
--- src/shell.c
+++ src/shell.c
@@ -10,11 +10,11 @@
10 **
11 *************************************************************************
12 ** This file contains code to implement the "sqlite" command line
13 ** utility for accessing SQLite databases.
14 */
15 #if (defined(_WIN32) || defined(WIN32)) && !defined(_CRT_SECURE_NO_WARNINGS)
16 /* This needs to come before any includes for MSVC compiler */
17 #define _CRT_SECURE_NO_WARNINGS
18 #endif
19
20 #include <stdlib.h>
@@ -71,10 +71,15 @@
71 #define isatty(x) 1
72 #endif
73
74 /* True if the timer is enabled */
75 static int enableTimer = 0;
76
77 /* ctype macros that work with signed characters */
78 #define IsSpace(X) isspace((unsigned char)X)
79 #define IsDigit(X) isdigit((unsigned char)X)
80 #define ToLower(X) (char)tolower((unsigned char)X)
81
82 #if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(__RTP__) && !defined(_WRS_KERNEL)
83 #include <sys/time.h>
84 #include <sys/resource.h>
85
@@ -263,27 +268,27 @@
268 /*
269 ** Determines if a string is a number of not.
270 */
271 static int isNumber(const char *z, int *realnum){
272 if( *z=='-' || *z=='+' ) z++;
273 if( !IsDigit(*z) ){
274 return 0;
275 }
276 z++;
277 if( realnum ) *realnum = 0;
278 while( IsDigit(*z) ){ z++; }
279 if( *z=='.' ){
280 z++;
281 if( !IsDigit(*z) ) return 0;
282 while( IsDigit(*z) ){ z++; }
283 if( realnum ) *realnum = 1;
284 }
285 if( *z=='e' || *z=='E' ){
286 z++;
287 if( *z=='+' || *z=='-' ) z++;
288 if( !IsDigit(*z) ) return 0;
289 while( IsDigit(*z) ){ z++; }
290 if( realnum ) *realnum = 1;
291 }
292 return *z==0;
293 }
294
@@ -1027,11 +1032,16 @@
1032 fprintf(pArg->out, "Lookaside failures due to size: %d\n", iHiwtr);
1033 sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL, &iCur, &iHiwtr, bReset);
1034 fprintf(pArg->out, "Lookaside failures due to OOM: %d\n", iHiwtr);
1035 iHiwtr = iCur = -1;
1036 sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_USED, &iCur, &iHiwtr, bReset);
1037 fprintf(pArg->out, "Pager Heap Usage: %d bytes\n", iCur); iHiwtr = iCur = -1;
1038 sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_HIT, &iCur, &iHiwtr, 1);
1039 fprintf(pArg->out, "Page cache hits: %d\n", iCur);
1040 iHiwtr = iCur = -1;
1041 sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_MISS, &iCur, &iHiwtr, 1);
1042 fprintf(pArg->out, "Page cache misses: %d\n", iCur);
1043 iHiwtr = iCur = -1;
1044 sqlite3_db_status(db, SQLITE_DBSTATUS_SCHEMA_USED, &iCur, &iHiwtr, bReset);
1045 fprintf(pArg->out, "Schema Heap Usage: %d bytes\n", iCur);
1046 iHiwtr = iCur = -1;
1047 sqlite3_db_status(db, SQLITE_DBSTATUS_STMT_USED, &iCur, &iHiwtr, bReset);
@@ -1083,11 +1093,11 @@
1093 }
1094 }else{
1095 if( !pStmt ){
1096 /* this happens for a comment or white-space */
1097 zSql = zLeftover;
1098 while( IsSpace(zSql[0]) ) zSql++;
1099 continue;
1100 }
1101
1102 /* save off the prepared statment handle and reset row count */
1103 if( pArg ){
@@ -1163,11 +1173,11 @@
1173 ** copy of the error message. Otherwise, set zSql to point to the
1174 ** next statement to execute. */
1175 rc = sqlite3_finalize(pStmt);
1176 if( rc==SQLITE_OK ){
1177 zSql = zLeftover;
1178 while( IsSpace(zSql[0]) ) zSql++;
1179 }else if( pzErrMsg ){
1180 *pzErrMsg = save_err_msg(db);
1181 }
1182
1183 /* clear saved stmt handle */
@@ -1434,11 +1444,11 @@
1444 */
1445 static int booleanValue(char *zArg){
1446 int val = atoi(zArg);
1447 int j;
1448 for(j=0; zArg[j]; j++){
1449 zArg[j] = ToLower(zArg[j]);
1450 }
1451 if( strcmp(zArg,"on")==0 ){
1452 val = 1;
1453 }else if( strcmp(zArg,"yes")==0 ){
1454 val = 1;
@@ -1460,11 +1470,11 @@
1470 char *azArg[50];
1471
1472 /* Parse the input line into tokens.
1473 */
1474 while( zLine[i] && nArg<ArraySize(azArg) ){
1475 while( IsSpace(zLine[i]) ){ i++; }
1476 if( zLine[i]==0 ) break;
1477 if( zLine[i]=='\'' || zLine[i]=='"' ){
1478 int delim = zLine[i++];
1479 azArg[nArg++] = &zLine[i];
1480 while( zLine[i] && zLine[i]!=delim ){ i++; }
@@ -1472,11 +1482,11 @@
1482 zLine[i++] = 0;
1483 }
1484 if( delim=='"' ) resolve_backslashes(azArg[nArg-1]);
1485 }else{
1486 azArg[nArg++] = &zLine[i];
1487 while( zLine[i] && !IsSpace(zLine[i]) ){ i++; }
1488 if( zLine[i] ) zLine[i++] = 0;
1489 resolve_backslashes(azArg[nArg-1]);
1490 }
1491 }
1492
@@ -1671,11 +1681,11 @@
1681 nSep = strlen30(p->separator);
1682 if( nSep==0 ){
1683 fprintf(stderr, "Error: non-null separator required for import\n");
1684 return 1;
1685 }
1686 zSql = sqlite3_mprintf("SELECT * FROM %s", zTable);
1687 if( zSql==0 ){
1688 fprintf(stderr, "Error: out of memory\n");
1689 return 1;
1690 }
1691 nByte = strlen30(zSql);
@@ -1693,11 +1703,11 @@
1703 zSql = malloc( nByte + 20 + nCol*2 );
1704 if( zSql==0 ){
1705 fprintf(stderr, "Error: out of memory\n");
1706 return 1;
1707 }
1708 sqlite3_snprintf(nByte+20, zSql, "INSERT INTO %s VALUES(?", zTable);
1709 j = strlen30(zSql);
1710 for(i=1; i<nCol; i++){
1711 zSql[j++] = ',';
1712 zSql[j++] = '?';
1713 }
@@ -2014,11 +2024,11 @@
2024 memcpy(&data, p, sizeof(data));
2025 data.showHeader = 0;
2026 data.mode = MODE_Semi;
2027 if( nArg>1 ){
2028 int i;
2029 for(i=0; azArg[1][i]; i++) azArg[1][i] = ToLower(azArg[1][i]);
2030 if( strcmp(azArg[1],"sqlite_master")==0 ){
2031 char *new_argv[2], *new_colv[2];
2032 new_argv[0] = "CREATE TABLE sqlite_master (\n"
2033 " type text,\n"
2034 " name text,\n"
@@ -2337,11 +2347,11 @@
2347 /*
2348 ** Test to see if a line consists entirely of whitespace.
2349 */
2350 static int _all_whitespace(const char *z){
2351 for(; *z; z++){
2352 if( IsSpace(z[0]) ) continue;
2353 if( *z=='/' && z[1]=='*' ){
2354 z += 2;
2355 while( *z && (*z!='*' || z[1]!='/') ){ z++; }
2356 if( *z==0 ) return 0;
2357 z++;
@@ -2362,15 +2372,15 @@
2372 ** Return TRUE if the line typed in is an SQL command terminator other
2373 ** than a semi-colon. The SQL Server style "go" command is understood
2374 ** as is the Oracle "/".
2375 */
2376 static int _is_command_terminator(const char *zLine){
2377 while( IsSpace(zLine[0]) ){ zLine++; };
2378 if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ){
2379 return 1; /* Oracle */
2380 }
2381 if( ToLower(zLine[0])=='g' && ToLower(zLine[1])=='o'
2382 && _all_whitespace(&zLine[2]) ){
2383 return 1; /* SQL Server */
2384 }
2385 return 0;
2386 }
@@ -2436,11 +2446,11 @@
2446 memcpy(zLine,";",2);
2447 }
2448 nSqlPrior = nSql;
2449 if( zSql==0 ){
2450 int i;
2451 for(i=0; zLine[i] && IsSpace(zLine[i]); i++){}
2452 if( zLine[i]!=0 ){
2453 nSql = strlen30(zLine);
2454 zSql = malloc( nSql+3 );
2455 if( zSql==0 ){
2456 fprintf(stderr, "Error: out of memory\n");
@@ -2630,10 +2640,13 @@
2640 " -version show SQLite version\n"
2641 " -vfs NAME use NAME as the default VFS\n"
2642 #ifdef SQLITE_ENABLE_VFSTRACE
2643 " -vfstrace enable tracing of all VFS calls\n"
2644 #endif
2645 #ifdef SQLITE_ENABLE_MULTIPLEX
2646 " -multiplex enable the multiplexor VFS\n"
2647 #endif
2648 ;
2649 static void usage(int showDetail){
2650 fprintf(stderr,
2651 "Usage: %s [OPTIONS] FILENAME [SQL]\n"
2652 "FILENAME is the name of an SQLite database. A new database is created\n"
@@ -2731,10 +2744,15 @@
2744 void *pOutArg,
2745 int makeDefault
2746 );
2747 vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1);
2748 #endif
2749 #ifdef SQLITE_ENABLE_MULTIPLEX
2750 }else if( strcmp(argv[i],"-multiplex")==0 ){
2751 extern int sqlite3_multiple_initialize(const char*,int);
2752 sqlite3_multiplex_initialize(0, 1);
2753 #endif
2754 }else if( strcmp(argv[i],"-vfs")==0 ){
2755 sqlite3_vfs *pVfs = sqlite3_vfs_find(argv[++i]);
2756 if( pVfs ){
2757 sqlite3_vfs_register(pVfs, 1);
2758 }else{
@@ -2855,12 +2873,18 @@
2873 stdin_is_interactive = 0;
2874 }else if( strcmp(z,"-heap")==0 ){
2875 i++;
2876 }else if( strcmp(z,"-vfs")==0 ){
2877 i++;
2878 #ifdef SQLITE_ENABLE_VFSTRACE
2879 }else if( strcmp(z,"-vfstrace")==0 ){
2880 i++;
2881 #endif
2882 #ifdef SQLITE_ENABLE_MULTIPLEX
2883 }else if( strcmp(z,"-multiplex")==0 ){
2884 i++;
2885 #endif
2886 }else if( strcmp(z,"-help")==0 || strcmp(z, "--help")==0 ){
2887 usage(1);
2888 }else{
2889 fprintf(stderr,"%s: Error: unknown option: %s\n", Argv0, z);
2890 fprintf(stderr,"Use -help for a list of options.\n");
2891
+102 -644
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,11 +24,10 @@
2424
#endif
2525
#ifndef SQLITE_API
2626
# define SQLITE_API
2727
#endif
2828
/************** Begin file sqliteInt.h ***************************************/
29
-#line 1 "tsrc/sqliteInt.h"
3029
/*
3130
** 2001 September 15
3231
**
3332
** The author disclaims copyright to this source code. In place of
3433
** a legal notice, here is a blessing:
@@ -79,11 +78,10 @@
7978
#include "config.h"
8079
#endif
8180
8281
/************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
8382
/************** Begin file sqliteLimit.h *************************************/
84
-#line 1 "tsrc/sqliteLimit.h"
8583
/*
8684
** 2007 May 7
8785
**
8886
** The author disclaims copyright to this source code. In place of
8987
** a legal notice, here is a blessing:
@@ -291,11 +289,10 @@
291289
# define SQLITE_MAX_TRIGGER_DEPTH 1000
292290
#endif
293291
294292
/************** End of sqliteLimit.h *****************************************/
295293
/************** Continuing where we left off in sqliteInt.h ******************/
296
-#line 54 "tsrc/sqliteInt.h"
297294
298295
/* Disable nuisance warnings on Borland compilers */
299296
#if defined(__BORLANDC__)
300297
#pragma warn -rch /* unreachable code */
301298
#pragma warn -ccc /* Condition is always true or false */
@@ -548,11 +545,10 @@
548545
# define unlikely(X) !!(X)
549546
#endif
550547
551548
/************** Include sqlite3.h in the middle of sqliteInt.h ***************/
552549
/************** Begin file sqlite3.h *****************************************/
553
-#line 1 "tsrc/sqlite3.h"
554550
/*
555551
** 2001 September 15
556552
**
557553
** The author disclaims copyright to this source code. In place of
558554
** a legal notice, here is a blessing:
@@ -660,11 +656,11 @@
660656
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
661657
** [sqlite_version()] and [sqlite_source_id()].
662658
*/
663659
#define SQLITE_VERSION "3.7.9"
664660
#define SQLITE_VERSION_NUMBER 3007009
665
-#define SQLITE_SOURCE_ID "2011-10-07 18:24:25 d4f95b3b6e9f4a4072606af5daa17ea7c645382e"
661
+#define SQLITE_SOURCE_ID "2011-10-11 20:41:54 b94a80a832777f0e639f6a81fcfe169bf970a8c0"
666662
667663
/*
668664
** CAPI3REF: Run-Time Library Version Numbers
669665
** KEYWORDS: sqlite3_version, sqlite3_sourceid
670666
**
@@ -6380,17 +6376,17 @@
63806376
** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0.
63816377
** </dd>
63826378
**
63836379
** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(<dt>SQLITE_DBSTATUS_CACHE_HIT</dt>
63846380
** <dd>This parameter returns the number of pager cache hits that have
6385
-** occurred. ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT
6381
+** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT
63866382
** is always 0.
63876383
** </dd>
63886384
**
63896385
** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt>
63906386
** <dd>This parameter returns the number of pager cache misses that have
6391
-** occurred. ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS
6387
+** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS
63926388
** is always 0.
63936389
** </dd>
63946390
** </dl>
63956391
*/
63966392
#define SQLITE_DBSTATUS_LOOKASIDE_USED 0
@@ -7333,14 +7329,12 @@
73337329
#endif /* ifndef _SQLITE3RTREE_H_ */
73347330
73357331
73367332
/************** End of sqlite3.h *********************************************/
73377333
/************** Continuing where we left off in sqliteInt.h ******************/
7338
-#line 309 "tsrc/sqliteInt.h"
73397334
/************** Include hash.h in the middle of sqliteInt.h ******************/
73407335
/************** Begin file hash.h ********************************************/
7341
-#line 1 "tsrc/hash.h"
73427336
/*
73437337
** 2001 September 22
73447338
**
73457339
** The author disclaims copyright to this source code. In place of
73467340
** a legal notice, here is a blessing:
@@ -7436,14 +7430,12 @@
74367430
74377431
#endif /* _SQLITE_HASH_H_ */
74387432
74397433
/************** End of hash.h ************************************************/
74407434
/************** Continuing where we left off in sqliteInt.h ******************/
7441
-#line 310 "tsrc/sqliteInt.h"
74427435
/************** Include parse.h in the middle of sqliteInt.h *****************/
74437436
/************** Begin file parse.h *******************************************/
7444
-#line 1 "tsrc/parse.h"
74457437
#define TK_SEMI 1
74467438
#define TK_EXPLAIN 2
74477439
#define TK_QUERY 3
74487440
#define TK_PLAN 4
74497441
#define TK_BEGIN 5
@@ -7600,11 +7592,10 @@
76007592
#define TK_UMINUS 156
76017593
#define TK_UPLUS 157
76027594
76037595
/************** End of parse.h ***********************************************/
76047596
/************** Continuing where we left off in sqliteInt.h ******************/
7605
-#line 311 "tsrc/sqliteInt.h"
76067597
#include <stdio.h>
76077598
#include <stdlib.h>
76087599
#include <string.h>
76097600
#include <assert.h>
76107601
#include <stddef.h>
@@ -7956,11 +7947,10 @@
79567947
** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
79577948
** pointer types (i.e. FuncDef) defined above.
79587949
*/
79597950
/************** Include btree.h in the middle of sqliteInt.h *****************/
79607951
/************** Begin file btree.h *******************************************/
7961
-#line 1 "tsrc/btree.h"
79627952
/*
79637953
** 2001 September 15
79647954
**
79657955
** The author disclaims copyright to this source code. In place of
79667956
** a legal notice, here is a blessing:
@@ -8201,14 +8191,12 @@
82018191
82028192
#endif /* _BTREE_H_ */
82038193
82048194
/************** End of btree.h ***********************************************/
82058195
/************** Continuing where we left off in sqliteInt.h ******************/
8206
-#line 665 "tsrc/sqliteInt.h"
82078196
/************** Include vdbe.h in the middle of sqliteInt.h ******************/
82088197
/************** Begin file vdbe.h ********************************************/
8209
-#line 1 "tsrc/vdbe.h"
82108198
/*
82118199
** 2001 September 15
82128200
**
82138201
** The author disclaims copyright to this source code. In place of
82148202
** a legal notice, here is a blessing:
@@ -8369,11 +8357,10 @@
83698357
** The makefile scans the vdbe.c source file and creates the "opcodes.h"
83708358
** header file that defines a number for each opcode used by the VDBE.
83718359
*/
83728360
/************** Include opcodes.h in the middle of vdbe.h ********************/
83738361
/************** Begin file opcodes.h *****************************************/
8374
-#line 1 "tsrc/opcodes.h"
83758362
/* Automatically generated. Do not edit */
83768363
/* See the mkopcodeh.awk script for details */
83778364
#define OP_Goto 1
83788365
#define OP_Gosub 2
83798366
#define OP_Return 3
@@ -8558,11 +8545,10 @@
85588545
/* 136 */ 0x01, 0x00, 0x01, 0x00, 0x00, 0x04, 0x04, 0x04,\
85598546
/* 144 */ 0x04, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00,}
85608547
85618548
/************** End of opcodes.h *********************************************/
85628549
/************** Continuing where we left off in vdbe.h ***********************/
8563
-#line 164 "tsrc/vdbe.h"
85648550
85658551
/*
85668552
** Prototypes for the VDBE interface. See comments on the implementation
85678553
** for a description of what each of these routines does.
85688554
*/
@@ -8633,14 +8619,12 @@
86338619
86348620
#endif
86358621
86368622
/************** End of vdbe.h ************************************************/
86378623
/************** Continuing where we left off in sqliteInt.h ******************/
8638
-#line 666 "tsrc/sqliteInt.h"
86398624
/************** Include pager.h in the middle of sqliteInt.h *****************/
86408625
/************** Begin file pager.h *******************************************/
8641
-#line 1 "tsrc/pager.h"
86428626
/*
86438627
** 2001 September 15
86448628
**
86458629
** The author disclaims copyright to this source code. In place of
86468630
** a legal notice, here is a blessing:
@@ -8822,14 +8806,12 @@
88228806
88238807
#endif /* _PAGER_H_ */
88248808
88258809
/************** End of pager.h ***********************************************/
88268810
/************** Continuing where we left off in sqliteInt.h ******************/
8827
-#line 667 "tsrc/sqliteInt.h"
88288811
/************** Include pcache.h in the middle of sqliteInt.h ****************/
88298812
/************** Begin file pcache.h ******************************************/
8830
-#line 1 "tsrc/pcache.h"
88318813
/*
88328814
** 2008 August 05
88338815
**
88348816
** The author disclaims copyright to this source code. In place of
88358817
** a legal notice, here is a blessing:
@@ -8984,15 +8966,13 @@
89848966
89858967
#endif /* _PCACHE_H_ */
89868968
89878969
/************** End of pcache.h **********************************************/
89888970
/************** Continuing where we left off in sqliteInt.h ******************/
8989
-#line 668 "tsrc/sqliteInt.h"
89908971
89918972
/************** Include os.h in the middle of sqliteInt.h ********************/
89928973
/************** Begin file os.h **********************************************/
8993
-#line 1 "tsrc/os.h"
89948974
/*
89958975
** 2001 September 16
89968976
**
89978977
** The author disclaims copyright to this source code. In place of
89988978
** a legal notice, here is a blessing:
@@ -9271,14 +9251,12 @@
92719251
92729252
#endif /* _SQLITE_OS_H_ */
92739253
92749254
/************** End of os.h **************************************************/
92759255
/************** Continuing where we left off in sqliteInt.h ******************/
9276
-#line 670 "tsrc/sqliteInt.h"
92779256
/************** Include mutex.h in the middle of sqliteInt.h *****************/
92789257
/************** Begin file mutex.h *******************************************/
9279
-#line 1 "tsrc/mutex.h"
92809258
/*
92819259
** 2007 August 28
92829260
**
92839261
** The author disclaims copyright to this source code. In place of
92849262
** a legal notice, here is a blessing:
@@ -9349,11 +9327,10 @@
93499327
#define sqlite3MutexEnd()
93509328
#endif /* defined(SQLITE_MUTEX_OMIT) */
93519329
93529330
/************** End of mutex.h ***********************************************/
93539331
/************** Continuing where we left off in sqliteInt.h ******************/
9354
-#line 671 "tsrc/sqliteInt.h"
93559332
93569333
93579334
/*
93589335
** Each database file to be accessed by the system is an instance
93599336
** of the following structure. There are normally two of these structures
@@ -11962,11 +11939,10 @@
1196211939
1196311940
#endif /* _SQLITEINT_H_ */
1196411941
1196511942
/************** End of sqliteInt.h *******************************************/
1196611943
/************** Begin file global.c ******************************************/
11967
-#line 1 "tsrc/global.c"
1196811944
/*
1196911945
** 2008 June 13
1197011946
**
1197111947
** The author disclaims copyright to this source code. In place of
1197211948
** a legal notice, here is a blessing:
@@ -12185,11 +12161,10 @@
1218512161
*/
1218612162
SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
1218712163
1218812164
/************** End of global.c **********************************************/
1218912165
/************** Begin file ctime.c *******************************************/
12190
-#line 1 "tsrc/ctime.c"
1219112166
/*
1219212167
** 2010 February 23
1219312168
**
1219412169
** The author disclaims copyright to this source code. In place of
1219512170
** a legal notice, here is a blessing:
@@ -12590,11 +12565,10 @@
1259012565
1259112566
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
1259212567
1259312568
/************** End of ctime.c ***********************************************/
1259412569
/************** Begin file status.c ******************************************/
12595
-#line 1 "tsrc/status.c"
1259612570
/*
1259712571
** 2008 June 18
1259812572
**
1259912573
** The author disclaims copyright to this source code. In place of
1260012574
** a legal notice, here is a blessing:
@@ -12608,11 +12582,10 @@
1260812582
** This module implements the sqlite3_status() interface and related
1260912583
** functionality.
1261012584
*/
1261112585
/************** Include vdbeInt.h in the middle of status.c ******************/
1261212586
/************** Begin file vdbeInt.h *****************************************/
12613
-#line 1 "tsrc/vdbeInt.h"
1261412587
/*
1261512588
** 2003 September 6
1261612589
**
1261712590
** The author disclaims copyright to this source code. In place of
1261812591
** a legal notice, here is a blessing:
@@ -13060,11 +13033,10 @@
1306013033
1306113034
#endif /* !defined(_VDBEINT_H_) */
1306213035
1306313036
/************** End of vdbeInt.h *********************************************/
1306413037
/************** Continuing where we left off in status.c *********************/
13065
-#line 18 "tsrc/status.c"
1306613038
1306713039
/*
1306813040
** Variables in which to record status information.
1306913041
*/
1307013042
typedef struct sqlite3StatType sqlite3StatType;
@@ -13296,11 +13268,10 @@
1329613268
return rc;
1329713269
}
1329813270
1329913271
/************** End of status.c **********************************************/
1330013272
/************** Begin file date.c ********************************************/
13301
-#line 1 "tsrc/date.c"
1330213273
/*
1330313274
** 2003 October 31
1330413275
**
1330513276
** The author disclaims copyright to this source code. In place of
1330613277
** a legal notice, here is a blessing:
@@ -14424,11 +14395,10 @@
1442414395
}
1442514396
}
1442614397
1442714398
/************** End of date.c ************************************************/
1442814399
/************** Begin file os.c **********************************************/
14429
-#line 1 "tsrc/os.c"
1443014400
/*
1443114401
** 2005 November 29
1443214402
**
1443314403
** The author disclaims copyright to this source code. In place of
1443414404
** a legal notice, here is a blessing:
@@ -14758,11 +14728,10 @@
1475814728
return SQLITE_OK;
1475914729
}
1476014730
1476114731
/************** End of os.c **************************************************/
1476214732
/************** Begin file fault.c *******************************************/
14763
-#line 1 "tsrc/fault.c"
1476414733
/*
1476514734
** 2008 Jan 22
1476614735
**
1476714736
** The author disclaims copyright to this source code. In place of
1476814737
** a legal notice, here is a blessing:
@@ -14848,11 +14817,10 @@
1484814817
1484914818
#endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */
1485014819
1485114820
/************** End of fault.c ***********************************************/
1485214821
/************** Begin file mem0.c ********************************************/
14853
-#line 1 "tsrc/mem0.c"
1485414822
/*
1485514823
** 2008 October 28
1485614824
**
1485714825
** The author disclaims copyright to this source code. In place of
1485814826
** a legal notice, here is a blessing:
@@ -14910,11 +14878,10 @@
1491014878
1491114879
#endif /* SQLITE_ZERO_MALLOC */
1491214880
1491314881
/************** End of mem0.c ************************************************/
1491414882
/************** Begin file mem1.c ********************************************/
14915
-#line 1 "tsrc/mem1.c"
1491614883
/*
1491714884
** 2007 August 14
1491814885
**
1491914886
** The author disclaims copyright to this source code. In place of
1492014887
** a legal notice, here is a blessing:
@@ -15063,11 +15030,10 @@
1506315030
1506415031
#endif /* SQLITE_SYSTEM_MALLOC */
1506515032
1506615033
/************** End of mem1.c ************************************************/
1506715034
/************** Begin file mem2.c ********************************************/
15068
-#line 1 "tsrc/mem2.c"
1506915035
/*
1507015036
** 2007 August 15
1507115037
**
1507215038
** The author disclaims copyright to this source code. In place of
1507315039
** a legal notice, here is a blessing:
@@ -15594,11 +15560,10 @@
1559415560
1559515561
#endif /* SQLITE_MEMDEBUG */
1559615562
1559715563
/************** End of mem2.c ************************************************/
1559815564
/************** Begin file mem3.c ********************************************/
15599
-#line 1 "tsrc/mem3.c"
1560015565
/*
1560115566
** 2007 October 14
1560215567
**
1560315568
** The author disclaims copyright to this source code. In place of
1560415569
** a legal notice, here is a blessing:
@@ -16284,11 +16249,10 @@
1628416249
1628516250
#endif /* SQLITE_ENABLE_MEMSYS3 */
1628616251
1628716252
/************** End of mem3.c ************************************************/
1628816253
/************** Begin file mem5.c ********************************************/
16289
-#line 1 "tsrc/mem5.c"
1629016254
/*
1629116255
** 2007 October 14
1629216256
**
1629316257
** The author disclaims copyright to this source code. In place of
1629416258
** a legal notice, here is a blessing:
@@ -16868,11 +16832,10 @@
1686816832
1686916833
#endif /* SQLITE_ENABLE_MEMSYS5 */
1687016834
1687116835
/************** End of mem5.c ************************************************/
1687216836
/************** Begin file mutex.c *******************************************/
16873
-#line 1 "tsrc/mutex.c"
1687416837
/*
1687516838
** 2007 August 14
1687616839
**
1687716840
** The author disclaims copyright to this source code. In place of
1687816841
** a legal notice, here is a blessing:
@@ -17024,11 +16987,10 @@
1702416987
1702516988
#endif /* SQLITE_MUTEX_OMIT */
1702616989
1702716990
/************** End of mutex.c ***********************************************/
1702816991
/************** Begin file mutex_noop.c **************************************/
17029
-#line 1 "tsrc/mutex_noop.c"
1703016992
/*
1703116993
** 2008 October 07
1703216994
**
1703316995
** The author disclaims copyright to this source code. In place of
1703416996
** a legal notice, here is a blessing:
@@ -17233,11 +17195,10 @@
1723317195
#endif /* SQLITE_MUTEX_NOOP */
1723417196
#endif /* SQLITE_MUTEX_OMIT */
1723517197
1723617198
/************** End of mutex_noop.c ******************************************/
1723717199
/************** Begin file mutex_os2.c ***************************************/
17238
-#line 1 "tsrc/mutex_os2.c"
1723917200
/*
1724017201
** 2007 August 28
1724117202
**
1724217203
** The author disclaims copyright to this source code. In place of
1724317204
** a legal notice, here is a blessing:
@@ -17510,11 +17471,10 @@
1751017471
}
1751117472
#endif /* SQLITE_MUTEX_OS2 */
1751217473
1751317474
/************** End of mutex_os2.c *******************************************/
1751417475
/************** Begin file mutex_unix.c **************************************/
17515
-#line 1 "tsrc/mutex_unix.c"
1751617476
/*
1751717477
** 2007 August 28
1751817478
**
1751917479
** The author disclaims copyright to this source code. In place of
1752017480
** a legal notice, here is a blessing:
@@ -17864,11 +17824,10 @@
1786417824
1786517825
#endif /* SQLITE_MUTEX_PTHREAD */
1786617826
1786717827
/************** End of mutex_unix.c ******************************************/
1786817828
/************** Begin file mutex_w32.c ***************************************/
17869
-#line 1 "tsrc/mutex_w32.c"
1787017829
/*
1787117830
** 2007 August 14
1787217831
**
1787317832
** The author disclaims copyright to this source code. In place of
1787417833
** a legal notice, here is a blessing:
@@ -18199,11 +18158,10 @@
1819918158
}
1820018159
#endif /* SQLITE_MUTEX_W32 */
1820118160
1820218161
/************** End of mutex_w32.c *******************************************/
1820318162
/************** Begin file malloc.c ******************************************/
18204
-#line 1 "tsrc/malloc.c"
1820518163
/*
1820618164
** 2001 September 15
1820718165
**
1820818166
** The author disclaims copyright to this source code. In place of
1820918167
** a legal notice, here is a blessing:
@@ -18979,11 +18937,10 @@
1897918937
return rc & (db ? db->errMask : 0xff);
1898018938
}
1898118939
1898218940
/************** End of malloc.c **********************************************/
1898318941
/************** Begin file printf.c ******************************************/
18984
-#line 1 "tsrc/printf.c"
1898518942
/*
1898618943
** The "printf" code that follows dates from the 1980's. It is in
1898718944
** the public domain. The original comments are included here for
1898818945
** completeness. They are very out-of-date but might be useful as
1898918946
** an historical reference. Most of the "enhancements" have been backed
@@ -19171,15 +19128,11 @@
1917119128
/*
1917219129
** On machines with a small stack size, you can redefine the
1917319130
** SQLITE_PRINT_BUF_SIZE to be less than 350.
1917419131
*/
1917519132
#ifndef SQLITE_PRINT_BUF_SIZE
19176
-# if defined(SQLITE_SMALL_STACK)
19177
-# define SQLITE_PRINT_BUF_SIZE 50
19178
-# else
19179
-# define SQLITE_PRINT_BUF_SIZE 350
19180
-# endif
19133
+# define SQLITE_PRINT_BUF_SIZE 70
1918119134
#endif
1918219135
#define etBUFSIZE SQLITE_PRINT_BUF_SIZE /* Size of the output buffer */
1918319136
1918419137
/*
1918519138
** The root program. All variations call this core.
@@ -19231,19 +19184,20 @@
1923119184
etByte done; /* Loop termination flag */
1923219185
sqlite_uint64 longvalue; /* Value for integer types */
1923319186
LONGDOUBLE_TYPE realvalue; /* Value for real types */
1923419187
const et_info *infop; /* Pointer to the appropriate info structure */
1923519188
char buf[etBUFSIZE]; /* Conversion buffer */
19189
+ char *zOut; /* Rendering buffer */
19190
+ int nOut; /* Size of the rendering buffer */
1923619191
char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */
1923719192
etByte xtype = 0; /* Conversion paradigm */
1923819193
char *zExtra; /* Extra memory used for etTCLESCAPE conversions */
1923919194
#ifndef SQLITE_OMIT_FLOATING_POINT
1924019195
int exp, e2; /* exponent of real numbers */
1924119196
double rounder; /* Used for rounding floating point values */
1924219197
etByte flag_dp; /* True if decimal point should be shown */
1924319198
etByte flag_rtz; /* True if trailing zeros should be removed */
19244
- etByte flag_exp; /* True to force display of the exponent */
1924519199
int nsd; /* Number of significant digits returned */
1924619200
#endif
1924719201
1924819202
length = 0;
1924919203
bufpt = 0;
@@ -19288,13 +19242,10 @@
1928819242
while( c>='0' && c<='9' ){
1928919243
width = width*10 + c - '0';
1929019244
c = *++fmt;
1929119245
}
1929219246
}
19293
- if( width > etBUFSIZE-10 ){
19294
- width = etBUFSIZE-10;
19295
- }
1929619247
/* Get the precision */
1929719248
if( c=='.' ){
1929819249
precision = 0;
1929919250
c = *++fmt;
1930019251
if( c=='*' ){
@@ -19337,16 +19288,10 @@
1933719288
break;
1933819289
}
1933919290
}
1934019291
zExtra = 0;
1934119292
19342
-
19343
- /* Limit the precision to prevent overflowing buf[] during conversion */
19344
- if( precision>etBUFSIZE-40 && (infop->flags & FLAG_STRING)==0 ){
19345
- precision = etBUFSIZE-40;
19346
- }
19347
-
1934819293
/*
1934919294
** At this point, variables are initialized as follows:
1935019295
**
1935119296
** flag_alternateform TRUE if a '#' is present.
1935219297
** flag_altform2 TRUE if a '!' is present.
@@ -19407,20 +19352,30 @@
1940719352
}
1940819353
if( longvalue==0 ) flag_alternateform = 0;
1940919354
if( flag_zeropad && precision<width-(prefix!=0) ){
1941019355
precision = width-(prefix!=0);
1941119356
}
19412
- bufpt = &buf[etBUFSIZE-1];
19357
+ if( precision<etBUFSIZE-10 ){
19358
+ nOut = etBUFSIZE;
19359
+ zOut = buf;
19360
+ }else{
19361
+ nOut = precision + 10;
19362
+ zOut = zExtra = sqlite3Malloc( nOut );
19363
+ if( zOut==0 ){
19364
+ pAccum->mallocFailed = 1;
19365
+ return;
19366
+ }
19367
+ }
19368
+ bufpt = &zOut[nOut-1];
1941319369
if( xtype==etORDINAL ){
1941419370
static const char zOrd[] = "thstndrd";
1941519371
int x = (int)(longvalue % 10);
1941619372
if( x>=4 || (longvalue/10)%10==1 ){
1941719373
x = 0;
1941819374
}
19419
- buf[etBUFSIZE-3] = zOrd[x*2];
19420
- buf[etBUFSIZE-2] = zOrd[x*2+1];
19421
- bufpt -= 2;
19375
+ *(--bufpt) = zOrd[x*2+1];
19376
+ *(--bufpt) = zOrd[x*2];
1942219377
}
1942319378
{
1942419379
register const char *cset; /* Use registers for speed */
1942519380
register int base;
1942619381
cset = &aDigits[infop->charset];
@@ -19428,11 +19383,11 @@
1942819383
do{ /* Convert to ascii */
1942919384
*(--bufpt) = cset[longvalue%base];
1943019385
longvalue = longvalue/base;
1943119386
}while( longvalue>0 );
1943219387
}
19433
- length = (int)(&buf[etBUFSIZE-1]-bufpt);
19388
+ length = (int)(&zOut[nOut-1]-bufpt);
1943419389
for(idx=precision-length; idx>0; idx--){
1943519390
*(--bufpt) = '0'; /* Zero pad */
1943619391
}
1943719392
if( prefix ) *(--bufpt) = prefix; /* Add sign */
1943819393
if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
@@ -19439,21 +19394,20 @@
1943919394
const char *pre;
1944019395
char x;
1944119396
pre = &aPrefix[infop->prefix];
1944219397
for(; (x=(*pre))!=0; pre++) *(--bufpt) = x;
1944319398
}
19444
- length = (int)(&buf[etBUFSIZE-1]-bufpt);
19399
+ length = (int)(&zOut[nOut-1]-bufpt);
1944519400
break;
1944619401
case etFLOAT:
1944719402
case etEXP:
1944819403
case etGENERIC:
1944919404
realvalue = va_arg(ap,double);
1945019405
#ifdef SQLITE_OMIT_FLOATING_POINT
1945119406
length = 0;
1945219407
#else
1945319408
if( precision<0 ) precision = 6; /* Set default precision */
19454
- if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10;
1945519409
if( realvalue<0.0 ){
1945619410
realvalue = -realvalue;
1945719411
prefix = '-';
1945819412
}else{
1945919413
if( flag_plussign ) prefix = '+';
@@ -19497,11 +19451,10 @@
1949719451
bufpt = buf;
1949819452
/*
1949919453
** If the field type is etGENERIC, then convert to either etEXP
1950019454
** or etFLOAT, as appropriate.
1950119455
*/
19502
- flag_exp = xtype==etEXP;
1950319456
if( xtype!=etFLOAT ){
1950419457
realvalue += rounder;
1950519458
if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }
1950619459
}
1950719460
if( xtype==etGENERIC ){
@@ -19518,10 +19471,18 @@
1951819471
if( xtype==etEXP ){
1951919472
e2 = 0;
1952019473
}else{
1952119474
e2 = exp;
1952219475
}
19476
+ if( e2+precision+width > etBUFSIZE - 15 ){
19477
+ bufpt = zExtra = sqlite3Malloc( e2+precision+width+15 );
19478
+ if( bufpt==0 ){
19479
+ pAccum->mallocFailed = 1;
19480
+ return;
19481
+ }
19482
+ }
19483
+ zOut = bufpt;
1952319484
nsd = 0;
1952419485
flag_dp = (precision>0 ?1:0) | flag_alternateform | flag_altform2;
1952519486
/* The sign in front of the number */
1952619487
if( prefix ){
1952719488
*(bufpt++) = prefix;
@@ -19549,21 +19510,21 @@
1954919510
*(bufpt++) = et_getdigit(&realvalue,&nsd);
1955019511
}
1955119512
/* Remove trailing zeros and the "." if no digits follow the "." */
1955219513
if( flag_rtz && flag_dp ){
1955319514
while( bufpt[-1]=='0' ) *(--bufpt) = 0;
19554
- assert( bufpt>buf );
19515
+ assert( bufpt>zOut );
1955519516
if( bufpt[-1]=='.' ){
1955619517
if( flag_altform2 ){
1955719518
*(bufpt++) = '0';
1955819519
}else{
1955919520
*(--bufpt) = 0;
1956019521
}
1956119522
}
1956219523
}
1956319524
/* Add the "eNNN" suffix */
19564
- if( flag_exp || xtype==etEXP ){
19525
+ if( xtype==etEXP ){
1956519526
*(bufpt++) = aDigits[infop->charset];
1956619527
if( exp<0 ){
1956719528
*(bufpt++) = '-'; exp = -exp;
1956819529
}else{
1956919530
*(bufpt++) = '+';
@@ -19578,12 +19539,12 @@
1957819539
*bufpt = 0;
1957919540
1958019541
/* The converted number is in buf[] and zero terminated. Output it.
1958119542
** Note that the number is in the usual order, not reversed as with
1958219543
** integer conversions. */
19583
- length = (int)(bufpt-buf);
19584
- bufpt = buf;
19544
+ length = (int)(bufpt-zOut);
19545
+ bufpt = zOut;
1958519546
1958619547
/* Special case: Add leading zeros if the flag_zeropad flag is
1958719548
** set and we are not left justified */
1958819549
if( flag_zeropad && !flag_leftjustify && length < width){
1958919550
int i;
@@ -19717,13 +19678,11 @@
1971719678
nspace = width-length;
1971819679
if( nspace>0 ){
1971919680
appendSpace(pAccum, nspace);
1972019681
}
1972119682
}
19722
- if( zExtra ){
19723
- sqlite3_free(zExtra);
19724
- }
19683
+ sqlite3_free(zExtra);
1972519684
}/* End for loop over the format string */
1972619685
} /* End of function */
1972719686
1972819687
/*
1972919688
** Append N bytes of text from z to the StrAccum object.
@@ -20011,11 +19970,10 @@
2001119970
}
2001219971
#endif
2001319972
2001419973
/************** End of printf.c **********************************************/
2001519974
/************** Begin file random.c ******************************************/
20016
-#line 1 "tsrc/random.c"
2001719975
/*
2001819976
** 2001 September 15
2001919977
**
2002019978
** The author disclaims copyright to this source code. In place of
2002119979
** a legal notice, here is a blessing:
@@ -20159,11 +20117,10 @@
2015920117
}
2016020118
#endif /* SQLITE_OMIT_BUILTIN_TEST */
2016120119
2016220120
/************** End of random.c **********************************************/
2016320121
/************** Begin file utf.c *********************************************/
20164
-#line 1 "tsrc/utf.c"
2016520122
/*
2016620123
** 2004 April 13
2016720124
**
2016820125
** The author disclaims copyright to this source code. In place of
2016920126
** a legal notice, here is a blessing:
@@ -20721,11 +20678,10 @@
2072120678
#endif /* SQLITE_TEST */
2072220679
#endif /* SQLITE_OMIT_UTF16 */
2072320680
2072420681
/************** End of utf.c *************************************************/
2072520682
/************** Begin file util.c ********************************************/
20726
-#line 1 "tsrc/util.c"
2072720683
/*
2072820684
** 2001 September 15
2072920685
**
2073020686
** The author disclaims copyright to this source code. In place of
2073120687
** a legal notice, here is a blessing:
@@ -21904,11 +21860,10 @@
2190421860
}
2190521861
#endif
2190621862
2190721863
/************** End of util.c ************************************************/
2190821864
/************** Begin file hash.c ********************************************/
21909
-#line 1 "tsrc/hash.c"
2191021865
/*
2191121866
** 2001 September 22
2191221867
**
2191321868
** The author disclaims copyright to this source code. In place of
2191421869
** a legal notice, here is a blessing:
@@ -22184,11 +22139,10 @@
2218422139
return 0;
2218522140
}
2218622141
2218722142
/************** End of hash.c ************************************************/
2218822143
/************** Begin file opcodes.c *****************************************/
22189
-#line 1 "tsrc/opcodes.c"
2219022144
/* Automatically generated. Do not edit */
2219122145
/* See the mkopcodec.awk script for details. */
2219222146
#if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
2219322147
SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
2219422148
static const char *const azName[] = { "?",
@@ -22347,11 +22301,10 @@
2234722301
}
2234822302
#endif
2234922303
2235022304
/************** End of opcodes.c *********************************************/
2235122305
/************** Begin file os_os2.c ******************************************/
22352
-#line 1 "tsrc/os_os2.c"
2235322306
/*
2235422307
** 2006 Feb 14
2235522308
**
2235622309
** The author disclaims copyright to this source code. In place of
2235722310
** a legal notice, here is a blessing:
@@ -22404,11 +22357,10 @@
2240422357
/*
2240522358
** Include code that is common to all os_*.c files
2240622359
*/
2240722360
/************** Include os_common.h in the middle of os_os2.c ****************/
2240822361
/************** Begin file os_common.h ***************************************/
22409
-#line 1 "tsrc/os_common.h"
2241022362
/*
2241122363
** 2004 May 22
2241222364
**
2241322365
** The author disclaims copyright to this source code. In place of
2241422366
** a legal notice, here is a blessing:
@@ -22458,11 +22410,10 @@
2245822410
** hwtime.h contains inline assembler code for implementing
2245922411
** high-performance timing routines.
2246022412
*/
2246122413
/************** Include hwtime.h in the middle of os_common.h ****************/
2246222414
/************** Begin file hwtime.h ******************************************/
22463
-#line 1 "tsrc/hwtime.h"
2246422415
/*
2246522416
** 2008 May 27
2246622417
**
2246722418
** The author disclaims copyright to this source code. In place of
2246822419
** a legal notice, here is a blessing:
@@ -22547,11 +22498,10 @@
2254722498
2254822499
#endif /* !defined(_HWTIME_H_) */
2254922500
2255022501
/************** End of hwtime.h **********************************************/
2255122502
/************** Continuing where we left off in os_common.h ******************/
22552
-#line 53 "tsrc/os_common.h"
2255322503
2255422504
static sqlite_uint64 g_start;
2255522505
static sqlite_uint64 g_elapsed;
2255622506
#define TIMER_START g_start=sqlite3Hwtime()
2255722507
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -22614,11 +22564,10 @@
2261422564
2261522565
#endif /* !defined(_OS_COMMON_H_) */
2261622566
2261722567
/************** End of os_common.h *******************************************/
2261822568
/************** Continuing where we left off in os_os2.c *********************/
22619
-#line 57 "tsrc/os_os2.c"
2262022569
2262122570
/* Forward references */
2262222571
typedef struct os2File os2File; /* The file structure */
2262322572
typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */
2262422573
typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */
@@ -24486,11 +24435,10 @@
2448624435
2448724436
#endif /* SQLITE_OS_OS2 */
2448824437
2448924438
/************** End of os_os2.c **********************************************/
2449024439
/************** Begin file os_unix.c *****************************************/
24491
-#line 1 "tsrc/os_unix.c"
2449224440
/*
2449324441
** 2004 May 22
2449424442
**
2449524443
** The author disclaims copyright to this source code. In place of
2449624444
** a legal notice, here is a blessing:
@@ -24751,11 +24699,10 @@
2475124699
/*
2475224700
** Include code that is common to all os_*.c files
2475324701
*/
2475424702
/************** Include os_common.h in the middle of os_unix.c ***************/
2475524703
/************** Begin file os_common.h ***************************************/
24756
-#line 1 "tsrc/os_common.h"
2475724704
/*
2475824705
** 2004 May 22
2475924706
**
2476024707
** The author disclaims copyright to this source code. In place of
2476124708
** a legal notice, here is a blessing:
@@ -24805,11 +24752,10 @@
2480524752
** hwtime.h contains inline assembler code for implementing
2480624753
** high-performance timing routines.
2480724754
*/
2480824755
/************** Include hwtime.h in the middle of os_common.h ****************/
2480924756
/************** Begin file hwtime.h ******************************************/
24810
-#line 1 "tsrc/hwtime.h"
2481124757
/*
2481224758
** 2008 May 27
2481324759
**
2481424760
** The author disclaims copyright to this source code. In place of
2481524761
** a legal notice, here is a blessing:
@@ -24894,11 +24840,10 @@
2489424840
2489524841
#endif /* !defined(_HWTIME_H_) */
2489624842
2489724843
/************** End of hwtime.h **********************************************/
2489824844
/************** Continuing where we left off in os_common.h ******************/
24899
-#line 53 "tsrc/os_common.h"
2490024845
2490124846
static sqlite_uint64 g_start;
2490224847
static sqlite_uint64 g_elapsed;
2490324848
#define TIMER_START g_start=sqlite3Hwtime()
2490424849
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -24961,11 +24906,10 @@
2496124906
2496224907
#endif /* !defined(_OS_COMMON_H_) */
2496324908
2496424909
/************** End of os_common.h *******************************************/
2496524910
/************** Continuing where we left off in os_unix.c ********************/
24966
-#line 265 "tsrc/os_unix.c"
2496724911
2496824912
/*
2496924913
** Define various macros that are missing from some systems.
2497024914
*/
2497124915
#ifndef O_LARGEFILE
@@ -28554,20 +28498,19 @@
2855428498
rc = SQLITE_NOMEM;
2855528499
goto shm_open_err;
2855628500
}
2855728501
2855828502
if( pInode->bProcessLock==0 ){
28559
- pShmNode->h = robust_open(zShmFilename, O_RDWR|O_CREAT,
28560
- (sStat.st_mode & 0777));
28503
+ const char *zRO;
28504
+ int openFlags = O_RDWR | O_CREAT;
28505
+ zRO = sqlite3_uri_parameter(pDbFd->zPath, "readonly_shm");
28506
+ if( zRO && sqlite3GetBoolean(zRO) ){
28507
+ openFlags = O_RDONLY;
28508
+ pShmNode->isReadonly = 1;
28509
+ }
28510
+ pShmNode->h = robust_open(zShmFilename, openFlags, (sStat.st_mode&0777));
2856128511
if( pShmNode->h<0 ){
28562
- const char *zRO;
28563
- zRO = sqlite3_uri_parameter(pDbFd->zPath, "readonly_shm");
28564
- if( zRO && sqlite3GetBoolean(zRO) ){
28565
- pShmNode->h = robust_open(zShmFilename, O_RDONLY,
28566
- (sStat.st_mode & 0777));
28567
- pShmNode->isReadonly = 1;
28568
- }
2856928512
if( pShmNode->h<0 ){
2857028513
rc = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zShmFilename);
2857128514
goto shm_open_err;
2857228515
}
2857328516
}
@@ -31479,11 +31422,10 @@
3147931422
3148031423
#endif /* SQLITE_OS_UNIX */
3148131424
3148231425
/************** End of os_unix.c *********************************************/
3148331426
/************** Begin file os_win.c ******************************************/
31484
-#line 1 "tsrc/os_win.c"
3148531427
/*
3148631428
** 2004 May 22
3148731429
**
3148831430
** The author disclaims copyright to this source code. In place of
3148931431
** a legal notice, here is a blessing:
@@ -31541,11 +31483,10 @@
3154131483
/*
3154231484
** Include code that is common to all os_*.c files
3154331485
*/
3154431486
/************** Include os_common.h in the middle of os_win.c ****************/
3154531487
/************** Begin file os_common.h ***************************************/
31546
-#line 1 "tsrc/os_common.h"
3154731488
/*
3154831489
** 2004 May 22
3154931490
**
3155031491
** The author disclaims copyright to this source code. In place of
3155131492
** a legal notice, here is a blessing:
@@ -31595,11 +31536,10 @@
3159531536
** hwtime.h contains inline assembler code for implementing
3159631537
** high-performance timing routines.
3159731538
*/
3159831539
/************** Include hwtime.h in the middle of os_common.h ****************/
3159931540
/************** Begin file hwtime.h ******************************************/
31600
-#line 1 "tsrc/hwtime.h"
3160131541
/*
3160231542
** 2008 May 27
3160331543
**
3160431544
** The author disclaims copyright to this source code. In place of
3160531545
** a legal notice, here is a blessing:
@@ -31684,11 +31624,10 @@
3168431624
3168531625
#endif /* !defined(_HWTIME_H_) */
3168631626
3168731627
/************** End of hwtime.h **********************************************/
3168831628
/************** Continuing where we left off in os_common.h ******************/
31689
-#line 53 "tsrc/os_common.h"
3169031629
3169131630
static sqlite_uint64 g_start;
3169231631
static sqlite_uint64 g_elapsed;
3169331632
#define TIMER_START g_start=sqlite3Hwtime()
3169431633
#define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -31751,11 +31690,10 @@
3175131690
3175231691
#endif /* !defined(_OS_COMMON_H_) */
3175331692
3175431693
/************** End of os_common.h *******************************************/
3175531694
/************** Continuing where we left off in os_win.c *********************/
31756
-#line 62 "tsrc/os_win.c"
3175731695
3175831696
/*
3175931697
** Some microsoft compilers lack this definition.
3176031698
*/
3176131699
#ifndef INVALID_FILE_ATTRIBUTES
@@ -34897,11 +34835,10 @@
3489734835
3489834836
#endif /* SQLITE_OS_WIN */
3489934837
3490034838
/************** End of os_win.c **********************************************/
3490134839
/************** Begin file bitvec.c ******************************************/
34902
-#line 1 "tsrc/bitvec.c"
3490334840
/*
3490434841
** 2008 February 16
3490534842
**
3490634843
** The author disclaims copyright to this source code. In place of
3490734844
** a legal notice, here is a blessing:
@@ -35308,11 +35245,10 @@
3530835245
}
3530935246
#endif /* SQLITE_OMIT_BUILTIN_TEST */
3531035247
3531135248
/************** End of bitvec.c **********************************************/
3531235249
/************** Begin file pcache.c ******************************************/
35313
-#line 1 "tsrc/pcache.c"
3531435250
/*
3531535251
** 2008 August 05
3531635252
**
3531735253
** The author disclaims copyright to this source code. In place of
3531835254
** a legal notice, here is a blessing:
@@ -35905,11 +35841,10 @@
3590535841
}
3590635842
#endif
3590735843
3590835844
/************** End of pcache.c **********************************************/
3590935845
/************** Begin file pcache1.c *****************************************/
35910
-#line 1 "tsrc/pcache1.c"
3591135846
/*
3591235847
** 2008 November 05
3591335848
**
3591435849
** The author disclaims copyright to this source code. In place of
3591535850
** a legal notice, here is a blessing:
@@ -36880,11 +36815,10 @@
3688036815
}
3688136816
#endif
3688236817
3688336818
/************** End of pcache1.c *********************************************/
3688436819
/************** Begin file rowset.c ******************************************/
36885
-#line 1 "tsrc/rowset.c"
3688636820
/*
3688736821
** 2008 December 3
3688836822
**
3688936823
** The author disclaims copyright to this source code. In place of
3689036824
** a legal notice, here is a blessing:
@@ -37305,11 +37239,10 @@
3730537239
return 0;
3730637240
}
3730737241
3730837242
/************** End of rowset.c **********************************************/
3730937243
/************** Begin file pager.c *******************************************/
37310
-#line 1 "tsrc/pager.c"
3731137244
/*
3731237245
** 2001 September 15
3731337246
**
3731437247
** The author disclaims copyright to this source code. In place of
3731537248
** a legal notice, here is a blessing:
@@ -37329,11 +37262,10 @@
3732937262
** another is writing.
3733037263
*/
3733137264
#ifndef SQLITE_OMIT_DISKIO
3733237265
/************** Include wal.h in the middle of pager.c ***********************/
3733337266
/************** Begin file wal.h *********************************************/
37334
-#line 1 "tsrc/wal.h"
3733537267
/*
3733637268
** 2010 February 1
3733737269
**
3733837270
** The author disclaims copyright to this source code. In place of
3733937271
** a legal notice, here is a blessing:
@@ -37454,11 +37386,10 @@
3745437386
#endif /* ifndef SQLITE_OMIT_WAL */
3745537387
#endif /* _WAL_H_ */
3745637388
3745737389
/************** End of wal.h *************************************************/
3745837390
/************** Continuing where we left off in pager.c **********************/
37459
-#line 24 "tsrc/pager.c"
3746037391
3746137392
3746237393
/******************* NOTES ON THE DESIGN OF THE PAGER ************************
3746337394
**
3746437395
** This comment block describes invariants that hold when using a rollback
@@ -44291,11 +44222,10 @@
4429144222
4429244223
#endif /* SQLITE_OMIT_DISKIO */
4429344224
4429444225
/************** End of pager.c ***********************************************/
4429544226
/************** Begin file wal.c *********************************************/
44296
-#line 1 "tsrc/wal.c"
4429744227
/*
4429844228
** 2010 February 1
4429944229
**
4430044230
** The author disclaims copyright to this source code. In place of
4430144231
** a legal notice, here is a blessing:
@@ -47246,11 +47176,10 @@
4724647176
4724747177
#endif /* #ifndef SQLITE_OMIT_WAL */
4724847178
4724947179
/************** End of wal.c *************************************************/
4725047180
/************** Begin file btmutex.c *****************************************/
47251
-#line 1 "tsrc/btmutex.c"
4725247181
/*
4725347182
** 2007 August 27
4725447183
**
4725547184
** The author disclaims copyright to this source code. In place of
4725647185
** a legal notice, here is a blessing:
@@ -47266,11 +47195,10 @@
4726647195
** big and we want to break it down some. This packaged seemed like
4726747196
** a good breakout.
4726847197
*/
4726947198
/************** Include btreeInt.h in the middle of btmutex.c ****************/
4727047199
/************** Begin file btreeInt.h ****************************************/
47271
-#line 1 "tsrc/btreeInt.h"
4727247200
/*
4727347201
** 2004 April 6
4727447202
**
4727547203
** The author disclaims copyright to this source code. In place of
4727647204
** a legal notice, here is a blessing:
@@ -47912,11 +47840,10 @@
4791247840
#define get4byte sqlite3Get4byte
4791347841
#define put4byte sqlite3Put4byte
4791447842
4791547843
/************** End of btreeInt.h ********************************************/
4791647844
/************** Continuing where we left off in btmutex.c ********************/
47917
-#line 19 "tsrc/btmutex.c"
4791847845
#ifndef SQLITE_OMIT_SHARED_CACHE
4791947846
#if SQLITE_THREADSAFE
4792047847
4792147848
/*
4792247849
** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -48185,11 +48112,10 @@
4818548112
#endif /* if SQLITE_THREADSAFE */
4818648113
#endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
4818748114
4818848115
/************** End of btmutex.c *********************************************/
4818948116
/************** Begin file btree.c *******************************************/
48190
-#line 1 "tsrc/btree.c"
4819148117
/*
4819248118
** 2004 April 6
4819348119
**
4819448120
** The author disclaims copyright to this source code. In place of
4819548121
** a legal notice, here is a blessing:
@@ -52125,25 +52051,59 @@
5212552051
offset -= ovflSize;
5212652052
}else{
5212752053
/* Need to read this page properly. It contains some of the
5212852054
** range of data that is being read (eOp==0) or written (eOp!=0).
5212952055
*/
52130
- DbPage *pDbPage;
52056
+#ifdef SQLITE_DIRECT_OVERFLOW_READ
52057
+ sqlite3_file *fd;
52058
+#endif
5213152059
int a = amt;
52132
- rc = sqlite3PagerGet(pBt->pPager, nextPage, &pDbPage);
52133
- if( rc==SQLITE_OK ){
52134
- aPayload = sqlite3PagerGetData(pDbPage);
52135
- nextPage = get4byte(aPayload);
52136
- if( a + offset > ovflSize ){
52137
- a = ovflSize - offset;
52138
- }
52139
- rc = copyPayload(&aPayload[offset+4], pBuf, a, eOp, pDbPage);
52140
- sqlite3PagerUnref(pDbPage);
52141
- offset = 0;
52142
- amt -= a;
52143
- pBuf += a;
52144
- }
52060
+ if( a + offset > ovflSize ){
52061
+ a = ovflSize - offset;
52062
+ }
52063
+
52064
+#ifdef SQLITE_DIRECT_OVERFLOW_READ
52065
+ /* If all the following are true:
52066
+ **
52067
+ ** 1) this is a read operation, and
52068
+ ** 2) data is required from the start of this overflow page, and
52069
+ ** 3) the database is file-backed, and
52070
+ ** 4) there is no open write-transaction, and
52071
+ ** 5) the database is not a WAL database,
52072
+ **
52073
+ ** then data can be read directly from the database file into the
52074
+ ** output buffer, bypassing the page-cache altogether. This speeds
52075
+ ** up loading large records that span many overflow pages.
52076
+ */
52077
+ if( eOp==0 /* (1) */
52078
+ && offset==0 /* (2) */
52079
+ && pBt->inTransaction==TRANS_READ /* (4) */
52080
+ && (fd = sqlite3PagerFile(pBt->pPager))->pMethods /* (3) */
52081
+ && pBt->pPage1->aData[19]==0x01 /* (5) */
52082
+ ){
52083
+ u8 aSave[4];
52084
+ u8 *aWrite = &pBuf[-4];
52085
+ memcpy(aSave, aWrite, 4);
52086
+ rc = sqlite3OsRead(fd, aWrite, a+4, pBt->pageSize * (nextPage-1));
52087
+ nextPage = get4byte(aWrite);
52088
+ memcpy(aWrite, aSave, 4);
52089
+ }else
52090
+#endif
52091
+
52092
+ {
52093
+ DbPage *pDbPage;
52094
+ rc = sqlite3PagerGet(pBt->pPager, nextPage, &pDbPage);
52095
+ if( rc==SQLITE_OK ){
52096
+ aPayload = sqlite3PagerGetData(pDbPage);
52097
+ nextPage = get4byte(aPayload);
52098
+ rc = copyPayload(&aPayload[offset+4], pBuf, a, eOp, pDbPage);
52099
+ sqlite3PagerUnref(pDbPage);
52100
+ offset = 0;
52101
+ }
52102
+ }
52103
+ amt -= a;
52104
+ pBuf += a;
5214552105
}
5214652106
}
5214752107
}
5214852108
5214952109
if( rc==SQLITE_OK && amt>0 ){
@@ -56373,11 +56333,10 @@
5637356333
return rc;
5637456334
}
5637556335
5637656336
/************** End of btree.c ***********************************************/
5637756337
/************** Begin file backup.c ******************************************/
56378
-#line 1 "tsrc/backup.c"
5637956338
/*
5638056339
** 2009 January 28
5638156340
**
5638256341
** The author disclaims copyright to this source code. In place of
5638356342
** a legal notice, here is a blessing:
@@ -57089,11 +57048,10 @@
5708957048
}
5709057049
#endif /* SQLITE_OMIT_VACUUM */
5709157050
5709257051
/************** End of backup.c **********************************************/
5709357052
/************** Begin file vdbemem.c *****************************************/
57094
-#line 1 "tsrc/vdbemem.c"
5709557053
/*
5709657054
** 2004 May 26
5709757055
**
5709857056
** The author disclaims copyright to this source code. In place of
5709957057
** a legal notice, here is a blessing:
@@ -58244,11 +58202,10 @@
5824458202
return 0;
5824558203
}
5824658204
5824758205
/************** End of vdbemem.c *********************************************/
5824858206
/************** Begin file vdbeaux.c *****************************************/
58249
-#line 1 "tsrc/vdbeaux.c"
5825058207
/*
5825158208
** 2003 September 6
5825258209
**
5825358210
** The author disclaims copyright to this source code. In place of
5825458211
** a legal notice, here is a blessing:
@@ -61486,11 +61443,10 @@
6148661443
}
6148761444
}
6148861445
6148961446
/************** End of vdbeaux.c *********************************************/
6149061447
/************** Begin file vdbeapi.c *****************************************/
61491
-#line 1 "tsrc/vdbeapi.c"
6149261448
/*
6149361449
** 2004 May 26
6149461450
**
6149561451
** The author disclaims copyright to this source code. In place of
6149661452
** a legal notice, here is a blessing:
@@ -62794,11 +62750,10 @@
6279462750
return v;
6279562751
}
6279662752
6279762753
/************** End of vdbeapi.c *********************************************/
6279862754
/************** Begin file vdbetrace.c ***************************************/
62799
-#line 1 "tsrc/vdbetrace.c"
6280062755
/*
6280162756
** 2009 November 25
6280262757
**
6280362758
** The author disclaims copyright to this source code. In place of
6280462759
** a legal notice, here is a blessing:
@@ -62950,11 +62905,10 @@
6295062905
6295162906
#endif /* #ifndef SQLITE_OMIT_TRACE */
6295262907
6295362908
/************** End of vdbetrace.c *******************************************/
6295462909
/************** Begin file vdbe.c ********************************************/
62955
-#line 1 "tsrc/vdbe.c"
6295662910
/*
6295762911
** 2001 September 15
6295862912
**
6295962913
** The author disclaims copyright to this source code. In place of
6296062914
** a legal notice, here is a blessing:
@@ -63420,11 +63374,10 @@
6342063374
** hwtime.h contains inline assembler code for implementing
6342163375
** high-performance timing routines.
6342263376
*/
6342363377
/************** Include hwtime.h in the middle of vdbe.c *********************/
6342463378
/************** Begin file hwtime.h ******************************************/
63425
-#line 1 "tsrc/hwtime.h"
6342663379
/*
6342763380
** 2008 May 27
6342863381
**
6342963382
** The author disclaims copyright to this source code. In place of
6343063383
** a legal notice, here is a blessing:
@@ -63509,11 +63462,10 @@
6350963462
6351063463
#endif /* !defined(_HWTIME_H_) */
6351163464
6351263465
/************** End of hwtime.h **********************************************/
6351363466
/************** Continuing where we left off in vdbe.c ***********************/
63514
-#line 471 "tsrc/vdbe.c"
6351563467
6351663468
#endif
6351763469
6351863470
/*
6351963471
** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
@@ -69754,11 +69706,10 @@
6975469706
goto vdbe_error_halt;
6975569707
}
6975669708
6975769709
/************** End of vdbe.c ************************************************/
6975869710
/************** Begin file vdbeblob.c ****************************************/
69759
-#line 1 "tsrc/vdbeblob.c"
6976069711
/*
6976169712
** 2007 May 1
6976269713
**
6976369714
** The author disclaims copyright to this source code. In place of
6976469715
** a legal notice, here is a blessing:
@@ -70225,11 +70176,10 @@
7022570176
7022670177
#endif /* #ifndef SQLITE_OMIT_INCRBLOB */
7022770178
7022870179
/************** End of vdbeblob.c ********************************************/
7022970180
/************** Begin file vdbesort.c ****************************************/
70230
-#line 1 "tsrc/vdbesort.c"
7023170181
/*
7023270182
** 2011 July 9
7023370183
**
7023470184
** The author disclaims copyright to this source code. In place of
7023570185
** a legal notice, here is a blessing:
@@ -71109,11 +71059,10 @@
7110971059
7111071060
#endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
7111171061
7111271062
/************** End of vdbesort.c ********************************************/
7111371063
/************** Begin file journal.c *****************************************/
71114
-#line 1 "tsrc/journal.c"
7111571064
/*
7111671065
** 2007 August 22
7111771066
**
7111871067
** The author disclaims copyright to this source code. In place of
7111971068
** a legal notice, here is a blessing:
@@ -71350,11 +71299,10 @@
7135071299
}
7135171300
#endif
7135271301
7135371302
/************** End of journal.c *********************************************/
7135471303
/************** Begin file memjournal.c **************************************/
71355
-#line 1 "tsrc/memjournal.c"
7135671304
/*
7135771305
** 2008 October 7
7135871306
**
7135971307
** The author disclaims copyright to this source code. In place of
7136071308
** a legal notice, here is a blessing:
@@ -71612,11 +71560,10 @@
7161271560
return sizeof(MemJournal);
7161371561
}
7161471562
7161571563
/************** End of memjournal.c ******************************************/
7161671564
/************** Begin file walker.c ******************************************/
71617
-#line 1 "tsrc/walker.c"
7161871565
/*
7161971566
** 2008 August 16
7162071567
**
7162171568
** The author disclaims copyright to this source code. In place of
7162271569
** a legal notice, here is a blessing:
@@ -71751,11 +71698,10 @@
7175171698
return rc & WRC_Abort;
7175271699
}
7175371700
7175471701
/************** End of walker.c **********************************************/
7175571702
/************** Begin file resolve.c *****************************************/
71756
-#line 1 "tsrc/resolve.c"
7175771703
/*
7175871704
** 2008 August 18
7175971705
**
7176071706
** The author disclaims copyright to this source code. In place of
7176171707
** a legal notice, here is a blessing:
@@ -72972,11 +72918,10 @@
7297272918
sqlite3WalkSelect(&w, p);
7297372919
}
7297472920
7297572921
/************** End of resolve.c *********************************************/
7297672922
/************** Begin file expr.c ********************************************/
72977
-#line 1 "tsrc/expr.c"
7297872923
/*
7297972924
** 2001 September 15
7298072925
**
7298172926
** The author disclaims copyright to this source code. In place of
7298272927
** a legal notice, here is a blessing:
@@ -76730,11 +76675,10 @@
7673076675
}
7673176676
}
7673276677
7673376678
/************** End of expr.c ************************************************/
7673476679
/************** Begin file alter.c *******************************************/
76735
-#line 1 "tsrc/alter.c"
7673676680
/*
7673776681
** 2005 February 15
7673876682
**
7673976683
** The author disclaims copyright to this source code. In place of
7674076684
** a legal notice, here is a blessing:
@@ -77559,11 +77503,10 @@
7755977503
}
7756077504
#endif /* SQLITE_ALTER_TABLE */
7756177505
7756277506
/************** End of alter.c ***********************************************/
7756377507
/************** Begin file analyze.c *****************************************/
77564
-#line 1 "tsrc/analyze.c"
7756577508
/*
7756677509
** 2005 July 8
7756777510
**
7756877511
** The author disclaims copyright to this source code. In place of
7756977512
** a legal notice, here is a blessing:
@@ -77709,16 +77652,10 @@
7770977652
{ "sqlite_stat1", "tbl,idx,stat" },
7771077653
#ifdef SQLITE_ENABLE_STAT3
7771177654
{ "sqlite_stat3", "tbl,idx,neq,nlt,ndlt,sample" },
7771277655
#endif
7771377656
};
77714
- static const char *azToDrop[] = {
77715
- "sqlite_stat2",
77716
-#ifndef SQLITE_ENABLE_STAT3
77717
- "sqlite_stat3",
77718
-#endif
77719
- };
7772077657
7772177658
int aRoot[] = {0, 0};
7772277659
u8 aCreateTbl[] = {0, 0};
7772377660
7772477661
int i;
@@ -77728,21 +77665,10 @@
7772877665
if( v==0 ) return;
7772977666
assert( sqlite3BtreeHoldsAllMutexes(db) );
7773077667
assert( sqlite3VdbeDb(v)==db );
7773177668
pDb = &db->aDb[iDb];
7773277669
77733
- /* Drop all statistics tables that this version of SQLite does not
77734
- ** understand.
77735
- */
77736
- for(i=0; i<ArraySize(azToDrop); i++){
77737
- Table *pTab = sqlite3FindTable(db, azToDrop[i], pDb->zName);
77738
- if( pTab ){
77739
- sqlite3CodeDropTable(pParse, pTab, iDb, 0);
77740
- break;
77741
- }
77742
- }
77743
-
7774477670
/* Create new statistic tables if they do not exist, or clear them
7774577671
** if they do already exist.
7774677672
*/
7774777673
for(i=0; i<ArraySize(aTable); i++){
7774877674
const char *zTab = aTable[i].zName;
@@ -78699,11 +78625,10 @@
7869978625
7870078626
#endif /* SQLITE_OMIT_ANALYZE */
7870178627
7870278628
/************** End of analyze.c *********************************************/
7870378629
/************** Begin file attach.c ******************************************/
78704
-#line 1 "tsrc/attach.c"
7870578630
/*
7870678631
** 2003 April 6
7870778632
**
7870878633
** The author disclaims copyright to this source code. In place of
7870978634
** a legal notice, here is a blessing:
@@ -79259,11 +79184,10 @@
7925979184
}
7926079185
#endif
7926179186
7926279187
/************** End of attach.c **********************************************/
7926379188
/************** Begin file auth.c ********************************************/
79264
-#line 1 "tsrc/auth.c"
7926579189
/*
7926679190
** 2003 January 11
7926779191
**
7926879192
** The author disclaims copyright to this source code. In place of
7926979193
** a legal notice, here is a blessing:
@@ -79511,11 +79435,10 @@
7951179435
7951279436
#endif /* SQLITE_OMIT_AUTHORIZATION */
7951379437
7951479438
/************** End of auth.c ************************************************/
7951579439
/************** Begin file build.c *******************************************/
79516
-#line 1 "tsrc/build.c"
7951779440
/*
7951879441
** 2001 September 15
7951979442
**
7952079443
** The author disclaims copyright to this source code. In place of
7952179444
** a legal notice, here is a blessing:
@@ -81658,11 +81581,12 @@
8165881581
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){
8165981582
goto exit_drop_table;
8166081583
}
8166181584
}
8166281585
#endif
81663
- if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 ){
81586
+ if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0
81587
+ && sqlite3StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){
8166481588
sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName);
8166581589
goto exit_drop_table;
8166681590
}
8166781591
8166881592
#ifndef SQLITE_OMIT_VIEW
@@ -83332,11 +83256,10 @@
8333283256
return pKey;
8333383257
}
8333483258
8333583259
/************** End of build.c ***********************************************/
8333683260
/************** Begin file callback.c ****************************************/
83337
-#line 1 "tsrc/callback.c"
8333883261
/*
8333983262
** 2005 May 23
8334083263
**
8334183264
** The author disclaims copyright to this source code. In place of
8334283265
** a legal notice, here is a blessing:
@@ -83792,11 +83715,10 @@
8379283715
return p;
8379383716
}
8379483717
8379583718
/************** End of callback.c ********************************************/
8379683719
/************** Begin file delete.c ******************************************/
83797
-#line 1 "tsrc/delete.c"
8379883720
/*
8379983721
** 2001 September 15
8380083722
**
8380183723
** The author disclaims copyright to this source code. In place of
8380283724
** a legal notice, here is a blessing:
@@ -84447,11 +84369,10 @@
8444784369
return regBase;
8444884370
}
8444984371
8445084372
/************** End of delete.c **********************************************/
8445184373
/************** Begin file func.c ********************************************/
84452
-#line 1 "tsrc/func.c"
8445384374
/*
8445484375
** 2002 February 23
8445584376
**
8445684377
** The author disclaims copyright to this source code. In place of
8445784378
** a legal notice, here is a blessing:
@@ -86056,11 +85977,10 @@
8605685977
#endif
8605785978
}
8605885979
8605985980
/************** End of func.c ************************************************/
8606085981
/************** Begin file fkey.c ********************************************/
86061
-#line 1 "tsrc/fkey.c"
8606285982
/*
8606385983
**
8606485984
** The author disclaims copyright to this source code. In place of
8606585985
** a legal notice, here is a blessing:
8606685986
**
@@ -87277,11 +87197,10 @@
8727787197
}
8727887198
#endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
8727987199
8728087200
/************** End of fkey.c ************************************************/
8728187201
/************** Begin file insert.c ******************************************/
87282
-#line 1 "tsrc/insert.c"
8728387202
/*
8728487203
** 2001 September 15
8728587204
**
8728687205
** The author disclaims copyright to this source code. In place of
8728787206
** a legal notice, here is a blessing:
@@ -89126,11 +89045,10 @@
8912689045
}
8912789046
#endif /* SQLITE_OMIT_XFER_OPT */
8912889047
8912989048
/************** End of insert.c **********************************************/
8913089049
/************** Begin file legacy.c ******************************************/
89131
-#line 1 "tsrc/legacy.c"
8913289050
/*
8913389051
** 2001 September 15
8913489052
**
8913589053
** The author disclaims copyright to this source code. In place of
8913689054
** a legal notice, here is a blessing:
@@ -89274,11 +89192,10 @@
8927489192
return rc;
8927589193
}
8927689194
8927789195
/************** End of legacy.c **********************************************/
8927889196
/************** Begin file loadext.c *****************************************/
89279
-#line 1 "tsrc/loadext.c"
8928089197
/*
8928189198
** 2006 June 7
8928289199
**
8928389200
** The author disclaims copyright to this source code. In place of
8928489201
** a legal notice, here is a blessing:
@@ -89295,11 +89212,10 @@
8929589212
#ifndef SQLITE_CORE
8929689213
#define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
8929789214
#endif
8929889215
/************** Include sqlite3ext.h in the middle of loadext.c **************/
8929989216
/************** Begin file sqlite3ext.h **************************************/
89300
-#line 1 "tsrc/sqlite3ext.h"
8930189217
/*
8930289218
** 2006 June 7
8930389219
**
8930489220
** The author disclaims copyright to this source code. In place of
8930589221
** a legal notice, here is a blessing:
@@ -89724,11 +89640,10 @@
8972489640
8972589641
#endif /* _SQLITE3EXT_H_ */
8972689642
8972789643
/************** End of sqlite3ext.h ******************************************/
8972889644
/************** Continuing where we left off in loadext.c ********************/
89729
-#line 20 "tsrc/loadext.c"
8973089645
/* #include <string.h> */
8973189646
8973289647
#ifndef SQLITE_OMIT_LOAD_EXTENSION
8973389648
8973489649
/*
@@ -90364,11 +90279,10 @@
9036490279
}
9036590280
}
9036690281
9036790282
/************** End of loadext.c *********************************************/
9036890283
/************** Begin file pragma.c ******************************************/
90369
-#line 1 "tsrc/pragma.c"
9037090284
/*
9037190285
** 2003 April 6
9037290286
**
9037390287
** The author disclaims copyright to this source code. In place of
9037490288
** a legal notice, here is a blessing:
@@ -90899,12 +90813,14 @@
9089990813
*/
9090090814
if( sqlite3StrICmp(zLeft,"journal_mode")==0 ){
9090190815
int eMode; /* One of the PAGER_JOURNALMODE_XXX symbols */
9090290816
int ii; /* Loop counter */
9090390817
90904
- /* Force the schema to be loaded on all databases. This cases all
90905
- ** database files to be opened and the journal_modes set. */
90818
+ /* Force the schema to be loaded on all databases. This causes all
90819
+ ** database files to be opened and the journal_modes set. This is
90820
+ ** necessary because subsequent processing must know if the databases
90821
+ ** are in WAL mode. */
9090690822
if( sqlite3ReadSchema(pParse) ){
9090790823
goto pragma_out;
9090890824
}
9090990825
9091090826
sqlite3VdbeSetNumCols(v, 1);
@@ -91893,11 +91809,10 @@
9189391809
9189491810
#endif /* SQLITE_OMIT_PRAGMA */
9189591811
9189691812
/************** End of pragma.c **********************************************/
9189791813
/************** Begin file prepare.c *****************************************/
91898
-#line 1 "tsrc/prepare.c"
9189991814
/*
9190091815
** 2005 May 25
9190191816
**
9190291817
** The author disclaims copyright to this source code. In place of
9190391818
** a legal notice, here is a blessing:
@@ -92754,11 +92669,10 @@
9275492669
9275592670
#endif /* SQLITE_OMIT_UTF16 */
9275692671
9275792672
/************** End of prepare.c *********************************************/
9275892673
/************** Begin file select.c ******************************************/
92759
-#line 1 "tsrc/select.c"
9276092674
/*
9276192675
** 2001 September 15
9276292676
**
9276392677
** The author disclaims copyright to this source code. In place of
9276492678
** a legal notice, here is a blessing:
@@ -92821,10 +92735,11 @@
9282192735
Select standin;
9282292736
sqlite3 *db = pParse->db;
9282392737
pNew = sqlite3DbMallocZero(db, sizeof(*pNew) );
9282492738
assert( db->mallocFailed || !pOffset || pLimit ); /* OFFSET implies LIMIT */
9282592739
if( pNew==0 ){
92740
+ assert( db->mallocFailed );
9282692741
pNew = &standin;
9282792742
memset(pNew, 0, sizeof(*pNew));
9282892743
}
9282992744
if( pEList==0 ){
9283092745
pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ALL,0));
@@ -92848,10 +92763,11 @@
9284892763
if( pNew!=&standin ) sqlite3DbFree(db, pNew);
9284992764
pNew = 0;
9285092765
}else{
9285192766
assert( pNew->pSrc!=0 || pParse->nErr>0 );
9285292767
}
92768
+ assert( pNew!=&standin );
9285392769
return pNew;
9285492770
}
9285592771
9285692772
/*
9285792773
** Delete the given Select structure and all of its substructures.
@@ -97343,11 +97259,10 @@
9734397259
*****************************************************************************/
9734497260
#endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
9734597261
9734697262
/************** End of select.c **********************************************/
9734797263
/************** Begin file table.c *******************************************/
97348
-#line 1 "tsrc/table.c"
9734997264
/*
9735097265
** 2001 September 15
9735197266
**
9735297267
** The author disclaims copyright to this source code. In place of
9735397268
** a legal notice, here is a blessing:
@@ -97543,11 +97458,10 @@
9754397458
9754497459
#endif /* SQLITE_OMIT_GET_TABLE */
9754597460
9754697461
/************** End of table.c ***********************************************/
9754797462
/************** Begin file trigger.c *****************************************/
97548
-#line 1 "tsrc/trigger.c"
9754997463
/*
9755097464
**
9755197465
** The author disclaims copyright to this source code. In place of
9755297466
** a legal notice, here is a blessing:
9755397467
**
@@ -98669,11 +98583,10 @@
9866998583
9867098584
#endif /* !defined(SQLITE_OMIT_TRIGGER) */
9867198585
9867298586
/************** End of trigger.c *********************************************/
9867398587
/************** Begin file update.c ******************************************/
98674
-#line 1 "tsrc/update.c"
9867598588
/*
9867698589
** 2001 September 15
9867798590
**
9867898591
** The author disclaims copyright to this source code. In place of
9867998592
** a legal notice, here is a blessing:
@@ -99342,11 +99255,10 @@
9934299255
}
9934399256
#endif /* SQLITE_OMIT_VIRTUALTABLE */
9934499257
9934599258
/************** End of update.c **********************************************/
9934699259
/************** Begin file vacuum.c ******************************************/
99347
-#line 1 "tsrc/vacuum.c"
9934899260
/*
9934999261
** 2003 April 6
9935099262
**
9935199263
** The author disclaims copyright to this source code. In place of
9935299264
** a legal notice, here is a blessing:
@@ -99687,11 +99599,10 @@
9968799599
9968899600
#endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
9968999601
9969099602
/************** End of vacuum.c **********************************************/
9969199603
/************** Begin file vtab.c ********************************************/
99692
-#line 1 "tsrc/vtab.c"
9969399604
/*
9969499605
** 2006 June 10
9969599606
**
9969699607
** The author disclaims copyright to this source code. In place of
9969799608
** a legal notice, here is a blessing:
@@ -100756,11 +100667,10 @@
100756100667
100757100668
#endif /* SQLITE_OMIT_VIRTUALTABLE */
100758100669
100759100670
/************** End of vtab.c ************************************************/
100760100671
/************** Begin file where.c *******************************************/
100761
-#line 1 "tsrc/where.c"
100762100672
/*
100763100673
** 2001 September 15
100764100674
**
100765100675
** The author disclaims copyright to this source code. In place of
100766100676
** a legal notice, here is a blessing:
@@ -101463,11 +101373,11 @@
101463101373
int iCol = pRight->iColumn;
101464101374
pVal = sqlite3VdbeGetValue(pReprepare, iCol, SQLITE_AFF_NONE);
101465101375
if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
101466101376
z = (char *)sqlite3_value_text(pVal);
101467101377
}
101468
- sqlite3VdbeSetVarmask(pParse->pVdbe, iCol); /* IMP: R-23257-02778 */
101378
+ sqlite3VdbeSetVarmask(pParse->pVdbe, iCol); /* IMP: R-31526-56213 */
101469101379
assert( pRight->op==TK_VARIABLE || pRight->op==TK_REGISTER );
101470101380
}else if( op==TK_STRING ){
101471101381
z = pRight->u.zToken;
101472101382
}
101473101383
if( z ){
@@ -101481,11 +101391,11 @@
101481101391
pPrefix = sqlite3Expr(db, TK_STRING, z);
101482101392
if( pPrefix ) pPrefix->u.zToken[cnt] = 0;
101483101393
*ppPrefix = pPrefix;
101484101394
if( op==TK_VARIABLE ){
101485101395
Vdbe *v = pParse->pVdbe;
101486
- sqlite3VdbeSetVarmask(v, pRight->iColumn); /* IMP: R-23257-02778 */
101396
+ sqlite3VdbeSetVarmask(v, pRight->iColumn); /* IMP: R-31526-56213 */
101487101397
if( *pisComplete && pRight->u.zToken[1] ){
101488101398
/* If the rhs of the LIKE expression is a variable, and the current
101489101399
** value of the variable means there is no need to invoke the LIKE
101490101400
** function, then no OP_Variable will be added to the program.
101491101401
** This causes problems for the sqlite3_bind_parameter_name()
@@ -103395,11 +103305,11 @@
103395103305
){
103396103306
if( pExpr->op==TK_VARIABLE
103397103307
|| (pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE)
103398103308
){
103399103309
int iVar = pExpr->iColumn;
103400
- sqlite3VdbeSetVarmask(pParse->pVdbe, iVar); /* IMP: R-23257-02778 */
103310
+ sqlite3VdbeSetVarmask(pParse->pVdbe, iVar); /* IMP: R-31526-56213 */
103401103311
*pp = sqlite3VdbeGetValue(pParse->pReprepare, iVar, aff);
103402103312
return SQLITE_OK;
103403103313
}
103404103314
return sqlite3ValueFromExpr(pParse->db, pExpr, SQLITE_UTF8, aff, pp);
103405103315
}
@@ -105984,11 +105894,10 @@
105984105894
return;
105985105895
}
105986105896
105987105897
/************** End of where.c ***********************************************/
105988105898
/************** Begin file parse.c *******************************************/
105989
-#line 1 "tsrc/parse.c"
105990105899
/* Driver template for the LEMON parser generator.
105991105900
** The author disclaims copyright to this source code.
105992105901
**
105993105902
** This version of "lempar.c" is modified, slightly, for use by SQLite.
105994105903
** The only modifications are the addition of a couple of NEVER()
@@ -105997,11 +105906,10 @@
105997105906
** specific grammar used by SQLite.
105998105907
*/
105999105908
/* First off, code is included that follows the "include" declaration
106000105909
** in the input grammar file. */
106001105910
/* #include <stdio.h> */
106002
-#line 51 "parse.y"
106003105911
106004105912
106005105913
/*
106006105914
** Disable all error recovery processing in the parser push-down
106007105915
** automaton.
@@ -106045,11 +105953,10 @@
106045105953
/*
106046105954
** An instance of this structure holds the ATTACH key and the key type.
106047105955
*/
106048105956
struct AttachKey { int type; Token key; };
106049105957
106050
-#line 722 "parse.y"
106051105958
106052105959
/* This is a utility routine used to set the ExprSpan.zStart and
106053105960
** ExprSpan.zEnd values of pOut so that the span covers the complete
106054105961
** range of text beginning with pStart and going to the end of pEnd.
106055105962
*/
@@ -106065,11 +105972,10 @@
106065105972
static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){
106066105973
pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue);
106067105974
pOut->zStart = pValue->z;
106068105975
pOut->zEnd = &pValue->z[pValue->n];
106069105976
}
106070
-#line 817 "parse.y"
106071105977
106072105978
/* This routine constructs a binary expression node out of two ExprSpan
106073105979
** objects and uses the result to populate a new ExprSpan object.
106074105980
*/
106075105981
static void spanBinaryExpr(
@@ -106081,11 +105987,10 @@
106081105987
){
106082105988
pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0);
106083105989
pOut->zStart = pLeft->zStart;
106084105990
pOut->zEnd = pRight->zEnd;
106085105991
}
106086
-#line 873 "parse.y"
106087105992
106088105993
/* Construct an expression node for a unary postfix operator
106089105994
*/
106090105995
static void spanUnaryPostfix(
106091105996
ExprSpan *pOut, /* Write the new expression node here */
@@ -106096,11 +106001,10 @@
106096106001
){
106097106002
pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
106098106003
pOut->zStart = pOperand->zStart;
106099106004
pOut->zEnd = &pPostOp->z[pPostOp->n];
106100106005
}
106101
-#line 892 "parse.y"
106102106006
106103106007
/* A routine to convert a binary TK_IS or TK_ISNOT expression into a
106104106008
** unary TK_ISNULL or TK_NOTNULL expression. */
106105106009
static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
106106106010
sqlite3 *db = pParse->db;
@@ -106108,11 +106012,10 @@
106108106012
pA->op = (u8)op;
106109106013
sqlite3ExprDelete(db, pA->pRight);
106110106014
pA->pRight = 0;
106111106015
}
106112106016
}
106113
-#line 920 "parse.y"
106114106017
106115106018
/* Construct an expression node for a unary prefix operator
106116106019
*/
106117106020
static void spanUnaryPrefix(
106118106021
ExprSpan *pOut, /* Write the new expression node here */
@@ -106123,11 +106026,10 @@
106123106026
){
106124106027
pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
106125106028
pOut->zStart = pPreOp->z;
106126106029
pOut->zEnd = pOperand->zEnd;
106127106030
}
106128
-#line 141 "parse.c"
106129106031
/* Next is all token values, in a form suitable for use by makeheaders.
106130106032
** This section will be null unless lemon is run with the -m switch.
106131106033
*/
106132106034
/*
106133106035
** These constants (all generated automatically by the parser generator)
@@ -107379,21 +107281,17 @@
107379107281
** inside the C code.
107380107282
*/
107381107283
case 160: /* select */
107382107284
case 194: /* oneselect */
107383107285
{
107384
-#line 403 "parse.y"
107385107286
sqlite3SelectDelete(pParse->db, (yypminor->yy387));
107386
-#line 1399 "parse.c"
107387107287
}
107388107288
break;
107389107289
case 174: /* term */
107390107290
case 175: /* expr */
107391107291
{
107392
-#line 720 "parse.y"
107393107292
sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
107394
-#line 1407 "parse.c"
107395107293
}
107396107294
break;
107397107295
case 179: /* idxlist_opt */
107398107296
case 187: /* idxlist */
107399107297
case 197: /* selcollist */
@@ -107405,23 +107303,19 @@
107405107303
case 217: /* setlist */
107406107304
case 220: /* itemlist */
107407107305
case 221: /* exprlist */
107408107306
case 226: /* case_exprlist */
107409107307
{
107410
-#line 1103 "parse.y"
107411107308
sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
107412
-#line 1425 "parse.c"
107413107309
}
107414107310
break;
107415107311
case 193: /* fullname */
107416107312
case 198: /* from */
107417107313
case 206: /* seltablist */
107418107314
case 207: /* stl_prefix */
107419107315
{
107420
-#line 534 "parse.y"
107421107316
sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
107422
-#line 1435 "parse.c"
107423107317
}
107424107318
break;
107425107319
case 199: /* where_opt */
107426107320
case 201: /* having_opt */
107427107321
case 210: /* on_opt */
@@ -107429,37 +107323,29 @@
107429107323
case 225: /* case_operand */
107430107324
case 227: /* case_else */
107431107325
case 238: /* when_clause */
107432107326
case 243: /* key_opt */
107433107327
{
107434
-#line 644 "parse.y"
107435107328
sqlite3ExprDelete(pParse->db, (yypminor->yy314));
107436
-#line 1449 "parse.c"
107437107329
}
107438107330
break;
107439107331
case 211: /* using_opt */
107440107332
case 213: /* inscollist */
107441107333
case 219: /* inscollist_opt */
107442107334
{
107443
-#line 566 "parse.y"
107444107335
sqlite3IdListDelete(pParse->db, (yypminor->yy384));
107445
-#line 1458 "parse.c"
107446107336
}
107447107337
break;
107448107338
case 234: /* trigger_cmd_list */
107449107339
case 239: /* trigger_cmd */
107450107340
{
107451
-#line 1210 "parse.y"
107452107341
sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
107453
-#line 1466 "parse.c"
107454107342
}
107455107343
break;
107456107344
case 236: /* trigger_event */
107457107345
{
107458
-#line 1196 "parse.y"
107459107346
sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
107460
-#line 1473 "parse.c"
107461107347
}
107462107348
break;
107463107349
default: break; /* If no destructor action specified: do nothing */
107464107350
}
107465107351
}
@@ -107641,16 +107527,14 @@
107641107527
}
107642107528
#endif
107643107529
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
107644107530
/* Here code is inserted which will execute if the parser
107645107531
** stack every overflows */
107646
-#line 38 "parse.y"
107647107532
107648107533
UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
107649107534
sqlite3ErrorMsg(pParse, "parser stack overflow");
107650107535
pParse->parseError = 1;
107651
-#line 1664 "parse.c"
107652107536
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
107653107537
}
107654107538
107655107539
/*
107656107540
** Perform a shift action.
@@ -108087,94 +107971,66 @@
108087107971
** { ... } // User supplied code
108088107972
** #line <lineno> <thisfile>
108089107973
** break;
108090107974
*/
108091107975
case 5: /* explain ::= */
108092
-#line 107 "parse.y"
108093107976
{ sqlite3BeginParse(pParse, 0); }
108094
-#line 2107 "parse.c"
108095107977
break;
108096107978
case 6: /* explain ::= EXPLAIN */
108097
-#line 109 "parse.y"
108098107979
{ sqlite3BeginParse(pParse, 1); }
108099
-#line 2112 "parse.c"
108100107980
break;
108101107981
case 7: /* explain ::= EXPLAIN QUERY PLAN */
108102
-#line 110 "parse.y"
108103107982
{ sqlite3BeginParse(pParse, 2); }
108104
-#line 2117 "parse.c"
108105107983
break;
108106107984
case 8: /* cmdx ::= cmd */
108107
-#line 112 "parse.y"
108108107985
{ sqlite3FinishCoding(pParse); }
108109
-#line 2122 "parse.c"
108110107986
break;
108111107987
case 9: /* cmd ::= BEGIN transtype trans_opt */
108112
-#line 117 "parse.y"
108113107988
{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
108114
-#line 2127 "parse.c"
108115107989
break;
108116107990
case 13: /* transtype ::= */
108117
-#line 122 "parse.y"
108118107991
{yygotominor.yy4 = TK_DEFERRED;}
108119
-#line 2132 "parse.c"
108120107992
break;
108121107993
case 14: /* transtype ::= DEFERRED */
108122107994
case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
108123107995
case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
108124107996
case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
108125107997
case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
108126
-#line 123 "parse.y"
108127107998
{yygotominor.yy4 = yymsp[0].major;}
108128
-#line 2141 "parse.c"
108129107999
break;
108130108000
case 17: /* cmd ::= COMMIT trans_opt */
108131108001
case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
108132
-#line 126 "parse.y"
108133108002
{sqlite3CommitTransaction(pParse);}
108134
-#line 2147 "parse.c"
108135108003
break;
108136108004
case 19: /* cmd ::= ROLLBACK trans_opt */
108137
-#line 128 "parse.y"
108138108005
{sqlite3RollbackTransaction(pParse);}
108139
-#line 2152 "parse.c"
108140108006
break;
108141108007
case 22: /* cmd ::= SAVEPOINT nm */
108142
-#line 132 "parse.y"
108143108008
{
108144108009
sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
108145108010
}
108146
-#line 2159 "parse.c"
108147108011
break;
108148108012
case 23: /* cmd ::= RELEASE savepoint_opt nm */
108149
-#line 135 "parse.y"
108150108013
{
108151108014
sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
108152108015
}
108153
-#line 2166 "parse.c"
108154108016
break;
108155108017
case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
108156
-#line 138 "parse.y"
108157108018
{
108158108019
sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
108159108020
}
108160
-#line 2173 "parse.c"
108161108021
break;
108162108022
case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
108163
-#line 145 "parse.y"
108164108023
{
108165108024
sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
108166108025
}
108167
-#line 2180 "parse.c"
108168108026
break;
108169108027
case 27: /* createkw ::= CREATE */
108170
-#line 148 "parse.y"
108171108028
{
108172108029
pParse->db->lookaside.bEnabled = 0;
108173108030
yygotominor.yy0 = yymsp[0].minor.yy0;
108174108031
}
108175
-#line 2188 "parse.c"
108176108032
break;
108177108033
case 28: /* ifnotexists ::= */
108178108034
case 31: /* temp ::= */ yytestcase(yyruleno==31);
108179108035
case 70: /* autoinc ::= */ yytestcase(yyruleno==70);
108180108036
case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83);
@@ -108184,56 +108040,44 @@
108184108040
case 109: /* ifexists ::= */ yytestcase(yyruleno==109);
108185108041
case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120);
108186108042
case 121: /* distinct ::= */ yytestcase(yyruleno==121);
108187108043
case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222);
108188108044
case 225: /* in_op ::= IN */ yytestcase(yyruleno==225);
108189
-#line 153 "parse.y"
108190108045
{yygotominor.yy4 = 0;}
108191
-#line 2204 "parse.c"
108192108046
break;
108193108047
case 29: /* ifnotexists ::= IF NOT EXISTS */
108194108048
case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
108195108049
case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71);
108196108050
case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86);
108197108051
case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108);
108198108052
case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119);
108199108053
case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223);
108200108054
case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226);
108201
-#line 154 "parse.y"
108202108055
{yygotominor.yy4 = 1;}
108203
-#line 2216 "parse.c"
108204108056
break;
108205108057
case 32: /* create_table_args ::= LP columnlist conslist_opt RP */
108206
-#line 160 "parse.y"
108207108058
{
108208108059
sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
108209108060
}
108210
-#line 2223 "parse.c"
108211108061
break;
108212108062
case 33: /* create_table_args ::= AS select */
108213
-#line 163 "parse.y"
108214108063
{
108215108064
sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387);
108216108065
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
108217108066
}
108218
-#line 2231 "parse.c"
108219108067
break;
108220108068
case 36: /* column ::= columnid type carglist */
108221
-#line 175 "parse.y"
108222108069
{
108223108070
yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
108224108071
yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
108225108072
}
108226
-#line 2239 "parse.c"
108227108073
break;
108228108074
case 37: /* columnid ::= nm */
108229
-#line 179 "parse.y"
108230108075
{
108231108076
sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
108232108077
yygotominor.yy0 = yymsp[0].minor.yy0;
108233108078
}
108234
-#line 2247 "parse.c"
108235108079
break;
108236108080
case 38: /* id ::= ID */
108237108081
case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39);
108238108082
case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40);
108239108083
case 41: /* nm ::= id */ yytestcase(yyruleno==41);
@@ -108253,373 +108097,256 @@
108253108097
case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264);
108254108098
case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265);
108255108099
case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266);
108256108100
case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267);
108257108101
case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
108258
-#line 189 "parse.y"
108259108102
{yygotominor.yy0 = yymsp[0].minor.yy0;}
108260
-#line 2273 "parse.c"
108261108103
break;
108262108104
case 45: /* type ::= typetoken */
108263
-#line 251 "parse.y"
108264108105
{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
108265
-#line 2278 "parse.c"
108266108106
break;
108267108107
case 47: /* typetoken ::= typename LP signed RP */
108268
-#line 253 "parse.y"
108269108108
{
108270108109
yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
108271108110
yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
108272108111
}
108273
-#line 2286 "parse.c"
108274108112
break;
108275108113
case 48: /* typetoken ::= typename LP signed COMMA signed RP */
108276
-#line 257 "parse.y"
108277108114
{
108278108115
yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
108279108116
yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
108280108117
}
108281
-#line 2294 "parse.c"
108282108118
break;
108283108119
case 50: /* typename ::= typename ids */
108284
-#line 263 "parse.y"
108285108120
{yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
108286
-#line 2299 "parse.c"
108287108121
break;
108288108122
case 57: /* ccons ::= DEFAULT term */
108289108123
case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59);
108290
-#line 274 "parse.y"
108291108124
{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
108292
-#line 2305 "parse.c"
108293108125
break;
108294108126
case 58: /* ccons ::= DEFAULT LP expr RP */
108295
-#line 275 "parse.y"
108296108127
{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
108297
-#line 2310 "parse.c"
108298108128
break;
108299108129
case 60: /* ccons ::= DEFAULT MINUS term */
108300
-#line 277 "parse.y"
108301108130
{
108302108131
ExprSpan v;
108303108132
v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
108304108133
v.zStart = yymsp[-1].minor.yy0.z;
108305108134
v.zEnd = yymsp[0].minor.yy118.zEnd;
108306108135
sqlite3AddDefaultValue(pParse,&v);
108307108136
}
108308
-#line 2321 "parse.c"
108309108137
break;
108310108138
case 61: /* ccons ::= DEFAULT id */
108311
-#line 284 "parse.y"
108312108139
{
108313108140
ExprSpan v;
108314108141
spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
108315108142
sqlite3AddDefaultValue(pParse,&v);
108316108143
}
108317
-#line 2330 "parse.c"
108318108144
break;
108319108145
case 63: /* ccons ::= NOT NULL onconf */
108320
-#line 294 "parse.y"
108321108146
{sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
108322
-#line 2335 "parse.c"
108323108147
break;
108324108148
case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
108325
-#line 296 "parse.y"
108326108149
{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
108327
-#line 2340 "parse.c"
108328108150
break;
108329108151
case 65: /* ccons ::= UNIQUE onconf */
108330
-#line 297 "parse.y"
108331108152
{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
108332
-#line 2345 "parse.c"
108333108153
break;
108334108154
case 66: /* ccons ::= CHECK LP expr RP */
108335
-#line 298 "parse.y"
108336108155
{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
108337
-#line 2350 "parse.c"
108338108156
break;
108339108157
case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */
108340
-#line 300 "parse.y"
108341108158
{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
108342
-#line 2355 "parse.c"
108343108159
break;
108344108160
case 68: /* ccons ::= defer_subclause */
108345
-#line 301 "parse.y"
108346108161
{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
108347
-#line 2360 "parse.c"
108348108162
break;
108349108163
case 69: /* ccons ::= COLLATE ids */
108350
-#line 302 "parse.y"
108351108164
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
108352
-#line 2365 "parse.c"
108353108165
break;
108354108166
case 72: /* refargs ::= */
108355
-#line 315 "parse.y"
108356108167
{ yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
108357
-#line 2370 "parse.c"
108358108168
break;
108359108169
case 73: /* refargs ::= refargs refarg */
108360
-#line 316 "parse.y"
108361108170
{ yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
108362
-#line 2375 "parse.c"
108363108171
break;
108364108172
case 74: /* refarg ::= MATCH nm */
108365108173
case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75);
108366
-#line 318 "parse.y"
108367108174
{ yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
108368
-#line 2381 "parse.c"
108369108175
break;
108370108176
case 76: /* refarg ::= ON DELETE refact */
108371
-#line 320 "parse.y"
108372108177
{ yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
108373
-#line 2386 "parse.c"
108374108178
break;
108375108179
case 77: /* refarg ::= ON UPDATE refact */
108376
-#line 321 "parse.y"
108377108180
{ yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
108378
-#line 2391 "parse.c"
108379108181
break;
108380108182
case 78: /* refact ::= SET NULL */
108381
-#line 323 "parse.y"
108382108183
{ yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
108383
-#line 2396 "parse.c"
108384108184
break;
108385108185
case 79: /* refact ::= SET DEFAULT */
108386
-#line 324 "parse.y"
108387108186
{ yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
108388
-#line 2401 "parse.c"
108389108187
break;
108390108188
case 80: /* refact ::= CASCADE */
108391
-#line 325 "parse.y"
108392108189
{ yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
108393
-#line 2406 "parse.c"
108394108190
break;
108395108191
case 81: /* refact ::= RESTRICT */
108396
-#line 326 "parse.y"
108397108192
{ yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
108398
-#line 2411 "parse.c"
108399108193
break;
108400108194
case 82: /* refact ::= NO ACTION */
108401
-#line 327 "parse.y"
108402108195
{ yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
108403
-#line 2416 "parse.c"
108404108196
break;
108405108197
case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
108406108198
case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99);
108407108199
case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101);
108408108200
case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104);
108409
-#line 330 "parse.y"
108410108201
{yygotominor.yy4 = yymsp[0].minor.yy4;}
108411
-#line 2424 "parse.c"
108412108202
break;
108413108203
case 88: /* conslist_opt ::= */
108414
-#line 339 "parse.y"
108415108204
{yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
108416
-#line 2429 "parse.c"
108417108205
break;
108418108206
case 89: /* conslist_opt ::= COMMA conslist */
108419
-#line 340 "parse.y"
108420108207
{yygotominor.yy0 = yymsp[-1].minor.yy0;}
108421
-#line 2434 "parse.c"
108422108208
break;
108423108209
case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
108424
-#line 346 "parse.y"
108425108210
{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
108426
-#line 2439 "parse.c"
108427108211
break;
108428108212
case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */
108429
-#line 348 "parse.y"
108430108213
{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
108431
-#line 2444 "parse.c"
108432108214
break;
108433108215
case 96: /* tcons ::= CHECK LP expr RP onconf */
108434
-#line 350 "parse.y"
108435108216
{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
108436
-#line 2449 "parse.c"
108437108217
break;
108438108218
case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
108439
-#line 352 "parse.y"
108440108219
{
108441108220
sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
108442108221
sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
108443108222
}
108444
-#line 2457 "parse.c"
108445108223
break;
108446108224
case 100: /* onconf ::= */
108447
-#line 366 "parse.y"
108448108225
{yygotominor.yy4 = OE_Default;}
108449
-#line 2462 "parse.c"
108450108226
break;
108451108227
case 102: /* orconf ::= */
108452
-#line 368 "parse.y"
108453108228
{yygotominor.yy210 = OE_Default;}
108454
-#line 2467 "parse.c"
108455108229
break;
108456108230
case 103: /* orconf ::= OR resolvetype */
108457
-#line 369 "parse.y"
108458108231
{yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
108459
-#line 2472 "parse.c"
108460108232
break;
108461108233
case 105: /* resolvetype ::= IGNORE */
108462
-#line 371 "parse.y"
108463108234
{yygotominor.yy4 = OE_Ignore;}
108464
-#line 2477 "parse.c"
108465108235
break;
108466108236
case 106: /* resolvetype ::= REPLACE */
108467
-#line 372 "parse.y"
108468108237
{yygotominor.yy4 = OE_Replace;}
108469
-#line 2482 "parse.c"
108470108238
break;
108471108239
case 107: /* cmd ::= DROP TABLE ifexists fullname */
108472
-#line 376 "parse.y"
108473108240
{
108474108241
sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
108475108242
}
108476
-#line 2489 "parse.c"
108477108243
break;
108478108244
case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
108479
-#line 386 "parse.y"
108480108245
{
108481108246
sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4);
108482108247
}
108483
-#line 2496 "parse.c"
108484108248
break;
108485108249
case 111: /* cmd ::= DROP VIEW ifexists fullname */
108486
-#line 389 "parse.y"
108487108250
{
108488108251
sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
108489108252
}
108490
-#line 2503 "parse.c"
108491108253
break;
108492108254
case 112: /* cmd ::= select */
108493
-#line 396 "parse.y"
108494108255
{
108495108256
SelectDest dest = {SRT_Output, 0, 0, 0, 0};
108496108257
sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
108497108258
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
108498108259
}
108499
-#line 2512 "parse.c"
108500108260
break;
108501108261
case 113: /* select ::= oneselect */
108502
-#line 407 "parse.y"
108503108262
{yygotominor.yy387 = yymsp[0].minor.yy387;}
108504
-#line 2517 "parse.c"
108505108263
break;
108506108264
case 114: /* select ::= select multiselect_op oneselect */
108507
-#line 409 "parse.y"
108508108265
{
108509108266
if( yymsp[0].minor.yy387 ){
108510108267
yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
108511108268
yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
108512108269
}else{
108513108270
sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
108514108271
}
108515108272
yygotominor.yy387 = yymsp[0].minor.yy387;
108516108273
}
108517
-#line 2530 "parse.c"
108518108274
break;
108519108275
case 116: /* multiselect_op ::= UNION ALL */
108520
-#line 420 "parse.y"
108521108276
{yygotominor.yy4 = TK_ALL;}
108522
-#line 2535 "parse.c"
108523108277
break;
108524108278
case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
108525
-#line 424 "parse.y"
108526108279
{
108527108280
yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset);
108528108281
}
108529
-#line 2542 "parse.c"
108530108282
break;
108531108283
case 122: /* sclp ::= selcollist COMMA */
108532108284
case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247);
108533
-#line 445 "parse.y"
108534108285
{yygotominor.yy322 = yymsp[-1].minor.yy322;}
108535
-#line 2548 "parse.c"
108536108286
break;
108537108287
case 123: /* sclp ::= */
108538108288
case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151);
108539108289
case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159);
108540108290
case 240: /* exprlist ::= */ yytestcase(yyruleno==240);
108541108291
case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246);
108542
-#line 446 "parse.y"
108543108292
{yygotominor.yy322 = 0;}
108544
-#line 2557 "parse.c"
108545108293
break;
108546108294
case 124: /* selcollist ::= sclp expr as */
108547
-#line 447 "parse.y"
108548108295
{
108549108296
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
108550108297
if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
108551108298
sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
108552108299
}
108553
-#line 2566 "parse.c"
108554108300
break;
108555108301
case 125: /* selcollist ::= sclp STAR */
108556
-#line 452 "parse.y"
108557108302
{
108558108303
Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
108559108304
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
108560108305
}
108561
-#line 2574 "parse.c"
108562108306
break;
108563108307
case 126: /* selcollist ::= sclp nm DOT STAR */
108564
-#line 456 "parse.y"
108565108308
{
108566108309
Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
108567108310
Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108568108311
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
108569108312
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
108570108313
}
108571
-#line 2584 "parse.c"
108572108314
break;
108573108315
case 129: /* as ::= */
108574
-#line 469 "parse.y"
108575108316
{yygotominor.yy0.n = 0;}
108576
-#line 2589 "parse.c"
108577108317
break;
108578108318
case 130: /* from ::= */
108579
-#line 481 "parse.y"
108580108319
{yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
108581
-#line 2594 "parse.c"
108582108320
break;
108583108321
case 131: /* from ::= FROM seltablist */
108584
-#line 482 "parse.y"
108585108322
{
108586108323
yygotominor.yy259 = yymsp[0].minor.yy259;
108587108324
sqlite3SrcListShiftJoinType(yygotominor.yy259);
108588108325
}
108589
-#line 2602 "parse.c"
108590108326
break;
108591108327
case 132: /* stl_prefix ::= seltablist joinop */
108592
-#line 490 "parse.y"
108593108328
{
108594108329
yygotominor.yy259 = yymsp[-1].minor.yy259;
108595108330
if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
108596108331
}
108597
-#line 2610 "parse.c"
108598108332
break;
108599108333
case 133: /* stl_prefix ::= */
108600
-#line 494 "parse.y"
108601108334
{yygotominor.yy259 = 0;}
108602
-#line 2615 "parse.c"
108603108335
break;
108604108336
case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
108605
-#line 495 "parse.y"
108606108337
{
108607108338
yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108608108339
sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
108609108340
}
108610
-#line 2623 "parse.c"
108611108341
break;
108612108342
case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
108613
-#line 501 "parse.y"
108614108343
{
108615108344
yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108616108345
}
108617
-#line 2630 "parse.c"
108618108346
break;
108619108347
case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
108620
-#line 505 "parse.y"
108621108348
{
108622108349
if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
108623108350
yygotominor.yy259 = yymsp[-4].minor.yy259;
108624108351
}else{
108625108352
Select *pSubquery;
@@ -108626,260 +108353,180 @@
108626108353
sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
108627108354
pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0);
108628108355
yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108629108356
}
108630108357
}
108631
-#line 2644 "parse.c"
108632108358
break;
108633108359
case 137: /* dbnm ::= */
108634108360
case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146);
108635
-#line 530 "parse.y"
108636108361
{yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
108637
-#line 2650 "parse.c"
108638108362
break;
108639108363
case 139: /* fullname ::= nm dbnm */
108640
-#line 535 "parse.y"
108641108364
{yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
108642
-#line 2655 "parse.c"
108643108365
break;
108644108366
case 140: /* joinop ::= COMMA|JOIN */
108645
-#line 539 "parse.y"
108646108367
{ yygotominor.yy4 = JT_INNER; }
108647
-#line 2660 "parse.c"
108648108368
break;
108649108369
case 141: /* joinop ::= JOIN_KW JOIN */
108650
-#line 540 "parse.y"
108651108370
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
108652
-#line 2665 "parse.c"
108653108371
break;
108654108372
case 142: /* joinop ::= JOIN_KW nm JOIN */
108655
-#line 541 "parse.y"
108656108373
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
108657
-#line 2670 "parse.c"
108658108374
break;
108659108375
case 143: /* joinop ::= JOIN_KW nm nm JOIN */
108660
-#line 543 "parse.y"
108661108376
{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
108662
-#line 2675 "parse.c"
108663108377
break;
108664108378
case 144: /* on_opt ::= ON expr */
108665108379
case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155);
108666108380
case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162);
108667108381
case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169);
108668108382
case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235);
108669108383
case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237);
108670
-#line 547 "parse.y"
108671108384
{yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
108672
-#line 2685 "parse.c"
108673108385
break;
108674108386
case 145: /* on_opt ::= */
108675108387
case 161: /* having_opt ::= */ yytestcase(yyruleno==161);
108676108388
case 168: /* where_opt ::= */ yytestcase(yyruleno==168);
108677108389
case 236: /* case_else ::= */ yytestcase(yyruleno==236);
108678108390
case 238: /* case_operand ::= */ yytestcase(yyruleno==238);
108679
-#line 548 "parse.y"
108680108391
{yygotominor.yy314 = 0;}
108681
-#line 2694 "parse.c"
108682108392
break;
108683108393
case 148: /* indexed_opt ::= NOT INDEXED */
108684
-#line 563 "parse.y"
108685108394
{yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
108686
-#line 2699 "parse.c"
108687108395
break;
108688108396
case 149: /* using_opt ::= USING LP inscollist RP */
108689108397
case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181);
108690
-#line 567 "parse.y"
108691108398
{yygotominor.yy384 = yymsp[-1].minor.yy384;}
108692
-#line 2705 "parse.c"
108693108399
break;
108694108400
case 150: /* using_opt ::= */
108695108401
case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180);
108696
-#line 568 "parse.y"
108697108402
{yygotominor.yy384 = 0;}
108698
-#line 2711 "parse.c"
108699108403
break;
108700108404
case 152: /* orderby_opt ::= ORDER BY sortlist */
108701108405
case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160);
108702108406
case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239);
108703
-#line 579 "parse.y"
108704108407
{yygotominor.yy322 = yymsp[0].minor.yy322;}
108705
-#line 2718 "parse.c"
108706108408
break;
108707108409
case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */
108708
-#line 580 "parse.y"
108709108410
{
108710108411
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
108711108412
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108712108413
}
108713
-#line 2726 "parse.c"
108714108414
break;
108715108415
case 154: /* sortlist ::= sortitem sortorder */
108716
-#line 584 "parse.y"
108717108416
{
108718108417
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314);
108719108418
if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
108720108419
}
108721
-#line 2734 "parse.c"
108722108420
break;
108723108421
case 156: /* sortorder ::= ASC */
108724108422
case 158: /* sortorder ::= */ yytestcase(yyruleno==158);
108725
-#line 592 "parse.y"
108726108423
{yygotominor.yy4 = SQLITE_SO_ASC;}
108727
-#line 2740 "parse.c"
108728108424
break;
108729108425
case 157: /* sortorder ::= DESC */
108730
-#line 593 "parse.y"
108731108426
{yygotominor.yy4 = SQLITE_SO_DESC;}
108732
-#line 2745 "parse.c"
108733108427
break;
108734108428
case 163: /* limit_opt ::= */
108735
-#line 619 "parse.y"
108736108429
{yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
108737
-#line 2750 "parse.c"
108738108430
break;
108739108431
case 164: /* limit_opt ::= LIMIT expr */
108740
-#line 620 "parse.y"
108741108432
{yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
108742
-#line 2755 "parse.c"
108743108433
break;
108744108434
case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
108745
-#line 622 "parse.y"
108746108435
{yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
108747
-#line 2760 "parse.c"
108748108436
break;
108749108437
case 166: /* limit_opt ::= LIMIT expr COMMA expr */
108750
-#line 624 "parse.y"
108751108438
{yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
108752
-#line 2765 "parse.c"
108753108439
break;
108754108440
case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
108755
-#line 637 "parse.y"
108756108441
{
108757108442
sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
108758108443
sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
108759108444
}
108760
-#line 2773 "parse.c"
108761108445
break;
108762108446
case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
108763
-#line 660 "parse.y"
108764108447
{
108765108448
sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
108766108449
sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
108767108450
sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
108768108451
}
108769
-#line 2782 "parse.c"
108770108452
break;
108771108453
case 171: /* setlist ::= setlist COMMA nm EQ expr */
108772
-#line 670 "parse.y"
108773108454
{
108774108455
yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
108775108456
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108776108457
}
108777
-#line 2790 "parse.c"
108778108458
break;
108779108459
case 172: /* setlist ::= nm EQ expr */
108780
-#line 674 "parse.y"
108781108460
{
108782108461
yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
108783108462
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108784108463
}
108785
-#line 2798 "parse.c"
108786108464
break;
108787108465
case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
108788
-#line 683 "parse.y"
108789108466
{sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);}
108790
-#line 2803 "parse.c"
108791108467
break;
108792108468
case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
108793
-#line 685 "parse.y"
108794108469
{sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
108795
-#line 2808 "parse.c"
108796108470
break;
108797108471
case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
108798
-#line 687 "parse.y"
108799108472
{sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
108800
-#line 2813 "parse.c"
108801108473
break;
108802108474
case 176: /* insert_cmd ::= INSERT orconf */
108803
-#line 690 "parse.y"
108804108475
{yygotominor.yy210 = yymsp[0].minor.yy210;}
108805
-#line 2818 "parse.c"
108806108476
break;
108807108477
case 177: /* insert_cmd ::= REPLACE */
108808
-#line 691 "parse.y"
108809108478
{yygotominor.yy210 = OE_Replace;}
108810
-#line 2823 "parse.c"
108811108479
break;
108812108480
case 178: /* itemlist ::= itemlist COMMA expr */
108813108481
case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241);
108814
-#line 698 "parse.y"
108815108482
{yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
108816
-#line 2829 "parse.c"
108817108483
break;
108818108484
case 179: /* itemlist ::= expr */
108819108485
case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242);
108820
-#line 700 "parse.y"
108821108486
{yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
108822
-#line 2835 "parse.c"
108823108487
break;
108824108488
case 182: /* inscollist ::= inscollist COMMA nm */
108825
-#line 710 "parse.y"
108826108489
{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
108827
-#line 2840 "parse.c"
108828108490
break;
108829108491
case 183: /* inscollist ::= nm */
108830
-#line 712 "parse.y"
108831108492
{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
108832
-#line 2845 "parse.c"
108833108493
break;
108834108494
case 184: /* expr ::= term */
108835
-#line 743 "parse.y"
108836108495
{yygotominor.yy118 = yymsp[0].minor.yy118;}
108837
-#line 2850 "parse.c"
108838108496
break;
108839108497
case 185: /* expr ::= LP expr RP */
108840
-#line 744 "parse.y"
108841108498
{yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
108842
-#line 2855 "parse.c"
108843108499
break;
108844108500
case 186: /* term ::= NULL */
108845108501
case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191);
108846108502
case 192: /* term ::= STRING */ yytestcase(yyruleno==192);
108847
-#line 745 "parse.y"
108848108503
{spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
108849
-#line 2862 "parse.c"
108850108504
break;
108851108505
case 187: /* expr ::= id */
108852108506
case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188);
108853
-#line 746 "parse.y"
108854108507
{spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
108855
-#line 2868 "parse.c"
108856108508
break;
108857108509
case 189: /* expr ::= nm DOT nm */
108858
-#line 748 "parse.y"
108859108510
{
108860108511
Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108861108512
Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108862108513
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
108863108514
spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
108864108515
}
108865
-#line 2878 "parse.c"
108866108516
break;
108867108517
case 190: /* expr ::= nm DOT nm DOT nm */
108868
-#line 754 "parse.y"
108869108518
{
108870108519
Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
108871108520
Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108872108521
Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108873108522
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
108874108523
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
108875108524
spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108876108525
}
108877
-#line 2890 "parse.c"
108878108526
break;
108879108527
case 193: /* expr ::= REGISTER */
108880
-#line 764 "parse.y"
108881108528
{
108882108529
/* When doing a nested parse, one can include terms in an expression
108883108530
** that look like this: #1 #2 ... These terms refer to registers
108884108531
** in the virtual machine. #N is the N-th register. */
108885108532
if( pParse->nested==0 ){
@@ -108889,40 +108536,32 @@
108889108536
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
108890108537
if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
108891108538
}
108892108539
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108893108540
}
108894
-#line 2907 "parse.c"
108895108541
break;
108896108542
case 194: /* expr ::= VARIABLE */
108897
-#line 777 "parse.y"
108898108543
{
108899108544
spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
108900108545
sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
108901108546
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108902108547
}
108903
-#line 2916 "parse.c"
108904108548
break;
108905108549
case 195: /* expr ::= expr COLLATE ids */
108906
-#line 782 "parse.y"
108907108550
{
108908108551
yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
108909108552
yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108910108553
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108911108554
}
108912
-#line 2925 "parse.c"
108913108555
break;
108914108556
case 196: /* expr ::= CAST LP expr AS typetoken RP */
108915
-#line 788 "parse.y"
108916108557
{
108917108558
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
108918108559
spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
108919108560
}
108920
-#line 2933 "parse.c"
108921108561
break;
108922108562
case 197: /* expr ::= ID LP distinct exprlist RP */
108923
-#line 793 "parse.y"
108924108563
{
108925108564
if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
108926108565
sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
108927108566
}
108928108567
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -108929,59 +108568,47 @@
108929108568
spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108930108569
if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){
108931108570
yygotominor.yy118.pExpr->flags |= EP_Distinct;
108932108571
}
108933108572
}
108934
-#line 2947 "parse.c"
108935108573
break;
108936108574
case 198: /* expr ::= ID LP STAR RP */
108937
-#line 803 "parse.y"
108938108575
{
108939108576
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
108940108577
spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
108941108578
}
108942
-#line 2955 "parse.c"
108943108579
break;
108944108580
case 199: /* term ::= CTIME_KW */
108945
-#line 807 "parse.y"
108946108581
{
108947108582
/* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
108948108583
** treated as functions that return constants */
108949108584
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
108950108585
if( yygotominor.yy118.pExpr ){
108951108586
yygotominor.yy118.pExpr->op = TK_CONST_FUNC;
108952108587
}
108953108588
spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108954108589
}
108955
-#line 2968 "parse.c"
108956108590
break;
108957108591
case 200: /* expr ::= expr AND expr */
108958108592
case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201);
108959108593
case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202);
108960108594
case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203);
108961108595
case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204);
108962108596
case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205);
108963108597
case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206);
108964108598
case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207);
108965
-#line 834 "parse.y"
108966108599
{spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
108967
-#line 2980 "parse.c"
108968108600
break;
108969108601
case 208: /* likeop ::= LIKE_KW */
108970108602
case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210);
108971
-#line 847 "parse.y"
108972108603
{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;}
108973
-#line 2986 "parse.c"
108974108604
break;
108975108605
case 209: /* likeop ::= NOT LIKE_KW */
108976108606
case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211);
108977
-#line 848 "parse.y"
108978108607
{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;}
108979
-#line 2992 "parse.c"
108980108608
break;
108981108609
case 212: /* expr ::= expr likeop expr */
108982
-#line 851 "parse.y"
108983108610
{
108984108611
ExprList *pList;
108985108612
pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
108986108613
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
108987108614
yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
@@ -108988,14 +108615,12 @@
108988108615
if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108989108616
yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108990108617
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108991108618
if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108992108619
}
108993
-#line 3006 "parse.c"
108994108620
break;
108995108621
case 213: /* expr ::= expr likeop expr ESCAPE expr */
108996
-#line 861 "parse.y"
108997108622
{
108998108623
ExprList *pList;
108999108624
pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
109000108625
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
109001108626
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
@@ -109003,56 +108628,40 @@
109003108628
if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
109004108629
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
109005108630
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
109006108631
if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
109007108632
}
109008
-#line 3021 "parse.c"
109009108633
break;
109010108634
case 214: /* expr ::= expr ISNULL|NOTNULL */
109011
-#line 889 "parse.y"
109012108635
{spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
109013
-#line 3026 "parse.c"
109014108636
break;
109015108637
case 215: /* expr ::= expr NOT NULL */
109016
-#line 890 "parse.y"
109017108638
{spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
109018
-#line 3031 "parse.c"
109019108639
break;
109020108640
case 216: /* expr ::= expr IS expr */
109021
-#line 911 "parse.y"
109022108641
{
109023108642
spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
109024108643
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
109025108644
}
109026
-#line 3039 "parse.c"
109027108645
break;
109028108646
case 217: /* expr ::= expr IS NOT expr */
109029
-#line 915 "parse.y"
109030108647
{
109031108648
spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
109032108649
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
109033108650
}
109034
-#line 3047 "parse.c"
109035108651
break;
109036108652
case 218: /* expr ::= NOT expr */
109037108653
case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219);
109038
-#line 938 "parse.y"
109039108654
{spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
109040
-#line 3053 "parse.c"
109041108655
break;
109042108656
case 220: /* expr ::= MINUS expr */
109043
-#line 941 "parse.y"
109044108657
{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
109045
-#line 3058 "parse.c"
109046108658
break;
109047108659
case 221: /* expr ::= PLUS expr */
109048
-#line 943 "parse.y"
109049108660
{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
109050
-#line 3063 "parse.c"
109051108661
break;
109052108662
case 224: /* expr ::= expr between_op expr AND expr */
109053
-#line 948 "parse.y"
109054108663
{
109055108664
ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
109056108665
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
109057108666
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
109058108667
if( yygotominor.yy118.pExpr ){
@@ -109062,14 +108671,12 @@
109062108671
}
109063108672
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
109064108673
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
109065108674
yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
109066108675
}
109067
-#line 3080 "parse.c"
109068108676
break;
109069108677
case 227: /* expr ::= expr in_op LP exprlist RP */
109070
-#line 965 "parse.y"
109071108678
{
109072108679
if( yymsp[-1].minor.yy322==0 ){
109073108680
/* Expressions of the form
109074108681
**
109075108682
** expr1 IN ()
@@ -109091,14 +108698,12 @@
109091108698
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
109092108699
}
109093108700
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
109094108701
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109095108702
}
109096
-#line 3109 "parse.c"
109097108703
break;
109098108704
case 228: /* expr ::= LP select RP */
109099
-#line 990 "parse.y"
109100108705
{
109101108706
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
109102108707
if( yygotominor.yy118.pExpr ){
109103108708
yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
109104108709
ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -109107,14 +108712,12 @@
109107108712
sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
109108108713
}
109109108714
yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
109110108715
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109111108716
}
109112
-#line 3125 "parse.c"
109113108717
break;
109114108718
case 229: /* expr ::= expr in_op LP select RP */
109115
-#line 1002 "parse.y"
109116108719
{
109117108720
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
109118108721
if( yygotominor.yy118.pExpr ){
109119108722
yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
109120108723
ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -109124,14 +108727,12 @@
109124108727
}
109125108728
if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
109126108729
yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
109127108730
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109128108731
}
109129
-#line 3142 "parse.c"
109130108732
break;
109131108733
case 230: /* expr ::= expr in_op nm dbnm */
109132
-#line 1015 "parse.y"
109133108734
{
109134108735
SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
109135108736
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
109136108737
if( yygotominor.yy118.pExpr ){
109137108738
yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
@@ -109142,14 +108743,12 @@
109142108743
}
109143108744
if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
109144108745
yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
109145108746
yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
109146108747
}
109147
-#line 3160 "parse.c"
109148108748
break;
109149108749
case 231: /* expr ::= EXISTS LP select RP */
109150
-#line 1029 "parse.y"
109151108750
{
109152108751
Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
109153108752
if( p ){
109154108753
p->x.pSelect = yymsp[-1].minor.yy387;
109155108754
ExprSetProperty(p, EP_xIsSelect);
@@ -109158,14 +108757,12 @@
109158108757
sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
109159108758
}
109160108759
yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
109161108760
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109162108761
}
109163
-#line 3176 "parse.c"
109164108762
break;
109165108763
case 232: /* expr ::= CASE case_operand case_exprlist case_else END */
109166
-#line 1044 "parse.y"
109167108764
{
109168108765
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0);
109169108766
if( yygotominor.yy118.pExpr ){
109170108767
yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322;
109171108768
sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
@@ -109173,50 +108770,38 @@
109173108770
sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
109174108771
}
109175108772
yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
109176108773
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109177108774
}
109178
-#line 3191 "parse.c"
109179108775
break;
109180108776
case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
109181
-#line 1057 "parse.y"
109182108777
{
109183108778
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
109184108779
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
109185108780
}
109186
-#line 3199 "parse.c"
109187108781
break;
109188108782
case 234: /* case_exprlist ::= WHEN expr THEN expr */
109189
-#line 1061 "parse.y"
109190108783
{
109191108784
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
109192108785
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
109193108786
}
109194
-#line 3207 "parse.c"
109195108787
break;
109196108788
case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
109197
-#line 1090 "parse.y"
109198108789
{
109199108790
sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0,
109200108791
sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
109201108792
&yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4);
109202108793
}
109203
-#line 3216 "parse.c"
109204108794
break;
109205108795
case 244: /* uniqueflag ::= UNIQUE */
109206108796
case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
109207
-#line 1097 "parse.y"
109208108797
{yygotominor.yy4 = OE_Abort;}
109209
-#line 3222 "parse.c"
109210108798
break;
109211108799
case 245: /* uniqueflag ::= */
109212
-#line 1098 "parse.y"
109213108800
{yygotominor.yy4 = OE_None;}
109214
-#line 3227 "parse.c"
109215108801
break;
109216108802
case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */
109217
-#line 1107 "parse.y"
109218108803
{
109219108804
Expr *p = 0;
109220108805
if( yymsp[-1].minor.yy0.n>0 ){
109221108806
p = sqlite3Expr(pParse->db, TK_COLUMN, 0);
109222108807
sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -109224,14 +108809,12 @@
109224108809
yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
109225108810
sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
109226108811
sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
109227108812
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
109228108813
}
109229
-#line 3242 "parse.c"
109230108814
break;
109231108815
case 249: /* idxlist ::= nm collate sortorder */
109232
-#line 1118 "parse.y"
109233108816
{
109234108817
Expr *p = 0;
109235108818
if( yymsp[-1].minor.yy0.n>0 ){
109236108819
p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
109237108820
sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -109239,307 +108822,214 @@
109239108822
yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
109240108823
sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
109241108824
sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
109242108825
if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
109243108826
}
109244
-#line 3257 "parse.c"
109245108827
break;
109246108828
case 250: /* collate ::= */
109247
-#line 1131 "parse.y"
109248108829
{yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
109249
-#line 3262 "parse.c"
109250108830
break;
109251108831
case 252: /* cmd ::= DROP INDEX ifexists fullname */
109252
-#line 1137 "parse.y"
109253108832
{sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
109254
-#line 3267 "parse.c"
109255108833
break;
109256108834
case 253: /* cmd ::= VACUUM */
109257108835
case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254);
109258
-#line 1143 "parse.y"
109259108836
{sqlite3Vacuum(pParse);}
109260
-#line 3273 "parse.c"
109261108837
break;
109262108838
case 255: /* cmd ::= PRAGMA nm dbnm */
109263
-#line 1151 "parse.y"
109264108839
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
109265
-#line 3278 "parse.c"
109266108840
break;
109267108841
case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
109268
-#line 1152 "parse.y"
109269108842
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
109270
-#line 3283 "parse.c"
109271108843
break;
109272108844
case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
109273
-#line 1153 "parse.y"
109274108845
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
109275
-#line 3288 "parse.c"
109276108846
break;
109277108847
case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
109278
-#line 1155 "parse.y"
109279108848
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
109280
-#line 3293 "parse.c"
109281108849
break;
109282108850
case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
109283
-#line 1157 "parse.y"
109284108851
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
109285
-#line 3298 "parse.c"
109286108852
break;
109287108853
case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
109288
-#line 1175 "parse.y"
109289108854
{
109290108855
Token all;
109291108856
all.z = yymsp[-3].minor.yy0.z;
109292108857
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
109293108858
sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
109294108859
}
109295
-#line 3308 "parse.c"
109296108860
break;
109297108861
case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
109298
-#line 1184 "parse.y"
109299108862
{
109300108863
sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4);
109301108864
yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
109302108865
}
109303
-#line 3316 "parse.c"
109304108866
break;
109305108867
case 272: /* trigger_time ::= BEFORE */
109306108868
case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
109307
-#line 1190 "parse.y"
109308108869
{ yygotominor.yy4 = TK_BEFORE; }
109309
-#line 3322 "parse.c"
109310108870
break;
109311108871
case 273: /* trigger_time ::= AFTER */
109312
-#line 1191 "parse.y"
109313108872
{ yygotominor.yy4 = TK_AFTER; }
109314
-#line 3327 "parse.c"
109315108873
break;
109316108874
case 274: /* trigger_time ::= INSTEAD OF */
109317
-#line 1192 "parse.y"
109318108875
{ yygotominor.yy4 = TK_INSTEAD;}
109319
-#line 3332 "parse.c"
109320108876
break;
109321108877
case 276: /* trigger_event ::= DELETE|INSERT */
109322108878
case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
109323
-#line 1197 "parse.y"
109324108879
{yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
109325
-#line 3338 "parse.c"
109326108880
break;
109327108881
case 278: /* trigger_event ::= UPDATE OF inscollist */
109328
-#line 1199 "parse.y"
109329108882
{yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
109330
-#line 3343 "parse.c"
109331108883
break;
109332108884
case 281: /* when_clause ::= */
109333108885
case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
109334
-#line 1206 "parse.y"
109335108886
{ yygotominor.yy314 = 0; }
109336
-#line 3349 "parse.c"
109337108887
break;
109338108888
case 282: /* when_clause ::= WHEN expr */
109339108889
case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
109340
-#line 1207 "parse.y"
109341108890
{ yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
109342
-#line 3355 "parse.c"
109343108891
break;
109344108892
case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
109345
-#line 1211 "parse.y"
109346108893
{
109347108894
assert( yymsp[-2].minor.yy203!=0 );
109348108895
yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
109349108896
yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
109350108897
yygotominor.yy203 = yymsp[-2].minor.yy203;
109351108898
}
109352
-#line 3365 "parse.c"
109353108899
break;
109354108900
case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
109355
-#line 1217 "parse.y"
109356108901
{
109357108902
assert( yymsp[-1].minor.yy203!=0 );
109358108903
yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
109359108904
yygotominor.yy203 = yymsp[-1].minor.yy203;
109360108905
}
109361
-#line 3374 "parse.c"
109362108906
break;
109363108907
case 286: /* trnm ::= nm DOT nm */
109364
-#line 1229 "parse.y"
109365108908
{
109366108909
yygotominor.yy0 = yymsp[0].minor.yy0;
109367108910
sqlite3ErrorMsg(pParse,
109368108911
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
109369108912
"statements within triggers");
109370108913
}
109371
-#line 3384 "parse.c"
109372108914
break;
109373108915
case 288: /* tridxby ::= INDEXED BY nm */
109374
-#line 1241 "parse.y"
109375108916
{
109376108917
sqlite3ErrorMsg(pParse,
109377108918
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
109378108919
"within triggers");
109379108920
}
109380
-#line 3393 "parse.c"
109381108921
break;
109382108922
case 289: /* tridxby ::= NOT INDEXED */
109383
-#line 1246 "parse.y"
109384108923
{
109385108924
sqlite3ErrorMsg(pParse,
109386108925
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
109387108926
"within triggers");
109388108927
}
109389
-#line 3402 "parse.c"
109390108928
break;
109391108929
case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
109392
-#line 1259 "parse.y"
109393108930
{ yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
109394
-#line 3407 "parse.c"
109395108931
break;
109396108932
case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */
109397
-#line 1264 "parse.y"
109398108933
{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);}
109399
-#line 3412 "parse.c"
109400108934
break;
109401108935
case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
109402
-#line 1267 "parse.y"
109403108936
{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
109404
-#line 3417 "parse.c"
109405108937
break;
109406108938
case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
109407
-#line 1271 "parse.y"
109408108939
{yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
109409
-#line 3422 "parse.c"
109410108940
break;
109411108941
case 294: /* trigger_cmd ::= select */
109412
-#line 1274 "parse.y"
109413108942
{yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
109414
-#line 3427 "parse.c"
109415108943
break;
109416108944
case 295: /* expr ::= RAISE LP IGNORE RP */
109417
-#line 1277 "parse.y"
109418108945
{
109419108946
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
109420108947
if( yygotominor.yy118.pExpr ){
109421108948
yygotominor.yy118.pExpr->affinity = OE_Ignore;
109422108949
}
109423108950
yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
109424108951
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109425108952
}
109426
-#line 3439 "parse.c"
109427108953
break;
109428108954
case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
109429
-#line 1285 "parse.y"
109430108955
{
109431108956
yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
109432108957
if( yygotominor.yy118.pExpr ) {
109433108958
yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
109434108959
}
109435108960
yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
109436108961
yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109437108962
}
109438
-#line 3451 "parse.c"
109439108963
break;
109440108964
case 297: /* raisetype ::= ROLLBACK */
109441
-#line 1296 "parse.y"
109442108965
{yygotominor.yy4 = OE_Rollback;}
109443
-#line 3456 "parse.c"
109444108966
break;
109445108967
case 299: /* raisetype ::= FAIL */
109446
-#line 1298 "parse.y"
109447108968
{yygotominor.yy4 = OE_Fail;}
109448
-#line 3461 "parse.c"
109449108969
break;
109450108970
case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
109451
-#line 1303 "parse.y"
109452108971
{
109453108972
sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
109454108973
}
109455
-#line 3468 "parse.c"
109456108974
break;
109457108975
case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
109458
-#line 1310 "parse.y"
109459108976
{
109460108977
sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
109461108978
}
109462
-#line 3475 "parse.c"
109463108979
break;
109464108980
case 302: /* cmd ::= DETACH database_kw_opt expr */
109465
-#line 1313 "parse.y"
109466108981
{
109467108982
sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
109468108983
}
109469
-#line 3482 "parse.c"
109470108984
break;
109471108985
case 307: /* cmd ::= REINDEX */
109472
-#line 1328 "parse.y"
109473108986
{sqlite3Reindex(pParse, 0, 0);}
109474
-#line 3487 "parse.c"
109475108987
break;
109476108988
case 308: /* cmd ::= REINDEX nm dbnm */
109477
-#line 1329 "parse.y"
109478108989
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109479
-#line 3492 "parse.c"
109480108990
break;
109481108991
case 309: /* cmd ::= ANALYZE */
109482
-#line 1334 "parse.y"
109483108992
{sqlite3Analyze(pParse, 0, 0);}
109484
-#line 3497 "parse.c"
109485108993
break;
109486108994
case 310: /* cmd ::= ANALYZE nm dbnm */
109487
-#line 1335 "parse.y"
109488108995
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109489
-#line 3502 "parse.c"
109490108996
break;
109491108997
case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
109492
-#line 1340 "parse.y"
109493108998
{
109494108999
sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
109495109000
}
109496
-#line 3509 "parse.c"
109497109001
break;
109498109002
case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
109499
-#line 1343 "parse.y"
109500109003
{
109501109004
sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
109502109005
}
109503
-#line 3516 "parse.c"
109504109006
break;
109505109007
case 313: /* add_column_fullname ::= fullname */
109506
-#line 1346 "parse.y"
109507109008
{
109508109009
pParse->db->lookaside.bEnabled = 0;
109509109010
sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
109510109011
}
109511
-#line 3524 "parse.c"
109512109012
break;
109513109013
case 316: /* cmd ::= create_vtab */
109514
-#line 1356 "parse.y"
109515109014
{sqlite3VtabFinishParse(pParse,0);}
109516
-#line 3529 "parse.c"
109517109015
break;
109518109016
case 317: /* cmd ::= create_vtab LP vtabarglist RP */
109519
-#line 1357 "parse.y"
109520109017
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
109521
-#line 3534 "parse.c"
109522109018
break;
109523109019
case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */
109524
-#line 1358 "parse.y"
109525109020
{
109526109021
sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
109527109022
}
109528
-#line 3541 "parse.c"
109529109023
break;
109530109024
case 321: /* vtabarg ::= */
109531
-#line 1363 "parse.y"
109532109025
{sqlite3VtabArgInit(pParse);}
109533
-#line 3546 "parse.c"
109534109026
break;
109535109027
case 323: /* vtabargtoken ::= ANY */
109536109028
case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
109537109029
case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
109538
-#line 1365 "parse.y"
109539109030
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
109540
-#line 3553 "parse.c"
109541109031
break;
109542109032
default:
109543109033
/* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
109544109034
/* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
109545109035
/* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -109637,17 +109127,15 @@
109637109127
int yymajor, /* The major type of the error token */
109638109128
YYMINORTYPE yyminor /* The minor type of the error token */
109639109129
){
109640109130
sqlite3ParserARG_FETCH;
109641109131
#define TOKEN (yyminor.yy0)
109642
-#line 32 "parse.y"
109643109132
109644109133
UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
109645109134
assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
109646109135
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
109647109136
pParse->parseError = 1;
109648
-#line 3661 "parse.c"
109649109137
sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
109650109138
}
109651109139
109652109140
/*
109653109141
** The following is executed when the parser accepts
@@ -109837,11 +109325,10 @@
109837109325
return;
109838109326
}
109839109327
109840109328
/************** End of parse.c ***********************************************/
109841109329
/************** Begin file tokenize.c ****************************************/
109842
-#line 1 "tsrc/tokenize.c"
109843109330
/*
109844109331
** 2001 September 15
109845109332
**
109846109333
** The author disclaims copyright to this source code. In place of
109847109334
** a legal notice, here is a blessing:
@@ -109903,11 +109390,10 @@
109903109390
** named keywordhash.h and then included into this source file by
109904109391
** the #include below.
109905109392
*/
109906109393
/************** Include keywordhash.h in the middle of tokenize.c ************/
109907109394
/************** Begin file keywordhash.h *************************************/
109908
-#line 1 "tsrc/keywordhash.h"
109909109395
/***** This file contains automatically generated code ******
109910109396
**
109911109397
** The code in this file has been automatically generated by
109912109398
**
109913109399
** sqlite/tool/mkkeywordhash.c
@@ -110177,11 +109663,10 @@
110177109663
}
110178109664
#define SQLITE_N_KEYWORD 121
110179109665
110180109666
/************** End of keywordhash.h *****************************************/
110181109667
/************** Continuing where we left off in tokenize.c *******************/
110182
-#line 66 "tsrc/tokenize.c"
110183109668
110184109669
110185109670
/*
110186109671
** If X is a character that can be used in an identifier then
110187109672
** IdChar(X) will be true. Otherwise it is false.
@@ -110642,11 +110127,10 @@
110642110127
return nErr;
110643110128
}
110644110129
110645110130
/************** End of tokenize.c ********************************************/
110646110131
/************** Begin file complete.c ****************************************/
110647
-#line 1 "tsrc/complete.c"
110648110132
/*
110649110133
** 2001 September 15
110650110134
**
110651110135
** The author disclaims copyright to this source code. In place of
110652110136
** a legal notice, here is a blessing:
@@ -110928,11 +110412,10 @@
110928110412
#endif /* SQLITE_OMIT_UTF16 */
110929110413
#endif /* SQLITE_OMIT_COMPLETE */
110930110414
110931110415
/************** End of complete.c ********************************************/
110932110416
/************** Begin file main.c ********************************************/
110933
-#line 1 "tsrc/main.c"
110934110417
/*
110935110418
** 2001 September 15
110936110419
**
110937110420
** The author disclaims copyright to this source code. In place of
110938110421
** a legal notice, here is a blessing:
@@ -110949,11 +110432,10 @@
110949110432
*/
110950110433
110951110434
#ifdef SQLITE_ENABLE_FTS3
110952110435
/************** Include fts3.h in the middle of main.c ***********************/
110953110436
/************** Begin file fts3.h ********************************************/
110954
-#line 1 "tsrc/fts3.h"
110955110437
/*
110956110438
** 2006 Oct 10
110957110439
**
110958110440
** The author disclaims copyright to this source code. In place of
110959110441
** a legal notice, here is a blessing:
@@ -110978,16 +110460,14 @@
110978110460
} /* extern "C" */
110979110461
#endif /* __cplusplus */
110980110462
110981110463
/************** End of fts3.h ************************************************/
110982110464
/************** Continuing where we left off in main.c ***********************/
110983
-#line 21 "tsrc/main.c"
110984110465
#endif
110985110466
#ifdef SQLITE_ENABLE_RTREE
110986110467
/************** Include rtree.h in the middle of main.c **********************/
110987110468
/************** Begin file rtree.h *******************************************/
110988
-#line 1 "tsrc/rtree.h"
110989110469
/*
110990110470
** 2008 May 26
110991110471
**
110992110472
** The author disclaims copyright to this source code. In place of
110993110473
** a legal notice, here is a blessing:
@@ -111012,16 +110492,14 @@
111012110492
} /* extern "C" */
111013110493
#endif /* __cplusplus */
111014110494
111015110495
/************** End of rtree.h ***********************************************/
111016110496
/************** Continuing where we left off in main.c ***********************/
111017
-#line 24 "tsrc/main.c"
111018110497
#endif
111019110498
#ifdef SQLITE_ENABLE_ICU
111020110499
/************** Include sqliteicu.h in the middle of main.c ******************/
111021110500
/************** Begin file sqliteicu.h ***************************************/
111022
-#line 1 "tsrc/sqliteicu.h"
111023110501
/*
111024110502
** 2008 May 26
111025110503
**
111026110504
** The author disclaims copyright to this source code. In place of
111027110505
** a legal notice, here is a blessing:
@@ -111047,11 +110525,10 @@
111047110525
#endif /* __cplusplus */
111048110526
111049110527
111050110528
/************** End of sqliteicu.h *******************************************/
111051110529
/************** Continuing where we left off in main.c ***********************/
111052
-#line 27 "tsrc/main.c"
111053110530
#endif
111054110531
111055110532
#ifndef SQLITE_AMALGAMATION
111056110533
/* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
111057110534
** contains the text of SQLITE_VERSION macro.
@@ -113978,11 +113455,10 @@
113978113455
return 0;
113979113456
}
113980113457
113981113458
/************** End of main.c ************************************************/
113982113459
/************** Begin file notify.c ******************************************/
113983
-#line 1 "tsrc/notify.c"
113984113460
/*
113985113461
** 2009 March 3
113986113462
**
113987113463
** The author disclaims copyright to this source code. In place of
113988113464
** a legal notice, here is a blessing:
@@ -114312,11 +113788,10 @@
114312113788
}
114313113789
#endif
114314113790
114315113791
/************** End of notify.c **********************************************/
114316113792
/************** Begin file fts3.c ********************************************/
114317
-#line 1 "tsrc/fts3.c"
114318113793
/*
114319113794
** 2006 Oct 10
114320113795
**
114321113796
** The author disclaims copyright to this source code. In place of
114322113797
** a legal notice, here is a blessing:
@@ -114609,11 +114084,10 @@
114609114084
** into a single segment.
114610114085
*/
114611114086
114612114087
/************** Include fts3Int.h in the middle of fts3.c ********************/
114613114088
/************** Begin file fts3Int.h *****************************************/
114614
-#line 1 "tsrc/fts3Int.h"
114615114089
/*
114616114090
** 2009 Nov 12
114617114091
**
114618114092
** The author disclaims copyright to this source code. In place of
114619114093
** a legal notice, here is a blessing:
@@ -114648,11 +114122,10 @@
114648114122
SQLITE_API extern const sqlite3_api_routines *sqlite3_api;
114649114123
#endif
114650114124
114651114125
/************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
114652114126
/************** Begin file fts3_tokenizer.h **********************************/
114653
-#line 1 "tsrc/fts3_tokenizer.h"
114654114127
/*
114655114128
** 2006 July 10
114656114129
**
114657114130
** The author disclaims copyright to this source code.
114658114131
**
@@ -114803,14 +114276,12 @@
114803114276
114804114277
#endif /* _FTS3_TOKENIZER_H_ */
114805114278
114806114279
/************** End of fts3_tokenizer.h **************************************/
114807114280
/************** Continuing where we left off in fts3Int.h ********************/
114808
-#line 40 "tsrc/fts3Int.h"
114809114281
/************** Include fts3_hash.h in the middle of fts3Int.h ***************/
114810114282
/************** Begin file fts3_hash.h ***************************************/
114811
-#line 1 "tsrc/fts3_hash.h"
114812114283
/*
114813114284
** 2001 September 22
114814114285
**
114815114286
** The author disclaims copyright to this source code. In place of
114816114287
** a legal notice, here is a blessing:
@@ -114922,11 +114393,10 @@
114922114393
114923114394
#endif /* _FTS3_HASH_H_ */
114924114395
114925114396
/************** End of fts3_hash.h *******************************************/
114926114397
/************** Continuing where we left off in fts3Int.h ********************/
114927
-#line 41 "tsrc/fts3Int.h"
114928114398
114929114399
/*
114930114400
** This constant controls how often segments are merged. Once there are
114931114401
** FTS3_MERGE_COUNT segments of level N, they are merged into a single
114932114402
** segment of level N+1.
@@ -115399,11 +114869,10 @@
115399114869
#endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
115400114870
#endif /* _FTSINT_H */
115401114871
115402114872
/************** End of fts3Int.h *********************************************/
115403114873
/************** Continuing where we left off in fts3.c ***********************/
115404
-#line 296 "tsrc/fts3.c"
115405114874
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
115406114875
115407114876
#if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
115408114877
# define SQLITE_CORE 1
115409114878
#endif
@@ -119949,11 +119418,10 @@
119949119418
119950119419
#endif
119951119420
119952119421
/************** End of fts3.c ************************************************/
119953119422
/************** Begin file fts3_aux.c ****************************************/
119954
-#line 1 "tsrc/fts3_aux.c"
119955119423
/*
119956119424
** 2011 Jan 27
119957119425
**
119958119426
** The author disclaims copyright to this source code. In place of
119959119427
** a legal notice, here is a blessing:
@@ -120426,11 +119894,10 @@
120426119894
120427119895
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120428119896
120429119897
/************** End of fts3_aux.c ********************************************/
120430119898
/************** Begin file fts3_expr.c ***************************************/
120431
-#line 1 "tsrc/fts3_expr.c"
120432119899
/*
120433119900
** 2008 Nov 28
120434119901
**
120435119902
** The author disclaims copyright to this source code. In place of
120436119903
** a legal notice, here is a blessing:
@@ -121393,11 +120860,10 @@
121393120860
#endif
121394120861
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121395120862
121396120863
/************** End of fts3_expr.c *******************************************/
121397120864
/************** Begin file fts3_hash.c ***************************************/
121398
-#line 1 "tsrc/fts3_hash.c"
121399120865
/*
121400120866
** 2001 September 22
121401120867
**
121402120868
** The author disclaims copyright to this source code. In place of
121403120869
** a legal notice, here is a blessing:
@@ -121778,11 +121244,10 @@
121778121244
121779121245
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121780121246
121781121247
/************** End of fts3_hash.c *******************************************/
121782121248
/************** Begin file fts3_porter.c *************************************/
121783
-#line 1 "tsrc/fts3_porter.c"
121784121249
/*
121785121250
** 2006 September 30
121786121251
**
121787121252
** The author disclaims copyright to this source code. In place of
121788121253
** a legal notice, here is a blessing:
@@ -122425,11 +121890,10 @@
122425121890
122426121891
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122427121892
122428121893
/************** End of fts3_porter.c *****************************************/
122429121894
/************** Begin file fts3_tokenizer.c **********************************/
122430
-#line 1 "tsrc/fts3_tokenizer.c"
122431121895
/*
122432121896
** 2007 June 22
122433121897
**
122434121898
** The author disclaims copyright to this source code. In place of
122435121899
** a legal notice, here is a blessing:
@@ -122917,11 +122381,10 @@
122917122381
122918122382
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122919122383
122920122384
/************** End of fts3_tokenizer.c **************************************/
122921122385
/************** Begin file fts3_tokenizer1.c *********************************/
122922
-#line 1 "tsrc/fts3_tokenizer1.c"
122923122386
/*
122924122387
** 2006 Oct 10
122925122388
**
122926122389
** The author disclaims copyright to this source code. In place of
122927122390
** a legal notice, here is a blessing:
@@ -123152,11 +122615,10 @@
123152122615
123153122616
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
123154122617
123155122618
/************** End of fts3_tokenizer1.c *************************************/
123156122619
/************** Begin file fts3_write.c **************************************/
123157
-#line 1 "tsrc/fts3_write.c"
123158122620
/*
123159122621
** 2009 Oct 23
123160122622
**
123161122623
** The author disclaims copyright to this source code. In place of
123162122624
** a legal notice, here is a blessing:
@@ -126423,11 +125885,10 @@
126423125885
126424125886
#endif
126425125887
126426125888
/************** End of fts3_write.c ******************************************/
126427125889
/************** Begin file fts3_snippet.c ************************************/
126428
-#line 1 "tsrc/fts3_snippet.c"
126429125890
/*
126430125891
** 2009 Oct 23
126431125892
**
126432125893
** The author disclaims copyright to this source code. In place of
126433125894
** a legal notice, here is a blessing:
@@ -127925,11 +127386,10 @@
127925127386
127926127387
#endif
127927127388
127928127389
/************** End of fts3_snippet.c ****************************************/
127929127390
/************** Begin file rtree.c *******************************************/
127930
-#line 1 "tsrc/rtree.c"
127931127391
/*
127932127392
** 2001 September 15
127933127393
**
127934127394
** The author disclaims copyright to this source code. In place of
127935127395
** a legal notice, here is a blessing:
@@ -131207,11 +130667,10 @@
131207130667
131208130668
#endif
131209130669
131210130670
/************** End of rtree.c ***********************************************/
131211130671
/************** Begin file icu.c *********************************************/
131212
-#line 1 "tsrc/icu.c"
131213130672
/*
131214130673
** 2007 May 6
131215130674
**
131216130675
** The author disclaims copyright to this source code. In place of
131217130676
** a legal notice, here is a blessing:
@@ -131710,11 +131169,10 @@
131710131169
131711131170
#endif
131712131171
131713131172
/************** End of icu.c *************************************************/
131714131173
/************** Begin file fts3_icu.c ****************************************/
131715
-#line 1 "tsrc/fts3_icu.c"
131716131174
/*
131717131175
** 2007 June 22
131718131176
**
131719131177
** The author disclaims copyright to this source code. In place of
131720131178
** a legal notice, here is a blessing:
131721131179
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,11 +24,10 @@
24 #endif
25 #ifndef SQLITE_API
26 # define SQLITE_API
27 #endif
28 /************** Begin file sqliteInt.h ***************************************/
29 #line 1 "tsrc/sqliteInt.h"
30 /*
31 ** 2001 September 15
32 **
33 ** The author disclaims copyright to this source code. In place of
34 ** a legal notice, here is a blessing:
@@ -79,11 +78,10 @@
79 #include "config.h"
80 #endif
81
82 /************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
83 /************** Begin file sqliteLimit.h *************************************/
84 #line 1 "tsrc/sqliteLimit.h"
85 /*
86 ** 2007 May 7
87 **
88 ** The author disclaims copyright to this source code. In place of
89 ** a legal notice, here is a blessing:
@@ -291,11 +289,10 @@
291 # define SQLITE_MAX_TRIGGER_DEPTH 1000
292 #endif
293
294 /************** End of sqliteLimit.h *****************************************/
295 /************** Continuing where we left off in sqliteInt.h ******************/
296 #line 54 "tsrc/sqliteInt.h"
297
298 /* Disable nuisance warnings on Borland compilers */
299 #if defined(__BORLANDC__)
300 #pragma warn -rch /* unreachable code */
301 #pragma warn -ccc /* Condition is always true or false */
@@ -548,11 +545,10 @@
548 # define unlikely(X) !!(X)
549 #endif
550
551 /************** Include sqlite3.h in the middle of sqliteInt.h ***************/
552 /************** Begin file sqlite3.h *****************************************/
553 #line 1 "tsrc/sqlite3.h"
554 /*
555 ** 2001 September 15
556 **
557 ** The author disclaims copyright to this source code. In place of
558 ** a legal notice, here is a blessing:
@@ -660,11 +656,11 @@
660 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
661 ** [sqlite_version()] and [sqlite_source_id()].
662 */
663 #define SQLITE_VERSION "3.7.9"
664 #define SQLITE_VERSION_NUMBER 3007009
665 #define SQLITE_SOURCE_ID "2011-10-07 18:24:25 d4f95b3b6e9f4a4072606af5daa17ea7c645382e"
666
667 /*
668 ** CAPI3REF: Run-Time Library Version Numbers
669 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
670 **
@@ -6380,17 +6376,17 @@
6380 ** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0.
6381 ** </dd>
6382 **
6383 ** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(<dt>SQLITE_DBSTATUS_CACHE_HIT</dt>
6384 ** <dd>This parameter returns the number of pager cache hits that have
6385 ** occurred. ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT
6386 ** is always 0.
6387 ** </dd>
6388 **
6389 ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt>
6390 ** <dd>This parameter returns the number of pager cache misses that have
6391 ** occurred. ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS
6392 ** is always 0.
6393 ** </dd>
6394 ** </dl>
6395 */
6396 #define SQLITE_DBSTATUS_LOOKASIDE_USED 0
@@ -7333,14 +7329,12 @@
7333 #endif /* ifndef _SQLITE3RTREE_H_ */
7334
7335
7336 /************** End of sqlite3.h *********************************************/
7337 /************** Continuing where we left off in sqliteInt.h ******************/
7338 #line 309 "tsrc/sqliteInt.h"
7339 /************** Include hash.h in the middle of sqliteInt.h ******************/
7340 /************** Begin file hash.h ********************************************/
7341 #line 1 "tsrc/hash.h"
7342 /*
7343 ** 2001 September 22
7344 **
7345 ** The author disclaims copyright to this source code. In place of
7346 ** a legal notice, here is a blessing:
@@ -7436,14 +7430,12 @@
7436
7437 #endif /* _SQLITE_HASH_H_ */
7438
7439 /************** End of hash.h ************************************************/
7440 /************** Continuing where we left off in sqliteInt.h ******************/
7441 #line 310 "tsrc/sqliteInt.h"
7442 /************** Include parse.h in the middle of sqliteInt.h *****************/
7443 /************** Begin file parse.h *******************************************/
7444 #line 1 "tsrc/parse.h"
7445 #define TK_SEMI 1
7446 #define TK_EXPLAIN 2
7447 #define TK_QUERY 3
7448 #define TK_PLAN 4
7449 #define TK_BEGIN 5
@@ -7600,11 +7592,10 @@
7600 #define TK_UMINUS 156
7601 #define TK_UPLUS 157
7602
7603 /************** End of parse.h ***********************************************/
7604 /************** Continuing where we left off in sqliteInt.h ******************/
7605 #line 311 "tsrc/sqliteInt.h"
7606 #include <stdio.h>
7607 #include <stdlib.h>
7608 #include <string.h>
7609 #include <assert.h>
7610 #include <stddef.h>
@@ -7956,11 +7947,10 @@
7956 ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
7957 ** pointer types (i.e. FuncDef) defined above.
7958 */
7959 /************** Include btree.h in the middle of sqliteInt.h *****************/
7960 /************** Begin file btree.h *******************************************/
7961 #line 1 "tsrc/btree.h"
7962 /*
7963 ** 2001 September 15
7964 **
7965 ** The author disclaims copyright to this source code. In place of
7966 ** a legal notice, here is a blessing:
@@ -8201,14 +8191,12 @@
8201
8202 #endif /* _BTREE_H_ */
8203
8204 /************** End of btree.h ***********************************************/
8205 /************** Continuing where we left off in sqliteInt.h ******************/
8206 #line 665 "tsrc/sqliteInt.h"
8207 /************** Include vdbe.h in the middle of sqliteInt.h ******************/
8208 /************** Begin file vdbe.h ********************************************/
8209 #line 1 "tsrc/vdbe.h"
8210 /*
8211 ** 2001 September 15
8212 **
8213 ** The author disclaims copyright to this source code. In place of
8214 ** a legal notice, here is a blessing:
@@ -8369,11 +8357,10 @@
8369 ** The makefile scans the vdbe.c source file and creates the "opcodes.h"
8370 ** header file that defines a number for each opcode used by the VDBE.
8371 */
8372 /************** Include opcodes.h in the middle of vdbe.h ********************/
8373 /************** Begin file opcodes.h *****************************************/
8374 #line 1 "tsrc/opcodes.h"
8375 /* Automatically generated. Do not edit */
8376 /* See the mkopcodeh.awk script for details */
8377 #define OP_Goto 1
8378 #define OP_Gosub 2
8379 #define OP_Return 3
@@ -8558,11 +8545,10 @@
8558 /* 136 */ 0x01, 0x00, 0x01, 0x00, 0x00, 0x04, 0x04, 0x04,\
8559 /* 144 */ 0x04, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00,}
8560
8561 /************** End of opcodes.h *********************************************/
8562 /************** Continuing where we left off in vdbe.h ***********************/
8563 #line 164 "tsrc/vdbe.h"
8564
8565 /*
8566 ** Prototypes for the VDBE interface. See comments on the implementation
8567 ** for a description of what each of these routines does.
8568 */
@@ -8633,14 +8619,12 @@
8633
8634 #endif
8635
8636 /************** End of vdbe.h ************************************************/
8637 /************** Continuing where we left off in sqliteInt.h ******************/
8638 #line 666 "tsrc/sqliteInt.h"
8639 /************** Include pager.h in the middle of sqliteInt.h *****************/
8640 /************** Begin file pager.h *******************************************/
8641 #line 1 "tsrc/pager.h"
8642 /*
8643 ** 2001 September 15
8644 **
8645 ** The author disclaims copyright to this source code. In place of
8646 ** a legal notice, here is a blessing:
@@ -8822,14 +8806,12 @@
8822
8823 #endif /* _PAGER_H_ */
8824
8825 /************** End of pager.h ***********************************************/
8826 /************** Continuing where we left off in sqliteInt.h ******************/
8827 #line 667 "tsrc/sqliteInt.h"
8828 /************** Include pcache.h in the middle of sqliteInt.h ****************/
8829 /************** Begin file pcache.h ******************************************/
8830 #line 1 "tsrc/pcache.h"
8831 /*
8832 ** 2008 August 05
8833 **
8834 ** The author disclaims copyright to this source code. In place of
8835 ** a legal notice, here is a blessing:
@@ -8984,15 +8966,13 @@
8984
8985 #endif /* _PCACHE_H_ */
8986
8987 /************** End of pcache.h **********************************************/
8988 /************** Continuing where we left off in sqliteInt.h ******************/
8989 #line 668 "tsrc/sqliteInt.h"
8990
8991 /************** Include os.h in the middle of sqliteInt.h ********************/
8992 /************** Begin file os.h **********************************************/
8993 #line 1 "tsrc/os.h"
8994 /*
8995 ** 2001 September 16
8996 **
8997 ** The author disclaims copyright to this source code. In place of
8998 ** a legal notice, here is a blessing:
@@ -9271,14 +9251,12 @@
9271
9272 #endif /* _SQLITE_OS_H_ */
9273
9274 /************** End of os.h **************************************************/
9275 /************** Continuing where we left off in sqliteInt.h ******************/
9276 #line 670 "tsrc/sqliteInt.h"
9277 /************** Include mutex.h in the middle of sqliteInt.h *****************/
9278 /************** Begin file mutex.h *******************************************/
9279 #line 1 "tsrc/mutex.h"
9280 /*
9281 ** 2007 August 28
9282 **
9283 ** The author disclaims copyright to this source code. In place of
9284 ** a legal notice, here is a blessing:
@@ -9349,11 +9327,10 @@
9349 #define sqlite3MutexEnd()
9350 #endif /* defined(SQLITE_MUTEX_OMIT) */
9351
9352 /************** End of mutex.h ***********************************************/
9353 /************** Continuing where we left off in sqliteInt.h ******************/
9354 #line 671 "tsrc/sqliteInt.h"
9355
9356
9357 /*
9358 ** Each database file to be accessed by the system is an instance
9359 ** of the following structure. There are normally two of these structures
@@ -11962,11 +11939,10 @@
11962
11963 #endif /* _SQLITEINT_H_ */
11964
11965 /************** End of sqliteInt.h *******************************************/
11966 /************** Begin file global.c ******************************************/
11967 #line 1 "tsrc/global.c"
11968 /*
11969 ** 2008 June 13
11970 **
11971 ** The author disclaims copyright to this source code. In place of
11972 ** a legal notice, here is a blessing:
@@ -12185,11 +12161,10 @@
12185 */
12186 SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
12187
12188 /************** End of global.c **********************************************/
12189 /************** Begin file ctime.c *******************************************/
12190 #line 1 "tsrc/ctime.c"
12191 /*
12192 ** 2010 February 23
12193 **
12194 ** The author disclaims copyright to this source code. In place of
12195 ** a legal notice, here is a blessing:
@@ -12590,11 +12565,10 @@
12590
12591 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
12592
12593 /************** End of ctime.c ***********************************************/
12594 /************** Begin file status.c ******************************************/
12595 #line 1 "tsrc/status.c"
12596 /*
12597 ** 2008 June 18
12598 **
12599 ** The author disclaims copyright to this source code. In place of
12600 ** a legal notice, here is a blessing:
@@ -12608,11 +12582,10 @@
12608 ** This module implements the sqlite3_status() interface and related
12609 ** functionality.
12610 */
12611 /************** Include vdbeInt.h in the middle of status.c ******************/
12612 /************** Begin file vdbeInt.h *****************************************/
12613 #line 1 "tsrc/vdbeInt.h"
12614 /*
12615 ** 2003 September 6
12616 **
12617 ** The author disclaims copyright to this source code. In place of
12618 ** a legal notice, here is a blessing:
@@ -13060,11 +13033,10 @@
13060
13061 #endif /* !defined(_VDBEINT_H_) */
13062
13063 /************** End of vdbeInt.h *********************************************/
13064 /************** Continuing where we left off in status.c *********************/
13065 #line 18 "tsrc/status.c"
13066
13067 /*
13068 ** Variables in which to record status information.
13069 */
13070 typedef struct sqlite3StatType sqlite3StatType;
@@ -13296,11 +13268,10 @@
13296 return rc;
13297 }
13298
13299 /************** End of status.c **********************************************/
13300 /************** Begin file date.c ********************************************/
13301 #line 1 "tsrc/date.c"
13302 /*
13303 ** 2003 October 31
13304 **
13305 ** The author disclaims copyright to this source code. In place of
13306 ** a legal notice, here is a blessing:
@@ -14424,11 +14395,10 @@
14424 }
14425 }
14426
14427 /************** End of date.c ************************************************/
14428 /************** Begin file os.c **********************************************/
14429 #line 1 "tsrc/os.c"
14430 /*
14431 ** 2005 November 29
14432 **
14433 ** The author disclaims copyright to this source code. In place of
14434 ** a legal notice, here is a blessing:
@@ -14758,11 +14728,10 @@
14758 return SQLITE_OK;
14759 }
14760
14761 /************** End of os.c **************************************************/
14762 /************** Begin file fault.c *******************************************/
14763 #line 1 "tsrc/fault.c"
14764 /*
14765 ** 2008 Jan 22
14766 **
14767 ** The author disclaims copyright to this source code. In place of
14768 ** a legal notice, here is a blessing:
@@ -14848,11 +14817,10 @@
14848
14849 #endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */
14850
14851 /************** End of fault.c ***********************************************/
14852 /************** Begin file mem0.c ********************************************/
14853 #line 1 "tsrc/mem0.c"
14854 /*
14855 ** 2008 October 28
14856 **
14857 ** The author disclaims copyright to this source code. In place of
14858 ** a legal notice, here is a blessing:
@@ -14910,11 +14878,10 @@
14910
14911 #endif /* SQLITE_ZERO_MALLOC */
14912
14913 /************** End of mem0.c ************************************************/
14914 /************** Begin file mem1.c ********************************************/
14915 #line 1 "tsrc/mem1.c"
14916 /*
14917 ** 2007 August 14
14918 **
14919 ** The author disclaims copyright to this source code. In place of
14920 ** a legal notice, here is a blessing:
@@ -15063,11 +15030,10 @@
15063
15064 #endif /* SQLITE_SYSTEM_MALLOC */
15065
15066 /************** End of mem1.c ************************************************/
15067 /************** Begin file mem2.c ********************************************/
15068 #line 1 "tsrc/mem2.c"
15069 /*
15070 ** 2007 August 15
15071 **
15072 ** The author disclaims copyright to this source code. In place of
15073 ** a legal notice, here is a blessing:
@@ -15594,11 +15560,10 @@
15594
15595 #endif /* SQLITE_MEMDEBUG */
15596
15597 /************** End of mem2.c ************************************************/
15598 /************** Begin file mem3.c ********************************************/
15599 #line 1 "tsrc/mem3.c"
15600 /*
15601 ** 2007 October 14
15602 **
15603 ** The author disclaims copyright to this source code. In place of
15604 ** a legal notice, here is a blessing:
@@ -16284,11 +16249,10 @@
16284
16285 #endif /* SQLITE_ENABLE_MEMSYS3 */
16286
16287 /************** End of mem3.c ************************************************/
16288 /************** Begin file mem5.c ********************************************/
16289 #line 1 "tsrc/mem5.c"
16290 /*
16291 ** 2007 October 14
16292 **
16293 ** The author disclaims copyright to this source code. In place of
16294 ** a legal notice, here is a blessing:
@@ -16868,11 +16832,10 @@
16868
16869 #endif /* SQLITE_ENABLE_MEMSYS5 */
16870
16871 /************** End of mem5.c ************************************************/
16872 /************** Begin file mutex.c *******************************************/
16873 #line 1 "tsrc/mutex.c"
16874 /*
16875 ** 2007 August 14
16876 **
16877 ** The author disclaims copyright to this source code. In place of
16878 ** a legal notice, here is a blessing:
@@ -17024,11 +16987,10 @@
17024
17025 #endif /* SQLITE_MUTEX_OMIT */
17026
17027 /************** End of mutex.c ***********************************************/
17028 /************** Begin file mutex_noop.c **************************************/
17029 #line 1 "tsrc/mutex_noop.c"
17030 /*
17031 ** 2008 October 07
17032 **
17033 ** The author disclaims copyright to this source code. In place of
17034 ** a legal notice, here is a blessing:
@@ -17233,11 +17195,10 @@
17233 #endif /* SQLITE_MUTEX_NOOP */
17234 #endif /* SQLITE_MUTEX_OMIT */
17235
17236 /************** End of mutex_noop.c ******************************************/
17237 /************** Begin file mutex_os2.c ***************************************/
17238 #line 1 "tsrc/mutex_os2.c"
17239 /*
17240 ** 2007 August 28
17241 **
17242 ** The author disclaims copyright to this source code. In place of
17243 ** a legal notice, here is a blessing:
@@ -17510,11 +17471,10 @@
17510 }
17511 #endif /* SQLITE_MUTEX_OS2 */
17512
17513 /************** End of mutex_os2.c *******************************************/
17514 /************** Begin file mutex_unix.c **************************************/
17515 #line 1 "tsrc/mutex_unix.c"
17516 /*
17517 ** 2007 August 28
17518 **
17519 ** The author disclaims copyright to this source code. In place of
17520 ** a legal notice, here is a blessing:
@@ -17864,11 +17824,10 @@
17864
17865 #endif /* SQLITE_MUTEX_PTHREAD */
17866
17867 /************** End of mutex_unix.c ******************************************/
17868 /************** Begin file mutex_w32.c ***************************************/
17869 #line 1 "tsrc/mutex_w32.c"
17870 /*
17871 ** 2007 August 14
17872 **
17873 ** The author disclaims copyright to this source code. In place of
17874 ** a legal notice, here is a blessing:
@@ -18199,11 +18158,10 @@
18199 }
18200 #endif /* SQLITE_MUTEX_W32 */
18201
18202 /************** End of mutex_w32.c *******************************************/
18203 /************** Begin file malloc.c ******************************************/
18204 #line 1 "tsrc/malloc.c"
18205 /*
18206 ** 2001 September 15
18207 **
18208 ** The author disclaims copyright to this source code. In place of
18209 ** a legal notice, here is a blessing:
@@ -18979,11 +18937,10 @@
18979 return rc & (db ? db->errMask : 0xff);
18980 }
18981
18982 /************** End of malloc.c **********************************************/
18983 /************** Begin file printf.c ******************************************/
18984 #line 1 "tsrc/printf.c"
18985 /*
18986 ** The "printf" code that follows dates from the 1980's. It is in
18987 ** the public domain. The original comments are included here for
18988 ** completeness. They are very out-of-date but might be useful as
18989 ** an historical reference. Most of the "enhancements" have been backed
@@ -19171,15 +19128,11 @@
19171 /*
19172 ** On machines with a small stack size, you can redefine the
19173 ** SQLITE_PRINT_BUF_SIZE to be less than 350.
19174 */
19175 #ifndef SQLITE_PRINT_BUF_SIZE
19176 # if defined(SQLITE_SMALL_STACK)
19177 # define SQLITE_PRINT_BUF_SIZE 50
19178 # else
19179 # define SQLITE_PRINT_BUF_SIZE 350
19180 # endif
19181 #endif
19182 #define etBUFSIZE SQLITE_PRINT_BUF_SIZE /* Size of the output buffer */
19183
19184 /*
19185 ** The root program. All variations call this core.
@@ -19231,19 +19184,20 @@
19231 etByte done; /* Loop termination flag */
19232 sqlite_uint64 longvalue; /* Value for integer types */
19233 LONGDOUBLE_TYPE realvalue; /* Value for real types */
19234 const et_info *infop; /* Pointer to the appropriate info structure */
19235 char buf[etBUFSIZE]; /* Conversion buffer */
 
 
19236 char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */
19237 etByte xtype = 0; /* Conversion paradigm */
19238 char *zExtra; /* Extra memory used for etTCLESCAPE conversions */
19239 #ifndef SQLITE_OMIT_FLOATING_POINT
19240 int exp, e2; /* exponent of real numbers */
19241 double rounder; /* Used for rounding floating point values */
19242 etByte flag_dp; /* True if decimal point should be shown */
19243 etByte flag_rtz; /* True if trailing zeros should be removed */
19244 etByte flag_exp; /* True to force display of the exponent */
19245 int nsd; /* Number of significant digits returned */
19246 #endif
19247
19248 length = 0;
19249 bufpt = 0;
@@ -19288,13 +19242,10 @@
19288 while( c>='0' && c<='9' ){
19289 width = width*10 + c - '0';
19290 c = *++fmt;
19291 }
19292 }
19293 if( width > etBUFSIZE-10 ){
19294 width = etBUFSIZE-10;
19295 }
19296 /* Get the precision */
19297 if( c=='.' ){
19298 precision = 0;
19299 c = *++fmt;
19300 if( c=='*' ){
@@ -19337,16 +19288,10 @@
19337 break;
19338 }
19339 }
19340 zExtra = 0;
19341
19342
19343 /* Limit the precision to prevent overflowing buf[] during conversion */
19344 if( precision>etBUFSIZE-40 && (infop->flags & FLAG_STRING)==0 ){
19345 precision = etBUFSIZE-40;
19346 }
19347
19348 /*
19349 ** At this point, variables are initialized as follows:
19350 **
19351 ** flag_alternateform TRUE if a '#' is present.
19352 ** flag_altform2 TRUE if a '!' is present.
@@ -19407,20 +19352,30 @@
19407 }
19408 if( longvalue==0 ) flag_alternateform = 0;
19409 if( flag_zeropad && precision<width-(prefix!=0) ){
19410 precision = width-(prefix!=0);
19411 }
19412 bufpt = &buf[etBUFSIZE-1];
 
 
 
 
 
 
 
 
 
 
 
19413 if( xtype==etORDINAL ){
19414 static const char zOrd[] = "thstndrd";
19415 int x = (int)(longvalue % 10);
19416 if( x>=4 || (longvalue/10)%10==1 ){
19417 x = 0;
19418 }
19419 buf[etBUFSIZE-3] = zOrd[x*2];
19420 buf[etBUFSIZE-2] = zOrd[x*2+1];
19421 bufpt -= 2;
19422 }
19423 {
19424 register const char *cset; /* Use registers for speed */
19425 register int base;
19426 cset = &aDigits[infop->charset];
@@ -19428,11 +19383,11 @@
19428 do{ /* Convert to ascii */
19429 *(--bufpt) = cset[longvalue%base];
19430 longvalue = longvalue/base;
19431 }while( longvalue>0 );
19432 }
19433 length = (int)(&buf[etBUFSIZE-1]-bufpt);
19434 for(idx=precision-length; idx>0; idx--){
19435 *(--bufpt) = '0'; /* Zero pad */
19436 }
19437 if( prefix ) *(--bufpt) = prefix; /* Add sign */
19438 if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
@@ -19439,21 +19394,20 @@
19439 const char *pre;
19440 char x;
19441 pre = &aPrefix[infop->prefix];
19442 for(; (x=(*pre))!=0; pre++) *(--bufpt) = x;
19443 }
19444 length = (int)(&buf[etBUFSIZE-1]-bufpt);
19445 break;
19446 case etFLOAT:
19447 case etEXP:
19448 case etGENERIC:
19449 realvalue = va_arg(ap,double);
19450 #ifdef SQLITE_OMIT_FLOATING_POINT
19451 length = 0;
19452 #else
19453 if( precision<0 ) precision = 6; /* Set default precision */
19454 if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10;
19455 if( realvalue<0.0 ){
19456 realvalue = -realvalue;
19457 prefix = '-';
19458 }else{
19459 if( flag_plussign ) prefix = '+';
@@ -19497,11 +19451,10 @@
19497 bufpt = buf;
19498 /*
19499 ** If the field type is etGENERIC, then convert to either etEXP
19500 ** or etFLOAT, as appropriate.
19501 */
19502 flag_exp = xtype==etEXP;
19503 if( xtype!=etFLOAT ){
19504 realvalue += rounder;
19505 if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }
19506 }
19507 if( xtype==etGENERIC ){
@@ -19518,10 +19471,18 @@
19518 if( xtype==etEXP ){
19519 e2 = 0;
19520 }else{
19521 e2 = exp;
19522 }
 
 
 
 
 
 
 
 
19523 nsd = 0;
19524 flag_dp = (precision>0 ?1:0) | flag_alternateform | flag_altform2;
19525 /* The sign in front of the number */
19526 if( prefix ){
19527 *(bufpt++) = prefix;
@@ -19549,21 +19510,21 @@
19549 *(bufpt++) = et_getdigit(&realvalue,&nsd);
19550 }
19551 /* Remove trailing zeros and the "." if no digits follow the "." */
19552 if( flag_rtz && flag_dp ){
19553 while( bufpt[-1]=='0' ) *(--bufpt) = 0;
19554 assert( bufpt>buf );
19555 if( bufpt[-1]=='.' ){
19556 if( flag_altform2 ){
19557 *(bufpt++) = '0';
19558 }else{
19559 *(--bufpt) = 0;
19560 }
19561 }
19562 }
19563 /* Add the "eNNN" suffix */
19564 if( flag_exp || xtype==etEXP ){
19565 *(bufpt++) = aDigits[infop->charset];
19566 if( exp<0 ){
19567 *(bufpt++) = '-'; exp = -exp;
19568 }else{
19569 *(bufpt++) = '+';
@@ -19578,12 +19539,12 @@
19578 *bufpt = 0;
19579
19580 /* The converted number is in buf[] and zero terminated. Output it.
19581 ** Note that the number is in the usual order, not reversed as with
19582 ** integer conversions. */
19583 length = (int)(bufpt-buf);
19584 bufpt = buf;
19585
19586 /* Special case: Add leading zeros if the flag_zeropad flag is
19587 ** set and we are not left justified */
19588 if( flag_zeropad && !flag_leftjustify && length < width){
19589 int i;
@@ -19717,13 +19678,11 @@
19717 nspace = width-length;
19718 if( nspace>0 ){
19719 appendSpace(pAccum, nspace);
19720 }
19721 }
19722 if( zExtra ){
19723 sqlite3_free(zExtra);
19724 }
19725 }/* End for loop over the format string */
19726 } /* End of function */
19727
19728 /*
19729 ** Append N bytes of text from z to the StrAccum object.
@@ -20011,11 +19970,10 @@
20011 }
20012 #endif
20013
20014 /************** End of printf.c **********************************************/
20015 /************** Begin file random.c ******************************************/
20016 #line 1 "tsrc/random.c"
20017 /*
20018 ** 2001 September 15
20019 **
20020 ** The author disclaims copyright to this source code. In place of
20021 ** a legal notice, here is a blessing:
@@ -20159,11 +20117,10 @@
20159 }
20160 #endif /* SQLITE_OMIT_BUILTIN_TEST */
20161
20162 /************** End of random.c **********************************************/
20163 /************** Begin file utf.c *********************************************/
20164 #line 1 "tsrc/utf.c"
20165 /*
20166 ** 2004 April 13
20167 **
20168 ** The author disclaims copyright to this source code. In place of
20169 ** a legal notice, here is a blessing:
@@ -20721,11 +20678,10 @@
20721 #endif /* SQLITE_TEST */
20722 #endif /* SQLITE_OMIT_UTF16 */
20723
20724 /************** End of utf.c *************************************************/
20725 /************** Begin file util.c ********************************************/
20726 #line 1 "tsrc/util.c"
20727 /*
20728 ** 2001 September 15
20729 **
20730 ** The author disclaims copyright to this source code. In place of
20731 ** a legal notice, here is a blessing:
@@ -21904,11 +21860,10 @@
21904 }
21905 #endif
21906
21907 /************** End of util.c ************************************************/
21908 /************** Begin file hash.c ********************************************/
21909 #line 1 "tsrc/hash.c"
21910 /*
21911 ** 2001 September 22
21912 **
21913 ** The author disclaims copyright to this source code. In place of
21914 ** a legal notice, here is a blessing:
@@ -22184,11 +22139,10 @@
22184 return 0;
22185 }
22186
22187 /************** End of hash.c ************************************************/
22188 /************** Begin file opcodes.c *****************************************/
22189 #line 1 "tsrc/opcodes.c"
22190 /* Automatically generated. Do not edit */
22191 /* See the mkopcodec.awk script for details. */
22192 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
22193 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
22194 static const char *const azName[] = { "?",
@@ -22347,11 +22301,10 @@
22347 }
22348 #endif
22349
22350 /************** End of opcodes.c *********************************************/
22351 /************** Begin file os_os2.c ******************************************/
22352 #line 1 "tsrc/os_os2.c"
22353 /*
22354 ** 2006 Feb 14
22355 **
22356 ** The author disclaims copyright to this source code. In place of
22357 ** a legal notice, here is a blessing:
@@ -22404,11 +22357,10 @@
22404 /*
22405 ** Include code that is common to all os_*.c files
22406 */
22407 /************** Include os_common.h in the middle of os_os2.c ****************/
22408 /************** Begin file os_common.h ***************************************/
22409 #line 1 "tsrc/os_common.h"
22410 /*
22411 ** 2004 May 22
22412 **
22413 ** The author disclaims copyright to this source code. In place of
22414 ** a legal notice, here is a blessing:
@@ -22458,11 +22410,10 @@
22458 ** hwtime.h contains inline assembler code for implementing
22459 ** high-performance timing routines.
22460 */
22461 /************** Include hwtime.h in the middle of os_common.h ****************/
22462 /************** Begin file hwtime.h ******************************************/
22463 #line 1 "tsrc/hwtime.h"
22464 /*
22465 ** 2008 May 27
22466 **
22467 ** The author disclaims copyright to this source code. In place of
22468 ** a legal notice, here is a blessing:
@@ -22547,11 +22498,10 @@
22547
22548 #endif /* !defined(_HWTIME_H_) */
22549
22550 /************** End of hwtime.h **********************************************/
22551 /************** Continuing where we left off in os_common.h ******************/
22552 #line 53 "tsrc/os_common.h"
22553
22554 static sqlite_uint64 g_start;
22555 static sqlite_uint64 g_elapsed;
22556 #define TIMER_START g_start=sqlite3Hwtime()
22557 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -22614,11 +22564,10 @@
22614
22615 #endif /* !defined(_OS_COMMON_H_) */
22616
22617 /************** End of os_common.h *******************************************/
22618 /************** Continuing where we left off in os_os2.c *********************/
22619 #line 57 "tsrc/os_os2.c"
22620
22621 /* Forward references */
22622 typedef struct os2File os2File; /* The file structure */
22623 typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */
22624 typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */
@@ -24486,11 +24435,10 @@
24486
24487 #endif /* SQLITE_OS_OS2 */
24488
24489 /************** End of os_os2.c **********************************************/
24490 /************** Begin file os_unix.c *****************************************/
24491 #line 1 "tsrc/os_unix.c"
24492 /*
24493 ** 2004 May 22
24494 **
24495 ** The author disclaims copyright to this source code. In place of
24496 ** a legal notice, here is a blessing:
@@ -24751,11 +24699,10 @@
24751 /*
24752 ** Include code that is common to all os_*.c files
24753 */
24754 /************** Include os_common.h in the middle of os_unix.c ***************/
24755 /************** Begin file os_common.h ***************************************/
24756 #line 1 "tsrc/os_common.h"
24757 /*
24758 ** 2004 May 22
24759 **
24760 ** The author disclaims copyright to this source code. In place of
24761 ** a legal notice, here is a blessing:
@@ -24805,11 +24752,10 @@
24805 ** hwtime.h contains inline assembler code for implementing
24806 ** high-performance timing routines.
24807 */
24808 /************** Include hwtime.h in the middle of os_common.h ****************/
24809 /************** Begin file hwtime.h ******************************************/
24810 #line 1 "tsrc/hwtime.h"
24811 /*
24812 ** 2008 May 27
24813 **
24814 ** The author disclaims copyright to this source code. In place of
24815 ** a legal notice, here is a blessing:
@@ -24894,11 +24840,10 @@
24894
24895 #endif /* !defined(_HWTIME_H_) */
24896
24897 /************** End of hwtime.h **********************************************/
24898 /************** Continuing where we left off in os_common.h ******************/
24899 #line 53 "tsrc/os_common.h"
24900
24901 static sqlite_uint64 g_start;
24902 static sqlite_uint64 g_elapsed;
24903 #define TIMER_START g_start=sqlite3Hwtime()
24904 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -24961,11 +24906,10 @@
24961
24962 #endif /* !defined(_OS_COMMON_H_) */
24963
24964 /************** End of os_common.h *******************************************/
24965 /************** Continuing where we left off in os_unix.c ********************/
24966 #line 265 "tsrc/os_unix.c"
24967
24968 /*
24969 ** Define various macros that are missing from some systems.
24970 */
24971 #ifndef O_LARGEFILE
@@ -28554,20 +28498,19 @@
28554 rc = SQLITE_NOMEM;
28555 goto shm_open_err;
28556 }
28557
28558 if( pInode->bProcessLock==0 ){
28559 pShmNode->h = robust_open(zShmFilename, O_RDWR|O_CREAT,
28560 (sStat.st_mode & 0777));
 
 
 
 
 
 
28561 if( pShmNode->h<0 ){
28562 const char *zRO;
28563 zRO = sqlite3_uri_parameter(pDbFd->zPath, "readonly_shm");
28564 if( zRO && sqlite3GetBoolean(zRO) ){
28565 pShmNode->h = robust_open(zShmFilename, O_RDONLY,
28566 (sStat.st_mode & 0777));
28567 pShmNode->isReadonly = 1;
28568 }
28569 if( pShmNode->h<0 ){
28570 rc = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zShmFilename);
28571 goto shm_open_err;
28572 }
28573 }
@@ -31479,11 +31422,10 @@
31479
31480 #endif /* SQLITE_OS_UNIX */
31481
31482 /************** End of os_unix.c *********************************************/
31483 /************** Begin file os_win.c ******************************************/
31484 #line 1 "tsrc/os_win.c"
31485 /*
31486 ** 2004 May 22
31487 **
31488 ** The author disclaims copyright to this source code. In place of
31489 ** a legal notice, here is a blessing:
@@ -31541,11 +31483,10 @@
31541 /*
31542 ** Include code that is common to all os_*.c files
31543 */
31544 /************** Include os_common.h in the middle of os_win.c ****************/
31545 /************** Begin file os_common.h ***************************************/
31546 #line 1 "tsrc/os_common.h"
31547 /*
31548 ** 2004 May 22
31549 **
31550 ** The author disclaims copyright to this source code. In place of
31551 ** a legal notice, here is a blessing:
@@ -31595,11 +31536,10 @@
31595 ** hwtime.h contains inline assembler code for implementing
31596 ** high-performance timing routines.
31597 */
31598 /************** Include hwtime.h in the middle of os_common.h ****************/
31599 /************** Begin file hwtime.h ******************************************/
31600 #line 1 "tsrc/hwtime.h"
31601 /*
31602 ** 2008 May 27
31603 **
31604 ** The author disclaims copyright to this source code. In place of
31605 ** a legal notice, here is a blessing:
@@ -31684,11 +31624,10 @@
31684
31685 #endif /* !defined(_HWTIME_H_) */
31686
31687 /************** End of hwtime.h **********************************************/
31688 /************** Continuing where we left off in os_common.h ******************/
31689 #line 53 "tsrc/os_common.h"
31690
31691 static sqlite_uint64 g_start;
31692 static sqlite_uint64 g_elapsed;
31693 #define TIMER_START g_start=sqlite3Hwtime()
31694 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -31751,11 +31690,10 @@
31751
31752 #endif /* !defined(_OS_COMMON_H_) */
31753
31754 /************** End of os_common.h *******************************************/
31755 /************** Continuing where we left off in os_win.c *********************/
31756 #line 62 "tsrc/os_win.c"
31757
31758 /*
31759 ** Some microsoft compilers lack this definition.
31760 */
31761 #ifndef INVALID_FILE_ATTRIBUTES
@@ -34897,11 +34835,10 @@
34897
34898 #endif /* SQLITE_OS_WIN */
34899
34900 /************** End of os_win.c **********************************************/
34901 /************** Begin file bitvec.c ******************************************/
34902 #line 1 "tsrc/bitvec.c"
34903 /*
34904 ** 2008 February 16
34905 **
34906 ** The author disclaims copyright to this source code. In place of
34907 ** a legal notice, here is a blessing:
@@ -35308,11 +35245,10 @@
35308 }
35309 #endif /* SQLITE_OMIT_BUILTIN_TEST */
35310
35311 /************** End of bitvec.c **********************************************/
35312 /************** Begin file pcache.c ******************************************/
35313 #line 1 "tsrc/pcache.c"
35314 /*
35315 ** 2008 August 05
35316 **
35317 ** The author disclaims copyright to this source code. In place of
35318 ** a legal notice, here is a blessing:
@@ -35905,11 +35841,10 @@
35905 }
35906 #endif
35907
35908 /************** End of pcache.c **********************************************/
35909 /************** Begin file pcache1.c *****************************************/
35910 #line 1 "tsrc/pcache1.c"
35911 /*
35912 ** 2008 November 05
35913 **
35914 ** The author disclaims copyright to this source code. In place of
35915 ** a legal notice, here is a blessing:
@@ -36880,11 +36815,10 @@
36880 }
36881 #endif
36882
36883 /************** End of pcache1.c *********************************************/
36884 /************** Begin file rowset.c ******************************************/
36885 #line 1 "tsrc/rowset.c"
36886 /*
36887 ** 2008 December 3
36888 **
36889 ** The author disclaims copyright to this source code. In place of
36890 ** a legal notice, here is a blessing:
@@ -37305,11 +37239,10 @@
37305 return 0;
37306 }
37307
37308 /************** End of rowset.c **********************************************/
37309 /************** Begin file pager.c *******************************************/
37310 #line 1 "tsrc/pager.c"
37311 /*
37312 ** 2001 September 15
37313 **
37314 ** The author disclaims copyright to this source code. In place of
37315 ** a legal notice, here is a blessing:
@@ -37329,11 +37262,10 @@
37329 ** another is writing.
37330 */
37331 #ifndef SQLITE_OMIT_DISKIO
37332 /************** Include wal.h in the middle of pager.c ***********************/
37333 /************** Begin file wal.h *********************************************/
37334 #line 1 "tsrc/wal.h"
37335 /*
37336 ** 2010 February 1
37337 **
37338 ** The author disclaims copyright to this source code. In place of
37339 ** a legal notice, here is a blessing:
@@ -37454,11 +37386,10 @@
37454 #endif /* ifndef SQLITE_OMIT_WAL */
37455 #endif /* _WAL_H_ */
37456
37457 /************** End of wal.h *************************************************/
37458 /************** Continuing where we left off in pager.c **********************/
37459 #line 24 "tsrc/pager.c"
37460
37461
37462 /******************* NOTES ON THE DESIGN OF THE PAGER ************************
37463 **
37464 ** This comment block describes invariants that hold when using a rollback
@@ -44291,11 +44222,10 @@
44291
44292 #endif /* SQLITE_OMIT_DISKIO */
44293
44294 /************** End of pager.c ***********************************************/
44295 /************** Begin file wal.c *********************************************/
44296 #line 1 "tsrc/wal.c"
44297 /*
44298 ** 2010 February 1
44299 **
44300 ** The author disclaims copyright to this source code. In place of
44301 ** a legal notice, here is a blessing:
@@ -47246,11 +47176,10 @@
47246
47247 #endif /* #ifndef SQLITE_OMIT_WAL */
47248
47249 /************** End of wal.c *************************************************/
47250 /************** Begin file btmutex.c *****************************************/
47251 #line 1 "tsrc/btmutex.c"
47252 /*
47253 ** 2007 August 27
47254 **
47255 ** The author disclaims copyright to this source code. In place of
47256 ** a legal notice, here is a blessing:
@@ -47266,11 +47195,10 @@
47266 ** big and we want to break it down some. This packaged seemed like
47267 ** a good breakout.
47268 */
47269 /************** Include btreeInt.h in the middle of btmutex.c ****************/
47270 /************** Begin file btreeInt.h ****************************************/
47271 #line 1 "tsrc/btreeInt.h"
47272 /*
47273 ** 2004 April 6
47274 **
47275 ** The author disclaims copyright to this source code. In place of
47276 ** a legal notice, here is a blessing:
@@ -47912,11 +47840,10 @@
47912 #define get4byte sqlite3Get4byte
47913 #define put4byte sqlite3Put4byte
47914
47915 /************** End of btreeInt.h ********************************************/
47916 /************** Continuing where we left off in btmutex.c ********************/
47917 #line 19 "tsrc/btmutex.c"
47918 #ifndef SQLITE_OMIT_SHARED_CACHE
47919 #if SQLITE_THREADSAFE
47920
47921 /*
47922 ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -48185,11 +48112,10 @@
48185 #endif /* if SQLITE_THREADSAFE */
48186 #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
48187
48188 /************** End of btmutex.c *********************************************/
48189 /************** Begin file btree.c *******************************************/
48190 #line 1 "tsrc/btree.c"
48191 /*
48192 ** 2004 April 6
48193 **
48194 ** The author disclaims copyright to this source code. In place of
48195 ** a legal notice, here is a blessing:
@@ -52125,25 +52051,59 @@
52125 offset -= ovflSize;
52126 }else{
52127 /* Need to read this page properly. It contains some of the
52128 ** range of data that is being read (eOp==0) or written (eOp!=0).
52129 */
52130 DbPage *pDbPage;
 
 
52131 int a = amt;
52132 rc = sqlite3PagerGet(pBt->pPager, nextPage, &pDbPage);
52133 if( rc==SQLITE_OK ){
52134 aPayload = sqlite3PagerGetData(pDbPage);
52135 nextPage = get4byte(aPayload);
52136 if( a + offset > ovflSize ){
52137 a = ovflSize - offset;
52138 }
52139 rc = copyPayload(&aPayload[offset+4], pBuf, a, eOp, pDbPage);
52140 sqlite3PagerUnref(pDbPage);
52141 offset = 0;
52142 amt -= a;
52143 pBuf += a;
52144 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52145 }
52146 }
52147 }
52148
52149 if( rc==SQLITE_OK && amt>0 ){
@@ -56373,11 +56333,10 @@
56373 return rc;
56374 }
56375
56376 /************** End of btree.c ***********************************************/
56377 /************** Begin file backup.c ******************************************/
56378 #line 1 "tsrc/backup.c"
56379 /*
56380 ** 2009 January 28
56381 **
56382 ** The author disclaims copyright to this source code. In place of
56383 ** a legal notice, here is a blessing:
@@ -57089,11 +57048,10 @@
57089 }
57090 #endif /* SQLITE_OMIT_VACUUM */
57091
57092 /************** End of backup.c **********************************************/
57093 /************** Begin file vdbemem.c *****************************************/
57094 #line 1 "tsrc/vdbemem.c"
57095 /*
57096 ** 2004 May 26
57097 **
57098 ** The author disclaims copyright to this source code. In place of
57099 ** a legal notice, here is a blessing:
@@ -58244,11 +58202,10 @@
58244 return 0;
58245 }
58246
58247 /************** End of vdbemem.c *********************************************/
58248 /************** Begin file vdbeaux.c *****************************************/
58249 #line 1 "tsrc/vdbeaux.c"
58250 /*
58251 ** 2003 September 6
58252 **
58253 ** The author disclaims copyright to this source code. In place of
58254 ** a legal notice, here is a blessing:
@@ -61486,11 +61443,10 @@
61486 }
61487 }
61488
61489 /************** End of vdbeaux.c *********************************************/
61490 /************** Begin file vdbeapi.c *****************************************/
61491 #line 1 "tsrc/vdbeapi.c"
61492 /*
61493 ** 2004 May 26
61494 **
61495 ** The author disclaims copyright to this source code. In place of
61496 ** a legal notice, here is a blessing:
@@ -62794,11 +62750,10 @@
62794 return v;
62795 }
62796
62797 /************** End of vdbeapi.c *********************************************/
62798 /************** Begin file vdbetrace.c ***************************************/
62799 #line 1 "tsrc/vdbetrace.c"
62800 /*
62801 ** 2009 November 25
62802 **
62803 ** The author disclaims copyright to this source code. In place of
62804 ** a legal notice, here is a blessing:
@@ -62950,11 +62905,10 @@
62950
62951 #endif /* #ifndef SQLITE_OMIT_TRACE */
62952
62953 /************** End of vdbetrace.c *******************************************/
62954 /************** Begin file vdbe.c ********************************************/
62955 #line 1 "tsrc/vdbe.c"
62956 /*
62957 ** 2001 September 15
62958 **
62959 ** The author disclaims copyright to this source code. In place of
62960 ** a legal notice, here is a blessing:
@@ -63420,11 +63374,10 @@
63420 ** hwtime.h contains inline assembler code for implementing
63421 ** high-performance timing routines.
63422 */
63423 /************** Include hwtime.h in the middle of vdbe.c *********************/
63424 /************** Begin file hwtime.h ******************************************/
63425 #line 1 "tsrc/hwtime.h"
63426 /*
63427 ** 2008 May 27
63428 **
63429 ** The author disclaims copyright to this source code. In place of
63430 ** a legal notice, here is a blessing:
@@ -63509,11 +63462,10 @@
63509
63510 #endif /* !defined(_HWTIME_H_) */
63511
63512 /************** End of hwtime.h **********************************************/
63513 /************** Continuing where we left off in vdbe.c ***********************/
63514 #line 471 "tsrc/vdbe.c"
63515
63516 #endif
63517
63518 /*
63519 ** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
@@ -69754,11 +69706,10 @@
69754 goto vdbe_error_halt;
69755 }
69756
69757 /************** End of vdbe.c ************************************************/
69758 /************** Begin file vdbeblob.c ****************************************/
69759 #line 1 "tsrc/vdbeblob.c"
69760 /*
69761 ** 2007 May 1
69762 **
69763 ** The author disclaims copyright to this source code. In place of
69764 ** a legal notice, here is a blessing:
@@ -70225,11 +70176,10 @@
70225
70226 #endif /* #ifndef SQLITE_OMIT_INCRBLOB */
70227
70228 /************** End of vdbeblob.c ********************************************/
70229 /************** Begin file vdbesort.c ****************************************/
70230 #line 1 "tsrc/vdbesort.c"
70231 /*
70232 ** 2011 July 9
70233 **
70234 ** The author disclaims copyright to this source code. In place of
70235 ** a legal notice, here is a blessing:
@@ -71109,11 +71059,10 @@
71109
71110 #endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
71111
71112 /************** End of vdbesort.c ********************************************/
71113 /************** Begin file journal.c *****************************************/
71114 #line 1 "tsrc/journal.c"
71115 /*
71116 ** 2007 August 22
71117 **
71118 ** The author disclaims copyright to this source code. In place of
71119 ** a legal notice, here is a blessing:
@@ -71350,11 +71299,10 @@
71350 }
71351 #endif
71352
71353 /************** End of journal.c *********************************************/
71354 /************** Begin file memjournal.c **************************************/
71355 #line 1 "tsrc/memjournal.c"
71356 /*
71357 ** 2008 October 7
71358 **
71359 ** The author disclaims copyright to this source code. In place of
71360 ** a legal notice, here is a blessing:
@@ -71612,11 +71560,10 @@
71612 return sizeof(MemJournal);
71613 }
71614
71615 /************** End of memjournal.c ******************************************/
71616 /************** Begin file walker.c ******************************************/
71617 #line 1 "tsrc/walker.c"
71618 /*
71619 ** 2008 August 16
71620 **
71621 ** The author disclaims copyright to this source code. In place of
71622 ** a legal notice, here is a blessing:
@@ -71751,11 +71698,10 @@
71751 return rc & WRC_Abort;
71752 }
71753
71754 /************** End of walker.c **********************************************/
71755 /************** Begin file resolve.c *****************************************/
71756 #line 1 "tsrc/resolve.c"
71757 /*
71758 ** 2008 August 18
71759 **
71760 ** The author disclaims copyright to this source code. In place of
71761 ** a legal notice, here is a blessing:
@@ -72972,11 +72918,10 @@
72972 sqlite3WalkSelect(&w, p);
72973 }
72974
72975 /************** End of resolve.c *********************************************/
72976 /************** Begin file expr.c ********************************************/
72977 #line 1 "tsrc/expr.c"
72978 /*
72979 ** 2001 September 15
72980 **
72981 ** The author disclaims copyright to this source code. In place of
72982 ** a legal notice, here is a blessing:
@@ -76730,11 +76675,10 @@
76730 }
76731 }
76732
76733 /************** End of expr.c ************************************************/
76734 /************** Begin file alter.c *******************************************/
76735 #line 1 "tsrc/alter.c"
76736 /*
76737 ** 2005 February 15
76738 **
76739 ** The author disclaims copyright to this source code. In place of
76740 ** a legal notice, here is a blessing:
@@ -77559,11 +77503,10 @@
77559 }
77560 #endif /* SQLITE_ALTER_TABLE */
77561
77562 /************** End of alter.c ***********************************************/
77563 /************** Begin file analyze.c *****************************************/
77564 #line 1 "tsrc/analyze.c"
77565 /*
77566 ** 2005 July 8
77567 **
77568 ** The author disclaims copyright to this source code. In place of
77569 ** a legal notice, here is a blessing:
@@ -77709,16 +77652,10 @@
77709 { "sqlite_stat1", "tbl,idx,stat" },
77710 #ifdef SQLITE_ENABLE_STAT3
77711 { "sqlite_stat3", "tbl,idx,neq,nlt,ndlt,sample" },
77712 #endif
77713 };
77714 static const char *azToDrop[] = {
77715 "sqlite_stat2",
77716 #ifndef SQLITE_ENABLE_STAT3
77717 "sqlite_stat3",
77718 #endif
77719 };
77720
77721 int aRoot[] = {0, 0};
77722 u8 aCreateTbl[] = {0, 0};
77723
77724 int i;
@@ -77728,21 +77665,10 @@
77728 if( v==0 ) return;
77729 assert( sqlite3BtreeHoldsAllMutexes(db) );
77730 assert( sqlite3VdbeDb(v)==db );
77731 pDb = &db->aDb[iDb];
77732
77733 /* Drop all statistics tables that this version of SQLite does not
77734 ** understand.
77735 */
77736 for(i=0; i<ArraySize(azToDrop); i++){
77737 Table *pTab = sqlite3FindTable(db, azToDrop[i], pDb->zName);
77738 if( pTab ){
77739 sqlite3CodeDropTable(pParse, pTab, iDb, 0);
77740 break;
77741 }
77742 }
77743
77744 /* Create new statistic tables if they do not exist, or clear them
77745 ** if they do already exist.
77746 */
77747 for(i=0; i<ArraySize(aTable); i++){
77748 const char *zTab = aTable[i].zName;
@@ -78699,11 +78625,10 @@
78699
78700 #endif /* SQLITE_OMIT_ANALYZE */
78701
78702 /************** End of analyze.c *********************************************/
78703 /************** Begin file attach.c ******************************************/
78704 #line 1 "tsrc/attach.c"
78705 /*
78706 ** 2003 April 6
78707 **
78708 ** The author disclaims copyright to this source code. In place of
78709 ** a legal notice, here is a blessing:
@@ -79259,11 +79184,10 @@
79259 }
79260 #endif
79261
79262 /************** End of attach.c **********************************************/
79263 /************** Begin file auth.c ********************************************/
79264 #line 1 "tsrc/auth.c"
79265 /*
79266 ** 2003 January 11
79267 **
79268 ** The author disclaims copyright to this source code. In place of
79269 ** a legal notice, here is a blessing:
@@ -79511,11 +79435,10 @@
79511
79512 #endif /* SQLITE_OMIT_AUTHORIZATION */
79513
79514 /************** End of auth.c ************************************************/
79515 /************** Begin file build.c *******************************************/
79516 #line 1 "tsrc/build.c"
79517 /*
79518 ** 2001 September 15
79519 **
79520 ** The author disclaims copyright to this source code. In place of
79521 ** a legal notice, here is a blessing:
@@ -81658,11 +81581,12 @@
81658 if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){
81659 goto exit_drop_table;
81660 }
81661 }
81662 #endif
81663 if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 ){
 
81664 sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName);
81665 goto exit_drop_table;
81666 }
81667
81668 #ifndef SQLITE_OMIT_VIEW
@@ -83332,11 +83256,10 @@
83332 return pKey;
83333 }
83334
83335 /************** End of build.c ***********************************************/
83336 /************** Begin file callback.c ****************************************/
83337 #line 1 "tsrc/callback.c"
83338 /*
83339 ** 2005 May 23
83340 **
83341 ** The author disclaims copyright to this source code. In place of
83342 ** a legal notice, here is a blessing:
@@ -83792,11 +83715,10 @@
83792 return p;
83793 }
83794
83795 /************** End of callback.c ********************************************/
83796 /************** Begin file delete.c ******************************************/
83797 #line 1 "tsrc/delete.c"
83798 /*
83799 ** 2001 September 15
83800 **
83801 ** The author disclaims copyright to this source code. In place of
83802 ** a legal notice, here is a blessing:
@@ -84447,11 +84369,10 @@
84447 return regBase;
84448 }
84449
84450 /************** End of delete.c **********************************************/
84451 /************** Begin file func.c ********************************************/
84452 #line 1 "tsrc/func.c"
84453 /*
84454 ** 2002 February 23
84455 **
84456 ** The author disclaims copyright to this source code. In place of
84457 ** a legal notice, here is a blessing:
@@ -86056,11 +85977,10 @@
86056 #endif
86057 }
86058
86059 /************** End of func.c ************************************************/
86060 /************** Begin file fkey.c ********************************************/
86061 #line 1 "tsrc/fkey.c"
86062 /*
86063 **
86064 ** The author disclaims copyright to this source code. In place of
86065 ** a legal notice, here is a blessing:
86066 **
@@ -87277,11 +87197,10 @@
87277 }
87278 #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
87279
87280 /************** End of fkey.c ************************************************/
87281 /************** Begin file insert.c ******************************************/
87282 #line 1 "tsrc/insert.c"
87283 /*
87284 ** 2001 September 15
87285 **
87286 ** The author disclaims copyright to this source code. In place of
87287 ** a legal notice, here is a blessing:
@@ -89126,11 +89045,10 @@
89126 }
89127 #endif /* SQLITE_OMIT_XFER_OPT */
89128
89129 /************** End of insert.c **********************************************/
89130 /************** Begin file legacy.c ******************************************/
89131 #line 1 "tsrc/legacy.c"
89132 /*
89133 ** 2001 September 15
89134 **
89135 ** The author disclaims copyright to this source code. In place of
89136 ** a legal notice, here is a blessing:
@@ -89274,11 +89192,10 @@
89274 return rc;
89275 }
89276
89277 /************** End of legacy.c **********************************************/
89278 /************** Begin file loadext.c *****************************************/
89279 #line 1 "tsrc/loadext.c"
89280 /*
89281 ** 2006 June 7
89282 **
89283 ** The author disclaims copyright to this source code. In place of
89284 ** a legal notice, here is a blessing:
@@ -89295,11 +89212,10 @@
89295 #ifndef SQLITE_CORE
89296 #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
89297 #endif
89298 /************** Include sqlite3ext.h in the middle of loadext.c **************/
89299 /************** Begin file sqlite3ext.h **************************************/
89300 #line 1 "tsrc/sqlite3ext.h"
89301 /*
89302 ** 2006 June 7
89303 **
89304 ** The author disclaims copyright to this source code. In place of
89305 ** a legal notice, here is a blessing:
@@ -89724,11 +89640,10 @@
89724
89725 #endif /* _SQLITE3EXT_H_ */
89726
89727 /************** End of sqlite3ext.h ******************************************/
89728 /************** Continuing where we left off in loadext.c ********************/
89729 #line 20 "tsrc/loadext.c"
89730 /* #include <string.h> */
89731
89732 #ifndef SQLITE_OMIT_LOAD_EXTENSION
89733
89734 /*
@@ -90364,11 +90279,10 @@
90364 }
90365 }
90366
90367 /************** End of loadext.c *********************************************/
90368 /************** Begin file pragma.c ******************************************/
90369 #line 1 "tsrc/pragma.c"
90370 /*
90371 ** 2003 April 6
90372 **
90373 ** The author disclaims copyright to this source code. In place of
90374 ** a legal notice, here is a blessing:
@@ -90899,12 +90813,14 @@
90899 */
90900 if( sqlite3StrICmp(zLeft,"journal_mode")==0 ){
90901 int eMode; /* One of the PAGER_JOURNALMODE_XXX symbols */
90902 int ii; /* Loop counter */
90903
90904 /* Force the schema to be loaded on all databases. This cases all
90905 ** database files to be opened and the journal_modes set. */
 
 
90906 if( sqlite3ReadSchema(pParse) ){
90907 goto pragma_out;
90908 }
90909
90910 sqlite3VdbeSetNumCols(v, 1);
@@ -91893,11 +91809,10 @@
91893
91894 #endif /* SQLITE_OMIT_PRAGMA */
91895
91896 /************** End of pragma.c **********************************************/
91897 /************** Begin file prepare.c *****************************************/
91898 #line 1 "tsrc/prepare.c"
91899 /*
91900 ** 2005 May 25
91901 **
91902 ** The author disclaims copyright to this source code. In place of
91903 ** a legal notice, here is a blessing:
@@ -92754,11 +92669,10 @@
92754
92755 #endif /* SQLITE_OMIT_UTF16 */
92756
92757 /************** End of prepare.c *********************************************/
92758 /************** Begin file select.c ******************************************/
92759 #line 1 "tsrc/select.c"
92760 /*
92761 ** 2001 September 15
92762 **
92763 ** The author disclaims copyright to this source code. In place of
92764 ** a legal notice, here is a blessing:
@@ -92821,10 +92735,11 @@
92821 Select standin;
92822 sqlite3 *db = pParse->db;
92823 pNew = sqlite3DbMallocZero(db, sizeof(*pNew) );
92824 assert( db->mallocFailed || !pOffset || pLimit ); /* OFFSET implies LIMIT */
92825 if( pNew==0 ){
 
92826 pNew = &standin;
92827 memset(pNew, 0, sizeof(*pNew));
92828 }
92829 if( pEList==0 ){
92830 pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ALL,0));
@@ -92848,10 +92763,11 @@
92848 if( pNew!=&standin ) sqlite3DbFree(db, pNew);
92849 pNew = 0;
92850 }else{
92851 assert( pNew->pSrc!=0 || pParse->nErr>0 );
92852 }
 
92853 return pNew;
92854 }
92855
92856 /*
92857 ** Delete the given Select structure and all of its substructures.
@@ -97343,11 +97259,10 @@
97343 *****************************************************************************/
97344 #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
97345
97346 /************** End of select.c **********************************************/
97347 /************** Begin file table.c *******************************************/
97348 #line 1 "tsrc/table.c"
97349 /*
97350 ** 2001 September 15
97351 **
97352 ** The author disclaims copyright to this source code. In place of
97353 ** a legal notice, here is a blessing:
@@ -97543,11 +97458,10 @@
97543
97544 #endif /* SQLITE_OMIT_GET_TABLE */
97545
97546 /************** End of table.c ***********************************************/
97547 /************** Begin file trigger.c *****************************************/
97548 #line 1 "tsrc/trigger.c"
97549 /*
97550 **
97551 ** The author disclaims copyright to this source code. In place of
97552 ** a legal notice, here is a blessing:
97553 **
@@ -98669,11 +98583,10 @@
98669
98670 #endif /* !defined(SQLITE_OMIT_TRIGGER) */
98671
98672 /************** End of trigger.c *********************************************/
98673 /************** Begin file update.c ******************************************/
98674 #line 1 "tsrc/update.c"
98675 /*
98676 ** 2001 September 15
98677 **
98678 ** The author disclaims copyright to this source code. In place of
98679 ** a legal notice, here is a blessing:
@@ -99342,11 +99255,10 @@
99342 }
99343 #endif /* SQLITE_OMIT_VIRTUALTABLE */
99344
99345 /************** End of update.c **********************************************/
99346 /************** Begin file vacuum.c ******************************************/
99347 #line 1 "tsrc/vacuum.c"
99348 /*
99349 ** 2003 April 6
99350 **
99351 ** The author disclaims copyright to this source code. In place of
99352 ** a legal notice, here is a blessing:
@@ -99687,11 +99599,10 @@
99687
99688 #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
99689
99690 /************** End of vacuum.c **********************************************/
99691 /************** Begin file vtab.c ********************************************/
99692 #line 1 "tsrc/vtab.c"
99693 /*
99694 ** 2006 June 10
99695 **
99696 ** The author disclaims copyright to this source code. In place of
99697 ** a legal notice, here is a blessing:
@@ -100756,11 +100667,10 @@
100756
100757 #endif /* SQLITE_OMIT_VIRTUALTABLE */
100758
100759 /************** End of vtab.c ************************************************/
100760 /************** Begin file where.c *******************************************/
100761 #line 1 "tsrc/where.c"
100762 /*
100763 ** 2001 September 15
100764 **
100765 ** The author disclaims copyright to this source code. In place of
100766 ** a legal notice, here is a blessing:
@@ -101463,11 +101373,11 @@
101463 int iCol = pRight->iColumn;
101464 pVal = sqlite3VdbeGetValue(pReprepare, iCol, SQLITE_AFF_NONE);
101465 if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
101466 z = (char *)sqlite3_value_text(pVal);
101467 }
101468 sqlite3VdbeSetVarmask(pParse->pVdbe, iCol); /* IMP: R-23257-02778 */
101469 assert( pRight->op==TK_VARIABLE || pRight->op==TK_REGISTER );
101470 }else if( op==TK_STRING ){
101471 z = pRight->u.zToken;
101472 }
101473 if( z ){
@@ -101481,11 +101391,11 @@
101481 pPrefix = sqlite3Expr(db, TK_STRING, z);
101482 if( pPrefix ) pPrefix->u.zToken[cnt] = 0;
101483 *ppPrefix = pPrefix;
101484 if( op==TK_VARIABLE ){
101485 Vdbe *v = pParse->pVdbe;
101486 sqlite3VdbeSetVarmask(v, pRight->iColumn); /* IMP: R-23257-02778 */
101487 if( *pisComplete && pRight->u.zToken[1] ){
101488 /* If the rhs of the LIKE expression is a variable, and the current
101489 ** value of the variable means there is no need to invoke the LIKE
101490 ** function, then no OP_Variable will be added to the program.
101491 ** This causes problems for the sqlite3_bind_parameter_name()
@@ -103395,11 +103305,11 @@
103395 ){
103396 if( pExpr->op==TK_VARIABLE
103397 || (pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE)
103398 ){
103399 int iVar = pExpr->iColumn;
103400 sqlite3VdbeSetVarmask(pParse->pVdbe, iVar); /* IMP: R-23257-02778 */
103401 *pp = sqlite3VdbeGetValue(pParse->pReprepare, iVar, aff);
103402 return SQLITE_OK;
103403 }
103404 return sqlite3ValueFromExpr(pParse->db, pExpr, SQLITE_UTF8, aff, pp);
103405 }
@@ -105984,11 +105894,10 @@
105984 return;
105985 }
105986
105987 /************** End of where.c ***********************************************/
105988 /************** Begin file parse.c *******************************************/
105989 #line 1 "tsrc/parse.c"
105990 /* Driver template for the LEMON parser generator.
105991 ** The author disclaims copyright to this source code.
105992 **
105993 ** This version of "lempar.c" is modified, slightly, for use by SQLite.
105994 ** The only modifications are the addition of a couple of NEVER()
@@ -105997,11 +105906,10 @@
105997 ** specific grammar used by SQLite.
105998 */
105999 /* First off, code is included that follows the "include" declaration
106000 ** in the input grammar file. */
106001 /* #include <stdio.h> */
106002 #line 51 "parse.y"
106003
106004
106005 /*
106006 ** Disable all error recovery processing in the parser push-down
106007 ** automaton.
@@ -106045,11 +105953,10 @@
106045 /*
106046 ** An instance of this structure holds the ATTACH key and the key type.
106047 */
106048 struct AttachKey { int type; Token key; };
106049
106050 #line 722 "parse.y"
106051
106052 /* This is a utility routine used to set the ExprSpan.zStart and
106053 ** ExprSpan.zEnd values of pOut so that the span covers the complete
106054 ** range of text beginning with pStart and going to the end of pEnd.
106055 */
@@ -106065,11 +105972,10 @@
106065 static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){
106066 pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue);
106067 pOut->zStart = pValue->z;
106068 pOut->zEnd = &pValue->z[pValue->n];
106069 }
106070 #line 817 "parse.y"
106071
106072 /* This routine constructs a binary expression node out of two ExprSpan
106073 ** objects and uses the result to populate a new ExprSpan object.
106074 */
106075 static void spanBinaryExpr(
@@ -106081,11 +105987,10 @@
106081 ){
106082 pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0);
106083 pOut->zStart = pLeft->zStart;
106084 pOut->zEnd = pRight->zEnd;
106085 }
106086 #line 873 "parse.y"
106087
106088 /* Construct an expression node for a unary postfix operator
106089 */
106090 static void spanUnaryPostfix(
106091 ExprSpan *pOut, /* Write the new expression node here */
@@ -106096,11 +106001,10 @@
106096 ){
106097 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
106098 pOut->zStart = pOperand->zStart;
106099 pOut->zEnd = &pPostOp->z[pPostOp->n];
106100 }
106101 #line 892 "parse.y"
106102
106103 /* A routine to convert a binary TK_IS or TK_ISNOT expression into a
106104 ** unary TK_ISNULL or TK_NOTNULL expression. */
106105 static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
106106 sqlite3 *db = pParse->db;
@@ -106108,11 +106012,10 @@
106108 pA->op = (u8)op;
106109 sqlite3ExprDelete(db, pA->pRight);
106110 pA->pRight = 0;
106111 }
106112 }
106113 #line 920 "parse.y"
106114
106115 /* Construct an expression node for a unary prefix operator
106116 */
106117 static void spanUnaryPrefix(
106118 ExprSpan *pOut, /* Write the new expression node here */
@@ -106123,11 +106026,10 @@
106123 ){
106124 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
106125 pOut->zStart = pPreOp->z;
106126 pOut->zEnd = pOperand->zEnd;
106127 }
106128 #line 141 "parse.c"
106129 /* Next is all token values, in a form suitable for use by makeheaders.
106130 ** This section will be null unless lemon is run with the -m switch.
106131 */
106132 /*
106133 ** These constants (all generated automatically by the parser generator)
@@ -107379,21 +107281,17 @@
107379 ** inside the C code.
107380 */
107381 case 160: /* select */
107382 case 194: /* oneselect */
107383 {
107384 #line 403 "parse.y"
107385 sqlite3SelectDelete(pParse->db, (yypminor->yy387));
107386 #line 1399 "parse.c"
107387 }
107388 break;
107389 case 174: /* term */
107390 case 175: /* expr */
107391 {
107392 #line 720 "parse.y"
107393 sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
107394 #line 1407 "parse.c"
107395 }
107396 break;
107397 case 179: /* idxlist_opt */
107398 case 187: /* idxlist */
107399 case 197: /* selcollist */
@@ -107405,23 +107303,19 @@
107405 case 217: /* setlist */
107406 case 220: /* itemlist */
107407 case 221: /* exprlist */
107408 case 226: /* case_exprlist */
107409 {
107410 #line 1103 "parse.y"
107411 sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
107412 #line 1425 "parse.c"
107413 }
107414 break;
107415 case 193: /* fullname */
107416 case 198: /* from */
107417 case 206: /* seltablist */
107418 case 207: /* stl_prefix */
107419 {
107420 #line 534 "parse.y"
107421 sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
107422 #line 1435 "parse.c"
107423 }
107424 break;
107425 case 199: /* where_opt */
107426 case 201: /* having_opt */
107427 case 210: /* on_opt */
@@ -107429,37 +107323,29 @@
107429 case 225: /* case_operand */
107430 case 227: /* case_else */
107431 case 238: /* when_clause */
107432 case 243: /* key_opt */
107433 {
107434 #line 644 "parse.y"
107435 sqlite3ExprDelete(pParse->db, (yypminor->yy314));
107436 #line 1449 "parse.c"
107437 }
107438 break;
107439 case 211: /* using_opt */
107440 case 213: /* inscollist */
107441 case 219: /* inscollist_opt */
107442 {
107443 #line 566 "parse.y"
107444 sqlite3IdListDelete(pParse->db, (yypminor->yy384));
107445 #line 1458 "parse.c"
107446 }
107447 break;
107448 case 234: /* trigger_cmd_list */
107449 case 239: /* trigger_cmd */
107450 {
107451 #line 1210 "parse.y"
107452 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
107453 #line 1466 "parse.c"
107454 }
107455 break;
107456 case 236: /* trigger_event */
107457 {
107458 #line 1196 "parse.y"
107459 sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
107460 #line 1473 "parse.c"
107461 }
107462 break;
107463 default: break; /* If no destructor action specified: do nothing */
107464 }
107465 }
@@ -107641,16 +107527,14 @@
107641 }
107642 #endif
107643 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
107644 /* Here code is inserted which will execute if the parser
107645 ** stack every overflows */
107646 #line 38 "parse.y"
107647
107648 UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
107649 sqlite3ErrorMsg(pParse, "parser stack overflow");
107650 pParse->parseError = 1;
107651 #line 1664 "parse.c"
107652 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
107653 }
107654
107655 /*
107656 ** Perform a shift action.
@@ -108087,94 +107971,66 @@
108087 ** { ... } // User supplied code
108088 ** #line <lineno> <thisfile>
108089 ** break;
108090 */
108091 case 5: /* explain ::= */
108092 #line 107 "parse.y"
108093 { sqlite3BeginParse(pParse, 0); }
108094 #line 2107 "parse.c"
108095 break;
108096 case 6: /* explain ::= EXPLAIN */
108097 #line 109 "parse.y"
108098 { sqlite3BeginParse(pParse, 1); }
108099 #line 2112 "parse.c"
108100 break;
108101 case 7: /* explain ::= EXPLAIN QUERY PLAN */
108102 #line 110 "parse.y"
108103 { sqlite3BeginParse(pParse, 2); }
108104 #line 2117 "parse.c"
108105 break;
108106 case 8: /* cmdx ::= cmd */
108107 #line 112 "parse.y"
108108 { sqlite3FinishCoding(pParse); }
108109 #line 2122 "parse.c"
108110 break;
108111 case 9: /* cmd ::= BEGIN transtype trans_opt */
108112 #line 117 "parse.y"
108113 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
108114 #line 2127 "parse.c"
108115 break;
108116 case 13: /* transtype ::= */
108117 #line 122 "parse.y"
108118 {yygotominor.yy4 = TK_DEFERRED;}
108119 #line 2132 "parse.c"
108120 break;
108121 case 14: /* transtype ::= DEFERRED */
108122 case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
108123 case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
108124 case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
108125 case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
108126 #line 123 "parse.y"
108127 {yygotominor.yy4 = yymsp[0].major;}
108128 #line 2141 "parse.c"
108129 break;
108130 case 17: /* cmd ::= COMMIT trans_opt */
108131 case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
108132 #line 126 "parse.y"
108133 {sqlite3CommitTransaction(pParse);}
108134 #line 2147 "parse.c"
108135 break;
108136 case 19: /* cmd ::= ROLLBACK trans_opt */
108137 #line 128 "parse.y"
108138 {sqlite3RollbackTransaction(pParse);}
108139 #line 2152 "parse.c"
108140 break;
108141 case 22: /* cmd ::= SAVEPOINT nm */
108142 #line 132 "parse.y"
108143 {
108144 sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
108145 }
108146 #line 2159 "parse.c"
108147 break;
108148 case 23: /* cmd ::= RELEASE savepoint_opt nm */
108149 #line 135 "parse.y"
108150 {
108151 sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
108152 }
108153 #line 2166 "parse.c"
108154 break;
108155 case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
108156 #line 138 "parse.y"
108157 {
108158 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
108159 }
108160 #line 2173 "parse.c"
108161 break;
108162 case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
108163 #line 145 "parse.y"
108164 {
108165 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
108166 }
108167 #line 2180 "parse.c"
108168 break;
108169 case 27: /* createkw ::= CREATE */
108170 #line 148 "parse.y"
108171 {
108172 pParse->db->lookaside.bEnabled = 0;
108173 yygotominor.yy0 = yymsp[0].minor.yy0;
108174 }
108175 #line 2188 "parse.c"
108176 break;
108177 case 28: /* ifnotexists ::= */
108178 case 31: /* temp ::= */ yytestcase(yyruleno==31);
108179 case 70: /* autoinc ::= */ yytestcase(yyruleno==70);
108180 case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83);
@@ -108184,56 +108040,44 @@
108184 case 109: /* ifexists ::= */ yytestcase(yyruleno==109);
108185 case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120);
108186 case 121: /* distinct ::= */ yytestcase(yyruleno==121);
108187 case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222);
108188 case 225: /* in_op ::= IN */ yytestcase(yyruleno==225);
108189 #line 153 "parse.y"
108190 {yygotominor.yy4 = 0;}
108191 #line 2204 "parse.c"
108192 break;
108193 case 29: /* ifnotexists ::= IF NOT EXISTS */
108194 case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
108195 case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71);
108196 case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86);
108197 case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108);
108198 case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119);
108199 case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223);
108200 case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226);
108201 #line 154 "parse.y"
108202 {yygotominor.yy4 = 1;}
108203 #line 2216 "parse.c"
108204 break;
108205 case 32: /* create_table_args ::= LP columnlist conslist_opt RP */
108206 #line 160 "parse.y"
108207 {
108208 sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
108209 }
108210 #line 2223 "parse.c"
108211 break;
108212 case 33: /* create_table_args ::= AS select */
108213 #line 163 "parse.y"
108214 {
108215 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387);
108216 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
108217 }
108218 #line 2231 "parse.c"
108219 break;
108220 case 36: /* column ::= columnid type carglist */
108221 #line 175 "parse.y"
108222 {
108223 yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
108224 yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
108225 }
108226 #line 2239 "parse.c"
108227 break;
108228 case 37: /* columnid ::= nm */
108229 #line 179 "parse.y"
108230 {
108231 sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
108232 yygotominor.yy0 = yymsp[0].minor.yy0;
108233 }
108234 #line 2247 "parse.c"
108235 break;
108236 case 38: /* id ::= ID */
108237 case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39);
108238 case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40);
108239 case 41: /* nm ::= id */ yytestcase(yyruleno==41);
@@ -108253,373 +108097,256 @@
108253 case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264);
108254 case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265);
108255 case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266);
108256 case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267);
108257 case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
108258 #line 189 "parse.y"
108259 {yygotominor.yy0 = yymsp[0].minor.yy0;}
108260 #line 2273 "parse.c"
108261 break;
108262 case 45: /* type ::= typetoken */
108263 #line 251 "parse.y"
108264 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
108265 #line 2278 "parse.c"
108266 break;
108267 case 47: /* typetoken ::= typename LP signed RP */
108268 #line 253 "parse.y"
108269 {
108270 yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
108271 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
108272 }
108273 #line 2286 "parse.c"
108274 break;
108275 case 48: /* typetoken ::= typename LP signed COMMA signed RP */
108276 #line 257 "parse.y"
108277 {
108278 yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
108279 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
108280 }
108281 #line 2294 "parse.c"
108282 break;
108283 case 50: /* typename ::= typename ids */
108284 #line 263 "parse.y"
108285 {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
108286 #line 2299 "parse.c"
108287 break;
108288 case 57: /* ccons ::= DEFAULT term */
108289 case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59);
108290 #line 274 "parse.y"
108291 {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
108292 #line 2305 "parse.c"
108293 break;
108294 case 58: /* ccons ::= DEFAULT LP expr RP */
108295 #line 275 "parse.y"
108296 {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
108297 #line 2310 "parse.c"
108298 break;
108299 case 60: /* ccons ::= DEFAULT MINUS term */
108300 #line 277 "parse.y"
108301 {
108302 ExprSpan v;
108303 v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
108304 v.zStart = yymsp[-1].minor.yy0.z;
108305 v.zEnd = yymsp[0].minor.yy118.zEnd;
108306 sqlite3AddDefaultValue(pParse,&v);
108307 }
108308 #line 2321 "parse.c"
108309 break;
108310 case 61: /* ccons ::= DEFAULT id */
108311 #line 284 "parse.y"
108312 {
108313 ExprSpan v;
108314 spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
108315 sqlite3AddDefaultValue(pParse,&v);
108316 }
108317 #line 2330 "parse.c"
108318 break;
108319 case 63: /* ccons ::= NOT NULL onconf */
108320 #line 294 "parse.y"
108321 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
108322 #line 2335 "parse.c"
108323 break;
108324 case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
108325 #line 296 "parse.y"
108326 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
108327 #line 2340 "parse.c"
108328 break;
108329 case 65: /* ccons ::= UNIQUE onconf */
108330 #line 297 "parse.y"
108331 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
108332 #line 2345 "parse.c"
108333 break;
108334 case 66: /* ccons ::= CHECK LP expr RP */
108335 #line 298 "parse.y"
108336 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
108337 #line 2350 "parse.c"
108338 break;
108339 case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */
108340 #line 300 "parse.y"
108341 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
108342 #line 2355 "parse.c"
108343 break;
108344 case 68: /* ccons ::= defer_subclause */
108345 #line 301 "parse.y"
108346 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
108347 #line 2360 "parse.c"
108348 break;
108349 case 69: /* ccons ::= COLLATE ids */
108350 #line 302 "parse.y"
108351 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
108352 #line 2365 "parse.c"
108353 break;
108354 case 72: /* refargs ::= */
108355 #line 315 "parse.y"
108356 { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
108357 #line 2370 "parse.c"
108358 break;
108359 case 73: /* refargs ::= refargs refarg */
108360 #line 316 "parse.y"
108361 { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
108362 #line 2375 "parse.c"
108363 break;
108364 case 74: /* refarg ::= MATCH nm */
108365 case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75);
108366 #line 318 "parse.y"
108367 { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
108368 #line 2381 "parse.c"
108369 break;
108370 case 76: /* refarg ::= ON DELETE refact */
108371 #line 320 "parse.y"
108372 { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
108373 #line 2386 "parse.c"
108374 break;
108375 case 77: /* refarg ::= ON UPDATE refact */
108376 #line 321 "parse.y"
108377 { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
108378 #line 2391 "parse.c"
108379 break;
108380 case 78: /* refact ::= SET NULL */
108381 #line 323 "parse.y"
108382 { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
108383 #line 2396 "parse.c"
108384 break;
108385 case 79: /* refact ::= SET DEFAULT */
108386 #line 324 "parse.y"
108387 { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
108388 #line 2401 "parse.c"
108389 break;
108390 case 80: /* refact ::= CASCADE */
108391 #line 325 "parse.y"
108392 { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
108393 #line 2406 "parse.c"
108394 break;
108395 case 81: /* refact ::= RESTRICT */
108396 #line 326 "parse.y"
108397 { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
108398 #line 2411 "parse.c"
108399 break;
108400 case 82: /* refact ::= NO ACTION */
108401 #line 327 "parse.y"
108402 { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
108403 #line 2416 "parse.c"
108404 break;
108405 case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
108406 case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99);
108407 case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101);
108408 case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104);
108409 #line 330 "parse.y"
108410 {yygotominor.yy4 = yymsp[0].minor.yy4;}
108411 #line 2424 "parse.c"
108412 break;
108413 case 88: /* conslist_opt ::= */
108414 #line 339 "parse.y"
108415 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
108416 #line 2429 "parse.c"
108417 break;
108418 case 89: /* conslist_opt ::= COMMA conslist */
108419 #line 340 "parse.y"
108420 {yygotominor.yy0 = yymsp[-1].minor.yy0;}
108421 #line 2434 "parse.c"
108422 break;
108423 case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
108424 #line 346 "parse.y"
108425 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
108426 #line 2439 "parse.c"
108427 break;
108428 case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */
108429 #line 348 "parse.y"
108430 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
108431 #line 2444 "parse.c"
108432 break;
108433 case 96: /* tcons ::= CHECK LP expr RP onconf */
108434 #line 350 "parse.y"
108435 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
108436 #line 2449 "parse.c"
108437 break;
108438 case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
108439 #line 352 "parse.y"
108440 {
108441 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
108442 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
108443 }
108444 #line 2457 "parse.c"
108445 break;
108446 case 100: /* onconf ::= */
108447 #line 366 "parse.y"
108448 {yygotominor.yy4 = OE_Default;}
108449 #line 2462 "parse.c"
108450 break;
108451 case 102: /* orconf ::= */
108452 #line 368 "parse.y"
108453 {yygotominor.yy210 = OE_Default;}
108454 #line 2467 "parse.c"
108455 break;
108456 case 103: /* orconf ::= OR resolvetype */
108457 #line 369 "parse.y"
108458 {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
108459 #line 2472 "parse.c"
108460 break;
108461 case 105: /* resolvetype ::= IGNORE */
108462 #line 371 "parse.y"
108463 {yygotominor.yy4 = OE_Ignore;}
108464 #line 2477 "parse.c"
108465 break;
108466 case 106: /* resolvetype ::= REPLACE */
108467 #line 372 "parse.y"
108468 {yygotominor.yy4 = OE_Replace;}
108469 #line 2482 "parse.c"
108470 break;
108471 case 107: /* cmd ::= DROP TABLE ifexists fullname */
108472 #line 376 "parse.y"
108473 {
108474 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
108475 }
108476 #line 2489 "parse.c"
108477 break;
108478 case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
108479 #line 386 "parse.y"
108480 {
108481 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4);
108482 }
108483 #line 2496 "parse.c"
108484 break;
108485 case 111: /* cmd ::= DROP VIEW ifexists fullname */
108486 #line 389 "parse.y"
108487 {
108488 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
108489 }
108490 #line 2503 "parse.c"
108491 break;
108492 case 112: /* cmd ::= select */
108493 #line 396 "parse.y"
108494 {
108495 SelectDest dest = {SRT_Output, 0, 0, 0, 0};
108496 sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
108497 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
108498 }
108499 #line 2512 "parse.c"
108500 break;
108501 case 113: /* select ::= oneselect */
108502 #line 407 "parse.y"
108503 {yygotominor.yy387 = yymsp[0].minor.yy387;}
108504 #line 2517 "parse.c"
108505 break;
108506 case 114: /* select ::= select multiselect_op oneselect */
108507 #line 409 "parse.y"
108508 {
108509 if( yymsp[0].minor.yy387 ){
108510 yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
108511 yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
108512 }else{
108513 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
108514 }
108515 yygotominor.yy387 = yymsp[0].minor.yy387;
108516 }
108517 #line 2530 "parse.c"
108518 break;
108519 case 116: /* multiselect_op ::= UNION ALL */
108520 #line 420 "parse.y"
108521 {yygotominor.yy4 = TK_ALL;}
108522 #line 2535 "parse.c"
108523 break;
108524 case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
108525 #line 424 "parse.y"
108526 {
108527 yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset);
108528 }
108529 #line 2542 "parse.c"
108530 break;
108531 case 122: /* sclp ::= selcollist COMMA */
108532 case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247);
108533 #line 445 "parse.y"
108534 {yygotominor.yy322 = yymsp[-1].minor.yy322;}
108535 #line 2548 "parse.c"
108536 break;
108537 case 123: /* sclp ::= */
108538 case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151);
108539 case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159);
108540 case 240: /* exprlist ::= */ yytestcase(yyruleno==240);
108541 case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246);
108542 #line 446 "parse.y"
108543 {yygotominor.yy322 = 0;}
108544 #line 2557 "parse.c"
108545 break;
108546 case 124: /* selcollist ::= sclp expr as */
108547 #line 447 "parse.y"
108548 {
108549 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
108550 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
108551 sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
108552 }
108553 #line 2566 "parse.c"
108554 break;
108555 case 125: /* selcollist ::= sclp STAR */
108556 #line 452 "parse.y"
108557 {
108558 Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
108559 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
108560 }
108561 #line 2574 "parse.c"
108562 break;
108563 case 126: /* selcollist ::= sclp nm DOT STAR */
108564 #line 456 "parse.y"
108565 {
108566 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
108567 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108568 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
108569 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
108570 }
108571 #line 2584 "parse.c"
108572 break;
108573 case 129: /* as ::= */
108574 #line 469 "parse.y"
108575 {yygotominor.yy0.n = 0;}
108576 #line 2589 "parse.c"
108577 break;
108578 case 130: /* from ::= */
108579 #line 481 "parse.y"
108580 {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
108581 #line 2594 "parse.c"
108582 break;
108583 case 131: /* from ::= FROM seltablist */
108584 #line 482 "parse.y"
108585 {
108586 yygotominor.yy259 = yymsp[0].minor.yy259;
108587 sqlite3SrcListShiftJoinType(yygotominor.yy259);
108588 }
108589 #line 2602 "parse.c"
108590 break;
108591 case 132: /* stl_prefix ::= seltablist joinop */
108592 #line 490 "parse.y"
108593 {
108594 yygotominor.yy259 = yymsp[-1].minor.yy259;
108595 if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
108596 }
108597 #line 2610 "parse.c"
108598 break;
108599 case 133: /* stl_prefix ::= */
108600 #line 494 "parse.y"
108601 {yygotominor.yy259 = 0;}
108602 #line 2615 "parse.c"
108603 break;
108604 case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
108605 #line 495 "parse.y"
108606 {
108607 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108608 sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
108609 }
108610 #line 2623 "parse.c"
108611 break;
108612 case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
108613 #line 501 "parse.y"
108614 {
108615 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108616 }
108617 #line 2630 "parse.c"
108618 break;
108619 case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
108620 #line 505 "parse.y"
108621 {
108622 if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
108623 yygotominor.yy259 = yymsp[-4].minor.yy259;
108624 }else{
108625 Select *pSubquery;
@@ -108626,260 +108353,180 @@
108626 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
108627 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0);
108628 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108629 }
108630 }
108631 #line 2644 "parse.c"
108632 break;
108633 case 137: /* dbnm ::= */
108634 case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146);
108635 #line 530 "parse.y"
108636 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
108637 #line 2650 "parse.c"
108638 break;
108639 case 139: /* fullname ::= nm dbnm */
108640 #line 535 "parse.y"
108641 {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
108642 #line 2655 "parse.c"
108643 break;
108644 case 140: /* joinop ::= COMMA|JOIN */
108645 #line 539 "parse.y"
108646 { yygotominor.yy4 = JT_INNER; }
108647 #line 2660 "parse.c"
108648 break;
108649 case 141: /* joinop ::= JOIN_KW JOIN */
108650 #line 540 "parse.y"
108651 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
108652 #line 2665 "parse.c"
108653 break;
108654 case 142: /* joinop ::= JOIN_KW nm JOIN */
108655 #line 541 "parse.y"
108656 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
108657 #line 2670 "parse.c"
108658 break;
108659 case 143: /* joinop ::= JOIN_KW nm nm JOIN */
108660 #line 543 "parse.y"
108661 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
108662 #line 2675 "parse.c"
108663 break;
108664 case 144: /* on_opt ::= ON expr */
108665 case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155);
108666 case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162);
108667 case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169);
108668 case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235);
108669 case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237);
108670 #line 547 "parse.y"
108671 {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
108672 #line 2685 "parse.c"
108673 break;
108674 case 145: /* on_opt ::= */
108675 case 161: /* having_opt ::= */ yytestcase(yyruleno==161);
108676 case 168: /* where_opt ::= */ yytestcase(yyruleno==168);
108677 case 236: /* case_else ::= */ yytestcase(yyruleno==236);
108678 case 238: /* case_operand ::= */ yytestcase(yyruleno==238);
108679 #line 548 "parse.y"
108680 {yygotominor.yy314 = 0;}
108681 #line 2694 "parse.c"
108682 break;
108683 case 148: /* indexed_opt ::= NOT INDEXED */
108684 #line 563 "parse.y"
108685 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
108686 #line 2699 "parse.c"
108687 break;
108688 case 149: /* using_opt ::= USING LP inscollist RP */
108689 case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181);
108690 #line 567 "parse.y"
108691 {yygotominor.yy384 = yymsp[-1].minor.yy384;}
108692 #line 2705 "parse.c"
108693 break;
108694 case 150: /* using_opt ::= */
108695 case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180);
108696 #line 568 "parse.y"
108697 {yygotominor.yy384 = 0;}
108698 #line 2711 "parse.c"
108699 break;
108700 case 152: /* orderby_opt ::= ORDER BY sortlist */
108701 case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160);
108702 case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239);
108703 #line 579 "parse.y"
108704 {yygotominor.yy322 = yymsp[0].minor.yy322;}
108705 #line 2718 "parse.c"
108706 break;
108707 case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */
108708 #line 580 "parse.y"
108709 {
108710 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
108711 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108712 }
108713 #line 2726 "parse.c"
108714 break;
108715 case 154: /* sortlist ::= sortitem sortorder */
108716 #line 584 "parse.y"
108717 {
108718 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314);
108719 if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
108720 }
108721 #line 2734 "parse.c"
108722 break;
108723 case 156: /* sortorder ::= ASC */
108724 case 158: /* sortorder ::= */ yytestcase(yyruleno==158);
108725 #line 592 "parse.y"
108726 {yygotominor.yy4 = SQLITE_SO_ASC;}
108727 #line 2740 "parse.c"
108728 break;
108729 case 157: /* sortorder ::= DESC */
108730 #line 593 "parse.y"
108731 {yygotominor.yy4 = SQLITE_SO_DESC;}
108732 #line 2745 "parse.c"
108733 break;
108734 case 163: /* limit_opt ::= */
108735 #line 619 "parse.y"
108736 {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
108737 #line 2750 "parse.c"
108738 break;
108739 case 164: /* limit_opt ::= LIMIT expr */
108740 #line 620 "parse.y"
108741 {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
108742 #line 2755 "parse.c"
108743 break;
108744 case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
108745 #line 622 "parse.y"
108746 {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
108747 #line 2760 "parse.c"
108748 break;
108749 case 166: /* limit_opt ::= LIMIT expr COMMA expr */
108750 #line 624 "parse.y"
108751 {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
108752 #line 2765 "parse.c"
108753 break;
108754 case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
108755 #line 637 "parse.y"
108756 {
108757 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
108758 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
108759 }
108760 #line 2773 "parse.c"
108761 break;
108762 case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
108763 #line 660 "parse.y"
108764 {
108765 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
108766 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
108767 sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
108768 }
108769 #line 2782 "parse.c"
108770 break;
108771 case 171: /* setlist ::= setlist COMMA nm EQ expr */
108772 #line 670 "parse.y"
108773 {
108774 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
108775 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108776 }
108777 #line 2790 "parse.c"
108778 break;
108779 case 172: /* setlist ::= nm EQ expr */
108780 #line 674 "parse.y"
108781 {
108782 yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
108783 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108784 }
108785 #line 2798 "parse.c"
108786 break;
108787 case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
108788 #line 683 "parse.y"
108789 {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);}
108790 #line 2803 "parse.c"
108791 break;
108792 case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
108793 #line 685 "parse.y"
108794 {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
108795 #line 2808 "parse.c"
108796 break;
108797 case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
108798 #line 687 "parse.y"
108799 {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
108800 #line 2813 "parse.c"
108801 break;
108802 case 176: /* insert_cmd ::= INSERT orconf */
108803 #line 690 "parse.y"
108804 {yygotominor.yy210 = yymsp[0].minor.yy210;}
108805 #line 2818 "parse.c"
108806 break;
108807 case 177: /* insert_cmd ::= REPLACE */
108808 #line 691 "parse.y"
108809 {yygotominor.yy210 = OE_Replace;}
108810 #line 2823 "parse.c"
108811 break;
108812 case 178: /* itemlist ::= itemlist COMMA expr */
108813 case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241);
108814 #line 698 "parse.y"
108815 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
108816 #line 2829 "parse.c"
108817 break;
108818 case 179: /* itemlist ::= expr */
108819 case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242);
108820 #line 700 "parse.y"
108821 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
108822 #line 2835 "parse.c"
108823 break;
108824 case 182: /* inscollist ::= inscollist COMMA nm */
108825 #line 710 "parse.y"
108826 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
108827 #line 2840 "parse.c"
108828 break;
108829 case 183: /* inscollist ::= nm */
108830 #line 712 "parse.y"
108831 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
108832 #line 2845 "parse.c"
108833 break;
108834 case 184: /* expr ::= term */
108835 #line 743 "parse.y"
108836 {yygotominor.yy118 = yymsp[0].minor.yy118;}
108837 #line 2850 "parse.c"
108838 break;
108839 case 185: /* expr ::= LP expr RP */
108840 #line 744 "parse.y"
108841 {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
108842 #line 2855 "parse.c"
108843 break;
108844 case 186: /* term ::= NULL */
108845 case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191);
108846 case 192: /* term ::= STRING */ yytestcase(yyruleno==192);
108847 #line 745 "parse.y"
108848 {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
108849 #line 2862 "parse.c"
108850 break;
108851 case 187: /* expr ::= id */
108852 case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188);
108853 #line 746 "parse.y"
108854 {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
108855 #line 2868 "parse.c"
108856 break;
108857 case 189: /* expr ::= nm DOT nm */
108858 #line 748 "parse.y"
108859 {
108860 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108861 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108862 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
108863 spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
108864 }
108865 #line 2878 "parse.c"
108866 break;
108867 case 190: /* expr ::= nm DOT nm DOT nm */
108868 #line 754 "parse.y"
108869 {
108870 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
108871 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108872 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108873 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
108874 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
108875 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108876 }
108877 #line 2890 "parse.c"
108878 break;
108879 case 193: /* expr ::= REGISTER */
108880 #line 764 "parse.y"
108881 {
108882 /* When doing a nested parse, one can include terms in an expression
108883 ** that look like this: #1 #2 ... These terms refer to registers
108884 ** in the virtual machine. #N is the N-th register. */
108885 if( pParse->nested==0 ){
@@ -108889,40 +108536,32 @@
108889 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
108890 if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
108891 }
108892 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108893 }
108894 #line 2907 "parse.c"
108895 break;
108896 case 194: /* expr ::= VARIABLE */
108897 #line 777 "parse.y"
108898 {
108899 spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
108900 sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
108901 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108902 }
108903 #line 2916 "parse.c"
108904 break;
108905 case 195: /* expr ::= expr COLLATE ids */
108906 #line 782 "parse.y"
108907 {
108908 yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
108909 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108910 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108911 }
108912 #line 2925 "parse.c"
108913 break;
108914 case 196: /* expr ::= CAST LP expr AS typetoken RP */
108915 #line 788 "parse.y"
108916 {
108917 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
108918 spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
108919 }
108920 #line 2933 "parse.c"
108921 break;
108922 case 197: /* expr ::= ID LP distinct exprlist RP */
108923 #line 793 "parse.y"
108924 {
108925 if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
108926 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
108927 }
108928 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -108929,59 +108568,47 @@
108929 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108930 if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){
108931 yygotominor.yy118.pExpr->flags |= EP_Distinct;
108932 }
108933 }
108934 #line 2947 "parse.c"
108935 break;
108936 case 198: /* expr ::= ID LP STAR RP */
108937 #line 803 "parse.y"
108938 {
108939 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
108940 spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
108941 }
108942 #line 2955 "parse.c"
108943 break;
108944 case 199: /* term ::= CTIME_KW */
108945 #line 807 "parse.y"
108946 {
108947 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
108948 ** treated as functions that return constants */
108949 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
108950 if( yygotominor.yy118.pExpr ){
108951 yygotominor.yy118.pExpr->op = TK_CONST_FUNC;
108952 }
108953 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108954 }
108955 #line 2968 "parse.c"
108956 break;
108957 case 200: /* expr ::= expr AND expr */
108958 case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201);
108959 case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202);
108960 case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203);
108961 case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204);
108962 case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205);
108963 case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206);
108964 case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207);
108965 #line 834 "parse.y"
108966 {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
108967 #line 2980 "parse.c"
108968 break;
108969 case 208: /* likeop ::= LIKE_KW */
108970 case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210);
108971 #line 847 "parse.y"
108972 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;}
108973 #line 2986 "parse.c"
108974 break;
108975 case 209: /* likeop ::= NOT LIKE_KW */
108976 case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211);
108977 #line 848 "parse.y"
108978 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;}
108979 #line 2992 "parse.c"
108980 break;
108981 case 212: /* expr ::= expr likeop expr */
108982 #line 851 "parse.y"
108983 {
108984 ExprList *pList;
108985 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
108986 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
108987 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
@@ -108988,14 +108615,12 @@
108988 if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108989 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108990 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108991 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108992 }
108993 #line 3006 "parse.c"
108994 break;
108995 case 213: /* expr ::= expr likeop expr ESCAPE expr */
108996 #line 861 "parse.y"
108997 {
108998 ExprList *pList;
108999 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
109000 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
109001 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
@@ -109003,56 +108628,40 @@
109003 if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
109004 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
109005 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
109006 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
109007 }
109008 #line 3021 "parse.c"
109009 break;
109010 case 214: /* expr ::= expr ISNULL|NOTNULL */
109011 #line 889 "parse.y"
109012 {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
109013 #line 3026 "parse.c"
109014 break;
109015 case 215: /* expr ::= expr NOT NULL */
109016 #line 890 "parse.y"
109017 {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
109018 #line 3031 "parse.c"
109019 break;
109020 case 216: /* expr ::= expr IS expr */
109021 #line 911 "parse.y"
109022 {
109023 spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
109024 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
109025 }
109026 #line 3039 "parse.c"
109027 break;
109028 case 217: /* expr ::= expr IS NOT expr */
109029 #line 915 "parse.y"
109030 {
109031 spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
109032 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
109033 }
109034 #line 3047 "parse.c"
109035 break;
109036 case 218: /* expr ::= NOT expr */
109037 case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219);
109038 #line 938 "parse.y"
109039 {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
109040 #line 3053 "parse.c"
109041 break;
109042 case 220: /* expr ::= MINUS expr */
109043 #line 941 "parse.y"
109044 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
109045 #line 3058 "parse.c"
109046 break;
109047 case 221: /* expr ::= PLUS expr */
109048 #line 943 "parse.y"
109049 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
109050 #line 3063 "parse.c"
109051 break;
109052 case 224: /* expr ::= expr between_op expr AND expr */
109053 #line 948 "parse.y"
109054 {
109055 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
109056 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
109057 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
109058 if( yygotominor.yy118.pExpr ){
@@ -109062,14 +108671,12 @@
109062 }
109063 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
109064 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
109065 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
109066 }
109067 #line 3080 "parse.c"
109068 break;
109069 case 227: /* expr ::= expr in_op LP exprlist RP */
109070 #line 965 "parse.y"
109071 {
109072 if( yymsp[-1].minor.yy322==0 ){
109073 /* Expressions of the form
109074 **
109075 ** expr1 IN ()
@@ -109091,14 +108698,12 @@
109091 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
109092 }
109093 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
109094 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109095 }
109096 #line 3109 "parse.c"
109097 break;
109098 case 228: /* expr ::= LP select RP */
109099 #line 990 "parse.y"
109100 {
109101 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
109102 if( yygotominor.yy118.pExpr ){
109103 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
109104 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -109107,14 +108712,12 @@
109107 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
109108 }
109109 yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
109110 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109111 }
109112 #line 3125 "parse.c"
109113 break;
109114 case 229: /* expr ::= expr in_op LP select RP */
109115 #line 1002 "parse.y"
109116 {
109117 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
109118 if( yygotominor.yy118.pExpr ){
109119 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
109120 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -109124,14 +108727,12 @@
109124 }
109125 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
109126 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
109127 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109128 }
109129 #line 3142 "parse.c"
109130 break;
109131 case 230: /* expr ::= expr in_op nm dbnm */
109132 #line 1015 "parse.y"
109133 {
109134 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
109135 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
109136 if( yygotominor.yy118.pExpr ){
109137 yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
@@ -109142,14 +108743,12 @@
109142 }
109143 if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
109144 yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
109145 yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
109146 }
109147 #line 3160 "parse.c"
109148 break;
109149 case 231: /* expr ::= EXISTS LP select RP */
109150 #line 1029 "parse.y"
109151 {
109152 Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
109153 if( p ){
109154 p->x.pSelect = yymsp[-1].minor.yy387;
109155 ExprSetProperty(p, EP_xIsSelect);
@@ -109158,14 +108757,12 @@
109158 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
109159 }
109160 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
109161 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109162 }
109163 #line 3176 "parse.c"
109164 break;
109165 case 232: /* expr ::= CASE case_operand case_exprlist case_else END */
109166 #line 1044 "parse.y"
109167 {
109168 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0);
109169 if( yygotominor.yy118.pExpr ){
109170 yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322;
109171 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
@@ -109173,50 +108770,38 @@
109173 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
109174 }
109175 yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
109176 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109177 }
109178 #line 3191 "parse.c"
109179 break;
109180 case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
109181 #line 1057 "parse.y"
109182 {
109183 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
109184 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
109185 }
109186 #line 3199 "parse.c"
109187 break;
109188 case 234: /* case_exprlist ::= WHEN expr THEN expr */
109189 #line 1061 "parse.y"
109190 {
109191 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
109192 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
109193 }
109194 #line 3207 "parse.c"
109195 break;
109196 case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
109197 #line 1090 "parse.y"
109198 {
109199 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0,
109200 sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
109201 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4);
109202 }
109203 #line 3216 "parse.c"
109204 break;
109205 case 244: /* uniqueflag ::= UNIQUE */
109206 case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
109207 #line 1097 "parse.y"
109208 {yygotominor.yy4 = OE_Abort;}
109209 #line 3222 "parse.c"
109210 break;
109211 case 245: /* uniqueflag ::= */
109212 #line 1098 "parse.y"
109213 {yygotominor.yy4 = OE_None;}
109214 #line 3227 "parse.c"
109215 break;
109216 case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */
109217 #line 1107 "parse.y"
109218 {
109219 Expr *p = 0;
109220 if( yymsp[-1].minor.yy0.n>0 ){
109221 p = sqlite3Expr(pParse->db, TK_COLUMN, 0);
109222 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -109224,14 +108809,12 @@
109224 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
109225 sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
109226 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
109227 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
109228 }
109229 #line 3242 "parse.c"
109230 break;
109231 case 249: /* idxlist ::= nm collate sortorder */
109232 #line 1118 "parse.y"
109233 {
109234 Expr *p = 0;
109235 if( yymsp[-1].minor.yy0.n>0 ){
109236 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
109237 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -109239,307 +108822,214 @@
109239 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
109240 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
109241 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
109242 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
109243 }
109244 #line 3257 "parse.c"
109245 break;
109246 case 250: /* collate ::= */
109247 #line 1131 "parse.y"
109248 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
109249 #line 3262 "parse.c"
109250 break;
109251 case 252: /* cmd ::= DROP INDEX ifexists fullname */
109252 #line 1137 "parse.y"
109253 {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
109254 #line 3267 "parse.c"
109255 break;
109256 case 253: /* cmd ::= VACUUM */
109257 case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254);
109258 #line 1143 "parse.y"
109259 {sqlite3Vacuum(pParse);}
109260 #line 3273 "parse.c"
109261 break;
109262 case 255: /* cmd ::= PRAGMA nm dbnm */
109263 #line 1151 "parse.y"
109264 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
109265 #line 3278 "parse.c"
109266 break;
109267 case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
109268 #line 1152 "parse.y"
109269 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
109270 #line 3283 "parse.c"
109271 break;
109272 case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
109273 #line 1153 "parse.y"
109274 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
109275 #line 3288 "parse.c"
109276 break;
109277 case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
109278 #line 1155 "parse.y"
109279 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
109280 #line 3293 "parse.c"
109281 break;
109282 case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
109283 #line 1157 "parse.y"
109284 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
109285 #line 3298 "parse.c"
109286 break;
109287 case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
109288 #line 1175 "parse.y"
109289 {
109290 Token all;
109291 all.z = yymsp[-3].minor.yy0.z;
109292 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
109293 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
109294 }
109295 #line 3308 "parse.c"
109296 break;
109297 case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
109298 #line 1184 "parse.y"
109299 {
109300 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4);
109301 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
109302 }
109303 #line 3316 "parse.c"
109304 break;
109305 case 272: /* trigger_time ::= BEFORE */
109306 case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
109307 #line 1190 "parse.y"
109308 { yygotominor.yy4 = TK_BEFORE; }
109309 #line 3322 "parse.c"
109310 break;
109311 case 273: /* trigger_time ::= AFTER */
109312 #line 1191 "parse.y"
109313 { yygotominor.yy4 = TK_AFTER; }
109314 #line 3327 "parse.c"
109315 break;
109316 case 274: /* trigger_time ::= INSTEAD OF */
109317 #line 1192 "parse.y"
109318 { yygotominor.yy4 = TK_INSTEAD;}
109319 #line 3332 "parse.c"
109320 break;
109321 case 276: /* trigger_event ::= DELETE|INSERT */
109322 case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
109323 #line 1197 "parse.y"
109324 {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
109325 #line 3338 "parse.c"
109326 break;
109327 case 278: /* trigger_event ::= UPDATE OF inscollist */
109328 #line 1199 "parse.y"
109329 {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
109330 #line 3343 "parse.c"
109331 break;
109332 case 281: /* when_clause ::= */
109333 case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
109334 #line 1206 "parse.y"
109335 { yygotominor.yy314 = 0; }
109336 #line 3349 "parse.c"
109337 break;
109338 case 282: /* when_clause ::= WHEN expr */
109339 case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
109340 #line 1207 "parse.y"
109341 { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
109342 #line 3355 "parse.c"
109343 break;
109344 case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
109345 #line 1211 "parse.y"
109346 {
109347 assert( yymsp[-2].minor.yy203!=0 );
109348 yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
109349 yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
109350 yygotominor.yy203 = yymsp[-2].minor.yy203;
109351 }
109352 #line 3365 "parse.c"
109353 break;
109354 case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
109355 #line 1217 "parse.y"
109356 {
109357 assert( yymsp[-1].minor.yy203!=0 );
109358 yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
109359 yygotominor.yy203 = yymsp[-1].minor.yy203;
109360 }
109361 #line 3374 "parse.c"
109362 break;
109363 case 286: /* trnm ::= nm DOT nm */
109364 #line 1229 "parse.y"
109365 {
109366 yygotominor.yy0 = yymsp[0].minor.yy0;
109367 sqlite3ErrorMsg(pParse,
109368 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
109369 "statements within triggers");
109370 }
109371 #line 3384 "parse.c"
109372 break;
109373 case 288: /* tridxby ::= INDEXED BY nm */
109374 #line 1241 "parse.y"
109375 {
109376 sqlite3ErrorMsg(pParse,
109377 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
109378 "within triggers");
109379 }
109380 #line 3393 "parse.c"
109381 break;
109382 case 289: /* tridxby ::= NOT INDEXED */
109383 #line 1246 "parse.y"
109384 {
109385 sqlite3ErrorMsg(pParse,
109386 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
109387 "within triggers");
109388 }
109389 #line 3402 "parse.c"
109390 break;
109391 case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
109392 #line 1259 "parse.y"
109393 { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
109394 #line 3407 "parse.c"
109395 break;
109396 case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */
109397 #line 1264 "parse.y"
109398 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);}
109399 #line 3412 "parse.c"
109400 break;
109401 case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
109402 #line 1267 "parse.y"
109403 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
109404 #line 3417 "parse.c"
109405 break;
109406 case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
109407 #line 1271 "parse.y"
109408 {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
109409 #line 3422 "parse.c"
109410 break;
109411 case 294: /* trigger_cmd ::= select */
109412 #line 1274 "parse.y"
109413 {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
109414 #line 3427 "parse.c"
109415 break;
109416 case 295: /* expr ::= RAISE LP IGNORE RP */
109417 #line 1277 "parse.y"
109418 {
109419 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
109420 if( yygotominor.yy118.pExpr ){
109421 yygotominor.yy118.pExpr->affinity = OE_Ignore;
109422 }
109423 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
109424 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109425 }
109426 #line 3439 "parse.c"
109427 break;
109428 case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
109429 #line 1285 "parse.y"
109430 {
109431 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
109432 if( yygotominor.yy118.pExpr ) {
109433 yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
109434 }
109435 yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
109436 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
109437 }
109438 #line 3451 "parse.c"
109439 break;
109440 case 297: /* raisetype ::= ROLLBACK */
109441 #line 1296 "parse.y"
109442 {yygotominor.yy4 = OE_Rollback;}
109443 #line 3456 "parse.c"
109444 break;
109445 case 299: /* raisetype ::= FAIL */
109446 #line 1298 "parse.y"
109447 {yygotominor.yy4 = OE_Fail;}
109448 #line 3461 "parse.c"
109449 break;
109450 case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
109451 #line 1303 "parse.y"
109452 {
109453 sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
109454 }
109455 #line 3468 "parse.c"
109456 break;
109457 case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
109458 #line 1310 "parse.y"
109459 {
109460 sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
109461 }
109462 #line 3475 "parse.c"
109463 break;
109464 case 302: /* cmd ::= DETACH database_kw_opt expr */
109465 #line 1313 "parse.y"
109466 {
109467 sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
109468 }
109469 #line 3482 "parse.c"
109470 break;
109471 case 307: /* cmd ::= REINDEX */
109472 #line 1328 "parse.y"
109473 {sqlite3Reindex(pParse, 0, 0);}
109474 #line 3487 "parse.c"
109475 break;
109476 case 308: /* cmd ::= REINDEX nm dbnm */
109477 #line 1329 "parse.y"
109478 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109479 #line 3492 "parse.c"
109480 break;
109481 case 309: /* cmd ::= ANALYZE */
109482 #line 1334 "parse.y"
109483 {sqlite3Analyze(pParse, 0, 0);}
109484 #line 3497 "parse.c"
109485 break;
109486 case 310: /* cmd ::= ANALYZE nm dbnm */
109487 #line 1335 "parse.y"
109488 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
109489 #line 3502 "parse.c"
109490 break;
109491 case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
109492 #line 1340 "parse.y"
109493 {
109494 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
109495 }
109496 #line 3509 "parse.c"
109497 break;
109498 case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
109499 #line 1343 "parse.y"
109500 {
109501 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
109502 }
109503 #line 3516 "parse.c"
109504 break;
109505 case 313: /* add_column_fullname ::= fullname */
109506 #line 1346 "parse.y"
109507 {
109508 pParse->db->lookaside.bEnabled = 0;
109509 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
109510 }
109511 #line 3524 "parse.c"
109512 break;
109513 case 316: /* cmd ::= create_vtab */
109514 #line 1356 "parse.y"
109515 {sqlite3VtabFinishParse(pParse,0);}
109516 #line 3529 "parse.c"
109517 break;
109518 case 317: /* cmd ::= create_vtab LP vtabarglist RP */
109519 #line 1357 "parse.y"
109520 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
109521 #line 3534 "parse.c"
109522 break;
109523 case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */
109524 #line 1358 "parse.y"
109525 {
109526 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
109527 }
109528 #line 3541 "parse.c"
109529 break;
109530 case 321: /* vtabarg ::= */
109531 #line 1363 "parse.y"
109532 {sqlite3VtabArgInit(pParse);}
109533 #line 3546 "parse.c"
109534 break;
109535 case 323: /* vtabargtoken ::= ANY */
109536 case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
109537 case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
109538 #line 1365 "parse.y"
109539 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
109540 #line 3553 "parse.c"
109541 break;
109542 default:
109543 /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
109544 /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
109545 /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -109637,17 +109127,15 @@
109637 int yymajor, /* The major type of the error token */
109638 YYMINORTYPE yyminor /* The minor type of the error token */
109639 ){
109640 sqlite3ParserARG_FETCH;
109641 #define TOKEN (yyminor.yy0)
109642 #line 32 "parse.y"
109643
109644 UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
109645 assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
109646 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
109647 pParse->parseError = 1;
109648 #line 3661 "parse.c"
109649 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
109650 }
109651
109652 /*
109653 ** The following is executed when the parser accepts
@@ -109837,11 +109325,10 @@
109837 return;
109838 }
109839
109840 /************** End of parse.c ***********************************************/
109841 /************** Begin file tokenize.c ****************************************/
109842 #line 1 "tsrc/tokenize.c"
109843 /*
109844 ** 2001 September 15
109845 **
109846 ** The author disclaims copyright to this source code. In place of
109847 ** a legal notice, here is a blessing:
@@ -109903,11 +109390,10 @@
109903 ** named keywordhash.h and then included into this source file by
109904 ** the #include below.
109905 */
109906 /************** Include keywordhash.h in the middle of tokenize.c ************/
109907 /************** Begin file keywordhash.h *************************************/
109908 #line 1 "tsrc/keywordhash.h"
109909 /***** This file contains automatically generated code ******
109910 **
109911 ** The code in this file has been automatically generated by
109912 **
109913 ** sqlite/tool/mkkeywordhash.c
@@ -110177,11 +109663,10 @@
110177 }
110178 #define SQLITE_N_KEYWORD 121
110179
110180 /************** End of keywordhash.h *****************************************/
110181 /************** Continuing where we left off in tokenize.c *******************/
110182 #line 66 "tsrc/tokenize.c"
110183
110184
110185 /*
110186 ** If X is a character that can be used in an identifier then
110187 ** IdChar(X) will be true. Otherwise it is false.
@@ -110642,11 +110127,10 @@
110642 return nErr;
110643 }
110644
110645 /************** End of tokenize.c ********************************************/
110646 /************** Begin file complete.c ****************************************/
110647 #line 1 "tsrc/complete.c"
110648 /*
110649 ** 2001 September 15
110650 **
110651 ** The author disclaims copyright to this source code. In place of
110652 ** a legal notice, here is a blessing:
@@ -110928,11 +110412,10 @@
110928 #endif /* SQLITE_OMIT_UTF16 */
110929 #endif /* SQLITE_OMIT_COMPLETE */
110930
110931 /************** End of complete.c ********************************************/
110932 /************** Begin file main.c ********************************************/
110933 #line 1 "tsrc/main.c"
110934 /*
110935 ** 2001 September 15
110936 **
110937 ** The author disclaims copyright to this source code. In place of
110938 ** a legal notice, here is a blessing:
@@ -110949,11 +110432,10 @@
110949 */
110950
110951 #ifdef SQLITE_ENABLE_FTS3
110952 /************** Include fts3.h in the middle of main.c ***********************/
110953 /************** Begin file fts3.h ********************************************/
110954 #line 1 "tsrc/fts3.h"
110955 /*
110956 ** 2006 Oct 10
110957 **
110958 ** The author disclaims copyright to this source code. In place of
110959 ** a legal notice, here is a blessing:
@@ -110978,16 +110460,14 @@
110978 } /* extern "C" */
110979 #endif /* __cplusplus */
110980
110981 /************** End of fts3.h ************************************************/
110982 /************** Continuing where we left off in main.c ***********************/
110983 #line 21 "tsrc/main.c"
110984 #endif
110985 #ifdef SQLITE_ENABLE_RTREE
110986 /************** Include rtree.h in the middle of main.c **********************/
110987 /************** Begin file rtree.h *******************************************/
110988 #line 1 "tsrc/rtree.h"
110989 /*
110990 ** 2008 May 26
110991 **
110992 ** The author disclaims copyright to this source code. In place of
110993 ** a legal notice, here is a blessing:
@@ -111012,16 +110492,14 @@
111012 } /* extern "C" */
111013 #endif /* __cplusplus */
111014
111015 /************** End of rtree.h ***********************************************/
111016 /************** Continuing where we left off in main.c ***********************/
111017 #line 24 "tsrc/main.c"
111018 #endif
111019 #ifdef SQLITE_ENABLE_ICU
111020 /************** Include sqliteicu.h in the middle of main.c ******************/
111021 /************** Begin file sqliteicu.h ***************************************/
111022 #line 1 "tsrc/sqliteicu.h"
111023 /*
111024 ** 2008 May 26
111025 **
111026 ** The author disclaims copyright to this source code. In place of
111027 ** a legal notice, here is a blessing:
@@ -111047,11 +110525,10 @@
111047 #endif /* __cplusplus */
111048
111049
111050 /************** End of sqliteicu.h *******************************************/
111051 /************** Continuing where we left off in main.c ***********************/
111052 #line 27 "tsrc/main.c"
111053 #endif
111054
111055 #ifndef SQLITE_AMALGAMATION
111056 /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
111057 ** contains the text of SQLITE_VERSION macro.
@@ -113978,11 +113455,10 @@
113978 return 0;
113979 }
113980
113981 /************** End of main.c ************************************************/
113982 /************** Begin file notify.c ******************************************/
113983 #line 1 "tsrc/notify.c"
113984 /*
113985 ** 2009 March 3
113986 **
113987 ** The author disclaims copyright to this source code. In place of
113988 ** a legal notice, here is a blessing:
@@ -114312,11 +113788,10 @@
114312 }
114313 #endif
114314
114315 /************** End of notify.c **********************************************/
114316 /************** Begin file fts3.c ********************************************/
114317 #line 1 "tsrc/fts3.c"
114318 /*
114319 ** 2006 Oct 10
114320 **
114321 ** The author disclaims copyright to this source code. In place of
114322 ** a legal notice, here is a blessing:
@@ -114609,11 +114084,10 @@
114609 ** into a single segment.
114610 */
114611
114612 /************** Include fts3Int.h in the middle of fts3.c ********************/
114613 /************** Begin file fts3Int.h *****************************************/
114614 #line 1 "tsrc/fts3Int.h"
114615 /*
114616 ** 2009 Nov 12
114617 **
114618 ** The author disclaims copyright to this source code. In place of
114619 ** a legal notice, here is a blessing:
@@ -114648,11 +114122,10 @@
114648 SQLITE_API extern const sqlite3_api_routines *sqlite3_api;
114649 #endif
114650
114651 /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
114652 /************** Begin file fts3_tokenizer.h **********************************/
114653 #line 1 "tsrc/fts3_tokenizer.h"
114654 /*
114655 ** 2006 July 10
114656 **
114657 ** The author disclaims copyright to this source code.
114658 **
@@ -114803,14 +114276,12 @@
114803
114804 #endif /* _FTS3_TOKENIZER_H_ */
114805
114806 /************** End of fts3_tokenizer.h **************************************/
114807 /************** Continuing where we left off in fts3Int.h ********************/
114808 #line 40 "tsrc/fts3Int.h"
114809 /************** Include fts3_hash.h in the middle of fts3Int.h ***************/
114810 /************** Begin file fts3_hash.h ***************************************/
114811 #line 1 "tsrc/fts3_hash.h"
114812 /*
114813 ** 2001 September 22
114814 **
114815 ** The author disclaims copyright to this source code. In place of
114816 ** a legal notice, here is a blessing:
@@ -114922,11 +114393,10 @@
114922
114923 #endif /* _FTS3_HASH_H_ */
114924
114925 /************** End of fts3_hash.h *******************************************/
114926 /************** Continuing where we left off in fts3Int.h ********************/
114927 #line 41 "tsrc/fts3Int.h"
114928
114929 /*
114930 ** This constant controls how often segments are merged. Once there are
114931 ** FTS3_MERGE_COUNT segments of level N, they are merged into a single
114932 ** segment of level N+1.
@@ -115399,11 +114869,10 @@
115399 #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
115400 #endif /* _FTSINT_H */
115401
115402 /************** End of fts3Int.h *********************************************/
115403 /************** Continuing where we left off in fts3.c ***********************/
115404 #line 296 "tsrc/fts3.c"
115405 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
115406
115407 #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
115408 # define SQLITE_CORE 1
115409 #endif
@@ -119949,11 +119418,10 @@
119949
119950 #endif
119951
119952 /************** End of fts3.c ************************************************/
119953 /************** Begin file fts3_aux.c ****************************************/
119954 #line 1 "tsrc/fts3_aux.c"
119955 /*
119956 ** 2011 Jan 27
119957 **
119958 ** The author disclaims copyright to this source code. In place of
119959 ** a legal notice, here is a blessing:
@@ -120426,11 +119894,10 @@
120426
120427 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120428
120429 /************** End of fts3_aux.c ********************************************/
120430 /************** Begin file fts3_expr.c ***************************************/
120431 #line 1 "tsrc/fts3_expr.c"
120432 /*
120433 ** 2008 Nov 28
120434 **
120435 ** The author disclaims copyright to this source code. In place of
120436 ** a legal notice, here is a blessing:
@@ -121393,11 +120860,10 @@
121393 #endif
121394 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121395
121396 /************** End of fts3_expr.c *******************************************/
121397 /************** Begin file fts3_hash.c ***************************************/
121398 #line 1 "tsrc/fts3_hash.c"
121399 /*
121400 ** 2001 September 22
121401 **
121402 ** The author disclaims copyright to this source code. In place of
121403 ** a legal notice, here is a blessing:
@@ -121778,11 +121244,10 @@
121778
121779 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121780
121781 /************** End of fts3_hash.c *******************************************/
121782 /************** Begin file fts3_porter.c *************************************/
121783 #line 1 "tsrc/fts3_porter.c"
121784 /*
121785 ** 2006 September 30
121786 **
121787 ** The author disclaims copyright to this source code. In place of
121788 ** a legal notice, here is a blessing:
@@ -122425,11 +121890,10 @@
122425
122426 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122427
122428 /************** End of fts3_porter.c *****************************************/
122429 /************** Begin file fts3_tokenizer.c **********************************/
122430 #line 1 "tsrc/fts3_tokenizer.c"
122431 /*
122432 ** 2007 June 22
122433 **
122434 ** The author disclaims copyright to this source code. In place of
122435 ** a legal notice, here is a blessing:
@@ -122917,11 +122381,10 @@
122917
122918 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122919
122920 /************** End of fts3_tokenizer.c **************************************/
122921 /************** Begin file fts3_tokenizer1.c *********************************/
122922 #line 1 "tsrc/fts3_tokenizer1.c"
122923 /*
122924 ** 2006 Oct 10
122925 **
122926 ** The author disclaims copyright to this source code. In place of
122927 ** a legal notice, here is a blessing:
@@ -123152,11 +122615,10 @@
123152
123153 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
123154
123155 /************** End of fts3_tokenizer1.c *************************************/
123156 /************** Begin file fts3_write.c **************************************/
123157 #line 1 "tsrc/fts3_write.c"
123158 /*
123159 ** 2009 Oct 23
123160 **
123161 ** The author disclaims copyright to this source code. In place of
123162 ** a legal notice, here is a blessing:
@@ -126423,11 +125885,10 @@
126423
126424 #endif
126425
126426 /************** End of fts3_write.c ******************************************/
126427 /************** Begin file fts3_snippet.c ************************************/
126428 #line 1 "tsrc/fts3_snippet.c"
126429 /*
126430 ** 2009 Oct 23
126431 **
126432 ** The author disclaims copyright to this source code. In place of
126433 ** a legal notice, here is a blessing:
@@ -127925,11 +127386,10 @@
127925
127926 #endif
127927
127928 /************** End of fts3_snippet.c ****************************************/
127929 /************** Begin file rtree.c *******************************************/
127930 #line 1 "tsrc/rtree.c"
127931 /*
127932 ** 2001 September 15
127933 **
127934 ** The author disclaims copyright to this source code. In place of
127935 ** a legal notice, here is a blessing:
@@ -131207,11 +130667,10 @@
131207
131208 #endif
131209
131210 /************** End of rtree.c ***********************************************/
131211 /************** Begin file icu.c *********************************************/
131212 #line 1 "tsrc/icu.c"
131213 /*
131214 ** 2007 May 6
131215 **
131216 ** The author disclaims copyright to this source code. In place of
131217 ** a legal notice, here is a blessing:
@@ -131710,11 +131169,10 @@
131710
131711 #endif
131712
131713 /************** End of icu.c *************************************************/
131714 /************** Begin file fts3_icu.c ****************************************/
131715 #line 1 "tsrc/fts3_icu.c"
131716 /*
131717 ** 2007 June 22
131718 **
131719 ** The author disclaims copyright to this source code. In place of
131720 ** a legal notice, here is a blessing:
131721
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -24,11 +24,10 @@
24 #endif
25 #ifndef SQLITE_API
26 # define SQLITE_API
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:
@@ -79,11 +78,10 @@
78 #include "config.h"
79 #endif
80
81 /************** Include sqliteLimit.h in the middle of sqliteInt.h ***********/
82 /************** Begin file sqliteLimit.h *************************************/
 
83 /*
84 ** 2007 May 7
85 **
86 ** The author disclaims copyright to this source code. In place of
87 ** a legal notice, here is a blessing:
@@ -291,11 +289,10 @@
289 # define SQLITE_MAX_TRIGGER_DEPTH 1000
290 #endif
291
292 /************** End of sqliteLimit.h *****************************************/
293 /************** Continuing where we left off in sqliteInt.h ******************/
 
294
295 /* Disable nuisance warnings on Borland compilers */
296 #if defined(__BORLANDC__)
297 #pragma warn -rch /* unreachable code */
298 #pragma warn -ccc /* Condition is always true or false */
@@ -548,11 +545,10 @@
545 # define unlikely(X) !!(X)
546 #endif
547
548 /************** Include sqlite3.h in the middle of sqliteInt.h ***************/
549 /************** Begin file sqlite3.h *****************************************/
 
550 /*
551 ** 2001 September 15
552 **
553 ** The author disclaims copyright to this source code. In place of
554 ** a legal notice, here is a blessing:
@@ -660,11 +656,11 @@
656 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
657 ** [sqlite_version()] and [sqlite_source_id()].
658 */
659 #define SQLITE_VERSION "3.7.9"
660 #define SQLITE_VERSION_NUMBER 3007009
661 #define SQLITE_SOURCE_ID "2011-10-11 20:41:54 b94a80a832777f0e639f6a81fcfe169bf970a8c0"
662
663 /*
664 ** CAPI3REF: Run-Time Library Version Numbers
665 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
666 **
@@ -6380,17 +6376,17 @@
6376 ** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0.
6377 ** </dd>
6378 **
6379 ** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(<dt>SQLITE_DBSTATUS_CACHE_HIT</dt>
6380 ** <dd>This parameter returns the number of pager cache hits that have
6381 ** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT
6382 ** is always 0.
6383 ** </dd>
6384 **
6385 ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt>
6386 ** <dd>This parameter returns the number of pager cache misses that have
6387 ** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS
6388 ** is always 0.
6389 ** </dd>
6390 ** </dl>
6391 */
6392 #define SQLITE_DBSTATUS_LOOKASIDE_USED 0
@@ -7333,14 +7329,12 @@
7329 #endif /* ifndef _SQLITE3RTREE_H_ */
7330
7331
7332 /************** End of sqlite3.h *********************************************/
7333 /************** Continuing where we left off in sqliteInt.h ******************/
 
7334 /************** Include hash.h in the middle of sqliteInt.h ******************/
7335 /************** Begin file hash.h ********************************************/
 
7336 /*
7337 ** 2001 September 22
7338 **
7339 ** The author disclaims copyright to this source code. In place of
7340 ** a legal notice, here is a blessing:
@@ -7436,14 +7430,12 @@
7430
7431 #endif /* _SQLITE_HASH_H_ */
7432
7433 /************** End of hash.h ************************************************/
7434 /************** Continuing where we left off in sqliteInt.h ******************/
 
7435 /************** Include parse.h in the middle of sqliteInt.h *****************/
7436 /************** Begin file parse.h *******************************************/
 
7437 #define TK_SEMI 1
7438 #define TK_EXPLAIN 2
7439 #define TK_QUERY 3
7440 #define TK_PLAN 4
7441 #define TK_BEGIN 5
@@ -7600,11 +7592,10 @@
7592 #define TK_UMINUS 156
7593 #define TK_UPLUS 157
7594
7595 /************** End of parse.h ***********************************************/
7596 /************** Continuing where we left off in sqliteInt.h ******************/
 
7597 #include <stdio.h>
7598 #include <stdlib.h>
7599 #include <string.h>
7600 #include <assert.h>
7601 #include <stddef.h>
@@ -7956,11 +7947,10 @@
7947 ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
7948 ** pointer types (i.e. FuncDef) defined above.
7949 */
7950 /************** Include btree.h in the middle of sqliteInt.h *****************/
7951 /************** Begin file btree.h *******************************************/
 
7952 /*
7953 ** 2001 September 15
7954 **
7955 ** The author disclaims copyright to this source code. In place of
7956 ** a legal notice, here is a blessing:
@@ -8201,14 +8191,12 @@
8191
8192 #endif /* _BTREE_H_ */
8193
8194 /************** End of btree.h ***********************************************/
8195 /************** Continuing where we left off in sqliteInt.h ******************/
 
8196 /************** Include vdbe.h in the middle of sqliteInt.h ******************/
8197 /************** Begin file vdbe.h ********************************************/
 
8198 /*
8199 ** 2001 September 15
8200 **
8201 ** The author disclaims copyright to this source code. In place of
8202 ** a legal notice, here is a blessing:
@@ -8369,11 +8357,10 @@
8357 ** The makefile scans the vdbe.c source file and creates the "opcodes.h"
8358 ** header file that defines a number for each opcode used by the VDBE.
8359 */
8360 /************** Include opcodes.h in the middle of vdbe.h ********************/
8361 /************** Begin file opcodes.h *****************************************/
 
8362 /* Automatically generated. Do not edit */
8363 /* See the mkopcodeh.awk script for details */
8364 #define OP_Goto 1
8365 #define OP_Gosub 2
8366 #define OP_Return 3
@@ -8558,11 +8545,10 @@
8545 /* 136 */ 0x01, 0x00, 0x01, 0x00, 0x00, 0x04, 0x04, 0x04,\
8546 /* 144 */ 0x04, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00,}
8547
8548 /************** End of opcodes.h *********************************************/
8549 /************** Continuing where we left off in vdbe.h ***********************/
 
8550
8551 /*
8552 ** Prototypes for the VDBE interface. See comments on the implementation
8553 ** for a description of what each of these routines does.
8554 */
@@ -8633,14 +8619,12 @@
8619
8620 #endif
8621
8622 /************** End of vdbe.h ************************************************/
8623 /************** Continuing where we left off in sqliteInt.h ******************/
 
8624 /************** Include pager.h in the middle of sqliteInt.h *****************/
8625 /************** Begin file pager.h *******************************************/
 
8626 /*
8627 ** 2001 September 15
8628 **
8629 ** The author disclaims copyright to this source code. In place of
8630 ** a legal notice, here is a blessing:
@@ -8822,14 +8806,12 @@
8806
8807 #endif /* _PAGER_H_ */
8808
8809 /************** End of pager.h ***********************************************/
8810 /************** Continuing where we left off in sqliteInt.h ******************/
 
8811 /************** Include pcache.h in the middle of sqliteInt.h ****************/
8812 /************** Begin file pcache.h ******************************************/
 
8813 /*
8814 ** 2008 August 05
8815 **
8816 ** The author disclaims copyright to this source code. In place of
8817 ** a legal notice, here is a blessing:
@@ -8984,15 +8966,13 @@
8966
8967 #endif /* _PCACHE_H_ */
8968
8969 /************** End of pcache.h **********************************************/
8970 /************** Continuing where we left off in sqliteInt.h ******************/
 
8971
8972 /************** Include os.h in the middle of sqliteInt.h ********************/
8973 /************** Begin file os.h **********************************************/
 
8974 /*
8975 ** 2001 September 16
8976 **
8977 ** The author disclaims copyright to this source code. In place of
8978 ** a legal notice, here is a blessing:
@@ -9271,14 +9251,12 @@
9251
9252 #endif /* _SQLITE_OS_H_ */
9253
9254 /************** End of os.h **************************************************/
9255 /************** Continuing where we left off in sqliteInt.h ******************/
 
9256 /************** Include mutex.h in the middle of sqliteInt.h *****************/
9257 /************** Begin file mutex.h *******************************************/
 
9258 /*
9259 ** 2007 August 28
9260 **
9261 ** The author disclaims copyright to this source code. In place of
9262 ** a legal notice, here is a blessing:
@@ -9349,11 +9327,10 @@
9327 #define sqlite3MutexEnd()
9328 #endif /* defined(SQLITE_MUTEX_OMIT) */
9329
9330 /************** End of mutex.h ***********************************************/
9331 /************** Continuing where we left off in sqliteInt.h ******************/
 
9332
9333
9334 /*
9335 ** Each database file to be accessed by the system is an instance
9336 ** of the following structure. There are normally two of these structures
@@ -11962,11 +11939,10 @@
11939
11940 #endif /* _SQLITEINT_H_ */
11941
11942 /************** End of sqliteInt.h *******************************************/
11943 /************** Begin file global.c ******************************************/
 
11944 /*
11945 ** 2008 June 13
11946 **
11947 ** The author disclaims copyright to this source code. In place of
11948 ** a legal notice, here is a blessing:
@@ -12185,11 +12161,10 @@
12161 */
12162 SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER;
12163
12164 /************** End of global.c **********************************************/
12165 /************** Begin file ctime.c *******************************************/
 
12166 /*
12167 ** 2010 February 23
12168 **
12169 ** The author disclaims copyright to this source code. In place of
12170 ** a legal notice, here is a blessing:
@@ -12590,11 +12565,10 @@
12565
12566 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
12567
12568 /************** End of ctime.c ***********************************************/
12569 /************** Begin file status.c ******************************************/
 
12570 /*
12571 ** 2008 June 18
12572 **
12573 ** The author disclaims copyright to this source code. In place of
12574 ** a legal notice, here is a blessing:
@@ -12608,11 +12582,10 @@
12582 ** This module implements the sqlite3_status() interface and related
12583 ** functionality.
12584 */
12585 /************** Include vdbeInt.h in the middle of status.c ******************/
12586 /************** Begin file vdbeInt.h *****************************************/
 
12587 /*
12588 ** 2003 September 6
12589 **
12590 ** The author disclaims copyright to this source code. In place of
12591 ** a legal notice, here is a blessing:
@@ -13060,11 +13033,10 @@
13033
13034 #endif /* !defined(_VDBEINT_H_) */
13035
13036 /************** End of vdbeInt.h *********************************************/
13037 /************** Continuing where we left off in status.c *********************/
 
13038
13039 /*
13040 ** Variables in which to record status information.
13041 */
13042 typedef struct sqlite3StatType sqlite3StatType;
@@ -13296,11 +13268,10 @@
13268 return rc;
13269 }
13270
13271 /************** End of status.c **********************************************/
13272 /************** Begin file date.c ********************************************/
 
13273 /*
13274 ** 2003 October 31
13275 **
13276 ** The author disclaims copyright to this source code. In place of
13277 ** a legal notice, here is a blessing:
@@ -14424,11 +14395,10 @@
14395 }
14396 }
14397
14398 /************** End of date.c ************************************************/
14399 /************** Begin file os.c **********************************************/
 
14400 /*
14401 ** 2005 November 29
14402 **
14403 ** The author disclaims copyright to this source code. In place of
14404 ** a legal notice, here is a blessing:
@@ -14758,11 +14728,10 @@
14728 return SQLITE_OK;
14729 }
14730
14731 /************** End of os.c **************************************************/
14732 /************** Begin file fault.c *******************************************/
 
14733 /*
14734 ** 2008 Jan 22
14735 **
14736 ** The author disclaims copyright to this source code. In place of
14737 ** a legal notice, here is a blessing:
@@ -14848,11 +14817,10 @@
14817
14818 #endif /* #ifndef SQLITE_OMIT_BUILTIN_TEST */
14819
14820 /************** End of fault.c ***********************************************/
14821 /************** Begin file mem0.c ********************************************/
 
14822 /*
14823 ** 2008 October 28
14824 **
14825 ** The author disclaims copyright to this source code. In place of
14826 ** a legal notice, here is a blessing:
@@ -14910,11 +14878,10 @@
14878
14879 #endif /* SQLITE_ZERO_MALLOC */
14880
14881 /************** End of mem0.c ************************************************/
14882 /************** Begin file mem1.c ********************************************/
 
14883 /*
14884 ** 2007 August 14
14885 **
14886 ** The author disclaims copyright to this source code. In place of
14887 ** a legal notice, here is a blessing:
@@ -15063,11 +15030,10 @@
15030
15031 #endif /* SQLITE_SYSTEM_MALLOC */
15032
15033 /************** End of mem1.c ************************************************/
15034 /************** Begin file mem2.c ********************************************/
 
15035 /*
15036 ** 2007 August 15
15037 **
15038 ** The author disclaims copyright to this source code. In place of
15039 ** a legal notice, here is a blessing:
@@ -15594,11 +15560,10 @@
15560
15561 #endif /* SQLITE_MEMDEBUG */
15562
15563 /************** End of mem2.c ************************************************/
15564 /************** Begin file mem3.c ********************************************/
 
15565 /*
15566 ** 2007 October 14
15567 **
15568 ** The author disclaims copyright to this source code. In place of
15569 ** a legal notice, here is a blessing:
@@ -16284,11 +16249,10 @@
16249
16250 #endif /* SQLITE_ENABLE_MEMSYS3 */
16251
16252 /************** End of mem3.c ************************************************/
16253 /************** Begin file mem5.c ********************************************/
 
16254 /*
16255 ** 2007 October 14
16256 **
16257 ** The author disclaims copyright to this source code. In place of
16258 ** a legal notice, here is a blessing:
@@ -16868,11 +16832,10 @@
16832
16833 #endif /* SQLITE_ENABLE_MEMSYS5 */
16834
16835 /************** End of mem5.c ************************************************/
16836 /************** Begin file mutex.c *******************************************/
 
16837 /*
16838 ** 2007 August 14
16839 **
16840 ** The author disclaims copyright to this source code. In place of
16841 ** a legal notice, here is a blessing:
@@ -17024,11 +16987,10 @@
16987
16988 #endif /* SQLITE_MUTEX_OMIT */
16989
16990 /************** End of mutex.c ***********************************************/
16991 /************** Begin file mutex_noop.c **************************************/
 
16992 /*
16993 ** 2008 October 07
16994 **
16995 ** The author disclaims copyright to this source code. In place of
16996 ** a legal notice, here is a blessing:
@@ -17233,11 +17195,10 @@
17195 #endif /* SQLITE_MUTEX_NOOP */
17196 #endif /* SQLITE_MUTEX_OMIT */
17197
17198 /************** End of mutex_noop.c ******************************************/
17199 /************** Begin file mutex_os2.c ***************************************/
 
17200 /*
17201 ** 2007 August 28
17202 **
17203 ** The author disclaims copyright to this source code. In place of
17204 ** a legal notice, here is a blessing:
@@ -17510,11 +17471,10 @@
17471 }
17472 #endif /* SQLITE_MUTEX_OS2 */
17473
17474 /************** End of mutex_os2.c *******************************************/
17475 /************** Begin file mutex_unix.c **************************************/
 
17476 /*
17477 ** 2007 August 28
17478 **
17479 ** The author disclaims copyright to this source code. In place of
17480 ** a legal notice, here is a blessing:
@@ -17864,11 +17824,10 @@
17824
17825 #endif /* SQLITE_MUTEX_PTHREAD */
17826
17827 /************** End of mutex_unix.c ******************************************/
17828 /************** Begin file mutex_w32.c ***************************************/
 
17829 /*
17830 ** 2007 August 14
17831 **
17832 ** The author disclaims copyright to this source code. In place of
17833 ** a legal notice, here is a blessing:
@@ -18199,11 +18158,10 @@
18158 }
18159 #endif /* SQLITE_MUTEX_W32 */
18160
18161 /************** End of mutex_w32.c *******************************************/
18162 /************** Begin file malloc.c ******************************************/
 
18163 /*
18164 ** 2001 September 15
18165 **
18166 ** The author disclaims copyright to this source code. In place of
18167 ** a legal notice, here is a blessing:
@@ -18979,11 +18937,10 @@
18937 return rc & (db ? db->errMask : 0xff);
18938 }
18939
18940 /************** End of malloc.c **********************************************/
18941 /************** Begin file printf.c ******************************************/
 
18942 /*
18943 ** The "printf" code that follows dates from the 1980's. It is in
18944 ** the public domain. The original comments are included here for
18945 ** completeness. They are very out-of-date but might be useful as
18946 ** an historical reference. Most of the "enhancements" have been backed
@@ -19171,15 +19128,11 @@
19128 /*
19129 ** On machines with a small stack size, you can redefine the
19130 ** SQLITE_PRINT_BUF_SIZE to be less than 350.
19131 */
19132 #ifndef SQLITE_PRINT_BUF_SIZE
19133 # define SQLITE_PRINT_BUF_SIZE 70
 
 
 
 
19134 #endif
19135 #define etBUFSIZE SQLITE_PRINT_BUF_SIZE /* Size of the output buffer */
19136
19137 /*
19138 ** The root program. All variations call this core.
@@ -19231,19 +19184,20 @@
19184 etByte done; /* Loop termination flag */
19185 sqlite_uint64 longvalue; /* Value for integer types */
19186 LONGDOUBLE_TYPE realvalue; /* Value for real types */
19187 const et_info *infop; /* Pointer to the appropriate info structure */
19188 char buf[etBUFSIZE]; /* Conversion buffer */
19189 char *zOut; /* Rendering buffer */
19190 int nOut; /* Size of the rendering buffer */
19191 char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */
19192 etByte xtype = 0; /* Conversion paradigm */
19193 char *zExtra; /* Extra memory used for etTCLESCAPE conversions */
19194 #ifndef SQLITE_OMIT_FLOATING_POINT
19195 int exp, e2; /* exponent of real numbers */
19196 double rounder; /* Used for rounding floating point values */
19197 etByte flag_dp; /* True if decimal point should be shown */
19198 etByte flag_rtz; /* True if trailing zeros should be removed */
 
19199 int nsd; /* Number of significant digits returned */
19200 #endif
19201
19202 length = 0;
19203 bufpt = 0;
@@ -19288,13 +19242,10 @@
19242 while( c>='0' && c<='9' ){
19243 width = width*10 + c - '0';
19244 c = *++fmt;
19245 }
19246 }
 
 
 
19247 /* Get the precision */
19248 if( c=='.' ){
19249 precision = 0;
19250 c = *++fmt;
19251 if( c=='*' ){
@@ -19337,16 +19288,10 @@
19288 break;
19289 }
19290 }
19291 zExtra = 0;
19292
 
 
 
 
 
 
19293 /*
19294 ** At this point, variables are initialized as follows:
19295 **
19296 ** flag_alternateform TRUE if a '#' is present.
19297 ** flag_altform2 TRUE if a '!' is present.
@@ -19407,20 +19352,30 @@
19352 }
19353 if( longvalue==0 ) flag_alternateform = 0;
19354 if( flag_zeropad && precision<width-(prefix!=0) ){
19355 precision = width-(prefix!=0);
19356 }
19357 if( precision<etBUFSIZE-10 ){
19358 nOut = etBUFSIZE;
19359 zOut = buf;
19360 }else{
19361 nOut = precision + 10;
19362 zOut = zExtra = sqlite3Malloc( nOut );
19363 if( zOut==0 ){
19364 pAccum->mallocFailed = 1;
19365 return;
19366 }
19367 }
19368 bufpt = &zOut[nOut-1];
19369 if( xtype==etORDINAL ){
19370 static const char zOrd[] = "thstndrd";
19371 int x = (int)(longvalue % 10);
19372 if( x>=4 || (longvalue/10)%10==1 ){
19373 x = 0;
19374 }
19375 *(--bufpt) = zOrd[x*2+1];
19376 *(--bufpt) = zOrd[x*2];
 
19377 }
19378 {
19379 register const char *cset; /* Use registers for speed */
19380 register int base;
19381 cset = &aDigits[infop->charset];
@@ -19428,11 +19383,11 @@
19383 do{ /* Convert to ascii */
19384 *(--bufpt) = cset[longvalue%base];
19385 longvalue = longvalue/base;
19386 }while( longvalue>0 );
19387 }
19388 length = (int)(&zOut[nOut-1]-bufpt);
19389 for(idx=precision-length; idx>0; idx--){
19390 *(--bufpt) = '0'; /* Zero pad */
19391 }
19392 if( prefix ) *(--bufpt) = prefix; /* Add sign */
19393 if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
@@ -19439,21 +19394,20 @@
19394 const char *pre;
19395 char x;
19396 pre = &aPrefix[infop->prefix];
19397 for(; (x=(*pre))!=0; pre++) *(--bufpt) = x;
19398 }
19399 length = (int)(&zOut[nOut-1]-bufpt);
19400 break;
19401 case etFLOAT:
19402 case etEXP:
19403 case etGENERIC:
19404 realvalue = va_arg(ap,double);
19405 #ifdef SQLITE_OMIT_FLOATING_POINT
19406 length = 0;
19407 #else
19408 if( precision<0 ) precision = 6; /* Set default precision */
 
19409 if( realvalue<0.0 ){
19410 realvalue = -realvalue;
19411 prefix = '-';
19412 }else{
19413 if( flag_plussign ) prefix = '+';
@@ -19497,11 +19451,10 @@
19451 bufpt = buf;
19452 /*
19453 ** If the field type is etGENERIC, then convert to either etEXP
19454 ** or etFLOAT, as appropriate.
19455 */
 
19456 if( xtype!=etFLOAT ){
19457 realvalue += rounder;
19458 if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }
19459 }
19460 if( xtype==etGENERIC ){
@@ -19518,10 +19471,18 @@
19471 if( xtype==etEXP ){
19472 e2 = 0;
19473 }else{
19474 e2 = exp;
19475 }
19476 if( e2+precision+width > etBUFSIZE - 15 ){
19477 bufpt = zExtra = sqlite3Malloc( e2+precision+width+15 );
19478 if( bufpt==0 ){
19479 pAccum->mallocFailed = 1;
19480 return;
19481 }
19482 }
19483 zOut = bufpt;
19484 nsd = 0;
19485 flag_dp = (precision>0 ?1:0) | flag_alternateform | flag_altform2;
19486 /* The sign in front of the number */
19487 if( prefix ){
19488 *(bufpt++) = prefix;
@@ -19549,21 +19510,21 @@
19510 *(bufpt++) = et_getdigit(&realvalue,&nsd);
19511 }
19512 /* Remove trailing zeros and the "." if no digits follow the "." */
19513 if( flag_rtz && flag_dp ){
19514 while( bufpt[-1]=='0' ) *(--bufpt) = 0;
19515 assert( bufpt>zOut );
19516 if( bufpt[-1]=='.' ){
19517 if( flag_altform2 ){
19518 *(bufpt++) = '0';
19519 }else{
19520 *(--bufpt) = 0;
19521 }
19522 }
19523 }
19524 /* Add the "eNNN" suffix */
19525 if( xtype==etEXP ){
19526 *(bufpt++) = aDigits[infop->charset];
19527 if( exp<0 ){
19528 *(bufpt++) = '-'; exp = -exp;
19529 }else{
19530 *(bufpt++) = '+';
@@ -19578,12 +19539,12 @@
19539 *bufpt = 0;
19540
19541 /* The converted number is in buf[] and zero terminated. Output it.
19542 ** Note that the number is in the usual order, not reversed as with
19543 ** integer conversions. */
19544 length = (int)(bufpt-zOut);
19545 bufpt = zOut;
19546
19547 /* Special case: Add leading zeros if the flag_zeropad flag is
19548 ** set and we are not left justified */
19549 if( flag_zeropad && !flag_leftjustify && length < width){
19550 int i;
@@ -19717,13 +19678,11 @@
19678 nspace = width-length;
19679 if( nspace>0 ){
19680 appendSpace(pAccum, nspace);
19681 }
19682 }
19683 sqlite3_free(zExtra);
 
 
19684 }/* End for loop over the format string */
19685 } /* End of function */
19686
19687 /*
19688 ** Append N bytes of text from z to the StrAccum object.
@@ -20011,11 +19970,10 @@
19970 }
19971 #endif
19972
19973 /************** End of printf.c **********************************************/
19974 /************** Begin file random.c ******************************************/
 
19975 /*
19976 ** 2001 September 15
19977 **
19978 ** The author disclaims copyright to this source code. In place of
19979 ** a legal notice, here is a blessing:
@@ -20159,11 +20117,10 @@
20117 }
20118 #endif /* SQLITE_OMIT_BUILTIN_TEST */
20119
20120 /************** End of random.c **********************************************/
20121 /************** Begin file utf.c *********************************************/
 
20122 /*
20123 ** 2004 April 13
20124 **
20125 ** The author disclaims copyright to this source code. In place of
20126 ** a legal notice, here is a blessing:
@@ -20721,11 +20678,10 @@
20678 #endif /* SQLITE_TEST */
20679 #endif /* SQLITE_OMIT_UTF16 */
20680
20681 /************** End of utf.c *************************************************/
20682 /************** Begin file util.c ********************************************/
 
20683 /*
20684 ** 2001 September 15
20685 **
20686 ** The author disclaims copyright to this source code. In place of
20687 ** a legal notice, here is a blessing:
@@ -21904,11 +21860,10 @@
21860 }
21861 #endif
21862
21863 /************** End of util.c ************************************************/
21864 /************** Begin file hash.c ********************************************/
 
21865 /*
21866 ** 2001 September 22
21867 **
21868 ** The author disclaims copyright to this source code. In place of
21869 ** a legal notice, here is a blessing:
@@ -22184,11 +22139,10 @@
22139 return 0;
22140 }
22141
22142 /************** End of hash.c ************************************************/
22143 /************** Begin file opcodes.c *****************************************/
 
22144 /* Automatically generated. Do not edit */
22145 /* See the mkopcodec.awk script for details. */
22146 #if !defined(SQLITE_OMIT_EXPLAIN) || !defined(NDEBUG) || defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
22147 SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
22148 static const char *const azName[] = { "?",
@@ -22347,11 +22301,10 @@
22301 }
22302 #endif
22303
22304 /************** End of opcodes.c *********************************************/
22305 /************** Begin file os_os2.c ******************************************/
 
22306 /*
22307 ** 2006 Feb 14
22308 **
22309 ** The author disclaims copyright to this source code. In place of
22310 ** a legal notice, here is a blessing:
@@ -22404,11 +22357,10 @@
22357 /*
22358 ** Include code that is common to all os_*.c files
22359 */
22360 /************** Include os_common.h in the middle of os_os2.c ****************/
22361 /************** Begin file os_common.h ***************************************/
 
22362 /*
22363 ** 2004 May 22
22364 **
22365 ** The author disclaims copyright to this source code. In place of
22366 ** a legal notice, here is a blessing:
@@ -22458,11 +22410,10 @@
22410 ** hwtime.h contains inline assembler code for implementing
22411 ** high-performance timing routines.
22412 */
22413 /************** Include hwtime.h in the middle of os_common.h ****************/
22414 /************** Begin file hwtime.h ******************************************/
 
22415 /*
22416 ** 2008 May 27
22417 **
22418 ** The author disclaims copyright to this source code. In place of
22419 ** a legal notice, here is a blessing:
@@ -22547,11 +22498,10 @@
22498
22499 #endif /* !defined(_HWTIME_H_) */
22500
22501 /************** End of hwtime.h **********************************************/
22502 /************** Continuing where we left off in os_common.h ******************/
 
22503
22504 static sqlite_uint64 g_start;
22505 static sqlite_uint64 g_elapsed;
22506 #define TIMER_START g_start=sqlite3Hwtime()
22507 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -22614,11 +22564,10 @@
22564
22565 #endif /* !defined(_OS_COMMON_H_) */
22566
22567 /************** End of os_common.h *******************************************/
22568 /************** Continuing where we left off in os_os2.c *********************/
 
22569
22570 /* Forward references */
22571 typedef struct os2File os2File; /* The file structure */
22572 typedef struct os2ShmNode os2ShmNode; /* A shared descritive memory node */
22573 typedef struct os2ShmLink os2ShmLink; /* A connection to shared-memory */
@@ -24486,11 +24435,10 @@
24435
24436 #endif /* SQLITE_OS_OS2 */
24437
24438 /************** End of os_os2.c **********************************************/
24439 /************** Begin file os_unix.c *****************************************/
 
24440 /*
24441 ** 2004 May 22
24442 **
24443 ** The author disclaims copyright to this source code. In place of
24444 ** a legal notice, here is a blessing:
@@ -24751,11 +24699,10 @@
24699 /*
24700 ** Include code that is common to all os_*.c files
24701 */
24702 /************** Include os_common.h in the middle of os_unix.c ***************/
24703 /************** Begin file os_common.h ***************************************/
 
24704 /*
24705 ** 2004 May 22
24706 **
24707 ** The author disclaims copyright to this source code. In place of
24708 ** a legal notice, here is a blessing:
@@ -24805,11 +24752,10 @@
24752 ** hwtime.h contains inline assembler code for implementing
24753 ** high-performance timing routines.
24754 */
24755 /************** Include hwtime.h in the middle of os_common.h ****************/
24756 /************** Begin file hwtime.h ******************************************/
 
24757 /*
24758 ** 2008 May 27
24759 **
24760 ** The author disclaims copyright to this source code. In place of
24761 ** a legal notice, here is a blessing:
@@ -24894,11 +24840,10 @@
24840
24841 #endif /* !defined(_HWTIME_H_) */
24842
24843 /************** End of hwtime.h **********************************************/
24844 /************** Continuing where we left off in os_common.h ******************/
 
24845
24846 static sqlite_uint64 g_start;
24847 static sqlite_uint64 g_elapsed;
24848 #define TIMER_START g_start=sqlite3Hwtime()
24849 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -24961,11 +24906,10 @@
24906
24907 #endif /* !defined(_OS_COMMON_H_) */
24908
24909 /************** End of os_common.h *******************************************/
24910 /************** Continuing where we left off in os_unix.c ********************/
 
24911
24912 /*
24913 ** Define various macros that are missing from some systems.
24914 */
24915 #ifndef O_LARGEFILE
@@ -28554,20 +28498,19 @@
28498 rc = SQLITE_NOMEM;
28499 goto shm_open_err;
28500 }
28501
28502 if( pInode->bProcessLock==0 ){
28503 const char *zRO;
28504 int openFlags = O_RDWR | O_CREAT;
28505 zRO = sqlite3_uri_parameter(pDbFd->zPath, "readonly_shm");
28506 if( zRO && sqlite3GetBoolean(zRO) ){
28507 openFlags = O_RDONLY;
28508 pShmNode->isReadonly = 1;
28509 }
28510 pShmNode->h = robust_open(zShmFilename, openFlags, (sStat.st_mode&0777));
28511 if( pShmNode->h<0 ){
 
 
 
 
 
 
 
28512 if( pShmNode->h<0 ){
28513 rc = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zShmFilename);
28514 goto shm_open_err;
28515 }
28516 }
@@ -31479,11 +31422,10 @@
31422
31423 #endif /* SQLITE_OS_UNIX */
31424
31425 /************** End of os_unix.c *********************************************/
31426 /************** Begin file os_win.c ******************************************/
 
31427 /*
31428 ** 2004 May 22
31429 **
31430 ** The author disclaims copyright to this source code. In place of
31431 ** a legal notice, here is a blessing:
@@ -31541,11 +31483,10 @@
31483 /*
31484 ** Include code that is common to all os_*.c files
31485 */
31486 /************** Include os_common.h in the middle of os_win.c ****************/
31487 /************** Begin file os_common.h ***************************************/
 
31488 /*
31489 ** 2004 May 22
31490 **
31491 ** The author disclaims copyright to this source code. In place of
31492 ** a legal notice, here is a blessing:
@@ -31595,11 +31536,10 @@
31536 ** hwtime.h contains inline assembler code for implementing
31537 ** high-performance timing routines.
31538 */
31539 /************** Include hwtime.h in the middle of os_common.h ****************/
31540 /************** Begin file hwtime.h ******************************************/
 
31541 /*
31542 ** 2008 May 27
31543 **
31544 ** The author disclaims copyright to this source code. In place of
31545 ** a legal notice, here is a blessing:
@@ -31684,11 +31624,10 @@
31624
31625 #endif /* !defined(_HWTIME_H_) */
31626
31627 /************** End of hwtime.h **********************************************/
31628 /************** Continuing where we left off in os_common.h ******************/
 
31629
31630 static sqlite_uint64 g_start;
31631 static sqlite_uint64 g_elapsed;
31632 #define TIMER_START g_start=sqlite3Hwtime()
31633 #define TIMER_END g_elapsed=sqlite3Hwtime()-g_start
@@ -31751,11 +31690,10 @@
31690
31691 #endif /* !defined(_OS_COMMON_H_) */
31692
31693 /************** End of os_common.h *******************************************/
31694 /************** Continuing where we left off in os_win.c *********************/
 
31695
31696 /*
31697 ** Some microsoft compilers lack this definition.
31698 */
31699 #ifndef INVALID_FILE_ATTRIBUTES
@@ -34897,11 +34835,10 @@
34835
34836 #endif /* SQLITE_OS_WIN */
34837
34838 /************** End of os_win.c **********************************************/
34839 /************** Begin file bitvec.c ******************************************/
 
34840 /*
34841 ** 2008 February 16
34842 **
34843 ** The author disclaims copyright to this source code. In place of
34844 ** a legal notice, here is a blessing:
@@ -35308,11 +35245,10 @@
35245 }
35246 #endif /* SQLITE_OMIT_BUILTIN_TEST */
35247
35248 /************** End of bitvec.c **********************************************/
35249 /************** Begin file pcache.c ******************************************/
 
35250 /*
35251 ** 2008 August 05
35252 **
35253 ** The author disclaims copyright to this source code. In place of
35254 ** a legal notice, here is a blessing:
@@ -35905,11 +35841,10 @@
35841 }
35842 #endif
35843
35844 /************** End of pcache.c **********************************************/
35845 /************** Begin file pcache1.c *****************************************/
 
35846 /*
35847 ** 2008 November 05
35848 **
35849 ** The author disclaims copyright to this source code. In place of
35850 ** a legal notice, here is a blessing:
@@ -36880,11 +36815,10 @@
36815 }
36816 #endif
36817
36818 /************** End of pcache1.c *********************************************/
36819 /************** Begin file rowset.c ******************************************/
 
36820 /*
36821 ** 2008 December 3
36822 **
36823 ** The author disclaims copyright to this source code. In place of
36824 ** a legal notice, here is a blessing:
@@ -37305,11 +37239,10 @@
37239 return 0;
37240 }
37241
37242 /************** End of rowset.c **********************************************/
37243 /************** Begin file pager.c *******************************************/
 
37244 /*
37245 ** 2001 September 15
37246 **
37247 ** The author disclaims copyright to this source code. In place of
37248 ** a legal notice, here is a blessing:
@@ -37329,11 +37262,10 @@
37262 ** another is writing.
37263 */
37264 #ifndef SQLITE_OMIT_DISKIO
37265 /************** Include wal.h in the middle of pager.c ***********************/
37266 /************** Begin file wal.h *********************************************/
 
37267 /*
37268 ** 2010 February 1
37269 **
37270 ** The author disclaims copyright to this source code. In place of
37271 ** a legal notice, here is a blessing:
@@ -37454,11 +37386,10 @@
37386 #endif /* ifndef SQLITE_OMIT_WAL */
37387 #endif /* _WAL_H_ */
37388
37389 /************** End of wal.h *************************************************/
37390 /************** Continuing where we left off in pager.c **********************/
 
37391
37392
37393 /******************* NOTES ON THE DESIGN OF THE PAGER ************************
37394 **
37395 ** This comment block describes invariants that hold when using a rollback
@@ -44291,11 +44222,10 @@
44222
44223 #endif /* SQLITE_OMIT_DISKIO */
44224
44225 /************** End of pager.c ***********************************************/
44226 /************** Begin file wal.c *********************************************/
 
44227 /*
44228 ** 2010 February 1
44229 **
44230 ** The author disclaims copyright to this source code. In place of
44231 ** a legal notice, here is a blessing:
@@ -47246,11 +47176,10 @@
47176
47177 #endif /* #ifndef SQLITE_OMIT_WAL */
47178
47179 /************** End of wal.c *************************************************/
47180 /************** Begin file btmutex.c *****************************************/
 
47181 /*
47182 ** 2007 August 27
47183 **
47184 ** The author disclaims copyright to this source code. In place of
47185 ** a legal notice, here is a blessing:
@@ -47266,11 +47195,10 @@
47195 ** big and we want to break it down some. This packaged seemed like
47196 ** a good breakout.
47197 */
47198 /************** Include btreeInt.h in the middle of btmutex.c ****************/
47199 /************** Begin file btreeInt.h ****************************************/
 
47200 /*
47201 ** 2004 April 6
47202 **
47203 ** The author disclaims copyright to this source code. In place of
47204 ** a legal notice, here is a blessing:
@@ -47912,11 +47840,10 @@
47840 #define get4byte sqlite3Get4byte
47841 #define put4byte sqlite3Put4byte
47842
47843 /************** End of btreeInt.h ********************************************/
47844 /************** Continuing where we left off in btmutex.c ********************/
 
47845 #ifndef SQLITE_OMIT_SHARED_CACHE
47846 #if SQLITE_THREADSAFE
47847
47848 /*
47849 ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
@@ -48185,11 +48112,10 @@
48112 #endif /* if SQLITE_THREADSAFE */
48113 #endif /* ifndef SQLITE_OMIT_SHARED_CACHE */
48114
48115 /************** End of btmutex.c *********************************************/
48116 /************** Begin file btree.c *******************************************/
 
48117 /*
48118 ** 2004 April 6
48119 **
48120 ** The author disclaims copyright to this source code. In place of
48121 ** a legal notice, here is a blessing:
@@ -52125,25 +52051,59 @@
52051 offset -= ovflSize;
52052 }else{
52053 /* Need to read this page properly. It contains some of the
52054 ** range of data that is being read (eOp==0) or written (eOp!=0).
52055 */
52056 #ifdef SQLITE_DIRECT_OVERFLOW_READ
52057 sqlite3_file *fd;
52058 #endif
52059 int a = amt;
52060 if( a + offset > ovflSize ){
52061 a = ovflSize - offset;
52062 }
52063
52064 #ifdef SQLITE_DIRECT_OVERFLOW_READ
52065 /* If all the following are true:
52066 **
52067 ** 1) this is a read operation, and
52068 ** 2) data is required from the start of this overflow page, and
52069 ** 3) the database is file-backed, and
52070 ** 4) there is no open write-transaction, and
52071 ** 5) the database is not a WAL database,
52072 **
52073 ** then data can be read directly from the database file into the
52074 ** output buffer, bypassing the page-cache altogether. This speeds
52075 ** up loading large records that span many overflow pages.
52076 */
52077 if( eOp==0 /* (1) */
52078 && offset==0 /* (2) */
52079 && pBt->inTransaction==TRANS_READ /* (4) */
52080 && (fd = sqlite3PagerFile(pBt->pPager))->pMethods /* (3) */
52081 && pBt->pPage1->aData[19]==0x01 /* (5) */
52082 ){
52083 u8 aSave[4];
52084 u8 *aWrite = &pBuf[-4];
52085 memcpy(aSave, aWrite, 4);
52086 rc = sqlite3OsRead(fd, aWrite, a+4, pBt->pageSize * (nextPage-1));
52087 nextPage = get4byte(aWrite);
52088 memcpy(aWrite, aSave, 4);
52089 }else
52090 #endif
52091
52092 {
52093 DbPage *pDbPage;
52094 rc = sqlite3PagerGet(pBt->pPager, nextPage, &pDbPage);
52095 if( rc==SQLITE_OK ){
52096 aPayload = sqlite3PagerGetData(pDbPage);
52097 nextPage = get4byte(aPayload);
52098 rc = copyPayload(&aPayload[offset+4], pBuf, a, eOp, pDbPage);
52099 sqlite3PagerUnref(pDbPage);
52100 offset = 0;
52101 }
52102 }
52103 amt -= a;
52104 pBuf += a;
52105 }
52106 }
52107 }
52108
52109 if( rc==SQLITE_OK && amt>0 ){
@@ -56373,11 +56333,10 @@
56333 return rc;
56334 }
56335
56336 /************** End of btree.c ***********************************************/
56337 /************** Begin file backup.c ******************************************/
 
56338 /*
56339 ** 2009 January 28
56340 **
56341 ** The author disclaims copyright to this source code. In place of
56342 ** a legal notice, here is a blessing:
@@ -57089,11 +57048,10 @@
57048 }
57049 #endif /* SQLITE_OMIT_VACUUM */
57050
57051 /************** End of backup.c **********************************************/
57052 /************** Begin file vdbemem.c *****************************************/
 
57053 /*
57054 ** 2004 May 26
57055 **
57056 ** The author disclaims copyright to this source code. In place of
57057 ** a legal notice, here is a blessing:
@@ -58244,11 +58202,10 @@
58202 return 0;
58203 }
58204
58205 /************** End of vdbemem.c *********************************************/
58206 /************** Begin file vdbeaux.c *****************************************/
 
58207 /*
58208 ** 2003 September 6
58209 **
58210 ** The author disclaims copyright to this source code. In place of
58211 ** a legal notice, here is a blessing:
@@ -61486,11 +61443,10 @@
61443 }
61444 }
61445
61446 /************** End of vdbeaux.c *********************************************/
61447 /************** Begin file vdbeapi.c *****************************************/
 
61448 /*
61449 ** 2004 May 26
61450 **
61451 ** The author disclaims copyright to this source code. In place of
61452 ** a legal notice, here is a blessing:
@@ -62794,11 +62750,10 @@
62750 return v;
62751 }
62752
62753 /************** End of vdbeapi.c *********************************************/
62754 /************** Begin file vdbetrace.c ***************************************/
 
62755 /*
62756 ** 2009 November 25
62757 **
62758 ** The author disclaims copyright to this source code. In place of
62759 ** a legal notice, here is a blessing:
@@ -62950,11 +62905,10 @@
62905
62906 #endif /* #ifndef SQLITE_OMIT_TRACE */
62907
62908 /************** End of vdbetrace.c *******************************************/
62909 /************** Begin file vdbe.c ********************************************/
 
62910 /*
62911 ** 2001 September 15
62912 **
62913 ** The author disclaims copyright to this source code. In place of
62914 ** a legal notice, here is a blessing:
@@ -63420,11 +63374,10 @@
63374 ** hwtime.h contains inline assembler code for implementing
63375 ** high-performance timing routines.
63376 */
63377 /************** Include hwtime.h in the middle of vdbe.c *********************/
63378 /************** Begin file hwtime.h ******************************************/
 
63379 /*
63380 ** 2008 May 27
63381 **
63382 ** The author disclaims copyright to this source code. In place of
63383 ** a legal notice, here is a blessing:
@@ -63509,11 +63462,10 @@
63462
63463 #endif /* !defined(_HWTIME_H_) */
63464
63465 /************** End of hwtime.h **********************************************/
63466 /************** Continuing where we left off in vdbe.c ***********************/
 
63467
63468 #endif
63469
63470 /*
63471 ** The CHECK_FOR_INTERRUPT macro defined here looks to see if the
@@ -69754,11 +69706,10 @@
69706 goto vdbe_error_halt;
69707 }
69708
69709 /************** End of vdbe.c ************************************************/
69710 /************** Begin file vdbeblob.c ****************************************/
 
69711 /*
69712 ** 2007 May 1
69713 **
69714 ** The author disclaims copyright to this source code. In place of
69715 ** a legal notice, here is a blessing:
@@ -70225,11 +70176,10 @@
70176
70177 #endif /* #ifndef SQLITE_OMIT_INCRBLOB */
70178
70179 /************** End of vdbeblob.c ********************************************/
70180 /************** Begin file vdbesort.c ****************************************/
 
70181 /*
70182 ** 2011 July 9
70183 **
70184 ** The author disclaims copyright to this source code. In place of
70185 ** a legal notice, here is a blessing:
@@ -71109,11 +71059,10 @@
71059
71060 #endif /* #ifndef SQLITE_OMIT_MERGE_SORT */
71061
71062 /************** End of vdbesort.c ********************************************/
71063 /************** Begin file journal.c *****************************************/
 
71064 /*
71065 ** 2007 August 22
71066 **
71067 ** The author disclaims copyright to this source code. In place of
71068 ** a legal notice, here is a blessing:
@@ -71350,11 +71299,10 @@
71299 }
71300 #endif
71301
71302 /************** End of journal.c *********************************************/
71303 /************** Begin file memjournal.c **************************************/
 
71304 /*
71305 ** 2008 October 7
71306 **
71307 ** The author disclaims copyright to this source code. In place of
71308 ** a legal notice, here is a blessing:
@@ -71612,11 +71560,10 @@
71560 return sizeof(MemJournal);
71561 }
71562
71563 /************** End of memjournal.c ******************************************/
71564 /************** Begin file walker.c ******************************************/
 
71565 /*
71566 ** 2008 August 16
71567 **
71568 ** The author disclaims copyright to this source code. In place of
71569 ** a legal notice, here is a blessing:
@@ -71751,11 +71698,10 @@
71698 return rc & WRC_Abort;
71699 }
71700
71701 /************** End of walker.c **********************************************/
71702 /************** Begin file resolve.c *****************************************/
 
71703 /*
71704 ** 2008 August 18
71705 **
71706 ** The author disclaims copyright to this source code. In place of
71707 ** a legal notice, here is a blessing:
@@ -72972,11 +72918,10 @@
72918 sqlite3WalkSelect(&w, p);
72919 }
72920
72921 /************** End of resolve.c *********************************************/
72922 /************** Begin file expr.c ********************************************/
 
72923 /*
72924 ** 2001 September 15
72925 **
72926 ** The author disclaims copyright to this source code. In place of
72927 ** a legal notice, here is a blessing:
@@ -76730,11 +76675,10 @@
76675 }
76676 }
76677
76678 /************** End of expr.c ************************************************/
76679 /************** Begin file alter.c *******************************************/
 
76680 /*
76681 ** 2005 February 15
76682 **
76683 ** The author disclaims copyright to this source code. In place of
76684 ** a legal notice, here is a blessing:
@@ -77559,11 +77503,10 @@
77503 }
77504 #endif /* SQLITE_ALTER_TABLE */
77505
77506 /************** End of alter.c ***********************************************/
77507 /************** Begin file analyze.c *****************************************/
 
77508 /*
77509 ** 2005 July 8
77510 **
77511 ** The author disclaims copyright to this source code. In place of
77512 ** a legal notice, here is a blessing:
@@ -77709,16 +77652,10 @@
77652 { "sqlite_stat1", "tbl,idx,stat" },
77653 #ifdef SQLITE_ENABLE_STAT3
77654 { "sqlite_stat3", "tbl,idx,neq,nlt,ndlt,sample" },
77655 #endif
77656 };
 
 
 
 
 
 
77657
77658 int aRoot[] = {0, 0};
77659 u8 aCreateTbl[] = {0, 0};
77660
77661 int i;
@@ -77728,21 +77665,10 @@
77665 if( v==0 ) return;
77666 assert( sqlite3BtreeHoldsAllMutexes(db) );
77667 assert( sqlite3VdbeDb(v)==db );
77668 pDb = &db->aDb[iDb];
77669
 
 
 
 
 
 
 
 
 
 
 
77670 /* Create new statistic tables if they do not exist, or clear them
77671 ** if they do already exist.
77672 */
77673 for(i=0; i<ArraySize(aTable); i++){
77674 const char *zTab = aTable[i].zName;
@@ -78699,11 +78625,10 @@
78625
78626 #endif /* SQLITE_OMIT_ANALYZE */
78627
78628 /************** End of analyze.c *********************************************/
78629 /************** Begin file attach.c ******************************************/
 
78630 /*
78631 ** 2003 April 6
78632 **
78633 ** The author disclaims copyright to this source code. In place of
78634 ** a legal notice, here is a blessing:
@@ -79259,11 +79184,10 @@
79184 }
79185 #endif
79186
79187 /************** End of attach.c **********************************************/
79188 /************** Begin file auth.c ********************************************/
 
79189 /*
79190 ** 2003 January 11
79191 **
79192 ** The author disclaims copyright to this source code. In place of
79193 ** a legal notice, here is a blessing:
@@ -79511,11 +79435,10 @@
79435
79436 #endif /* SQLITE_OMIT_AUTHORIZATION */
79437
79438 /************** End of auth.c ************************************************/
79439 /************** Begin file build.c *******************************************/
 
79440 /*
79441 ** 2001 September 15
79442 **
79443 ** The author disclaims copyright to this source code. In place of
79444 ** a legal notice, here is a blessing:
@@ -81658,11 +81581,12 @@
81581 if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){
81582 goto exit_drop_table;
81583 }
81584 }
81585 #endif
81586 if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0
81587 && sqlite3StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){
81588 sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName);
81589 goto exit_drop_table;
81590 }
81591
81592 #ifndef SQLITE_OMIT_VIEW
@@ -83332,11 +83256,10 @@
83256 return pKey;
83257 }
83258
83259 /************** End of build.c ***********************************************/
83260 /************** Begin file callback.c ****************************************/
 
83261 /*
83262 ** 2005 May 23
83263 **
83264 ** The author disclaims copyright to this source code. In place of
83265 ** a legal notice, here is a blessing:
@@ -83792,11 +83715,10 @@
83715 return p;
83716 }
83717
83718 /************** End of callback.c ********************************************/
83719 /************** Begin file delete.c ******************************************/
 
83720 /*
83721 ** 2001 September 15
83722 **
83723 ** The author disclaims copyright to this source code. In place of
83724 ** a legal notice, here is a blessing:
@@ -84447,11 +84369,10 @@
84369 return regBase;
84370 }
84371
84372 /************** End of delete.c **********************************************/
84373 /************** Begin file func.c ********************************************/
 
84374 /*
84375 ** 2002 February 23
84376 **
84377 ** The author disclaims copyright to this source code. In place of
84378 ** a legal notice, here is a blessing:
@@ -86056,11 +85977,10 @@
85977 #endif
85978 }
85979
85980 /************** End of func.c ************************************************/
85981 /************** Begin file fkey.c ********************************************/
 
85982 /*
85983 **
85984 ** The author disclaims copyright to this source code. In place of
85985 ** a legal notice, here is a blessing:
85986 **
@@ -87277,11 +87197,10 @@
87197 }
87198 #endif /* ifndef SQLITE_OMIT_FOREIGN_KEY */
87199
87200 /************** End of fkey.c ************************************************/
87201 /************** Begin file insert.c ******************************************/
 
87202 /*
87203 ** 2001 September 15
87204 **
87205 ** The author disclaims copyright to this source code. In place of
87206 ** a legal notice, here is a blessing:
@@ -89126,11 +89045,10 @@
89045 }
89046 #endif /* SQLITE_OMIT_XFER_OPT */
89047
89048 /************** End of insert.c **********************************************/
89049 /************** Begin file legacy.c ******************************************/
 
89050 /*
89051 ** 2001 September 15
89052 **
89053 ** The author disclaims copyright to this source code. In place of
89054 ** a legal notice, here is a blessing:
@@ -89274,11 +89192,10 @@
89192 return rc;
89193 }
89194
89195 /************** End of legacy.c **********************************************/
89196 /************** Begin file loadext.c *****************************************/
 
89197 /*
89198 ** 2006 June 7
89199 **
89200 ** The author disclaims copyright to this source code. In place of
89201 ** a legal notice, here is a blessing:
@@ -89295,11 +89212,10 @@
89212 #ifndef SQLITE_CORE
89213 #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */
89214 #endif
89215 /************** Include sqlite3ext.h in the middle of loadext.c **************/
89216 /************** Begin file sqlite3ext.h **************************************/
 
89217 /*
89218 ** 2006 June 7
89219 **
89220 ** The author disclaims copyright to this source code. In place of
89221 ** a legal notice, here is a blessing:
@@ -89724,11 +89640,10 @@
89640
89641 #endif /* _SQLITE3EXT_H_ */
89642
89643 /************** End of sqlite3ext.h ******************************************/
89644 /************** Continuing where we left off in loadext.c ********************/
 
89645 /* #include <string.h> */
89646
89647 #ifndef SQLITE_OMIT_LOAD_EXTENSION
89648
89649 /*
@@ -90364,11 +90279,10 @@
90279 }
90280 }
90281
90282 /************** End of loadext.c *********************************************/
90283 /************** Begin file pragma.c ******************************************/
 
90284 /*
90285 ** 2003 April 6
90286 **
90287 ** The author disclaims copyright to this source code. In place of
90288 ** a legal notice, here is a blessing:
@@ -90899,12 +90813,14 @@
90813 */
90814 if( sqlite3StrICmp(zLeft,"journal_mode")==0 ){
90815 int eMode; /* One of the PAGER_JOURNALMODE_XXX symbols */
90816 int ii; /* Loop counter */
90817
90818 /* Force the schema to be loaded on all databases. This causes all
90819 ** database files to be opened and the journal_modes set. This is
90820 ** necessary because subsequent processing must know if the databases
90821 ** are in WAL mode. */
90822 if( sqlite3ReadSchema(pParse) ){
90823 goto pragma_out;
90824 }
90825
90826 sqlite3VdbeSetNumCols(v, 1);
@@ -91893,11 +91809,10 @@
91809
91810 #endif /* SQLITE_OMIT_PRAGMA */
91811
91812 /************** End of pragma.c **********************************************/
91813 /************** Begin file prepare.c *****************************************/
 
91814 /*
91815 ** 2005 May 25
91816 **
91817 ** The author disclaims copyright to this source code. In place of
91818 ** a legal notice, here is a blessing:
@@ -92754,11 +92669,10 @@
92669
92670 #endif /* SQLITE_OMIT_UTF16 */
92671
92672 /************** End of prepare.c *********************************************/
92673 /************** Begin file select.c ******************************************/
 
92674 /*
92675 ** 2001 September 15
92676 **
92677 ** The author disclaims copyright to this source code. In place of
92678 ** a legal notice, here is a blessing:
@@ -92821,10 +92735,11 @@
92735 Select standin;
92736 sqlite3 *db = pParse->db;
92737 pNew = sqlite3DbMallocZero(db, sizeof(*pNew) );
92738 assert( db->mallocFailed || !pOffset || pLimit ); /* OFFSET implies LIMIT */
92739 if( pNew==0 ){
92740 assert( db->mallocFailed );
92741 pNew = &standin;
92742 memset(pNew, 0, sizeof(*pNew));
92743 }
92744 if( pEList==0 ){
92745 pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ALL,0));
@@ -92848,10 +92763,11 @@
92763 if( pNew!=&standin ) sqlite3DbFree(db, pNew);
92764 pNew = 0;
92765 }else{
92766 assert( pNew->pSrc!=0 || pParse->nErr>0 );
92767 }
92768 assert( pNew!=&standin );
92769 return pNew;
92770 }
92771
92772 /*
92773 ** Delete the given Select structure and all of its substructures.
@@ -97343,11 +97259,10 @@
97259 *****************************************************************************/
97260 #endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */
97261
97262 /************** End of select.c **********************************************/
97263 /************** Begin file table.c *******************************************/
 
97264 /*
97265 ** 2001 September 15
97266 **
97267 ** The author disclaims copyright to this source code. In place of
97268 ** a legal notice, here is a blessing:
@@ -97543,11 +97458,10 @@
97458
97459 #endif /* SQLITE_OMIT_GET_TABLE */
97460
97461 /************** End of table.c ***********************************************/
97462 /************** Begin file trigger.c *****************************************/
 
97463 /*
97464 **
97465 ** The author disclaims copyright to this source code. In place of
97466 ** a legal notice, here is a blessing:
97467 **
@@ -98669,11 +98583,10 @@
98583
98584 #endif /* !defined(SQLITE_OMIT_TRIGGER) */
98585
98586 /************** End of trigger.c *********************************************/
98587 /************** Begin file update.c ******************************************/
 
98588 /*
98589 ** 2001 September 15
98590 **
98591 ** The author disclaims copyright to this source code. In place of
98592 ** a legal notice, here is a blessing:
@@ -99342,11 +99255,10 @@
99255 }
99256 #endif /* SQLITE_OMIT_VIRTUALTABLE */
99257
99258 /************** End of update.c **********************************************/
99259 /************** Begin file vacuum.c ******************************************/
 
99260 /*
99261 ** 2003 April 6
99262 **
99263 ** The author disclaims copyright to this source code. In place of
99264 ** a legal notice, here is a blessing:
@@ -99687,11 +99599,10 @@
99599
99600 #endif /* SQLITE_OMIT_VACUUM && SQLITE_OMIT_ATTACH */
99601
99602 /************** End of vacuum.c **********************************************/
99603 /************** Begin file vtab.c ********************************************/
 
99604 /*
99605 ** 2006 June 10
99606 **
99607 ** The author disclaims copyright to this source code. In place of
99608 ** a legal notice, here is a blessing:
@@ -100756,11 +100667,10 @@
100667
100668 #endif /* SQLITE_OMIT_VIRTUALTABLE */
100669
100670 /************** End of vtab.c ************************************************/
100671 /************** Begin file where.c *******************************************/
 
100672 /*
100673 ** 2001 September 15
100674 **
100675 ** The author disclaims copyright to this source code. In place of
100676 ** a legal notice, here is a blessing:
@@ -101463,11 +101373,11 @@
101373 int iCol = pRight->iColumn;
101374 pVal = sqlite3VdbeGetValue(pReprepare, iCol, SQLITE_AFF_NONE);
101375 if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
101376 z = (char *)sqlite3_value_text(pVal);
101377 }
101378 sqlite3VdbeSetVarmask(pParse->pVdbe, iCol); /* IMP: R-31526-56213 */
101379 assert( pRight->op==TK_VARIABLE || pRight->op==TK_REGISTER );
101380 }else if( op==TK_STRING ){
101381 z = pRight->u.zToken;
101382 }
101383 if( z ){
@@ -101481,11 +101391,11 @@
101391 pPrefix = sqlite3Expr(db, TK_STRING, z);
101392 if( pPrefix ) pPrefix->u.zToken[cnt] = 0;
101393 *ppPrefix = pPrefix;
101394 if( op==TK_VARIABLE ){
101395 Vdbe *v = pParse->pVdbe;
101396 sqlite3VdbeSetVarmask(v, pRight->iColumn); /* IMP: R-31526-56213 */
101397 if( *pisComplete && pRight->u.zToken[1] ){
101398 /* If the rhs of the LIKE expression is a variable, and the current
101399 ** value of the variable means there is no need to invoke the LIKE
101400 ** function, then no OP_Variable will be added to the program.
101401 ** This causes problems for the sqlite3_bind_parameter_name()
@@ -103395,11 +103305,11 @@
103305 ){
103306 if( pExpr->op==TK_VARIABLE
103307 || (pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE)
103308 ){
103309 int iVar = pExpr->iColumn;
103310 sqlite3VdbeSetVarmask(pParse->pVdbe, iVar); /* IMP: R-31526-56213 */
103311 *pp = sqlite3VdbeGetValue(pParse->pReprepare, iVar, aff);
103312 return SQLITE_OK;
103313 }
103314 return sqlite3ValueFromExpr(pParse->db, pExpr, SQLITE_UTF8, aff, pp);
103315 }
@@ -105984,11 +105894,10 @@
105894 return;
105895 }
105896
105897 /************** End of where.c ***********************************************/
105898 /************** Begin file parse.c *******************************************/
 
105899 /* Driver template for the LEMON parser generator.
105900 ** The author disclaims copyright to this source code.
105901 **
105902 ** This version of "lempar.c" is modified, slightly, for use by SQLite.
105903 ** The only modifications are the addition of a couple of NEVER()
@@ -105997,11 +105906,10 @@
105906 ** specific grammar used by SQLite.
105907 */
105908 /* First off, code is included that follows the "include" declaration
105909 ** in the input grammar file. */
105910 /* #include <stdio.h> */
 
105911
105912
105913 /*
105914 ** Disable all error recovery processing in the parser push-down
105915 ** automaton.
@@ -106045,11 +105953,10 @@
105953 /*
105954 ** An instance of this structure holds the ATTACH key and the key type.
105955 */
105956 struct AttachKey { int type; Token key; };
105957
 
105958
105959 /* This is a utility routine used to set the ExprSpan.zStart and
105960 ** ExprSpan.zEnd values of pOut so that the span covers the complete
105961 ** range of text beginning with pStart and going to the end of pEnd.
105962 */
@@ -106065,11 +105972,10 @@
105972 static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token *pValue){
105973 pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, pValue);
105974 pOut->zStart = pValue->z;
105975 pOut->zEnd = &pValue->z[pValue->n];
105976 }
 
105977
105978 /* This routine constructs a binary expression node out of two ExprSpan
105979 ** objects and uses the result to populate a new ExprSpan object.
105980 */
105981 static void spanBinaryExpr(
@@ -106081,11 +105987,10 @@
105987 ){
105988 pOut->pExpr = sqlite3PExpr(pParse, op, pLeft->pExpr, pRight->pExpr, 0);
105989 pOut->zStart = pLeft->zStart;
105990 pOut->zEnd = pRight->zEnd;
105991 }
 
105992
105993 /* Construct an expression node for a unary postfix operator
105994 */
105995 static void spanUnaryPostfix(
105996 ExprSpan *pOut, /* Write the new expression node here */
@@ -106096,11 +106001,10 @@
106001 ){
106002 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
106003 pOut->zStart = pOperand->zStart;
106004 pOut->zEnd = &pPostOp->z[pPostOp->n];
106005 }
 
106006
106007 /* A routine to convert a binary TK_IS or TK_ISNOT expression into a
106008 ** unary TK_ISNULL or TK_NOTNULL expression. */
106009 static void binaryToUnaryIfNull(Parse *pParse, Expr *pY, Expr *pA, int op){
106010 sqlite3 *db = pParse->db;
@@ -106108,11 +106012,10 @@
106012 pA->op = (u8)op;
106013 sqlite3ExprDelete(db, pA->pRight);
106014 pA->pRight = 0;
106015 }
106016 }
 
106017
106018 /* Construct an expression node for a unary prefix operator
106019 */
106020 static void spanUnaryPrefix(
106021 ExprSpan *pOut, /* Write the new expression node here */
@@ -106123,11 +106026,10 @@
106026 ){
106027 pOut->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0, 0);
106028 pOut->zStart = pPreOp->z;
106029 pOut->zEnd = pOperand->zEnd;
106030 }
 
106031 /* Next is all token values, in a form suitable for use by makeheaders.
106032 ** This section will be null unless lemon is run with the -m switch.
106033 */
106034 /*
106035 ** These constants (all generated automatically by the parser generator)
@@ -107379,21 +107281,17 @@
107281 ** inside the C code.
107282 */
107283 case 160: /* select */
107284 case 194: /* oneselect */
107285 {
 
107286 sqlite3SelectDelete(pParse->db, (yypminor->yy387));
 
107287 }
107288 break;
107289 case 174: /* term */
107290 case 175: /* expr */
107291 {
 
107292 sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr);
 
107293 }
107294 break;
107295 case 179: /* idxlist_opt */
107296 case 187: /* idxlist */
107297 case 197: /* selcollist */
@@ -107405,23 +107303,19 @@
107303 case 217: /* setlist */
107304 case 220: /* itemlist */
107305 case 221: /* exprlist */
107306 case 226: /* case_exprlist */
107307 {
 
107308 sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
 
107309 }
107310 break;
107311 case 193: /* fullname */
107312 case 198: /* from */
107313 case 206: /* seltablist */
107314 case 207: /* stl_prefix */
107315 {
 
107316 sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
 
107317 }
107318 break;
107319 case 199: /* where_opt */
107320 case 201: /* having_opt */
107321 case 210: /* on_opt */
@@ -107429,37 +107323,29 @@
107323 case 225: /* case_operand */
107324 case 227: /* case_else */
107325 case 238: /* when_clause */
107326 case 243: /* key_opt */
107327 {
 
107328 sqlite3ExprDelete(pParse->db, (yypminor->yy314));
 
107329 }
107330 break;
107331 case 211: /* using_opt */
107332 case 213: /* inscollist */
107333 case 219: /* inscollist_opt */
107334 {
 
107335 sqlite3IdListDelete(pParse->db, (yypminor->yy384));
 
107336 }
107337 break;
107338 case 234: /* trigger_cmd_list */
107339 case 239: /* trigger_cmd */
107340 {
 
107341 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
 
107342 }
107343 break;
107344 case 236: /* trigger_event */
107345 {
 
107346 sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
 
107347 }
107348 break;
107349 default: break; /* If no destructor action specified: do nothing */
107350 }
107351 }
@@ -107641,16 +107527,14 @@
107527 }
107528 #endif
107529 while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
107530 /* Here code is inserted which will execute if the parser
107531 ** stack every overflows */
 
107532
107533 UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
107534 sqlite3ErrorMsg(pParse, "parser stack overflow");
107535 pParse->parseError = 1;
 
107536 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
107537 }
107538
107539 /*
107540 ** Perform a shift action.
@@ -108087,94 +107971,66 @@
107971 ** { ... } // User supplied code
107972 ** #line <lineno> <thisfile>
107973 ** break;
107974 */
107975 case 5: /* explain ::= */
 
107976 { sqlite3BeginParse(pParse, 0); }
 
107977 break;
107978 case 6: /* explain ::= EXPLAIN */
 
107979 { sqlite3BeginParse(pParse, 1); }
 
107980 break;
107981 case 7: /* explain ::= EXPLAIN QUERY PLAN */
 
107982 { sqlite3BeginParse(pParse, 2); }
 
107983 break;
107984 case 8: /* cmdx ::= cmd */
 
107985 { sqlite3FinishCoding(pParse); }
 
107986 break;
107987 case 9: /* cmd ::= BEGIN transtype trans_opt */
 
107988 {sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);}
 
107989 break;
107990 case 13: /* transtype ::= */
 
107991 {yygotominor.yy4 = TK_DEFERRED;}
 
107992 break;
107993 case 14: /* transtype ::= DEFERRED */
107994 case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15);
107995 case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16);
107996 case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115);
107997 case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117);
 
107998 {yygotominor.yy4 = yymsp[0].major;}
 
107999 break;
108000 case 17: /* cmd ::= COMMIT trans_opt */
108001 case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18);
 
108002 {sqlite3CommitTransaction(pParse);}
 
108003 break;
108004 case 19: /* cmd ::= ROLLBACK trans_opt */
 
108005 {sqlite3RollbackTransaction(pParse);}
 
108006 break;
108007 case 22: /* cmd ::= SAVEPOINT nm */
 
108008 {
108009 sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
108010 }
 
108011 break;
108012 case 23: /* cmd ::= RELEASE savepoint_opt nm */
 
108013 {
108014 sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
108015 }
 
108016 break;
108017 case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
 
108018 {
108019 sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
108020 }
 
108021 break;
108022 case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
 
108023 {
108024 sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4);
108025 }
 
108026 break;
108027 case 27: /* createkw ::= CREATE */
 
108028 {
108029 pParse->db->lookaside.bEnabled = 0;
108030 yygotominor.yy0 = yymsp[0].minor.yy0;
108031 }
 
108032 break;
108033 case 28: /* ifnotexists ::= */
108034 case 31: /* temp ::= */ yytestcase(yyruleno==31);
108035 case 70: /* autoinc ::= */ yytestcase(yyruleno==70);
108036 case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83);
@@ -108184,56 +108040,44 @@
108040 case 109: /* ifexists ::= */ yytestcase(yyruleno==109);
108041 case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120);
108042 case 121: /* distinct ::= */ yytestcase(yyruleno==121);
108043 case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222);
108044 case 225: /* in_op ::= IN */ yytestcase(yyruleno==225);
 
108045 {yygotominor.yy4 = 0;}
 
108046 break;
108047 case 29: /* ifnotexists ::= IF NOT EXISTS */
108048 case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30);
108049 case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71);
108050 case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86);
108051 case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108);
108052 case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119);
108053 case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223);
108054 case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226);
 
108055 {yygotominor.yy4 = 1;}
 
108056 break;
108057 case 32: /* create_table_args ::= LP columnlist conslist_opt RP */
 
108058 {
108059 sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
108060 }
 
108061 break;
108062 case 33: /* create_table_args ::= AS select */
 
108063 {
108064 sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387);
108065 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
108066 }
 
108067 break;
108068 case 36: /* column ::= columnid type carglist */
 
108069 {
108070 yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
108071 yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
108072 }
 
108073 break;
108074 case 37: /* columnid ::= nm */
 
108075 {
108076 sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
108077 yygotominor.yy0 = yymsp[0].minor.yy0;
108078 }
 
108079 break;
108080 case 38: /* id ::= ID */
108081 case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39);
108082 case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40);
108083 case 41: /* nm ::= id */ yytestcase(yyruleno==41);
@@ -108253,373 +108097,256 @@
108097 case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264);
108098 case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265);
108099 case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266);
108100 case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267);
108101 case 285: /* trnm ::= nm */ yytestcase(yyruleno==285);
 
108102 {yygotominor.yy0 = yymsp[0].minor.yy0;}
 
108103 break;
108104 case 45: /* type ::= typetoken */
 
108105 {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
 
108106 break;
108107 case 47: /* typetoken ::= typename LP signed RP */
 
108108 {
108109 yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
108110 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
108111 }
 
108112 break;
108113 case 48: /* typetoken ::= typename LP signed COMMA signed RP */
 
108114 {
108115 yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
108116 yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
108117 }
 
108118 break;
108119 case 50: /* typename ::= typename ids */
 
108120 {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
 
108121 break;
108122 case 57: /* ccons ::= DEFAULT term */
108123 case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59);
 
108124 {sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);}
 
108125 break;
108126 case 58: /* ccons ::= DEFAULT LP expr RP */
 
108127 {sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);}
 
108128 break;
108129 case 60: /* ccons ::= DEFAULT MINUS term */
 
108130 {
108131 ExprSpan v;
108132 v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0);
108133 v.zStart = yymsp[-1].minor.yy0.z;
108134 v.zEnd = yymsp[0].minor.yy118.zEnd;
108135 sqlite3AddDefaultValue(pParse,&v);
108136 }
 
108137 break;
108138 case 61: /* ccons ::= DEFAULT id */
 
108139 {
108140 ExprSpan v;
108141 spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0);
108142 sqlite3AddDefaultValue(pParse,&v);
108143 }
 
108144 break;
108145 case 63: /* ccons ::= NOT NULL onconf */
 
108146 {sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);}
 
108147 break;
108148 case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
 
108149 {sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);}
 
108150 break;
108151 case 65: /* ccons ::= UNIQUE onconf */
 
108152 {sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);}
 
108153 break;
108154 case 66: /* ccons ::= CHECK LP expr RP */
 
108155 {sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);}
 
108156 break;
108157 case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */
 
108158 {sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);}
 
108159 break;
108160 case 68: /* ccons ::= defer_subclause */
 
108161 {sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);}
 
108162 break;
108163 case 69: /* ccons ::= COLLATE ids */
 
108164 {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
 
108165 break;
108166 case 72: /* refargs ::= */
 
108167 { yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */}
 
108168 break;
108169 case 73: /* refargs ::= refargs refarg */
 
108170 { yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; }
 
108171 break;
108172 case 74: /* refarg ::= MATCH nm */
108173 case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75);
 
108174 { yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; }
 
108175 break;
108176 case 76: /* refarg ::= ON DELETE refact */
 
108177 { yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; }
 
108178 break;
108179 case 77: /* refarg ::= ON UPDATE refact */
 
108180 { yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; }
 
108181 break;
108182 case 78: /* refact ::= SET NULL */
 
108183 { yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */}
 
108184 break;
108185 case 79: /* refact ::= SET DEFAULT */
 
108186 { yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */}
 
108187 break;
108188 case 80: /* refact ::= CASCADE */
 
108189 { yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */}
 
108190 break;
108191 case 81: /* refact ::= RESTRICT */
 
108192 { yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */}
 
108193 break;
108194 case 82: /* refact ::= NO ACTION */
 
108195 { yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */}
 
108196 break;
108197 case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
108198 case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99);
108199 case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101);
108200 case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104);
 
108201 {yygotominor.yy4 = yymsp[0].minor.yy4;}
 
108202 break;
108203 case 88: /* conslist_opt ::= */
 
108204 {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
 
108205 break;
108206 case 89: /* conslist_opt ::= COMMA conslist */
 
108207 {yygotominor.yy0 = yymsp[-1].minor.yy0;}
 
108208 break;
108209 case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
 
108210 {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);}
 
108211 break;
108212 case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */
 
108213 {sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);}
 
108214 break;
108215 case 96: /* tcons ::= CHECK LP expr RP onconf */
 
108216 {sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);}
 
108217 break;
108218 case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
 
108219 {
108220 sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4);
108221 sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4);
108222 }
 
108223 break;
108224 case 100: /* onconf ::= */
 
108225 {yygotominor.yy4 = OE_Default;}
 
108226 break;
108227 case 102: /* orconf ::= */
 
108228 {yygotominor.yy210 = OE_Default;}
 
108229 break;
108230 case 103: /* orconf ::= OR resolvetype */
 
108231 {yygotominor.yy210 = (u8)yymsp[0].minor.yy4;}
 
108232 break;
108233 case 105: /* resolvetype ::= IGNORE */
 
108234 {yygotominor.yy4 = OE_Ignore;}
 
108235 break;
108236 case 106: /* resolvetype ::= REPLACE */
 
108237 {yygotominor.yy4 = OE_Replace;}
 
108238 break;
108239 case 107: /* cmd ::= DROP TABLE ifexists fullname */
 
108240 {
108241 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
108242 }
 
108243 break;
108244 case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */
 
108245 {
108246 sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4);
108247 }
 
108248 break;
108249 case 111: /* cmd ::= DROP VIEW ifexists fullname */
 
108250 {
108251 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4);
108252 }
 
108253 break;
108254 case 112: /* cmd ::= select */
 
108255 {
108256 SelectDest dest = {SRT_Output, 0, 0, 0, 0};
108257 sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
108258 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
108259 }
 
108260 break;
108261 case 113: /* select ::= oneselect */
 
108262 {yygotominor.yy387 = yymsp[0].minor.yy387;}
 
108263 break;
108264 case 114: /* select ::= select multiselect_op oneselect */
 
108265 {
108266 if( yymsp[0].minor.yy387 ){
108267 yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4;
108268 yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387;
108269 }else{
108270 sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387);
108271 }
108272 yygotominor.yy387 = yymsp[0].minor.yy387;
108273 }
 
108274 break;
108275 case 116: /* multiselect_op ::= UNION ALL */
 
108276 {yygotominor.yy4 = TK_ALL;}
 
108277 break;
108278 case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
 
108279 {
108280 yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset);
108281 }
 
108282 break;
108283 case 122: /* sclp ::= selcollist COMMA */
108284 case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247);
 
108285 {yygotominor.yy322 = yymsp[-1].minor.yy322;}
 
108286 break;
108287 case 123: /* sclp ::= */
108288 case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151);
108289 case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159);
108290 case 240: /* exprlist ::= */ yytestcase(yyruleno==240);
108291 case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246);
 
108292 {yygotominor.yy322 = 0;}
 
108293 break;
108294 case 124: /* selcollist ::= sclp expr as */
 
108295 {
108296 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr);
108297 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1);
108298 sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118);
108299 }
 
108300 break;
108301 case 125: /* selcollist ::= sclp STAR */
 
108302 {
108303 Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0);
108304 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p);
108305 }
 
108306 break;
108307 case 126: /* selcollist ::= sclp nm DOT STAR */
 
108308 {
108309 Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
108310 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108311 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
108312 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot);
108313 }
 
108314 break;
108315 case 129: /* as ::= */
 
108316 {yygotominor.yy0.n = 0;}
 
108317 break;
108318 case 130: /* from ::= */
 
108319 {yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));}
 
108320 break;
108321 case 131: /* from ::= FROM seltablist */
 
108322 {
108323 yygotominor.yy259 = yymsp[0].minor.yy259;
108324 sqlite3SrcListShiftJoinType(yygotominor.yy259);
108325 }
 
108326 break;
108327 case 132: /* stl_prefix ::= seltablist joinop */
 
108328 {
108329 yygotominor.yy259 = yymsp[-1].minor.yy259;
108330 if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4;
108331 }
 
108332 break;
108333 case 133: /* stl_prefix ::= */
 
108334 {yygotominor.yy259 = 0;}
 
108335 break;
108336 case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
 
108337 {
108338 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108339 sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0);
108340 }
 
108341 break;
108342 case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
 
108343 {
108344 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108345 }
 
108346 break;
108347 case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
 
108348 {
108349 if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
108350 yygotominor.yy259 = yymsp[-4].minor.yy259;
108351 }else{
108352 Select *pSubquery;
@@ -108626,260 +108353,180 @@
108353 sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259);
108354 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0);
108355 yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
108356 }
108357 }
 
108358 break;
108359 case 137: /* dbnm ::= */
108360 case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146);
 
108361 {yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
 
108362 break;
108363 case 139: /* fullname ::= nm dbnm */
 
108364 {yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
 
108365 break;
108366 case 140: /* joinop ::= COMMA|JOIN */
 
108367 { yygotominor.yy4 = JT_INNER; }
 
108368 break;
108369 case 141: /* joinop ::= JOIN_KW JOIN */
 
108370 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
 
108371 break;
108372 case 142: /* joinop ::= JOIN_KW nm JOIN */
 
108373 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
 
108374 break;
108375 case 143: /* joinop ::= JOIN_KW nm nm JOIN */
 
108376 { yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
 
108377 break;
108378 case 144: /* on_opt ::= ON expr */
108379 case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155);
108380 case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162);
108381 case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169);
108382 case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235);
108383 case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237);
 
108384 {yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;}
 
108385 break;
108386 case 145: /* on_opt ::= */
108387 case 161: /* having_opt ::= */ yytestcase(yyruleno==161);
108388 case 168: /* where_opt ::= */ yytestcase(yyruleno==168);
108389 case 236: /* case_else ::= */ yytestcase(yyruleno==236);
108390 case 238: /* case_operand ::= */ yytestcase(yyruleno==238);
 
108391 {yygotominor.yy314 = 0;}
 
108392 break;
108393 case 148: /* indexed_opt ::= NOT INDEXED */
 
108394 {yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
 
108395 break;
108396 case 149: /* using_opt ::= USING LP inscollist RP */
108397 case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181);
 
108398 {yygotominor.yy384 = yymsp[-1].minor.yy384;}
 
108399 break;
108400 case 150: /* using_opt ::= */
108401 case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180);
 
108402 {yygotominor.yy384 = 0;}
 
108403 break;
108404 case 152: /* orderby_opt ::= ORDER BY sortlist */
108405 case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160);
108406 case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239);
 
108407 {yygotominor.yy322 = yymsp[0].minor.yy322;}
 
108408 break;
108409 case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */
 
108410 {
108411 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
108412 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108413 }
 
108414 break;
108415 case 154: /* sortlist ::= sortitem sortorder */
 
108416 {
108417 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314);
108418 if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4;
108419 }
 
108420 break;
108421 case 156: /* sortorder ::= ASC */
108422 case 158: /* sortorder ::= */ yytestcase(yyruleno==158);
 
108423 {yygotominor.yy4 = SQLITE_SO_ASC;}
 
108424 break;
108425 case 157: /* sortorder ::= DESC */
 
108426 {yygotominor.yy4 = SQLITE_SO_DESC;}
 
108427 break;
108428 case 163: /* limit_opt ::= */
 
108429 {yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;}
 
108430 break;
108431 case 164: /* limit_opt ::= LIMIT expr */
 
108432 {yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;}
 
108433 break;
108434 case 165: /* limit_opt ::= LIMIT expr OFFSET expr */
 
108435 {yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;}
 
108436 break;
108437 case 166: /* limit_opt ::= LIMIT expr COMMA expr */
 
108438 {yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;}
 
108439 break;
108440 case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
 
108441 {
108442 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
108443 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314);
108444 }
 
108445 break;
108446 case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
 
108447 {
108448 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
108449 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
108450 sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210);
108451 }
 
108452 break;
108453 case 171: /* setlist ::= setlist COMMA nm EQ expr */
 
108454 {
108455 yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr);
108456 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108457 }
 
108458 break;
108459 case 172: /* setlist ::= nm EQ expr */
 
108460 {
108461 yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr);
108462 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108463 }
 
108464 break;
108465 case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
 
108466 {sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);}
 
108467 break;
108468 case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
 
108469 {sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);}
 
108470 break;
108471 case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
 
108472 {sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);}
 
108473 break;
108474 case 176: /* insert_cmd ::= INSERT orconf */
 
108475 {yygotominor.yy210 = yymsp[0].minor.yy210;}
 
108476 break;
108477 case 177: /* insert_cmd ::= REPLACE */
 
108478 {yygotominor.yy210 = OE_Replace;}
 
108479 break;
108480 case 178: /* itemlist ::= itemlist COMMA expr */
108481 case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241);
 
108482 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);}
 
108483 break;
108484 case 179: /* itemlist ::= expr */
108485 case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242);
 
108486 {yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);}
 
108487 break;
108488 case 182: /* inscollist ::= inscollist COMMA nm */
 
108489 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
 
108490 break;
108491 case 183: /* inscollist ::= nm */
 
108492 {yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
 
108493 break;
108494 case 184: /* expr ::= term */
 
108495 {yygotominor.yy118 = yymsp[0].minor.yy118;}
 
108496 break;
108497 case 185: /* expr ::= LP expr RP */
 
108498 {yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);}
 
108499 break;
108500 case 186: /* term ::= NULL */
108501 case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191);
108502 case 192: /* term ::= STRING */ yytestcase(yyruleno==192);
 
108503 {spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);}
 
108504 break;
108505 case 187: /* expr ::= id */
108506 case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188);
 
108507 {spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);}
 
108508 break;
108509 case 189: /* expr ::= nm DOT nm */
 
108510 {
108511 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108512 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108513 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
108514 spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
108515 }
 
108516 break;
108517 case 190: /* expr ::= nm DOT nm DOT nm */
 
108518 {
108519 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
108520 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
108521 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
108522 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
108523 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
108524 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108525 }
 
108526 break;
108527 case 193: /* expr ::= REGISTER */
 
108528 {
108529 /* When doing a nested parse, one can include terms in an expression
108530 ** that look like this: #1 #2 ... These terms refer to registers
108531 ** in the virtual machine. #N is the N-th register. */
108532 if( pParse->nested==0 ){
@@ -108889,40 +108536,32 @@
108536 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0);
108537 if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable);
108538 }
108539 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108540 }
 
108541 break;
108542 case 194: /* expr ::= VARIABLE */
 
108543 {
108544 spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0);
108545 sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr);
108546 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108547 }
 
108548 break;
108549 case 195: /* expr ::= expr COLLATE ids */
 
108550 {
108551 yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0);
108552 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108553 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108554 }
 
108555 break;
108556 case 196: /* expr ::= CAST LP expr AS typetoken RP */
 
108557 {
108558 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0);
108559 spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
108560 }
 
108561 break;
108562 case 197: /* expr ::= ID LP distinct exprlist RP */
 
108563 {
108564 if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
108565 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
108566 }
108567 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -108929,59 +108568,47 @@
108568 spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
108569 if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){
108570 yygotominor.yy118.pExpr->flags |= EP_Distinct;
108571 }
108572 }
 
108573 break;
108574 case 198: /* expr ::= ID LP STAR RP */
 
108575 {
108576 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
108577 spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
108578 }
 
108579 break;
108580 case 199: /* term ::= CTIME_KW */
 
108581 {
108582 /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
108583 ** treated as functions that return constants */
108584 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
108585 if( yygotominor.yy118.pExpr ){
108586 yygotominor.yy118.pExpr->op = TK_CONST_FUNC;
108587 }
108588 spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
108589 }
 
108590 break;
108591 case 200: /* expr ::= expr AND expr */
108592 case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201);
108593 case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202);
108594 case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203);
108595 case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204);
108596 case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205);
108597 case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206);
108598 case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207);
 
108599 {spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);}
 
108600 break;
108601 case 208: /* likeop ::= LIKE_KW */
108602 case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210);
 
108603 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;}
 
108604 break;
108605 case 209: /* likeop ::= NOT LIKE_KW */
108606 case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211);
 
108607 {yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;}
 
108608 break;
108609 case 212: /* expr ::= expr likeop expr */
 
108610 {
108611 ExprList *pList;
108612 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr);
108613 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr);
108614 yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator);
@@ -108988,14 +108615,12 @@
108615 if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108616 yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart;
108617 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108618 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108619 }
 
108620 break;
108621 case 213: /* expr ::= expr likeop expr ESCAPE expr */
 
108622 {
108623 ExprList *pList;
108624 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108625 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr);
108626 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
@@ -109003,56 +108628,40 @@
108628 if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108629 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108630 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108631 if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc;
108632 }
 
108633 break;
108634 case 214: /* expr ::= expr ISNULL|NOTNULL */
 
108635 {spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);}
 
108636 break;
108637 case 215: /* expr ::= expr NOT NULL */
 
108638 {spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);}
 
108639 break;
108640 case 216: /* expr ::= expr IS expr */
 
108641 {
108642 spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);
108643 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL);
108644 }
 
108645 break;
108646 case 217: /* expr ::= expr IS NOT expr */
 
108647 {
108648 spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118);
108649 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL);
108650 }
 
108651 break;
108652 case 218: /* expr ::= NOT expr */
108653 case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219);
 
108654 {spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108655 break;
108656 case 220: /* expr ::= MINUS expr */
 
108657 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108658 break;
108659 case 221: /* expr ::= PLUS expr */
 
108660 {spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);}
 
108661 break;
108662 case 224: /* expr ::= expr between_op expr AND expr */
 
108663 {
108664 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108665 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr);
108666 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108667 if( yygotominor.yy118.pExpr ){
@@ -109062,14 +108671,12 @@
108671 }
108672 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108673 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108674 yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd;
108675 }
 
108676 break;
108677 case 227: /* expr ::= expr in_op LP exprlist RP */
 
108678 {
108679 if( yymsp[-1].minor.yy322==0 ){
108680 /* Expressions of the form
108681 **
108682 ** expr1 IN ()
@@ -109091,14 +108698,12 @@
108698 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108699 }
108700 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108701 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108702 }
 
108703 break;
108704 case 228: /* expr ::= LP select RP */
 
108705 {
108706 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
108707 if( yygotominor.yy118.pExpr ){
108708 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108709 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -109107,14 +108712,12 @@
108712 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108713 }
108714 yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z;
108715 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108716 }
 
108717 break;
108718 case 229: /* expr ::= expr in_op LP select RP */
 
108719 {
108720 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0);
108721 if( yygotominor.yy118.pExpr ){
108722 yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387;
108723 ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect);
@@ -109124,14 +108727,12 @@
108727 }
108728 if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108729 yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart;
108730 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108731 }
 
108732 break;
108733 case 230: /* expr ::= expr in_op nm dbnm */
 
108734 {
108735 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
108736 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0);
108737 if( yygotominor.yy118.pExpr ){
108738 yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
@@ -109142,14 +108743,12 @@
108743 }
108744 if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0);
108745 yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart;
108746 yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n];
108747 }
 
108748 break;
108749 case 231: /* expr ::= EXISTS LP select RP */
 
108750 {
108751 Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
108752 if( p ){
108753 p->x.pSelect = yymsp[-1].minor.yy387;
108754 ExprSetProperty(p, EP_xIsSelect);
@@ -109158,14 +108757,12 @@
108757 sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387);
108758 }
108759 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108760 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108761 }
 
108762 break;
108763 case 232: /* expr ::= CASE case_operand case_exprlist case_else END */
 
108764 {
108765 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0);
108766 if( yygotominor.yy118.pExpr ){
108767 yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322;
108768 sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr);
@@ -109173,50 +108770,38 @@
108770 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
108771 }
108772 yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z;
108773 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108774 }
 
108775 break;
108776 case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
 
108777 {
108778 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr);
108779 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108780 }
 
108781 break;
108782 case 234: /* case_exprlist ::= WHEN expr THEN expr */
 
108783 {
108784 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr);
108785 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr);
108786 }
 
108787 break;
108788 case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
 
108789 {
108790 sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0,
108791 sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4,
108792 &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4);
108793 }
 
108794 break;
108795 case 244: /* uniqueflag ::= UNIQUE */
108796 case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298);
 
108797 {yygotominor.yy4 = OE_Abort;}
 
108798 break;
108799 case 245: /* uniqueflag ::= */
 
108800 {yygotominor.yy4 = OE_None;}
 
108801 break;
108802 case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */
 
108803 {
108804 Expr *p = 0;
108805 if( yymsp[-1].minor.yy0.n>0 ){
108806 p = sqlite3Expr(pParse->db, TK_COLUMN, 0);
108807 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -109224,14 +108809,12 @@
108809 yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p);
108810 sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1);
108811 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108812 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108813 }
 
108814 break;
108815 case 249: /* idxlist ::= nm collate sortorder */
 
108816 {
108817 Expr *p = 0;
108818 if( yymsp[-1].minor.yy0.n>0 ){
108819 p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
108820 sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0);
@@ -109239,307 +108822,214 @@
108822 yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p);
108823 sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1);
108824 sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index");
108825 if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4;
108826 }
 
108827 break;
108828 case 250: /* collate ::= */
 
108829 {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
 
108830 break;
108831 case 252: /* cmd ::= DROP INDEX ifexists fullname */
 
108832 {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
 
108833 break;
108834 case 253: /* cmd ::= VACUUM */
108835 case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254);
 
108836 {sqlite3Vacuum(pParse);}
 
108837 break;
108838 case 255: /* cmd ::= PRAGMA nm dbnm */
 
108839 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
 
108840 break;
108841 case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
 
108842 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
 
108843 break;
108844 case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
 
108845 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
 
108846 break;
108847 case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
 
108848 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
 
108849 break;
108850 case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
 
108851 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
 
108852 break;
108853 case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
 
108854 {
108855 Token all;
108856 all.z = yymsp[-3].minor.yy0.z;
108857 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
108858 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
108859 }
 
108860 break;
108861 case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
 
108862 {
108863 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4);
108864 yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
108865 }
 
108866 break;
108867 case 272: /* trigger_time ::= BEFORE */
108868 case 275: /* trigger_time ::= */ yytestcase(yyruleno==275);
 
108869 { yygotominor.yy4 = TK_BEFORE; }
 
108870 break;
108871 case 273: /* trigger_time ::= AFTER */
 
108872 { yygotominor.yy4 = TK_AFTER; }
 
108873 break;
108874 case 274: /* trigger_time ::= INSTEAD OF */
 
108875 { yygotominor.yy4 = TK_INSTEAD;}
 
108876 break;
108877 case 276: /* trigger_event ::= DELETE|INSERT */
108878 case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277);
 
108879 {yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;}
 
108880 break;
108881 case 278: /* trigger_event ::= UPDATE OF inscollist */
 
108882 {yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;}
 
108883 break;
108884 case 281: /* when_clause ::= */
108885 case 303: /* key_opt ::= */ yytestcase(yyruleno==303);
 
108886 { yygotominor.yy314 = 0; }
 
108887 break;
108888 case 282: /* when_clause ::= WHEN expr */
108889 case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304);
 
108890 { yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; }
 
108891 break;
108892 case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
 
108893 {
108894 assert( yymsp[-2].minor.yy203!=0 );
108895 yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
108896 yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
108897 yygotominor.yy203 = yymsp[-2].minor.yy203;
108898 }
 
108899 break;
108900 case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */
 
108901 {
108902 assert( yymsp[-1].minor.yy203!=0 );
108903 yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
108904 yygotominor.yy203 = yymsp[-1].minor.yy203;
108905 }
 
108906 break;
108907 case 286: /* trnm ::= nm DOT nm */
 
108908 {
108909 yygotominor.yy0 = yymsp[0].minor.yy0;
108910 sqlite3ErrorMsg(pParse,
108911 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
108912 "statements within triggers");
108913 }
 
108914 break;
108915 case 288: /* tridxby ::= INDEXED BY nm */
 
108916 {
108917 sqlite3ErrorMsg(pParse,
108918 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
108919 "within triggers");
108920 }
 
108921 break;
108922 case 289: /* tridxby ::= NOT INDEXED */
 
108923 {
108924 sqlite3ErrorMsg(pParse,
108925 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
108926 "within triggers");
108927 }
 
108928 break;
108929 case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
 
108930 { yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); }
 
108931 break;
108932 case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */
 
108933 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);}
 
108934 break;
108935 case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */
 
108936 {yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);}
 
108937 break;
108938 case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
 
108939 {yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);}
 
108940 break;
108941 case 294: /* trigger_cmd ::= select */
 
108942 {yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); }
 
108943 break;
108944 case 295: /* expr ::= RAISE LP IGNORE RP */
 
108945 {
108946 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
108947 if( yygotominor.yy118.pExpr ){
108948 yygotominor.yy118.pExpr->affinity = OE_Ignore;
108949 }
108950 yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z;
108951 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108952 }
 
108953 break;
108954 case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */
 
108955 {
108956 yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
108957 if( yygotominor.yy118.pExpr ) {
108958 yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4;
108959 }
108960 yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z;
108961 yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
108962 }
 
108963 break;
108964 case 297: /* raisetype ::= ROLLBACK */
 
108965 {yygotominor.yy4 = OE_Rollback;}
 
108966 break;
108967 case 299: /* raisetype ::= FAIL */
 
108968 {yygotominor.yy4 = OE_Fail;}
 
108969 break;
108970 case 300: /* cmd ::= DROP TRIGGER ifexists fullname */
 
108971 {
108972 sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
108973 }
 
108974 break;
108975 case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
 
108976 {
108977 sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314);
108978 }
 
108979 break;
108980 case 302: /* cmd ::= DETACH database_kw_opt expr */
 
108981 {
108982 sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr);
108983 }
 
108984 break;
108985 case 307: /* cmd ::= REINDEX */
 
108986 {sqlite3Reindex(pParse, 0, 0);}
 
108987 break;
108988 case 308: /* cmd ::= REINDEX nm dbnm */
 
108989 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
 
108990 break;
108991 case 309: /* cmd ::= ANALYZE */
 
108992 {sqlite3Analyze(pParse, 0, 0);}
 
108993 break;
108994 case 310: /* cmd ::= ANALYZE nm dbnm */
 
108995 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
 
108996 break;
108997 case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
 
108998 {
108999 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
109000 }
 
109001 break;
109002 case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
 
109003 {
109004 sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
109005 }
 
109006 break;
109007 case 313: /* add_column_fullname ::= fullname */
 
109008 {
109009 pParse->db->lookaside.bEnabled = 0;
109010 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
109011 }
 
109012 break;
109013 case 316: /* cmd ::= create_vtab */
 
109014 {sqlite3VtabFinishParse(pParse,0);}
 
109015 break;
109016 case 317: /* cmd ::= create_vtab LP vtabarglist RP */
 
109017 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
 
109018 break;
109019 case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */
 
109020 {
109021 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
109022 }
 
109023 break;
109024 case 321: /* vtabarg ::= */
 
109025 {sqlite3VtabArgInit(pParse);}
 
109026 break;
109027 case 323: /* vtabargtoken ::= ANY */
109028 case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324);
109029 case 325: /* lp ::= LP */ yytestcase(yyruleno==325);
 
109030 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
 
109031 break;
109032 default:
109033 /* (0) input ::= cmdlist */ yytestcase(yyruleno==0);
109034 /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1);
109035 /* (2) cmdlist ::= ecmd */ yytestcase(yyruleno==2);
@@ -109637,17 +109127,15 @@
109127 int yymajor, /* The major type of the error token */
109128 YYMINORTYPE yyminor /* The minor type of the error token */
109129 ){
109130 sqlite3ParserARG_FETCH;
109131 #define TOKEN (yyminor.yy0)
 
109132
109133 UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */
109134 assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */
109135 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
109136 pParse->parseError = 1;
 
109137 sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
109138 }
109139
109140 /*
109141 ** The following is executed when the parser accepts
@@ -109837,11 +109325,10 @@
109325 return;
109326 }
109327
109328 /************** End of parse.c ***********************************************/
109329 /************** Begin file tokenize.c ****************************************/
 
109330 /*
109331 ** 2001 September 15
109332 **
109333 ** The author disclaims copyright to this source code. In place of
109334 ** a legal notice, here is a blessing:
@@ -109903,11 +109390,10 @@
109390 ** named keywordhash.h and then included into this source file by
109391 ** the #include below.
109392 */
109393 /************** Include keywordhash.h in the middle of tokenize.c ************/
109394 /************** Begin file keywordhash.h *************************************/
 
109395 /***** This file contains automatically generated code ******
109396 **
109397 ** The code in this file has been automatically generated by
109398 **
109399 ** sqlite/tool/mkkeywordhash.c
@@ -110177,11 +109663,10 @@
109663 }
109664 #define SQLITE_N_KEYWORD 121
109665
109666 /************** End of keywordhash.h *****************************************/
109667 /************** Continuing where we left off in tokenize.c *******************/
 
109668
109669
109670 /*
109671 ** If X is a character that can be used in an identifier then
109672 ** IdChar(X) will be true. Otherwise it is false.
@@ -110642,11 +110127,10 @@
110127 return nErr;
110128 }
110129
110130 /************** End of tokenize.c ********************************************/
110131 /************** Begin file complete.c ****************************************/
 
110132 /*
110133 ** 2001 September 15
110134 **
110135 ** The author disclaims copyright to this source code. In place of
110136 ** a legal notice, here is a blessing:
@@ -110928,11 +110412,10 @@
110412 #endif /* SQLITE_OMIT_UTF16 */
110413 #endif /* SQLITE_OMIT_COMPLETE */
110414
110415 /************** End of complete.c ********************************************/
110416 /************** Begin file main.c ********************************************/
 
110417 /*
110418 ** 2001 September 15
110419 **
110420 ** The author disclaims copyright to this source code. In place of
110421 ** a legal notice, here is a blessing:
@@ -110949,11 +110432,10 @@
110432 */
110433
110434 #ifdef SQLITE_ENABLE_FTS3
110435 /************** Include fts3.h in the middle of main.c ***********************/
110436 /************** Begin file fts3.h ********************************************/
 
110437 /*
110438 ** 2006 Oct 10
110439 **
110440 ** The author disclaims copyright to this source code. In place of
110441 ** a legal notice, here is a blessing:
@@ -110978,16 +110460,14 @@
110460 } /* extern "C" */
110461 #endif /* __cplusplus */
110462
110463 /************** End of fts3.h ************************************************/
110464 /************** Continuing where we left off in main.c ***********************/
 
110465 #endif
110466 #ifdef SQLITE_ENABLE_RTREE
110467 /************** Include rtree.h in the middle of main.c **********************/
110468 /************** Begin file rtree.h *******************************************/
 
110469 /*
110470 ** 2008 May 26
110471 **
110472 ** The author disclaims copyright to this source code. In place of
110473 ** a legal notice, here is a blessing:
@@ -111012,16 +110492,14 @@
110492 } /* extern "C" */
110493 #endif /* __cplusplus */
110494
110495 /************** End of rtree.h ***********************************************/
110496 /************** Continuing where we left off in main.c ***********************/
 
110497 #endif
110498 #ifdef SQLITE_ENABLE_ICU
110499 /************** Include sqliteicu.h in the middle of main.c ******************/
110500 /************** Begin file sqliteicu.h ***************************************/
 
110501 /*
110502 ** 2008 May 26
110503 **
110504 ** The author disclaims copyright to this source code. In place of
110505 ** a legal notice, here is a blessing:
@@ -111047,11 +110525,10 @@
110525 #endif /* __cplusplus */
110526
110527
110528 /************** End of sqliteicu.h *******************************************/
110529 /************** Continuing where we left off in main.c ***********************/
 
110530 #endif
110531
110532 #ifndef SQLITE_AMALGAMATION
110533 /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant
110534 ** contains the text of SQLITE_VERSION macro.
@@ -113978,11 +113455,10 @@
113455 return 0;
113456 }
113457
113458 /************** End of main.c ************************************************/
113459 /************** Begin file notify.c ******************************************/
 
113460 /*
113461 ** 2009 March 3
113462 **
113463 ** The author disclaims copyright to this source code. In place of
113464 ** a legal notice, here is a blessing:
@@ -114312,11 +113788,10 @@
113788 }
113789 #endif
113790
113791 /************** End of notify.c **********************************************/
113792 /************** Begin file fts3.c ********************************************/
 
113793 /*
113794 ** 2006 Oct 10
113795 **
113796 ** The author disclaims copyright to this source code. In place of
113797 ** a legal notice, here is a blessing:
@@ -114609,11 +114084,10 @@
114084 ** into a single segment.
114085 */
114086
114087 /************** Include fts3Int.h in the middle of fts3.c ********************/
114088 /************** Begin file fts3Int.h *****************************************/
 
114089 /*
114090 ** 2009 Nov 12
114091 **
114092 ** The author disclaims copyright to this source code. In place of
114093 ** a legal notice, here is a blessing:
@@ -114648,11 +114122,10 @@
114122 SQLITE_API extern const sqlite3_api_routines *sqlite3_api;
114123 #endif
114124
114125 /************** Include fts3_tokenizer.h in the middle of fts3Int.h **********/
114126 /************** Begin file fts3_tokenizer.h **********************************/
 
114127 /*
114128 ** 2006 July 10
114129 **
114130 ** The author disclaims copyright to this source code.
114131 **
@@ -114803,14 +114276,12 @@
114276
114277 #endif /* _FTS3_TOKENIZER_H_ */
114278
114279 /************** End of fts3_tokenizer.h **************************************/
114280 /************** Continuing where we left off in fts3Int.h ********************/
 
114281 /************** Include fts3_hash.h in the middle of fts3Int.h ***************/
114282 /************** Begin file fts3_hash.h ***************************************/
 
114283 /*
114284 ** 2001 September 22
114285 **
114286 ** The author disclaims copyright to this source code. In place of
114287 ** a legal notice, here is a blessing:
@@ -114922,11 +114393,10 @@
114393
114394 #endif /* _FTS3_HASH_H_ */
114395
114396 /************** End of fts3_hash.h *******************************************/
114397 /************** Continuing where we left off in fts3Int.h ********************/
 
114398
114399 /*
114400 ** This constant controls how often segments are merged. Once there are
114401 ** FTS3_MERGE_COUNT segments of level N, they are merged into a single
114402 ** segment of level N+1.
@@ -115399,11 +114869,10 @@
114869 #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */
114870 #endif /* _FTSINT_H */
114871
114872 /************** End of fts3Int.h *********************************************/
114873 /************** Continuing where we left off in fts3.c ***********************/
 
114874 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
114875
114876 #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_CORE)
114877 # define SQLITE_CORE 1
114878 #endif
@@ -119949,11 +119418,10 @@
119418
119419 #endif
119420
119421 /************** End of fts3.c ************************************************/
119422 /************** Begin file fts3_aux.c ****************************************/
 
119423 /*
119424 ** 2011 Jan 27
119425 **
119426 ** The author disclaims copyright to this source code. In place of
119427 ** a legal notice, here is a blessing:
@@ -120426,11 +119894,10 @@
119894
119895 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
119896
119897 /************** End of fts3_aux.c ********************************************/
119898 /************** Begin file fts3_expr.c ***************************************/
 
119899 /*
119900 ** 2008 Nov 28
119901 **
119902 ** The author disclaims copyright to this source code. In place of
119903 ** a legal notice, here is a blessing:
@@ -121393,11 +120860,10 @@
120860 #endif
120861 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
120862
120863 /************** End of fts3_expr.c *******************************************/
120864 /************** Begin file fts3_hash.c ***************************************/
 
120865 /*
120866 ** 2001 September 22
120867 **
120868 ** The author disclaims copyright to this source code. In place of
120869 ** a legal notice, here is a blessing:
@@ -121778,11 +121244,10 @@
121244
121245 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121246
121247 /************** End of fts3_hash.c *******************************************/
121248 /************** Begin file fts3_porter.c *************************************/
 
121249 /*
121250 ** 2006 September 30
121251 **
121252 ** The author disclaims copyright to this source code. In place of
121253 ** a legal notice, here is a blessing:
@@ -122425,11 +121890,10 @@
121890
121891 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
121892
121893 /************** End of fts3_porter.c *****************************************/
121894 /************** Begin file fts3_tokenizer.c **********************************/
 
121895 /*
121896 ** 2007 June 22
121897 **
121898 ** The author disclaims copyright to this source code. In place of
121899 ** a legal notice, here is a blessing:
@@ -122917,11 +122381,10 @@
122381
122382 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122383
122384 /************** End of fts3_tokenizer.c **************************************/
122385 /************** Begin file fts3_tokenizer1.c *********************************/
 
122386 /*
122387 ** 2006 Oct 10
122388 **
122389 ** The author disclaims copyright to this source code. In place of
122390 ** a legal notice, here is a blessing:
@@ -123152,11 +122615,10 @@
122615
122616 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
122617
122618 /************** End of fts3_tokenizer1.c *************************************/
122619 /************** Begin file fts3_write.c **************************************/
 
122620 /*
122621 ** 2009 Oct 23
122622 **
122623 ** The author disclaims copyright to this source code. In place of
122624 ** a legal notice, here is a blessing:
@@ -126423,11 +125885,10 @@
125885
125886 #endif
125887
125888 /************** End of fts3_write.c ******************************************/
125889 /************** Begin file fts3_snippet.c ************************************/
 
125890 /*
125891 ** 2009 Oct 23
125892 **
125893 ** The author disclaims copyright to this source code. In place of
125894 ** a legal notice, here is a blessing:
@@ -127925,11 +127386,10 @@
127386
127387 #endif
127388
127389 /************** End of fts3_snippet.c ****************************************/
127390 /************** Begin file rtree.c *******************************************/
 
127391 /*
127392 ** 2001 September 15
127393 **
127394 ** The author disclaims copyright to this source code. In place of
127395 ** a legal notice, here is a blessing:
@@ -131207,11 +130667,10 @@
130667
130668 #endif
130669
130670 /************** End of rtree.c ***********************************************/
130671 /************** Begin file icu.c *********************************************/
 
130672 /*
130673 ** 2007 May 6
130674 **
130675 ** The author disclaims copyright to this source code. In place of
130676 ** a legal notice, here is a blessing:
@@ -131710,11 +131169,10 @@
131169
131170 #endif
131171
131172 /************** End of icu.c *************************************************/
131173 /************** Begin file fts3_icu.c ****************************************/
 
131174 /*
131175 ** 2007 June 22
131176 **
131177 ** The author disclaims copyright to this source code. In place of
131178 ** a legal notice, here is a blessing:
131179
+3 -3
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107107
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108108
** [sqlite_version()] and [sqlite_source_id()].
109109
*/
110110
#define SQLITE_VERSION "3.7.9"
111111
#define SQLITE_VERSION_NUMBER 3007009
112
-#define SQLITE_SOURCE_ID "2011-10-07 18:24:25 d4f95b3b6e9f4a4072606af5daa17ea7c645382e"
112
+#define SQLITE_SOURCE_ID "2011-10-11 20:41:54 b94a80a832777f0e639f6a81fcfe169bf970a8c0"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
@@ -5827,17 +5827,17 @@
58275827
** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0.
58285828
** </dd>
58295829
**
58305830
** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(<dt>SQLITE_DBSTATUS_CACHE_HIT</dt>
58315831
** <dd>This parameter returns the number of pager cache hits that have
5832
-** occurred. ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT
5832
+** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT
58335833
** is always 0.
58345834
** </dd>
58355835
**
58365836
** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt>
58375837
** <dd>This parameter returns the number of pager cache misses that have
5838
-** occurred. ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS
5838
+** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS
58395839
** is always 0.
58405840
** </dd>
58415841
** </dl>
58425842
*/
58435843
#define SQLITE_DBSTATUS_LOOKASIDE_USED 0
58445844
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.7.9"
111 #define SQLITE_VERSION_NUMBER 3007009
112 #define SQLITE_SOURCE_ID "2011-10-07 18:24:25 d4f95b3b6e9f4a4072606af5daa17ea7c645382e"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
@@ -5827,17 +5827,17 @@
5827 ** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0.
5828 ** </dd>
5829 **
5830 ** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(<dt>SQLITE_DBSTATUS_CACHE_HIT</dt>
5831 ** <dd>This parameter returns the number of pager cache hits that have
5832 ** occurred. ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT
5833 ** is always 0.
5834 ** </dd>
5835 **
5836 ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt>
5837 ** <dd>This parameter returns the number of pager cache misses that have
5838 ** occurred. ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS
5839 ** is always 0.
5840 ** </dd>
5841 ** </dl>
5842 */
5843 #define SQLITE_DBSTATUS_LOOKASIDE_USED 0
5844
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.7.9"
111 #define SQLITE_VERSION_NUMBER 3007009
112 #define SQLITE_SOURCE_ID "2011-10-11 20:41:54 b94a80a832777f0e639f6a81fcfe169bf970a8c0"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
@@ -5827,17 +5827,17 @@
5827 ** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0.
5828 ** </dd>
5829 **
5830 ** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(<dt>SQLITE_DBSTATUS_CACHE_HIT</dt>
5831 ** <dd>This parameter returns the number of pager cache hits that have
5832 ** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT
5833 ** is always 0.
5834 ** </dd>
5835 **
5836 ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt>
5837 ** <dd>This parameter returns the number of pager cache misses that have
5838 ** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS
5839 ** is always 0.
5840 ** </dd>
5841 ** </dl>
5842 */
5843 #define SQLITE_DBSTATUS_LOOKASIDE_USED 0
5844

Keyboard Shortcuts

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