Fossil SCM

Merge trunk. Update to Beta 2 of OpenSSL 1.1.1 (with TLS 1.3 support !!!)

jan.nijtmans 2018-04-11 08:16 openssl-1.1 merge
Commit 87f3c9467735e641c5c2cf0e05e7745d597ba12d06f539a5fb95dafa57eb7a9e
+8
--- src/blob.c
+++ src/blob.c
@@ -114,10 +114,18 @@
114114
return (c>='a' && c<='z') || (c>='A' && c<='Z');
115115
}
116116
int fossil_isalnum(char c){
117117
return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9');
118118
}
119
+
120
+/* Return true if and only if the entire string consists of only
121
+** alphanumeric characters.
122
+*/
123
+int fossil_no_strange_characters(const char *z){
124
+ while( z && (fossil_isalnum(z[0]) || z[0]=='_' || z[0]=='-') ) z++;
125
+ return z[0]==0;
126
+}
119127
120128
121129
/*
122130
** COMMAND: test-isspace
123131
**
124132
--- src/blob.c
+++ src/blob.c
@@ -114,10 +114,18 @@
114 return (c>='a' && c<='z') || (c>='A' && c<='Z');
115 }
116 int fossil_isalnum(char c){
117 return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9');
118 }
 
 
 
 
 
 
 
 
119
120
121 /*
122 ** COMMAND: test-isspace
123 **
124
--- src/blob.c
+++ src/blob.c
@@ -114,10 +114,18 @@
114 return (c>='a' && c<='z') || (c>='A' && c<='Z');
115 }
116 int fossil_isalnum(char c){
117 return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9');
118 }
119
120 /* Return true if and only if the entire string consists of only
121 ** alphanumeric characters.
122 */
123 int fossil_no_strange_characters(const char *z){
124 while( z && (fossil_isalnum(z[0]) || z[0]=='_' || z[0]=='-') ) z++;
125 return z[0]==0;
126 }
127
128
129 /*
130 ** COMMAND: test-isspace
131 **
132
+13 -4
--- src/cache.c
+++ src/cache.c
@@ -165,17 +165,25 @@
165165
sqlite3_bind_int(pStmt, 3, sqlite3_last_insert_rowid(db));
166166
if( sqlite3_step(pStmt)!=SQLITE_DONE) goto cache_write_end;
167167
rc = sqlite3_changes(db);
168168
169169
/* If the write was successful, truncate the cache to keep at most
170
- ** max-cache-entry entries in the cache */
170
+ ** max-cache-entry entries in the cache.
171
+ **
172
+ ** The cache entry replacement algorithm is approximately LRU
173
+ ** (least recently used). However, each access of an entry buys
174
+ ** that entry an extra hour of grace, so that more commonly accessed
175
+ ** entries are held in cache longer. The extra "grace" allotted to
176
+ ** an entry is limited to 2 days worth.
177
+ */
171178
if( rc ){
172179
nKeep = db_get_int("max-cache-entry",10);
173180
sqlite3_finalize(pStmt);
174181
pStmt = cacheStmt(db,
175182
"DELETE FROM cache WHERE rowid IN ("
176
- "SELECT rowid FROM cache ORDER BY tm DESC"
183
+ "SELECT rowid FROM cache"
184
+ " ORDER BY (tm + 3600*min(nRef,48)) DESC"
177185
" LIMIT -1 OFFSET ?1)");
178186
if( pStmt ){
179187
sqlite3_bind_int(pStmt, 1, nKeep);
180188
sqlite3_step(pStmt);
181189
}
@@ -291,11 +299,12 @@
291299
sqlite3_close(db);
292300
fossil_print("cache cleared\n");
293301
}else{
294302
fossil_print("nothing to clear; cache does not exist\n");
295303
}
296
- }else if(( strncmp(zCmd, "list", nCmd)==0 ) || ( strncmp(zCmd, "ls", nCmd)==0 )){
304
+ }else if(( strncmp(zCmd, "list", nCmd)==0 )
305
+ || ( strncmp(zCmd, "ls", nCmd)==0 )){
297306
db = cacheOpen(0);
298307
if( db==0 ){
299308
fossil_print("cache does not exist\n");
300309
}else{
301310
int nEntry = 0;
@@ -350,11 +359,11 @@
350359
char *zDbName = cacheName();
351360
cache_register_sizename(db);
352361
pStmt = cacheStmt(db,
353362
"SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')"
354363
" FROM cache"
355
- " ORDER BY tm DESC"
364
+ " ORDER BY (tm + 3600*min(nRef,48)) DESC"
356365
);
357366
if( pStmt ){
358367
@ <ol>
359368
while( sqlite3_step(pStmt)==SQLITE_ROW ){
360369
const unsigned char *zName = sqlite3_column_text(pStmt,0);
361370
--- src/cache.c
+++ src/cache.c
@@ -165,17 +165,25 @@
165 sqlite3_bind_int(pStmt, 3, sqlite3_last_insert_rowid(db));
166 if( sqlite3_step(pStmt)!=SQLITE_DONE) goto cache_write_end;
167 rc = sqlite3_changes(db);
168
169 /* If the write was successful, truncate the cache to keep at most
170 ** max-cache-entry entries in the cache */
 
 
 
 
 
 
 
171 if( rc ){
172 nKeep = db_get_int("max-cache-entry",10);
173 sqlite3_finalize(pStmt);
174 pStmt = cacheStmt(db,
175 "DELETE FROM cache WHERE rowid IN ("
176 "SELECT rowid FROM cache ORDER BY tm DESC"
 
177 " LIMIT -1 OFFSET ?1)");
178 if( pStmt ){
179 sqlite3_bind_int(pStmt, 1, nKeep);
180 sqlite3_step(pStmt);
181 }
@@ -291,11 +299,12 @@
291 sqlite3_close(db);
292 fossil_print("cache cleared\n");
293 }else{
294 fossil_print("nothing to clear; cache does not exist\n");
295 }
296 }else if(( strncmp(zCmd, "list", nCmd)==0 ) || ( strncmp(zCmd, "ls", nCmd)==0 )){
 
297 db = cacheOpen(0);
298 if( db==0 ){
299 fossil_print("cache does not exist\n");
300 }else{
301 int nEntry = 0;
@@ -350,11 +359,11 @@
350 char *zDbName = cacheName();
351 cache_register_sizename(db);
352 pStmt = cacheStmt(db,
353 "SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')"
354 " FROM cache"
355 " ORDER BY tm DESC"
356 );
357 if( pStmt ){
358 @ <ol>
359 while( sqlite3_step(pStmt)==SQLITE_ROW ){
360 const unsigned char *zName = sqlite3_column_text(pStmt,0);
361
--- src/cache.c
+++ src/cache.c
@@ -165,17 +165,25 @@
165 sqlite3_bind_int(pStmt, 3, sqlite3_last_insert_rowid(db));
166 if( sqlite3_step(pStmt)!=SQLITE_DONE) goto cache_write_end;
167 rc = sqlite3_changes(db);
168
169 /* If the write was successful, truncate the cache to keep at most
170 ** max-cache-entry entries in the cache.
171 **
172 ** The cache entry replacement algorithm is approximately LRU
173 ** (least recently used). However, each access of an entry buys
174 ** that entry an extra hour of grace, so that more commonly accessed
175 ** entries are held in cache longer. The extra "grace" allotted to
176 ** an entry is limited to 2 days worth.
177 */
178 if( rc ){
179 nKeep = db_get_int("max-cache-entry",10);
180 sqlite3_finalize(pStmt);
181 pStmt = cacheStmt(db,
182 "DELETE FROM cache WHERE rowid IN ("
183 "SELECT rowid FROM cache"
184 " ORDER BY (tm + 3600*min(nRef,48)) DESC"
185 " LIMIT -1 OFFSET ?1)");
186 if( pStmt ){
187 sqlite3_bind_int(pStmt, 1, nKeep);
188 sqlite3_step(pStmt);
189 }
@@ -291,11 +299,12 @@
299 sqlite3_close(db);
300 fossil_print("cache cleared\n");
301 }else{
302 fossil_print("nothing to clear; cache does not exist\n");
303 }
304 }else if(( strncmp(zCmd, "list", nCmd)==0 )
305 || ( strncmp(zCmd, "ls", nCmd)==0 )){
306 db = cacheOpen(0);
307 if( db==0 ){
308 fossil_print("cache does not exist\n");
309 }else{
310 int nEntry = 0;
@@ -350,11 +359,11 @@
359 char *zDbName = cacheName();
360 cache_register_sizename(db);
361 pStmt = cacheStmt(db,
362 "SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')"
363 " FROM cache"
364 " ORDER BY (tm + 3600*min(nRef,48)) DESC"
365 );
366 if( pStmt ){
367 @ <ol>
368 while( sqlite3_step(pStmt)==SQLITE_ROW ){
369 const unsigned char *zName = sqlite3_column_text(pStmt,0);
370
+6 -1
--- src/cgi.c
+++ src/cgi.c
@@ -555,10 +555,15 @@
555555
** are ignored.
556556
**
557557
** * it is impossible for a cookie or query parameter to
558558
** override the value of an environment variable since
559559
** environment variables always have uppercase names.
560
+**
561
+** 2018-03-29: Also ignore the entry if NAME that contains any characters
562
+** other than [a-zA-Z0-9_]. There are no known exploits involving unusual
563
+** names that contain characters outside that set, but it never hurts to
564
+** be extra cautious when sanitizing inputs.
560565
**
561566
** Parameters are separated by the "terminator" character. Whitespace
562567
** before the NAME is ignored.
563568
**
564569
** The input string "z" is modified but no copies is made. "z"
@@ -585,11 +590,11 @@
585590
dehttpize(zValue);
586591
}else{
587592
if( *z ){ *z++ = 0; }
588593
zValue = "";
589594
}
590
- if( fossil_islower(zName[0]) ){
595
+ if( fossil_islower(zName[0]) && fossil_no_strange_characters(zName+1) ){
591596
cgi_set_parameter_nocopy(zName, zValue, isQP);
592597
}
593598
#ifdef FOSSIL_ENABLE_JSON
594599
json_setenv( zName, cson_value_new_string(zValue,strlen(zValue)) );
595600
#endif /* FOSSIL_ENABLE_JSON */
596601
--- src/cgi.c
+++ src/cgi.c
@@ -555,10 +555,15 @@
555 ** are ignored.
556 **
557 ** * it is impossible for a cookie or query parameter to
558 ** override the value of an environment variable since
559 ** environment variables always have uppercase names.
 
 
 
 
 
560 **
561 ** Parameters are separated by the "terminator" character. Whitespace
562 ** before the NAME is ignored.
563 **
564 ** The input string "z" is modified but no copies is made. "z"
@@ -585,11 +590,11 @@
585 dehttpize(zValue);
586 }else{
587 if( *z ){ *z++ = 0; }
588 zValue = "";
589 }
590 if( fossil_islower(zName[0]) ){
591 cgi_set_parameter_nocopy(zName, zValue, isQP);
592 }
593 #ifdef FOSSIL_ENABLE_JSON
594 json_setenv( zName, cson_value_new_string(zValue,strlen(zValue)) );
595 #endif /* FOSSIL_ENABLE_JSON */
596
--- src/cgi.c
+++ src/cgi.c
@@ -555,10 +555,15 @@
555 ** are ignored.
556 **
557 ** * it is impossible for a cookie or query parameter to
558 ** override the value of an environment variable since
559 ** environment variables always have uppercase names.
560 **
561 ** 2018-03-29: Also ignore the entry if NAME that contains any characters
562 ** other than [a-zA-Z0-9_]. There are no known exploits involving unusual
563 ** names that contain characters outside that set, but it never hurts to
564 ** be extra cautious when sanitizing inputs.
565 **
566 ** Parameters are separated by the "terminator" character. Whitespace
567 ** before the NAME is ignored.
568 **
569 ** The input string "z" is modified but no copies is made. "z"
@@ -585,11 +590,11 @@
590 dehttpize(zValue);
591 }else{
592 if( *z ){ *z++ = 0; }
593 zValue = "";
594 }
595 if( fossil_islower(zName[0]) && fossil_no_strange_characters(zName+1) ){
596 cgi_set_parameter_nocopy(zName, zValue, isQP);
597 }
598 #ifdef FOSSIL_ENABLE_JSON
599 json_setenv( zName, cson_value_new_string(zValue,strlen(zValue)) );
600 #endif /* FOSSIL_ENABLE_JSON */
601
+4 -2
--- src/clone.c
+++ src/clone.c
@@ -317,14 +317,16 @@
317317
@ you "Download Zip" privileges.
318318
}
319319
}else{
320320
const char *zDLTag = db_get("download-tag","trunk");
321321
const char *zNm = db_get("short-project-name","download");
322
- char *zUrl = href("%R/zip/%t.zip?uuid=%t", zNm, zDLTag);
322
+ char *zUrl = href("%R/zip/%t/%t.zip", zDLTag, zNm);
323323
@ <p>ZIP Archive: %z(zUrl)%h(zNm).zip</a>
324
- zUrl = href("%R/tarball/%t.tar.gz?uuid=%t", zNm, zDLTag);
324
+ zUrl = href("%R/tarball/%t/%t.tar.gz", zDLTag, zNm);
325325
@ <p>Tarball: %z(zUrl)%h(zNm).tar.gz</a>
326
+ zUrl = href("%R/sqlar/%t/%t.sqlar", zDLTag, zNm);
327
+ @ <p>SQLite Archive: %z(zUrl)%h(zNm).sqlar</a>
326328
}
327329
if( !g.perm.Clone ){
328330
@ <p>You are not authorized to clone this repository.
329331
if( g.zLogin==0 || g.zLogin[0]==0 ){
330332
@ Maybe you would be able to clone if you
331333
--- src/clone.c
+++ src/clone.c
@@ -317,14 +317,16 @@
317 @ you "Download Zip" privileges.
318 }
319 }else{
320 const char *zDLTag = db_get("download-tag","trunk");
321 const char *zNm = db_get("short-project-name","download");
322 char *zUrl = href("%R/zip/%t.zip?uuid=%t", zNm, zDLTag);
323 @ <p>ZIP Archive: %z(zUrl)%h(zNm).zip</a>
324 zUrl = href("%R/tarball/%t.tar.gz?uuid=%t", zNm, zDLTag);
325 @ <p>Tarball: %z(zUrl)%h(zNm).tar.gz</a>
 
 
326 }
327 if( !g.perm.Clone ){
328 @ <p>You are not authorized to clone this repository.
329 if( g.zLogin==0 || g.zLogin[0]==0 ){
330 @ Maybe you would be able to clone if you
331
--- src/clone.c
+++ src/clone.c
@@ -317,14 +317,16 @@
317 @ you "Download Zip" privileges.
318 }
319 }else{
320 const char *zDLTag = db_get("download-tag","trunk");
321 const char *zNm = db_get("short-project-name","download");
322 char *zUrl = href("%R/zip/%t/%t.zip", zDLTag, zNm);
323 @ <p>ZIP Archive: %z(zUrl)%h(zNm).zip</a>
324 zUrl = href("%R/tarball/%t/%t.tar.gz", zDLTag, zNm);
325 @ <p>Tarball: %z(zUrl)%h(zNm).tar.gz</a>
326 zUrl = href("%R/sqlar/%t/%t.sqlar", zDLTag, zNm);
327 @ <p>SQLite Archive: %z(zUrl)%h(zNm).sqlar</a>
328 }
329 if( !g.perm.Clone ){
330 @ <p>You are not authorized to clone this repository.
331 if( g.zLogin==0 || g.zLogin[0]==0 ){
332 @ Maybe you would be able to clone if you
333
+3 -3
--- src/info.c
+++ src/info.c
@@ -714,15 +714,15 @@
714714
for(jj=0; zPJ[jj]; jj++){
715715
if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){
716716
zPJ[jj] = '_';
717717
}
718718
}
719
- zUrl = mprintf("%R/tarball/%t-%S.tar.gz?r=%s", zPJ, zUuid, zUuid);
719
+ zUrl = mprintf("%R/tarball/%S/%t-%S.tar.gz", zUuid, zPJ, zUuid);
720720
@ <tr><th>Downloads:</th><td>
721721
@ %z(href("%s",zUrl))Tarball</a>
722
- @ | %z(href("%R/zip/%t-%S.zip?r=%!S",zPJ,zUuid,zUuid))ZIP archive</a>
723
- @ | %z(href("%R/sqlar/%t-%S.sqlar?r=%!S",zPJ,zUuid,zUuid))\
722
+ @ | %z(href("%R/zip/%S/%t-%S.zip",zUuid, zPJ,zUuid))ZIP archive</a>
723
+ @ | %z(href("%R/sqlar/%S/%t-%S.sqlar",zUuid,zPJ,zUuid))\
724724
@ SQL archive</a></td></tr>
725725
fossil_free(zUrl);
726726
blob_reset(&projName);
727727
}
728728
729729
--- src/info.c
+++ src/info.c
@@ -714,15 +714,15 @@
714 for(jj=0; zPJ[jj]; jj++){
715 if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){
716 zPJ[jj] = '_';
717 }
718 }
719 zUrl = mprintf("%R/tarball/%t-%S.tar.gz?r=%s", zPJ, zUuid, zUuid);
720 @ <tr><th>Downloads:</th><td>
721 @ %z(href("%s",zUrl))Tarball</a>
722 @ | %z(href("%R/zip/%t-%S.zip?r=%!S",zPJ,zUuid,zUuid))ZIP archive</a>
723 @ | %z(href("%R/sqlar/%t-%S.sqlar?r=%!S",zPJ,zUuid,zUuid))\
724 @ SQL archive</a></td></tr>
725 fossil_free(zUrl);
726 blob_reset(&projName);
727 }
728
729
--- src/info.c
+++ src/info.c
@@ -714,15 +714,15 @@
714 for(jj=0; zPJ[jj]; jj++){
715 if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){
716 zPJ[jj] = '_';
717 }
718 }
719 zUrl = mprintf("%R/tarball/%S/%t-%S.tar.gz", zUuid, zPJ, zUuid);
720 @ <tr><th>Downloads:</th><td>
721 @ %z(href("%s",zUrl))Tarball</a>
722 @ | %z(href("%R/zip/%S/%t-%S.zip",zUuid, zPJ,zUuid))ZIP archive</a>
723 @ | %z(href("%R/sqlar/%S/%t-%S.sqlar",zUuid,zPJ,zUuid))\
724 @ SQL archive</a></td></tr>
725 fossil_free(zUrl);
726 blob_reset(&projName);
727 }
728
729
+2 -2
--- src/main.mk
+++ src/main.mk
@@ -555,11 +555,11 @@
555555
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
556556
-DSQLITE_ENABLE_DBSTAT_VTAB \
557557
-DSQLITE_ENABLE_JSON1 \
558558
-DSQLITE_ENABLE_FTS5 \
559559
-DSQLITE_ENABLE_STMTVTAB \
560
- -DSQLITE_USE_ZLIB \
560
+ -DSQLITE_HAVE_ZLIB \
561561
-DSQLITE_INTROSPECTION_PRAGMAS \
562562
-DSQLITE_ENABLE_DBPAGE_VTAB
563563
564564
# Setup the options used to compile the included SQLite shell.
565565
SHELL_OPTIONS = -DNDEBUG=1 \
@@ -582,11 +582,11 @@
582582
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
583583
-DSQLITE_ENABLE_DBSTAT_VTAB \
584584
-DSQLITE_ENABLE_JSON1 \
585585
-DSQLITE_ENABLE_FTS5 \
586586
-DSQLITE_ENABLE_STMTVTAB \
587
- -DSQLITE_USE_ZLIB \
587
+ -DSQLITE_HAVE_ZLIB \
588588
-DSQLITE_INTROSPECTION_PRAGMAS \
589589
-DSQLITE_ENABLE_DBPAGE_VTAB \
590590
-Dmain=sqlite3_shell \
591591
-DSQLITE_SHELL_IS_UTF8=1 \
592592
-DSQLITE_OMIT_LOAD_EXTENSION=1 \
593593
--- src/main.mk
+++ src/main.mk
@@ -555,11 +555,11 @@
555 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
556 -DSQLITE_ENABLE_DBSTAT_VTAB \
557 -DSQLITE_ENABLE_JSON1 \
558 -DSQLITE_ENABLE_FTS5 \
559 -DSQLITE_ENABLE_STMTVTAB \
560 -DSQLITE_USE_ZLIB \
561 -DSQLITE_INTROSPECTION_PRAGMAS \
562 -DSQLITE_ENABLE_DBPAGE_VTAB
563
564 # Setup the options used to compile the included SQLite shell.
565 SHELL_OPTIONS = -DNDEBUG=1 \
@@ -582,11 +582,11 @@
582 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
583 -DSQLITE_ENABLE_DBSTAT_VTAB \
584 -DSQLITE_ENABLE_JSON1 \
585 -DSQLITE_ENABLE_FTS5 \
586 -DSQLITE_ENABLE_STMTVTAB \
587 -DSQLITE_USE_ZLIB \
588 -DSQLITE_INTROSPECTION_PRAGMAS \
589 -DSQLITE_ENABLE_DBPAGE_VTAB \
590 -Dmain=sqlite3_shell \
591 -DSQLITE_SHELL_IS_UTF8=1 \
592 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
593
--- src/main.mk
+++ src/main.mk
@@ -555,11 +555,11 @@
555 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
556 -DSQLITE_ENABLE_DBSTAT_VTAB \
557 -DSQLITE_ENABLE_JSON1 \
558 -DSQLITE_ENABLE_FTS5 \
559 -DSQLITE_ENABLE_STMTVTAB \
560 -DSQLITE_HAVE_ZLIB \
561 -DSQLITE_INTROSPECTION_PRAGMAS \
562 -DSQLITE_ENABLE_DBPAGE_VTAB
563
564 # Setup the options used to compile the included SQLite shell.
565 SHELL_OPTIONS = -DNDEBUG=1 \
@@ -582,11 +582,11 @@
582 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
583 -DSQLITE_ENABLE_DBSTAT_VTAB \
584 -DSQLITE_ENABLE_JSON1 \
585 -DSQLITE_ENABLE_FTS5 \
586 -DSQLITE_ENABLE_STMTVTAB \
587 -DSQLITE_HAVE_ZLIB \
588 -DSQLITE_INTROSPECTION_PRAGMAS \
589 -DSQLITE_ENABLE_DBPAGE_VTAB \
590 -Dmain=sqlite3_shell \
591 -DSQLITE_SHELL_IS_UTF8=1 \
592 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
593
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -190,11 +190,11 @@
190190
-DSQLITE_ENABLE_FTS3_PARENTHESIS
191191
-DSQLITE_ENABLE_DBSTAT_VTAB
192192
-DSQLITE_ENABLE_JSON1
193193
-DSQLITE_ENABLE_FTS5
194194
-DSQLITE_ENABLE_STMTVTAB
195
- -DSQLITE_USE_ZLIB
195
+ -DSQLITE_HAVE_ZLIB
196196
-DSQLITE_INTROSPECTION_PRAGMAS
197197
-DSQLITE_ENABLE_DBPAGE_VTAB
198198
}
199199
#lappend SQLITE_OPTIONS -DSQLITE_ENABLE_FTS3=1
200200
#lappend SQLITE_OPTIONS -DSQLITE_ENABLE_STAT4
@@ -701,11 +701,11 @@
701701
#### The directories where the OpenSSL include and library files are located.
702702
# The recommended usage here is to use the Sysinternals junction tool
703703
# to create a hard link between an "openssl-1.x" sub-directory of the
704704
# Fossil source code directory and the target OpenSSL source directory.
705705
#
706
-OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
706
+OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
707707
OPENSSLINCDIR = $(OPENSSLDIR)/include
708708
OPENSSLLIBDIR = $(OPENSSLDIR)
709709
710710
#### Either the directory where the Tcl library is installed or the Tcl
711711
# source code directory resides (depending on the value of the macro
@@ -1553,11 +1553,11 @@
15531553
!ifndef USE_SEE
15541554
USE_SEE = 0
15551555
!endif
15561556
15571557
!if $(FOSSIL_ENABLE_SSL)!=0
1558
-SSLDIR = $(B)\compat\openssl-1.1.0h
1558
+SSLDIR = $(B)\compat\openssl-1.1.1-pre4
15591559
SSLINCDIR = $(SSLDIR)\inc32
15601560
!if $(FOSSIL_DYNAMIC_BUILD)!=0
15611561
SSLLIBDIR = $(SSLDIR)\out32dll
15621562
!else
15631563
SSLLIBDIR = $(SSLDIR)\out32
15641564
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -190,11 +190,11 @@
190 -DSQLITE_ENABLE_FTS3_PARENTHESIS
191 -DSQLITE_ENABLE_DBSTAT_VTAB
192 -DSQLITE_ENABLE_JSON1
193 -DSQLITE_ENABLE_FTS5
194 -DSQLITE_ENABLE_STMTVTAB
195 -DSQLITE_USE_ZLIB
196 -DSQLITE_INTROSPECTION_PRAGMAS
197 -DSQLITE_ENABLE_DBPAGE_VTAB
198 }
199 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_FTS3=1
200 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_STAT4
@@ -701,11 +701,11 @@
701 #### The directories where the OpenSSL include and library files are located.
702 # The recommended usage here is to use the Sysinternals junction tool
703 # to create a hard link between an "openssl-1.x" sub-directory of the
704 # Fossil source code directory and the target OpenSSL source directory.
705 #
706 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
707 OPENSSLINCDIR = $(OPENSSLDIR)/include
708 OPENSSLLIBDIR = $(OPENSSLDIR)
709
710 #### Either the directory where the Tcl library is installed or the Tcl
711 # source code directory resides (depending on the value of the macro
@@ -1553,11 +1553,11 @@
1553 !ifndef USE_SEE
1554 USE_SEE = 0
1555 !endif
1556
1557 !if $(FOSSIL_ENABLE_SSL)!=0
1558 SSLDIR = $(B)\compat\openssl-1.1.0h
1559 SSLINCDIR = $(SSLDIR)\inc32
1560 !if $(FOSSIL_DYNAMIC_BUILD)!=0
1561 SSLLIBDIR = $(SSLDIR)\out32dll
1562 !else
1563 SSLLIBDIR = $(SSLDIR)\out32
1564
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -190,11 +190,11 @@
190 -DSQLITE_ENABLE_FTS3_PARENTHESIS
191 -DSQLITE_ENABLE_DBSTAT_VTAB
192 -DSQLITE_ENABLE_JSON1
193 -DSQLITE_ENABLE_FTS5
194 -DSQLITE_ENABLE_STMTVTAB
195 -DSQLITE_HAVE_ZLIB
196 -DSQLITE_INTROSPECTION_PRAGMAS
197 -DSQLITE_ENABLE_DBPAGE_VTAB
198 }
199 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_FTS3=1
200 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_STAT4
@@ -701,11 +701,11 @@
701 #### The directories where the OpenSSL include and library files are located.
702 # The recommended usage here is to use the Sysinternals junction tool
703 # to create a hard link between an "openssl-1.x" sub-directory of the
704 # Fossil source code directory and the target OpenSSL source directory.
705 #
706 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
707 OPENSSLINCDIR = $(OPENSSLDIR)/include
708 OPENSSLLIBDIR = $(OPENSSLDIR)
709
710 #### Either the directory where the Tcl library is installed or the Tcl
711 # source code directory resides (depending on the value of the macro
@@ -1553,11 +1553,11 @@
1553 !ifndef USE_SEE
1554 USE_SEE = 0
1555 !endif
1556
1557 !if $(FOSSIL_ENABLE_SSL)!=0
1558 SSLDIR = $(B)\compat\openssl-1.1.1-pre4
1559 SSLINCDIR = $(SSLDIR)\inc32
1560 !if $(FOSSIL_DYNAMIC_BUILD)!=0
1561 SSLLIBDIR = $(SSLDIR)\out32dll
1562 !else
1563 SSLLIBDIR = $(SSLDIR)\out32
1564
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -190,11 +190,11 @@
190190
-DSQLITE_ENABLE_FTS3_PARENTHESIS
191191
-DSQLITE_ENABLE_DBSTAT_VTAB
192192
-DSQLITE_ENABLE_JSON1
193193
-DSQLITE_ENABLE_FTS5
194194
-DSQLITE_ENABLE_STMTVTAB
195
- -DSQLITE_USE_ZLIB
195
+ -DSQLITE_HAVE_ZLIB
196196
-DSQLITE_INTROSPECTION_PRAGMAS
197197
-DSQLITE_ENABLE_DBPAGE_VTAB
198198
}
199199
#lappend SQLITE_OPTIONS -DSQLITE_ENABLE_FTS3=1
200200
#lappend SQLITE_OPTIONS -DSQLITE_ENABLE_STAT4
@@ -701,11 +701,11 @@
701701
#### The directories where the OpenSSL include and library files are located.
702702
# The recommended usage here is to use the Sysinternals junction tool
703703
# to create a hard link between an "openssl-1.x" sub-directory of the
704704
# Fossil source code directory and the target OpenSSL source directory.
705705
#
706
-OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
706
+OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
707707
OPENSSLINCDIR = $(OPENSSLDIR)/include
708708
OPENSSLLIBDIR = $(OPENSSLDIR)
709709
710710
#### Either the directory where the Tcl library is installed or the Tcl
711711
# source code directory resides (depending on the value of the macro
@@ -1553,11 +1553,11 @@
15531553
!ifndef USE_SEE
15541554
USE_SEE = 0
15551555
!endif
15561556
15571557
!if $(FOSSIL_ENABLE_SSL)!=0
1558
-SSLDIR = $(B)\compat\openssl-1.1.0h
1558
+SSLDIR = $(B)\compat\openssl-1.1.1-pre4
15591559
SSLINCDIR = $(SSLDIR)\inc32
15601560
!if $(FOSSIL_DYNAMIC_BUILD)!=0
15611561
SSLLIBDIR = $(SSLDIR)\out32dll
15621562
!else
15631563
SSLLIBDIR = $(SSLDIR)\out32
15641564
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -190,11 +190,11 @@
190 -DSQLITE_ENABLE_FTS3_PARENTHESIS
191 -DSQLITE_ENABLE_DBSTAT_VTAB
192 -DSQLITE_ENABLE_JSON1
193 -DSQLITE_ENABLE_FTS5
194 -DSQLITE_ENABLE_STMTVTAB
195 -DSQLITE_USE_ZLIB
196 -DSQLITE_INTROSPECTION_PRAGMAS
197 -DSQLITE_ENABLE_DBPAGE_VTAB
198 }
199 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_FTS3=1
200 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_STAT4
@@ -701,11 +701,11 @@
701 #### The directories where the OpenSSL include and library files are located.
702 # The recommended usage here is to use the Sysinternals junction tool
703 # to create a hard link between an "openssl-1.x" sub-directory of the
704 # Fossil source code directory and the target OpenSSL source directory.
705 #
706 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
707 OPENSSLINCDIR = $(OPENSSLDIR)/include
708 OPENSSLLIBDIR = $(OPENSSLDIR)
709
710 #### Either the directory where the Tcl library is installed or the Tcl
711 # source code directory resides (depending on the value of the macro
@@ -1553,11 +1553,11 @@
1553 !ifndef USE_SEE
1554 USE_SEE = 0
1555 !endif
1556
1557 !if $(FOSSIL_ENABLE_SSL)!=0
1558 SSLDIR = $(B)\compat\openssl-1.1.0h
1559 SSLINCDIR = $(SSLDIR)\inc32
1560 !if $(FOSSIL_DYNAMIC_BUILD)!=0
1561 SSLLIBDIR = $(SSLDIR)\out32dll
1562 !else
1563 SSLLIBDIR = $(SSLDIR)\out32
1564
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -190,11 +190,11 @@
190 -DSQLITE_ENABLE_FTS3_PARENTHESIS
191 -DSQLITE_ENABLE_DBSTAT_VTAB
192 -DSQLITE_ENABLE_JSON1
193 -DSQLITE_ENABLE_FTS5
194 -DSQLITE_ENABLE_STMTVTAB
195 -DSQLITE_HAVE_ZLIB
196 -DSQLITE_INTROSPECTION_PRAGMAS
197 -DSQLITE_ENABLE_DBPAGE_VTAB
198 }
199 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_FTS3=1
200 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_STAT4
@@ -701,11 +701,11 @@
701 #### The directories where the OpenSSL include and library files are located.
702 # The recommended usage here is to use the Sysinternals junction tool
703 # to create a hard link between an "openssl-1.x" sub-directory of the
704 # Fossil source code directory and the target OpenSSL source directory.
705 #
706 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
707 OPENSSLINCDIR = $(OPENSSLDIR)/include
708 OPENSSLLIBDIR = $(OPENSSLDIR)
709
710 #### Either the directory where the Tcl library is installed or the Tcl
711 # source code directory resides (depending on the value of the macro
@@ -1553,11 +1553,11 @@
1553 !ifndef USE_SEE
1554 USE_SEE = 0
1555 !endif
1556
1557 !if $(FOSSIL_ENABLE_SSL)!=0
1558 SSLDIR = $(B)\compat\openssl-1.1.1-pre4
1559 SSLINCDIR = $(SSLDIR)\inc32
1560 !if $(FOSSIL_DYNAMIC_BUILD)!=0
1561 SSLLIBDIR = $(SSLDIR)\out32dll
1562 !else
1563 SSLLIBDIR = $(SSLDIR)\out32
1564
+25 -12
--- src/shell.c
+++ src/shell.c
@@ -148,10 +148,13 @@
148148
# include <fcntl.h>
149149
# define isatty(h) _isatty(h)
150150
# ifndef access
151151
# define access(f,m) _access((f),(m))
152152
# endif
153
+# ifndef unlink
154
+# define unlink _unlink
155
+# endif
153156
# undef popen
154157
# define popen _popen
155158
# undef pclose
156159
# define pclose _pclose
157160
#else
@@ -2140,10 +2143,13 @@
21402143
# include "windows.h"
21412144
# include <io.h>
21422145
# include <direct.h>
21432146
/* # include "test_windirent.h" */
21442147
# define dirent DIRENT
2148
+# ifndef chmod
2149
+# define chmod _chmod
2150
+# endif
21452151
# ifndef stat
21462152
# define stat _stat
21472153
# endif
21482154
# define mkdir(path,mode) _mkdir(path)
21492155
# define lstat(path,buf) stat(path,buf)
@@ -6125,13 +6131,15 @@
61256131
nByte = ZIPFILE_LFH_FIXED_SZ + e.cds.nFile + 9;
61266132
if( (rc = zipfileBufferGrow(&p->body, nByte)) ) goto zipfile_step_out;
61276133
p->body.n += zipfileSerializeLFH(&e, &p->body.a[p->body.n]);
61286134
61296135
/* Append the data to the body of the new archive */
6130
- if( (rc = zipfileBufferGrow(&p->body, nData)) ) goto zipfile_step_out;
6131
- memcpy(&p->body.a[p->body.n], aData, nData);
6132
- p->body.n += nData;
6136
+ if( nData>0 ){
6137
+ if( (rc = zipfileBufferGrow(&p->body, nData)) ) goto zipfile_step_out;
6138
+ memcpy(&p->body.a[p->body.n], aData, nData);
6139
+ p->body.n += nData;
6140
+ }
61336141
61346142
/* Append the CDS record to the directory of the new archive */
61356143
nByte = ZIPFILE_CDS_FIXED_SZ + e.cds.nFile + 9;
61366144
if( (rc = zipfileBufferGrow(&p->cds, nByte)) ) goto zipfile_step_out;
61376145
p->cds.n += zipfileSerializeCDS(&e, &p->cds.a[p->cds.n]);
@@ -11247,11 +11255,10 @@
1124711255
}
1124811256
}
1124911257
return f;
1125011258
}
1125111259
11252
-#if !defined(SQLITE_UNTESTABLE)
1125311260
#if !defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_OMIT_FLOATING_POINT)
1125411261
/*
1125511262
** A routine for handling output from sqlite3_trace().
1125611263
*/
1125711264
static int sql_trace_callback(
@@ -11269,11 +11276,10 @@
1126911276
while( i>0 && z[i-1]==';' ){ i--; }
1127011277
utf8_printf(f, "%.*s;\n", i, z);
1127111278
}
1127211279
return 0;
1127311280
}
11274
-#endif
1127511281
#endif
1127611282
1127711283
/*
1127811284
** A no-op routine that runs with the ".breakpoint" doc-command. This is
1127911285
** a useful spot to set a debugger breakpoint.
@@ -12853,15 +12859,15 @@
1285312859
if( rc!=SQLITE_OK ) goto end_ar_transaction;
1285412860
}
1285512861
rc = arExecSql(pAr, zCreate);
1285612862
}
1285712863
for(i=0; i<pAr->nArg && rc==SQLITE_OK; i++){
12858
- char *zSql = sqlite3_mprintf(zInsertFmt[pAr->bZip], zTab,
12864
+ char *zSql2 = sqlite3_mprintf(zInsertFmt[pAr->bZip], zTab,
1285912865
pAr->bVerbose ? "shell_putsnl(name)" : "name",
1286012866
pAr->azArg[i], pAr->zDir);
12861
- rc = arExecSql(pAr, zSql);
12862
- sqlite3_free(zSql);
12867
+ rc = arExecSql(pAr, zSql2);
12868
+ sqlite3_free(zSql2);
1286312869
}
1286412870
end_ar_transaction:
1286512871
if( rc!=SQLITE_OK ){
1286612872
arExecSql(pAr, "ROLLBACK TO ar; RELEASE ar;");
1286712873
}else{
@@ -14135,12 +14141,12 @@
1413514141
rc = 1;
1413614142
goto meta_command_exit;
1413714143
}
1413814144
}
1413914145
if( zName!=0 ){
14140
- int isMaster = sqlite3_strlike(zName, "sqlite_master", 0)==0;
14141
- if( isMaster || sqlite3_strlike(zName,"sqlite_temp_master",0)==0 ){
14146
+ int isMaster = sqlite3_strlike(zName, "sqlite_master", '\\')==0;
14147
+ if( isMaster || sqlite3_strlike(zName,"sqlite_temp_master", '\\')==0 ){
1414214148
char *new_argv[2], *new_colv[2];
1414314149
new_argv[0] = sqlite3_mprintf(
1414414150
"CREATE TABLE %s (\n"
1414514151
" type text,\n"
1414614152
" name text,\n"
@@ -14196,17 +14202,22 @@
1419614202
}
1419714203
#endif
1419814204
appendText(&sSelect, ") WHERE ", 0);
1419914205
if( zName ){
1420014206
char *zQarg = sqlite3_mprintf("%Q", zName);
14207
+ int bGlob = strchr(zName, '*') != 0 || strchr(zName, '?') != 0 ||
14208
+ strchr(zName, '[') != 0;
1420114209
if( strchr(zName, '.') ){
1420214210
appendText(&sSelect, "lower(printf('%s.%s',sname,tbl_name))", 0);
1420314211
}else{
1420414212
appendText(&sSelect, "lower(tbl_name)", 0);
1420514213
}
14206
- appendText(&sSelect, strchr(zName, '*') ? " GLOB " : " LIKE ", 0);
14214
+ appendText(&sSelect, bGlob ? " GLOB " : " LIKE ", 0);
1420714215
appendText(&sSelect, zQarg, 0);
14216
+ if( !bGlob ){
14217
+ appendText(&sSelect, " ESCAPE '\\' ", 0);
14218
+ }
1420814219
appendText(&sSelect, " AND ", 0);
1420914220
sqlite3_free(zQarg);
1421014221
}
1421114222
appendText(&sSelect, "type!='meta' AND sql IS NOT NULL"
1421214223
" ORDER BY snum, rowid", 0);
@@ -14617,11 +14628,11 @@
1461714628
rc = 1;
1461814629
goto meta_command_exit;
1461914630
}else{
1462014631
zLike = z;
1462114632
bSeparate = 1;
14622
- if( sqlite3_strlike("sqlite_%", zLike, 0)==0 ) bSchema = 1;
14633
+ if( sqlite3_strlike("sqlite\\_%", zLike, '\\')==0 ) bSchema = 1;
1462314634
}
1462414635
}
1462514636
if( bSchema ){
1462614637
zSql = "SELECT lower(name) FROM sqlite_master"
1462714638
" WHERE type='table' AND coalesce(rootpage,0)>1"
@@ -15923,10 +15934,12 @@
1592315934
}else if( strcmp(z,"-zip")==0 ){
1592415935
data.openMode = SHELL_OPEN_ZIPFILE;
1592515936
#endif
1592615937
}else if( strcmp(z,"-append")==0 ){
1592715938
data.openMode = SHELL_OPEN_APPENDVFS;
15939
+ }else if( strcmp(z,"-readonly")==0 ){
15940
+ data.openMode = SHELL_OPEN_READONLY;
1592815941
}else if( strcmp(z,"-ascii")==0 ){
1592915942
data.mode = MODE_Ascii;
1593015943
sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator,
1593115944
SEP_Unit);
1593215945
sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator,
1593315946
--- src/shell.c
+++ src/shell.c
@@ -148,10 +148,13 @@
148 # include <fcntl.h>
149 # define isatty(h) _isatty(h)
150 # ifndef access
151 # define access(f,m) _access((f),(m))
152 # endif
 
 
 
153 # undef popen
154 # define popen _popen
155 # undef pclose
156 # define pclose _pclose
157 #else
@@ -2140,10 +2143,13 @@
2140 # include "windows.h"
2141 # include <io.h>
2142 # include <direct.h>
2143 /* # include "test_windirent.h" */
2144 # define dirent DIRENT
 
 
 
2145 # ifndef stat
2146 # define stat _stat
2147 # endif
2148 # define mkdir(path,mode) _mkdir(path)
2149 # define lstat(path,buf) stat(path,buf)
@@ -6125,13 +6131,15 @@
6125 nByte = ZIPFILE_LFH_FIXED_SZ + e.cds.nFile + 9;
6126 if( (rc = zipfileBufferGrow(&p->body, nByte)) ) goto zipfile_step_out;
6127 p->body.n += zipfileSerializeLFH(&e, &p->body.a[p->body.n]);
6128
6129 /* Append the data to the body of the new archive */
6130 if( (rc = zipfileBufferGrow(&p->body, nData)) ) goto zipfile_step_out;
6131 memcpy(&p->body.a[p->body.n], aData, nData);
6132 p->body.n += nData;
 
 
6133
6134 /* Append the CDS record to the directory of the new archive */
6135 nByte = ZIPFILE_CDS_FIXED_SZ + e.cds.nFile + 9;
6136 if( (rc = zipfileBufferGrow(&p->cds, nByte)) ) goto zipfile_step_out;
6137 p->cds.n += zipfileSerializeCDS(&e, &p->cds.a[p->cds.n]);
@@ -11247,11 +11255,10 @@
11247 }
11248 }
11249 return f;
11250 }
11251
11252 #if !defined(SQLITE_UNTESTABLE)
11253 #if !defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_OMIT_FLOATING_POINT)
11254 /*
11255 ** A routine for handling output from sqlite3_trace().
11256 */
11257 static int sql_trace_callback(
@@ -11269,11 +11276,10 @@
11269 while( i>0 && z[i-1]==';' ){ i--; }
11270 utf8_printf(f, "%.*s;\n", i, z);
11271 }
11272 return 0;
11273 }
11274 #endif
11275 #endif
11276
11277 /*
11278 ** A no-op routine that runs with the ".breakpoint" doc-command. This is
11279 ** a useful spot to set a debugger breakpoint.
@@ -12853,15 +12859,15 @@
12853 if( rc!=SQLITE_OK ) goto end_ar_transaction;
12854 }
12855 rc = arExecSql(pAr, zCreate);
12856 }
12857 for(i=0; i<pAr->nArg && rc==SQLITE_OK; i++){
12858 char *zSql = sqlite3_mprintf(zInsertFmt[pAr->bZip], zTab,
12859 pAr->bVerbose ? "shell_putsnl(name)" : "name",
12860 pAr->azArg[i], pAr->zDir);
12861 rc = arExecSql(pAr, zSql);
12862 sqlite3_free(zSql);
12863 }
12864 end_ar_transaction:
12865 if( rc!=SQLITE_OK ){
12866 arExecSql(pAr, "ROLLBACK TO ar; RELEASE ar;");
12867 }else{
@@ -14135,12 +14141,12 @@
14135 rc = 1;
14136 goto meta_command_exit;
14137 }
14138 }
14139 if( zName!=0 ){
14140 int isMaster = sqlite3_strlike(zName, "sqlite_master", 0)==0;
14141 if( isMaster || sqlite3_strlike(zName,"sqlite_temp_master",0)==0 ){
14142 char *new_argv[2], *new_colv[2];
14143 new_argv[0] = sqlite3_mprintf(
14144 "CREATE TABLE %s (\n"
14145 " type text,\n"
14146 " name text,\n"
@@ -14196,17 +14202,22 @@
14196 }
14197 #endif
14198 appendText(&sSelect, ") WHERE ", 0);
14199 if( zName ){
14200 char *zQarg = sqlite3_mprintf("%Q", zName);
 
 
14201 if( strchr(zName, '.') ){
14202 appendText(&sSelect, "lower(printf('%s.%s',sname,tbl_name))", 0);
14203 }else{
14204 appendText(&sSelect, "lower(tbl_name)", 0);
14205 }
14206 appendText(&sSelect, strchr(zName, '*') ? " GLOB " : " LIKE ", 0);
14207 appendText(&sSelect, zQarg, 0);
 
 
 
14208 appendText(&sSelect, " AND ", 0);
14209 sqlite3_free(zQarg);
14210 }
14211 appendText(&sSelect, "type!='meta' AND sql IS NOT NULL"
14212 " ORDER BY snum, rowid", 0);
@@ -14617,11 +14628,11 @@
14617 rc = 1;
14618 goto meta_command_exit;
14619 }else{
14620 zLike = z;
14621 bSeparate = 1;
14622 if( sqlite3_strlike("sqlite_%", zLike, 0)==0 ) bSchema = 1;
14623 }
14624 }
14625 if( bSchema ){
14626 zSql = "SELECT lower(name) FROM sqlite_master"
14627 " WHERE type='table' AND coalesce(rootpage,0)>1"
@@ -15923,10 +15934,12 @@
15923 }else if( strcmp(z,"-zip")==0 ){
15924 data.openMode = SHELL_OPEN_ZIPFILE;
15925 #endif
15926 }else if( strcmp(z,"-append")==0 ){
15927 data.openMode = SHELL_OPEN_APPENDVFS;
 
 
15928 }else if( strcmp(z,"-ascii")==0 ){
15929 data.mode = MODE_Ascii;
15930 sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator,
15931 SEP_Unit);
15932 sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator,
15933
--- src/shell.c
+++ src/shell.c
@@ -148,10 +148,13 @@
148 # include <fcntl.h>
149 # define isatty(h) _isatty(h)
150 # ifndef access
151 # define access(f,m) _access((f),(m))
152 # endif
153 # ifndef unlink
154 # define unlink _unlink
155 # endif
156 # undef popen
157 # define popen _popen
158 # undef pclose
159 # define pclose _pclose
160 #else
@@ -2140,10 +2143,13 @@
2143 # include "windows.h"
2144 # include <io.h>
2145 # include <direct.h>
2146 /* # include "test_windirent.h" */
2147 # define dirent DIRENT
2148 # ifndef chmod
2149 # define chmod _chmod
2150 # endif
2151 # ifndef stat
2152 # define stat _stat
2153 # endif
2154 # define mkdir(path,mode) _mkdir(path)
2155 # define lstat(path,buf) stat(path,buf)
@@ -6125,13 +6131,15 @@
6131 nByte = ZIPFILE_LFH_FIXED_SZ + e.cds.nFile + 9;
6132 if( (rc = zipfileBufferGrow(&p->body, nByte)) ) goto zipfile_step_out;
6133 p->body.n += zipfileSerializeLFH(&e, &p->body.a[p->body.n]);
6134
6135 /* Append the data to the body of the new archive */
6136 if( nData>0 ){
6137 if( (rc = zipfileBufferGrow(&p->body, nData)) ) goto zipfile_step_out;
6138 memcpy(&p->body.a[p->body.n], aData, nData);
6139 p->body.n += nData;
6140 }
6141
6142 /* Append the CDS record to the directory of the new archive */
6143 nByte = ZIPFILE_CDS_FIXED_SZ + e.cds.nFile + 9;
6144 if( (rc = zipfileBufferGrow(&p->cds, nByte)) ) goto zipfile_step_out;
6145 p->cds.n += zipfileSerializeCDS(&e, &p->cds.a[p->cds.n]);
@@ -11247,11 +11255,10 @@
11255 }
11256 }
11257 return f;
11258 }
11259
 
11260 #if !defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_OMIT_FLOATING_POINT)
11261 /*
11262 ** A routine for handling output from sqlite3_trace().
11263 */
11264 static int sql_trace_callback(
@@ -11269,11 +11276,10 @@
11276 while( i>0 && z[i-1]==';' ){ i--; }
11277 utf8_printf(f, "%.*s;\n", i, z);
11278 }
11279 return 0;
11280 }
 
11281 #endif
11282
11283 /*
11284 ** A no-op routine that runs with the ".breakpoint" doc-command. This is
11285 ** a useful spot to set a debugger breakpoint.
@@ -12853,15 +12859,15 @@
12859 if( rc!=SQLITE_OK ) goto end_ar_transaction;
12860 }
12861 rc = arExecSql(pAr, zCreate);
12862 }
12863 for(i=0; i<pAr->nArg && rc==SQLITE_OK; i++){
12864 char *zSql2 = sqlite3_mprintf(zInsertFmt[pAr->bZip], zTab,
12865 pAr->bVerbose ? "shell_putsnl(name)" : "name",
12866 pAr->azArg[i], pAr->zDir);
12867 rc = arExecSql(pAr, zSql2);
12868 sqlite3_free(zSql2);
12869 }
12870 end_ar_transaction:
12871 if( rc!=SQLITE_OK ){
12872 arExecSql(pAr, "ROLLBACK TO ar; RELEASE ar;");
12873 }else{
@@ -14135,12 +14141,12 @@
14141 rc = 1;
14142 goto meta_command_exit;
14143 }
14144 }
14145 if( zName!=0 ){
14146 int isMaster = sqlite3_strlike(zName, "sqlite_master", '\\')==0;
14147 if( isMaster || sqlite3_strlike(zName,"sqlite_temp_master", '\\')==0 ){
14148 char *new_argv[2], *new_colv[2];
14149 new_argv[0] = sqlite3_mprintf(
14150 "CREATE TABLE %s (\n"
14151 " type text,\n"
14152 " name text,\n"
@@ -14196,17 +14202,22 @@
14202 }
14203 #endif
14204 appendText(&sSelect, ") WHERE ", 0);
14205 if( zName ){
14206 char *zQarg = sqlite3_mprintf("%Q", zName);
14207 int bGlob = strchr(zName, '*') != 0 || strchr(zName, '?') != 0 ||
14208 strchr(zName, '[') != 0;
14209 if( strchr(zName, '.') ){
14210 appendText(&sSelect, "lower(printf('%s.%s',sname,tbl_name))", 0);
14211 }else{
14212 appendText(&sSelect, "lower(tbl_name)", 0);
14213 }
14214 appendText(&sSelect, bGlob ? " GLOB " : " LIKE ", 0);
14215 appendText(&sSelect, zQarg, 0);
14216 if( !bGlob ){
14217 appendText(&sSelect, " ESCAPE '\\' ", 0);
14218 }
14219 appendText(&sSelect, " AND ", 0);
14220 sqlite3_free(zQarg);
14221 }
14222 appendText(&sSelect, "type!='meta' AND sql IS NOT NULL"
14223 " ORDER BY snum, rowid", 0);
@@ -14617,11 +14628,11 @@
14628 rc = 1;
14629 goto meta_command_exit;
14630 }else{
14631 zLike = z;
14632 bSeparate = 1;
14633 if( sqlite3_strlike("sqlite\\_%", zLike, '\\')==0 ) bSchema = 1;
14634 }
14635 }
14636 if( bSchema ){
14637 zSql = "SELECT lower(name) FROM sqlite_master"
14638 " WHERE type='table' AND coalesce(rootpage,0)>1"
@@ -15923,10 +15934,12 @@
15934 }else if( strcmp(z,"-zip")==0 ){
15935 data.openMode = SHELL_OPEN_ZIPFILE;
15936 #endif
15937 }else if( strcmp(z,"-append")==0 ){
15938 data.openMode = SHELL_OPEN_APPENDVFS;
15939 }else if( strcmp(z,"-readonly")==0 ){
15940 data.openMode = SHELL_OPEN_READONLY;
15941 }else if( strcmp(z,"-ascii")==0 ){
15942 data.mode = MODE_Ascii;
15943 sqlite3_snprintf(sizeof(data.colSeparator), data.colSeparator,
15944 SEP_Unit);
15945 sqlite3_snprintf(sizeof(data.rowSeparator), data.rowSeparator,
15946
+2372 -1409
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3
-** version 3.23.0. By combining all the individual C code files into this
3
+** version 3.23.1. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% or more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -1145,13 +1145,13 @@
11451145
**
11461146
** See also: [sqlite3_libversion()],
11471147
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11481148
** [sqlite_version()] and [sqlite_source_id()].
11491149
*/
1150
-#define SQLITE_VERSION "3.23.0"
1151
-#define SQLITE_VERSION_NUMBER 3023000
1152
-#define SQLITE_SOURCE_ID "2018-03-22 17:13:44 eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27ef01"
1150
+#define SQLITE_VERSION "3.23.1"
1151
+#define SQLITE_VERSION_NUMBER 3023001
1152
+#define SQLITE_SOURCE_ID "2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b"
11531153
11541154
/*
11551155
** CAPI3REF: Run-Time Library Version Numbers
11561156
** KEYWORDS: sqlite3_version sqlite3_sourceid
11571157
**
@@ -2086,10 +2086,16 @@
20862086
** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back.
20872087
** ^This file control takes the file descriptor out of batch write mode
20882088
** so that all subsequent write operations are independent.
20892089
** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without
20902090
** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE].
2091
+**
2092
+** <li>[[SQLITE_FCNTL_LOCK_TIMEOUT]]
2093
+** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode causes attempts to obtain
2094
+** a file lock using the xLock or xShmLock methods of the VFS to wait
2095
+** for up to M milliseconds before failing, where M is the single
2096
+** unsigned integer parameter.
20912097
** </ul>
20922098
*/
20932099
#define SQLITE_FCNTL_LOCKSTATE 1
20942100
#define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
20952101
#define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -2120,10 +2126,11 @@
21202126
#define SQLITE_FCNTL_WIN32_GET_HANDLE 29
21212127
#define SQLITE_FCNTL_PDB 30
21222128
#define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31
21232129
#define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32
21242130
#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33
2131
+#define SQLITE_FCNTL_LOCK_TIMEOUT 34
21252132
21262133
/* deprecated names */
21272134
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
21282135
#define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
21292136
#define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -9833,11 +9840,11 @@
98339840
98349841
/*
98359842
** CAPI3REF: Deserialize a database
98369843
**
98379844
** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the
9838
-** [database connection] D to disconnection from database S and then
9845
+** [database connection] D to disconnect from database S and then
98399846
** reopen S as an in-memory database based on the serialization contained
98409847
** in P. The serialized database P is N bytes in size. M is the size of
98419848
** the buffer P, which might be larger than N. If M is larger than N, and
98429849
** the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is
98439850
** permitted to add content to the in-memory database as long as the total
@@ -10974,23 +10981,22 @@
1097410981
SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*);
1097510982
1097610983
/*
1097710984
** CAPI3REF: Apply A Changeset To A Database
1097810985
**
10979
-** Apply a changeset to a database. This function attempts to update the
10980
-** "main" database attached to handle db with the changes found in the
10981
-** changeset passed via the second and third arguments.
10986
+** Apply a changeset or patchset to a database. These functions attempt to
10987
+** update the "main" database attached to handle db with the changes found in
10988
+** the changeset passed via the second and third arguments.
1098210989
**
10983
-** The fourth argument (xFilter) passed to this function is the "filter
10990
+** The fourth argument (xFilter) passed to these functions is the "filter
1098410991
** callback". If it is not NULL, then for each table affected by at least one
1098510992
** change in the changeset, the filter callback is invoked with
1098610993
** the table name as the second argument, and a copy of the context pointer
10987
-** passed as the sixth argument to this function as the first. If the "filter
10988
-** callback" returns zero, then no attempt is made to apply any changes to
10989
-** the table. Otherwise, if the return value is non-zero or the xFilter
10990
-** argument to this function is NULL, all changes related to the table are
10991
-** attempted.
10994
+** passed as the sixth argument as the first. If the "filter callback"
10995
+** returns zero, then no attempt is made to apply any changes to the table.
10996
+** Otherwise, if the return value is non-zero or the xFilter argument to
10997
+** is NULL, all changes related to the table are attempted.
1099210998
**
1099310999
** For each table that is not excluded by the filter callback, this function
1099411000
** tests that the target database contains a compatible table. A table is
1099511001
** considered compatible if all of the following are true:
1099611002
**
@@ -11031,11 +11037,11 @@
1103111037
** the documentation for the three
1103211038
** [SQLITE_CHANGESET_OMIT|available return values] for details.
1103311039
**
1103411040
** <dl>
1103511041
** <dt>DELETE Changes<dd>
11036
-** For each DELETE change, this function checks if the target database
11042
+** For each DELETE change, the function checks if the target database
1103711043
** contains a row with the same primary key value (or values) as the
1103811044
** original row values stored in the changeset. If it does, and the values
1103911045
** stored in all non-primary key columns also match the values stored in
1104011046
** the changeset the row is deleted from the target database.
1104111047
**
@@ -11076,11 +11082,11 @@
1107611082
** This includes the case where the INSERT operation is re-attempted because
1107711083
** an earlier call to the conflict handler function returned
1107811084
** [SQLITE_CHANGESET_REPLACE].
1107911085
**
1108011086
** <dt>UPDATE Changes<dd>
11081
-** For each UPDATE change, this function checks if the target database
11087
+** For each UPDATE change, the function checks if the target database
1108211088
** contains a row with the same primary key value (or values) as the
1108311089
** original row values stored in the changeset. If it does, and the values
1108411090
** stored in all modified non-primary key columns also match the values
1108511091
** stored in the changeset the row is updated within the target database.
1108611092
**
@@ -11107,15 +11113,32 @@
1110711113
** It is safe to execute SQL statements, including those that write to the
1110811114
** table that the callback related to, from within the xConflict callback.
1110911115
** This can be used to further customize the applications conflict
1111011116
** resolution strategy.
1111111117
**
11112
-** All changes made by this function are enclosed in a savepoint transaction.
11118
+** All changes made by these functions are enclosed in a savepoint transaction.
1111311119
** If any other error (aside from a constraint failure when attempting to
1111411120
** write to the target database) occurs, then the savepoint transaction is
1111511121
** rolled back, restoring the target database to its original state, and an
1111611122
** SQLite error code returned.
11123
+**
11124
+** If the output parameters (ppRebase) and (pnRebase) are non-NULL and
11125
+** the input is a changeset (not a patchset), then sqlite3changeset_apply_v2()
11126
+** may set (*ppRebase) to point to a "rebase" that may be used with the
11127
+** sqlite3_rebaser APIs buffer before returning. In this case (*pnRebase)
11128
+** is set to the size of the buffer in bytes. It is the responsibility of the
11129
+** caller to eventually free any such buffer using sqlite3_free(). The buffer
11130
+** is only allocated and populated if one or more conflicts were encountered
11131
+** while applying the patchset. See comments surrounding the sqlite3_rebaser
11132
+** APIs for further details.
11133
+**
11134
+** The behavior of sqlite3changeset_apply_v2() and its streaming equivalent
11135
+** may be modified by passing a combination of
11136
+** [SQLITE_CHANGESETAPPLY_NOSAVEPOINT | supported flags] as the 9th parameter.
11137
+**
11138
+** Note that the sqlite3changeset_apply_v2() API is still <b>experimental</b>
11139
+** and therefore subject to change.
1111711140
*/
1111811141
SQLITE_API int sqlite3changeset_apply(
1111911142
sqlite3 *db, /* Apply change to "main" db of this handle */
1112011143
int nChangeset, /* Size of changeset in bytes */
1112111144
void *pChangeset, /* Changeset blob */
@@ -11128,10 +11151,45 @@
1112811151
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
1112911152
sqlite3_changeset_iter *p /* Handle describing change and conflict */
1113011153
),
1113111154
void *pCtx /* First argument passed to xConflict */
1113211155
);
11156
+SQLITE_API int sqlite3changeset_apply_v2(
11157
+ sqlite3 *db, /* Apply change to "main" db of this handle */
11158
+ int nChangeset, /* Size of changeset in bytes */
11159
+ void *pChangeset, /* Changeset blob */
11160
+ int(*xFilter)(
11161
+ void *pCtx, /* Copy of sixth arg to _apply() */
11162
+ const char *zTab /* Table name */
11163
+ ),
11164
+ int(*xConflict)(
11165
+ void *pCtx, /* Copy of sixth arg to _apply() */
11166
+ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
11167
+ sqlite3_changeset_iter *p /* Handle describing change and conflict */
11168
+ ),
11169
+ void *pCtx, /* First argument passed to xConflict */
11170
+ void **ppRebase, int *pnRebase, /* OUT: Rebase data */
11171
+ int flags /* Combination of SESSION_APPLY_* flags */
11172
+);
11173
+
11174
+/*
11175
+** CAPI3REF: Flags for sqlite3changeset_apply_v2
11176
+**
11177
+** The following flags may passed via the 9th parameter to
11178
+** [sqlite3changeset_apply_v2] and [sqlite3changeset_apply_v2_strm]:
11179
+**
11180
+** <dl>
11181
+** <dt>SQLITE_CHANGESETAPPLY_NOSAVEPOINT <dd>
11182
+** Usually, the sessions module encloses all operations performed by
11183
+** a single call to apply_v2() or apply_v2_strm() in a [SAVEPOINT]. The
11184
+** SAVEPOINT is committed if the changeset or patchset is successfully
11185
+** applied, or rolled back if an error occurs. Specifying this flag
11186
+** causes the sessions module to omit this savepoint. In this case, if the
11187
+** caller has an open transaction or savepoint when apply_v2() is called,
11188
+** it may revert the partially applied changeset by rolling it back.
11189
+*/
11190
+#define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001
1113311191
1113411192
/*
1113511193
** CAPI3REF: Constants Passed To The Conflict Handler
1113611194
**
1113711195
** Values that may be passed as the second argument to a conflict-handler.
@@ -11225,19 +11283,175 @@
1122511283
*/
1122611284
#define SQLITE_CHANGESET_OMIT 0
1122711285
#define SQLITE_CHANGESET_REPLACE 1
1122811286
#define SQLITE_CHANGESET_ABORT 2
1122911287
11288
+/*
11289
+** CAPI3REF: Rebasing changesets
11290
+** EXPERIMENTAL
11291
+**
11292
+** Suppose there is a site hosting a database in state S0. And that
11293
+** modifications are made that move that database to state S1 and a
11294
+** changeset recorded (the "local" changeset). Then, a changeset based
11295
+** on S0 is received from another site (the "remote" changeset) and
11296
+** applied to the database. The database is then in state
11297
+** (S1+"remote"), where the exact state depends on any conflict
11298
+** resolution decisions (OMIT or REPLACE) made while applying "remote".
11299
+** Rebasing a changeset is to update it to take those conflict
11300
+** resolution decisions into account, so that the same conflicts
11301
+** do not have to be resolved elsewhere in the network.
11302
+**
11303
+** For example, if both the local and remote changesets contain an
11304
+** INSERT of the same key on "CREATE TABLE t1(a PRIMARY KEY, b)":
11305
+**
11306
+** local: INSERT INTO t1 VALUES(1, 'v1');
11307
+** remote: INSERT INTO t1 VALUES(1, 'v2');
11308
+**
11309
+** and the conflict resolution is REPLACE, then the INSERT change is
11310
+** removed from the local changeset (it was overridden). Or, if the
11311
+** conflict resolution was "OMIT", then the local changeset is modified
11312
+** to instead contain:
11313
+**
11314
+** UPDATE t1 SET b = 'v2' WHERE a=1;
11315
+**
11316
+** Changes within the local changeset are rebased as follows:
11317
+**
11318
+** <dl>
11319
+** <dt>Local INSERT<dd>
11320
+** This may only conflict with a remote INSERT. If the conflict
11321
+** resolution was OMIT, then add an UPDATE change to the rebased
11322
+** changeset. Or, if the conflict resolution was REPLACE, add
11323
+** nothing to the rebased changeset.
11324
+**
11325
+** <dt>Local DELETE<dd>
11326
+** This may conflict with a remote UPDATE or DELETE. In both cases the
11327
+** only possible resolution is OMIT. If the remote operation was a
11328
+** DELETE, then add no change to the rebased changeset. If the remote
11329
+** operation was an UPDATE, then the old.* fields of change are updated
11330
+** to reflect the new.* values in the UPDATE.
11331
+**
11332
+** <dt>Local UPDATE<dd>
11333
+** This may conflict with a remote UPDATE or DELETE. If it conflicts
11334
+** with a DELETE, and the conflict resolution was OMIT, then the update
11335
+** is changed into an INSERT. Any undefined values in the new.* record
11336
+** from the update change are filled in using the old.* values from
11337
+** the conflicting DELETE. Or, if the conflict resolution was REPLACE,
11338
+** the UPDATE change is simply omitted from the rebased changeset.
11339
+**
11340
+** If conflict is with a remote UPDATE and the resolution is OMIT, then
11341
+** the old.* values are rebased using the new.* values in the remote
11342
+** change. Or, if the resolution is REPLACE, then the change is copied
11343
+** into the rebased changeset with updates to columns also updated by
11344
+** the conflicting remote UPDATE removed. If this means no columns would
11345
+** be updated, the change is omitted.
11346
+** </dl>
11347
+**
11348
+** A local change may be rebased against multiple remote changes
11349
+** simultaneously. If a single key is modified by multiple remote
11350
+** changesets, they are combined as follows before the local changeset
11351
+** is rebased:
11352
+**
11353
+** <ul>
11354
+** <li> If there has been one or more REPLACE resolutions on a
11355
+** key, it is rebased according to a REPLACE.
11356
+**
11357
+** <li> If there have been no REPLACE resolutions on a key, then
11358
+** the local changeset is rebased according to the most recent
11359
+** of the OMIT resolutions.
11360
+** </ul>
11361
+**
11362
+** Note that conflict resolutions from multiple remote changesets are
11363
+** combined on a per-field basis, not per-row. This means that in the
11364
+** case of multiple remote UPDATE operations, some fields of a single
11365
+** local change may be rebased for REPLACE while others are rebased for
11366
+** OMIT.
11367
+**
11368
+** In order to rebase a local changeset, the remote changeset must first
11369
+** be applied to the local database using sqlite3changeset_apply_v2() and
11370
+** the buffer of rebase information captured. Then:
11371
+**
11372
+** <ol>
11373
+** <li> An sqlite3_rebaser object is created by calling
11374
+** sqlite3rebaser_create().
11375
+** <li> The new object is configured with the rebase buffer obtained from
11376
+** sqlite3changeset_apply_v2() by calling sqlite3rebaser_configure().
11377
+** If the local changeset is to be rebased against multiple remote
11378
+** changesets, then sqlite3rebaser_configure() should be called
11379
+** multiple times, in the same order that the multiple
11380
+** sqlite3changeset_apply_v2() calls were made.
11381
+** <li> Each local changeset is rebased by calling sqlite3rebaser_rebase().
11382
+** <li> The sqlite3_rebaser object is deleted by calling
11383
+** sqlite3rebaser_delete().
11384
+** </ol>
11385
+*/
11386
+typedef struct sqlite3_rebaser sqlite3_rebaser;
11387
+
11388
+/*
11389
+** CAPI3REF: Create a changeset rebaser object.
11390
+** EXPERIMENTAL
11391
+**
11392
+** Allocate a new changeset rebaser object. If successful, set (*ppNew) to
11393
+** point to the new object and return SQLITE_OK. Otherwise, if an error
11394
+** occurs, return an SQLite error code (e.g. SQLITE_NOMEM) and set (*ppNew)
11395
+** to NULL.
11396
+*/
11397
+SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew);
11398
+
11399
+/*
11400
+** CAPI3REF: Configure a changeset rebaser object.
11401
+** EXPERIMENTAL
11402
+**
11403
+** Configure the changeset rebaser object to rebase changesets according
11404
+** to the conflict resolutions described by buffer pRebase (size nRebase
11405
+** bytes), which must have been obtained from a previous call to
11406
+** sqlite3changeset_apply_v2().
11407
+*/
11408
+SQLITE_API int sqlite3rebaser_configure(
11409
+ sqlite3_rebaser*,
11410
+ int nRebase, const void *pRebase
11411
+);
11412
+
11413
+/*
11414
+** CAPI3REF: Rebase a changeset
11415
+** EXPERIMENTAL
11416
+**
11417
+** Argument pIn must point to a buffer containing a changeset nIn bytes
11418
+** in size. This function allocates and populates a buffer with a copy
11419
+** of the changeset rebased rebased according to the configuration of the
11420
+** rebaser object passed as the first argument. If successful, (*ppOut)
11421
+** is set to point to the new buffer containing the rebased changset and
11422
+** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the
11423
+** responsibility of the caller to eventually free the new buffer using
11424
+** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut)
11425
+** are set to zero and an SQLite error code returned.
11426
+*/
11427
+SQLITE_API int sqlite3rebaser_rebase(
11428
+ sqlite3_rebaser*,
11429
+ int nIn, const void *pIn,
11430
+ int *pnOut, void **ppOut
11431
+);
11432
+
11433
+/*
11434
+** CAPI3REF: Delete a changeset rebaser object.
11435
+** EXPERIMENTAL
11436
+**
11437
+** Delete the changeset rebaser object and all associated resources. There
11438
+** should be one call to this function for each successful invocation
11439
+** of sqlite3rebaser_create().
11440
+*/
11441
+SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p);
11442
+
1123011443
/*
1123111444
** CAPI3REF: Streaming Versions of API functions.
1123211445
**
1123311446
** The six streaming API xxx_strm() functions serve similar purposes to the
1123411447
** corresponding non-streaming API functions:
1123511448
**
1123611449
** <table border=1 style="margin-left:8ex;margin-right:8ex">
1123711450
** <tr><th>Streaming function<th>Non-streaming equivalent</th>
1123811451
** <tr><td>sqlite3changeset_apply_strm<td>[sqlite3changeset_apply]
11452
+** <tr><td>sqlite3changeset_apply_strm_v2<td>[sqlite3changeset_apply_v2]
1123911453
** <tr><td>sqlite3changeset_concat_strm<td>[sqlite3changeset_concat]
1124011454
** <tr><td>sqlite3changeset_invert_strm<td>[sqlite3changeset_invert]
1124111455
** <tr><td>sqlite3changeset_start_strm<td>[sqlite3changeset_start]
1124211456
** <tr><td>sqlite3session_changeset_strm<td>[sqlite3session_changeset]
1124311457
** <tr><td>sqlite3session_patchset_strm<td>[sqlite3session_patchset]
@@ -11328,10 +11542,27 @@
1132811542
void *pCtx, /* Copy of sixth arg to _apply() */
1132911543
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
1133011544
sqlite3_changeset_iter *p /* Handle describing change and conflict */
1133111545
),
1133211546
void *pCtx /* First argument passed to xConflict */
11547
+);
11548
+SQLITE_API int sqlite3changeset_apply_v2_strm(
11549
+ sqlite3 *db, /* Apply change to "main" db of this handle */
11550
+ int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
11551
+ void *pIn, /* First arg for xInput */
11552
+ int(*xFilter)(
11553
+ void *pCtx, /* Copy of sixth arg to _apply() */
11554
+ const char *zTab /* Table name */
11555
+ ),
11556
+ int(*xConflict)(
11557
+ void *pCtx, /* Copy of sixth arg to _apply() */
11558
+ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
11559
+ sqlite3_changeset_iter *p /* Handle describing change and conflict */
11560
+ ),
11561
+ void *pCtx, /* First argument passed to xConflict */
11562
+ void **ppRebase, int *pnRebase,
11563
+ int flags
1133311564
);
1133411565
SQLITE_API int sqlite3changeset_concat_strm(
1133511566
int (*xInputA)(void *pIn, void *pData, int *pnData),
1133611567
void *pInA,
1133711568
int (*xInputB)(void *pIn, void *pData, int *pnData),
@@ -11365,10 +11596,17 @@
1136511596
void *pIn
1136611597
);
1136711598
SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup*,
1136811599
int (*xOutput)(void *pOut, const void *pData, int nData),
1136911600
void *pOut
11601
+);
11602
+SQLITE_API int sqlite3rebaser_rebase_strm(
11603
+ sqlite3_rebaser *pRebaser,
11604
+ int (*xInput)(void *pIn, void *pData, int *pnData),
11605
+ void *pIn,
11606
+ int (*xOutput)(void *pOut, const void *pData, int nData),
11607
+ void *pOut
1137011608
);
1137111609
1137211610
1137311611
/*
1137411612
** Make sure we can call this stuff from C++.
@@ -13245,13 +13483,14 @@
1324513483
** handle is passed a pointer to sqlite.busyHandler. The busy-handler
1324613484
** callback is currently invoked only from within pager.c.
1324713485
*/
1324813486
typedef struct BusyHandler BusyHandler;
1324913487
struct BusyHandler {
13250
- int (*xFunc)(void *,int); /* The busy callback */
13251
- void *pArg; /* First arg to busy callback */
13252
- int nBusy; /* Incremented with each busy call */
13488
+ int (*xBusyHandler)(void *,int); /* The busy callback */
13489
+ void *pBusyArg; /* First arg to busy callback */
13490
+ int nBusy; /* Incremented with each busy call */
13491
+ u8 bExtraFileArg; /* Include sqlite3_file as callback arg */
1325313492
};
1325413493
1325513494
/*
1325613495
** Name of the master database table. The master database table
1325713496
** is a special table that holds the names and attributes of all
@@ -14456,11 +14695,11 @@
1445614695
);
1445714696
SQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager, sqlite3*);
1445814697
SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
1445914698
1446014699
/* Functions used to configure a Pager object. */
14461
-SQLITE_PRIVATE void sqlite3PagerSetBusyhandler(Pager*, int(*)(void *), void *);
14700
+SQLITE_PRIVATE void sqlite3PagerSetBusyHandler(Pager*, int(*)(void *), void *);
1446214701
SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, u32*, int);
1446314702
#ifdef SQLITE_HAS_CODEC
1446414703
SQLITE_PRIVATE void sqlite3PagerAlignReserve(Pager*,Pager*);
1446514704
#endif
1446614705
SQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager*, int);
@@ -14542,10 +14781,15 @@
1454214781
SQLITE_PRIVATE void *sqlite3PagerTempSpace(Pager*);
1454314782
SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager*);
1454414783
SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *, int, int, int *);
1454514784
SQLITE_PRIVATE void sqlite3PagerClearCache(Pager*);
1454614785
SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *);
14786
+#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
14787
+SQLITE_PRIVATE void sqlite3PagerResetLockTimeout(Pager *pPager);
14788
+#else
14789
+# define sqlite3PagerResetLockTimeout(X)
14790
+#endif
1454714791
1454814792
/* Functions used to truncate the database file. */
1454914793
SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager*,Pgno);
1455014794
1455114795
SQLITE_PRIVATE void sqlite3PagerRekey(DbPage*, Pgno, u16);
@@ -18099,11 +18343,11 @@
1809918343
SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *);
1810018344
SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *);
1810118345
SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*);
1810218346
SQLITE_PRIVATE char sqlite3AffinityType(const char*, u8*);
1810318347
SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*);
18104
-SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*);
18348
+SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*, sqlite3_file*);
1810518349
SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*);
1810618350
SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *, const char *);
1810718351
SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3*,int iDB);
1810818352
SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3*,Index*);
1810918353
SQLITE_PRIVATE void sqlite3DefaultRowEst(Index*);
@@ -21069,12 +21313,15 @@
2106921313
** really care if the VFS receives and understands the information since it
2107021314
** is only a hint and can be safely ignored. The sqlite3OsFileControlHint()
2107121315
** routine has no return value since the return value would be meaningless.
2107221316
*/
2107321317
SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
21318
+ if( id->pMethods==0 ) return SQLITE_NOTFOUND;
2107421319
#ifdef SQLITE_TEST
21075
- if( op!=SQLITE_FCNTL_COMMIT_PHASETWO ){
21320
+ if( op!=SQLITE_FCNTL_COMMIT_PHASETWO
21321
+ && op!=SQLITE_FCNTL_LOCK_TIMEOUT
21322
+ ){
2107621323
/* Faults are not injected into COMMIT_PHASETWO because, assuming SQLite
2107721324
** is using a regular VFS, it is called after the corresponding
2107821325
** transaction has been committed. Injecting a fault at this point
2107921326
** confuses the test scripts - the COMMIT comand returns SQLITE_NOMEM
2108021327
** but the transaction is committed anyway.
@@ -21087,11 +21334,11 @@
2108721334
}
2108821335
#endif
2108921336
return id->pMethods->xFileControl(id, op, pArg);
2109021337
}
2109121338
SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file *id, int op, void *pArg){
21092
- (void)id->pMethods->xFileControl(id, op, pArg);
21339
+ if( id->pMethods ) (void)id->pMethods->xFileControl(id, op, pArg);
2109321340
}
2109421341
2109521342
SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){
2109621343
int (*xSectorSize)(sqlite3_file*) = id->pMethods->xSectorSize;
2109721344
return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE);
@@ -31026,10 +31273,13 @@
3102631273
int openFlags; /* The flags specified at open() */
3102731274
#endif
3102831275
#if SQLITE_ENABLE_LOCKING_STYLE || defined(__APPLE__)
3102931276
unsigned fsFlags; /* cached details from statfs() */
3103031277
#endif
31278
+#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
31279
+ unsigned iBusyTimeout; /* Wait this many millisec on locks */
31280
+#endif
3103131281
#if OS_VXWORKS
3103231282
struct vxworksFileId *pId; /* Unique file ID */
3103331283
#endif
3103431284
#ifdef SQLITE_DEBUG
3103531285
/* The next group of variables are used to track whether or not the
@@ -32459,10 +32709,47 @@
3245932709
OSTRACE(("TEST WR-LOCK %d %d %d (unix)\n", pFile->h, rc, reserved));
3246032710
3246132711
*pResOut = reserved;
3246232712
return rc;
3246332713
}
32714
+
32715
+/*
32716
+** Set a posix-advisory-lock.
32717
+**
32718
+** There are two versions of this routine. If compiled with
32719
+** SQLITE_ENABLE_SETLK_TIMEOUT then the routine has an extra parameter
32720
+** which is a pointer to a unixFile. If the unixFile->iBusyTimeout
32721
+** value is set, then it is the number of milliseconds to wait before
32722
+** failing the lock. The iBusyTimeout value is always reset back to
32723
+** zero on each call.
32724
+**
32725
+** If SQLITE_ENABLE_SETLK_TIMEOUT is not defined, then do a non-blocking
32726
+** attempt to set the lock.
32727
+*/
32728
+#ifndef SQLITE_ENABLE_SETLK_TIMEOUT
32729
+# define osSetPosixAdvisoryLock(h,x,t) osFcntl(h,F_SETLK,x)
32730
+#else
32731
+static int osSetPosixAdvisoryLock(
32732
+ int h, /* The file descriptor on which to take the lock */
32733
+ struct flock *pLock, /* The description of the lock */
32734
+ unixFile *pFile /* Structure holding timeout value */
32735
+){
32736
+ int rc = osFcntl(h,F_SETLK,pLock);
32737
+ while( rc<0 && pFile->iBusyTimeout>0 ){
32738
+ /* On systems that support some kind of blocking file lock with a timeout,
32739
+ ** make appropriate changes here to invoke that blocking file lock. On
32740
+ ** generic posix, however, there is no such API. So we simply try the
32741
+ ** lock once every millisecond until either the timeout expires, or until
32742
+ ** the lock is obtained. */
32743
+ usleep(1000);
32744
+ rc = osFcntl(h,F_SETLK,pLock);
32745
+ pFile->iBusyTimeout--;
32746
+ }
32747
+ return rc;
32748
+}
32749
+#endif /* SQLITE_ENABLE_SETLK_TIMEOUT */
32750
+
3246432751
3246532752
/*
3246632753
** Attempt to set a system-lock on the file pFile. The lock is
3246732754
** described by pLock.
3246832755
**
@@ -32492,19 +32779,19 @@
3249232779
assert( pInode->nLock==0 );
3249332780
lock.l_whence = SEEK_SET;
3249432781
lock.l_start = SHARED_FIRST;
3249532782
lock.l_len = SHARED_SIZE;
3249632783
lock.l_type = F_WRLCK;
32497
- rc = osFcntl(pFile->h, F_SETLK, &lock);
32784
+ rc = osSetPosixAdvisoryLock(pFile->h, &lock, pFile);
3249832785
if( rc<0 ) return rc;
3249932786
pInode->bProcessLock = 1;
3250032787
pInode->nLock++;
3250132788
}else{
3250232789
rc = 0;
3250332790
}
3250432791
}else{
32505
- rc = osFcntl(pFile->h, F_SETLK, pLock);
32792
+ rc = osSetPosixAdvisoryLock(pFile->h, pLock, pFile);
3250632793
}
3250732794
return rc;
3250832795
}
3250932796
3251032797
/*
@@ -34860,10 +35147,16 @@
3486035147
}
3486135148
case SQLITE_FCNTL_HAS_MOVED: {
3486235149
*(int*)pArg = fileHasMoved(pFile);
3486335150
return SQLITE_OK;
3486435151
}
35152
+#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
35153
+ case SQLITE_FCNTL_LOCK_TIMEOUT: {
35154
+ pFile->iBusyTimeout = *(int*)pArg;
35155
+ return SQLITE_OK;
35156
+ }
35157
+#endif
3486535158
#if SQLITE_MAX_MMAP_SIZE>0
3486635159
case SQLITE_FCNTL_MMAP_SIZE: {
3486735160
i64 newLimit = *(i64*)pArg;
3486835161
int rc = SQLITE_OK;
3486935162
if( newLimit>sqlite3GlobalConfig.mxMmap ){
@@ -35179,11 +35472,11 @@
3517935472
/* Initialize the locking parameters */
3518035473
f.l_type = lockType;
3518135474
f.l_whence = SEEK_SET;
3518235475
f.l_start = ofst;
3518335476
f.l_len = n;
35184
- rc = osFcntl(pShmNode->h, F_SETLK, &f);
35477
+ rc = osSetPosixAdvisoryLock(pShmNode->h, &f, pFile);
3518535478
rc = (rc!=(-1)) ? SQLITE_OK : SQLITE_BUSY;
3518635479
}
3518735480
3518835481
/* Update the global lock state and do debug tracing */
3518935482
#ifdef SQLITE_DEBUG
@@ -45039,11 +45332,11 @@
4503945332
** May you find forgiveness for yourself and forgive others.
4504045333
** May you share freely, never taking more than you give.
4504145334
**
4504245335
******************************************************************************
4504345336
**
45044
-** This file implements in-memory VFS. A database is held as a contiguous
45337
+** This file implements an in-memory VFS. A database is held as a contiguous
4504545338
** block of memory.
4504645339
**
4504745340
** This file also implements interface sqlite3_serialize() and
4504845341
** sqlite3_deserialize().
4504945342
*/
@@ -50953,11 +51246,11 @@
5095351246
** required size. */
5095451247
assert( pPager->eLock==EXCLUSIVE_LOCK );
5095551248
rc = pager_truncate(pPager, pPager->dbSize);
5095651249
}
5095751250
50958
- if( rc==SQLITE_OK && bCommit && isOpen(pPager->fd) ){
51251
+ if( rc==SQLITE_OK && bCommit ){
5095951252
rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_COMMIT_PHASETWO, 0);
5096051253
if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
5096151254
}
5096251255
5096351256
if( !pPager->exclusiveMode
@@ -51772,13 +52065,11 @@
5177252065
** state prior to the start of the transaction, so invoke the
5177352066
** SQLITE_FCNTL_DB_UNCHANGED file-control method to disable the
5177452067
** assertion that the transaction counter was modified.
5177552068
*/
5177652069
#ifdef SQLITE_DEBUG
51777
- if( pPager->fd->pMethods ){
51778
- sqlite3OsFileControlHint(pPager->fd,SQLITE_FCNTL_DB_UNCHANGED,0);
51779
- }
52070
+ sqlite3OsFileControlHint(pPager->fd,SQLITE_FCNTL_DB_UNCHANGED,0);
5178052071
#endif
5178152072
5178252073
/* If this playback is happening automatically as a result of an IO or
5178352074
** malloc error that occurred after the change-counter was updated but
5178452075
** before the transaction was committed, then the change-counter
@@ -52527,24 +52818,22 @@
5252752818
**
5252852819
** If the busy-handler callback returns non-zero, the lock is
5252952820
** retried. If it returns zero, then the SQLITE_BUSY error is
5253052821
** returned to the caller of the pager API function.
5253152822
*/
52532
-SQLITE_PRIVATE void sqlite3PagerSetBusyhandler(
52823
+SQLITE_PRIVATE void sqlite3PagerSetBusyHandler(
5253352824
Pager *pPager, /* Pager object */
5253452825
int (*xBusyHandler)(void *), /* Pointer to busy-handler function */
5253552826
void *pBusyHandlerArg /* Argument to pass to xBusyHandler */
5253652827
){
52828
+ void **ap;
5253752829
pPager->xBusyHandler = xBusyHandler;
5253852830
pPager->pBusyHandlerArg = pBusyHandlerArg;
52539
-
52540
- if( isOpen(pPager->fd) ){
52541
- void **ap = (void **)&pPager->xBusyHandler;
52542
- assert( ((int(*)(void *))(ap[0]))==xBusyHandler );
52543
- assert( ap[1]==pBusyHandlerArg );
52544
- sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_BUSYHANDLER, (void *)ap);
52545
- }
52831
+ ap = (void **)&pPager->xBusyHandler;
52832
+ assert( ((int(*)(void *))(ap[0]))==xBusyHandler );
52833
+ assert( ap[1]==pBusyHandlerArg );
52834
+ sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_BUSYHANDLER, (void *)ap);
5254652835
}
5254752836
5254852837
/*
5254952838
** Change the page size used by the Pager object. The new page size
5255052839
** is passed in *pPageSize.
@@ -54516,10 +54805,11 @@
5451654805
Pager *pPager;
5451754806
assert( pPg!=0 );
5451854807
assert( pPg->pgno==1 );
5451954808
assert( (pPg->flags & PGHDR_MMAP)==0 ); /* Page1 is never memory mapped */
5452054809
pPager = pPg->pPager;
54810
+ sqlite3PagerResetLockTimeout(pPager);
5452154811
sqlite3PcacheRelease(pPg);
5452254812
pagerUnlockIfUnused(pPager);
5452354813
}
5452454814
5452554815
/*
@@ -55111,16 +55401,13 @@
5511155401
** If successful, or if called on a pager for which it is a no-op, this
5511255402
** function returns SQLITE_OK. Otherwise, an IO error code is returned.
5511355403
*/
5511455404
SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager, const char *zMaster){
5511555405
int rc = SQLITE_OK;
55116
-
55117
- if( isOpen(pPager->fd) ){
55118
- void *pArg = (void*)zMaster;
55119
- rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SYNC, pArg);
55120
- if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
55121
- }
55406
+ void *pArg = (void*)zMaster;
55407
+ rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SYNC, pArg);
55408
+ if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
5512255409
if( rc==SQLITE_OK && !pPager->noSync ){
5512355410
assert( !MEMDB );
5512455411
rc = sqlite3OsSync(pPager->fd, pPager->syncFlags);
5512555412
}
5512655413
return rc;
@@ -55793,10 +56080,20 @@
5579356080
*/
5579456081
SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager *pPager){
5579556082
return pPager->fd;
5579656083
}
5579756084
56085
+#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
56086
+/*
56087
+** Reset the lock timeout for pager.
56088
+*/
56089
+SQLITE_PRIVATE void sqlite3PagerResetLockTimeout(Pager *pPager){
56090
+ int x = 0;
56091
+ sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_LOCK_TIMEOUT, &x);
56092
+}
56093
+#endif
56094
+
5579856095
/*
5579956096
** Return the file handle for the journal file (if it exists).
5580056097
** This will be either the rollback journal or the WAL file.
5580156098
*/
5580256099
SQLITE_PRIVATE sqlite3_file *sqlite3PagerJrnlFile(Pager *pPager){
@@ -56253,10 +56550,11 @@
5625356550
(eMode==SQLITE_CHECKPOINT_PASSIVE ? 0 : pPager->xBusyHandler),
5625456551
pPager->pBusyHandlerArg,
5625556552
pPager->walSyncFlags, pPager->pageSize, (u8 *)pPager->pTmpSpace,
5625656553
pnLog, pnCkpt
5625756554
);
56555
+ sqlite3PagerResetLockTimeout(pPager);
5625856556
}
5625956557
return rc;
5626056558
}
5626156559
5626256560
SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager){
@@ -63529,11 +63827,12 @@
6352963827
*/
6353063828
static int btreeInvokeBusyHandler(void *pArg){
6353163829
BtShared *pBt = (BtShared*)pArg;
6353263830
assert( pBt->db );
6353363831
assert( sqlite3_mutex_held(pBt->db->mutex) );
63534
- return sqlite3InvokeBusyHandler(&pBt->db->busyHandler);
63832
+ return sqlite3InvokeBusyHandler(&pBt->db->busyHandler,
63833
+ sqlite3PagerFile(pBt->pPager));
6353563834
}
6353663835
6353763836
/*
6353863837
** Open a database file.
6353963838
**
@@ -63707,11 +64006,11 @@
6370764006
if( rc!=SQLITE_OK ){
6370864007
goto btree_open_out;
6370964008
}
6371064009
pBt->openFlags = (u8)flags;
6371164010
pBt->db = db;
63712
- sqlite3PagerSetBusyhandler(pBt->pPager, btreeInvokeBusyHandler, pBt);
64011
+ sqlite3PagerSetBusyHandler(pBt->pPager, btreeInvokeBusyHandler, pBt);
6371364012
p->pBt = pBt;
6371464013
6371564014
pBt->pCursor = 0;
6371664015
pBt->pPage1 = 0;
6371764016
if( sqlite3PagerIsreadonly(pBt->pPager) ) pBt->btsFlags |= BTS_READ_ONLY;
@@ -64670,10 +64969,11 @@
6467064969
if( rc!=SQLITE_OK ){
6467164970
unlockBtreeIfUnused(pBt);
6467264971
}
6467364972
}while( (rc&0xFF)==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE &&
6467464973
btreeInvokeBusyHandler(pBt) );
64974
+ sqlite3PagerResetLockTimeout(pBt->pPager);
6467564975
6467664976
if( rc==SQLITE_OK ){
6467764977
if( p->inTrans==TRANS_NONE ){
6467864978
pBt->nTransaction++;
6467964979
#ifndef SQLITE_OMIT_SHARED_CACHE
@@ -98715,25 +99015,65 @@
9871599015
** This is the Expr node callback for sqlite3ExprImpliesNotNullRow().
9871699016
** If the expression node requires that the table at pWalker->iCur
9871799017
** have a non-NULL column, then set pWalker->eCode to 1 and abort.
9871899018
*/
9871999019
static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
99020
+ /* This routine is only called for WHERE clause expressions and so it
99021
+ ** cannot have any TK_AGG_COLUMN entries because those are only found
99022
+ ** in HAVING clauses. We can get a TK_AGG_FUNCTION in a WHERE clause,
99023
+ ** but that is an illegal construct and the query will be rejected at
99024
+ ** a later stage of processing, so the TK_AGG_FUNCTION case does not
99025
+ ** need to be considered here. */
99026
+ assert( pExpr->op!=TK_AGG_COLUMN );
99027
+ testcase( pExpr->op==TK_AGG_FUNCTION );
99028
+
9872099029
if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune;
9872199030
switch( pExpr->op ){
99031
+ case TK_ISNOT:
99032
+ case TK_NOT:
9872299033
case TK_ISNULL:
9872399034
case TK_IS:
9872499035
case TK_OR:
99036
+ case TK_CASE:
99037
+ case TK_IN:
9872599038
case TK_FUNCTION:
98726
- case TK_AGG_FUNCTION:
99039
+ testcase( pExpr->op==TK_ISNOT );
99040
+ testcase( pExpr->op==TK_NOT );
99041
+ testcase( pExpr->op==TK_ISNULL );
99042
+ testcase( pExpr->op==TK_IS );
99043
+ testcase( pExpr->op==TK_OR );
99044
+ testcase( pExpr->op==TK_CASE );
99045
+ testcase( pExpr->op==TK_IN );
99046
+ testcase( pExpr->op==TK_FUNCTION );
9872799047
return WRC_Prune;
9872899048
case TK_COLUMN:
98729
- case TK_AGG_COLUMN:
9873099049
if( pWalker->u.iCur==pExpr->iTable ){
9873199050
pWalker->eCode = 1;
9873299051
return WRC_Abort;
9873399052
}
9873499053
return WRC_Prune;
99054
+
99055
+ /* Virtual tables are allowed to use constraints like x=NULL. So
99056
+ ** a term of the form x=y does not prove that y is not null if x
99057
+ ** is the column of a virtual table */
99058
+ case TK_EQ:
99059
+ case TK_NE:
99060
+ case TK_LT:
99061
+ case TK_LE:
99062
+ case TK_GT:
99063
+ case TK_GE:
99064
+ testcase( pExpr->op==TK_EQ );
99065
+ testcase( pExpr->op==TK_NE );
99066
+ testcase( pExpr->op==TK_LT );
99067
+ testcase( pExpr->op==TK_LE );
99068
+ testcase( pExpr->op==TK_GT );
99069
+ testcase( pExpr->op==TK_GE );
99070
+ if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->pTab))
99071
+ || (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->pTab))
99072
+ ){
99073
+ return WRC_Prune;
99074
+ }
9873599075
default:
9873699076
return WRC_Continue;
9873799077
}
9873899078
}
9873999079
@@ -98740,10 +99080,17 @@
9874099080
/*
9874199081
** Return true (non-zero) if expression p can only be true if at least
9874299082
** one column of table iTab is non-null. In other words, return true
9874399083
** if expression p will always be NULL or false if every column of iTab
9874499084
** is NULL.
99085
+**
99086
+** False negatives are acceptable. In other words, it is ok to return
99087
+** zero even if expression p will never be true of every column of iTab
99088
+** is NULL. A false negative is merely a missed optimization opportunity.
99089
+**
99090
+** False positives are not allowed, however. A false positive may result
99091
+** in an incorrect answer.
9874599092
**
9874699093
** Terms of p that are marked with EP_FromJoin (and hence that come from
9874799094
** the ON or USING clauses of LEFT JOINS) are excluded from the analysis.
9874899095
**
9874999096
** This routine is used to check if a LEFT JOIN can be converted into
@@ -101005,11 +101352,11 @@
101005101352
}
101006101353
if( pTab->tnum==0 ){
101007101354
/* Do not gather statistics on views or virtual tables */
101008101355
return;
101009101356
}
101010
- if( sqlite3_strlike("sqlite_%", pTab->zName, 0)==0 ){
101357
+ if( sqlite3_strlike("sqlite\\_%", pTab->zName, '\\')==0 ){
101011101358
/* Do not gather statistics on system tables */
101012101359
return;
101013101360
}
101014101361
assert( sqlite3BtreeHoldsAllMutexes(db) );
101015101362
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
@@ -104066,11 +104413,11 @@
104066104413
if( !sqlite3ExprIsConstantOrFunction(pExpr, db->init.busy) ){
104067104414
sqlite3ErrorMsg(pParse, "default value of column [%s] is not constant",
104068104415
pCol->zName);
104069104416
}else{
104070104417
/* A copy of pExpr is used instead of the original, as pExpr contains
104071
- ** tokens that point to volatile memory.
104418
+ ** tokens that point to volatile memory.
104072104419
*/
104073104420
Expr x;
104074104421
sqlite3ExprDelete(db, pCol->pDflt);
104075104422
memset(&x, 0, sizeof(x));
104076104423
x.op = TK_SPAN;
@@ -104310,11 +104657,11 @@
104310104657
SQLITE_PRIVATE void sqlite3ChangeCookie(Parse *pParse, int iDb){
104311104658
sqlite3 *db = pParse->db;
104312104659
Vdbe *v = pParse->pVdbe;
104313104660
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
104314104661
sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION,
104315
- db->aDb[iDb].pSchema->schema_cookie+1);
104662
+ (int)(1+(unsigned)db->aDb[iDb].pSchema->schema_cookie));
104316104663
}
104317104664
104318104665
/*
104319104666
** Measure the number of characters needed to output the given
104320104667
** identifier. The number returned includes any quotes used
@@ -104988,11 +105335,11 @@
104988105335
Table *pSelTab; /* A fake table from which we get the result set */
104989105336
Select *pSel; /* Copy of the SELECT that implements the view */
104990105337
int nErr = 0; /* Number of errors encountered */
104991105338
int n; /* Temporarily holds the number of cursors assigned */
104992105339
sqlite3 *db = pParse->db; /* Database connection for malloc errors */
104993
-#ifndef SQLITE_OMIT_VIRTUALTABLE
105340
+#ifndef SQLITE_OMIT_VIRTUALTABLE
104994105341
int rc;
104995105342
#endif
104996105343
#ifndef SQLITE_OMIT_AUTHORIZATION
104997105344
sqlite3_xauth xAuth; /* Saved xAuth pointer */
104998105345
#endif
@@ -123694,11 +124041,10 @@
123694124041
ExprList *pOrderBy = pSub->pOrderBy;
123695124042
for(i=0; i<pOrderBy->nExpr; i++){
123696124043
pOrderBy->a[i].u.x.iOrderByCol = 0;
123697124044
}
123698124045
assert( pParent->pOrderBy==0 );
123699
- assert( pSub->pPrior==0 );
123700124046
pParent->pOrderBy = pOrderBy;
123701124047
pSub->pOrderBy = 0;
123702124048
}
123703124049
pWhere = sqlite3ExprDup(db, pSub->pWhere, 0);
123704124050
if( isLeftJoin>0 ){
@@ -123778,12 +124124,13 @@
123778124124
** (2) The inner query is the recursive part of a common table expression.
123779124125
**
123780124126
** (3) The inner query has a LIMIT clause (since the changes to the WHERE
123781124127
** close would change the meaning of the LIMIT).
123782124128
**
123783
-** (4) (** This restriction was removed on 2018-03-21. It used to read:
123784
-** The inner query is the right operand of a LEFT JOIN. **)
124129
+** (4) The inner query is the right operand of a LEFT JOIN and the
124130
+** expression to be pushed down does not come from the ON clause
124131
+** on that LEFT JOIN.
123785124132
**
123786124133
** (5) The WHERE clause expression originates in the ON or USING clause
123787124134
** of a LEFT JOIN where iCursor is not the right-hand table of that
123788124135
** left join. An example:
123789124136
**
@@ -123801,11 +124148,12 @@
123801124148
*/
123802124149
static int pushDownWhereTerms(
123803124150
Parse *pParse, /* Parse context (for malloc() and error reporting) */
123804124151
Select *pSubq, /* The subquery whose WHERE clause is to be augmented */
123805124152
Expr *pWhere, /* The WHERE clause of the outer query */
123806
- int iCursor /* Cursor number of the subquery */
124153
+ int iCursor, /* Cursor number of the subquery */
124154
+ int isLeftJoin /* True if pSubq is the right term of a LEFT JOIN */
123807124155
){
123808124156
Expr *pNew;
123809124157
int nChng = 0;
123810124158
if( pWhere==0 ) return 0;
123811124159
if( pSubq->selFlags & SF_Recursive ) return 0; /* restriction (2) */
@@ -123825,13 +124173,20 @@
123825124173
123826124174
if( pSubq->pLimit!=0 ){
123827124175
return 0; /* restriction (3) */
123828124176
}
123829124177
while( pWhere->op==TK_AND ){
123830
- nChng += pushDownWhereTerms(pParse, pSubq, pWhere->pRight, iCursor);
124178
+ nChng += pushDownWhereTerms(pParse, pSubq, pWhere->pRight,
124179
+ iCursor, isLeftJoin);
123831124180
pWhere = pWhere->pLeft;
123832124181
}
124182
+ if( isLeftJoin
124183
+ && (ExprHasProperty(pWhere,EP_FromJoin)==0
124184
+ || pWhere->iRightJoinTable!=iCursor)
124185
+ ){
124186
+ return 0; /* restriction (4) */
124187
+ }
123833124188
if( ExprHasProperty(pWhere,EP_FromJoin) && pWhere->iRightJoinTable!=iCursor ){
123834124189
return 0; /* restriction (5) */
123835124190
}
123836124191
if( sqlite3ExprIsTableConstant(pWhere, iCursor) ){
123837124192
nChng++;
@@ -124291,13 +124646,11 @@
124291124646
if( (selFlags & SF_Expanded)!=0 ){
124292124647
return WRC_Prune;
124293124648
}
124294124649
pTabList = p->pSrc;
124295124650
pEList = p->pEList;
124296
- if( OK_IF_ALWAYS_TRUE(p->pWith) ){
124297
- sqlite3WithPush(pParse, p->pWith, 0);
124298
- }
124651
+ sqlite3WithPush(pParse, p->pWith, 0);
124299124652
124300124653
/* Make sure cursor numbers have been assigned to all entries in
124301124654
** the FROM clause of the SELECT statement.
124302124655
*/
124303124656
sqlite3SrcListAssignCursors(pParse, pTabList);
@@ -125295,11 +125648,12 @@
125295125648
125296125649
/* Make copies of constant WHERE-clause terms in the outer query down
125297125650
** inside the subquery. This can help the subquery to run more efficiently.
125298125651
*/
125299125652
if( OptimizationEnabled(db, SQLITE_PushDown)
125300
- && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor)
125653
+ && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
125654
+ (pItem->fg.jointype & JT_OUTER)!=0)
125301125655
){
125302125656
#if SELECTTRACE_ENABLED
125303125657
if( sqlite3SelectTrace & 0x100 ){
125304125658
SELECTTRACE(0x100,pParse,p,("After WHERE-clause push-down:\n"));
125305125659
sqlite3TreeViewSelect(0, p, 0);
@@ -127755,11 +128109,11 @@
127755128109
iPk = pParse->nMem+1;
127756128110
pParse->nMem += nPk;
127757128111
regKey = ++pParse->nMem;
127758128112
iEph = pParse->nTab++;
127759128113
127760
- sqlite3VdbeAddOp2(v, OP_Null, 0, iPk);
128114
+ sqlite3VdbeAddOp3(v, OP_Null, 0, iPk, iPk+nPk-1);
127761128115
addrOpen = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, iEph, nPk);
127762128116
sqlite3VdbeSetP4KeyInfo(pParse, pPk);
127763128117
}
127764128118
127765128119
/* Begin the database scan.
@@ -129927,11 +130281,11 @@
129927130281
129928130282
/*
129929130283
** Trace output macros
129930130284
*/
129931130285
#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
129932
-/***/ int sqlite3WhereTrace;
130286
+/***/ extern int sqlite3WhereTrace;
129933130287
#endif
129934130288
#if defined(SQLITE_DEBUG) \
129935130289
&& (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_WHERETRACE))
129936130290
# define WHERETRACE(K,X) if(sqlite3WhereTrace&(K)) sqlite3DebugPrintf X
129937130291
# define WHERETRACE_ENABLED 1
@@ -132576,22 +132930,23 @@
132576132930
if( iLoop<3 && (pTerm->wtFlags & TERM_VARSELECT) ){
132577132931
if( iNext==0 ) iNext = 3;
132578132932
continue;
132579132933
}
132580132934
132581
- if( pTerm->wtFlags & TERM_LIKECOND ){
132935
+ if( (pTerm->wtFlags & TERM_LIKECOND)!=0 ){
132582132936
/* If the TERM_LIKECOND flag is set, that means that the range search
132583132937
** is sufficient to guarantee that the LIKE operator is true, so we
132584132938
** can skip the call to the like(A,B) function. But this only works
132585132939
** for strings. So do not skip the call to the function on the pass
132586132940
** that compares BLOBs. */
132587132941
#ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS
132588132942
continue;
132589132943
#else
132590132944
u32 x = pLevel->iLikeRepCntr;
132591
- assert( x>0 );
132592
- skipLikeAddr = sqlite3VdbeAddOp1(v, (x&1)?OP_IfNot:OP_If, (int)(x>>1));
132945
+ if( x>0 ){
132946
+ skipLikeAddr = sqlite3VdbeAddOp1(v, (x&1)?OP_IfNot:OP_If,(int)(x>>1));
132947
+ }
132593132948
VdbeCoverage(v);
132594132949
#endif
132595132950
}
132596132951
#ifdef WHERETRACE_ENABLED /* 0xffff */
132597132952
if( sqlite3WhereTrace ){
@@ -136579,12 +136934,12 @@
136579136934
LogEst rLogSize; /* Logarithm of table size */
136580136935
WhereTerm *pTop = 0, *pBtm = 0; /* Top and bottom range constraints */
136581136936
136582136937
pNew = pBuilder->pNew;
136583136938
if( db->mallocFailed ) return SQLITE_NOMEM_BKPT;
136584
- WHERETRACE(0x800, ("BEGIN addBtreeIdx(%s), nEq=%d\n",
136585
- pProbe->zName, pNew->u.btree.nEq));
136939
+ WHERETRACE(0x800, ("BEGIN %s.addBtreeIdx(%s), nEq=%d\n",
136940
+ pProbe->pTable->zName,pProbe->zName, pNew->u.btree.nEq));
136586136941
136587136942
assert( (pNew->wsFlags & WHERE_VIRTUALTABLE)==0 );
136588136943
assert( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 );
136589136944
if( pNew->wsFlags & WHERE_BTM_LIMIT ){
136590136945
opMask = WO_LT|WO_LE;
@@ -136866,12 +137221,12 @@
136866137221
pNew->u.btree.nEq = saved_nEq;
136867137222
pNew->nSkip = saved_nSkip;
136868137223
pNew->wsFlags = saved_wsFlags;
136869137224
}
136870137225
136871
- WHERETRACE(0x800, ("END addBtreeIdx(%s), nEq=%d, rc=%d\n",
136872
- pProbe->zName, saved_nEq, rc));
137226
+ WHERETRACE(0x800, ("END %s.addBtreeIdx(%s), nEq=%d, rc=%d\n",
137227
+ pProbe->pTable->zName, pProbe->zName, saved_nEq, rc));
136873137228
return rc;
136874137229
}
136875137230
136876137231
/*
136877137232
** Return True if it is possible that pIndex might be useful in
@@ -137305,13 +137660,13 @@
137305137660
|| j<0
137306137661
|| j>=pWC->nTerm
137307137662
|| pNew->aLTerm[iTerm]!=0
137308137663
|| pIdxCons->usable==0
137309137664
){
137310
- rc = SQLITE_ERROR;
137311137665
sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
137312
- return rc;
137666
+ testcase( pIdxInfo->needToFreeIdxStr );
137667
+ return SQLITE_ERROR;
137313137668
}
137314137669
testcase( iTerm==nConstraint-1 );
137315137670
testcase( j==0 );
137316137671
testcase( j==pWC->nTerm-1 );
137317137672
pTerm = &pWC->a[j];
@@ -137335,10 +137690,19 @@
137335137690
}
137336137691
}
137337137692
pNew->u.vtab.omitMask &= ~mNoOmit;
137338137693
137339137694
pNew->nLTerm = mxTerm+1;
137695
+ for(i=0; i<=mxTerm; i++){
137696
+ if( pNew->aLTerm[i]==0 ){
137697
+ /* The non-zero argvIdx values must be contiguous. Raise an
137698
+ ** error if they are not */
137699
+ sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
137700
+ testcase( pIdxInfo->needToFreeIdxStr );
137701
+ return SQLITE_ERROR;
137702
+ }
137703
+ }
137340137704
assert( pNew->nLTerm<=pNew->nLSlot );
137341137705
pNew->u.vtab.idxNum = pIdxInfo->idxNum;
137342137706
pNew->u.vtab.needFree = pIdxInfo->needToFreeIdxStr;
137343137707
pIdxInfo->needToFreeIdxStr = 0;
137344137708
pNew->u.vtab.idxStr = pIdxInfo->idxStr;
@@ -137450,10 +137814,11 @@
137450137814
sqlite3DbFree(pParse->db, p);
137451137815
return SQLITE_NOMEM_BKPT;
137452137816
}
137453137817
137454137818
/* First call xBestIndex() with all constraints usable. */
137819
+ WHERETRACE(0x800, ("BEGIN %s.addVirtual()\n", pSrc->pTab->zName));
137455137820
WHERETRACE(0x40, (" VirtualOne: all usable\n"));
137456137821
rc = whereLoopAddVirtualOne(pBuilder, mPrereq, ALLBITS, 0, p, mNoOmit, &bIn);
137457137822
137458137823
/* If the call to xBestIndex() with all terms enabled produced a plan
137459137824
** that does not require any source tables (IOW: a plan with mBest==0),
@@ -137525,10 +137890,11 @@
137525137890
}
137526137891
}
137527137892
137528137893
if( p->needToFreeIdxStr ) sqlite3_free(p->idxStr);
137529137894
sqlite3DbFreeNN(pParse->db, p);
137895
+ WHERETRACE(0x800, ("END %s.addVirtual(), rc=%d\n", pSrc->pTab->zName, rc));
137530137896
return rc;
137531137897
}
137532137898
#endif /* SQLITE_OMIT_VIRTUALTABLE */
137533137899
137534137900
/*
@@ -139665,21 +140031,21 @@
139665140031
#define sqlite3ParserARG_SDECL Parse *pParse;
139666140032
#define sqlite3ParserARG_PDECL ,Parse *pParse
139667140033
#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
139668140034
#define sqlite3ParserARG_STORE yypParser->pParse = pParse
139669140035
#define YYFALLBACK 1
139670
-#define YYNSTATE 466
139671
-#define YYNRULE 330
140036
+#define YYNSTATE 472
140037
+#define YYNRULE 333
139672140038
#define YYNTOKEN 143
139673
-#define YY_MAX_SHIFT 465
139674
-#define YY_MIN_SHIFTREDUCE 675
139675
-#define YY_MAX_SHIFTREDUCE 1004
139676
-#define YY_ERROR_ACTION 1005
139677
-#define YY_ACCEPT_ACTION 1006
139678
-#define YY_NO_ACTION 1007
139679
-#define YY_MIN_REDUCE 1008
139680
-#define YY_MAX_REDUCE 1337
140039
+#define YY_MAX_SHIFT 471
140040
+#define YY_MIN_SHIFTREDUCE 681
140041
+#define YY_MAX_SHIFTREDUCE 1013
140042
+#define YY_ERROR_ACTION 1014
140043
+#define YY_ACCEPT_ACTION 1015
140044
+#define YY_NO_ACTION 1016
140045
+#define YY_MIN_REDUCE 1017
140046
+#define YY_MAX_REDUCE 1349
139681140047
/************* End control #defines *******************************************/
139682140048
139683140049
/* Define the yytestcase() macro to be a no-op if is not already defined
139684140050
** otherwise.
139685140051
**
@@ -139741,326 +140107,328 @@
139741140107
** yy_reduce_ofst[] For each state, the offset into yy_action for
139742140108
** shifting non-terminals after a reduce.
139743140109
** yy_default[] Default action for each state.
139744140110
**
139745140111
*********** Begin parsing tables **********************************************/
139746
-#define YY_ACTTAB_COUNT (1541)
140112
+#define YY_ACTTAB_COUNT (1566)
139747140113
static const YYACTIONTYPE yy_action[] = {
139748
- /* 0 */ 1006, 156, 156, 2, 1302, 90, 87, 179, 90, 87,
139749
- /* 10 */ 179, 460, 1048, 460, 465, 1010, 460, 333, 1130, 335,
139750
- /* 20 */ 246, 330, 112, 303, 439, 1258, 304, 419, 1129, 1087,
139751
- /* 30 */ 72, 798, 50, 50, 50, 50, 331, 30, 30, 799,
139752
- /* 40 */ 951, 364, 371, 97, 98, 88, 983, 983, 859, 862,
139753
- /* 50 */ 851, 851, 95, 95, 96, 96, 96, 96, 120, 371,
139754
- /* 60 */ 370, 120, 348, 22, 90, 87, 179, 438, 423, 438,
139755
- /* 70 */ 440, 335, 420, 385, 90, 87, 179, 116, 73, 163,
139756
- /* 80 */ 848, 848, 860, 863, 94, 94, 94, 94, 93, 93,
139757
- /* 90 */ 92, 92, 92, 91, 361, 97, 98, 88, 983, 983,
139758
- /* 100 */ 859, 862, 851, 851, 95, 95, 96, 96, 96, 96,
139759
- /* 110 */ 718, 365, 339, 93, 93, 92, 92, 92, 91, 361,
139760
- /* 120 */ 99, 371, 453, 335, 94, 94, 94, 94, 93, 93,
139761
- /* 130 */ 92, 92, 92, 91, 361, 852, 94, 94, 94, 94,
139762
- /* 140 */ 93, 93, 92, 92, 92, 91, 361, 97, 98, 88,
139763
- /* 150 */ 983, 983, 859, 862, 851, 851, 95, 95, 96, 96,
139764
- /* 160 */ 96, 96, 92, 92, 92, 91, 361, 838, 132, 195,
139765
- /* 170 */ 58, 244, 412, 409, 408, 335, 457, 457, 457, 304,
139766
- /* 180 */ 59, 332, 831, 407, 394, 962, 830, 391, 94, 94,
139767
- /* 190 */ 94, 94, 93, 93, 92, 92, 92, 91, 361, 97,
139768
- /* 200 */ 98, 88, 983, 983, 859, 862, 851, 851, 95, 95,
139769
- /* 210 */ 96, 96, 96, 96, 426, 357, 460, 830, 830, 832,
139770
- /* 220 */ 91, 361, 962, 963, 964, 195, 459, 335, 412, 409,
139771
- /* 230 */ 408, 280, 361, 820, 132, 11, 11, 50, 50, 407,
139772
- /* 240 */ 94, 94, 94, 94, 93, 93, 92, 92, 92, 91,
139773
- /* 250 */ 361, 97, 98, 88, 983, 983, 859, 862, 851, 851,
139774
- /* 260 */ 95, 95, 96, 96, 96, 96, 460, 221, 460, 264,
139775
- /* 270 */ 375, 254, 438, 428, 1276, 1276, 383, 1074, 1053, 335,
139776
- /* 280 */ 245, 422, 299, 713, 271, 271, 1074, 50, 50, 50,
139777
- /* 290 */ 50, 962, 94, 94, 94, 94, 93, 93, 92, 92,
139778
- /* 300 */ 92, 91, 361, 97, 98, 88, 983, 983, 859, 862,
139779
- /* 310 */ 851, 851, 95, 95, 96, 96, 96, 96, 90, 87,
139780
- /* 320 */ 179, 1306, 438, 437, 438, 418, 368, 253, 962, 963,
139781
- /* 330 */ 964, 335, 360, 360, 360, 706, 359, 358, 324, 962,
139782
- /* 340 */ 1281, 951, 364, 230, 94, 94, 94, 94, 93, 93,
139783
- /* 350 */ 92, 92, 92, 91, 361, 97, 98, 88, 983, 983,
139784
- /* 360 */ 859, 862, 851, 851, 95, 95, 96, 96, 96, 96,
139785
- /* 370 */ 769, 460, 120, 226, 226, 366, 962, 963, 964, 1089,
139786
- /* 380 */ 990, 900, 990, 335, 1057, 425, 421, 839, 759, 759,
139787
- /* 390 */ 425, 427, 50, 50, 432, 381, 94, 94, 94, 94,
139788
- /* 400 */ 93, 93, 92, 92, 92, 91, 361, 97, 98, 88,
139789
- /* 410 */ 983, 983, 859, 862, 851, 851, 95, 95, 96, 96,
139790
- /* 420 */ 96, 96, 460, 259, 460, 120, 117, 354, 942, 1332,
139791
- /* 430 */ 942, 1333, 1332, 278, 1333, 335, 680, 681, 682, 825,
139792
- /* 440 */ 201, 176, 303, 50, 50, 49, 49, 404, 94, 94,
139793
- /* 450 */ 94, 94, 93, 93, 92, 92, 92, 91, 361, 97,
139794
- /* 460 */ 98, 88, 983, 983, 859, 862, 851, 851, 95, 95,
139795
- /* 470 */ 96, 96, 96, 96, 199, 460, 380, 265, 433, 380,
139796
- /* 480 */ 265, 383, 256, 158, 258, 319, 1003, 335, 155, 940,
139797
- /* 490 */ 177, 940, 273, 379, 276, 322, 34, 34, 302, 962,
139798
- /* 500 */ 94, 94, 94, 94, 93, 93, 92, 92, 92, 91,
139799
- /* 510 */ 361, 97, 98, 88, 983, 983, 859, 862, 851, 851,
139800
- /* 520 */ 95, 95, 96, 96, 96, 96, 905, 905, 397, 460,
139801
- /* 530 */ 301, 158, 101, 319, 941, 340, 962, 963, 964, 313,
139802
- /* 540 */ 283, 449, 335, 327, 146, 1266, 1004, 257, 234, 248,
139803
- /* 550 */ 35, 35, 94, 94, 94, 94, 93, 93, 92, 92,
139804
- /* 560 */ 92, 91, 361, 709, 785, 1227, 97, 98, 88, 983,
139805
- /* 570 */ 983, 859, 862, 851, 851, 95, 95, 96, 96, 96,
139806
- /* 580 */ 96, 962, 1227, 1229, 245, 422, 838, 198, 197, 196,
139807
- /* 590 */ 1079, 1079, 1077, 1077, 1004, 1334, 320, 335, 172, 171,
139808
- /* 600 */ 709, 831, 159, 271, 271, 830, 76, 94, 94, 94,
139809
- /* 610 */ 94, 93, 93, 92, 92, 92, 91, 361, 962, 963,
139810
- /* 620 */ 964, 97, 98, 88, 983, 983, 859, 862, 851, 851,
139811
- /* 630 */ 95, 95, 96, 96, 96, 96, 830, 830, 832, 1157,
139812
- /* 640 */ 1157, 199, 1157, 173, 1227, 231, 232, 1282, 2, 335,
139813
- /* 650 */ 271, 764, 271, 820, 271, 271, 763, 389, 389, 389,
139814
- /* 660 */ 132, 79, 94, 94, 94, 94, 93, 93, 92, 92,
139815
- /* 670 */ 92, 91, 361, 97, 98, 88, 983, 983, 859, 862,
139816
- /* 680 */ 851, 851, 95, 95, 96, 96, 96, 96, 460, 264,
139817
- /* 690 */ 223, 460, 1257, 783, 1223, 1157, 1086, 1082, 80, 271,
139818
- /* 700 */ 78, 335, 340, 1031, 341, 344, 345, 902, 346, 10,
139819
- /* 710 */ 10, 902, 25, 25, 94, 94, 94, 94, 93, 93,
139820
- /* 720 */ 92, 92, 92, 91, 361, 97, 86, 88, 983, 983,
139821
- /* 730 */ 859, 862, 851, 851, 95, 95, 96, 96, 96, 96,
139822
- /* 740 */ 1157, 270, 395, 117, 233, 263, 235, 70, 456, 341,
139823
- /* 750 */ 225, 176, 335, 1305, 342, 133, 736, 966, 980, 249,
139824
- /* 760 */ 1150, 396, 325, 1085, 1028, 178, 94, 94, 94, 94,
139825
- /* 770 */ 93, 93, 92, 92, 92, 91, 361, 98, 88, 983,
139826
- /* 780 */ 983, 859, 862, 851, 851, 95, 95, 96, 96, 96,
139827
- /* 790 */ 96, 783, 783, 132, 120, 966, 120, 120, 120, 798,
139828
- /* 800 */ 252, 937, 335, 353, 321, 429, 355, 799, 822, 692,
139829
- /* 810 */ 390, 203, 446, 450, 372, 716, 454, 94, 94, 94,
139830
- /* 820 */ 94, 93, 93, 92, 92, 92, 91, 361, 88, 983,
139831
- /* 830 */ 983, 859, 862, 851, 851, 95, 95, 96, 96, 96,
139832
- /* 840 */ 96, 84, 455, 1225, 3, 1209, 120, 120, 382, 387,
139833
- /* 850 */ 120, 203, 1271, 716, 384, 168, 266, 203, 458, 72,
139834
- /* 860 */ 260, 1246, 84, 455, 178, 3, 378, 94, 94, 94,
139835
- /* 870 */ 94, 93, 93, 92, 92, 92, 91, 361, 350, 458,
139836
- /* 880 */ 1245, 362, 430, 213, 228, 290, 415, 285, 414, 200,
139837
- /* 890 */ 783, 882, 444, 726, 725, 405, 283, 921, 209, 921,
139838
- /* 900 */ 281, 132, 362, 72, 838, 289, 147, 733, 734, 392,
139839
- /* 910 */ 81, 82, 922, 444, 922, 267, 288, 83, 362, 462,
139840
- /* 920 */ 461, 272, 132, 830, 23, 838, 388, 923, 1216, 923,
139841
- /* 930 */ 1056, 81, 82, 84, 455, 899, 3, 899, 83, 362,
139842
- /* 940 */ 462, 461, 761, 962, 830, 75, 1, 443, 275, 747,
139843
- /* 950 */ 458, 5, 962, 204, 830, 830, 832, 833, 18, 748,
139844
- /* 960 */ 229, 962, 277, 19, 153, 317, 317, 316, 216, 314,
139845
- /* 970 */ 279, 460, 689, 362, 1055, 830, 830, 832, 833, 18,
139846
- /* 980 */ 962, 963, 964, 962, 444, 181, 460, 251, 981, 962,
139847
- /* 990 */ 963, 964, 8, 8, 20, 250, 838, 1070, 962, 963,
139848
- /* 1000 */ 964, 417, 81, 82, 768, 204, 347, 36, 36, 83,
139849
- /* 1010 */ 362, 462, 461, 1054, 284, 830, 84, 455, 1123, 3,
139850
- /* 1020 */ 962, 963, 964, 460, 183, 962, 981, 764, 889, 1107,
139851
- /* 1030 */ 460, 184, 763, 458, 132, 182, 74, 455, 460, 3,
139852
- /* 1040 */ 981, 898, 834, 898, 8, 8, 830, 830, 832, 833,
139853
- /* 1050 */ 18, 8, 8, 458, 219, 1156, 362, 1103, 349, 8,
139854
- /* 1060 */ 8, 240, 962, 963, 964, 236, 889, 444, 792, 336,
139855
- /* 1070 */ 158, 203, 885, 435, 700, 209, 362, 114, 981, 838,
139856
- /* 1080 */ 834, 227, 334, 1114, 441, 81, 82, 444, 442, 305,
139857
- /* 1090 */ 784, 306, 83, 362, 462, 461, 369, 1162, 830, 838,
139858
- /* 1100 */ 460, 1037, 237, 1030, 237, 81, 82, 7, 96, 96,
139859
- /* 1110 */ 96, 96, 83, 362, 462, 461, 1019, 1018, 830, 1020,
139860
- /* 1120 */ 1289, 37, 37, 400, 96, 96, 96, 96, 89, 830,
139861
- /* 1130 */ 830, 832, 833, 18, 1100, 318, 962, 292, 94, 94,
139862
- /* 1140 */ 94, 94, 93, 93, 92, 92, 92, 91, 361, 830,
139863
- /* 1150 */ 830, 832, 833, 18, 94, 94, 94, 94, 93, 93,
139864
- /* 1160 */ 92, 92, 92, 91, 361, 359, 358, 226, 226, 727,
139865
- /* 1170 */ 294, 296, 460, 962, 963, 964, 460, 989, 160, 425,
139866
- /* 1180 */ 170, 1295, 262, 460, 987, 374, 988, 386, 1145, 255,
139867
- /* 1190 */ 326, 460, 373, 38, 38, 410, 174, 39, 39, 413,
139868
- /* 1200 */ 460, 287, 460, 1053, 40, 40, 298, 728, 1220, 990,
139869
- /* 1210 */ 445, 990, 26, 26, 1219, 460, 311, 460, 169, 1292,
139870
- /* 1220 */ 460, 27, 27, 29, 29, 998, 460, 206, 135, 995,
139871
- /* 1230 */ 1265, 1263, 460, 57, 60, 460, 41, 41, 42, 42,
139872
- /* 1240 */ 460, 43, 43, 460, 343, 351, 460, 9, 9, 460,
139873
- /* 1250 */ 144, 460, 130, 44, 44, 460, 103, 103, 460, 137,
139874
- /* 1260 */ 70, 45, 45, 460, 46, 46, 460, 31, 31, 1142,
139875
- /* 1270 */ 47, 47, 48, 48, 460, 376, 32, 32, 460, 122,
139876
- /* 1280 */ 122, 460, 157, 460, 123, 123, 139, 124, 124, 460,
139877
- /* 1290 */ 186, 460, 377, 460, 115, 54, 54, 460, 403, 33,
139878
- /* 1300 */ 33, 460, 104, 104, 51, 51, 460, 161, 460, 140,
139879
- /* 1310 */ 105, 105, 106, 106, 102, 102, 460, 141, 121, 121,
139880
- /* 1320 */ 460, 142, 119, 119, 190, 460, 1152, 110, 110, 109,
139881
- /* 1330 */ 109, 702, 460, 148, 393, 65, 460, 107, 107, 460,
139882
- /* 1340 */ 323, 108, 108, 399, 460, 1234, 53, 53, 1214, 269,
139883
- /* 1350 */ 154, 416, 1115, 55, 55, 220, 401, 52, 52, 191,
139884
- /* 1360 */ 24, 24, 274, 192, 193, 28, 28, 1021, 328, 702,
139885
- /* 1370 */ 1073, 352, 1072, 718, 1071, 431, 1111, 1064, 329, 1045,
139886
- /* 1380 */ 69, 205, 6, 291, 1044, 286, 1112, 1043, 1304, 1110,
139887
- /* 1390 */ 293, 300, 295, 297, 1063, 1200, 1109, 77, 241, 448,
139888
- /* 1400 */ 356, 452, 436, 100, 214, 71, 434, 1027, 1093, 21,
139889
- /* 1410 */ 463, 242, 243, 957, 215, 217, 218, 464, 309, 307,
139890
- /* 1420 */ 308, 310, 1016, 125, 1250, 1251, 1011, 1249, 126, 127,
139891
- /* 1430 */ 1248, 113, 676, 337, 238, 338, 134, 363, 167, 1041,
139892
- /* 1440 */ 1040, 56, 247, 367, 180, 897, 111, 895, 136, 1038,
139893
- /* 1450 */ 818, 128, 138, 750, 261, 911, 185, 143, 145, 61,
139894
- /* 1460 */ 62, 63, 64, 129, 914, 187, 188, 910, 118, 12,
139895
- /* 1470 */ 189, 903, 268, 992, 203, 162, 398, 150, 149, 691,
139896
- /* 1480 */ 402, 288, 194, 406, 151, 411, 66, 13, 729, 239,
139897
- /* 1490 */ 282, 14, 67, 131, 837, 836, 865, 758, 15, 4,
139898
- /* 1500 */ 68, 762, 175, 222, 224, 424, 152, 869, 791, 202,
139899
- /* 1510 */ 786, 75, 72, 880, 866, 864, 16, 17, 920, 207,
139900
- /* 1520 */ 919, 208, 447, 946, 164, 211, 947, 210, 165, 451,
139901
- /* 1530 */ 868, 166, 315, 835, 701, 85, 212, 1297, 312, 952,
139902
- /* 1540 */ 1296,
140114
+ /* 0 */ 1169, 1015, 167, 167, 1, 168, 466, 1313, 466, 1083,
140115
+ /* 10 */ 1062, 466, 97, 94, 183, 1057, 466, 329, 1083, 342,
140116
+ /* 20 */ 97, 94, 183, 459, 459, 459, 436, 57, 57, 57,
140117
+ /* 30 */ 57, 807, 57, 57, 367, 367, 367, 57, 57, 808,
140118
+ /* 40 */ 1270, 1088, 1088, 104, 105, 95, 991, 991, 868, 871,
140119
+ /* 50 */ 860, 860, 102, 102, 103, 103, 103, 103, 233, 233,
140120
+ /* 60 */ 326, 1011, 449, 437, 449, 446, 351, 449, 461, 1142,
140121
+ /* 70 */ 463, 342, 449, 426, 1316, 209, 180, 742, 80, 299,
140122
+ /* 80 */ 857, 857, 869, 872, 101, 101, 101, 101, 100, 100,
140123
+ /* 90 */ 99, 99, 99, 98, 368, 104, 105, 95, 991, 991,
140124
+ /* 100 */ 868, 871, 860, 860, 102, 102, 103, 103, 103, 103,
140125
+ /* 110 */ 99, 99, 99, 98, 368, 355, 97, 94, 183, 228,
140126
+ /* 120 */ 106, 1012, 407, 342, 101, 101, 101, 101, 100, 100,
140127
+ /* 130 */ 99, 99, 99, 98, 368, 861, 101, 101, 101, 101,
140128
+ /* 140 */ 100, 100, 99, 99, 99, 98, 368, 104, 105, 95,
140129
+ /* 150 */ 991, 991, 868, 871, 860, 860, 102, 102, 103, 103,
140130
+ /* 160 */ 103, 103, 201, 368, 375, 420, 417, 416, 387, 273,
140131
+ /* 170 */ 65, 97, 94, 183, 168, 342, 415, 951, 1343, 396,
140132
+ /* 180 */ 66, 1343, 320, 959, 371, 970, 334, 340, 101, 101,
140133
+ /* 190 */ 101, 101, 100, 100, 99, 99, 99, 98, 368, 104,
140134
+ /* 200 */ 105, 95, 991, 991, 868, 871, 860, 860, 102, 102,
140135
+ /* 210 */ 103, 103, 103, 103, 373, 100, 100, 99, 99, 99,
140136
+ /* 220 */ 98, 368, 970, 971, 972, 201, 1100, 342, 420, 417,
140137
+ /* 230 */ 416, 287, 366, 365, 337, 970, 1162, 463, 949, 415,
140138
+ /* 240 */ 101, 101, 101, 101, 100, 100, 99, 99, 99, 98,
140139
+ /* 250 */ 368, 104, 105, 95, 991, 991, 868, 871, 860, 860,
140140
+ /* 260 */ 102, 102, 103, 103, 103, 103, 777, 241, 233, 233,
140141
+ /* 270 */ 9, 847, 970, 971, 972, 390, 998, 1141, 998, 342,
140142
+ /* 280 */ 463, 252, 829, 719, 98, 368, 840, 298, 338, 142,
140143
+ /* 290 */ 839, 339, 101, 101, 101, 101, 100, 100, 99, 99,
140144
+ /* 300 */ 99, 98, 368, 104, 105, 95, 991, 991, 868, 871,
140145
+ /* 310 */ 860, 860, 102, 102, 103, 103, 103, 103, 272, 466,
140146
+ /* 320 */ 392, 839, 839, 841, 97, 94, 183, 390, 1317, 253,
140147
+ /* 330 */ 456, 342, 125, 166, 807, 712, 208, 407, 386, 970,
140148
+ /* 340 */ 57, 57, 808, 238, 101, 101, 101, 101, 100, 100,
140149
+ /* 350 */ 99, 99, 99, 98, 368, 104, 105, 95, 991, 991,
140150
+ /* 360 */ 868, 871, 860, 860, 102, 102, 103, 103, 103, 103,
140151
+ /* 370 */ 466, 108, 466, 267, 465, 442, 970, 971, 972, 261,
140152
+ /* 380 */ 951, 1344, 909, 342, 1344, 142, 829, 848, 1292, 959,
140153
+ /* 390 */ 371, 55, 55, 57, 57, 242, 101, 101, 101, 101,
140154
+ /* 400 */ 100, 100, 99, 99, 99, 98, 368, 104, 105, 95,
140155
+ /* 410 */ 991, 991, 868, 871, 860, 860, 102, 102, 103, 103,
140156
+ /* 420 */ 103, 103, 272, 382, 262, 253, 456, 310, 364, 253,
140157
+ /* 430 */ 456, 86, 264, 84, 266, 342, 441, 176, 175, 834,
140158
+ /* 440 */ 464, 949, 767, 767, 332, 313, 1094, 396, 101, 101,
140159
+ /* 450 */ 101, 101, 100, 100, 99, 99, 99, 98, 368, 104,
140160
+ /* 460 */ 105, 95, 991, 991, 868, 871, 860, 860, 102, 102,
140161
+ /* 470 */ 103, 103, 103, 103, 227, 227, 233, 233, 233, 233,
140162
+ /* 480 */ 387, 273, 234, 234, 326, 950, 463, 342, 463, 298,
140163
+ /* 490 */ 463, 914, 914, 404, 463, 1037, 123, 265, 27, 970,
140164
+ /* 500 */ 101, 101, 101, 101, 100, 100, 99, 99, 99, 98,
140165
+ /* 510 */ 368, 104, 105, 95, 991, 991, 868, 871, 860, 860,
140166
+ /* 520 */ 102, 102, 103, 103, 103, 103, 435, 233, 233, 466,
140167
+ /* 530 */ 285, 686, 687, 688, 127, 271, 970, 971, 972, 463,
140168
+ /* 540 */ 1345, 327, 342, 407, 157, 1012, 988, 13, 13, 181,
140169
+ /* 550 */ 41, 41, 101, 101, 101, 101, 100, 100, 99, 99,
140170
+ /* 560 */ 99, 98, 368, 715, 794, 378, 104, 105, 95, 991,
140171
+ /* 570 */ 991, 868, 871, 860, 860, 102, 102, 103, 103, 103,
140172
+ /* 580 */ 103, 970, 378, 377, 346, 239, 847, 1086, 1086, 280,
140173
+ /* 590 */ 1169, 283, 204, 203, 202, 177, 298, 342, 407, 298,
140174
+ /* 600 */ 715, 840, 169, 299, 407, 839, 82, 101, 101, 101,
140175
+ /* 610 */ 101, 100, 100, 99, 99, 99, 98, 368, 970, 971,
140176
+ /* 620 */ 972, 104, 105, 95, 991, 991, 868, 871, 860, 860,
140177
+ /* 630 */ 102, 102, 103, 103, 103, 103, 839, 839, 841, 362,
140178
+ /* 640 */ 240, 124, 1169, 172, 126, 378, 1269, 1169, 1066, 342,
140179
+ /* 650 */ 253, 456, 407, 407, 407, 396, 352, 401, 407, 429,
140180
+ /* 660 */ 398, 85, 101, 101, 101, 101, 100, 100, 99, 99,
140181
+ /* 670 */ 99, 98, 368, 104, 105, 95, 991, 991, 868, 871,
140182
+ /* 680 */ 860, 860, 102, 102, 103, 103, 103, 103, 1169, 466,
140183
+ /* 690 */ 230, 233, 233, 792, 1235, 1095, 1091, 1293, 1, 77,
140184
+ /* 700 */ 278, 342, 205, 463, 974, 911, 1040, 348, 353, 911,
140185
+ /* 710 */ 42, 42, 79, 403, 101, 101, 101, 101, 100, 100,
140186
+ /* 720 */ 99, 99, 99, 98, 368, 104, 93, 95, 991, 991,
140187
+ /* 730 */ 868, 871, 860, 860, 102, 102, 103, 103, 103, 103,
140188
+ /* 740 */ 402, 9, 974, 243, 772, 458, 348, 232, 180, 771,
140189
+ /* 750 */ 946, 312, 342, 328, 363, 349, 143, 831, 389, 1278,
140190
+ /* 760 */ 211, 211, 21, 347, 432, 182, 101, 101, 101, 101,
140191
+ /* 770 */ 100, 100, 99, 99, 99, 98, 368, 105, 95, 991,
140192
+ /* 780 */ 991, 868, 871, 860, 860, 102, 102, 103, 103, 103,
140193
+ /* 790 */ 103, 792, 724, 22, 732, 731, 233, 233, 1239, 256,
140194
+ /* 800 */ 391, 274, 342, 211, 79, 360, 257, 413, 463, 397,
140195
+ /* 810 */ 207, 288, 260, 450, 79, 1239, 1241, 101, 101, 101,
140196
+ /* 820 */ 101, 100, 100, 99, 99, 99, 98, 368, 95, 991,
140197
+ /* 830 */ 991, 868, 871, 860, 860, 102, 102, 103, 103, 103,
140198
+ /* 840 */ 103, 91, 457, 296, 3, 233, 233, 5, 438, 212,
140199
+ /* 850 */ 331, 394, 739, 740, 295, 898, 894, 463, 460, 207,
140200
+ /* 860 */ 801, 1237, 722, 211, 698, 843, 1283, 101, 101, 101,
140201
+ /* 870 */ 101, 100, 100, 99, 99, 99, 98, 368, 1239, 380,
140202
+ /* 880 */ 357, 369, 233, 233, 989, 219, 236, 297, 423, 292,
140203
+ /* 890 */ 422, 206, 454, 898, 463, 970, 91, 457, 290, 3,
140204
+ /* 900 */ 722, 142, 268, 843, 847, 466, 1258, 149, 388, 425,
140205
+ /* 910 */ 88, 89, 769, 460, 930, 87, 447, 90, 369, 468,
140206
+ /* 920 */ 467, 385, 989, 839, 1257, 439, 57, 57, 395, 931,
140207
+ /* 930 */ 1065, 158, 970, 971, 972, 772, 369, 471, 1019, 399,
140208
+ /* 940 */ 771, 253, 456, 254, 932, 119, 891, 454, 233, 233,
140209
+ /* 950 */ 4, 970, 1096, 275, 839, 839, 841, 842, 19, 847,
140210
+ /* 960 */ 463, 449, 448, 163, 453, 88, 89, 776, 970, 1127,
140211
+ /* 970 */ 279, 930, 90, 369, 468, 467, 91, 457, 839, 3,
140212
+ /* 980 */ 235, 1064, 466, 1228, 233, 233, 931, 970, 970, 971,
140213
+ /* 990 */ 972, 970, 908, 460, 908, 2, 463, 81, 457, 212,
140214
+ /* 1000 */ 3, 932, 282, 10, 10, 970, 971, 972, 189, 839,
140215
+ /* 1010 */ 839, 841, 842, 19, 460, 284, 369, 354, 907, 286,
140216
+ /* 1020 */ 907, 753, 466, 1079, 970, 971, 972, 454, 970, 971,
140217
+ /* 1030 */ 972, 754, 970, 1063, 989, 372, 792, 369, 1118, 847,
140218
+ /* 1040 */ 291, 452, 466, 10, 10, 88, 89, 142, 454, 168,
140219
+ /* 1050 */ 300, 412, 90, 369, 468, 467, 793, 356, 839, 706,
140220
+ /* 1060 */ 847, 341, 121, 10, 10, 301, 88, 89, 379, 970,
140221
+ /* 1070 */ 971, 972, 989, 90, 369, 468, 467, 244, 205, 839,
140222
+ /* 1080 */ 1306, 245, 1135, 245, 250, 1168, 1114, 253, 456, 839,
140223
+ /* 1090 */ 839, 841, 842, 19, 1125, 237, 122, 451, 1174, 733,
140224
+ /* 1100 */ 324, 324, 323, 222, 321, 466, 1046, 695, 182, 225,
140225
+ /* 1110 */ 839, 839, 841, 842, 19, 103, 103, 103, 103, 96,
140226
+ /* 1120 */ 185, 466, 259, 1039, 1028, 170, 10, 10, 1027, 421,
140227
+ /* 1130 */ 258, 1029, 1300, 708, 792, 466, 408, 734, 8, 347,
140228
+ /* 1140 */ 444, 174, 12, 12, 290, 101, 101, 101, 101, 100,
140229
+ /* 1150 */ 100, 99, 99, 99, 98, 368, 32, 32, 466, 187,
140230
+ /* 1160 */ 466, 1111, 103, 103, 103, 103, 188, 466, 325, 138,
140231
+ /* 1170 */ 186, 708, 303, 305, 307, 358, 970, 270, 393, 43,
140232
+ /* 1180 */ 43, 44, 44, 1157, 333, 178, 418, 294, 45, 45,
140233
+ /* 1190 */ 1232, 318, 101, 101, 101, 101, 100, 100, 99, 99,
140234
+ /* 1200 */ 99, 98, 368, 381, 343, 366, 365, 466, 263, 253,
140235
+ /* 1210 */ 456, 466, 1062, 970, 971, 972, 1231, 997, 309, 466,
140236
+ /* 1220 */ 455, 466, 427, 466, 995, 173, 996, 1303, 46, 46,
140237
+ /* 1230 */ 145, 376, 37, 37, 1006, 1277, 466, 214, 1275, 64,
140238
+ /* 1240 */ 47, 47, 33, 33, 34, 34, 1003, 67, 466, 998,
140239
+ /* 1250 */ 350, 998, 466, 155, 233, 233, 466, 36, 36, 24,
140240
+ /* 1260 */ 140, 77, 1154, 466, 383, 466, 463, 428, 466, 48,
140241
+ /* 1270 */ 48, 466, 147, 49, 49, 466, 150, 50, 50, 466,
140242
+ /* 1280 */ 151, 152, 466, 384, 11, 11, 51, 51, 466, 110,
140243
+ /* 1290 */ 110, 153, 52, 52, 411, 466, 38, 38, 466, 191,
140244
+ /* 1300 */ 53, 53, 466, 54, 54, 466, 400, 466, 330, 39,
140245
+ /* 1310 */ 39, 466, 1164, 466, 25, 466, 56, 56, 466, 131,
140246
+ /* 1320 */ 131, 72, 466, 132, 132, 159, 133, 133, 61, 61,
140247
+ /* 1330 */ 1226, 195, 40, 40, 111, 111, 58, 58, 406, 112,
140248
+ /* 1340 */ 112, 466, 277, 113, 113, 466, 226, 466, 1246, 466,
140249
+ /* 1350 */ 197, 466, 164, 466, 409, 466, 198, 466, 199, 466,
140250
+ /* 1360 */ 335, 281, 109, 109, 466, 1030, 130, 130, 129, 129,
140251
+ /* 1370 */ 117, 117, 116, 116, 114, 114, 115, 115, 60, 60,
140252
+ /* 1380 */ 62, 62, 466, 359, 466, 59, 59, 424, 1082, 1081,
140253
+ /* 1390 */ 1080, 724, 1073, 1054, 336, 293, 1053, 1052, 1315, 431,
140254
+ /* 1400 */ 361, 76, 248, 31, 31, 35, 35, 1072, 249, 440,
140255
+ /* 1410 */ 302, 434, 213, 1122, 6, 311, 1212, 107, 83, 251,
140256
+ /* 1420 */ 78, 1123, 445, 220, 443, 1036, 304, 23, 1121, 469,
140257
+ /* 1430 */ 965, 221, 223, 1104, 314, 224, 344, 317, 315, 316,
140258
+ /* 1440 */ 470, 306, 1025, 1120, 308, 1262, 1020, 134, 120, 246,
140259
+ /* 1450 */ 682, 370, 171, 255, 1263, 135, 184, 1261, 1260, 374,
140260
+ /* 1460 */ 118, 906, 904, 827, 1050, 146, 136, 137, 148, 1049,
140261
+ /* 1470 */ 63, 1047, 756, 190, 269, 920, 154, 156, 68, 69,
140262
+ /* 1480 */ 70, 71, 139, 923, 192, 193, 144, 919, 345, 128,
140263
+ /* 1490 */ 14, 194, 276, 211, 1000, 405, 196, 161, 912, 160,
140264
+ /* 1500 */ 26, 697, 410, 295, 200, 289, 414, 162, 419, 73,
140265
+ /* 1510 */ 15, 16, 141, 74, 28, 247, 846, 845, 735, 874,
140266
+ /* 1520 */ 954, 75, 430, 955, 29, 433, 179, 229, 231, 800,
140267
+ /* 1530 */ 165, 795, 87, 210, 889, 79, 875, 17, 873, 877,
140268
+ /* 1540 */ 929, 18, 928, 216, 215, 878, 20, 30, 462, 844,
140269
+ /* 1550 */ 707, 92, 766, 770, 7, 322, 217, 218, 319, 1308,
140270
+ /* 1560 */ 960, 1016, 1016, 1016, 1016, 1307,
139903140271
};
139904140272
static const YYCODETYPE yy_lookahead[] = {
139905
- /* 0 */ 144, 145, 146, 147, 172, 222, 223, 224, 222, 223,
139906
- /* 10 */ 224, 152, 180, 152, 148, 149, 152, 173, 176, 19,
139907
- /* 20 */ 154, 173, 156, 152, 163, 242, 152, 163, 176, 163,
139908
- /* 30 */ 26, 31, 173, 174, 173, 174, 173, 173, 174, 39,
139909
- /* 40 */ 1, 2, 152, 43, 44, 45, 46, 47, 48, 49,
139910
- /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 197, 169,
139911
- /* 60 */ 170, 197, 188, 197, 222, 223, 224, 208, 209, 208,
139912
- /* 70 */ 209, 19, 208, 152, 222, 223, 224, 22, 26, 24,
140273
+ /* 0 */ 152, 144, 145, 146, 147, 152, 152, 172, 152, 180,
140274
+ /* 10 */ 181, 152, 223, 224, 225, 180, 152, 164, 189, 19,
140275
+ /* 20 */ 223, 224, 225, 168, 169, 170, 163, 173, 174, 173,
140276
+ /* 30 */ 174, 31, 173, 174, 168, 169, 170, 173, 174, 39,
140277
+ /* 40 */ 243, 191, 192, 43, 44, 45, 46, 47, 48, 49,
140278
+ /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 195, 196,
140279
+ /* 60 */ 22, 23, 208, 209, 208, 209, 218, 208, 209, 176,
140280
+ /* 70 */ 207, 19, 208, 209, 23, 212, 213, 26, 26, 152,
139913140281
/* 80 */ 46, 47, 48, 49, 84, 85, 86, 87, 88, 89,
139914140282
/* 90 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47,
139915140283
/* 100 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
139916
- /* 110 */ 106, 245, 157, 88, 89, 90, 91, 92, 93, 94,
139917
- /* 120 */ 68, 231, 251, 19, 84, 85, 86, 87, 88, 89,
140284
+ /* 110 */ 90, 91, 92, 93, 94, 188, 223, 224, 225, 171,
140285
+ /* 120 */ 68, 83, 152, 19, 84, 85, 86, 87, 88, 89,
139918140286
/* 130 */ 90, 91, 92, 93, 94, 101, 84, 85, 86, 87,
139919140287
/* 140 */ 88, 89, 90, 91, 92, 93, 94, 43, 44, 45,
139920140288
/* 150 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
139921
- /* 160 */ 56, 57, 90, 91, 92, 93, 94, 82, 79, 99,
139922
- /* 170 */ 66, 200, 102, 103, 104, 19, 168, 169, 170, 152,
139923
- /* 180 */ 24, 210, 97, 113, 229, 59, 101, 232, 84, 85,
140289
+ /* 160 */ 56, 57, 99, 94, 194, 102, 103, 104, 109, 110,
140290
+ /* 170 */ 66, 223, 224, 225, 152, 19, 113, 22, 23, 152,
140291
+ /* 180 */ 24, 26, 160, 1, 2, 59, 164, 173, 84, 85,
139924140292
/* 190 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 43,
139925140293
/* 200 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
139926
- /* 210 */ 54, 55, 56, 57, 152, 188, 152, 132, 133, 134,
139927
- /* 220 */ 93, 94, 96, 97, 98, 99, 152, 19, 102, 103,
139928
- /* 230 */ 104, 23, 94, 72, 79, 173, 174, 173, 174, 113,
140294
+ /* 210 */ 54, 55, 56, 57, 244, 88, 89, 90, 91, 92,
140295
+ /* 220 */ 93, 94, 96, 97, 98, 99, 196, 19, 102, 103,
140296
+ /* 230 */ 104, 23, 88, 89, 173, 59, 163, 207, 83, 113,
139929140297
/* 240 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
139930140298
/* 250 */ 94, 43, 44, 45, 46, 47, 48, 49, 50, 51,
139931
- /* 260 */ 52, 53, 54, 55, 56, 57, 152, 171, 152, 108,
139932
- /* 270 */ 109, 110, 208, 209, 119, 120, 152, 180, 181, 19,
139933
- /* 280 */ 119, 120, 152, 23, 152, 152, 189, 173, 174, 173,
139934
- /* 290 */ 174, 59, 84, 85, 86, 87, 88, 89, 90, 91,
140299
+ /* 260 */ 52, 53, 54, 55, 56, 57, 90, 240, 195, 196,
140300
+ /* 270 */ 171, 82, 96, 97, 98, 152, 132, 176, 134, 19,
140301
+ /* 280 */ 207, 200, 72, 23, 93, 94, 97, 152, 173, 79,
140302
+ /* 290 */ 101, 210, 84, 85, 86, 87, 88, 89, 90, 91,
139935140303
/* 300 */ 92, 93, 94, 43, 44, 45, 46, 47, 48, 49,
139936
- /* 310 */ 50, 51, 52, 53, 54, 55, 56, 57, 222, 223,
139937
- /* 320 */ 224, 186, 208, 209, 208, 209, 194, 194, 96, 97,
139938
- /* 330 */ 98, 19, 168, 169, 170, 23, 88, 89, 163, 59,
139939
- /* 340 */ 0, 1, 2, 219, 84, 85, 86, 87, 88, 89,
140304
+ /* 310 */ 50, 51, 52, 53, 54, 55, 56, 57, 108, 152,
140305
+ /* 320 */ 152, 132, 133, 134, 223, 224, 225, 152, 186, 119,
140306
+ /* 330 */ 120, 19, 197, 234, 31, 23, 26, 152, 239, 59,
140307
+ /* 340 */ 173, 174, 39, 220, 84, 85, 86, 87, 88, 89,
139940140308
/* 350 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47,
139941140309
/* 360 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
139942
- /* 370 */ 90, 152, 197, 195, 196, 243, 96, 97, 98, 196,
139943
- /* 380 */ 132, 11, 134, 19, 182, 207, 115, 23, 117, 118,
139944
- /* 390 */ 207, 163, 173, 174, 152, 220, 84, 85, 86, 87,
140310
+ /* 370 */ 152, 22, 152, 16, 152, 208, 96, 97, 98, 194,
140311
+ /* 380 */ 22, 23, 11, 19, 26, 79, 72, 23, 0, 1,
140312
+ /* 390 */ 2, 173, 174, 173, 174, 220, 84, 85, 86, 87,
139945140313
/* 400 */ 88, 89, 90, 91, 92, 93, 94, 43, 44, 45,
139946140314
/* 410 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
139947
- /* 420 */ 56, 57, 152, 16, 152, 197, 171, 208, 22, 23,
139948
- /* 430 */ 22, 23, 26, 16, 26, 19, 7, 8, 9, 23,
139949
- /* 440 */ 212, 213, 152, 173, 174, 173, 174, 19, 84, 85,
140315
+ /* 420 */ 56, 57, 108, 109, 110, 119, 120, 152, 208, 119,
140316
+ /* 430 */ 120, 137, 75, 139, 77, 19, 152, 88, 89, 23,
140317
+ /* 440 */ 115, 83, 117, 118, 163, 227, 163, 152, 84, 85,
139950140318
/* 450 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 43,
139951140319
/* 460 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
139952
- /* 470 */ 54, 55, 56, 57, 46, 152, 109, 110, 208, 109,
139953
- /* 480 */ 110, 152, 75, 152, 77, 22, 23, 19, 233, 83,
139954
- /* 490 */ 152, 83, 75, 238, 77, 164, 173, 174, 226, 59,
140320
+ /* 470 */ 54, 55, 56, 57, 195, 196, 195, 196, 195, 196,
140321
+ /* 480 */ 109, 110, 195, 196, 22, 23, 207, 19, 207, 152,
140322
+ /* 490 */ 207, 108, 109, 110, 207, 163, 22, 140, 24, 59,
139955140323
/* 500 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
139956140324
/* 510 */ 94, 43, 44, 45, 46, 47, 48, 49, 50, 51,
139957
- /* 520 */ 52, 53, 54, 55, 56, 57, 108, 109, 110, 152,
139958
- /* 530 */ 152, 152, 22, 22, 23, 107, 96, 97, 98, 160,
139959
- /* 540 */ 112, 251, 19, 164, 22, 152, 83, 140, 219, 152,
140325
+ /* 520 */ 52, 53, 54, 55, 56, 57, 152, 195, 196, 152,
140326
+ /* 530 */ 16, 7, 8, 9, 197, 240, 96, 97, 98, 207,
140327
+ /* 540 */ 249, 250, 19, 152, 22, 83, 26, 173, 174, 152,
139960140328
/* 550 */ 173, 174, 84, 85, 86, 87, 88, 89, 90, 91,
139961140329
/* 560 */ 92, 93, 94, 59, 124, 152, 43, 44, 45, 46,
139962140330
/* 570 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
139963
- /* 580 */ 57, 59, 169, 170, 119, 120, 82, 108, 109, 110,
139964
- /* 590 */ 191, 192, 191, 192, 83, 248, 249, 19, 88, 89,
140331
+ /* 580 */ 57, 59, 169, 170, 157, 194, 82, 191, 192, 75,
140332
+ /* 590 */ 152, 77, 108, 109, 110, 26, 152, 19, 152, 152,
139965140333
/* 600 */ 96, 97, 24, 152, 152, 101, 138, 84, 85, 86,
139966140334
/* 610 */ 87, 88, 89, 90, 91, 92, 93, 94, 96, 97,
139967140335
/* 620 */ 98, 43, 44, 45, 46, 47, 48, 49, 50, 51,
139968
- /* 630 */ 52, 53, 54, 55, 56, 57, 132, 133, 134, 152,
139969
- /* 640 */ 152, 46, 152, 26, 231, 194, 194, 146, 147, 19,
139970
- /* 650 */ 152, 116, 152, 72, 152, 152, 121, 152, 152, 152,
139971
- /* 660 */ 79, 138, 84, 85, 86, 87, 88, 89, 90, 91,
140336
+ /* 630 */ 52, 53, 54, 55, 56, 57, 132, 133, 134, 188,
140337
+ /* 640 */ 194, 197, 152, 123, 197, 232, 194, 152, 182, 19,
140338
+ /* 650 */ 119, 120, 152, 152, 152, 152, 218, 230, 152, 163,
140339
+ /* 660 */ 233, 138, 84, 85, 86, 87, 88, 89, 90, 91,
139972140340
/* 670 */ 92, 93, 94, 43, 44, 45, 46, 47, 48, 49,
139973
- /* 680 */ 50, 51, 52, 53, 54, 55, 56, 57, 152, 108,
139974
- /* 690 */ 23, 152, 194, 26, 194, 152, 194, 194, 137, 152,
139975
- /* 700 */ 139, 19, 107, 166, 167, 218, 218, 29, 218, 173,
139976
- /* 710 */ 174, 33, 173, 174, 84, 85, 86, 87, 88, 89,
140341
+ /* 680 */ 50, 51, 52, 53, 54, 55, 56, 57, 152, 152,
140342
+ /* 690 */ 23, 195, 196, 26, 194, 194, 194, 146, 147, 130,
140343
+ /* 700 */ 194, 19, 46, 207, 59, 29, 166, 167, 218, 33,
140344
+ /* 710 */ 173, 174, 26, 218, 84, 85, 86, 87, 88, 89,
139977140345
/* 720 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47,
139978140346
/* 730 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
139979
- /* 740 */ 152, 194, 64, 171, 239, 239, 239, 130, 166, 167,
139980
- /* 750 */ 212, 213, 19, 23, 246, 247, 26, 59, 26, 152,
139981
- /* 760 */ 163, 218, 163, 163, 163, 98, 84, 85, 86, 87,
140347
+ /* 740 */ 64, 171, 97, 240, 116, 166, 167, 212, 213, 121,
140348
+ /* 750 */ 23, 152, 19, 26, 218, 247, 248, 23, 23, 152,
140349
+ /* 760 */ 26, 26, 22, 107, 163, 98, 84, 85, 86, 87,
139982140350
/* 770 */ 88, 89, 90, 91, 92, 93, 94, 44, 45, 46,
139983140351
/* 780 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
139984
- /* 790 */ 57, 124, 26, 79, 197, 97, 197, 197, 197, 31,
139985
- /* 800 */ 152, 23, 19, 19, 26, 19, 218, 39, 23, 21,
139986
- /* 810 */ 238, 26, 163, 163, 100, 59, 163, 84, 85, 86,
140352
+ /* 790 */ 57, 124, 106, 53, 100, 101, 195, 196, 152, 152,
140353
+ /* 800 */ 23, 23, 19, 26, 26, 19, 152, 23, 207, 239,
140354
+ /* 810 */ 26, 23, 152, 163, 26, 169, 170, 84, 85, 86,
139987140355
/* 820 */ 87, 88, 89, 90, 91, 92, 93, 94, 45, 46,
139988140356
/* 830 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
139989
- /* 840 */ 57, 19, 20, 152, 22, 23, 197, 197, 23, 19,
139990
- /* 850 */ 197, 26, 152, 97, 23, 123, 23, 26, 36, 26,
139991
- /* 860 */ 152, 152, 19, 20, 98, 22, 78, 84, 85, 86,
139992
- /* 870 */ 87, 88, 89, 90, 91, 92, 93, 94, 94, 36,
139993
- /* 880 */ 152, 59, 96, 99, 100, 101, 102, 103, 104, 105,
139994
- /* 890 */ 124, 103, 70, 100, 101, 23, 112, 12, 26, 12,
139995
- /* 900 */ 23, 79, 59, 26, 82, 101, 22, 7, 8, 152,
139996
- /* 910 */ 88, 89, 27, 70, 27, 152, 112, 95, 96, 97,
139997
- /* 920 */ 98, 152, 79, 101, 22, 82, 96, 42, 140, 42,
139998
- /* 930 */ 182, 88, 89, 19, 20, 132, 22, 134, 95, 96,
139999
- /* 940 */ 97, 98, 23, 59, 101, 26, 22, 62, 152, 62,
140000
- /* 950 */ 36, 22, 59, 24, 132, 133, 134, 135, 136, 72,
140001
- /* 960 */ 5, 59, 152, 22, 71, 10, 11, 12, 13, 14,
140002
- /* 970 */ 152, 152, 17, 59, 182, 132, 133, 134, 135, 136,
140003
- /* 980 */ 96, 97, 98, 59, 70, 30, 152, 32, 59, 96,
140004
- /* 990 */ 97, 98, 173, 174, 53, 40, 82, 152, 96, 97,
140005
- /* 1000 */ 98, 90, 88, 89, 90, 24, 187, 173, 174, 95,
140006
- /* 1010 */ 96, 97, 98, 152, 152, 101, 19, 20, 152, 22,
140007
- /* 1020 */ 96, 97, 98, 152, 69, 59, 97, 116, 59, 214,
140008
- /* 1030 */ 152, 76, 121, 36, 79, 80, 19, 20, 152, 22,
140009
- /* 1040 */ 59, 132, 59, 134, 173, 174, 132, 133, 134, 135,
140010
- /* 1050 */ 136, 173, 174, 36, 234, 152, 59, 152, 187, 173,
140011
- /* 1060 */ 174, 211, 96, 97, 98, 187, 97, 70, 23, 114,
140012
- /* 1070 */ 152, 26, 23, 187, 23, 26, 59, 26, 97, 82,
140013
- /* 1080 */ 97, 22, 164, 152, 152, 88, 89, 70, 192, 152,
140014
- /* 1090 */ 124, 152, 95, 96, 97, 98, 141, 152, 101, 82,
140015
- /* 1100 */ 152, 152, 184, 152, 186, 88, 89, 199, 54, 55,
140016
- /* 1110 */ 56, 57, 95, 96, 97, 98, 152, 152, 101, 152,
140017
- /* 1120 */ 152, 173, 174, 235, 54, 55, 56, 57, 58, 132,
140018
- /* 1130 */ 133, 134, 135, 136, 211, 150, 59, 211, 84, 85,
140019
- /* 1140 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 132,
140020
- /* 1150 */ 133, 134, 135, 136, 84, 85, 86, 87, 88, 89,
140021
- /* 1160 */ 90, 91, 92, 93, 94, 88, 89, 195, 196, 35,
140022
- /* 1170 */ 211, 211, 152, 96, 97, 98, 152, 100, 198, 207,
140023
- /* 1180 */ 171, 122, 240, 152, 107, 215, 109, 240, 202, 215,
140024
- /* 1190 */ 202, 152, 220, 173, 174, 177, 185, 173, 174, 65,
140025
- /* 1200 */ 152, 176, 152, 181, 173, 174, 215, 73, 176, 132,
140026
- /* 1210 */ 228, 134, 173, 174, 176, 152, 201, 152, 199, 155,
140027
- /* 1220 */ 152, 173, 174, 173, 174, 60, 152, 122, 244, 38,
140028
- /* 1230 */ 159, 159, 152, 241, 241, 152, 173, 174, 173, 174,
140029
- /* 1240 */ 152, 173, 174, 152, 159, 111, 152, 173, 174, 152,
140030
- /* 1250 */ 22, 152, 43, 173, 174, 152, 173, 174, 152, 190,
140031
- /* 1260 */ 130, 173, 174, 152, 173, 174, 152, 173, 174, 202,
140032
- /* 1270 */ 173, 174, 173, 174, 152, 18, 173, 174, 152, 173,
140033
- /* 1280 */ 174, 152, 221, 152, 173, 174, 193, 173, 174, 152,
140034
- /* 1290 */ 158, 152, 159, 152, 22, 173, 174, 152, 18, 173,
140035
- /* 1300 */ 174, 152, 173, 174, 173, 174, 152, 221, 152, 193,
140036
- /* 1310 */ 173, 174, 173, 174, 173, 174, 152, 193, 173, 174,
140037
- /* 1320 */ 152, 193, 173, 174, 158, 152, 190, 173, 174, 173,
140038
- /* 1330 */ 174, 59, 152, 190, 159, 137, 152, 173, 174, 152,
140039
- /* 1340 */ 202, 173, 174, 61, 152, 237, 173, 174, 202, 236,
140040
- /* 1350 */ 22, 107, 159, 173, 174, 159, 178, 173, 174, 158,
140041
- /* 1360 */ 173, 174, 159, 158, 158, 173, 174, 159, 178, 97,
140042
- /* 1370 */ 175, 63, 175, 106, 175, 125, 217, 183, 178, 175,
140043
- /* 1380 */ 107, 159, 22, 216, 177, 175, 217, 175, 175, 217,
140044
- /* 1390 */ 216, 159, 216, 216, 183, 225, 217, 137, 227, 178,
140045
- /* 1400 */ 94, 178, 126, 129, 25, 128, 127, 162, 206, 26,
140046
- /* 1410 */ 161, 230, 230, 13, 153, 153, 6, 151, 203, 205,
140047
- /* 1420 */ 204, 202, 151, 165, 171, 171, 151, 171, 165, 165,
140048
- /* 1430 */ 171, 179, 4, 250, 179, 250, 247, 3, 22, 171,
140049
- /* 1440 */ 171, 171, 142, 81, 15, 23, 16, 23, 131, 171,
140050
- /* 1450 */ 120, 111, 123, 20, 16, 1, 125, 123, 131, 53,
140051
- /* 1460 */ 53, 53, 53, 111, 96, 34, 122, 1, 5, 22,
140052
- /* 1470 */ 107, 67, 140, 74, 26, 24, 41, 107, 67, 20,
140053
- /* 1480 */ 19, 112, 105, 66, 22, 66, 22, 22, 28, 66,
140054
- /* 1490 */ 23, 22, 22, 37, 23, 23, 23, 116, 22, 22,
140055
- /* 1500 */ 26, 23, 122, 23, 23, 26, 22, 11, 96, 34,
140056
- /* 1510 */ 124, 26, 26, 23, 23, 23, 34, 34, 23, 26,
140057
- /* 1520 */ 23, 22, 24, 23, 22, 122, 23, 26, 22, 24,
140058
- /* 1530 */ 23, 22, 15, 23, 23, 22, 122, 122, 23, 1,
140059
- /* 1540 */ 122, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140060
- /* 1550 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140061
- /* 1560 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140357
+ /* 840 */ 57, 19, 20, 101, 22, 195, 196, 22, 19, 24,
140358
+ /* 850 */ 163, 19, 7, 8, 112, 59, 23, 207, 36, 26,
140359
+ /* 860 */ 23, 152, 59, 26, 21, 59, 152, 84, 85, 86,
140360
+ /* 870 */ 87, 88, 89, 90, 91, 92, 93, 94, 232, 221,
140361
+ /* 880 */ 94, 59, 195, 196, 59, 99, 100, 101, 102, 103,
140362
+ /* 890 */ 104, 105, 70, 97, 207, 59, 19, 20, 112, 22,
140363
+ /* 900 */ 97, 79, 152, 97, 82, 152, 152, 71, 221, 90,
140364
+ /* 910 */ 88, 89, 23, 36, 12, 26, 163, 95, 96, 97,
140365
+ /* 920 */ 98, 78, 97, 101, 152, 96, 173, 174, 96, 27,
140366
+ /* 930 */ 182, 22, 96, 97, 98, 116, 59, 148, 149, 152,
140367
+ /* 940 */ 121, 119, 120, 154, 42, 156, 103, 70, 195, 196,
140368
+ /* 950 */ 22, 59, 163, 152, 132, 133, 134, 135, 136, 82,
140369
+ /* 960 */ 207, 208, 209, 71, 62, 88, 89, 90, 59, 152,
140370
+ /* 970 */ 152, 12, 95, 96, 97, 98, 19, 20, 101, 22,
140371
+ /* 980 */ 22, 182, 152, 140, 195, 196, 27, 59, 96, 97,
140372
+ /* 990 */ 98, 59, 132, 36, 134, 22, 207, 19, 20, 24,
140373
+ /* 1000 */ 22, 42, 152, 173, 174, 96, 97, 98, 219, 132,
140374
+ /* 1010 */ 133, 134, 135, 136, 36, 152, 59, 187, 132, 152,
140375
+ /* 1020 */ 134, 62, 152, 152, 96, 97, 98, 70, 96, 97,
140376
+ /* 1030 */ 98, 72, 59, 152, 59, 246, 26, 59, 214, 82,
140377
+ /* 1040 */ 152, 192, 152, 173, 174, 88, 89, 79, 70, 152,
140378
+ /* 1050 */ 152, 19, 95, 96, 97, 98, 124, 187, 101, 23,
140379
+ /* 1060 */ 82, 164, 26, 173, 174, 152, 88, 89, 100, 96,
140380
+ /* 1070 */ 97, 98, 97, 95, 96, 97, 98, 187, 46, 101,
140381
+ /* 1080 */ 122, 184, 152, 186, 211, 152, 152, 119, 120, 132,
140382
+ /* 1090 */ 133, 134, 135, 136, 152, 5, 22, 152, 152, 35,
140383
+ /* 1100 */ 10, 11, 12, 13, 14, 152, 152, 17, 98, 235,
140384
+ /* 1110 */ 132, 133, 134, 135, 136, 54, 55, 56, 57, 58,
140385
+ /* 1120 */ 30, 152, 32, 152, 152, 198, 173, 174, 152, 65,
140386
+ /* 1130 */ 40, 152, 152, 59, 124, 152, 236, 73, 199, 107,
140387
+ /* 1140 */ 187, 171, 173, 174, 112, 84, 85, 86, 87, 88,
140388
+ /* 1150 */ 89, 90, 91, 92, 93, 94, 173, 174, 152, 69,
140389
+ /* 1160 */ 152, 211, 54, 55, 56, 57, 76, 152, 150, 79,
140390
+ /* 1170 */ 80, 97, 211, 211, 211, 111, 59, 241, 241, 173,
140391
+ /* 1180 */ 174, 173, 174, 202, 202, 185, 177, 176, 173, 174,
140392
+ /* 1190 */ 176, 201, 84, 85, 86, 87, 88, 89, 90, 91,
140393
+ /* 1200 */ 92, 93, 94, 215, 114, 88, 89, 152, 215, 119,
140394
+ /* 1210 */ 120, 152, 181, 96, 97, 98, 176, 100, 215, 152,
140395
+ /* 1220 */ 229, 152, 163, 152, 107, 199, 109, 155, 173, 174,
140396
+ /* 1230 */ 245, 141, 173, 174, 60, 159, 152, 122, 159, 242,
140397
+ /* 1240 */ 173, 174, 173, 174, 173, 174, 38, 242, 152, 132,
140398
+ /* 1250 */ 159, 134, 152, 22, 195, 196, 152, 173, 174, 222,
140399
+ /* 1260 */ 43, 130, 202, 152, 18, 152, 207, 208, 152, 173,
140400
+ /* 1270 */ 174, 152, 190, 173, 174, 152, 193, 173, 174, 152,
140401
+ /* 1280 */ 193, 193, 152, 159, 173, 174, 173, 174, 152, 173,
140402
+ /* 1290 */ 174, 193, 173, 174, 18, 152, 173, 174, 152, 158,
140403
+ /* 1300 */ 173, 174, 152, 173, 174, 152, 159, 152, 202, 173,
140404
+ /* 1310 */ 174, 152, 190, 152, 222, 152, 173, 174, 152, 173,
140405
+ /* 1320 */ 174, 137, 152, 173, 174, 190, 173, 174, 173, 174,
140406
+ /* 1330 */ 202, 158, 173, 174, 173, 174, 173, 174, 61, 173,
140407
+ /* 1340 */ 174, 152, 237, 173, 174, 152, 159, 152, 238, 152,
140408
+ /* 1350 */ 158, 152, 22, 152, 178, 152, 158, 152, 158, 152,
140409
+ /* 1360 */ 178, 159, 173, 174, 152, 159, 173, 174, 173, 174,
140410
+ /* 1370 */ 173, 174, 173, 174, 173, 174, 173, 174, 173, 174,
140411
+ /* 1380 */ 173, 174, 152, 63, 152, 173, 174, 107, 175, 175,
140412
+ /* 1390 */ 175, 106, 183, 175, 178, 175, 177, 175, 175, 178,
140413
+ /* 1400 */ 94, 107, 231, 173, 174, 173, 174, 183, 231, 125,
140414
+ /* 1410 */ 216, 178, 159, 217, 22, 159, 226, 129, 137, 228,
140415
+ /* 1420 */ 128, 217, 126, 25, 127, 162, 216, 26, 217, 161,
140416
+ /* 1430 */ 13, 153, 153, 206, 205, 6, 251, 202, 204, 203,
140417
+ /* 1440 */ 151, 216, 151, 217, 216, 171, 151, 165, 179, 179,
140418
+ /* 1450 */ 4, 3, 22, 142, 171, 165, 15, 171, 171, 81,
140419
+ /* 1460 */ 16, 23, 23, 120, 171, 131, 165, 111, 123, 171,
140420
+ /* 1470 */ 171, 171, 20, 125, 16, 1, 123, 131, 53, 53,
140421
+ /* 1480 */ 53, 53, 111, 96, 34, 122, 248, 1, 251, 5,
140422
+ /* 1490 */ 22, 107, 140, 26, 74, 41, 122, 107, 67, 67,
140423
+ /* 1500 */ 24, 20, 19, 112, 105, 23, 66, 22, 66, 22,
140424
+ /* 1510 */ 22, 22, 37, 22, 22, 66, 23, 23, 28, 23,
140425
+ /* 1520 */ 23, 26, 24, 23, 22, 24, 122, 23, 23, 96,
140426
+ /* 1530 */ 22, 124, 26, 34, 23, 26, 23, 34, 23, 23,
140427
+ /* 1540 */ 23, 34, 23, 22, 26, 11, 22, 22, 26, 23,
140428
+ /* 1550 */ 23, 22, 116, 23, 22, 15, 122, 122, 23, 122,
140429
+ /* 1560 */ 1, 252, 252, 252, 252, 122, 252, 252, 252, 252,
140062140430
/* 1570 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140063140431
/* 1580 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140064140432
/* 1590 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140065140433
/* 1600 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140066140434
/* 1610 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
@@ -140068,151 +140436,156 @@
140068140436
/* 1630 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140069140437
/* 1640 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140070140438
/* 1650 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140071140439
/* 1660 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140072140440
/* 1670 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140073
- /* 1680 */ 252, 252, 252, 252,
140441
+ /* 1680 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140442
+ /* 1690 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140443
+ /* 1700 */ 252, 252, 252, 252, 252, 252, 252, 252, 252,
140074140444
};
140075
-#define YY_SHIFT_COUNT (465)
140445
+#define YY_SHIFT_COUNT (471)
140076140446
#define YY_SHIFT_MIN (0)
140077
-#define YY_SHIFT_MAX (1538)
140447
+#define YY_SHIFT_MAX (1559)
140078140448
static const unsigned short int yy_shift_ofst[] = {
140079
- /* 0 */ 39, 822, 955, 843, 997, 997, 997, 997, 0, 0,
140080
- /* 10 */ 104, 630, 997, 997, 997, 997, 997, 997, 997, 1077,
140081
- /* 20 */ 1077, 126, 161, 155, 52, 156, 208, 260, 312, 364,
140082
- /* 30 */ 416, 468, 523, 578, 630, 630, 630, 630, 630, 630,
140083
- /* 40 */ 630, 630, 630, 630, 630, 630, 630, 630, 630, 630,
140084
- /* 50 */ 630, 682, 630, 733, 783, 783, 914, 997, 997, 997,
140085
- /* 60 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997,
140086
- /* 70 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997,
140087
- /* 80 */ 997, 997, 997, 997, 997, 997, 997, 997, 1017, 997,
140088
- /* 90 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997,
140089
- /* 100 */ 997, 997, 1070, 1054, 1054, 1054, 1054, 1054, 40, 25,
140090
- /* 110 */ 72, 232, 788, 428, 248, 248, 232, 581, 367, 127,
140091
- /* 120 */ 465, 138, 1541, 1541, 1541, 784, 784, 784, 522, 522,
140092
- /* 130 */ 887, 887, 893, 406, 408, 232, 232, 232, 232, 232,
140093
- /* 140 */ 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
140094
- /* 150 */ 232, 232, 232, 232, 232, 370, 340, 714, 698, 698,
140095
- /* 160 */ 465, 89, 89, 89, 89, 89, 89, 1541, 1541, 1541,
140096
- /* 170 */ 504, 85, 85, 884, 70, 280, 902, 440, 966, 924,
140097
- /* 180 */ 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
140098
- /* 190 */ 232, 232, 232, 232, 232, 232, 1134, 1134, 1134, 232,
140099
- /* 200 */ 232, 667, 232, 232, 232, 929, 232, 232, 885, 232,
140100
- /* 210 */ 232, 232, 232, 232, 232, 232, 232, 232, 232, 418,
140101
- /* 220 */ 678, 981, 981, 981, 981, 766, 271, 911, 510, 429,
140102
- /* 230 */ 617, 786, 786, 830, 617, 830, 4, 730, 595, 768,
140103
- /* 240 */ 786, 561, 768, 768, 732, 535, 55, 1165, 1105, 1105,
140104
- /* 250 */ 1191, 1191, 1105, 1228, 1209, 1130, 1257, 1257, 1257, 1257,
140105
- /* 260 */ 1105, 1280, 1130, 1228, 1209, 1209, 1130, 1105, 1280, 1198,
140106
- /* 270 */ 1282, 1105, 1105, 1280, 1328, 1105, 1280, 1105, 1280, 1328,
140107
- /* 280 */ 1244, 1244, 1244, 1308, 1328, 1244, 1267, 1244, 1308, 1244,
140108
- /* 290 */ 1244, 1250, 1273, 1250, 1273, 1250, 1273, 1250, 1273, 1105,
140109
- /* 300 */ 1360, 1105, 1260, 1328, 1306, 1306, 1328, 1274, 1276, 1277,
140110
- /* 310 */ 1279, 1130, 1379, 1383, 1400, 1400, 1410, 1410, 1410, 1541,
140111
- /* 320 */ 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541,
140112
- /* 330 */ 1541, 1541, 1541, 1541, 1541, 34, 407, 463, 511, 417,
140113
- /* 340 */ 479, 1272, 778, 941, 785, 825, 831, 833, 872, 877,
140114
- /* 350 */ 756, 793, 900, 804, 919, 1045, 969, 1049, 803, 909,
140115
- /* 360 */ 1051, 983, 1059, 1428, 1434, 1416, 1300, 1429, 1362, 1430,
140116
- /* 370 */ 1422, 1424, 1330, 1317, 1340, 1329, 1433, 1331, 1438, 1454,
140117
- /* 380 */ 1334, 1327, 1406, 1407, 1408, 1409, 1352, 1368, 1431, 1344,
140118
- /* 390 */ 1466, 1463, 1447, 1363, 1332, 1404, 1448, 1411, 1399, 1435,
140119
- /* 400 */ 1370, 1451, 1459, 1461, 1369, 1377, 1462, 1417, 1464, 1465,
140120
- /* 410 */ 1467, 1469, 1419, 1460, 1470, 1423, 1456, 1471, 1472, 1473,
140121
- /* 420 */ 1474, 1381, 1476, 1478, 1477, 1479, 1380, 1480, 1481, 1412,
140122
- /* 430 */ 1475, 1484, 1386, 1485, 1482, 1486, 1483, 1490, 1485, 1491,
140123
- /* 440 */ 1492, 1495, 1493, 1497, 1499, 1496, 1500, 1502, 1498, 1501,
140124
- /* 450 */ 1503, 1506, 1505, 1501, 1507, 1509, 1510, 1511, 1513, 1403,
140125
- /* 460 */ 1414, 1415, 1418, 1515, 1517, 1538,
140126
-};
140127
-#define YY_REDUCE_COUNT (334)
140128
-#define YY_REDUCE_MIN (-217)
140129
-#define YY_REDUCE_MAX (1278)
140449
+ /* 0 */ 182, 1090, 822, 822, 306, 957, 957, 957, 957, 210,
140450
+ /* 10 */ 0, 0, 104, 630, 957, 957, 957, 957, 957, 957,
140451
+ /* 20 */ 957, 1117, 1117, 126, 968, 306, 306, 306, 306, 306,
140452
+ /* 30 */ 306, 52, 156, 208, 260, 312, 364, 416, 468, 523,
140453
+ /* 40 */ 578, 630, 630, 630, 630, 630, 630, 630, 630, 630,
140454
+ /* 50 */ 630, 630, 630, 630, 630, 630, 630, 630, 682, 630,
140455
+ /* 60 */ 733, 783, 783, 877, 957, 957, 957, 957, 957, 957,
140456
+ /* 70 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 957,
140457
+ /* 80 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 957,
140458
+ /* 90 */ 957, 957, 957, 957, 957, 978, 957, 957, 957, 957,
140459
+ /* 100 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 1061,
140460
+ /* 110 */ 1108, 1108, 1108, 1108, 1108, 40, 127, 20, 280, 843,
140461
+ /* 120 */ 1032, 144, 144, 280, 310, 310, 310, 310, 59, 191,
140462
+ /* 130 */ 69, 1566, 1566, 1566, 786, 786, 786, 522, 836, 522,
140463
+ /* 140 */ 959, 959, 892, 155, 358, 280, 280, 280, 280, 280,
140464
+ /* 150 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
140465
+ /* 160 */ 280, 280, 280, 280, 280, 280, 371, 388, 645, 645,
140466
+ /* 170 */ 531, 1566, 1566, 1566, 504, 189, 189, 909, 63, 176,
140467
+ /* 180 */ 928, 440, 932, 973, 280, 280, 280, 280, 280, 314,
140468
+ /* 190 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
140469
+ /* 200 */ 280, 280, 1064, 1064, 1064, 280, 280, 280, 280, 667,
140470
+ /* 210 */ 280, 280, 280, 825, 280, 280, 902, 280, 280, 280,
140471
+ /* 220 */ 280, 280, 280, 280, 280, 383, 676, 325, 975, 975,
140472
+ /* 230 */ 975, 975, 1010, 325, 325, 819, 349, 524, 569, 829,
140473
+ /* 240 */ 829, 832, 569, 832, 686, 51, 656, 303, 303, 303,
140474
+ /* 250 */ 829, 294, 520, 628, 474, 1174, 1115, 1115, 1208, 1208,
140475
+ /* 260 */ 1115, 1231, 1217, 1131, 1246, 1246, 1246, 1246, 1115, 1276,
140476
+ /* 270 */ 1131, 1231, 1217, 1217, 1131, 1115, 1276, 1184, 1277, 1115,
140477
+ /* 280 */ 1276, 1330, 1115, 1276, 1115, 1276, 1330, 1280, 1280, 1280,
140478
+ /* 290 */ 1320, 1330, 1280, 1285, 1280, 1320, 1280, 1280, 1330, 1306,
140479
+ /* 300 */ 1306, 1330, 1284, 1294, 1284, 1294, 1284, 1294, 1284, 1294,
140480
+ /* 310 */ 1115, 1392, 1115, 1281, 1288, 1296, 1292, 1297, 1131, 1398,
140481
+ /* 320 */ 1401, 1417, 1417, 1429, 1429, 1429, 1566, 1566, 1566, 1566,
140482
+ /* 330 */ 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566,
140483
+ /* 340 */ 1566, 1566, 34, 357, 38, 462, 514, 484, 1074, 727,
140484
+ /* 350 */ 740, 734, 735, 777, 778, 784, 788, 803, 694, 845,
140485
+ /* 360 */ 742, 796, 833, 837, 889, 860, 886, 1036, 806, 958,
140486
+ /* 370 */ 1446, 1448, 1430, 1311, 1441, 1378, 1444, 1438, 1439, 1343,
140487
+ /* 380 */ 1334, 1356, 1345, 1452, 1348, 1458, 1474, 1353, 1346, 1425,
140488
+ /* 390 */ 1426, 1427, 1428, 1371, 1387, 1450, 1363, 1486, 1484, 1468,
140489
+ /* 400 */ 1384, 1352, 1431, 1467, 1432, 1420, 1454, 1374, 1390, 1476,
140490
+ /* 410 */ 1481, 1483, 1391, 1399, 1485, 1440, 1487, 1488, 1482, 1489,
140491
+ /* 420 */ 1442, 1490, 1491, 1449, 1475, 1493, 1494, 1496, 1495, 1497,
140492
+ /* 430 */ 1492, 1498, 1500, 1502, 1501, 1404, 1504, 1505, 1433, 1499,
140493
+ /* 440 */ 1508, 1407, 1506, 1503, 1509, 1507, 1511, 1513, 1515, 1506,
140494
+ /* 450 */ 1516, 1517, 1518, 1519, 1521, 1534, 1524, 1525, 1526, 1527,
140495
+ /* 460 */ 1529, 1530, 1532, 1522, 1436, 1434, 1435, 1437, 1443, 1535,
140496
+ /* 470 */ 1540, 1559,
140497
+};
140498
+#define YY_REDUCE_COUNT (341)
140499
+#define YY_REDUCE_MIN (-211)
140500
+#define YY_REDUCE_MAX (1301)
140130140501
static const short yy_reduce_ofst[] = {
140131
- /* 0 */ -144, -139, -134, -136, -141, 64, 114, 116, -158, -148,
140132
- /* 10 */ -217, 96, 819, 871, 878, 219, 270, 886, 272, -110,
140133
- /* 20 */ 413, 918, 972, 228, -214, -214, -214, -214, -214, -214,
140134
- /* 30 */ -214, -214, -214, -214, -214, -214, -214, -214, -214, -214,
140135
- /* 40 */ -214, -214, -214, -214, -214, -214, -214, -214, -214, -214,
140136
- /* 50 */ -214, -214, -214, -214, -214, -214, 62, 323, 377, 536,
140137
- /* 60 */ 539, 834, 948, 1020, 1024, 1031, 1039, 1048, 1050, 1063,
140138
- /* 70 */ 1065, 1068, 1074, 1080, 1083, 1088, 1091, 1094, 1097, 1099,
140139
- /* 80 */ 1103, 1106, 1111, 1114, 1122, 1126, 1129, 1131, 1137, 1139,
140140
- /* 90 */ 1141, 1145, 1149, 1154, 1156, 1164, 1168, 1173, 1180, 1184,
140141
- /* 100 */ 1187, 1192, -214, -214, -214, -214, -214, -214, -214, -214,
140142
- /* 110 */ -214, 132, -45, 97, 8, 164, 379, 175, 255, -214,
140143
- /* 120 */ 178, -214, -214, -214, -214, -168, -168, -168, 124, 329,
140144
- /* 130 */ 399, 401, -129, 347, 347, 331, 133, 451, 452, 498,
140145
- /* 140 */ 500, 502, 503, 505, 487, 506, 488, 490, 507, 543,
140146
- /* 150 */ 547, -126, 588, 290, 27, 572, 501, 597, 537, 582,
140147
- /* 160 */ 183, 599, 600, 601, 649, 650, 653, 508, 538, -29,
140148
- /* 170 */ -156, -152, -137, -79, 135, 74, 130, 242, 338, 378,
140149
- /* 180 */ 393, 397, 607, 648, 691, 700, 708, 709, 728, 757,
140150
- /* 190 */ 763, 769, 796, 810, 818, 845, 202, 748, 792, 861,
140151
- /* 200 */ 862, 815, 866, 903, 905, 850, 931, 932, 896, 937,
140152
- /* 210 */ 939, 945, 74, 949, 951, 964, 965, 967, 968, 888,
140153
- /* 220 */ 820, 923, 926, 959, 960, 815, 980, 908, 1009, 985,
140154
- /* 230 */ 986, 970, 974, 942, 988, 947, 1018, 1011, 1022, 1025,
140155
- /* 240 */ 991, 982, 1032, 1038, 1015, 1019, 1064, 984, 1071, 1072,
140156
- /* 250 */ 992, 993, 1085, 1061, 1069, 1067, 1093, 1116, 1124, 1128,
140157
- /* 260 */ 1133, 1132, 1138, 1086, 1136, 1143, 1146, 1175, 1166, 1108,
140158
- /* 270 */ 1113, 1193, 1196, 1201, 1178, 1203, 1205, 1208, 1206, 1190,
140159
- /* 280 */ 1195, 1197, 1199, 1194, 1200, 1204, 1207, 1210, 1211, 1212,
140160
- /* 290 */ 1213, 1159, 1167, 1169, 1174, 1172, 1176, 1179, 1177, 1222,
140161
- /* 300 */ 1170, 1232, 1171, 1221, 1181, 1182, 1223, 1202, 1214, 1216,
140162
- /* 310 */ 1215, 1219, 1245, 1249, 1261, 1262, 1266, 1271, 1275, 1183,
140163
- /* 320 */ 1185, 1189, 1258, 1253, 1254, 1256, 1259, 1263, 1252, 1255,
140164
- /* 330 */ 1268, 1269, 1270, 1278, 1264,
140502
+ /* 0 */ -143, 789, 753, 1059, -137, -146, -144, -141, -136, 687,
140503
+ /* 10 */ -107, 101, -203, -52, 830, 870, 890, 167, 953, 218,
140504
+ /* 20 */ 220, 413, 646, 897, 73, 281, 283, 332, 496, 601,
140505
+ /* 30 */ 650, -211, -211, -211, -211, -211, -211, -211, -211, -211,
140506
+ /* 40 */ -211, -211, -211, -211, -211, -211, -211, -211, -211, -211,
140507
+ /* 50 */ -211, -211, -211, -211, -211, -211, -211, -211, -211, -211,
140508
+ /* 60 */ -211, -211, -211, 374, 377, 537, 969, 983, 1006, 1008,
140509
+ /* 70 */ 1015, 1055, 1067, 1069, 1071, 1084, 1096, 1100, 1104, 1111,
140510
+ /* 80 */ 1113, 1116, 1119, 1123, 1127, 1130, 1136, 1143, 1146, 1150,
140511
+ /* 90 */ 1153, 1155, 1159, 1161, 1163, 1166, 1170, 1189, 1193, 1195,
140512
+ /* 100 */ 1197, 1199, 1201, 1203, 1205, 1207, 1212, 1230, 1232, -211,
140513
+ /* 110 */ -211, -211, -211, -211, -211, -211, -211, -211, -30, 427,
140514
+ /* 120 */ -171, -145, -134, 22, 279, 287, 279, 287, 99, -211,
140515
+ /* 130 */ -211, -211, -211, -211, -165, -165, -165, 123, 135, 175,
140516
+ /* 140 */ -150, 396, 337, 291, 291, -147, 185, 391, 446, 444,
140517
+ /* 150 */ 452, 500, 501, 502, 27, -152, 295, 438, 490, 503,
140518
+ /* 160 */ 495, 506, -73, 447, 451, 536, 570, 551, 540, 579,
140519
+ /* 170 */ 30, 508, 535, 81, 14, 61, 115, 168, 142, 222,
140520
+ /* 180 */ 275, 284, 397, 599, 607, 647, 654, 660, 709, 658,
140521
+ /* 190 */ 714, 750, 754, 772, 787, 801, 817, 818, 850, 863,
140522
+ /* 200 */ 867, 871, 466, 748, 799, 881, 888, 898, 913, 824,
140523
+ /* 210 */ 930, 933, 934, 873, 942, 945, 849, 946, 222, 954,
140524
+ /* 220 */ 971, 972, 976, 979, 980, 900, 874, 927, 950, 961,
140525
+ /* 230 */ 962, 963, 824, 927, 927, 939, 970, 1018, 981, 988,
140526
+ /* 240 */ 993, 936, 982, 937, 1009, 1000, 1031, 1011, 1014, 1040,
140527
+ /* 250 */ 1003, 991, 990, 1026, 1072, 985, 1076, 1079, 997, 1005,
140528
+ /* 260 */ 1091, 1037, 1082, 1060, 1083, 1087, 1088, 1098, 1124, 1141,
140529
+ /* 270 */ 1106, 1092, 1122, 1135, 1128, 1147, 1173, 1110, 1105, 1187,
140530
+ /* 280 */ 1192, 1176, 1202, 1198, 1206, 1200, 1182, 1213, 1214, 1215,
140531
+ /* 290 */ 1209, 1216, 1218, 1219, 1220, 1224, 1222, 1223, 1221, 1171,
140532
+ /* 300 */ 1177, 1233, 1196, 1194, 1204, 1210, 1211, 1225, 1226, 1228,
140533
+ /* 310 */ 1253, 1190, 1256, 1191, 1227, 1229, 1234, 1236, 1235, 1263,
140534
+ /* 320 */ 1268, 1278, 1279, 1289, 1291, 1295, 1185, 1237, 1238, 1282,
140535
+ /* 330 */ 1274, 1283, 1286, 1287, 1290, 1269, 1270, 1293, 1298, 1299,
140536
+ /* 340 */ 1300, 1301,
140165140537
};
140166140538
static const YYACTIONTYPE yy_default[] = {
140167
- /* 0 */ 1286, 1276, 1276, 1276, 1209, 1209, 1209, 1209, 1133, 1133,
140168
- /* 10 */ 1260, 1036, 1005, 1005, 1005, 1005, 1005, 1005, 1208, 1005,
140169
- /* 20 */ 1005, 1005, 1005, 1108, 1139, 1005, 1005, 1005, 1005, 1210,
140170
- /* 30 */ 1211, 1005, 1005, 1005, 1259, 1261, 1149, 1148, 1147, 1146,
140171
- /* 40 */ 1242, 1120, 1144, 1137, 1141, 1210, 1204, 1205, 1203, 1207,
140172
- /* 50 */ 1211, 1005, 1140, 1174, 1188, 1173, 1005, 1005, 1005, 1005,
140173
- /* 60 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140174
- /* 70 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140175
- /* 80 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140176
- /* 90 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140177
- /* 100 */ 1005, 1005, 1182, 1187, 1194, 1186, 1183, 1176, 1175, 1177,
140178
- /* 110 */ 1178, 1005, 1026, 1075, 1005, 1005, 1005, 1276, 1036, 1179,
140179
- /* 120 */ 1005, 1180, 1191, 1190, 1189, 1267, 1294, 1293, 1005, 1005,
140180
- /* 130 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140181
- /* 140 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140182
- /* 150 */ 1005, 1005, 1005, 1005, 1005, 1036, 1286, 1276, 1032, 1032,
140183
- /* 160 */ 1005, 1276, 1276, 1276, 1276, 1276, 1276, 1272, 1108, 1099,
140184
- /* 170 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140185
- /* 180 */ 1005, 1264, 1262, 1005, 1224, 1005, 1005, 1005, 1005, 1005,
140186
- /* 190 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140187
- /* 200 */ 1005, 1005, 1005, 1005, 1005, 1104, 1005, 1005, 1005, 1005,
140188
- /* 210 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1288, 1005,
140189
- /* 220 */ 1237, 1104, 1104, 1104, 1104, 1106, 1088, 1098, 1036, 1012,
140190
- /* 230 */ 1143, 1122, 1122, 1327, 1143, 1327, 1050, 1308, 1047, 1133,
140191
- /* 240 */ 1122, 1206, 1133, 1133, 1105, 1098, 1005, 1330, 1113, 1113,
140192
- /* 250 */ 1329, 1329, 1113, 1154, 1078, 1143, 1084, 1084, 1084, 1084,
140193
- /* 260 */ 1113, 1023, 1143, 1154, 1078, 1078, 1143, 1113, 1023, 1241,
140194
- /* 270 */ 1324, 1113, 1113, 1023, 1217, 1113, 1023, 1113, 1023, 1217,
140195
- /* 280 */ 1076, 1076, 1076, 1065, 1217, 1076, 1050, 1076, 1065, 1076,
140196
- /* 290 */ 1076, 1126, 1121, 1126, 1121, 1126, 1121, 1126, 1121, 1113,
140197
- /* 300 */ 1212, 1113, 1005, 1217, 1221, 1221, 1217, 1138, 1127, 1136,
140198
- /* 310 */ 1134, 1143, 1029, 1068, 1291, 1291, 1287, 1287, 1287, 1335,
140199
- /* 320 */ 1335, 1272, 1303, 1036, 1036, 1036, 1036, 1303, 1052, 1052,
140200
- /* 330 */ 1036, 1036, 1036, 1036, 1303, 1005, 1005, 1005, 1005, 1005,
140201
- /* 340 */ 1005, 1298, 1005, 1226, 1005, 1005, 1005, 1005, 1005, 1005,
140202
- /* 350 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140203
- /* 360 */ 1005, 1005, 1159, 1005, 1008, 1269, 1005, 1005, 1268, 1005,
140204
- /* 370 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140205
- /* 380 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1326,
140206
- /* 390 */ 1005, 1005, 1005, 1005, 1005, 1005, 1240, 1239, 1005, 1005,
140207
- /* 400 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140208
- /* 410 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140209
- /* 420 */ 1005, 1090, 1005, 1005, 1005, 1312, 1005, 1005, 1005, 1005,
140210
- /* 430 */ 1005, 1005, 1005, 1135, 1005, 1128, 1005, 1005, 1317, 1005,
140211
- /* 440 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1278,
140212
- /* 450 */ 1005, 1005, 1005, 1277, 1005, 1005, 1005, 1005, 1005, 1161,
140213
- /* 460 */ 1005, 1160, 1164, 1005, 1017, 1005,
140539
+ /* 0 */ 1297, 1349, 1221, 1014, 1119, 1221, 1221, 1221, 1221, 1014,
140540
+ /* 10 */ 1145, 1145, 1272, 1045, 1014, 1014, 1014, 1014, 1014, 1220,
140541
+ /* 20 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140542
+ /* 30 */ 1014, 1151, 1014, 1014, 1014, 1014, 1222, 1223, 1014, 1014,
140543
+ /* 40 */ 1014, 1271, 1273, 1161, 1160, 1159, 1158, 1254, 1132, 1156,
140544
+ /* 50 */ 1149, 1153, 1216, 1217, 1215, 1219, 1222, 1223, 1014, 1152,
140545
+ /* 60 */ 1186, 1200, 1185, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140546
+ /* 70 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140547
+ /* 80 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140548
+ /* 90 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140549
+ /* 100 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1194,
140550
+ /* 110 */ 1199, 1206, 1198, 1195, 1188, 1187, 1189, 1190, 1014, 1035,
140551
+ /* 120 */ 1084, 1014, 1014, 1014, 1289, 1288, 1014, 1014, 1045, 1191,
140552
+ /* 130 */ 1192, 1203, 1202, 1201, 1279, 1305, 1304, 1014, 1014, 1014,
140553
+ /* 140 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140554
+ /* 150 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140555
+ /* 160 */ 1014, 1014, 1014, 1014, 1014, 1014, 1045, 1297, 1041, 1041,
140556
+ /* 170 */ 1014, 1284, 1119, 1110, 1014, 1014, 1014, 1014, 1014, 1014,
140557
+ /* 180 */ 1014, 1014, 1014, 1014, 1014, 1276, 1274, 1014, 1236, 1014,
140558
+ /* 190 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140559
+ /* 200 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140560
+ /* 210 */ 1014, 1014, 1014, 1115, 1014, 1014, 1014, 1014, 1014, 1014,
140561
+ /* 220 */ 1014, 1014, 1014, 1014, 1299, 1014, 1249, 1098, 1115, 1115,
140562
+ /* 230 */ 1115, 1115, 1117, 1099, 1097, 1109, 1045, 1021, 1155, 1134,
140563
+ /* 240 */ 1134, 1338, 1155, 1338, 1059, 1319, 1056, 1145, 1145, 1145,
140564
+ /* 250 */ 1134, 1218, 1116, 1109, 1014, 1341, 1124, 1124, 1340, 1340,
140565
+ /* 260 */ 1124, 1166, 1087, 1155, 1093, 1093, 1093, 1093, 1124, 1032,
140566
+ /* 270 */ 1155, 1166, 1087, 1087, 1155, 1124, 1032, 1253, 1335, 1124,
140567
+ /* 280 */ 1032, 1229, 1124, 1032, 1124, 1032, 1229, 1085, 1085, 1085,
140568
+ /* 290 */ 1074, 1229, 1085, 1059, 1085, 1074, 1085, 1085, 1229, 1233,
140569
+ /* 300 */ 1233, 1229, 1138, 1133, 1138, 1133, 1138, 1133, 1138, 1133,
140570
+ /* 310 */ 1124, 1224, 1124, 1014, 1150, 1139, 1148, 1146, 1155, 1038,
140571
+ /* 320 */ 1077, 1302, 1302, 1298, 1298, 1298, 1346, 1346, 1284, 1314,
140572
+ /* 330 */ 1045, 1045, 1045, 1045, 1314, 1061, 1061, 1045, 1045, 1045,
140573
+ /* 340 */ 1045, 1314, 1014, 1014, 1014, 1014, 1014, 1014, 1309, 1014,
140574
+ /* 350 */ 1238, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140575
+ /* 360 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1171,
140576
+ /* 370 */ 1014, 1017, 1281, 1014, 1014, 1280, 1014, 1014, 1014, 1014,
140577
+ /* 380 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140578
+ /* 390 */ 1014, 1014, 1014, 1014, 1014, 1014, 1337, 1014, 1014, 1014,
140579
+ /* 400 */ 1014, 1014, 1014, 1252, 1251, 1014, 1014, 1126, 1014, 1014,
140580
+ /* 410 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140581
+ /* 420 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140582
+ /* 430 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140583
+ /* 440 */ 1014, 1014, 1147, 1014, 1140, 1014, 1014, 1014, 1014, 1328,
140584
+ /* 450 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140585
+ /* 460 */ 1014, 1014, 1014, 1323, 1101, 1173, 1014, 1172, 1176, 1014,
140586
+ /* 470 */ 1026, 1014,
140214140587
};
140215140588
/********** End of lemon-generated parsing tables *****************************/
140216140589
140217140590
/* The next table maps tokens (terminal symbols) into fallback tokens.
140218140591
** If a construct like the following:
@@ -140594,11 +140967,11 @@
140594140967
/* 192 */ "raisetype",
140595140968
/* 193 */ "ifexists",
140596140969
/* 194 */ "fullname",
140597140970
/* 195 */ "selectnowith",
140598140971
/* 196 */ "oneselect",
140599
- /* 197 */ "with",
140972
+ /* 197 */ "wqlist",
140600140973
/* 198 */ "multiselect_op",
140601140974
/* 199 */ "distinct",
140602140975
/* 200 */ "selcollist",
140603140976
/* 201 */ "from",
140604140977
/* 202 */ "where_opt",
@@ -140616,43 +140989,43 @@
140616140989
/* 214 */ "joinop",
140617140990
/* 215 */ "indexed_opt",
140618140991
/* 216 */ "on_opt",
140619140992
/* 217 */ "using_opt",
140620140993
/* 218 */ "idlist",
140621
- /* 219 */ "setlist",
140622
- /* 220 */ "insert_cmd",
140623
- /* 221 */ "idlist_opt",
140624
- /* 222 */ "likeop",
140625
- /* 223 */ "between_op",
140626
- /* 224 */ "in_op",
140627
- /* 225 */ "paren_exprlist",
140628
- /* 226 */ "case_operand",
140629
- /* 227 */ "case_exprlist",
140630
- /* 228 */ "case_else",
140631
- /* 229 */ "uniqueflag",
140632
- /* 230 */ "collate",
140633
- /* 231 */ "nmnum",
140634
- /* 232 */ "trigger_decl",
140635
- /* 233 */ "trigger_cmd_list",
140636
- /* 234 */ "trigger_time",
140637
- /* 235 */ "trigger_event",
140638
- /* 236 */ "foreach_clause",
140639
- /* 237 */ "when_clause",
140640
- /* 238 */ "trigger_cmd",
140641
- /* 239 */ "trnm",
140642
- /* 240 */ "tridxby",
140643
- /* 241 */ "database_kw_opt",
140644
- /* 242 */ "key_opt",
140645
- /* 243 */ "add_column_fullname",
140646
- /* 244 */ "kwcolumn_opt",
140647
- /* 245 */ "create_vtab",
140648
- /* 246 */ "vtabarglist",
140649
- /* 247 */ "vtabarg",
140650
- /* 248 */ "vtabargtoken",
140651
- /* 249 */ "lp",
140652
- /* 250 */ "anylist",
140653
- /* 251 */ "wqlist",
140994
+ /* 219 */ "with",
140995
+ /* 220 */ "setlist",
140996
+ /* 221 */ "insert_cmd",
140997
+ /* 222 */ "idlist_opt",
140998
+ /* 223 */ "likeop",
140999
+ /* 224 */ "between_op",
141000
+ /* 225 */ "in_op",
141001
+ /* 226 */ "paren_exprlist",
141002
+ /* 227 */ "case_operand",
141003
+ /* 228 */ "case_exprlist",
141004
+ /* 229 */ "case_else",
141005
+ /* 230 */ "uniqueflag",
141006
+ /* 231 */ "collate",
141007
+ /* 232 */ "nmnum",
141008
+ /* 233 */ "trigger_decl",
141009
+ /* 234 */ "trigger_cmd_list",
141010
+ /* 235 */ "trigger_time",
141011
+ /* 236 */ "trigger_event",
141012
+ /* 237 */ "foreach_clause",
141013
+ /* 238 */ "when_clause",
141014
+ /* 239 */ "trigger_cmd",
141015
+ /* 240 */ "trnm",
141016
+ /* 241 */ "tridxby",
141017
+ /* 242 */ "database_kw_opt",
141018
+ /* 243 */ "key_opt",
141019
+ /* 244 */ "add_column_fullname",
141020
+ /* 245 */ "kwcolumn_opt",
141021
+ /* 246 */ "create_vtab",
141022
+ /* 247 */ "vtabarglist",
141023
+ /* 248 */ "vtabarg",
141024
+ /* 249 */ "vtabargtoken",
141025
+ /* 250 */ "lp",
141026
+ /* 251 */ "anylist",
140654141027
};
140655141028
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
140656141029
140657141030
#ifndef NDEBUG
140658141031
/* For tracing reduce actions, the names of all rules are required.
@@ -140736,260 +141109,263 @@
140736141109
/* 75 */ "ifexists ::= IF EXISTS",
140737141110
/* 76 */ "ifexists ::=",
140738141111
/* 77 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select",
140739141112
/* 78 */ "cmd ::= DROP VIEW ifexists fullname",
140740141113
/* 79 */ "cmd ::= select",
140741
- /* 80 */ "select ::= with selectnowith",
140742
- /* 81 */ "selectnowith ::= selectnowith multiselect_op oneselect",
140743
- /* 82 */ "multiselect_op ::= UNION",
140744
- /* 83 */ "multiselect_op ::= UNION ALL",
140745
- /* 84 */ "multiselect_op ::= EXCEPT|INTERSECT",
140746
- /* 85 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
140747
- /* 86 */ "values ::= VALUES LP nexprlist RP",
140748
- /* 87 */ "values ::= values COMMA LP exprlist RP",
140749
- /* 88 */ "distinct ::= DISTINCT",
140750
- /* 89 */ "distinct ::= ALL",
140751
- /* 90 */ "distinct ::=",
140752
- /* 91 */ "sclp ::=",
140753
- /* 92 */ "selcollist ::= sclp scanpt expr scanpt as",
140754
- /* 93 */ "selcollist ::= sclp scanpt STAR",
140755
- /* 94 */ "selcollist ::= sclp scanpt nm DOT STAR",
140756
- /* 95 */ "as ::= AS nm",
140757
- /* 96 */ "as ::=",
140758
- /* 97 */ "from ::=",
140759
- /* 98 */ "from ::= FROM seltablist",
140760
- /* 99 */ "stl_prefix ::= seltablist joinop",
140761
- /* 100 */ "stl_prefix ::=",
140762
- /* 101 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
140763
- /* 102 */ "seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt",
140764
- /* 103 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
140765
- /* 104 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
140766
- /* 105 */ "dbnm ::=",
140767
- /* 106 */ "dbnm ::= DOT nm",
140768
- /* 107 */ "fullname ::= nm dbnm",
140769
- /* 108 */ "joinop ::= COMMA|JOIN",
140770
- /* 109 */ "joinop ::= JOIN_KW JOIN",
140771
- /* 110 */ "joinop ::= JOIN_KW nm JOIN",
140772
- /* 111 */ "joinop ::= JOIN_KW nm nm JOIN",
140773
- /* 112 */ "on_opt ::= ON expr",
140774
- /* 113 */ "on_opt ::=",
140775
- /* 114 */ "indexed_opt ::=",
140776
- /* 115 */ "indexed_opt ::= INDEXED BY nm",
140777
- /* 116 */ "indexed_opt ::= NOT INDEXED",
140778
- /* 117 */ "using_opt ::= USING LP idlist RP",
140779
- /* 118 */ "using_opt ::=",
140780
- /* 119 */ "orderby_opt ::=",
140781
- /* 120 */ "orderby_opt ::= ORDER BY sortlist",
140782
- /* 121 */ "sortlist ::= sortlist COMMA expr sortorder",
140783
- /* 122 */ "sortlist ::= expr sortorder",
140784
- /* 123 */ "sortorder ::= ASC",
140785
- /* 124 */ "sortorder ::= DESC",
140786
- /* 125 */ "sortorder ::=",
140787
- /* 126 */ "groupby_opt ::=",
140788
- /* 127 */ "groupby_opt ::= GROUP BY nexprlist",
140789
- /* 128 */ "having_opt ::=",
140790
- /* 129 */ "having_opt ::= HAVING expr",
140791
- /* 130 */ "limit_opt ::=",
140792
- /* 131 */ "limit_opt ::= LIMIT expr",
140793
- /* 132 */ "limit_opt ::= LIMIT expr OFFSET expr",
140794
- /* 133 */ "limit_opt ::= LIMIT expr COMMA expr",
140795
- /* 134 */ "cmd ::= with DELETE FROM fullname indexed_opt where_opt",
140796
- /* 135 */ "where_opt ::=",
140797
- /* 136 */ "where_opt ::= WHERE expr",
140798
- /* 137 */ "cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt",
140799
- /* 138 */ "setlist ::= setlist COMMA nm EQ expr",
140800
- /* 139 */ "setlist ::= setlist COMMA LP idlist RP EQ expr",
140801
- /* 140 */ "setlist ::= nm EQ expr",
140802
- /* 141 */ "setlist ::= LP idlist RP EQ expr",
140803
- /* 142 */ "cmd ::= with insert_cmd INTO fullname idlist_opt select",
140804
- /* 143 */ "cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES",
140805
- /* 144 */ "insert_cmd ::= INSERT orconf",
140806
- /* 145 */ "insert_cmd ::= REPLACE",
140807
- /* 146 */ "idlist_opt ::=",
140808
- /* 147 */ "idlist_opt ::= LP idlist RP",
140809
- /* 148 */ "idlist ::= idlist COMMA nm",
140810
- /* 149 */ "idlist ::= nm",
140811
- /* 150 */ "expr ::= LP expr RP",
140812
- /* 151 */ "expr ::= ID|INDEXED",
140813
- /* 152 */ "expr ::= JOIN_KW",
140814
- /* 153 */ "expr ::= nm DOT nm",
140815
- /* 154 */ "expr ::= nm DOT nm DOT nm",
140816
- /* 155 */ "term ::= NULL|FLOAT|BLOB",
140817
- /* 156 */ "term ::= STRING",
140818
- /* 157 */ "term ::= INTEGER",
140819
- /* 158 */ "expr ::= VARIABLE",
140820
- /* 159 */ "expr ::= expr COLLATE ID|STRING",
140821
- /* 160 */ "expr ::= CAST LP expr AS typetoken RP",
140822
- /* 161 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
140823
- /* 162 */ "expr ::= ID|INDEXED LP STAR RP",
140824
- /* 163 */ "term ::= CTIME_KW",
140825
- /* 164 */ "expr ::= LP nexprlist COMMA expr RP",
140826
- /* 165 */ "expr ::= expr AND expr",
140827
- /* 166 */ "expr ::= expr OR expr",
140828
- /* 167 */ "expr ::= expr LT|GT|GE|LE expr",
140829
- /* 168 */ "expr ::= expr EQ|NE expr",
140830
- /* 169 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
140831
- /* 170 */ "expr ::= expr PLUS|MINUS expr",
140832
- /* 171 */ "expr ::= expr STAR|SLASH|REM expr",
140833
- /* 172 */ "expr ::= expr CONCAT expr",
140834
- /* 173 */ "likeop ::= NOT LIKE_KW|MATCH",
140835
- /* 174 */ "expr ::= expr likeop expr",
140836
- /* 175 */ "expr ::= expr likeop expr ESCAPE expr",
140837
- /* 176 */ "expr ::= expr ISNULL|NOTNULL",
140838
- /* 177 */ "expr ::= expr NOT NULL",
140839
- /* 178 */ "expr ::= expr IS expr",
140840
- /* 179 */ "expr ::= expr IS NOT expr",
140841
- /* 180 */ "expr ::= NOT expr",
140842
- /* 181 */ "expr ::= BITNOT expr",
140843
- /* 182 */ "expr ::= MINUS expr",
140844
- /* 183 */ "expr ::= PLUS expr",
140845
- /* 184 */ "between_op ::= BETWEEN",
140846
- /* 185 */ "between_op ::= NOT BETWEEN",
140847
- /* 186 */ "expr ::= expr between_op expr AND expr",
140848
- /* 187 */ "in_op ::= IN",
140849
- /* 188 */ "in_op ::= NOT IN",
140850
- /* 189 */ "expr ::= expr in_op LP exprlist RP",
140851
- /* 190 */ "expr ::= LP select RP",
140852
- /* 191 */ "expr ::= expr in_op LP select RP",
140853
- /* 192 */ "expr ::= expr in_op nm dbnm paren_exprlist",
140854
- /* 193 */ "expr ::= EXISTS LP select RP",
140855
- /* 194 */ "expr ::= CASE case_operand case_exprlist case_else END",
140856
- /* 195 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
140857
- /* 196 */ "case_exprlist ::= WHEN expr THEN expr",
140858
- /* 197 */ "case_else ::= ELSE expr",
140859
- /* 198 */ "case_else ::=",
140860
- /* 199 */ "case_operand ::= expr",
140861
- /* 200 */ "case_operand ::=",
140862
- /* 201 */ "exprlist ::=",
140863
- /* 202 */ "nexprlist ::= nexprlist COMMA expr",
140864
- /* 203 */ "nexprlist ::= expr",
140865
- /* 204 */ "paren_exprlist ::=",
140866
- /* 205 */ "paren_exprlist ::= LP exprlist RP",
140867
- /* 206 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
140868
- /* 207 */ "uniqueflag ::= UNIQUE",
140869
- /* 208 */ "uniqueflag ::=",
140870
- /* 209 */ "eidlist_opt ::=",
140871
- /* 210 */ "eidlist_opt ::= LP eidlist RP",
140872
- /* 211 */ "eidlist ::= eidlist COMMA nm collate sortorder",
140873
- /* 212 */ "eidlist ::= nm collate sortorder",
140874
- /* 213 */ "collate ::=",
140875
- /* 214 */ "collate ::= COLLATE ID|STRING",
140876
- /* 215 */ "cmd ::= DROP INDEX ifexists fullname",
140877
- /* 216 */ "cmd ::= VACUUM",
140878
- /* 217 */ "cmd ::= VACUUM nm",
140879
- /* 218 */ "cmd ::= PRAGMA nm dbnm",
140880
- /* 219 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
140881
- /* 220 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
140882
- /* 221 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
140883
- /* 222 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
140884
- /* 223 */ "plus_num ::= PLUS INTEGER|FLOAT",
140885
- /* 224 */ "minus_num ::= MINUS INTEGER|FLOAT",
140886
- /* 225 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
140887
- /* 226 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
140888
- /* 227 */ "trigger_time ::= BEFORE|AFTER",
140889
- /* 228 */ "trigger_time ::= INSTEAD OF",
140890
- /* 229 */ "trigger_time ::=",
140891
- /* 230 */ "trigger_event ::= DELETE|INSERT",
140892
- /* 231 */ "trigger_event ::= UPDATE",
140893
- /* 232 */ "trigger_event ::= UPDATE OF idlist",
140894
- /* 233 */ "when_clause ::=",
140895
- /* 234 */ "when_clause ::= WHEN expr",
140896
- /* 235 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
140897
- /* 236 */ "trigger_cmd_list ::= trigger_cmd SEMI",
140898
- /* 237 */ "trnm ::= nm DOT nm",
140899
- /* 238 */ "tridxby ::= INDEXED BY nm",
140900
- /* 239 */ "tridxby ::= NOT INDEXED",
140901
- /* 240 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt",
140902
- /* 241 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt",
140903
- /* 242 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
140904
- /* 243 */ "trigger_cmd ::= scanpt select scanpt",
140905
- /* 244 */ "expr ::= RAISE LP IGNORE RP",
140906
- /* 245 */ "expr ::= RAISE LP raisetype COMMA nm RP",
140907
- /* 246 */ "raisetype ::= ROLLBACK",
140908
- /* 247 */ "raisetype ::= ABORT",
140909
- /* 248 */ "raisetype ::= FAIL",
140910
- /* 249 */ "cmd ::= DROP TRIGGER ifexists fullname",
140911
- /* 250 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
140912
- /* 251 */ "cmd ::= DETACH database_kw_opt expr",
140913
- /* 252 */ "key_opt ::=",
140914
- /* 253 */ "key_opt ::= KEY expr",
140915
- /* 254 */ "cmd ::= REINDEX",
140916
- /* 255 */ "cmd ::= REINDEX nm dbnm",
140917
- /* 256 */ "cmd ::= ANALYZE",
140918
- /* 257 */ "cmd ::= ANALYZE nm dbnm",
140919
- /* 258 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
140920
- /* 259 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
140921
- /* 260 */ "add_column_fullname ::= fullname",
140922
- /* 261 */ "cmd ::= create_vtab",
140923
- /* 262 */ "cmd ::= create_vtab LP vtabarglist RP",
140924
- /* 263 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
140925
- /* 264 */ "vtabarg ::=",
140926
- /* 265 */ "vtabargtoken ::= ANY",
140927
- /* 266 */ "vtabargtoken ::= lp anylist RP",
140928
- /* 267 */ "lp ::= LP",
140929
- /* 268 */ "with ::=",
140930
- /* 269 */ "with ::= WITH wqlist",
140931
- /* 270 */ "with ::= WITH RECURSIVE wqlist",
140932
- /* 271 */ "wqlist ::= nm eidlist_opt AS LP select RP",
140933
- /* 272 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
140934
- /* 273 */ "input ::= cmdlist",
140935
- /* 274 */ "cmdlist ::= cmdlist ecmd",
140936
- /* 275 */ "cmdlist ::= ecmd",
140937
- /* 276 */ "ecmd ::= SEMI",
140938
- /* 277 */ "ecmd ::= explain cmdx SEMI",
140939
- /* 278 */ "explain ::=",
140940
- /* 279 */ "trans_opt ::=",
140941
- /* 280 */ "trans_opt ::= TRANSACTION",
140942
- /* 281 */ "trans_opt ::= TRANSACTION nm",
140943
- /* 282 */ "savepoint_opt ::= SAVEPOINT",
140944
- /* 283 */ "savepoint_opt ::=",
140945
- /* 284 */ "cmd ::= create_table create_table_args",
140946
- /* 285 */ "columnlist ::= columnlist COMMA columnname carglist",
140947
- /* 286 */ "columnlist ::= columnname carglist",
140948
- /* 287 */ "nm ::= ID|INDEXED",
140949
- /* 288 */ "nm ::= STRING",
140950
- /* 289 */ "nm ::= JOIN_KW",
140951
- /* 290 */ "typetoken ::= typename",
140952
- /* 291 */ "typename ::= ID|STRING",
140953
- /* 292 */ "signed ::= plus_num",
140954
- /* 293 */ "signed ::= minus_num",
140955
- /* 294 */ "carglist ::= carglist ccons",
140956
- /* 295 */ "carglist ::=",
140957
- /* 296 */ "ccons ::= NULL onconf",
140958
- /* 297 */ "conslist_opt ::= COMMA conslist",
140959
- /* 298 */ "conslist ::= conslist tconscomma tcons",
140960
- /* 299 */ "conslist ::= tcons",
140961
- /* 300 */ "tconscomma ::=",
140962
- /* 301 */ "defer_subclause_opt ::= defer_subclause",
140963
- /* 302 */ "resolvetype ::= raisetype",
140964
- /* 303 */ "selectnowith ::= oneselect",
140965
- /* 304 */ "oneselect ::= values",
140966
- /* 305 */ "sclp ::= selcollist COMMA",
140967
- /* 306 */ "as ::= ID|STRING",
140968
- /* 307 */ "expr ::= term",
140969
- /* 308 */ "likeop ::= LIKE_KW|MATCH",
140970
- /* 309 */ "exprlist ::= nexprlist",
140971
- /* 310 */ "nmnum ::= plus_num",
140972
- /* 311 */ "nmnum ::= nm",
140973
- /* 312 */ "nmnum ::= ON",
140974
- /* 313 */ "nmnum ::= DELETE",
140975
- /* 314 */ "nmnum ::= DEFAULT",
140976
- /* 315 */ "plus_num ::= INTEGER|FLOAT",
140977
- /* 316 */ "foreach_clause ::=",
140978
- /* 317 */ "foreach_clause ::= FOR EACH ROW",
140979
- /* 318 */ "trnm ::= nm",
140980
- /* 319 */ "tridxby ::=",
140981
- /* 320 */ "database_kw_opt ::= DATABASE",
140982
- /* 321 */ "database_kw_opt ::=",
140983
- /* 322 */ "kwcolumn_opt ::=",
140984
- /* 323 */ "kwcolumn_opt ::= COLUMNKW",
140985
- /* 324 */ "vtabarglist ::= vtabarg",
140986
- /* 325 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
140987
- /* 326 */ "vtabarg ::= vtabarg vtabargtoken",
140988
- /* 327 */ "anylist ::=",
140989
- /* 328 */ "anylist ::= anylist LP anylist RP",
140990
- /* 329 */ "anylist ::= anylist ANY",
141114
+ /* 80 */ "select ::= WITH wqlist selectnowith",
141115
+ /* 81 */ "select ::= WITH RECURSIVE wqlist selectnowith",
141116
+ /* 82 */ "select ::= selectnowith",
141117
+ /* 83 */ "selectnowith ::= selectnowith multiselect_op oneselect",
141118
+ /* 84 */ "multiselect_op ::= UNION",
141119
+ /* 85 */ "multiselect_op ::= UNION ALL",
141120
+ /* 86 */ "multiselect_op ::= EXCEPT|INTERSECT",
141121
+ /* 87 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
141122
+ /* 88 */ "values ::= VALUES LP nexprlist RP",
141123
+ /* 89 */ "values ::= values COMMA LP exprlist RP",
141124
+ /* 90 */ "distinct ::= DISTINCT",
141125
+ /* 91 */ "distinct ::= ALL",
141126
+ /* 92 */ "distinct ::=",
141127
+ /* 93 */ "sclp ::=",
141128
+ /* 94 */ "selcollist ::= sclp scanpt expr scanpt as",
141129
+ /* 95 */ "selcollist ::= sclp scanpt STAR",
141130
+ /* 96 */ "selcollist ::= sclp scanpt nm DOT STAR",
141131
+ /* 97 */ "as ::= AS nm",
141132
+ /* 98 */ "as ::=",
141133
+ /* 99 */ "from ::=",
141134
+ /* 100 */ "from ::= FROM seltablist",
141135
+ /* 101 */ "stl_prefix ::= seltablist joinop",
141136
+ /* 102 */ "stl_prefix ::=",
141137
+ /* 103 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
141138
+ /* 104 */ "seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt",
141139
+ /* 105 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
141140
+ /* 106 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
141141
+ /* 107 */ "dbnm ::=",
141142
+ /* 108 */ "dbnm ::= DOT nm",
141143
+ /* 109 */ "fullname ::= nm",
141144
+ /* 110 */ "fullname ::= nm DOT nm",
141145
+ /* 111 */ "joinop ::= COMMA|JOIN",
141146
+ /* 112 */ "joinop ::= JOIN_KW JOIN",
141147
+ /* 113 */ "joinop ::= JOIN_KW nm JOIN",
141148
+ /* 114 */ "joinop ::= JOIN_KW nm nm JOIN",
141149
+ /* 115 */ "on_opt ::= ON expr",
141150
+ /* 116 */ "on_opt ::=",
141151
+ /* 117 */ "indexed_opt ::=",
141152
+ /* 118 */ "indexed_opt ::= INDEXED BY nm",
141153
+ /* 119 */ "indexed_opt ::= NOT INDEXED",
141154
+ /* 120 */ "using_opt ::= USING LP idlist RP",
141155
+ /* 121 */ "using_opt ::=",
141156
+ /* 122 */ "orderby_opt ::=",
141157
+ /* 123 */ "orderby_opt ::= ORDER BY sortlist",
141158
+ /* 124 */ "sortlist ::= sortlist COMMA expr sortorder",
141159
+ /* 125 */ "sortlist ::= expr sortorder",
141160
+ /* 126 */ "sortorder ::= ASC",
141161
+ /* 127 */ "sortorder ::= DESC",
141162
+ /* 128 */ "sortorder ::=",
141163
+ /* 129 */ "groupby_opt ::=",
141164
+ /* 130 */ "groupby_opt ::= GROUP BY nexprlist",
141165
+ /* 131 */ "having_opt ::=",
141166
+ /* 132 */ "having_opt ::= HAVING expr",
141167
+ /* 133 */ "limit_opt ::=",
141168
+ /* 134 */ "limit_opt ::= LIMIT expr",
141169
+ /* 135 */ "limit_opt ::= LIMIT expr OFFSET expr",
141170
+ /* 136 */ "limit_opt ::= LIMIT expr COMMA expr",
141171
+ /* 137 */ "cmd ::= with DELETE FROM fullname indexed_opt where_opt",
141172
+ /* 138 */ "where_opt ::=",
141173
+ /* 139 */ "where_opt ::= WHERE expr",
141174
+ /* 140 */ "cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt",
141175
+ /* 141 */ "setlist ::= setlist COMMA nm EQ expr",
141176
+ /* 142 */ "setlist ::= setlist COMMA LP idlist RP EQ expr",
141177
+ /* 143 */ "setlist ::= nm EQ expr",
141178
+ /* 144 */ "setlist ::= LP idlist RP EQ expr",
141179
+ /* 145 */ "cmd ::= with insert_cmd INTO fullname idlist_opt select",
141180
+ /* 146 */ "cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES",
141181
+ /* 147 */ "insert_cmd ::= INSERT orconf",
141182
+ /* 148 */ "insert_cmd ::= REPLACE",
141183
+ /* 149 */ "idlist_opt ::=",
141184
+ /* 150 */ "idlist_opt ::= LP idlist RP",
141185
+ /* 151 */ "idlist ::= idlist COMMA nm",
141186
+ /* 152 */ "idlist ::= nm",
141187
+ /* 153 */ "expr ::= LP expr RP",
141188
+ /* 154 */ "expr ::= ID|INDEXED",
141189
+ /* 155 */ "expr ::= JOIN_KW",
141190
+ /* 156 */ "expr ::= nm DOT nm",
141191
+ /* 157 */ "expr ::= nm DOT nm DOT nm",
141192
+ /* 158 */ "term ::= NULL|FLOAT|BLOB",
141193
+ /* 159 */ "term ::= STRING",
141194
+ /* 160 */ "term ::= INTEGER",
141195
+ /* 161 */ "expr ::= VARIABLE",
141196
+ /* 162 */ "expr ::= expr COLLATE ID|STRING",
141197
+ /* 163 */ "expr ::= CAST LP expr AS typetoken RP",
141198
+ /* 164 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
141199
+ /* 165 */ "expr ::= ID|INDEXED LP STAR RP",
141200
+ /* 166 */ "term ::= CTIME_KW",
141201
+ /* 167 */ "expr ::= LP nexprlist COMMA expr RP",
141202
+ /* 168 */ "expr ::= expr AND expr",
141203
+ /* 169 */ "expr ::= expr OR expr",
141204
+ /* 170 */ "expr ::= expr LT|GT|GE|LE expr",
141205
+ /* 171 */ "expr ::= expr EQ|NE expr",
141206
+ /* 172 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
141207
+ /* 173 */ "expr ::= expr PLUS|MINUS expr",
141208
+ /* 174 */ "expr ::= expr STAR|SLASH|REM expr",
141209
+ /* 175 */ "expr ::= expr CONCAT expr",
141210
+ /* 176 */ "likeop ::= NOT LIKE_KW|MATCH",
141211
+ /* 177 */ "expr ::= expr likeop expr",
141212
+ /* 178 */ "expr ::= expr likeop expr ESCAPE expr",
141213
+ /* 179 */ "expr ::= expr ISNULL|NOTNULL",
141214
+ /* 180 */ "expr ::= expr NOT NULL",
141215
+ /* 181 */ "expr ::= expr IS expr",
141216
+ /* 182 */ "expr ::= expr IS NOT expr",
141217
+ /* 183 */ "expr ::= NOT expr",
141218
+ /* 184 */ "expr ::= BITNOT expr",
141219
+ /* 185 */ "expr ::= MINUS expr",
141220
+ /* 186 */ "expr ::= PLUS expr",
141221
+ /* 187 */ "between_op ::= BETWEEN",
141222
+ /* 188 */ "between_op ::= NOT BETWEEN",
141223
+ /* 189 */ "expr ::= expr between_op expr AND expr",
141224
+ /* 190 */ "in_op ::= IN",
141225
+ /* 191 */ "in_op ::= NOT IN",
141226
+ /* 192 */ "expr ::= expr in_op LP exprlist RP",
141227
+ /* 193 */ "expr ::= LP select RP",
141228
+ /* 194 */ "expr ::= expr in_op LP select RP",
141229
+ /* 195 */ "expr ::= expr in_op nm dbnm paren_exprlist",
141230
+ /* 196 */ "expr ::= EXISTS LP select RP",
141231
+ /* 197 */ "expr ::= CASE case_operand case_exprlist case_else END",
141232
+ /* 198 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
141233
+ /* 199 */ "case_exprlist ::= WHEN expr THEN expr",
141234
+ /* 200 */ "case_else ::= ELSE expr",
141235
+ /* 201 */ "case_else ::=",
141236
+ /* 202 */ "case_operand ::= expr",
141237
+ /* 203 */ "case_operand ::=",
141238
+ /* 204 */ "exprlist ::=",
141239
+ /* 205 */ "nexprlist ::= nexprlist COMMA expr",
141240
+ /* 206 */ "nexprlist ::= expr",
141241
+ /* 207 */ "paren_exprlist ::=",
141242
+ /* 208 */ "paren_exprlist ::= LP exprlist RP",
141243
+ /* 209 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
141244
+ /* 210 */ "uniqueflag ::= UNIQUE",
141245
+ /* 211 */ "uniqueflag ::=",
141246
+ /* 212 */ "eidlist_opt ::=",
141247
+ /* 213 */ "eidlist_opt ::= LP eidlist RP",
141248
+ /* 214 */ "eidlist ::= eidlist COMMA nm collate sortorder",
141249
+ /* 215 */ "eidlist ::= nm collate sortorder",
141250
+ /* 216 */ "collate ::=",
141251
+ /* 217 */ "collate ::= COLLATE ID|STRING",
141252
+ /* 218 */ "cmd ::= DROP INDEX ifexists fullname",
141253
+ /* 219 */ "cmd ::= VACUUM",
141254
+ /* 220 */ "cmd ::= VACUUM nm",
141255
+ /* 221 */ "cmd ::= PRAGMA nm dbnm",
141256
+ /* 222 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
141257
+ /* 223 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
141258
+ /* 224 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
141259
+ /* 225 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
141260
+ /* 226 */ "plus_num ::= PLUS INTEGER|FLOAT",
141261
+ /* 227 */ "minus_num ::= MINUS INTEGER|FLOAT",
141262
+ /* 228 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
141263
+ /* 229 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
141264
+ /* 230 */ "trigger_time ::= BEFORE|AFTER",
141265
+ /* 231 */ "trigger_time ::= INSTEAD OF",
141266
+ /* 232 */ "trigger_time ::=",
141267
+ /* 233 */ "trigger_event ::= DELETE|INSERT",
141268
+ /* 234 */ "trigger_event ::= UPDATE",
141269
+ /* 235 */ "trigger_event ::= UPDATE OF idlist",
141270
+ /* 236 */ "when_clause ::=",
141271
+ /* 237 */ "when_clause ::= WHEN expr",
141272
+ /* 238 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
141273
+ /* 239 */ "trigger_cmd_list ::= trigger_cmd SEMI",
141274
+ /* 240 */ "trnm ::= nm DOT nm",
141275
+ /* 241 */ "tridxby ::= INDEXED BY nm",
141276
+ /* 242 */ "tridxby ::= NOT INDEXED",
141277
+ /* 243 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt",
141278
+ /* 244 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt",
141279
+ /* 245 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
141280
+ /* 246 */ "trigger_cmd ::= scanpt select scanpt",
141281
+ /* 247 */ "expr ::= RAISE LP IGNORE RP",
141282
+ /* 248 */ "expr ::= RAISE LP raisetype COMMA nm RP",
141283
+ /* 249 */ "raisetype ::= ROLLBACK",
141284
+ /* 250 */ "raisetype ::= ABORT",
141285
+ /* 251 */ "raisetype ::= FAIL",
141286
+ /* 252 */ "cmd ::= DROP TRIGGER ifexists fullname",
141287
+ /* 253 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
141288
+ /* 254 */ "cmd ::= DETACH database_kw_opt expr",
141289
+ /* 255 */ "key_opt ::=",
141290
+ /* 256 */ "key_opt ::= KEY expr",
141291
+ /* 257 */ "cmd ::= REINDEX",
141292
+ /* 258 */ "cmd ::= REINDEX nm dbnm",
141293
+ /* 259 */ "cmd ::= ANALYZE",
141294
+ /* 260 */ "cmd ::= ANALYZE nm dbnm",
141295
+ /* 261 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
141296
+ /* 262 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
141297
+ /* 263 */ "add_column_fullname ::= fullname",
141298
+ /* 264 */ "cmd ::= create_vtab",
141299
+ /* 265 */ "cmd ::= create_vtab LP vtabarglist RP",
141300
+ /* 266 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
141301
+ /* 267 */ "vtabarg ::=",
141302
+ /* 268 */ "vtabargtoken ::= ANY",
141303
+ /* 269 */ "vtabargtoken ::= lp anylist RP",
141304
+ /* 270 */ "lp ::= LP",
141305
+ /* 271 */ "with ::= WITH wqlist",
141306
+ /* 272 */ "with ::= WITH RECURSIVE wqlist",
141307
+ /* 273 */ "wqlist ::= nm eidlist_opt AS LP select RP",
141308
+ /* 274 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
141309
+ /* 275 */ "input ::= cmdlist",
141310
+ /* 276 */ "cmdlist ::= cmdlist ecmd",
141311
+ /* 277 */ "cmdlist ::= ecmd",
141312
+ /* 278 */ "ecmd ::= SEMI",
141313
+ /* 279 */ "ecmd ::= explain cmdx SEMI",
141314
+ /* 280 */ "explain ::=",
141315
+ /* 281 */ "trans_opt ::=",
141316
+ /* 282 */ "trans_opt ::= TRANSACTION",
141317
+ /* 283 */ "trans_opt ::= TRANSACTION nm",
141318
+ /* 284 */ "savepoint_opt ::= SAVEPOINT",
141319
+ /* 285 */ "savepoint_opt ::=",
141320
+ /* 286 */ "cmd ::= create_table create_table_args",
141321
+ /* 287 */ "columnlist ::= columnlist COMMA columnname carglist",
141322
+ /* 288 */ "columnlist ::= columnname carglist",
141323
+ /* 289 */ "nm ::= ID|INDEXED",
141324
+ /* 290 */ "nm ::= STRING",
141325
+ /* 291 */ "nm ::= JOIN_KW",
141326
+ /* 292 */ "typetoken ::= typename",
141327
+ /* 293 */ "typename ::= ID|STRING",
141328
+ /* 294 */ "signed ::= plus_num",
141329
+ /* 295 */ "signed ::= minus_num",
141330
+ /* 296 */ "carglist ::= carglist ccons",
141331
+ /* 297 */ "carglist ::=",
141332
+ /* 298 */ "ccons ::= NULL onconf",
141333
+ /* 299 */ "conslist_opt ::= COMMA conslist",
141334
+ /* 300 */ "conslist ::= conslist tconscomma tcons",
141335
+ /* 301 */ "conslist ::= tcons",
141336
+ /* 302 */ "tconscomma ::=",
141337
+ /* 303 */ "defer_subclause_opt ::= defer_subclause",
141338
+ /* 304 */ "resolvetype ::= raisetype",
141339
+ /* 305 */ "selectnowith ::= oneselect",
141340
+ /* 306 */ "oneselect ::= values",
141341
+ /* 307 */ "sclp ::= selcollist COMMA",
141342
+ /* 308 */ "as ::= ID|STRING",
141343
+ /* 309 */ "expr ::= term",
141344
+ /* 310 */ "likeop ::= LIKE_KW|MATCH",
141345
+ /* 311 */ "exprlist ::= nexprlist",
141346
+ /* 312 */ "nmnum ::= plus_num",
141347
+ /* 313 */ "nmnum ::= nm",
141348
+ /* 314 */ "nmnum ::= ON",
141349
+ /* 315 */ "nmnum ::= DELETE",
141350
+ /* 316 */ "nmnum ::= DEFAULT",
141351
+ /* 317 */ "plus_num ::= INTEGER|FLOAT",
141352
+ /* 318 */ "foreach_clause ::=",
141353
+ /* 319 */ "foreach_clause ::= FOR EACH ROW",
141354
+ /* 320 */ "trnm ::= nm",
141355
+ /* 321 */ "tridxby ::=",
141356
+ /* 322 */ "database_kw_opt ::= DATABASE",
141357
+ /* 323 */ "database_kw_opt ::=",
141358
+ /* 324 */ "kwcolumn_opt ::=",
141359
+ /* 325 */ "kwcolumn_opt ::= COLUMNKW",
141360
+ /* 326 */ "vtabarglist ::= vtabarg",
141361
+ /* 327 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
141362
+ /* 328 */ "vtabarg ::= vtabarg vtabargtoken",
141363
+ /* 329 */ "anylist ::=",
141364
+ /* 330 */ "anylist ::= anylist LP anylist RP",
141365
+ /* 331 */ "anylist ::= anylist ANY",
141366
+ /* 332 */ "with ::=",
140991141367
};
140992141368
#endif /* NDEBUG */
140993141369
140994141370
140995141371
#if YYSTACKDEPTH<=0
@@ -141119,14 +141495,14 @@
141119141495
case 173: /* term */
141120141496
case 174: /* expr */
141121141497
case 202: /* where_opt */
141122141498
case 204: /* having_opt */
141123141499
case 216: /* on_opt */
141124
- case 226: /* case_operand */
141125
- case 228: /* case_else */
141126
- case 237: /* when_clause */
141127
- case 242: /* key_opt */
141500
+ case 227: /* case_operand */
141501
+ case 229: /* case_else */
141502
+ case 238: /* when_clause */
141503
+ case 243: /* key_opt */
141128141504
{
141129141505
sqlite3ExprDelete(pParse->db, (yypminor->yy314));
141130141506
}
141131141507
break;
141132141508
case 178: /* eidlist_opt */
@@ -141136,13 +141512,13 @@
141136141512
case 203: /* groupby_opt */
141137141513
case 205: /* orderby_opt */
141138141514
case 208: /* nexprlist */
141139141515
case 209: /* exprlist */
141140141516
case 210: /* sclp */
141141
- case 219: /* setlist */
141142
- case 225: /* paren_exprlist */
141143
- case 227: /* case_exprlist */
141517
+ case 220: /* setlist */
141518
+ case 226: /* paren_exprlist */
141519
+ case 228: /* case_exprlist */
141144141520
{
141145141521
sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
141146141522
}
141147141523
break;
141148141524
case 194: /* fullname */
@@ -141151,30 +141527,29 @@
141151141527
case 213: /* stl_prefix */
141152141528
{
141153141529
sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
141154141530
}
141155141531
break;
141156
- case 197: /* with */
141157
- case 251: /* wqlist */
141532
+ case 197: /* wqlist */
141158141533
{
141159141534
sqlite3WithDelete(pParse->db, (yypminor->yy451));
141160141535
}
141161141536
break;
141162141537
case 217: /* using_opt */
141163141538
case 218: /* idlist */
141164
- case 221: /* idlist_opt */
141539
+ case 222: /* idlist_opt */
141165141540
{
141166141541
sqlite3IdListDelete(pParse->db, (yypminor->yy384));
141167141542
}
141168141543
break;
141169
- case 233: /* trigger_cmd_list */
141170
- case 238: /* trigger_cmd */
141544
+ case 234: /* trigger_cmd_list */
141545
+ case 239: /* trigger_cmd */
141171141546
{
141172141547
sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
141173141548
}
141174141549
break;
141175
- case 235: /* trigger_event */
141550
+ case 236: /* trigger_event */
141176141551
{
141177141552
sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
141178141553
}
141179141554
break;
141180141555
/********* End destructor definitions *****************************************/
@@ -141549,260 +141924,263 @@
141549141924
{ 193, -2 }, /* (75) ifexists ::= IF EXISTS */
141550141925
{ 193, 0 }, /* (76) ifexists ::= */
141551141926
{ 149, -9 }, /* (77) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
141552141927
{ 149, -4 }, /* (78) cmd ::= DROP VIEW ifexists fullname */
141553141928
{ 149, -1 }, /* (79) cmd ::= select */
141554
- { 163, -2 }, /* (80) select ::= with selectnowith */
141555
- { 195, -3 }, /* (81) selectnowith ::= selectnowith multiselect_op oneselect */
141556
- { 198, -1 }, /* (82) multiselect_op ::= UNION */
141557
- { 198, -2 }, /* (83) multiselect_op ::= UNION ALL */
141558
- { 198, -1 }, /* (84) multiselect_op ::= EXCEPT|INTERSECT */
141559
- { 196, -9 }, /* (85) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
141560
- { 207, -4 }, /* (86) values ::= VALUES LP nexprlist RP */
141561
- { 207, -5 }, /* (87) values ::= values COMMA LP exprlist RP */
141562
- { 199, -1 }, /* (88) distinct ::= DISTINCT */
141563
- { 199, -1 }, /* (89) distinct ::= ALL */
141564
- { 199, 0 }, /* (90) distinct ::= */
141565
- { 210, 0 }, /* (91) sclp ::= */
141566
- { 200, -5 }, /* (92) selcollist ::= sclp scanpt expr scanpt as */
141567
- { 200, -3 }, /* (93) selcollist ::= sclp scanpt STAR */
141568
- { 200, -5 }, /* (94) selcollist ::= sclp scanpt nm DOT STAR */
141569
- { 211, -2 }, /* (95) as ::= AS nm */
141570
- { 211, 0 }, /* (96) as ::= */
141571
- { 201, 0 }, /* (97) from ::= */
141572
- { 201, -2 }, /* (98) from ::= FROM seltablist */
141573
- { 213, -2 }, /* (99) stl_prefix ::= seltablist joinop */
141574
- { 213, 0 }, /* (100) stl_prefix ::= */
141575
- { 212, -7 }, /* (101) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
141576
- { 212, -9 }, /* (102) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
141577
- { 212, -7 }, /* (103) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
141578
- { 212, -7 }, /* (104) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
141579
- { 159, 0 }, /* (105) dbnm ::= */
141580
- { 159, -2 }, /* (106) dbnm ::= DOT nm */
141581
- { 194, -2 }, /* (107) fullname ::= nm dbnm */
141582
- { 214, -1 }, /* (108) joinop ::= COMMA|JOIN */
141583
- { 214, -2 }, /* (109) joinop ::= JOIN_KW JOIN */
141584
- { 214, -3 }, /* (110) joinop ::= JOIN_KW nm JOIN */
141585
- { 214, -4 }, /* (111) joinop ::= JOIN_KW nm nm JOIN */
141586
- { 216, -2 }, /* (112) on_opt ::= ON expr */
141587
- { 216, 0 }, /* (113) on_opt ::= */
141588
- { 215, 0 }, /* (114) indexed_opt ::= */
141589
- { 215, -3 }, /* (115) indexed_opt ::= INDEXED BY nm */
141590
- { 215, -2 }, /* (116) indexed_opt ::= NOT INDEXED */
141591
- { 217, -4 }, /* (117) using_opt ::= USING LP idlist RP */
141592
- { 217, 0 }, /* (118) using_opt ::= */
141593
- { 205, 0 }, /* (119) orderby_opt ::= */
141594
- { 205, -3 }, /* (120) orderby_opt ::= ORDER BY sortlist */
141595
- { 187, -4 }, /* (121) sortlist ::= sortlist COMMA expr sortorder */
141596
- { 187, -2 }, /* (122) sortlist ::= expr sortorder */
141597
- { 176, -1 }, /* (123) sortorder ::= ASC */
141598
- { 176, -1 }, /* (124) sortorder ::= DESC */
141599
- { 176, 0 }, /* (125) sortorder ::= */
141600
- { 203, 0 }, /* (126) groupby_opt ::= */
141601
- { 203, -3 }, /* (127) groupby_opt ::= GROUP BY nexprlist */
141602
- { 204, 0 }, /* (128) having_opt ::= */
141603
- { 204, -2 }, /* (129) having_opt ::= HAVING expr */
141604
- { 206, 0 }, /* (130) limit_opt ::= */
141605
- { 206, -2 }, /* (131) limit_opt ::= LIMIT expr */
141606
- { 206, -4 }, /* (132) limit_opt ::= LIMIT expr OFFSET expr */
141607
- { 206, -4 }, /* (133) limit_opt ::= LIMIT expr COMMA expr */
141608
- { 149, -6 }, /* (134) cmd ::= with DELETE FROM fullname indexed_opt where_opt */
141609
- { 202, 0 }, /* (135) where_opt ::= */
141610
- { 202, -2 }, /* (136) where_opt ::= WHERE expr */
141611
- { 149, -8 }, /* (137) cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */
141612
- { 219, -5 }, /* (138) setlist ::= setlist COMMA nm EQ expr */
141613
- { 219, -7 }, /* (139) setlist ::= setlist COMMA LP idlist RP EQ expr */
141614
- { 219, -3 }, /* (140) setlist ::= nm EQ expr */
141615
- { 219, -5 }, /* (141) setlist ::= LP idlist RP EQ expr */
141616
- { 149, -6 }, /* (142) cmd ::= with insert_cmd INTO fullname idlist_opt select */
141617
- { 149, -7 }, /* (143) cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */
141618
- { 220, -2 }, /* (144) insert_cmd ::= INSERT orconf */
141619
- { 220, -1 }, /* (145) insert_cmd ::= REPLACE */
141620
- { 221, 0 }, /* (146) idlist_opt ::= */
141621
- { 221, -3 }, /* (147) idlist_opt ::= LP idlist RP */
141622
- { 218, -3 }, /* (148) idlist ::= idlist COMMA nm */
141623
- { 218, -1 }, /* (149) idlist ::= nm */
141624
- { 174, -3 }, /* (150) expr ::= LP expr RP */
141625
- { 174, -1 }, /* (151) expr ::= ID|INDEXED */
141626
- { 174, -1 }, /* (152) expr ::= JOIN_KW */
141627
- { 174, -3 }, /* (153) expr ::= nm DOT nm */
141628
- { 174, -5 }, /* (154) expr ::= nm DOT nm DOT nm */
141629
- { 173, -1 }, /* (155) term ::= NULL|FLOAT|BLOB */
141630
- { 173, -1 }, /* (156) term ::= STRING */
141631
- { 173, -1 }, /* (157) term ::= INTEGER */
141632
- { 174, -1 }, /* (158) expr ::= VARIABLE */
141633
- { 174, -3 }, /* (159) expr ::= expr COLLATE ID|STRING */
141634
- { 174, -6 }, /* (160) expr ::= CAST LP expr AS typetoken RP */
141635
- { 174, -5 }, /* (161) expr ::= ID|INDEXED LP distinct exprlist RP */
141636
- { 174, -4 }, /* (162) expr ::= ID|INDEXED LP STAR RP */
141637
- { 173, -1 }, /* (163) term ::= CTIME_KW */
141638
- { 174, -5 }, /* (164) expr ::= LP nexprlist COMMA expr RP */
141639
- { 174, -3 }, /* (165) expr ::= expr AND expr */
141640
- { 174, -3 }, /* (166) expr ::= expr OR expr */
141641
- { 174, -3 }, /* (167) expr ::= expr LT|GT|GE|LE expr */
141642
- { 174, -3 }, /* (168) expr ::= expr EQ|NE expr */
141643
- { 174, -3 }, /* (169) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
141644
- { 174, -3 }, /* (170) expr ::= expr PLUS|MINUS expr */
141645
- { 174, -3 }, /* (171) expr ::= expr STAR|SLASH|REM expr */
141646
- { 174, -3 }, /* (172) expr ::= expr CONCAT expr */
141647
- { 222, -2 }, /* (173) likeop ::= NOT LIKE_KW|MATCH */
141648
- { 174, -3 }, /* (174) expr ::= expr likeop expr */
141649
- { 174, -5 }, /* (175) expr ::= expr likeop expr ESCAPE expr */
141650
- { 174, -2 }, /* (176) expr ::= expr ISNULL|NOTNULL */
141651
- { 174, -3 }, /* (177) expr ::= expr NOT NULL */
141652
- { 174, -3 }, /* (178) expr ::= expr IS expr */
141653
- { 174, -4 }, /* (179) expr ::= expr IS NOT expr */
141654
- { 174, -2 }, /* (180) expr ::= NOT expr */
141655
- { 174, -2 }, /* (181) expr ::= BITNOT expr */
141656
- { 174, -2 }, /* (182) expr ::= MINUS expr */
141657
- { 174, -2 }, /* (183) expr ::= PLUS expr */
141658
- { 223, -1 }, /* (184) between_op ::= BETWEEN */
141659
- { 223, -2 }, /* (185) between_op ::= NOT BETWEEN */
141660
- { 174, -5 }, /* (186) expr ::= expr between_op expr AND expr */
141661
- { 224, -1 }, /* (187) in_op ::= IN */
141662
- { 224, -2 }, /* (188) in_op ::= NOT IN */
141663
- { 174, -5 }, /* (189) expr ::= expr in_op LP exprlist RP */
141664
- { 174, -3 }, /* (190) expr ::= LP select RP */
141665
- { 174, -5 }, /* (191) expr ::= expr in_op LP select RP */
141666
- { 174, -5 }, /* (192) expr ::= expr in_op nm dbnm paren_exprlist */
141667
- { 174, -4 }, /* (193) expr ::= EXISTS LP select RP */
141668
- { 174, -5 }, /* (194) expr ::= CASE case_operand case_exprlist case_else END */
141669
- { 227, -5 }, /* (195) case_exprlist ::= case_exprlist WHEN expr THEN expr */
141670
- { 227, -4 }, /* (196) case_exprlist ::= WHEN expr THEN expr */
141671
- { 228, -2 }, /* (197) case_else ::= ELSE expr */
141672
- { 228, 0 }, /* (198) case_else ::= */
141673
- { 226, -1 }, /* (199) case_operand ::= expr */
141674
- { 226, 0 }, /* (200) case_operand ::= */
141675
- { 209, 0 }, /* (201) exprlist ::= */
141676
- { 208, -3 }, /* (202) nexprlist ::= nexprlist COMMA expr */
141677
- { 208, -1 }, /* (203) nexprlist ::= expr */
141678
- { 225, 0 }, /* (204) paren_exprlist ::= */
141679
- { 225, -3 }, /* (205) paren_exprlist ::= LP exprlist RP */
141680
- { 149, -12 }, /* (206) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
141681
- { 229, -1 }, /* (207) uniqueflag ::= UNIQUE */
141682
- { 229, 0 }, /* (208) uniqueflag ::= */
141683
- { 178, 0 }, /* (209) eidlist_opt ::= */
141684
- { 178, -3 }, /* (210) eidlist_opt ::= LP eidlist RP */
141685
- { 188, -5 }, /* (211) eidlist ::= eidlist COMMA nm collate sortorder */
141686
- { 188, -3 }, /* (212) eidlist ::= nm collate sortorder */
141687
- { 230, 0 }, /* (213) collate ::= */
141688
- { 230, -2 }, /* (214) collate ::= COLLATE ID|STRING */
141689
- { 149, -4 }, /* (215) cmd ::= DROP INDEX ifexists fullname */
141690
- { 149, -1 }, /* (216) cmd ::= VACUUM */
141691
- { 149, -2 }, /* (217) cmd ::= VACUUM nm */
141692
- { 149, -3 }, /* (218) cmd ::= PRAGMA nm dbnm */
141693
- { 149, -5 }, /* (219) cmd ::= PRAGMA nm dbnm EQ nmnum */
141694
- { 149, -6 }, /* (220) cmd ::= PRAGMA nm dbnm LP nmnum RP */
141695
- { 149, -5 }, /* (221) cmd ::= PRAGMA nm dbnm EQ minus_num */
141696
- { 149, -6 }, /* (222) cmd ::= PRAGMA nm dbnm LP minus_num RP */
141697
- { 169, -2 }, /* (223) plus_num ::= PLUS INTEGER|FLOAT */
141698
- { 170, -2 }, /* (224) minus_num ::= MINUS INTEGER|FLOAT */
141699
- { 149, -5 }, /* (225) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
141700
- { 232, -11 }, /* (226) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
141701
- { 234, -1 }, /* (227) trigger_time ::= BEFORE|AFTER */
141702
- { 234, -2 }, /* (228) trigger_time ::= INSTEAD OF */
141703
- { 234, 0 }, /* (229) trigger_time ::= */
141704
- { 235, -1 }, /* (230) trigger_event ::= DELETE|INSERT */
141705
- { 235, -1 }, /* (231) trigger_event ::= UPDATE */
141706
- { 235, -3 }, /* (232) trigger_event ::= UPDATE OF idlist */
141707
- { 237, 0 }, /* (233) when_clause ::= */
141708
- { 237, -2 }, /* (234) when_clause ::= WHEN expr */
141709
- { 233, -3 }, /* (235) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
141710
- { 233, -2 }, /* (236) trigger_cmd_list ::= trigger_cmd SEMI */
141711
- { 239, -3 }, /* (237) trnm ::= nm DOT nm */
141712
- { 240, -3 }, /* (238) tridxby ::= INDEXED BY nm */
141713
- { 240, -2 }, /* (239) tridxby ::= NOT INDEXED */
141714
- { 238, -8 }, /* (240) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
141715
- { 238, -7 }, /* (241) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */
141716
- { 238, -6 }, /* (242) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
141717
- { 238, -3 }, /* (243) trigger_cmd ::= scanpt select scanpt */
141718
- { 174, -4 }, /* (244) expr ::= RAISE LP IGNORE RP */
141719
- { 174, -6 }, /* (245) expr ::= RAISE LP raisetype COMMA nm RP */
141720
- { 192, -1 }, /* (246) raisetype ::= ROLLBACK */
141721
- { 192, -1 }, /* (247) raisetype ::= ABORT */
141722
- { 192, -1 }, /* (248) raisetype ::= FAIL */
141723
- { 149, -4 }, /* (249) cmd ::= DROP TRIGGER ifexists fullname */
141724
- { 149, -6 }, /* (250) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
141725
- { 149, -3 }, /* (251) cmd ::= DETACH database_kw_opt expr */
141726
- { 242, 0 }, /* (252) key_opt ::= */
141727
- { 242, -2 }, /* (253) key_opt ::= KEY expr */
141728
- { 149, -1 }, /* (254) cmd ::= REINDEX */
141729
- { 149, -3 }, /* (255) cmd ::= REINDEX nm dbnm */
141730
- { 149, -1 }, /* (256) cmd ::= ANALYZE */
141731
- { 149, -3 }, /* (257) cmd ::= ANALYZE nm dbnm */
141732
- { 149, -6 }, /* (258) cmd ::= ALTER TABLE fullname RENAME TO nm */
141733
- { 149, -7 }, /* (259) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
141734
- { 243, -1 }, /* (260) add_column_fullname ::= fullname */
141735
- { 149, -1 }, /* (261) cmd ::= create_vtab */
141736
- { 149, -4 }, /* (262) cmd ::= create_vtab LP vtabarglist RP */
141737
- { 245, -8 }, /* (263) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
141738
- { 247, 0 }, /* (264) vtabarg ::= */
141739
- { 248, -1 }, /* (265) vtabargtoken ::= ANY */
141740
- { 248, -3 }, /* (266) vtabargtoken ::= lp anylist RP */
141741
- { 249, -1 }, /* (267) lp ::= LP */
141742
- { 197, 0 }, /* (268) with ::= */
141743
- { 197, -2 }, /* (269) with ::= WITH wqlist */
141744
- { 197, -3 }, /* (270) with ::= WITH RECURSIVE wqlist */
141745
- { 251, -6 }, /* (271) wqlist ::= nm eidlist_opt AS LP select RP */
141746
- { 251, -8 }, /* (272) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
141747
- { 144, -1 }, /* (273) input ::= cmdlist */
141748
- { 145, -2 }, /* (274) cmdlist ::= cmdlist ecmd */
141749
- { 145, -1 }, /* (275) cmdlist ::= ecmd */
141750
- { 146, -1 }, /* (276) ecmd ::= SEMI */
141751
- { 146, -3 }, /* (277) ecmd ::= explain cmdx SEMI */
141752
- { 147, 0 }, /* (278) explain ::= */
141753
- { 151, 0 }, /* (279) trans_opt ::= */
141754
- { 151, -1 }, /* (280) trans_opt ::= TRANSACTION */
141755
- { 151, -2 }, /* (281) trans_opt ::= TRANSACTION nm */
141756
- { 153, -1 }, /* (282) savepoint_opt ::= SAVEPOINT */
141757
- { 153, 0 }, /* (283) savepoint_opt ::= */
141758
- { 149, -2 }, /* (284) cmd ::= create_table create_table_args */
141759
- { 160, -4 }, /* (285) columnlist ::= columnlist COMMA columnname carglist */
141760
- { 160, -2 }, /* (286) columnlist ::= columnname carglist */
141761
- { 152, -1 }, /* (287) nm ::= ID|INDEXED */
141762
- { 152, -1 }, /* (288) nm ::= STRING */
141763
- { 152, -1 }, /* (289) nm ::= JOIN_KW */
141764
- { 166, -1 }, /* (290) typetoken ::= typename */
141765
- { 167, -1 }, /* (291) typename ::= ID|STRING */
141766
- { 168, -1 }, /* (292) signed ::= plus_num */
141767
- { 168, -1 }, /* (293) signed ::= minus_num */
141768
- { 165, -2 }, /* (294) carglist ::= carglist ccons */
141769
- { 165, 0 }, /* (295) carglist ::= */
141770
- { 172, -2 }, /* (296) ccons ::= NULL onconf */
141771
- { 161, -2 }, /* (297) conslist_opt ::= COMMA conslist */
141772
- { 184, -3 }, /* (298) conslist ::= conslist tconscomma tcons */
141773
- { 184, -1 }, /* (299) conslist ::= tcons */
141774
- { 185, 0 }, /* (300) tconscomma ::= */
141775
- { 189, -1 }, /* (301) defer_subclause_opt ::= defer_subclause */
141776
- { 191, -1 }, /* (302) resolvetype ::= raisetype */
141777
- { 195, -1 }, /* (303) selectnowith ::= oneselect */
141778
- { 196, -1 }, /* (304) oneselect ::= values */
141779
- { 210, -2 }, /* (305) sclp ::= selcollist COMMA */
141780
- { 211, -1 }, /* (306) as ::= ID|STRING */
141781
- { 174, -1 }, /* (307) expr ::= term */
141782
- { 222, -1 }, /* (308) likeop ::= LIKE_KW|MATCH */
141783
- { 209, -1 }, /* (309) exprlist ::= nexprlist */
141784
- { 231, -1 }, /* (310) nmnum ::= plus_num */
141785
- { 231, -1 }, /* (311) nmnum ::= nm */
141786
- { 231, -1 }, /* (312) nmnum ::= ON */
141787
- { 231, -1 }, /* (313) nmnum ::= DELETE */
141788
- { 231, -1 }, /* (314) nmnum ::= DEFAULT */
141789
- { 169, -1 }, /* (315) plus_num ::= INTEGER|FLOAT */
141790
- { 236, 0 }, /* (316) foreach_clause ::= */
141791
- { 236, -3 }, /* (317) foreach_clause ::= FOR EACH ROW */
141792
- { 239, -1 }, /* (318) trnm ::= nm */
141793
- { 240, 0 }, /* (319) tridxby ::= */
141794
- { 241, -1 }, /* (320) database_kw_opt ::= DATABASE */
141795
- { 241, 0 }, /* (321) database_kw_opt ::= */
141796
- { 244, 0 }, /* (322) kwcolumn_opt ::= */
141797
- { 244, -1 }, /* (323) kwcolumn_opt ::= COLUMNKW */
141798
- { 246, -1 }, /* (324) vtabarglist ::= vtabarg */
141799
- { 246, -3 }, /* (325) vtabarglist ::= vtabarglist COMMA vtabarg */
141800
- { 247, -2 }, /* (326) vtabarg ::= vtabarg vtabargtoken */
141801
- { 250, 0 }, /* (327) anylist ::= */
141802
- { 250, -4 }, /* (328) anylist ::= anylist LP anylist RP */
141803
- { 250, -2 }, /* (329) anylist ::= anylist ANY */
141929
+ { 163, -3 }, /* (80) select ::= WITH wqlist selectnowith */
141930
+ { 163, -4 }, /* (81) select ::= WITH RECURSIVE wqlist selectnowith */
141931
+ { 163, -1 }, /* (82) select ::= selectnowith */
141932
+ { 195, -3 }, /* (83) selectnowith ::= selectnowith multiselect_op oneselect */
141933
+ { 198, -1 }, /* (84) multiselect_op ::= UNION */
141934
+ { 198, -2 }, /* (85) multiselect_op ::= UNION ALL */
141935
+ { 198, -1 }, /* (86) multiselect_op ::= EXCEPT|INTERSECT */
141936
+ { 196, -9 }, /* (87) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
141937
+ { 207, -4 }, /* (88) values ::= VALUES LP nexprlist RP */
141938
+ { 207, -5 }, /* (89) values ::= values COMMA LP exprlist RP */
141939
+ { 199, -1 }, /* (90) distinct ::= DISTINCT */
141940
+ { 199, -1 }, /* (91) distinct ::= ALL */
141941
+ { 199, 0 }, /* (92) distinct ::= */
141942
+ { 210, 0 }, /* (93) sclp ::= */
141943
+ { 200, -5 }, /* (94) selcollist ::= sclp scanpt expr scanpt as */
141944
+ { 200, -3 }, /* (95) selcollist ::= sclp scanpt STAR */
141945
+ { 200, -5 }, /* (96) selcollist ::= sclp scanpt nm DOT STAR */
141946
+ { 211, -2 }, /* (97) as ::= AS nm */
141947
+ { 211, 0 }, /* (98) as ::= */
141948
+ { 201, 0 }, /* (99) from ::= */
141949
+ { 201, -2 }, /* (100) from ::= FROM seltablist */
141950
+ { 213, -2 }, /* (101) stl_prefix ::= seltablist joinop */
141951
+ { 213, 0 }, /* (102) stl_prefix ::= */
141952
+ { 212, -7 }, /* (103) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
141953
+ { 212, -9 }, /* (104) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
141954
+ { 212, -7 }, /* (105) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
141955
+ { 212, -7 }, /* (106) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
141956
+ { 159, 0 }, /* (107) dbnm ::= */
141957
+ { 159, -2 }, /* (108) dbnm ::= DOT nm */
141958
+ { 194, -1 }, /* (109) fullname ::= nm */
141959
+ { 194, -3 }, /* (110) fullname ::= nm DOT nm */
141960
+ { 214, -1 }, /* (111) joinop ::= COMMA|JOIN */
141961
+ { 214, -2 }, /* (112) joinop ::= JOIN_KW JOIN */
141962
+ { 214, -3 }, /* (113) joinop ::= JOIN_KW nm JOIN */
141963
+ { 214, -4 }, /* (114) joinop ::= JOIN_KW nm nm JOIN */
141964
+ { 216, -2 }, /* (115) on_opt ::= ON expr */
141965
+ { 216, 0 }, /* (116) on_opt ::= */
141966
+ { 215, 0 }, /* (117) indexed_opt ::= */
141967
+ { 215, -3 }, /* (118) indexed_opt ::= INDEXED BY nm */
141968
+ { 215, -2 }, /* (119) indexed_opt ::= NOT INDEXED */
141969
+ { 217, -4 }, /* (120) using_opt ::= USING LP idlist RP */
141970
+ { 217, 0 }, /* (121) using_opt ::= */
141971
+ { 205, 0 }, /* (122) orderby_opt ::= */
141972
+ { 205, -3 }, /* (123) orderby_opt ::= ORDER BY sortlist */
141973
+ { 187, -4 }, /* (124) sortlist ::= sortlist COMMA expr sortorder */
141974
+ { 187, -2 }, /* (125) sortlist ::= expr sortorder */
141975
+ { 176, -1 }, /* (126) sortorder ::= ASC */
141976
+ { 176, -1 }, /* (127) sortorder ::= DESC */
141977
+ { 176, 0 }, /* (128) sortorder ::= */
141978
+ { 203, 0 }, /* (129) groupby_opt ::= */
141979
+ { 203, -3 }, /* (130) groupby_opt ::= GROUP BY nexprlist */
141980
+ { 204, 0 }, /* (131) having_opt ::= */
141981
+ { 204, -2 }, /* (132) having_opt ::= HAVING expr */
141982
+ { 206, 0 }, /* (133) limit_opt ::= */
141983
+ { 206, -2 }, /* (134) limit_opt ::= LIMIT expr */
141984
+ { 206, -4 }, /* (135) limit_opt ::= LIMIT expr OFFSET expr */
141985
+ { 206, -4 }, /* (136) limit_opt ::= LIMIT expr COMMA expr */
141986
+ { 149, -6 }, /* (137) cmd ::= with DELETE FROM fullname indexed_opt where_opt */
141987
+ { 202, 0 }, /* (138) where_opt ::= */
141988
+ { 202, -2 }, /* (139) where_opt ::= WHERE expr */
141989
+ { 149, -8 }, /* (140) cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */
141990
+ { 220, -5 }, /* (141) setlist ::= setlist COMMA nm EQ expr */
141991
+ { 220, -7 }, /* (142) setlist ::= setlist COMMA LP idlist RP EQ expr */
141992
+ { 220, -3 }, /* (143) setlist ::= nm EQ expr */
141993
+ { 220, -5 }, /* (144) setlist ::= LP idlist RP EQ expr */
141994
+ { 149, -6 }, /* (145) cmd ::= with insert_cmd INTO fullname idlist_opt select */
141995
+ { 149, -7 }, /* (146) cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */
141996
+ { 221, -2 }, /* (147) insert_cmd ::= INSERT orconf */
141997
+ { 221, -1 }, /* (148) insert_cmd ::= REPLACE */
141998
+ { 222, 0 }, /* (149) idlist_opt ::= */
141999
+ { 222, -3 }, /* (150) idlist_opt ::= LP idlist RP */
142000
+ { 218, -3 }, /* (151) idlist ::= idlist COMMA nm */
142001
+ { 218, -1 }, /* (152) idlist ::= nm */
142002
+ { 174, -3 }, /* (153) expr ::= LP expr RP */
142003
+ { 174, -1 }, /* (154) expr ::= ID|INDEXED */
142004
+ { 174, -1 }, /* (155) expr ::= JOIN_KW */
142005
+ { 174, -3 }, /* (156) expr ::= nm DOT nm */
142006
+ { 174, -5 }, /* (157) expr ::= nm DOT nm DOT nm */
142007
+ { 173, -1 }, /* (158) term ::= NULL|FLOAT|BLOB */
142008
+ { 173, -1 }, /* (159) term ::= STRING */
142009
+ { 173, -1 }, /* (160) term ::= INTEGER */
142010
+ { 174, -1 }, /* (161) expr ::= VARIABLE */
142011
+ { 174, -3 }, /* (162) expr ::= expr COLLATE ID|STRING */
142012
+ { 174, -6 }, /* (163) expr ::= CAST LP expr AS typetoken RP */
142013
+ { 174, -5 }, /* (164) expr ::= ID|INDEXED LP distinct exprlist RP */
142014
+ { 174, -4 }, /* (165) expr ::= ID|INDEXED LP STAR RP */
142015
+ { 173, -1 }, /* (166) term ::= CTIME_KW */
142016
+ { 174, -5 }, /* (167) expr ::= LP nexprlist COMMA expr RP */
142017
+ { 174, -3 }, /* (168) expr ::= expr AND expr */
142018
+ { 174, -3 }, /* (169) expr ::= expr OR expr */
142019
+ { 174, -3 }, /* (170) expr ::= expr LT|GT|GE|LE expr */
142020
+ { 174, -3 }, /* (171) expr ::= expr EQ|NE expr */
142021
+ { 174, -3 }, /* (172) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
142022
+ { 174, -3 }, /* (173) expr ::= expr PLUS|MINUS expr */
142023
+ { 174, -3 }, /* (174) expr ::= expr STAR|SLASH|REM expr */
142024
+ { 174, -3 }, /* (175) expr ::= expr CONCAT expr */
142025
+ { 223, -2 }, /* (176) likeop ::= NOT LIKE_KW|MATCH */
142026
+ { 174, -3 }, /* (177) expr ::= expr likeop expr */
142027
+ { 174, -5 }, /* (178) expr ::= expr likeop expr ESCAPE expr */
142028
+ { 174, -2 }, /* (179) expr ::= expr ISNULL|NOTNULL */
142029
+ { 174, -3 }, /* (180) expr ::= expr NOT NULL */
142030
+ { 174, -3 }, /* (181) expr ::= expr IS expr */
142031
+ { 174, -4 }, /* (182) expr ::= expr IS NOT expr */
142032
+ { 174, -2 }, /* (183) expr ::= NOT expr */
142033
+ { 174, -2 }, /* (184) expr ::= BITNOT expr */
142034
+ { 174, -2 }, /* (185) expr ::= MINUS expr */
142035
+ { 174, -2 }, /* (186) expr ::= PLUS expr */
142036
+ { 224, -1 }, /* (187) between_op ::= BETWEEN */
142037
+ { 224, -2 }, /* (188) between_op ::= NOT BETWEEN */
142038
+ { 174, -5 }, /* (189) expr ::= expr between_op expr AND expr */
142039
+ { 225, -1 }, /* (190) in_op ::= IN */
142040
+ { 225, -2 }, /* (191) in_op ::= NOT IN */
142041
+ { 174, -5 }, /* (192) expr ::= expr in_op LP exprlist RP */
142042
+ { 174, -3 }, /* (193) expr ::= LP select RP */
142043
+ { 174, -5 }, /* (194) expr ::= expr in_op LP select RP */
142044
+ { 174, -5 }, /* (195) expr ::= expr in_op nm dbnm paren_exprlist */
142045
+ { 174, -4 }, /* (196) expr ::= EXISTS LP select RP */
142046
+ { 174, -5 }, /* (197) expr ::= CASE case_operand case_exprlist case_else END */
142047
+ { 228, -5 }, /* (198) case_exprlist ::= case_exprlist WHEN expr THEN expr */
142048
+ { 228, -4 }, /* (199) case_exprlist ::= WHEN expr THEN expr */
142049
+ { 229, -2 }, /* (200) case_else ::= ELSE expr */
142050
+ { 229, 0 }, /* (201) case_else ::= */
142051
+ { 227, -1 }, /* (202) case_operand ::= expr */
142052
+ { 227, 0 }, /* (203) case_operand ::= */
142053
+ { 209, 0 }, /* (204) exprlist ::= */
142054
+ { 208, -3 }, /* (205) nexprlist ::= nexprlist COMMA expr */
142055
+ { 208, -1 }, /* (206) nexprlist ::= expr */
142056
+ { 226, 0 }, /* (207) paren_exprlist ::= */
142057
+ { 226, -3 }, /* (208) paren_exprlist ::= LP exprlist RP */
142058
+ { 149, -12 }, /* (209) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
142059
+ { 230, -1 }, /* (210) uniqueflag ::= UNIQUE */
142060
+ { 230, 0 }, /* (211) uniqueflag ::= */
142061
+ { 178, 0 }, /* (212) eidlist_opt ::= */
142062
+ { 178, -3 }, /* (213) eidlist_opt ::= LP eidlist RP */
142063
+ { 188, -5 }, /* (214) eidlist ::= eidlist COMMA nm collate sortorder */
142064
+ { 188, -3 }, /* (215) eidlist ::= nm collate sortorder */
142065
+ { 231, 0 }, /* (216) collate ::= */
142066
+ { 231, -2 }, /* (217) collate ::= COLLATE ID|STRING */
142067
+ { 149, -4 }, /* (218) cmd ::= DROP INDEX ifexists fullname */
142068
+ { 149, -1 }, /* (219) cmd ::= VACUUM */
142069
+ { 149, -2 }, /* (220) cmd ::= VACUUM nm */
142070
+ { 149, -3 }, /* (221) cmd ::= PRAGMA nm dbnm */
142071
+ { 149, -5 }, /* (222) cmd ::= PRAGMA nm dbnm EQ nmnum */
142072
+ { 149, -6 }, /* (223) cmd ::= PRAGMA nm dbnm LP nmnum RP */
142073
+ { 149, -5 }, /* (224) cmd ::= PRAGMA nm dbnm EQ minus_num */
142074
+ { 149, -6 }, /* (225) cmd ::= PRAGMA nm dbnm LP minus_num RP */
142075
+ { 169, -2 }, /* (226) plus_num ::= PLUS INTEGER|FLOAT */
142076
+ { 170, -2 }, /* (227) minus_num ::= MINUS INTEGER|FLOAT */
142077
+ { 149, -5 }, /* (228) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
142078
+ { 233, -11 }, /* (229) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
142079
+ { 235, -1 }, /* (230) trigger_time ::= BEFORE|AFTER */
142080
+ { 235, -2 }, /* (231) trigger_time ::= INSTEAD OF */
142081
+ { 235, 0 }, /* (232) trigger_time ::= */
142082
+ { 236, -1 }, /* (233) trigger_event ::= DELETE|INSERT */
142083
+ { 236, -1 }, /* (234) trigger_event ::= UPDATE */
142084
+ { 236, -3 }, /* (235) trigger_event ::= UPDATE OF idlist */
142085
+ { 238, 0 }, /* (236) when_clause ::= */
142086
+ { 238, -2 }, /* (237) when_clause ::= WHEN expr */
142087
+ { 234, -3 }, /* (238) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
142088
+ { 234, -2 }, /* (239) trigger_cmd_list ::= trigger_cmd SEMI */
142089
+ { 240, -3 }, /* (240) trnm ::= nm DOT nm */
142090
+ { 241, -3 }, /* (241) tridxby ::= INDEXED BY nm */
142091
+ { 241, -2 }, /* (242) tridxby ::= NOT INDEXED */
142092
+ { 239, -8 }, /* (243) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
142093
+ { 239, -7 }, /* (244) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */
142094
+ { 239, -6 }, /* (245) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
142095
+ { 239, -3 }, /* (246) trigger_cmd ::= scanpt select scanpt */
142096
+ { 174, -4 }, /* (247) expr ::= RAISE LP IGNORE RP */
142097
+ { 174, -6 }, /* (248) expr ::= RAISE LP raisetype COMMA nm RP */
142098
+ { 192, -1 }, /* (249) raisetype ::= ROLLBACK */
142099
+ { 192, -1 }, /* (250) raisetype ::= ABORT */
142100
+ { 192, -1 }, /* (251) raisetype ::= FAIL */
142101
+ { 149, -4 }, /* (252) cmd ::= DROP TRIGGER ifexists fullname */
142102
+ { 149, -6 }, /* (253) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
142103
+ { 149, -3 }, /* (254) cmd ::= DETACH database_kw_opt expr */
142104
+ { 243, 0 }, /* (255) key_opt ::= */
142105
+ { 243, -2 }, /* (256) key_opt ::= KEY expr */
142106
+ { 149, -1 }, /* (257) cmd ::= REINDEX */
142107
+ { 149, -3 }, /* (258) cmd ::= REINDEX nm dbnm */
142108
+ { 149, -1 }, /* (259) cmd ::= ANALYZE */
142109
+ { 149, -3 }, /* (260) cmd ::= ANALYZE nm dbnm */
142110
+ { 149, -6 }, /* (261) cmd ::= ALTER TABLE fullname RENAME TO nm */
142111
+ { 149, -7 }, /* (262) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
142112
+ { 244, -1 }, /* (263) add_column_fullname ::= fullname */
142113
+ { 149, -1 }, /* (264) cmd ::= create_vtab */
142114
+ { 149, -4 }, /* (265) cmd ::= create_vtab LP vtabarglist RP */
142115
+ { 246, -8 }, /* (266) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
142116
+ { 248, 0 }, /* (267) vtabarg ::= */
142117
+ { 249, -1 }, /* (268) vtabargtoken ::= ANY */
142118
+ { 249, -3 }, /* (269) vtabargtoken ::= lp anylist RP */
142119
+ { 250, -1 }, /* (270) lp ::= LP */
142120
+ { 219, -2 }, /* (271) with ::= WITH wqlist */
142121
+ { 219, -3 }, /* (272) with ::= WITH RECURSIVE wqlist */
142122
+ { 197, -6 }, /* (273) wqlist ::= nm eidlist_opt AS LP select RP */
142123
+ { 197, -8 }, /* (274) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
142124
+ { 144, -1 }, /* (275) input ::= cmdlist */
142125
+ { 145, -2 }, /* (276) cmdlist ::= cmdlist ecmd */
142126
+ { 145, -1 }, /* (277) cmdlist ::= ecmd */
142127
+ { 146, -1 }, /* (278) ecmd ::= SEMI */
142128
+ { 146, -3 }, /* (279) ecmd ::= explain cmdx SEMI */
142129
+ { 147, 0 }, /* (280) explain ::= */
142130
+ { 151, 0 }, /* (281) trans_opt ::= */
142131
+ { 151, -1 }, /* (282) trans_opt ::= TRANSACTION */
142132
+ { 151, -2 }, /* (283) trans_opt ::= TRANSACTION nm */
142133
+ { 153, -1 }, /* (284) savepoint_opt ::= SAVEPOINT */
142134
+ { 153, 0 }, /* (285) savepoint_opt ::= */
142135
+ { 149, -2 }, /* (286) cmd ::= create_table create_table_args */
142136
+ { 160, -4 }, /* (287) columnlist ::= columnlist COMMA columnname carglist */
142137
+ { 160, -2 }, /* (288) columnlist ::= columnname carglist */
142138
+ { 152, -1 }, /* (289) nm ::= ID|INDEXED */
142139
+ { 152, -1 }, /* (290) nm ::= STRING */
142140
+ { 152, -1 }, /* (291) nm ::= JOIN_KW */
142141
+ { 166, -1 }, /* (292) typetoken ::= typename */
142142
+ { 167, -1 }, /* (293) typename ::= ID|STRING */
142143
+ { 168, -1 }, /* (294) signed ::= plus_num */
142144
+ { 168, -1 }, /* (295) signed ::= minus_num */
142145
+ { 165, -2 }, /* (296) carglist ::= carglist ccons */
142146
+ { 165, 0 }, /* (297) carglist ::= */
142147
+ { 172, -2 }, /* (298) ccons ::= NULL onconf */
142148
+ { 161, -2 }, /* (299) conslist_opt ::= COMMA conslist */
142149
+ { 184, -3 }, /* (300) conslist ::= conslist tconscomma tcons */
142150
+ { 184, -1 }, /* (301) conslist ::= tcons */
142151
+ { 185, 0 }, /* (302) tconscomma ::= */
142152
+ { 189, -1 }, /* (303) defer_subclause_opt ::= defer_subclause */
142153
+ { 191, -1 }, /* (304) resolvetype ::= raisetype */
142154
+ { 195, -1 }, /* (305) selectnowith ::= oneselect */
142155
+ { 196, -1 }, /* (306) oneselect ::= values */
142156
+ { 210, -2 }, /* (307) sclp ::= selcollist COMMA */
142157
+ { 211, -1 }, /* (308) as ::= ID|STRING */
142158
+ { 174, -1 }, /* (309) expr ::= term */
142159
+ { 223, -1 }, /* (310) likeop ::= LIKE_KW|MATCH */
142160
+ { 209, -1 }, /* (311) exprlist ::= nexprlist */
142161
+ { 232, -1 }, /* (312) nmnum ::= plus_num */
142162
+ { 232, -1 }, /* (313) nmnum ::= nm */
142163
+ { 232, -1 }, /* (314) nmnum ::= ON */
142164
+ { 232, -1 }, /* (315) nmnum ::= DELETE */
142165
+ { 232, -1 }, /* (316) nmnum ::= DEFAULT */
142166
+ { 169, -1 }, /* (317) plus_num ::= INTEGER|FLOAT */
142167
+ { 237, 0 }, /* (318) foreach_clause ::= */
142168
+ { 237, -3 }, /* (319) foreach_clause ::= FOR EACH ROW */
142169
+ { 240, -1 }, /* (320) trnm ::= nm */
142170
+ { 241, 0 }, /* (321) tridxby ::= */
142171
+ { 242, -1 }, /* (322) database_kw_opt ::= DATABASE */
142172
+ { 242, 0 }, /* (323) database_kw_opt ::= */
142173
+ { 245, 0 }, /* (324) kwcolumn_opt ::= */
142174
+ { 245, -1 }, /* (325) kwcolumn_opt ::= COLUMNKW */
142175
+ { 247, -1 }, /* (326) vtabarglist ::= vtabarg */
142176
+ { 247, -3 }, /* (327) vtabarglist ::= vtabarglist COMMA vtabarg */
142177
+ { 248, -2 }, /* (328) vtabarg ::= vtabarg vtabargtoken */
142178
+ { 251, 0 }, /* (329) anylist ::= */
142179
+ { 251, -4 }, /* (330) anylist ::= anylist LP anylist RP */
142180
+ { 251, -2 }, /* (331) anylist ::= anylist ANY */
142181
+ { 219, 0 }, /* (332) with ::= */
141804142182
};
141805142183
141806142184
static void yy_accept(yyParser*); /* Forward Declaration */
141807142185
141808142186
/*
@@ -141932,12 +142310,12 @@
141932142310
case 21: /* table_options ::= */ yytestcase(yyruleno==21);
141933142311
case 42: /* autoinc ::= */ yytestcase(yyruleno==42);
141934142312
case 57: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==57);
141935142313
case 67: /* defer_subclause_opt ::= */ yytestcase(yyruleno==67);
141936142314
case 76: /* ifexists ::= */ yytestcase(yyruleno==76);
141937
- case 90: /* distinct ::= */ yytestcase(yyruleno==90);
141938
- case 213: /* collate ::= */ yytestcase(yyruleno==213);
142315
+ case 92: /* distinct ::= */ yytestcase(yyruleno==92);
142316
+ case 216: /* collate ::= */ yytestcase(yyruleno==216);
141939142317
{yymsp[1].minor.yy4 = 0;}
141940142318
break;
141941142319
case 16: /* ifnotexists ::= IF NOT EXISTS */
141942142320
{yymsp[-2].minor.yy4 = 1;}
141943142321
break;
@@ -141969,11 +142347,11 @@
141969142347
case 23: /* columnname ::= nm typetoken */
141970142348
{sqlite3AddColumn(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
141971142349
break;
141972142350
case 24: /* typetoken ::= */
141973142351
case 60: /* conslist_opt ::= */ yytestcase(yyruleno==60);
141974
- case 96: /* as ::= */ yytestcase(yyruleno==96);
142352
+ case 98: /* as ::= */ yytestcase(yyruleno==98);
141975142353
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = 0;}
141976142354
break;
141977142355
case 25: /* typetoken ::= typename LP signed RP */
141978142356
{
141979142357
yymsp[-3].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
@@ -142080,18 +142458,18 @@
142080142458
case 55: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
142081142459
{yymsp[-2].minor.yy4 = 0;}
142082142460
break;
142083142461
case 56: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
142084142462
case 71: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==71);
142085
- case 144: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==144);
142463
+ case 147: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==147);
142086142464
{yymsp[-1].minor.yy4 = yymsp[0].minor.yy4;}
142087142465
break;
142088142466
case 58: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
142089142467
case 75: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==75);
142090
- case 185: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==185);
142091
- case 188: /* in_op ::= NOT IN */ yytestcase(yyruleno==188);
142092
- case 214: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==214);
142468
+ case 188: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==188);
142469
+ case 191: /* in_op ::= NOT IN */ yytestcase(yyruleno==191);
142470
+ case 217: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==217);
142093142471
{yymsp[-1].minor.yy4 = 1;}
142094142472
break;
142095142473
case 59: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
142096142474
{yymsp[-1].minor.yy4 = 0;}
142097142475
break;
@@ -142123,11 +142501,11 @@
142123142501
break;
142124142502
case 72: /* resolvetype ::= IGNORE */
142125142503
{yymsp[0].minor.yy4 = OE_Ignore;}
142126142504
break;
142127142505
case 73: /* resolvetype ::= REPLACE */
142128
- case 145: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==145);
142506
+ case 148: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==148);
142129142507
{yymsp[0].minor.yy4 = OE_Replace;}
142130142508
break;
142131142509
case 74: /* cmd ::= DROP TABLE ifexists fullname */
142132142510
{
142133142511
sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
@@ -142148,23 +142526,44 @@
142148142526
SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0};
142149142527
sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
142150142528
sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
142151142529
}
142152142530
break;
142153
- case 80: /* select ::= with selectnowith */
142531
+ case 80: /* select ::= WITH wqlist selectnowith */
142532
+{
142533
+ Select *p = yymsp[0].minor.yy387;
142534
+ if( p ){
142535
+ p->pWith = yymsp[-1].minor.yy451;
142536
+ parserDoubleLinkSelect(pParse, p);
142537
+ }else{
142538
+ sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy451);
142539
+ }
142540
+ yymsp[-2].minor.yy387 = p;
142541
+}
142542
+ break;
142543
+ case 81: /* select ::= WITH RECURSIVE wqlist selectnowith */
142154142544
{
142155142545
Select *p = yymsp[0].minor.yy387;
142156142546
if( p ){
142157142547
p->pWith = yymsp[-1].minor.yy451;
142158142548
parserDoubleLinkSelect(pParse, p);
142159142549
}else{
142160142550
sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy451);
142161142551
}
142162
- yymsp[-1].minor.yy387 = p; /*A-overwrites-W*/
142552
+ yymsp[-3].minor.yy387 = p;
142163142553
}
142164142554
break;
142165
- case 81: /* selectnowith ::= selectnowith multiselect_op oneselect */
142555
+ case 82: /* select ::= selectnowith */
142556
+{
142557
+ Select *p = yymsp[0].minor.yy387;
142558
+ if( p ){
142559
+ parserDoubleLinkSelect(pParse, p);
142560
+ }
142561
+ yymsp[0].minor.yy387 = p; /*A-overwrites-X*/
142562
+}
142563
+ break;
142564
+ case 83: /* selectnowith ::= selectnowith multiselect_op oneselect */
142166142565
{
142167142566
Select *pRhs = yymsp[0].minor.yy387;
142168142567
Select *pLhs = yymsp[-2].minor.yy387;
142169142568
if( pRhs && pRhs->pPrior ){
142170142569
SrcList *pFrom;
@@ -142184,18 +142583,18 @@
142184142583
sqlite3SelectDelete(pParse->db, pLhs);
142185142584
}
142186142585
yymsp[-2].minor.yy387 = pRhs;
142187142586
}
142188142587
break;
142189
- case 82: /* multiselect_op ::= UNION */
142190
- case 84: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==84);
142588
+ case 84: /* multiselect_op ::= UNION */
142589
+ case 86: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==86);
142191142590
{yymsp[0].minor.yy4 = yymsp[0].major; /*A-overwrites-OP*/}
142192142591
break;
142193
- case 83: /* multiselect_op ::= UNION ALL */
142592
+ case 85: /* multiselect_op ::= UNION ALL */
142194142593
{yymsp[-1].minor.yy4 = TK_ALL;}
142195142594
break;
142196
- case 85: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
142595
+ case 87: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
142197142596
{
142198142597
#if SELECTTRACE_ENABLED
142199142598
Token s = yymsp[-8].minor.yy0; /*A-overwrites-S*/
142200142599
#endif
142201142600
yymsp[-8].minor.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.yy314);
@@ -142222,16 +142621,16 @@
142222142621
}
142223142622
}
142224142623
#endif /* SELECTRACE_ENABLED */
142225142624
}
142226142625
break;
142227
- case 86: /* values ::= VALUES LP nexprlist RP */
142626
+ case 88: /* values ::= VALUES LP nexprlist RP */
142228142627
{
142229142628
yymsp[-3].minor.yy387 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values,0);
142230142629
}
142231142630
break;
142232
- case 87: /* values ::= values COMMA LP exprlist RP */
142631
+ case 89: /* values ::= values COMMA LP exprlist RP */
142233142632
{
142234142633
Select *pRight, *pLeft = yymsp[-4].minor.yy387;
142235142634
pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values|SF_MultiValue,0);
142236142635
if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
142237142636
if( pRight ){
@@ -142241,86 +142640,86 @@
142241142640
}else{
142242142641
yymsp[-4].minor.yy387 = pLeft;
142243142642
}
142244142643
}
142245142644
break;
142246
- case 88: /* distinct ::= DISTINCT */
142645
+ case 90: /* distinct ::= DISTINCT */
142247142646
{yymsp[0].minor.yy4 = SF_Distinct;}
142248142647
break;
142249
- case 89: /* distinct ::= ALL */
142648
+ case 91: /* distinct ::= ALL */
142250142649
{yymsp[0].minor.yy4 = SF_All;}
142251142650
break;
142252
- case 91: /* sclp ::= */
142253
- case 119: /* orderby_opt ::= */ yytestcase(yyruleno==119);
142254
- case 126: /* groupby_opt ::= */ yytestcase(yyruleno==126);
142255
- case 201: /* exprlist ::= */ yytestcase(yyruleno==201);
142256
- case 204: /* paren_exprlist ::= */ yytestcase(yyruleno==204);
142257
- case 209: /* eidlist_opt ::= */ yytestcase(yyruleno==209);
142651
+ case 93: /* sclp ::= */
142652
+ case 122: /* orderby_opt ::= */ yytestcase(yyruleno==122);
142653
+ case 129: /* groupby_opt ::= */ yytestcase(yyruleno==129);
142654
+ case 204: /* exprlist ::= */ yytestcase(yyruleno==204);
142655
+ case 207: /* paren_exprlist ::= */ yytestcase(yyruleno==207);
142656
+ case 212: /* eidlist_opt ::= */ yytestcase(yyruleno==212);
142258142657
{yymsp[1].minor.yy322 = 0;}
142259142658
break;
142260
- case 92: /* selcollist ::= sclp scanpt expr scanpt as */
142659
+ case 94: /* selcollist ::= sclp scanpt expr scanpt as */
142261142660
{
142262142661
yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[-2].minor.yy314);
142263142662
if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[0].minor.yy0, 1);
142264142663
sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy322,yymsp[-3].minor.yy336,yymsp[-1].minor.yy336);
142265142664
}
142266142665
break;
142267
- case 93: /* selcollist ::= sclp scanpt STAR */
142666
+ case 95: /* selcollist ::= sclp scanpt STAR */
142268142667
{
142269142668
Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
142270142669
yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, p);
142271142670
}
142272142671
break;
142273
- case 94: /* selcollist ::= sclp scanpt nm DOT STAR */
142672
+ case 96: /* selcollist ::= sclp scanpt nm DOT STAR */
142274142673
{
142275142674
Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
142276142675
Expr *pLeft = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
142277142676
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
142278142677
yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, pDot);
142279142678
}
142280142679
break;
142281
- case 95: /* as ::= AS nm */
142282
- case 106: /* dbnm ::= DOT nm */ yytestcase(yyruleno==106);
142283
- case 223: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==223);
142284
- case 224: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==224);
142680
+ case 97: /* as ::= AS nm */
142681
+ case 108: /* dbnm ::= DOT nm */ yytestcase(yyruleno==108);
142682
+ case 226: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==226);
142683
+ case 227: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==227);
142285142684
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
142286142685
break;
142287
- case 97: /* from ::= */
142686
+ case 99: /* from ::= */
142288142687
{yymsp[1].minor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy259));}
142289142688
break;
142290
- case 98: /* from ::= FROM seltablist */
142689
+ case 100: /* from ::= FROM seltablist */
142291142690
{
142292142691
yymsp[-1].minor.yy259 = yymsp[0].minor.yy259;
142293142692
sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy259);
142294142693
}
142295142694
break;
142296
- case 99: /* stl_prefix ::= seltablist joinop */
142695
+ case 101: /* stl_prefix ::= seltablist joinop */
142297142696
{
142298142697
if( ALWAYS(yymsp[-1].minor.yy259 && yymsp[-1].minor.yy259->nSrc>0) ) yymsp[-1].minor.yy259->a[yymsp[-1].minor.yy259->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy4;
142299142698
}
142300142699
break;
142301
- case 100: /* stl_prefix ::= */
142700
+ case 102: /* stl_prefix ::= */
142302142701
{yymsp[1].minor.yy259 = 0;}
142303142702
break;
142304
- case 101: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
142703
+ case 103: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
142305142704
{
142306142705
yymsp[-6].minor.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);
142307142706
sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy259, &yymsp[-2].minor.yy0);
142308142707
}
142309142708
break;
142310
- case 102: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
142709
+ case 104: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
142311142710
{
142312142711
yymsp[-8].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy259,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
142313142712
sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy259, yymsp[-4].minor.yy322);
142314142713
}
142315142714
break;
142316
- case 103: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
142715
+ case 105: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
142317142716
{
142318142717
yymsp[-6].minor.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);
142319142718
}
142320142719
break;
142321
- case 104: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
142720
+ case 106: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
142322142721
{
142323142722
if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
142324142723
yymsp[-6].minor.yy259 = yymsp[-4].minor.yy259;
142325142724
}else if( yymsp[-4].minor.yy259->nSrc==1 ){
142326142725
yymsp[-6].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
@@ -142340,185 +142739,184 @@
142340142739
pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,SF_NestedFrom,0);
142341142740
yymsp[-6].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
142342142741
}
142343142742
}
142344142743
break;
142345
- case 105: /* dbnm ::= */
142346
- case 114: /* indexed_opt ::= */ yytestcase(yyruleno==114);
142744
+ case 107: /* dbnm ::= */
142745
+ case 117: /* indexed_opt ::= */ yytestcase(yyruleno==117);
142347142746
{yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
142348142747
break;
142349
- case 107: /* fullname ::= nm dbnm */
142350
-{yymsp[-1].minor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
142748
+ case 109: /* fullname ::= nm */
142749
+{yymsp[0].minor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
142351142750
break;
142352
- case 108: /* joinop ::= COMMA|JOIN */
142751
+ case 110: /* fullname ::= nm DOT nm */
142752
+{yymsp[-2].minor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
142753
+ break;
142754
+ case 111: /* joinop ::= COMMA|JOIN */
142353142755
{ yymsp[0].minor.yy4 = JT_INNER; }
142354142756
break;
142355
- case 109: /* joinop ::= JOIN_KW JOIN */
142757
+ case 112: /* joinop ::= JOIN_KW JOIN */
142356142758
{yymsp[-1].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
142357142759
break;
142358
- case 110: /* joinop ::= JOIN_KW nm JOIN */
142760
+ case 113: /* joinop ::= JOIN_KW nm JOIN */
142359142761
{yymsp[-2].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
142360142762
break;
142361
- case 111: /* joinop ::= JOIN_KW nm nm JOIN */
142763
+ case 114: /* joinop ::= JOIN_KW nm nm JOIN */
142362142764
{yymsp[-3].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
142363142765
break;
142364
- case 112: /* on_opt ::= ON expr */
142365
- case 129: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==129);
142366
- case 136: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==136);
142367
- case 197: /* case_else ::= ELSE expr */ yytestcase(yyruleno==197);
142766
+ case 115: /* on_opt ::= ON expr */
142767
+ case 132: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==132);
142768
+ case 139: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==139);
142769
+ case 200: /* case_else ::= ELSE expr */ yytestcase(yyruleno==200);
142368142770
{yymsp[-1].minor.yy314 = yymsp[0].minor.yy314;}
142369142771
break;
142370
- case 113: /* on_opt ::= */
142371
- case 128: /* having_opt ::= */ yytestcase(yyruleno==128);
142372
- case 130: /* limit_opt ::= */ yytestcase(yyruleno==130);
142373
- case 135: /* where_opt ::= */ yytestcase(yyruleno==135);
142374
- case 198: /* case_else ::= */ yytestcase(yyruleno==198);
142375
- case 200: /* case_operand ::= */ yytestcase(yyruleno==200);
142772
+ case 116: /* on_opt ::= */
142773
+ case 131: /* having_opt ::= */ yytestcase(yyruleno==131);
142774
+ case 133: /* limit_opt ::= */ yytestcase(yyruleno==133);
142775
+ case 138: /* where_opt ::= */ yytestcase(yyruleno==138);
142776
+ case 201: /* case_else ::= */ yytestcase(yyruleno==201);
142777
+ case 203: /* case_operand ::= */ yytestcase(yyruleno==203);
142376142778
{yymsp[1].minor.yy314 = 0;}
142377142779
break;
142378
- case 115: /* indexed_opt ::= INDEXED BY nm */
142780
+ case 118: /* indexed_opt ::= INDEXED BY nm */
142379142781
{yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
142380142782
break;
142381
- case 116: /* indexed_opt ::= NOT INDEXED */
142783
+ case 119: /* indexed_opt ::= NOT INDEXED */
142382142784
{yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
142383142785
break;
142384
- case 117: /* using_opt ::= USING LP idlist RP */
142786
+ case 120: /* using_opt ::= USING LP idlist RP */
142385142787
{yymsp[-3].minor.yy384 = yymsp[-1].minor.yy384;}
142386142788
break;
142387
- case 118: /* using_opt ::= */
142388
- case 146: /* idlist_opt ::= */ yytestcase(yyruleno==146);
142789
+ case 121: /* using_opt ::= */
142790
+ case 149: /* idlist_opt ::= */ yytestcase(yyruleno==149);
142389142791
{yymsp[1].minor.yy384 = 0;}
142390142792
break;
142391
- case 120: /* orderby_opt ::= ORDER BY sortlist */
142392
- case 127: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==127);
142793
+ case 123: /* orderby_opt ::= ORDER BY sortlist */
142794
+ case 130: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==130);
142393142795
{yymsp[-2].minor.yy322 = yymsp[0].minor.yy322;}
142394142796
break;
142395
- case 121: /* sortlist ::= sortlist COMMA expr sortorder */
142797
+ case 124: /* sortlist ::= sortlist COMMA expr sortorder */
142396142798
{
142397142799
yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
142398142800
sqlite3ExprListSetSortOrder(yymsp[-3].minor.yy322,yymsp[0].minor.yy4);
142399142801
}
142400142802
break;
142401
- case 122: /* sortlist ::= expr sortorder */
142803
+ case 125: /* sortlist ::= expr sortorder */
142402142804
{
142403142805
yymsp[-1].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314); /*A-overwrites-Y*/
142404142806
sqlite3ExprListSetSortOrder(yymsp[-1].minor.yy322,yymsp[0].minor.yy4);
142405142807
}
142406142808
break;
142407
- case 123: /* sortorder ::= ASC */
142809
+ case 126: /* sortorder ::= ASC */
142408142810
{yymsp[0].minor.yy4 = SQLITE_SO_ASC;}
142409142811
break;
142410
- case 124: /* sortorder ::= DESC */
142812
+ case 127: /* sortorder ::= DESC */
142411142813
{yymsp[0].minor.yy4 = SQLITE_SO_DESC;}
142412142814
break;
142413
- case 125: /* sortorder ::= */
142815
+ case 128: /* sortorder ::= */
142414142816
{yymsp[1].minor.yy4 = SQLITE_SO_UNDEFINED;}
142415142817
break;
142416
- case 131: /* limit_opt ::= LIMIT expr */
142818
+ case 134: /* limit_opt ::= LIMIT expr */
142417142819
{yymsp[-1].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy314,0);}
142418142820
break;
142419
- case 132: /* limit_opt ::= LIMIT expr OFFSET expr */
142821
+ case 135: /* limit_opt ::= LIMIT expr OFFSET expr */
142420142822
{yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy314,yymsp[0].minor.yy314);}
142421142823
break;
142422
- case 133: /* limit_opt ::= LIMIT expr COMMA expr */
142824
+ case 136: /* limit_opt ::= LIMIT expr COMMA expr */
142423142825
{yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy314,yymsp[-2].minor.yy314);}
142424142826
break;
142425
- case 134: /* cmd ::= with DELETE FROM fullname indexed_opt where_opt */
142827
+ case 137: /* cmd ::= with DELETE FROM fullname indexed_opt where_opt */
142426142828
{
142427
- sqlite3WithPush(pParse, yymsp[-5].minor.yy451, 1);
142428142829
sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
142429142830
sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314,0,0);
142430142831
}
142431142832
break;
142432
- case 137: /* cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */
142833
+ case 140: /* cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */
142433142834
{
142434
- sqlite3WithPush(pParse, yymsp[-7].minor.yy451, 1);
142435142835
sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
142436142836
sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
142437142837
sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy4,0,0);
142438142838
}
142439142839
break;
142440
- case 138: /* setlist ::= setlist COMMA nm EQ expr */
142840
+ case 141: /* setlist ::= setlist COMMA nm EQ expr */
142441142841
{
142442142842
yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy314);
142443142843
sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, 1);
142444142844
}
142445142845
break;
142446
- case 139: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
142846
+ case 142: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
142447142847
{
142448142848
yymsp[-6].minor.yy322 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy322, yymsp[-3].minor.yy384, yymsp[0].minor.yy314);
142449142849
}
142450142850
break;
142451
- case 140: /* setlist ::= nm EQ expr */
142851
+ case 143: /* setlist ::= nm EQ expr */
142452142852
{
142453142853
yylhsminor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy314);
142454142854
sqlite3ExprListSetName(pParse, yylhsminor.yy322, &yymsp[-2].minor.yy0, 1);
142455142855
}
142456142856
yymsp[-2].minor.yy322 = yylhsminor.yy322;
142457142857
break;
142458
- case 141: /* setlist ::= LP idlist RP EQ expr */
142858
+ case 144: /* setlist ::= LP idlist RP EQ expr */
142459142859
{
142460142860
yymsp[-4].minor.yy322 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy384, yymsp[0].minor.yy314);
142461142861
}
142462142862
break;
142463
- case 142: /* cmd ::= with insert_cmd INTO fullname idlist_opt select */
142863
+ case 145: /* cmd ::= with insert_cmd INTO fullname idlist_opt select */
142464142864
{
142465
- sqlite3WithPush(pParse, yymsp[-5].minor.yy451, 1);
142466142865
sqlite3Insert(pParse, yymsp[-2].minor.yy259, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy4);
142467142866
}
142468142867
break;
142469
- case 143: /* cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */
142868
+ case 146: /* cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */
142470142869
{
142471
- sqlite3WithPush(pParse, yymsp[-6].minor.yy451, 1);
142472142870
sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy4);
142473142871
}
142474142872
break;
142475
- case 147: /* idlist_opt ::= LP idlist RP */
142873
+ case 150: /* idlist_opt ::= LP idlist RP */
142476142874
{yymsp[-2].minor.yy384 = yymsp[-1].minor.yy384;}
142477142875
break;
142478
- case 148: /* idlist ::= idlist COMMA nm */
142876
+ case 151: /* idlist ::= idlist COMMA nm */
142479142877
{yymsp[-2].minor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
142480142878
break;
142481
- case 149: /* idlist ::= nm */
142879
+ case 152: /* idlist ::= nm */
142482142880
{yymsp[0].minor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
142483142881
break;
142484
- case 150: /* expr ::= LP expr RP */
142882
+ case 153: /* expr ::= LP expr RP */
142485142883
{yymsp[-2].minor.yy314 = yymsp[-1].minor.yy314;}
142486142884
break;
142487
- case 151: /* expr ::= ID|INDEXED */
142488
- case 152: /* expr ::= JOIN_KW */ yytestcase(yyruleno==152);
142885
+ case 154: /* expr ::= ID|INDEXED */
142886
+ case 155: /* expr ::= JOIN_KW */ yytestcase(yyruleno==155);
142489142887
{yymsp[0].minor.yy314=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
142490142888
break;
142491
- case 153: /* expr ::= nm DOT nm */
142889
+ case 156: /* expr ::= nm DOT nm */
142492142890
{
142493142891
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
142494142892
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
142495142893
yylhsminor.yy314 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
142496142894
}
142497142895
yymsp[-2].minor.yy314 = yylhsminor.yy314;
142498142896
break;
142499
- case 154: /* expr ::= nm DOT nm DOT nm */
142897
+ case 157: /* expr ::= nm DOT nm DOT nm */
142500142898
{
142501142899
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
142502142900
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
142503142901
Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
142504142902
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
142505142903
yylhsminor.yy314 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
142506142904
}
142507142905
yymsp[-4].minor.yy314 = yylhsminor.yy314;
142508142906
break;
142509
- case 155: /* term ::= NULL|FLOAT|BLOB */
142510
- case 156: /* term ::= STRING */ yytestcase(yyruleno==156);
142907
+ case 158: /* term ::= NULL|FLOAT|BLOB */
142908
+ case 159: /* term ::= STRING */ yytestcase(yyruleno==159);
142511142909
{yymsp[0].minor.yy314=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
142512142910
break;
142513
- case 157: /* term ::= INTEGER */
142911
+ case 160: /* term ::= INTEGER */
142514142912
{
142515142913
yylhsminor.yy314 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
142516142914
}
142517142915
yymsp[0].minor.yy314 = yylhsminor.yy314;
142518142916
break;
142519
- case 158: /* expr ::= VARIABLE */
142917
+ case 161: /* expr ::= VARIABLE */
142520142918
{
142521142919
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
142522142920
u32 n = yymsp[0].minor.yy0.n;
142523142921
yymsp[0].minor.yy314 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
142524142922
sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy314, n);
@@ -142536,22 +142934,22 @@
142536142934
if( yymsp[0].minor.yy314 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy314->iTable);
142537142935
}
142538142936
}
142539142937
}
142540142938
break;
142541
- case 159: /* expr ::= expr COLLATE ID|STRING */
142939
+ case 162: /* expr ::= expr COLLATE ID|STRING */
142542142940
{
142543142941
yymsp[-2].minor.yy314 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy314, &yymsp[0].minor.yy0, 1);
142544142942
}
142545142943
break;
142546
- case 160: /* expr ::= CAST LP expr AS typetoken RP */
142944
+ case 163: /* expr ::= CAST LP expr AS typetoken RP */
142547142945
{
142548142946
yymsp[-5].minor.yy314 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
142549142947
sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy314, yymsp[-3].minor.yy314, 0);
142550142948
}
142551142949
break;
142552
- case 161: /* expr ::= ID|INDEXED LP distinct exprlist RP */
142950
+ case 164: /* expr ::= ID|INDEXED LP distinct exprlist RP */
142553142951
{
142554142952
if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
142555142953
sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
142556142954
}
142557142955
yylhsminor.yy314 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -142559,23 +142957,23 @@
142559142957
yylhsminor.yy314->flags |= EP_Distinct;
142560142958
}
142561142959
}
142562142960
yymsp[-4].minor.yy314 = yylhsminor.yy314;
142563142961
break;
142564
- case 162: /* expr ::= ID|INDEXED LP STAR RP */
142962
+ case 165: /* expr ::= ID|INDEXED LP STAR RP */
142565142963
{
142566142964
yylhsminor.yy314 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
142567142965
}
142568142966
yymsp[-3].minor.yy314 = yylhsminor.yy314;
142569142967
break;
142570
- case 163: /* term ::= CTIME_KW */
142968
+ case 166: /* term ::= CTIME_KW */
142571142969
{
142572142970
yylhsminor.yy314 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
142573142971
}
142574142972
yymsp[0].minor.yy314 = yylhsminor.yy314;
142575142973
break;
142576
- case 164: /* expr ::= LP nexprlist COMMA expr RP */
142974
+ case 167: /* expr ::= LP nexprlist COMMA expr RP */
142577142975
{
142578142976
ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy322, yymsp[-1].minor.yy314);
142579142977
yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
142580142978
if( yymsp[-4].minor.yy314 ){
142581142979
yymsp[-4].minor.yy314->x.pList = pList;
@@ -142582,24 +142980,24 @@
142582142980
}else{
142583142981
sqlite3ExprListDelete(pParse->db, pList);
142584142982
}
142585142983
}
142586142984
break;
142587
- case 165: /* expr ::= expr AND expr */
142588
- case 166: /* expr ::= expr OR expr */ yytestcase(yyruleno==166);
142589
- case 167: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==167);
142590
- case 168: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==168);
142591
- case 169: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==169);
142592
- case 170: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==170);
142593
- case 171: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==171);
142594
- case 172: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==172);
142985
+ case 168: /* expr ::= expr AND expr */
142986
+ case 169: /* expr ::= expr OR expr */ yytestcase(yyruleno==169);
142987
+ case 170: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==170);
142988
+ case 171: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==171);
142989
+ case 172: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==172);
142990
+ case 173: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==173);
142991
+ case 174: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==174);
142992
+ case 175: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==175);
142595142993
{yymsp[-2].minor.yy314=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy314,yymsp[0].minor.yy314);}
142596142994
break;
142597
- case 173: /* likeop ::= NOT LIKE_KW|MATCH */
142995
+ case 176: /* likeop ::= NOT LIKE_KW|MATCH */
142598142996
{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
142599142997
break;
142600
- case 174: /* expr ::= expr likeop expr */
142998
+ case 177: /* expr ::= expr likeop expr */
142601142999
{
142602143000
ExprList *pList;
142603143001
int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
142604143002
yymsp[-1].minor.yy0.n &= 0x7fffffff;
142605143003
pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy314);
@@ -142607,11 +143005,11 @@
142607143005
yymsp[-2].minor.yy314 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0);
142608143006
if( bNot ) yymsp[-2].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy314, 0);
142609143007
if( yymsp[-2].minor.yy314 ) yymsp[-2].minor.yy314->flags |= EP_InfixFunc;
142610143008
}
142611143009
break;
142612
- case 175: /* expr ::= expr likeop expr ESCAPE expr */
143010
+ case 178: /* expr ::= expr likeop expr ESCAPE expr */
142613143011
{
142614143012
ExprList *pList;
142615143013
int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
142616143014
yymsp[-3].minor.yy0.n &= 0x7fffffff;
142617143015
pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314);
@@ -142620,43 +143018,43 @@
142620143018
yymsp[-4].minor.yy314 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0);
142621143019
if( bNot ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
142622143020
if( yymsp[-4].minor.yy314 ) yymsp[-4].minor.yy314->flags |= EP_InfixFunc;
142623143021
}
142624143022
break;
142625
- case 176: /* expr ::= expr ISNULL|NOTNULL */
143023
+ case 179: /* expr ::= expr ISNULL|NOTNULL */
142626143024
{yymsp[-1].minor.yy314 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy314,0);}
142627143025
break;
142628
- case 177: /* expr ::= expr NOT NULL */
143026
+ case 180: /* expr ::= expr NOT NULL */
142629143027
{yymsp[-2].minor.yy314 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy314,0);}
142630143028
break;
142631
- case 178: /* expr ::= expr IS expr */
143029
+ case 181: /* expr ::= expr IS expr */
142632143030
{
142633143031
yymsp[-2].minor.yy314 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy314,yymsp[0].minor.yy314);
142634143032
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy314, yymsp[-2].minor.yy314, TK_ISNULL);
142635143033
}
142636143034
break;
142637
- case 179: /* expr ::= expr IS NOT expr */
143035
+ case 182: /* expr ::= expr IS NOT expr */
142638143036
{
142639143037
yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy314,yymsp[0].minor.yy314);
142640143038
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy314, yymsp[-3].minor.yy314, TK_NOTNULL);
142641143039
}
142642143040
break;
142643
- case 180: /* expr ::= NOT expr */
142644
- case 181: /* expr ::= BITNOT expr */ yytestcase(yyruleno==181);
143041
+ case 183: /* expr ::= NOT expr */
143042
+ case 184: /* expr ::= BITNOT expr */ yytestcase(yyruleno==184);
142645143043
{yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy314, 0);/*A-overwrites-B*/}
142646143044
break;
142647
- case 182: /* expr ::= MINUS expr */
143045
+ case 185: /* expr ::= MINUS expr */
142648143046
{yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy314, 0);}
142649143047
break;
142650
- case 183: /* expr ::= PLUS expr */
143048
+ case 186: /* expr ::= PLUS expr */
142651143049
{yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, TK_UPLUS, yymsp[0].minor.yy314, 0);}
142652143050
break;
142653
- case 184: /* between_op ::= BETWEEN */
142654
- case 187: /* in_op ::= IN */ yytestcase(yyruleno==187);
143051
+ case 187: /* between_op ::= BETWEEN */
143052
+ case 190: /* in_op ::= IN */ yytestcase(yyruleno==190);
142655143053
{yymsp[0].minor.yy4 = 0;}
142656143054
break;
142657
- case 186: /* expr ::= expr between_op expr AND expr */
143055
+ case 189: /* expr ::= expr between_op expr AND expr */
142658143056
{
142659143057
ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314);
142660143058
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy314);
142661143059
yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy314, 0);
142662143060
if( yymsp[-4].minor.yy314 ){
@@ -142665,11 +143063,11 @@
142665143063
sqlite3ExprListDelete(pParse->db, pList);
142666143064
}
142667143065
if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
142668143066
}
142669143067
break;
142670
- case 189: /* expr ::= expr in_op LP exprlist RP */
143068
+ case 192: /* expr ::= expr in_op LP exprlist RP */
142671143069
{
142672143070
if( yymsp[-1].minor.yy322==0 ){
142673143071
/* Expressions of the form
142674143072
**
142675143073
** expr1 IN ()
@@ -142717,41 +143115,41 @@
142717143115
}
142718143116
if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
142719143117
}
142720143118
}
142721143119
break;
142722
- case 190: /* expr ::= LP select RP */
143120
+ case 193: /* expr ::= LP select RP */
142723143121
{
142724143122
yymsp[-2].minor.yy314 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
142725143123
sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy314, yymsp[-1].minor.yy387);
142726143124
}
142727143125
break;
142728
- case 191: /* expr ::= expr in_op LP select RP */
143126
+ case 194: /* expr ::= expr in_op LP select RP */
142729143127
{
142730143128
yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy314, 0);
142731143129
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy314, yymsp[-1].minor.yy387);
142732143130
if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
142733143131
}
142734143132
break;
142735
- case 192: /* expr ::= expr in_op nm dbnm paren_exprlist */
143133
+ case 195: /* expr ::= expr in_op nm dbnm paren_exprlist */
142736143134
{
142737143135
SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
142738143136
Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
142739143137
if( yymsp[0].minor.yy322 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy322);
142740143138
yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy314, 0);
142741143139
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy314, pSelect);
142742143140
if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
142743143141
}
142744143142
break;
142745
- case 193: /* expr ::= EXISTS LP select RP */
143143
+ case 196: /* expr ::= EXISTS LP select RP */
142746143144
{
142747143145
Expr *p;
142748143146
p = yymsp[-3].minor.yy314 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
142749143147
sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy387);
142750143148
}
142751143149
break;
142752
- case 194: /* expr ::= CASE case_operand case_exprlist case_else END */
143150
+ case 197: /* expr ::= CASE case_operand case_exprlist case_else END */
142753143151
{
142754143152
yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, 0);
142755143153
if( yymsp[-4].minor.yy314 ){
142756143154
yymsp[-4].minor.yy314->x.pList = yymsp[-1].minor.yy314 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy314) : yymsp[-2].minor.yy322;
142757143155
sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy314);
@@ -142759,334 +143157,330 @@
142759143157
sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
142760143158
sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy314);
142761143159
}
142762143160
}
142763143161
break;
142764
- case 195: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
143162
+ case 198: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
142765143163
{
142766143164
yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy314);
142767143165
yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[0].minor.yy314);
142768143166
}
142769143167
break;
142770
- case 196: /* case_exprlist ::= WHEN expr THEN expr */
143168
+ case 199: /* case_exprlist ::= WHEN expr THEN expr */
142771143169
{
142772143170
yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314);
142773143171
yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, yymsp[0].minor.yy314);
142774143172
}
142775143173
break;
142776
- case 199: /* case_operand ::= expr */
143174
+ case 202: /* case_operand ::= expr */
142777143175
{yymsp[0].minor.yy314 = yymsp[0].minor.yy314; /*A-overwrites-X*/}
142778143176
break;
142779
- case 202: /* nexprlist ::= nexprlist COMMA expr */
143177
+ case 205: /* nexprlist ::= nexprlist COMMA expr */
142780143178
{yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy314);}
142781143179
break;
142782
- case 203: /* nexprlist ::= expr */
143180
+ case 206: /* nexprlist ::= expr */
142783143181
{yymsp[0].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy314); /*A-overwrites-Y*/}
142784143182
break;
142785
- case 205: /* paren_exprlist ::= LP exprlist RP */
142786
- case 210: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==210);
143183
+ case 208: /* paren_exprlist ::= LP exprlist RP */
143184
+ case 213: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==213);
142787143185
{yymsp[-2].minor.yy322 = yymsp[-1].minor.yy322;}
142788143186
break;
142789
- case 206: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
143187
+ case 209: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
142790143188
{
142791143189
sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
142792143190
sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy322, yymsp[-10].minor.yy4,
142793143191
&yymsp[-11].minor.yy0, yymsp[0].minor.yy314, SQLITE_SO_ASC, yymsp[-8].minor.yy4, SQLITE_IDXTYPE_APPDEF);
142794143192
}
142795143193
break;
142796
- case 207: /* uniqueflag ::= UNIQUE */
142797
- case 247: /* raisetype ::= ABORT */ yytestcase(yyruleno==247);
143194
+ case 210: /* uniqueflag ::= UNIQUE */
143195
+ case 250: /* raisetype ::= ABORT */ yytestcase(yyruleno==250);
142798143196
{yymsp[0].minor.yy4 = OE_Abort;}
142799143197
break;
142800
- case 208: /* uniqueflag ::= */
143198
+ case 211: /* uniqueflag ::= */
142801143199
{yymsp[1].minor.yy4 = OE_None;}
142802143200
break;
142803
- case 211: /* eidlist ::= eidlist COMMA nm collate sortorder */
143201
+ case 214: /* eidlist ::= eidlist COMMA nm collate sortorder */
142804143202
{
142805143203
yymsp[-4].minor.yy322 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy4, yymsp[0].minor.yy4);
142806143204
}
142807143205
break;
142808
- case 212: /* eidlist ::= nm collate sortorder */
143206
+ case 215: /* eidlist ::= nm collate sortorder */
142809143207
{
142810143208
yymsp[-2].minor.yy322 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy4, yymsp[0].minor.yy4); /*A-overwrites-Y*/
142811143209
}
142812143210
break;
142813
- case 215: /* cmd ::= DROP INDEX ifexists fullname */
143211
+ case 218: /* cmd ::= DROP INDEX ifexists fullname */
142814143212
{sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
142815143213
break;
142816
- case 216: /* cmd ::= VACUUM */
143214
+ case 219: /* cmd ::= VACUUM */
142817143215
{sqlite3Vacuum(pParse,0);}
142818143216
break;
142819
- case 217: /* cmd ::= VACUUM nm */
143217
+ case 220: /* cmd ::= VACUUM nm */
142820143218
{sqlite3Vacuum(pParse,&yymsp[0].minor.yy0);}
142821143219
break;
142822
- case 218: /* cmd ::= PRAGMA nm dbnm */
143220
+ case 221: /* cmd ::= PRAGMA nm dbnm */
142823143221
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
142824143222
break;
142825
- case 219: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
143223
+ case 222: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
142826143224
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
142827143225
break;
142828
- case 220: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
143226
+ case 223: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
142829143227
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
142830143228
break;
142831
- case 221: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
143229
+ case 224: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
142832143230
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
142833143231
break;
142834
- case 222: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
143232
+ case 225: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
142835143233
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
142836143234
break;
142837
- case 225: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
143235
+ case 228: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
142838143236
{
142839143237
Token all;
142840143238
all.z = yymsp[-3].minor.yy0.z;
142841143239
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
142842143240
sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
142843143241
}
142844143242
break;
142845
- case 226: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
143243
+ case 229: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
142846143244
{
142847143245
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);
142848143246
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
142849143247
}
142850143248
break;
142851
- case 227: /* trigger_time ::= BEFORE|AFTER */
143249
+ case 230: /* trigger_time ::= BEFORE|AFTER */
142852143250
{ yymsp[0].minor.yy4 = yymsp[0].major; /*A-overwrites-X*/ }
142853143251
break;
142854
- case 228: /* trigger_time ::= INSTEAD OF */
143252
+ case 231: /* trigger_time ::= INSTEAD OF */
142855143253
{ yymsp[-1].minor.yy4 = TK_INSTEAD;}
142856143254
break;
142857
- case 229: /* trigger_time ::= */
143255
+ case 232: /* trigger_time ::= */
142858143256
{ yymsp[1].minor.yy4 = TK_BEFORE; }
142859143257
break;
142860
- case 230: /* trigger_event ::= DELETE|INSERT */
142861
- case 231: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==231);
143258
+ case 233: /* trigger_event ::= DELETE|INSERT */
143259
+ case 234: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==234);
142862143260
{yymsp[0].minor.yy90.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy90.b = 0;}
142863143261
break;
142864
- case 232: /* trigger_event ::= UPDATE OF idlist */
143262
+ case 235: /* trigger_event ::= UPDATE OF idlist */
142865143263
{yymsp[-2].minor.yy90.a = TK_UPDATE; yymsp[-2].minor.yy90.b = yymsp[0].minor.yy384;}
142866143264
break;
142867
- case 233: /* when_clause ::= */
142868
- case 252: /* key_opt ::= */ yytestcase(yyruleno==252);
143265
+ case 236: /* when_clause ::= */
143266
+ case 255: /* key_opt ::= */ yytestcase(yyruleno==255);
142869143267
{ yymsp[1].minor.yy314 = 0; }
142870143268
break;
142871
- case 234: /* when_clause ::= WHEN expr */
142872
- case 253: /* key_opt ::= KEY expr */ yytestcase(yyruleno==253);
143269
+ case 237: /* when_clause ::= WHEN expr */
143270
+ case 256: /* key_opt ::= KEY expr */ yytestcase(yyruleno==256);
142873143271
{ yymsp[-1].minor.yy314 = yymsp[0].minor.yy314; }
142874143272
break;
142875
- case 235: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
143273
+ case 238: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
142876143274
{
142877143275
assert( yymsp[-2].minor.yy203!=0 );
142878143276
yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
142879143277
yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
142880143278
}
142881143279
break;
142882
- case 236: /* trigger_cmd_list ::= trigger_cmd SEMI */
143280
+ case 239: /* trigger_cmd_list ::= trigger_cmd SEMI */
142883143281
{
142884143282
assert( yymsp[-1].minor.yy203!=0 );
142885143283
yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
142886143284
}
142887143285
break;
142888
- case 237: /* trnm ::= nm DOT nm */
143286
+ case 240: /* trnm ::= nm DOT nm */
142889143287
{
142890143288
yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
142891143289
sqlite3ErrorMsg(pParse,
142892143290
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
142893143291
"statements within triggers");
142894143292
}
142895143293
break;
142896
- case 238: /* tridxby ::= INDEXED BY nm */
143294
+ case 241: /* tridxby ::= INDEXED BY nm */
142897143295
{
142898143296
sqlite3ErrorMsg(pParse,
142899143297
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
142900143298
"within triggers");
142901143299
}
142902143300
break;
142903
- case 239: /* tridxby ::= NOT INDEXED */
143301
+ case 242: /* tridxby ::= NOT INDEXED */
142904143302
{
142905143303
sqlite3ErrorMsg(pParse,
142906143304
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
142907143305
"within triggers");
142908143306
}
142909143307
break;
142910
- case 240: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
143308
+ case 243: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
142911143309
{yylhsminor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy314, yymsp[-6].minor.yy4, yymsp[-7].minor.yy0.z, yymsp[0].minor.yy336);}
142912143310
yymsp[-7].minor.yy203 = yylhsminor.yy203;
142913143311
break;
142914
- case 241: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */
143312
+ case 244: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */
142915143313
{yylhsminor.yy203 = sqlite3TriggerInsertStep(pParse->db,&yymsp[-3].minor.yy0,yymsp[-2].minor.yy384,yymsp[-1].minor.yy387,yymsp[-5].minor.yy4,yymsp[-6].minor.yy336,yymsp[0].minor.yy336);/*yylhsminor.yy203-overwrites-yymsp[-5].minor.yy4*/}
142916143314
yymsp[-6].minor.yy203 = yylhsminor.yy203;
142917143315
break;
142918
- case 242: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
143316
+ case 245: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
142919143317
{yylhsminor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy314, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy336);}
142920143318
yymsp[-5].minor.yy203 = yylhsminor.yy203;
142921143319
break;
142922
- case 243: /* trigger_cmd ::= scanpt select scanpt */
143320
+ case 246: /* trigger_cmd ::= scanpt select scanpt */
142923143321
{yylhsminor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy387, yymsp[-2].minor.yy336, yymsp[0].minor.yy336); /*yylhsminor.yy203-overwrites-yymsp[-1].minor.yy387*/}
142924143322
yymsp[-2].minor.yy203 = yylhsminor.yy203;
142925143323
break;
142926
- case 244: /* expr ::= RAISE LP IGNORE RP */
143324
+ case 247: /* expr ::= RAISE LP IGNORE RP */
142927143325
{
142928143326
yymsp[-3].minor.yy314 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
142929143327
if( yymsp[-3].minor.yy314 ){
142930143328
yymsp[-3].minor.yy314->affinity = OE_Ignore;
142931143329
}
142932143330
}
142933143331
break;
142934
- case 245: /* expr ::= RAISE LP raisetype COMMA nm RP */
143332
+ case 248: /* expr ::= RAISE LP raisetype COMMA nm RP */
142935143333
{
142936143334
yymsp[-5].minor.yy314 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
142937143335
if( yymsp[-5].minor.yy314 ) {
142938143336
yymsp[-5].minor.yy314->affinity = (char)yymsp[-3].minor.yy4;
142939143337
}
142940143338
}
142941143339
break;
142942
- case 246: /* raisetype ::= ROLLBACK */
143340
+ case 249: /* raisetype ::= ROLLBACK */
142943143341
{yymsp[0].minor.yy4 = OE_Rollback;}
142944143342
break;
142945
- case 248: /* raisetype ::= FAIL */
143343
+ case 251: /* raisetype ::= FAIL */
142946143344
{yymsp[0].minor.yy4 = OE_Fail;}
142947143345
break;
142948
- case 249: /* cmd ::= DROP TRIGGER ifexists fullname */
143346
+ case 252: /* cmd ::= DROP TRIGGER ifexists fullname */
142949143347
{
142950143348
sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
142951143349
}
142952143350
break;
142953
- case 250: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
143351
+ case 253: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
142954143352
{
142955143353
sqlite3Attach(pParse, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, yymsp[0].minor.yy314);
142956143354
}
142957143355
break;
142958
- case 251: /* cmd ::= DETACH database_kw_opt expr */
143356
+ case 254: /* cmd ::= DETACH database_kw_opt expr */
142959143357
{
142960143358
sqlite3Detach(pParse, yymsp[0].minor.yy314);
142961143359
}
142962143360
break;
142963
- case 254: /* cmd ::= REINDEX */
143361
+ case 257: /* cmd ::= REINDEX */
142964143362
{sqlite3Reindex(pParse, 0, 0);}
142965143363
break;
142966
- case 255: /* cmd ::= REINDEX nm dbnm */
143364
+ case 258: /* cmd ::= REINDEX nm dbnm */
142967143365
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
142968143366
break;
142969
- case 256: /* cmd ::= ANALYZE */
143367
+ case 259: /* cmd ::= ANALYZE */
142970143368
{sqlite3Analyze(pParse, 0, 0);}
142971143369
break;
142972
- case 257: /* cmd ::= ANALYZE nm dbnm */
143370
+ case 260: /* cmd ::= ANALYZE nm dbnm */
142973143371
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
142974143372
break;
142975
- case 258: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
143373
+ case 261: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
142976143374
{
142977143375
sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
142978143376
}
142979143377
break;
142980
- case 259: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
143378
+ case 262: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
142981143379
{
142982143380
yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
142983143381
sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
142984143382
}
142985143383
break;
142986
- case 260: /* add_column_fullname ::= fullname */
143384
+ case 263: /* add_column_fullname ::= fullname */
142987143385
{
142988143386
disableLookaside(pParse);
142989143387
sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
142990143388
}
142991143389
break;
142992
- case 261: /* cmd ::= create_vtab */
143390
+ case 264: /* cmd ::= create_vtab */
142993143391
{sqlite3VtabFinishParse(pParse,0);}
142994143392
break;
142995
- case 262: /* cmd ::= create_vtab LP vtabarglist RP */
143393
+ case 265: /* cmd ::= create_vtab LP vtabarglist RP */
142996143394
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
142997143395
break;
142998
- case 263: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
143396
+ case 266: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
142999143397
{
143000143398
sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy4);
143001143399
}
143002143400
break;
143003
- case 264: /* vtabarg ::= */
143401
+ case 267: /* vtabarg ::= */
143004143402
{sqlite3VtabArgInit(pParse);}
143005143403
break;
143006
- case 265: /* vtabargtoken ::= ANY */
143007
- case 266: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==266);
143008
- case 267: /* lp ::= LP */ yytestcase(yyruleno==267);
143404
+ case 268: /* vtabargtoken ::= ANY */
143405
+ case 269: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==269);
143406
+ case 270: /* lp ::= LP */ yytestcase(yyruleno==270);
143009143407
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
143010143408
break;
143011
- case 268: /* with ::= */
143012
-{yymsp[1].minor.yy451 = 0;}
143013
- break;
143014
- case 269: /* with ::= WITH wqlist */
143015
-{ yymsp[-1].minor.yy451 = yymsp[0].minor.yy451; }
143016
- break;
143017
- case 270: /* with ::= WITH RECURSIVE wqlist */
143018
-{ yymsp[-2].minor.yy451 = yymsp[0].minor.yy451; }
143019
- break;
143020
- case 271: /* wqlist ::= nm eidlist_opt AS LP select RP */
143409
+ case 271: /* with ::= WITH wqlist */
143410
+ case 272: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==272);
143411
+{ sqlite3WithPush(pParse, yymsp[0].minor.yy451, 1); }
143412
+ break;
143413
+ case 273: /* wqlist ::= nm eidlist_opt AS LP select RP */
143021143414
{
143022143415
yymsp[-5].minor.yy451 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy322, yymsp[-1].minor.yy387); /*A-overwrites-X*/
143023143416
}
143024143417
break;
143025
- case 272: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
143418
+ case 274: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
143026143419
{
143027143420
yymsp[-7].minor.yy451 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy451, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy322, yymsp[-1].minor.yy387);
143028143421
}
143029143422
break;
143030143423
default:
143031
- /* (273) input ::= cmdlist */ yytestcase(yyruleno==273);
143032
- /* (274) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==274);
143033
- /* (275) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=275);
143034
- /* (276) ecmd ::= SEMI */ yytestcase(yyruleno==276);
143035
- /* (277) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==277);
143036
- /* (278) explain ::= */ yytestcase(yyruleno==278);
143037
- /* (279) trans_opt ::= */ yytestcase(yyruleno==279);
143038
- /* (280) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==280);
143039
- /* (281) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==281);
143040
- /* (282) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==282);
143041
- /* (283) savepoint_opt ::= */ yytestcase(yyruleno==283);
143042
- /* (284) cmd ::= create_table create_table_args */ yytestcase(yyruleno==284);
143043
- /* (285) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==285);
143044
- /* (286) columnlist ::= columnname carglist */ yytestcase(yyruleno==286);
143045
- /* (287) nm ::= ID|INDEXED */ yytestcase(yyruleno==287);
143046
- /* (288) nm ::= STRING */ yytestcase(yyruleno==288);
143047
- /* (289) nm ::= JOIN_KW */ yytestcase(yyruleno==289);
143048
- /* (290) typetoken ::= typename */ yytestcase(yyruleno==290);
143049
- /* (291) typename ::= ID|STRING */ yytestcase(yyruleno==291);
143050
- /* (292) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=292);
143051
- /* (293) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=293);
143052
- /* (294) carglist ::= carglist ccons */ yytestcase(yyruleno==294);
143053
- /* (295) carglist ::= */ yytestcase(yyruleno==295);
143054
- /* (296) ccons ::= NULL onconf */ yytestcase(yyruleno==296);
143055
- /* (297) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==297);
143056
- /* (298) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==298);
143057
- /* (299) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=299);
143058
- /* (300) tconscomma ::= */ yytestcase(yyruleno==300);
143059
- /* (301) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=301);
143060
- /* (302) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=302);
143061
- /* (303) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=303);
143062
- /* (304) oneselect ::= values */ yytestcase(yyruleno==304);
143063
- /* (305) sclp ::= selcollist COMMA */ yytestcase(yyruleno==305);
143064
- /* (306) as ::= ID|STRING */ yytestcase(yyruleno==306);
143065
- /* (307) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=307);
143066
- /* (308) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==308);
143067
- /* (309) exprlist ::= nexprlist */ yytestcase(yyruleno==309);
143068
- /* (310) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=310);
143069
- /* (311) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=311);
143070
- /* (312) nmnum ::= ON */ yytestcase(yyruleno==312);
143071
- /* (313) nmnum ::= DELETE */ yytestcase(yyruleno==313);
143072
- /* (314) nmnum ::= DEFAULT */ yytestcase(yyruleno==314);
143073
- /* (315) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==315);
143074
- /* (316) foreach_clause ::= */ yytestcase(yyruleno==316);
143075
- /* (317) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==317);
143076
- /* (318) trnm ::= nm */ yytestcase(yyruleno==318);
143077
- /* (319) tridxby ::= */ yytestcase(yyruleno==319);
143078
- /* (320) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==320);
143079
- /* (321) database_kw_opt ::= */ yytestcase(yyruleno==321);
143080
- /* (322) kwcolumn_opt ::= */ yytestcase(yyruleno==322);
143081
- /* (323) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==323);
143082
- /* (324) vtabarglist ::= vtabarg */ yytestcase(yyruleno==324);
143083
- /* (325) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==325);
143084
- /* (326) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==326);
143085
- /* (327) anylist ::= */ yytestcase(yyruleno==327);
143086
- /* (328) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==328);
143087
- /* (329) anylist ::= anylist ANY */ yytestcase(yyruleno==329);
143424
+ /* (275) input ::= cmdlist */ yytestcase(yyruleno==275);
143425
+ /* (276) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==276);
143426
+ /* (277) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=277);
143427
+ /* (278) ecmd ::= SEMI */ yytestcase(yyruleno==278);
143428
+ /* (279) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==279);
143429
+ /* (280) explain ::= */ yytestcase(yyruleno==280);
143430
+ /* (281) trans_opt ::= */ yytestcase(yyruleno==281);
143431
+ /* (282) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==282);
143432
+ /* (283) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==283);
143433
+ /* (284) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==284);
143434
+ /* (285) savepoint_opt ::= */ yytestcase(yyruleno==285);
143435
+ /* (286) cmd ::= create_table create_table_args */ yytestcase(yyruleno==286);
143436
+ /* (287) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==287);
143437
+ /* (288) columnlist ::= columnname carglist */ yytestcase(yyruleno==288);
143438
+ /* (289) nm ::= ID|INDEXED */ yytestcase(yyruleno==289);
143439
+ /* (290) nm ::= STRING */ yytestcase(yyruleno==290);
143440
+ /* (291) nm ::= JOIN_KW */ yytestcase(yyruleno==291);
143441
+ /* (292) typetoken ::= typename */ yytestcase(yyruleno==292);
143442
+ /* (293) typename ::= ID|STRING */ yytestcase(yyruleno==293);
143443
+ /* (294) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=294);
143444
+ /* (295) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=295);
143445
+ /* (296) carglist ::= carglist ccons */ yytestcase(yyruleno==296);
143446
+ /* (297) carglist ::= */ yytestcase(yyruleno==297);
143447
+ /* (298) ccons ::= NULL onconf */ yytestcase(yyruleno==298);
143448
+ /* (299) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==299);
143449
+ /* (300) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==300);
143450
+ /* (301) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=301);
143451
+ /* (302) tconscomma ::= */ yytestcase(yyruleno==302);
143452
+ /* (303) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=303);
143453
+ /* (304) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=304);
143454
+ /* (305) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=305);
143455
+ /* (306) oneselect ::= values */ yytestcase(yyruleno==306);
143456
+ /* (307) sclp ::= selcollist COMMA */ yytestcase(yyruleno==307);
143457
+ /* (308) as ::= ID|STRING */ yytestcase(yyruleno==308);
143458
+ /* (309) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=309);
143459
+ /* (310) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==310);
143460
+ /* (311) exprlist ::= nexprlist */ yytestcase(yyruleno==311);
143461
+ /* (312) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=312);
143462
+ /* (313) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=313);
143463
+ /* (314) nmnum ::= ON */ yytestcase(yyruleno==314);
143464
+ /* (315) nmnum ::= DELETE */ yytestcase(yyruleno==315);
143465
+ /* (316) nmnum ::= DEFAULT */ yytestcase(yyruleno==316);
143466
+ /* (317) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==317);
143467
+ /* (318) foreach_clause ::= */ yytestcase(yyruleno==318);
143468
+ /* (319) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==319);
143469
+ /* (320) trnm ::= nm */ yytestcase(yyruleno==320);
143470
+ /* (321) tridxby ::= */ yytestcase(yyruleno==321);
143471
+ /* (322) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==322);
143472
+ /* (323) database_kw_opt ::= */ yytestcase(yyruleno==323);
143473
+ /* (324) kwcolumn_opt ::= */ yytestcase(yyruleno==324);
143474
+ /* (325) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==325);
143475
+ /* (326) vtabarglist ::= vtabarg */ yytestcase(yyruleno==326);
143476
+ /* (327) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==327);
143477
+ /* (328) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==328);
143478
+ /* (329) anylist ::= */ yytestcase(yyruleno==329);
143479
+ /* (330) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==330);
143480
+ /* (331) anylist ::= anylist ANY */ yytestcase(yyruleno==331);
143481
+ /* (332) with ::= */ yytestcase(yyruleno==332);
143088143482
break;
143089143483
/********** End reduce actions ************************************************/
143090143484
};
143091143485
assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
143092143486
yygoto = yyRuleInfo[yyruleno].lhs;
@@ -146146,43 +146540,65 @@
146146146540
/*
146147146541
** This routine implements a busy callback that sleeps and tries
146148146542
** again until a timeout value is reached. The timeout value is
146149146543
** an integer number of milliseconds passed in as the first
146150146544
** argument.
146545
+**
146546
+** Return non-zero to retry the lock. Return zero to stop trying
146547
+** and cause SQLite to return SQLITE_BUSY.
146151146548
*/
146152146549
static int sqliteDefaultBusyCallback(
146153
- void *ptr, /* Database connection */
146154
- int count /* Number of times table has been busy */
146550
+ void *ptr, /* Database connection */
146551
+ int count, /* Number of times table has been busy */
146552
+ sqlite3_file *pFile /* The file on which the lock occurred */
146155146553
){
146156146554
#if SQLITE_OS_WIN || HAVE_USLEEP
146555
+ /* This case is for systems that have support for sleeping for fractions of
146556
+ ** a second. Examples: All windows systems, unix systems with usleep() */
146157146557
static const u8 delays[] =
146158146558
{ 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 };
146159146559
static const u8 totals[] =
146160146560
{ 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 };
146161146561
# define NDELAY ArraySize(delays)
146162146562
sqlite3 *db = (sqlite3 *)ptr;
146163
- int timeout = db->busyTimeout;
146563
+ int tmout = db->busyTimeout;
146164146564
int delay, prior;
146165146565
146566
+#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
146567
+ if( sqlite3OsFileControl(pFile,SQLITE_FCNTL_LOCK_TIMEOUT,&tmout)==SQLITE_OK ){
146568
+ if( count ){
146569
+ tmout = 0;
146570
+ sqlite3OsFileControl(pFile, SQLITE_FCNTL_LOCK_TIMEOUT, &tmout);
146571
+ return 0;
146572
+ }else{
146573
+ return 1;
146574
+ }
146575
+ }
146576
+#else
146577
+ UNUSED_PARAMETER(pFile);
146578
+#endif
146166146579
assert( count>=0 );
146167146580
if( count < NDELAY ){
146168146581
delay = delays[count];
146169146582
prior = totals[count];
146170146583
}else{
146171146584
delay = delays[NDELAY-1];
146172146585
prior = totals[NDELAY-1] + delay*(count-(NDELAY-1));
146173146586
}
146174
- if( prior + delay > timeout ){
146175
- delay = timeout - prior;
146587
+ if( prior + delay > tmout ){
146588
+ delay = tmout - prior;
146176146589
if( delay<=0 ) return 0;
146177146590
}
146178146591
sqlite3OsSleep(db->pVfs, delay*1000);
146179146592
return 1;
146180146593
#else
146594
+ /* This case for unix systems that lack usleep() support. Sleeping
146595
+ ** must be done in increments of whole seconds */
146181146596
sqlite3 *db = (sqlite3 *)ptr;
146182
- int timeout = ((sqlite3 *)ptr)->busyTimeout;
146183
- if( (count+1)*1000 > timeout ){
146597
+ int tmout = ((sqlite3 *)ptr)->busyTimeout;
146598
+ UNUSED_PARAMETER(pFile);
146599
+ if( (count+1)*1000 > tmout ){
146184146600
return 0;
146185146601
}
146186146602
sqlite3OsSleep(db->pVfs, 1000000);
146187146603
return 1;
146188146604
#endif
@@ -146189,18 +146605,29 @@
146189146605
}
146190146606
146191146607
/*
146192146608
** Invoke the given busy handler.
146193146609
**
146194
-** This routine is called when an operation failed with a lock.
146610
+** This routine is called when an operation failed to acquire a
146611
+** lock on VFS file pFile.
146612
+**
146195146613
** If this routine returns non-zero, the lock is retried. If it
146196146614
** returns 0, the operation aborts with an SQLITE_BUSY error.
146197146615
*/
146198
-SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p){
146616
+SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p, sqlite3_file *pFile){
146199146617
int rc;
146200
- if( NEVER(p==0) || p->xFunc==0 || p->nBusy<0 ) return 0;
146201
- rc = p->xFunc(p->pArg, p->nBusy);
146618
+ if( p->xBusyHandler==0 || p->nBusy<0 ) return 0;
146619
+ if( p->bExtraFileArg ){
146620
+ /* Add an extra parameter with the pFile pointer to the end of the
146621
+ ** callback argument list */
146622
+ int (*xTra)(void*,int,sqlite3_file*);
146623
+ xTra = (int(*)(void*,int,sqlite3_file*))p->xBusyHandler;
146624
+ rc = xTra(p->pBusyArg, p->nBusy, pFile);
146625
+ }else{
146626
+ /* Legacy style busy handler callback */
146627
+ rc = p->xBusyHandler(p->pBusyArg, p->nBusy);
146628
+ }
146202146629
if( rc==0 ){
146203146630
p->nBusy = -1;
146204146631
}else{
146205146632
p->nBusy++;
146206146633
}
@@ -146218,13 +146645,14 @@
146218146645
){
146219146646
#ifdef SQLITE_ENABLE_API_ARMOR
146220146647
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
146221146648
#endif
146222146649
sqlite3_mutex_enter(db->mutex);
146223
- db->busyHandler.xFunc = xBusy;
146224
- db->busyHandler.pArg = pArg;
146650
+ db->busyHandler.xBusyHandler = xBusy;
146651
+ db->busyHandler.pBusyArg = pArg;
146225146652
db->busyHandler.nBusy = 0;
146653
+ db->busyHandler.bExtraFileArg = 0;
146226146654
db->busyTimeout = 0;
146227146655
sqlite3_mutex_leave(db->mutex);
146228146656
return SQLITE_OK;
146229146657
}
146230146658
@@ -146268,12 +146696,14 @@
146268146696
SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms){
146269146697
#ifdef SQLITE_ENABLE_API_ARMOR
146270146698
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
146271146699
#endif
146272146700
if( ms>0 ){
146273
- sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
146701
+ sqlite3_busy_handler(db, (int(*)(void*,int))sqliteDefaultBusyCallback,
146702
+ (void*)db);
146274146703
db->busyTimeout = ms;
146704
+ db->busyHandler.bExtraFileArg = 1;
146275146705
}else{
146276146706
sqlite3_busy_handler(db, 0, 0);
146277146707
}
146278146708
return SQLITE_OK;
146279146709
}
@@ -148262,14 +148692,12 @@
148262148692
*(sqlite3_vfs**)pArg = sqlite3PagerVfs(pPager);
148263148693
rc = SQLITE_OK;
148264148694
}else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){
148265148695
*(sqlite3_file**)pArg = sqlite3PagerJrnlFile(pPager);
148266148696
rc = SQLITE_OK;
148267
- }else if( fd->pMethods ){
148697
+ }else{
148268148698
rc = sqlite3OsFileControl(fd, op, pArg);
148269
- }else{
148270
- rc = SQLITE_NOTFOUND;
148271148699
}
148272148700
sqlite3BtreeLeave(pBtree);
148273148701
}
148274148702
sqlite3_mutex_leave(db->mutex);
148275148703
return rc;
@@ -179336,11 +179764,11 @@
179336179764
/* If connected to a ZIPVFS backend, override the page size and
179337179765
** offset with actual values obtained from ZIPVFS.
179338179766
*/
179339179767
fd = sqlite3PagerFile(pPager);
179340179768
x[0] = pCsr->iPageno;
179341
- if( fd->pMethods!=0 && sqlite3OsFileControl(fd, 230440, &x)==SQLITE_OK ){
179769
+ if( sqlite3OsFileControl(fd, 230440, &x)==SQLITE_OK ){
179342179770
pCsr->iOffset = x[0];
179343179771
pCsr->szPage = (int)x[1];
179344179772
}
179345179773
}
179346179774
@@ -180102,11 +180530,11 @@
180102180530
** input data. Input data may be supplied either as a single large buffer
180103180531
** (e.g. sqlite3changeset_start()) or using a stream function (e.g.
180104180532
** sqlite3changeset_start_strm()).
180105180533
*/
180106180534
struct SessionInput {
180107
- int bNoDiscard; /* If true, discard no data */
180535
+ int bNoDiscard; /* If true, do not discard in InputBuffer() */
180108180536
int iCurrent; /* Offset in aData[] of current change */
180109180537
int iNext; /* Offset in aData[] of next change */
180110180538
u8 *aData; /* Pointer to buffer containing changeset */
180111180539
int nData; /* Number of bytes in aData */
180112180540
@@ -180266,12 +180694,12 @@
180266180694
** of a patchset change is associated with the correspondingly positioned
180267180695
** table column, counting from left to right within the CREATE TABLE
180268180696
** statement.
180269180697
**
180270180698
** For a DELETE change, all fields within the record except those associated
180271
-** with PRIMARY KEY columns are set to "undefined". The PRIMARY KEY fields
180272
-** contain the values identifying the row to delete.
180699
+** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the
180700
+** values identifying the row to delete.
180273180701
**
180274180702
** For an UPDATE change, all fields except those associated with PRIMARY KEY
180275180703
** columns and columns that are modified by the UPDATE are set to "undefined".
180276180704
** PRIMARY KEY fields contain the values identifying the table row to update,
180277180705
** and fields associated with modified columns contain the new column values.
@@ -180550,11 +180978,11 @@
180550180978
** the type byte).
180551180979
*/
180552180980
static int sessionSerialLen(u8 *a){
180553180981
int e = *a;
180554180982
int n;
180555
- if( e==0 ) return 1;
180983
+ if( e==0 || e==0xFF ) return 1;
180556180984
if( e==SQLITE_NULL ) return 1;
180557180985
if( e==SQLITE_INTEGER || e==SQLITE_FLOAT ) return 9;
180558180986
return sessionVarintGet(&a[1], &n) + 1 + n;
180559180987
}
180560180988
@@ -180630,11 +181058,11 @@
180630181058
for(iCol=0; iCol<pTab->nCol; iCol++){
180631181059
if( pTab->abPK[iCol] ){
180632181060
int n1 = sessionSerialLen(a1);
180633181061
int n2 = sessionSerialLen(a2);
180634181062
180635
- if( pTab->abPK[iCol] && (n1!=n2 || memcmp(a1, a2, n1)) ){
181063
+ if( n1!=n2 || memcmp(a1, a2, n1) ){
180636181064
return 0;
180637181065
}
180638181066
a1 += n1;
180639181067
a2 += n2;
180640181068
}else{
@@ -180873,11 +181301,11 @@
180873181301
if( eType==SQLITE_TEXT ){
180874181302
z = sqlite3_value_text(pVal);
180875181303
}else{
180876181304
z = sqlite3_value_blob(pVal);
180877181305
}
180878
- if( memcmp(a, z, n) ) return 0;
181306
+ if( n>0 && memcmp(a, z, n) ) return 0;
180879181307
a += n;
180880181308
}
180881181309
}
180882181310
}
180883181311
@@ -182217,10 +182645,11 @@
182217182645
if( 0==sqlite3_stricmp("sqlite_stat1", zTab) ){
182218182646
zSql = sqlite3_mprintf(
182219182647
"SELECT tbl, ?2, stat FROM %Q.sqlite_stat1 WHERE tbl IS ?1 AND "
182220182648
"idx IS (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)", zDb
182221182649
);
182650
+ if( zSql==0 ) rc = SQLITE_NOMEM;
182222182651
}else{
182223182652
int i;
182224182653
const char *zSep = "";
182225182654
SessionBuffer buf = {0, 0, 0};
182226182655
@@ -182626,11 +183055,11 @@
182626183055
/*
182627183056
** If the SessionInput object passed as the only argument is a streaming
182628183057
** object and the buffer is full, discard some data to free up space.
182629183058
*/
182630183059
static void sessionDiscardData(SessionInput *pIn){
182631
- if( pIn->bEof && pIn->xInput && pIn->iNext>=SESSIONS_STRM_CHUNK_SIZE ){
183060
+ if( pIn->xInput && pIn->iNext>=SESSIONS_STRM_CHUNK_SIZE ){
182632183061
int nMove = pIn->buf.nBuf - pIn->iNext;
182633183062
assert( nMove>=0 );
182634183063
if( nMove>0 ){
182635183064
memmove(pIn->buf.aBuf, &pIn->buf.aBuf[pIn->iNext], nMove);
182636183065
}
@@ -182952,11 +183381,12 @@
182952183381
** changes in the changeset.
182953183382
*/
182954183383
static int sessionChangesetNext(
182955183384
sqlite3_changeset_iter *p, /* Changeset iterator */
182956183385
u8 **paRec, /* If non-NULL, store record pointer here */
182957
- int *pnRec /* If non-NULL, store size of record here */
183386
+ int *pnRec, /* If non-NULL, store size of record here */
183387
+ int *pbNew /* If non-NULL, true if new table */
182958183388
){
182959183389
int i;
182960183390
u8 op;
182961183391
182962183392
assert( (paRec==0 && pnRec==0) || (paRec && pnRec) );
@@ -182987,10 +183417,11 @@
182987183417
sessionDiscardData(&p->in);
182988183418
p->in.iCurrent = p->in.iNext;
182989183419
182990183420
op = p->in.aData[p->in.iNext++];
182991183421
while( op=='T' || op=='P' ){
183422
+ if( pbNew ) *pbNew = 1;
182992183423
p->bPatchset = (op=='P');
182993183424
if( sessionChangesetReadTblhdr(p) ) return p->rc;
182994183425
if( (p->rc = sessionInputBuffer(&p->in, 2)) ) return p->rc;
182995183426
p->in.iCurrent = p->in.iNext;
182996183427
if( p->in.iNext>=p->in.nData ) return SQLITE_DONE;
@@ -183065,11 +183496,11 @@
183065183496
**
183066183497
** This function may not be called on iterators passed to a conflict handler
183067183498
** callback by changeset_apply().
183068183499
*/
183069183500
SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *p){
183070
- return sessionChangesetNext(p, 0, 0);
183501
+ return sessionChangesetNext(p, 0, 0, 0);
183071183502
}
183072183503
183073183504
/*
183074183505
** The following function extracts information on the current change
183075183506
** from a changeset iterator. It may only be called after changeset_next()
@@ -183444,10 +183875,12 @@
183444183875
const char **azCol; /* Array of column names */
183445183876
u8 *abPK; /* Boolean array - true if column is in PK */
183446183877
int bStat1; /* True if table is sqlite_stat1 */
183447183878
int bDeferConstraints; /* True to defer constraints */
183448183879
SessionBuffer constraints; /* Deferred constraints are stored here */
183880
+ SessionBuffer rebase; /* Rebase information (if any) here */
183881
+ int bRebaseStarted; /* If table header is already in rebase */
183449183882
};
183450183883
183451183884
/*
183452183885
** Formulate a statement to DELETE a row from database db. Assuming a table
183453183886
** structure like this:
@@ -183710,11 +184143,10 @@
183710184143
"DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS "
183711184144
"CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END "
183712184145
"AND (?4 OR stat IS ?3)"
183713184146
);
183714184147
}
183715
- assert( rc==SQLITE_OK );
183716184148
return rc;
183717184149
}
183718184150
183719184151
/*
183720184152
** A wrapper around sqlite3_bind_value() that detects an extra problem.
@@ -183824,10 +184256,58 @@
183824184256
if( rc!=SQLITE_ROW ) rc = sqlite3_reset(pSelect);
183825184257
}
183826184258
183827184259
return rc;
183828184260
}
184261
+
184262
+/*
184263
+** This function is called from within sqlite3changset_apply_v2() when
184264
+** a conflict is encountered and resolved using conflict resolution
184265
+** mode eType (either SQLITE_CHANGESET_OMIT or SQLITE_CHANGESET_REPLACE)..
184266
+** It adds a conflict resolution record to the buffer in
184267
+** SessionApplyCtx.rebase, which will eventually be returned to the caller
184268
+** of apply_v2() as the "rebase" buffer.
184269
+**
184270
+** Return SQLITE_OK if successful, or an SQLite error code otherwise.
184271
+*/
184272
+static int sessionRebaseAdd(
184273
+ SessionApplyCtx *p, /* Apply context */
184274
+ int eType, /* Conflict resolution (OMIT or REPLACE) */
184275
+ sqlite3_changeset_iter *pIter /* Iterator pointing at current change */
184276
+){
184277
+ int rc = SQLITE_OK;
184278
+ int i;
184279
+ int eOp = pIter->op;
184280
+ if( p->bRebaseStarted==0 ){
184281
+ /* Append a table-header to the rebase buffer */
184282
+ const char *zTab = pIter->zTab;
184283
+ sessionAppendByte(&p->rebase, 'T', &rc);
184284
+ sessionAppendVarint(&p->rebase, p->nCol, &rc);
184285
+ sessionAppendBlob(&p->rebase, p->abPK, p->nCol, &rc);
184286
+ sessionAppendBlob(&p->rebase, (u8*)zTab, (int)strlen(zTab)+1, &rc);
184287
+ p->bRebaseStarted = 1;
184288
+ }
184289
+
184290
+ assert( eType==SQLITE_CHANGESET_REPLACE||eType==SQLITE_CHANGESET_OMIT );
184291
+ assert( eOp==SQLITE_DELETE || eOp==SQLITE_INSERT || eOp==SQLITE_UPDATE );
184292
+
184293
+ sessionAppendByte(&p->rebase,
184294
+ (eOp==SQLITE_DELETE ? SQLITE_DELETE : SQLITE_INSERT), &rc
184295
+ );
184296
+ sessionAppendByte(&p->rebase, (eType==SQLITE_CHANGESET_REPLACE), &rc);
184297
+ for(i=0; i<p->nCol; i++){
184298
+ sqlite3_value *pVal = 0;
184299
+ if( eOp==SQLITE_DELETE || (eOp==SQLITE_UPDATE && p->abPK[i]) ){
184300
+ sqlite3changeset_old(pIter, i, &pVal);
184301
+ }else{
184302
+ sqlite3changeset_new(pIter, i, &pVal);
184303
+ }
184304
+ sessionAppendValue(&p->rebase, pVal, &rc);
184305
+ }
184306
+
184307
+ return rc;
184308
+}
183829184309
183830184310
/*
183831184311
** Invoke the conflict handler for the change that the changeset iterator
183832184312
** currently points to.
183833184313
**
@@ -183900,11 +184380,11 @@
183900184380
/* Instead of invoking the conflict handler, append the change blob
183901184381
** to the SessionApplyCtx.constraints buffer. */
183902184382
u8 *aBlob = &pIter->in.aData[pIter->in.iCurrent];
183903184383
int nBlob = pIter->in.iNext - pIter->in.iCurrent;
183904184384
sessionAppendBlob(&p->constraints, aBlob, nBlob, &rc);
183905
- res = SQLITE_CHANGESET_OMIT;
184385
+ return SQLITE_OK;
183906184386
}else{
183907184387
/* No other row with the new.* primary key. */
183908184388
res = xConflict(pCtx, eType+1, pIter);
183909184389
if( res==SQLITE_CHANGESET_REPLACE ) rc = SQLITE_MISUSE;
183910184390
}
@@ -183926,10 +184406,13 @@
183926184406
183927184407
default:
183928184408
rc = SQLITE_MISUSE;
183929184409
break;
183930184410
}
184411
+ if( rc==SQLITE_OK ){
184412
+ rc = sessionRebaseAdd(p, res, pIter);
184413
+ }
183931184414
}
183932184415
183933184416
return rc;
183934184417
}
183935184418
@@ -184101,46 +184584,46 @@
184101184584
int bReplace = 0;
184102184585
int bRetry = 0;
184103184586
int rc;
184104184587
184105184588
rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, &bReplace, &bRetry);
184106
- assert( rc==SQLITE_OK || (bRetry==0 && bReplace==0) );
184107
-
184108
- /* If the bRetry flag is set, the change has not been applied due to an
184109
- ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and
184110
- ** a row with the correct PK is present in the db, but one or more other
184111
- ** fields do not contain the expected values) and the conflict handler
184112
- ** returned SQLITE_CHANGESET_REPLACE. In this case retry the operation,
184113
- ** but pass NULL as the final argument so that sessionApplyOneOp() ignores
184114
- ** the SQLITE_CHANGESET_DATA problem. */
184115
- if( bRetry ){
184116
- assert( pIter->op==SQLITE_UPDATE || pIter->op==SQLITE_DELETE );
184117
- rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0);
184118
- }
184119
-
184120
- /* If the bReplace flag is set, the change is an INSERT that has not
184121
- ** been performed because the database already contains a row with the
184122
- ** specified primary key and the conflict handler returned
184123
- ** SQLITE_CHANGESET_REPLACE. In this case remove the conflicting row
184124
- ** before reattempting the INSERT. */
184125
- else if( bReplace ){
184126
- assert( pIter->op==SQLITE_INSERT );
184127
- rc = sqlite3_exec(db, "SAVEPOINT replace_op", 0, 0, 0);
184128
- if( rc==SQLITE_OK ){
184129
- rc = sessionBindRow(pIter,
184130
- sqlite3changeset_new, pApply->nCol, pApply->abPK, pApply->pDelete);
184131
- sqlite3_bind_int(pApply->pDelete, pApply->nCol+1, 1);
184132
- }
184133
- if( rc==SQLITE_OK ){
184134
- sqlite3_step(pApply->pDelete);
184135
- rc = sqlite3_reset(pApply->pDelete);
184136
- }
184137
- if( rc==SQLITE_OK ){
184138
- rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0);
184139
- }
184140
- if( rc==SQLITE_OK ){
184141
- rc = sqlite3_exec(db, "RELEASE replace_op", 0, 0, 0);
184589
+ if( rc==SQLITE_OK ){
184590
+ /* If the bRetry flag is set, the change has not been applied due to an
184591
+ ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and
184592
+ ** a row with the correct PK is present in the db, but one or more other
184593
+ ** fields do not contain the expected values) and the conflict handler
184594
+ ** returned SQLITE_CHANGESET_REPLACE. In this case retry the operation,
184595
+ ** but pass NULL as the final argument so that sessionApplyOneOp() ignores
184596
+ ** the SQLITE_CHANGESET_DATA problem. */
184597
+ if( bRetry ){
184598
+ assert( pIter->op==SQLITE_UPDATE || pIter->op==SQLITE_DELETE );
184599
+ rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0);
184600
+ }
184601
+
184602
+ /* If the bReplace flag is set, the change is an INSERT that has not
184603
+ ** been performed because the database already contains a row with the
184604
+ ** specified primary key and the conflict handler returned
184605
+ ** SQLITE_CHANGESET_REPLACE. In this case remove the conflicting row
184606
+ ** before reattempting the INSERT. */
184607
+ else if( bReplace ){
184608
+ assert( pIter->op==SQLITE_INSERT );
184609
+ rc = sqlite3_exec(db, "SAVEPOINT replace_op", 0, 0, 0);
184610
+ if( rc==SQLITE_OK ){
184611
+ rc = sessionBindRow(pIter,
184612
+ sqlite3changeset_new, pApply->nCol, pApply->abPK, pApply->pDelete);
184613
+ sqlite3_bind_int(pApply->pDelete, pApply->nCol+1, 1);
184614
+ }
184615
+ if( rc==SQLITE_OK ){
184616
+ sqlite3_step(pApply->pDelete);
184617
+ rc = sqlite3_reset(pApply->pDelete);
184618
+ }
184619
+ if( rc==SQLITE_OK ){
184620
+ rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0);
184621
+ }
184622
+ if( rc==SQLITE_OK ){
184623
+ rc = sqlite3_exec(db, "RELEASE replace_op", 0, 0, 0);
184624
+ }
184142184625
}
184143184626
}
184144184627
184145184628
return rc;
184146184629
}
@@ -184212,14 +184695,16 @@
184212184695
int(*xConflict)(
184213184696
void *pCtx, /* Copy of fifth arg to _apply() */
184214184697
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184215184698
sqlite3_changeset_iter *p /* Handle describing change and conflict */
184216184699
),
184217
- void *pCtx /* First argument passed to xConflict */
184700
+ void *pCtx, /* First argument passed to xConflict */
184701
+ void **ppRebase, int *pnRebase, /* OUT: Rebase information */
184702
+ int flags /* SESSION_APPLY_XXX flags */
184218184703
){
184219184704
int schemaMismatch = 0;
184220
- int rc; /* Return code */
184705
+ int rc = SQLITE_OK; /* Return code */
184221184706
const char *zTab = 0; /* Name of current table */
184222184707
int nTab = 0; /* Result of sqlite3Strlen30(zTab) */
184223184708
SessionApplyCtx sApply; /* changeset_apply() context object */
184224184709
int bPatchset;
184225184710
@@ -184226,11 +184711,13 @@
184226184711
assert( xConflict!=0 );
184227184712
184228184713
pIter->in.bNoDiscard = 1;
184229184714
memset(&sApply, 0, sizeof(sApply));
184230184715
sqlite3_mutex_enter(sqlite3_db_mutex(db));
184231
- rc = sqlite3_exec(db, "SAVEPOINT changeset_apply", 0, 0, 0);
184716
+ if( (flags & SQLITE_CHANGESETAPPLY_NOSAVEPOINT)==0 ){
184717
+ rc = sqlite3_exec(db, "SAVEPOINT changeset_apply", 0, 0, 0);
184718
+ }
184232184719
if( rc==SQLITE_OK ){
184233184720
rc = sqlite3_exec(db, "PRAGMA defer_foreign_keys = 1", 0, 0, 0);
184234184721
}
184235184722
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3changeset_next(pIter) ){
184236184723
int nCol;
@@ -184250,13 +184737,22 @@
184250184737
sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */
184251184738
sqlite3_finalize(sApply.pDelete);
184252184739
sqlite3_finalize(sApply.pUpdate);
184253184740
sqlite3_finalize(sApply.pInsert);
184254184741
sqlite3_finalize(sApply.pSelect);
184255
- memset(&sApply, 0, sizeof(sApply));
184256184742
sApply.db = db;
184743
+ sApply.pDelete = 0;
184744
+ sApply.pUpdate = 0;
184745
+ sApply.pInsert = 0;
184746
+ sApply.pSelect = 0;
184747
+ sApply.nCol = 0;
184748
+ sApply.azCol = 0;
184749
+ sApply.abPK = 0;
184750
+ sApply.bStat1 = 0;
184257184751
sApply.bDeferConstraints = 1;
184752
+ sApply.bRebaseStarted = 0;
184753
+ memset(&sApply.constraints, 0, sizeof(SessionBuffer));
184258184754
184259184755
/* If an xFilter() callback was specified, invoke it now. If the
184260184756
** xFilter callback returns zero, skip this table. If it returns
184261184757
** non-zero, proceed. */
184262184758
schemaMismatch = (xFilter && (0==xFilter(pCtx, zNew)));
@@ -184355,26 +184851,65 @@
184355184851
}
184356184852
}
184357184853
}
184358184854
sqlite3_exec(db, "PRAGMA defer_foreign_keys = 0", 0, 0, 0);
184359184855
184360
- if( rc==SQLITE_OK ){
184361
- rc = sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0);
184362
- }else{
184363
- sqlite3_exec(db, "ROLLBACK TO changeset_apply", 0, 0, 0);
184364
- sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0);
184856
+ if( (flags & SQLITE_CHANGESETAPPLY_NOSAVEPOINT)==0 ){
184857
+ if( rc==SQLITE_OK ){
184858
+ rc = sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0);
184859
+ }else{
184860
+ sqlite3_exec(db, "ROLLBACK TO changeset_apply", 0, 0, 0);
184861
+ sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0);
184862
+ }
184365184863
}
184366184864
184865
+ if( rc==SQLITE_OK && bPatchset==0 && ppRebase && pnRebase ){
184866
+ *ppRebase = (void*)sApply.rebase.aBuf;
184867
+ *pnRebase = sApply.rebase.nBuf;
184868
+ sApply.rebase.aBuf = 0;
184869
+ }
184367184870
sqlite3_finalize(sApply.pInsert);
184368184871
sqlite3_finalize(sApply.pDelete);
184369184872
sqlite3_finalize(sApply.pUpdate);
184370184873
sqlite3_finalize(sApply.pSelect);
184371184874
sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */
184372184875
sqlite3_free((char*)sApply.constraints.aBuf);
184876
+ sqlite3_free((char*)sApply.rebase.aBuf);
184373184877
sqlite3_mutex_leave(sqlite3_db_mutex(db));
184374184878
return rc;
184375184879
}
184880
+
184881
+/*
184882
+** Apply the changeset passed via pChangeset/nChangeset to the main
184883
+** database attached to handle "db".
184884
+*/
184885
+SQLITE_API int sqlite3changeset_apply_v2(
184886
+ sqlite3 *db, /* Apply change to "main" db of this handle */
184887
+ int nChangeset, /* Size of changeset in bytes */
184888
+ void *pChangeset, /* Changeset blob */
184889
+ int(*xFilter)(
184890
+ void *pCtx, /* Copy of sixth arg to _apply() */
184891
+ const char *zTab /* Table name */
184892
+ ),
184893
+ int(*xConflict)(
184894
+ void *pCtx, /* Copy of sixth arg to _apply() */
184895
+ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184896
+ sqlite3_changeset_iter *p /* Handle describing change and conflict */
184897
+ ),
184898
+ void *pCtx, /* First argument passed to xConflict */
184899
+ void **ppRebase, int *pnRebase,
184900
+ int flags
184901
+){
184902
+ sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
184903
+ int rc = sqlite3changeset_start(&pIter, nChangeset, pChangeset);
184904
+ if( rc==SQLITE_OK ){
184905
+ rc = sessionChangesetApply(
184906
+ db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags
184907
+ );
184908
+ }
184909
+ return rc;
184910
+}
184376184911
184377184912
/*
184378184913
** Apply the changeset passed via pChangeset/nChangeset to the main database
184379184914
** attached to handle "db". Invoke the supplied conflict handler callback
184380184915
** to resolve any conflicts encountered while applying the change.
@@ -184392,23 +184927,46 @@
184392184927
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184393184928
sqlite3_changeset_iter *p /* Handle describing change and conflict */
184394184929
),
184395184930
void *pCtx /* First argument passed to xConflict */
184396184931
){
184397
- sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
184398
- int rc = sqlite3changeset_start(&pIter, nChangeset, pChangeset);
184399
- if( rc==SQLITE_OK ){
184400
- rc = sessionChangesetApply(db, pIter, xFilter, xConflict, pCtx);
184401
- }
184402
- return rc;
184932
+ return sqlite3changeset_apply_v2(
184933
+ db, nChangeset, pChangeset, xFilter, xConflict, pCtx, 0, 0, 0
184934
+ );
184403184935
}
184404184936
184405184937
/*
184406184938
** Apply the changeset passed via xInput/pIn to the main database
184407184939
** attached to handle "db". Invoke the supplied conflict handler callback
184408184940
** to resolve any conflicts encountered while applying the change.
184409184941
*/
184942
+SQLITE_API int sqlite3changeset_apply_v2_strm(
184943
+ sqlite3 *db, /* Apply change to "main" db of this handle */
184944
+ int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
184945
+ void *pIn, /* First arg for xInput */
184946
+ int(*xFilter)(
184947
+ void *pCtx, /* Copy of sixth arg to _apply() */
184948
+ const char *zTab /* Table name */
184949
+ ),
184950
+ int(*xConflict)(
184951
+ void *pCtx, /* Copy of sixth arg to _apply() */
184952
+ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184953
+ sqlite3_changeset_iter *p /* Handle describing change and conflict */
184954
+ ),
184955
+ void *pCtx, /* First argument passed to xConflict */
184956
+ void **ppRebase, int *pnRebase,
184957
+ int flags
184958
+){
184959
+ sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
184960
+ int rc = sqlite3changeset_start_strm(&pIter, xInput, pIn);
184961
+ if( rc==SQLITE_OK ){
184962
+ rc = sessionChangesetApply(
184963
+ db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags
184964
+ );
184965
+ }
184966
+ return rc;
184967
+}
184410184968
SQLITE_API int sqlite3changeset_apply_strm(
184411184969
sqlite3 *db, /* Apply change to "main" db of this handle */
184412184970
int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
184413184971
void *pIn, /* First arg for xInput */
184414184972
int(*xFilter)(
@@ -184420,16 +184978,13 @@
184420184978
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184421184979
sqlite3_changeset_iter *p /* Handle describing change and conflict */
184422184980
),
184423184981
void *pCtx /* First argument passed to xConflict */
184424184982
){
184425
- sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
184426
- int rc = sqlite3changeset_start_strm(&pIter, xInput, pIn);
184427
- if( rc==SQLITE_OK ){
184428
- rc = sessionChangesetApply(db, pIter, xFilter, xConflict, pCtx);
184429
- }
184430
- return rc;
184983
+ return sqlite3changeset_apply_v2_strm(
184984
+ db, xInput, pIn, xFilter, xConflict, pCtx, 0, 0, 0
184985
+ );
184431184986
}
184432184987
184433184988
/*
184434184989
** sqlite3_changegroup handle.
184435184990
*/
@@ -184444,31 +184999,90 @@
184444184999
** part of an sqlite3changeset_concat() operation. A new change object is
184445185000
** allocated and a pointer to it stored in *ppNew.
184446185001
*/
184447185002
static int sessionChangeMerge(
184448185003
SessionTable *pTab, /* Table structure */
185004
+ int bRebase, /* True for a rebase hash-table */
184449185005
int bPatchset, /* True for patchsets */
184450185006
SessionChange *pExist, /* Existing change */
184451185007
int op2, /* Second change operation */
184452185008
int bIndirect, /* True if second change is indirect */
184453185009
u8 *aRec, /* Second change record */
184454185010
int nRec, /* Number of bytes in aRec */
184455185011
SessionChange **ppNew /* OUT: Merged change */
184456185012
){
184457185013
SessionChange *pNew = 0;
185014
+ int rc = SQLITE_OK;
184458185015
184459185016
if( !pExist ){
184460185017
pNew = (SessionChange *)sqlite3_malloc(sizeof(SessionChange) + nRec);
184461185018
if( !pNew ){
184462185019
return SQLITE_NOMEM;
184463185020
}
184464185021
memset(pNew, 0, sizeof(SessionChange));
184465185022
pNew->op = op2;
184466185023
pNew->bIndirect = bIndirect;
184467
- pNew->nRecord = nRec;
184468185024
pNew->aRecord = (u8*)&pNew[1];
184469
- memcpy(pNew->aRecord, aRec, nRec);
185025
+ if( bIndirect==0 || bRebase==0 ){
185026
+ pNew->nRecord = nRec;
185027
+ memcpy(pNew->aRecord, aRec, nRec);
185028
+ }else{
185029
+ int i;
185030
+ u8 *pIn = aRec;
185031
+ u8 *pOut = pNew->aRecord;
185032
+ for(i=0; i<pTab->nCol; i++){
185033
+ int nIn = sessionSerialLen(pIn);
185034
+ if( *pIn==0 ){
185035
+ *pOut++ = 0;
185036
+ }else if( pTab->abPK[i]==0 ){
185037
+ *pOut++ = 0xFF;
185038
+ }else{
185039
+ memcpy(pOut, pIn, nIn);
185040
+ pOut += nIn;
185041
+ }
185042
+ pIn += nIn;
185043
+ }
185044
+ pNew->nRecord = pOut - pNew->aRecord;
185045
+ }
185046
+ }else if( bRebase ){
185047
+ if( pExist->op==SQLITE_DELETE && pExist->bIndirect ){
185048
+ *ppNew = pExist;
185049
+ }else{
185050
+ int nByte = nRec + pExist->nRecord + sizeof(SessionChange);
185051
+ pNew = (SessionChange*)sqlite3_malloc(nByte);
185052
+ if( pNew==0 ){
185053
+ rc = SQLITE_NOMEM;
185054
+ }else{
185055
+ int i;
185056
+ u8 *a1 = pExist->aRecord;
185057
+ u8 *a2 = aRec;
185058
+ u8 *pOut;
185059
+
185060
+ memset(pNew, 0, nByte);
185061
+ pNew->bIndirect = bIndirect || pExist->bIndirect;
185062
+ pNew->op = op2;
185063
+ pOut = pNew->aRecord = (u8*)&pNew[1];
185064
+
185065
+ for(i=0; i<pTab->nCol; i++){
185066
+ int n1 = sessionSerialLen(a1);
185067
+ int n2 = sessionSerialLen(a2);
185068
+ if( *a1==0xFF || (pTab->abPK[i]==0 && bIndirect) ){
185069
+ *pOut++ = 0xFF;
185070
+ }else if( *a2==0 ){
185071
+ memcpy(pOut, a1, n1);
185072
+ pOut += n1;
185073
+ }else{
185074
+ memcpy(pOut, a2, n2);
185075
+ pOut += n2;
185076
+ }
185077
+ a1 += n1;
185078
+ a2 += n2;
185079
+ }
185080
+ pNew->nRecord = pOut - pNew->aRecord;
185081
+ }
185082
+ sqlite3_free(pExist);
185083
+ }
184470185084
}else{
184471185085
int op1 = pExist->op;
184472185086
184473185087
/*
184474185088
** op1=INSERT, op2=INSERT -> Unsupported. Discard op2.
@@ -184558,28 +185172,28 @@
184558185172
sqlite3_free(pExist);
184559185173
}
184560185174
}
184561185175
184562185176
*ppNew = pNew;
184563
- return SQLITE_OK;
185177
+ return rc;
184564185178
}
184565185179
184566185180
/*
184567185181
** Add all changes in the changeset traversed by the iterator passed as
184568185182
** the first argument to the changegroup hash tables.
184569185183
*/
184570185184
static int sessionChangesetToHash(
184571185185
sqlite3_changeset_iter *pIter, /* Iterator to read from */
184572
- sqlite3_changegroup *pGrp /* Changegroup object to add changeset to */
185186
+ sqlite3_changegroup *pGrp, /* Changegroup object to add changeset to */
185187
+ int bRebase /* True if hash table is for rebasing */
184573185188
){
184574185189
u8 *aRec;
184575185190
int nRec;
184576185191
int rc = SQLITE_OK;
184577185192
SessionTable *pTab = 0;
184578185193
184579
-
184580
- while( SQLITE_ROW==sessionChangesetNext(pIter, &aRec, &nRec) ){
185194
+ while( SQLITE_ROW==sessionChangesetNext(pIter, &aRec, &nRec, 0) ){
184581185195
const char *zNew;
184582185196
int nCol;
184583185197
int op;
184584185198
int iHash;
184585185199
int bIndirect;
@@ -184655,11 +185269,11 @@
184655185269
pTab->nEntry--;
184656185270
break;
184657185271
}
184658185272
}
184659185273
184660
- rc = sessionChangeMerge(pTab,
185274
+ rc = sessionChangeMerge(pTab, bRebase,
184661185275
pIter->bPatchset, pExist, op, bIndirect, aRec, nRec, &pChange
184662185276
);
184663185277
if( rc ) break;
184664185278
if( pChange ){
184665185279
pChange->pNext = pTab->apChange[iHash];
@@ -184763,11 +185377,11 @@
184763185377
sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
184764185378
int rc; /* Return code */
184765185379
184766185380
rc = sqlite3changeset_start(&pIter, nData, pData);
184767185381
if( rc==SQLITE_OK ){
184768
- rc = sessionChangesetToHash(pIter, pGrp);
185382
+ rc = sessionChangesetToHash(pIter, pGrp, 0);
184769185383
}
184770185384
sqlite3changeset_finalize(pIter);
184771185385
return rc;
184772185386
}
184773185387
@@ -184794,11 +185408,11 @@
184794185408
sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
184795185409
int rc; /* Return code */
184796185410
184797185411
rc = sqlite3changeset_start_strm(&pIter, xInput, pIn);
184798185412
if( rc==SQLITE_OK ){
184799
- rc = sessionChangesetToHash(pIter, pGrp);
185413
+ rc = sessionChangesetToHash(pIter, pGrp, 0);
184800185414
}
184801185415
sqlite3changeset_finalize(pIter);
184802185416
return rc;
184803185417
}
184804185418
@@ -184878,10 +185492,353 @@
184878185492
}
184879185493
sqlite3changegroup_delete(pGrp);
184880185494
184881185495
return rc;
184882185496
}
185497
+
185498
+/*
185499
+** Changeset rebaser handle.
185500
+*/
185501
+struct sqlite3_rebaser {
185502
+ sqlite3_changegroup grp; /* Hash table */
185503
+};
185504
+
185505
+/*
185506
+** Buffers a1 and a2 must both contain a sessions module record nCol
185507
+** fields in size. This function appends an nCol sessions module
185508
+** record to buffer pBuf that is a copy of a1, except that for
185509
+** each field that is undefined in a1[], swap in the field from a2[].
185510
+*/
185511
+static void sessionAppendRecordMerge(
185512
+ SessionBuffer *pBuf, /* Buffer to append to */
185513
+ int nCol, /* Number of columns in each record */
185514
+ u8 *a1, int n1, /* Record 1 */
185515
+ u8 *a2, int n2, /* Record 2 */
185516
+ int *pRc /* IN/OUT: error code */
185517
+){
185518
+ sessionBufferGrow(pBuf, n1+n2, pRc);
185519
+ if( *pRc==SQLITE_OK ){
185520
+ int i;
185521
+ u8 *pOut = &pBuf->aBuf[pBuf->nBuf];
185522
+ for(i=0; i<nCol; i++){
185523
+ int nn1 = sessionSerialLen(a1);
185524
+ int nn2 = sessionSerialLen(a2);
185525
+ if( *a1==0 || *a1==0xFF ){
185526
+ memcpy(pOut, a2, nn2);
185527
+ pOut += nn2;
185528
+ }else{
185529
+ memcpy(pOut, a1, nn1);
185530
+ pOut += nn1;
185531
+ }
185532
+ a1 += nn1;
185533
+ a2 += nn2;
185534
+ }
185535
+
185536
+ pBuf->nBuf = pOut-pBuf->aBuf;
185537
+ assert( pBuf->nBuf<=pBuf->nAlloc );
185538
+ }
185539
+}
185540
+
185541
+/*
185542
+** This function is called when rebasing a local UPDATE change against one
185543
+** or more remote UPDATE changes. The aRec/nRec buffer contains the current
185544
+** old.* and new.* records for the change. The rebase buffer (a single
185545
+** record) is in aChange/nChange. The rebased change is appended to buffer
185546
+** pBuf.
185547
+**
185548
+** Rebasing the UPDATE involves:
185549
+**
185550
+** * Removing any changes to fields for which the corresponding field
185551
+** in the rebase buffer is set to "replaced" (type 0xFF). If this
185552
+** means the UPDATE change updates no fields, nothing is appended
185553
+** to the output buffer.
185554
+**
185555
+** * For each field modified by the local change for which the
185556
+** corresponding field in the rebase buffer is not "undefined" (0x00)
185557
+** or "replaced" (0xFF), the old.* value is replaced by the value
185558
+** in the rebase buffer.
185559
+*/
185560
+static void sessionAppendPartialUpdate(
185561
+ SessionBuffer *pBuf, /* Append record here */
185562
+ sqlite3_changeset_iter *pIter, /* Iterator pointed at local change */
185563
+ u8 *aRec, int nRec, /* Local change */
185564
+ u8 *aChange, int nChange, /* Record to rebase against */
185565
+ int *pRc /* IN/OUT: Return Code */
185566
+){
185567
+ sessionBufferGrow(pBuf, 2+nRec+nChange, pRc);
185568
+ if( *pRc==SQLITE_OK ){
185569
+ int bData = 0;
185570
+ u8 *pOut = &pBuf->aBuf[pBuf->nBuf];
185571
+ int i;
185572
+ u8 *a1 = aRec;
185573
+ u8 *a2 = aChange;
185574
+
185575
+ *pOut++ = SQLITE_UPDATE;
185576
+ *pOut++ = pIter->bIndirect;
185577
+ for(i=0; i<pIter->nCol; i++){
185578
+ int n1 = sessionSerialLen(a1);
185579
+ int n2 = sessionSerialLen(a2);
185580
+ if( pIter->abPK[i] || a2[0]==0 ){
185581
+ if( !pIter->abPK[i] ) bData = 1;
185582
+ memcpy(pOut, a1, n1);
185583
+ pOut += n1;
185584
+ }else if( a2[0]!=0xFF ){
185585
+ bData = 1;
185586
+ memcpy(pOut, a2, n2);
185587
+ pOut += n2;
185588
+ }else{
185589
+ *pOut++ = '\0';
185590
+ }
185591
+ a1 += n1;
185592
+ a2 += n2;
185593
+ }
185594
+ if( bData ){
185595
+ a2 = aChange;
185596
+ for(i=0; i<pIter->nCol; i++){
185597
+ int n1 = sessionSerialLen(a1);
185598
+ int n2 = sessionSerialLen(a2);
185599
+ if( pIter->abPK[i] || a2[0]!=0xFF ){
185600
+ memcpy(pOut, a1, n1);
185601
+ pOut += n1;
185602
+ }else{
185603
+ *pOut++ = '\0';
185604
+ }
185605
+ a1 += n1;
185606
+ a2 += n2;
185607
+ }
185608
+ pBuf->nBuf = (pOut - pBuf->aBuf);
185609
+ }
185610
+ }
185611
+}
185612
+
185613
+/*
185614
+** pIter is configured to iterate through a changeset. This function rebases
185615
+** that changeset according to the current configuration of the rebaser
185616
+** object passed as the first argument. If no error occurs and argument xOutput
185617
+** is not NULL, then the changeset is returned to the caller by invoking
185618
+** xOutput zero or more times and SQLITE_OK returned. Or, if xOutput is NULL,
185619
+** then (*ppOut) is set to point to a buffer containing the rebased changeset
185620
+** before this function returns. In this case (*pnOut) is set to the size of
185621
+** the buffer in bytes. It is the responsibility of the caller to eventually
185622
+** free the (*ppOut) buffer using sqlite3_free().
185623
+**
185624
+** If an error occurs, an SQLite error code is returned. If ppOut and
185625
+** pnOut are not NULL, then the two output parameters are set to 0 before
185626
+** returning.
185627
+*/
185628
+static int sessionRebase(
185629
+ sqlite3_rebaser *p, /* Rebaser hash table */
185630
+ sqlite3_changeset_iter *pIter, /* Input data */
185631
+ int (*xOutput)(void *pOut, const void *pData, int nData),
185632
+ void *pOut, /* Context for xOutput callback */
185633
+ int *pnOut, /* OUT: Number of bytes in output changeset */
185634
+ void **ppOut /* OUT: Inverse of pChangeset */
185635
+){
185636
+ int rc = SQLITE_OK;
185637
+ u8 *aRec = 0;
185638
+ int nRec = 0;
185639
+ int bNew = 0;
185640
+ SessionTable *pTab = 0;
185641
+ SessionBuffer sOut = {0,0,0};
185642
+
185643
+ while( SQLITE_ROW==sessionChangesetNext(pIter, &aRec, &nRec, &bNew) ){
185644
+ SessionChange *pChange = 0;
185645
+ int bDone = 0;
185646
+
185647
+ if( bNew ){
185648
+ const char *zTab = pIter->zTab;
185649
+ for(pTab=p->grp.pList; pTab; pTab=pTab->pNext){
185650
+ if( 0==sqlite3_stricmp(pTab->zName, zTab) ) break;
185651
+ }
185652
+ bNew = 0;
185653
+
185654
+ /* A patchset may not be rebased */
185655
+ if( pIter->bPatchset ){
185656
+ rc = SQLITE_ERROR;
185657
+ }
185658
+
185659
+ /* Append a table header to the output for this new table */
185660
+ sessionAppendByte(&sOut, pIter->bPatchset ? 'P' : 'T', &rc);
185661
+ sessionAppendVarint(&sOut, pIter->nCol, &rc);
185662
+ sessionAppendBlob(&sOut, pIter->abPK, pIter->nCol, &rc);
185663
+ sessionAppendBlob(&sOut,(u8*)pIter->zTab,(int)strlen(pIter->zTab)+1,&rc);
185664
+ }
185665
+
185666
+ if( pTab && rc==SQLITE_OK ){
185667
+ int iHash = sessionChangeHash(pTab, 0, aRec, pTab->nChange);
185668
+
185669
+ for(pChange=pTab->apChange[iHash]; pChange; pChange=pChange->pNext){
185670
+ if( sessionChangeEqual(pTab, 0, aRec, 0, pChange->aRecord) ){
185671
+ break;
185672
+ }
185673
+ }
185674
+ }
185675
+
185676
+ if( pChange ){
185677
+ assert( pChange->op==SQLITE_DELETE || pChange->op==SQLITE_INSERT );
185678
+ switch( pIter->op ){
185679
+ case SQLITE_INSERT:
185680
+ if( pChange->op==SQLITE_INSERT ){
185681
+ bDone = 1;
185682
+ if( pChange->bIndirect==0 ){
185683
+ sessionAppendByte(&sOut, SQLITE_UPDATE, &rc);
185684
+ sessionAppendByte(&sOut, pIter->bIndirect, &rc);
185685
+ sessionAppendBlob(&sOut, pChange->aRecord, pChange->nRecord, &rc);
185686
+ sessionAppendBlob(&sOut, aRec, nRec, &rc);
185687
+ }
185688
+ }
185689
+ break;
185690
+
185691
+ case SQLITE_UPDATE:
185692
+ bDone = 1;
185693
+ if( pChange->op==SQLITE_DELETE ){
185694
+ if( pChange->bIndirect==0 ){
185695
+ u8 *pCsr = aRec;
185696
+ sessionSkipRecord(&pCsr, pIter->nCol);
185697
+ sessionAppendByte(&sOut, SQLITE_INSERT, &rc);
185698
+ sessionAppendByte(&sOut, pIter->bIndirect, &rc);
185699
+ sessionAppendRecordMerge(&sOut, pIter->nCol,
185700
+ pCsr, nRec-(pCsr-aRec),
185701
+ pChange->aRecord, pChange->nRecord, &rc
185702
+ );
185703
+ }
185704
+ }else{
185705
+ sessionAppendPartialUpdate(&sOut, pIter,
185706
+ aRec, nRec, pChange->aRecord, pChange->nRecord, &rc
185707
+ );
185708
+ }
185709
+ break;
185710
+
185711
+ default:
185712
+ assert( pIter->op==SQLITE_DELETE );
185713
+ bDone = 1;
185714
+ if( pChange->op==SQLITE_INSERT ){
185715
+ sessionAppendByte(&sOut, SQLITE_DELETE, &rc);
185716
+ sessionAppendByte(&sOut, pIter->bIndirect, &rc);
185717
+ sessionAppendRecordMerge(&sOut, pIter->nCol,
185718
+ pChange->aRecord, pChange->nRecord, aRec, nRec, &rc
185719
+ );
185720
+ }
185721
+ break;
185722
+ }
185723
+ }
185724
+
185725
+ if( bDone==0 ){
185726
+ sessionAppendByte(&sOut, pIter->op, &rc);
185727
+ sessionAppendByte(&sOut, pIter->bIndirect, &rc);
185728
+ sessionAppendBlob(&sOut, aRec, nRec, &rc);
185729
+ }
185730
+ if( rc==SQLITE_OK && xOutput && sOut.nBuf>SESSIONS_STRM_CHUNK_SIZE ){
185731
+ rc = xOutput(pOut, sOut.aBuf, sOut.nBuf);
185732
+ sOut.nBuf = 0;
185733
+ }
185734
+ if( rc ) break;
185735
+ }
185736
+
185737
+ if( rc!=SQLITE_OK ){
185738
+ sqlite3_free(sOut.aBuf);
185739
+ memset(&sOut, 0, sizeof(sOut));
185740
+ }
185741
+
185742
+ if( rc==SQLITE_OK ){
185743
+ if( xOutput ){
185744
+ if( sOut.nBuf>0 ){
185745
+ rc = xOutput(pOut, sOut.aBuf, sOut.nBuf);
185746
+ }
185747
+ }else{
185748
+ *ppOut = (void*)sOut.aBuf;
185749
+ *pnOut = sOut.nBuf;
185750
+ sOut.aBuf = 0;
185751
+ }
185752
+ }
185753
+ sqlite3_free(sOut.aBuf);
185754
+ return rc;
185755
+}
185756
+
185757
+/*
185758
+** Create a new rebaser object.
185759
+*/
185760
+SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew){
185761
+ int rc = SQLITE_OK;
185762
+ sqlite3_rebaser *pNew;
185763
+
185764
+ pNew = sqlite3_malloc(sizeof(sqlite3_rebaser));
185765
+ if( pNew==0 ){
185766
+ rc = SQLITE_NOMEM;
185767
+ }else{
185768
+ memset(pNew, 0, sizeof(sqlite3_rebaser));
185769
+ }
185770
+ *ppNew = pNew;
185771
+ return rc;
185772
+}
185773
+
185774
+/*
185775
+** Call this one or more times to configure a rebaser.
185776
+*/
185777
+SQLITE_API int sqlite3rebaser_configure(
185778
+ sqlite3_rebaser *p,
185779
+ int nRebase, const void *pRebase
185780
+){
185781
+ sqlite3_changeset_iter *pIter = 0; /* Iterator opened on pData/nData */
185782
+ int rc; /* Return code */
185783
+ rc = sqlite3changeset_start(&pIter, nRebase, (void*)pRebase);
185784
+ if( rc==SQLITE_OK ){
185785
+ rc = sessionChangesetToHash(pIter, &p->grp, 1);
185786
+ }
185787
+ sqlite3changeset_finalize(pIter);
185788
+ return rc;
185789
+}
185790
+
185791
+/*
185792
+** Rebase a changeset according to current rebaser configuration
185793
+*/
185794
+SQLITE_API int sqlite3rebaser_rebase(
185795
+ sqlite3_rebaser *p,
185796
+ int nIn, const void *pIn,
185797
+ int *pnOut, void **ppOut
185798
+){
185799
+ sqlite3_changeset_iter *pIter = 0; /* Iterator to skip through input */
185800
+ int rc = sqlite3changeset_start(&pIter, nIn, (void*)pIn);
185801
+
185802
+ if( rc==SQLITE_OK ){
185803
+ rc = sessionRebase(p, pIter, 0, 0, pnOut, ppOut);
185804
+ sqlite3changeset_finalize(pIter);
185805
+ }
185806
+
185807
+ return rc;
185808
+}
185809
+
185810
+/*
185811
+** Rebase a changeset according to current rebaser configuration
185812
+*/
185813
+SQLITE_API int sqlite3rebaser_rebase_strm(
185814
+ sqlite3_rebaser *p,
185815
+ int (*xInput)(void *pIn, void *pData, int *pnData),
185816
+ void *pIn,
185817
+ int (*xOutput)(void *pOut, const void *pData, int nData),
185818
+ void *pOut
185819
+){
185820
+ sqlite3_changeset_iter *pIter = 0; /* Iterator to skip through input */
185821
+ int rc = sqlite3changeset_start_strm(&pIter, xInput, pIn);
185822
+
185823
+ if( rc==SQLITE_OK ){
185824
+ rc = sessionRebase(p, pIter, xOutput, pOut, 0, 0);
185825
+ sqlite3changeset_finalize(pIter);
185826
+ }
185827
+
185828
+ return rc;
185829
+}
185830
+
185831
+/*
185832
+** Destroy a rebaser object
185833
+*/
185834
+SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p){
185835
+ if( p ){
185836
+ sessionDeleteTable(p->grp.pList);
185837
+ sqlite3_free(p);
185838
+ }
185839
+}
184883185840
184884185841
#endif /* SQLITE_ENABLE_SESSION && SQLITE_ENABLE_PREUPDATE_HOOK */
184885185842
184886185843
/************** End of sqlite3session.c **************************************/
184887185844
/************** Begin file json1.c *******************************************/
@@ -202602,10 +203559,16 @@
202602203559
202603203560
int aColMap[3];
202604203561
aColMap[0] = -1;
202605203562
aColMap[1] = nCol;
202606203563
aColMap[2] = nCol+1;
203564
+
203565
+ assert( SQLITE_INDEX_CONSTRAINT_EQ<SQLITE_INDEX_CONSTRAINT_MATCH );
203566
+ assert( SQLITE_INDEX_CONSTRAINT_GT<SQLITE_INDEX_CONSTRAINT_MATCH );
203567
+ assert( SQLITE_INDEX_CONSTRAINT_LE<SQLITE_INDEX_CONSTRAINT_MATCH );
203568
+ assert( SQLITE_INDEX_CONSTRAINT_GE<SQLITE_INDEX_CONSTRAINT_MATCH );
203569
+ assert( SQLITE_INDEX_CONSTRAINT_LE<SQLITE_INDEX_CONSTRAINT_MATCH );
202607203570
202608203571
/* Set idxFlags flags for all WHERE clause terms that will be used. */
202609203572
for(i=0; i<pInfo->nConstraint; i++){
202610203573
struct sqlite3_index_constraint *p = &pInfo->aConstraint[i];
202611203574
int iCol = p->iColumn;
@@ -202621,15 +203584,15 @@
202621203584
/* As there exists an unusable MATCH constraint this is an
202622203585
** unusable plan. Set a prohibitively high cost. */
202623203586
pInfo->estimatedCost = 1e50;
202624203587
return SQLITE_OK;
202625203588
}
202626
- }else{
203589
+ }else if( p->op<=SQLITE_INDEX_CONSTRAINT_MATCH ){
202627203590
int j;
202628203591
for(j=1; j<ArraySize(aConstraint); j++){
202629203592
struct Constraint *pC = &aConstraint[j];
202630
- if( iCol==aColMap[pC->iCol] && p->op & pC->op && p->usable ){
203593
+ if( iCol==aColMap[pC->iCol] && (p->op & pC->op) && p->usable ){
202631203594
pC->iConsIndex = i;
202632203595
idxFlags |= pC->fts5op;
202633203596
}
202634203597
}
202635203598
}
@@ -204697,11 +205660,11 @@
204697205660
int nArg, /* Number of args */
204698205661
sqlite3_value **apUnused /* Function arguments */
204699205662
){
204700205663
assert( nArg==0 );
204701205664
UNUSED_PARAM2(nArg, apUnused);
204702
- sqlite3_result_text(pCtx, "fts5: 2018-03-22 17:13:44 eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27ef01", -1, SQLITE_TRANSIENT);
205665
+ sqlite3_result_text(pCtx, "fts5: 2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b", -1, SQLITE_TRANSIENT);
204703205666
}
204704205667
204705205668
static int fts5Init(sqlite3 *db){
204706205669
static const sqlite3_module fts5Mod = {
204707205670
/* iVersion */ 2,
@@ -208967,12 +209930,12 @@
208967209930
}
208968209931
#endif /* SQLITE_CORE */
208969209932
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
208970209933
208971209934
/************** End of stmt.c ************************************************/
208972
-#if __LINE__!=208972
209935
+#if __LINE__!=209935
208973209936
#undef SQLITE_SOURCE_ID
208974
-#define SQLITE_SOURCE_ID "2018-03-22 17:13:44 eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27alt2"
209937
+#define SQLITE_SOURCE_ID "2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd14alt2"
208975209938
#endif
208976209939
/* Return the source-id for this library */
208977209940
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
208978209941
/************************** End of sqlite3.c ******************************/
208979209942
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.23.0. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -1145,13 +1145,13 @@
1145 **
1146 ** See also: [sqlite3_libversion()],
1147 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1148 ** [sqlite_version()] and [sqlite_source_id()].
1149 */
1150 #define SQLITE_VERSION "3.23.0"
1151 #define SQLITE_VERSION_NUMBER 3023000
1152 #define SQLITE_SOURCE_ID "2018-03-22 17:13:44 eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27ef01"
1153
1154 /*
1155 ** CAPI3REF: Run-Time Library Version Numbers
1156 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1157 **
@@ -2086,10 +2086,16 @@
2086 ** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back.
2087 ** ^This file control takes the file descriptor out of batch write mode
2088 ** so that all subsequent write operations are independent.
2089 ** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without
2090 ** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE].
 
 
 
 
 
 
2091 ** </ul>
2092 */
2093 #define SQLITE_FCNTL_LOCKSTATE 1
2094 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
2095 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -2120,10 +2126,11 @@
2120 #define SQLITE_FCNTL_WIN32_GET_HANDLE 29
2121 #define SQLITE_FCNTL_PDB 30
2122 #define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31
2123 #define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32
2124 #define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33
 
2125
2126 /* deprecated names */
2127 #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
2128 #define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
2129 #define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -9833,11 +9840,11 @@
9833
9834 /*
9835 ** CAPI3REF: Deserialize a database
9836 **
9837 ** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the
9838 ** [database connection] D to disconnection from database S and then
9839 ** reopen S as an in-memory database based on the serialization contained
9840 ** in P. The serialized database P is N bytes in size. M is the size of
9841 ** the buffer P, which might be larger than N. If M is larger than N, and
9842 ** the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is
9843 ** permitted to add content to the in-memory database as long as the total
@@ -10974,23 +10981,22 @@
10974 SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*);
10975
10976 /*
10977 ** CAPI3REF: Apply A Changeset To A Database
10978 **
10979 ** Apply a changeset to a database. This function attempts to update the
10980 ** "main" database attached to handle db with the changes found in the
10981 ** changeset passed via the second and third arguments.
10982 **
10983 ** The fourth argument (xFilter) passed to this function is the "filter
10984 ** callback". If it is not NULL, then for each table affected by at least one
10985 ** change in the changeset, the filter callback is invoked with
10986 ** the table name as the second argument, and a copy of the context pointer
10987 ** passed as the sixth argument to this function as the first. If the "filter
10988 ** callback" returns zero, then no attempt is made to apply any changes to
10989 ** the table. Otherwise, if the return value is non-zero or the xFilter
10990 ** argument to this function is NULL, all changes related to the table are
10991 ** attempted.
10992 **
10993 ** For each table that is not excluded by the filter callback, this function
10994 ** tests that the target database contains a compatible table. A table is
10995 ** considered compatible if all of the following are true:
10996 **
@@ -11031,11 +11037,11 @@
11031 ** the documentation for the three
11032 ** [SQLITE_CHANGESET_OMIT|available return values] for details.
11033 **
11034 ** <dl>
11035 ** <dt>DELETE Changes<dd>
11036 ** For each DELETE change, this function checks if the target database
11037 ** contains a row with the same primary key value (or values) as the
11038 ** original row values stored in the changeset. If it does, and the values
11039 ** stored in all non-primary key columns also match the values stored in
11040 ** the changeset the row is deleted from the target database.
11041 **
@@ -11076,11 +11082,11 @@
11076 ** This includes the case where the INSERT operation is re-attempted because
11077 ** an earlier call to the conflict handler function returned
11078 ** [SQLITE_CHANGESET_REPLACE].
11079 **
11080 ** <dt>UPDATE Changes<dd>
11081 ** For each UPDATE change, this function checks if the target database
11082 ** contains a row with the same primary key value (or values) as the
11083 ** original row values stored in the changeset. If it does, and the values
11084 ** stored in all modified non-primary key columns also match the values
11085 ** stored in the changeset the row is updated within the target database.
11086 **
@@ -11107,15 +11113,32 @@
11107 ** It is safe to execute SQL statements, including those that write to the
11108 ** table that the callback related to, from within the xConflict callback.
11109 ** This can be used to further customize the applications conflict
11110 ** resolution strategy.
11111 **
11112 ** All changes made by this function are enclosed in a savepoint transaction.
11113 ** If any other error (aside from a constraint failure when attempting to
11114 ** write to the target database) occurs, then the savepoint transaction is
11115 ** rolled back, restoring the target database to its original state, and an
11116 ** SQLite error code returned.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11117 */
11118 SQLITE_API int sqlite3changeset_apply(
11119 sqlite3 *db, /* Apply change to "main" db of this handle */
11120 int nChangeset, /* Size of changeset in bytes */
11121 void *pChangeset, /* Changeset blob */
@@ -11128,10 +11151,45 @@
11128 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
11129 sqlite3_changeset_iter *p /* Handle describing change and conflict */
11130 ),
11131 void *pCtx /* First argument passed to xConflict */
11132 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11133
11134 /*
11135 ** CAPI3REF: Constants Passed To The Conflict Handler
11136 **
11137 ** Values that may be passed as the second argument to a conflict-handler.
@@ -11225,19 +11283,175 @@
11225 */
11226 #define SQLITE_CHANGESET_OMIT 0
11227 #define SQLITE_CHANGESET_REPLACE 1
11228 #define SQLITE_CHANGESET_ABORT 2
11229
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11230 /*
11231 ** CAPI3REF: Streaming Versions of API functions.
11232 **
11233 ** The six streaming API xxx_strm() functions serve similar purposes to the
11234 ** corresponding non-streaming API functions:
11235 **
11236 ** <table border=1 style="margin-left:8ex;margin-right:8ex">
11237 ** <tr><th>Streaming function<th>Non-streaming equivalent</th>
11238 ** <tr><td>sqlite3changeset_apply_strm<td>[sqlite3changeset_apply]
 
11239 ** <tr><td>sqlite3changeset_concat_strm<td>[sqlite3changeset_concat]
11240 ** <tr><td>sqlite3changeset_invert_strm<td>[sqlite3changeset_invert]
11241 ** <tr><td>sqlite3changeset_start_strm<td>[sqlite3changeset_start]
11242 ** <tr><td>sqlite3session_changeset_strm<td>[sqlite3session_changeset]
11243 ** <tr><td>sqlite3session_patchset_strm<td>[sqlite3session_patchset]
@@ -11328,10 +11542,27 @@
11328 void *pCtx, /* Copy of sixth arg to _apply() */
11329 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
11330 sqlite3_changeset_iter *p /* Handle describing change and conflict */
11331 ),
11332 void *pCtx /* First argument passed to xConflict */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11333 );
11334 SQLITE_API int sqlite3changeset_concat_strm(
11335 int (*xInputA)(void *pIn, void *pData, int *pnData),
11336 void *pInA,
11337 int (*xInputB)(void *pIn, void *pData, int *pnData),
@@ -11365,10 +11596,17 @@
11365 void *pIn
11366 );
11367 SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup*,
11368 int (*xOutput)(void *pOut, const void *pData, int nData),
11369 void *pOut
 
 
 
 
 
 
 
11370 );
11371
11372
11373 /*
11374 ** Make sure we can call this stuff from C++.
@@ -13245,13 +13483,14 @@
13245 ** handle is passed a pointer to sqlite.busyHandler. The busy-handler
13246 ** callback is currently invoked only from within pager.c.
13247 */
13248 typedef struct BusyHandler BusyHandler;
13249 struct BusyHandler {
13250 int (*xFunc)(void *,int); /* The busy callback */
13251 void *pArg; /* First arg to busy callback */
13252 int nBusy; /* Incremented with each busy call */
 
13253 };
13254
13255 /*
13256 ** Name of the master database table. The master database table
13257 ** is a special table that holds the names and attributes of all
@@ -14456,11 +14695,11 @@
14456 );
14457 SQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager, sqlite3*);
14458 SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
14459
14460 /* Functions used to configure a Pager object. */
14461 SQLITE_PRIVATE void sqlite3PagerSetBusyhandler(Pager*, int(*)(void *), void *);
14462 SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, u32*, int);
14463 #ifdef SQLITE_HAS_CODEC
14464 SQLITE_PRIVATE void sqlite3PagerAlignReserve(Pager*,Pager*);
14465 #endif
14466 SQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager*, int);
@@ -14542,10 +14781,15 @@
14542 SQLITE_PRIVATE void *sqlite3PagerTempSpace(Pager*);
14543 SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager*);
14544 SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *, int, int, int *);
14545 SQLITE_PRIVATE void sqlite3PagerClearCache(Pager*);
14546 SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *);
 
 
 
 
 
14547
14548 /* Functions used to truncate the database file. */
14549 SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager*,Pgno);
14550
14551 SQLITE_PRIVATE void sqlite3PagerRekey(DbPage*, Pgno, u16);
@@ -18099,11 +18343,11 @@
18099 SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *);
18100 SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *);
18101 SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*);
18102 SQLITE_PRIVATE char sqlite3AffinityType(const char*, u8*);
18103 SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*);
18104 SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*);
18105 SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*);
18106 SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *, const char *);
18107 SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3*,int iDB);
18108 SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3*,Index*);
18109 SQLITE_PRIVATE void sqlite3DefaultRowEst(Index*);
@@ -21069,12 +21313,15 @@
21069 ** really care if the VFS receives and understands the information since it
21070 ** is only a hint and can be safely ignored. The sqlite3OsFileControlHint()
21071 ** routine has no return value since the return value would be meaningless.
21072 */
21073 SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
 
21074 #ifdef SQLITE_TEST
21075 if( op!=SQLITE_FCNTL_COMMIT_PHASETWO ){
 
 
21076 /* Faults are not injected into COMMIT_PHASETWO because, assuming SQLite
21077 ** is using a regular VFS, it is called after the corresponding
21078 ** transaction has been committed. Injecting a fault at this point
21079 ** confuses the test scripts - the COMMIT comand returns SQLITE_NOMEM
21080 ** but the transaction is committed anyway.
@@ -21087,11 +21334,11 @@
21087 }
21088 #endif
21089 return id->pMethods->xFileControl(id, op, pArg);
21090 }
21091 SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file *id, int op, void *pArg){
21092 (void)id->pMethods->xFileControl(id, op, pArg);
21093 }
21094
21095 SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){
21096 int (*xSectorSize)(sqlite3_file*) = id->pMethods->xSectorSize;
21097 return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE);
@@ -31026,10 +31273,13 @@
31026 int openFlags; /* The flags specified at open() */
31027 #endif
31028 #if SQLITE_ENABLE_LOCKING_STYLE || defined(__APPLE__)
31029 unsigned fsFlags; /* cached details from statfs() */
31030 #endif
 
 
 
31031 #if OS_VXWORKS
31032 struct vxworksFileId *pId; /* Unique file ID */
31033 #endif
31034 #ifdef SQLITE_DEBUG
31035 /* The next group of variables are used to track whether or not the
@@ -32459,10 +32709,47 @@
32459 OSTRACE(("TEST WR-LOCK %d %d %d (unix)\n", pFile->h, rc, reserved));
32460
32461 *pResOut = reserved;
32462 return rc;
32463 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32464
32465 /*
32466 ** Attempt to set a system-lock on the file pFile. The lock is
32467 ** described by pLock.
32468 **
@@ -32492,19 +32779,19 @@
32492 assert( pInode->nLock==0 );
32493 lock.l_whence = SEEK_SET;
32494 lock.l_start = SHARED_FIRST;
32495 lock.l_len = SHARED_SIZE;
32496 lock.l_type = F_WRLCK;
32497 rc = osFcntl(pFile->h, F_SETLK, &lock);
32498 if( rc<0 ) return rc;
32499 pInode->bProcessLock = 1;
32500 pInode->nLock++;
32501 }else{
32502 rc = 0;
32503 }
32504 }else{
32505 rc = osFcntl(pFile->h, F_SETLK, pLock);
32506 }
32507 return rc;
32508 }
32509
32510 /*
@@ -34860,10 +35147,16 @@
34860 }
34861 case SQLITE_FCNTL_HAS_MOVED: {
34862 *(int*)pArg = fileHasMoved(pFile);
34863 return SQLITE_OK;
34864 }
 
 
 
 
 
 
34865 #if SQLITE_MAX_MMAP_SIZE>0
34866 case SQLITE_FCNTL_MMAP_SIZE: {
34867 i64 newLimit = *(i64*)pArg;
34868 int rc = SQLITE_OK;
34869 if( newLimit>sqlite3GlobalConfig.mxMmap ){
@@ -35179,11 +35472,11 @@
35179 /* Initialize the locking parameters */
35180 f.l_type = lockType;
35181 f.l_whence = SEEK_SET;
35182 f.l_start = ofst;
35183 f.l_len = n;
35184 rc = osFcntl(pShmNode->h, F_SETLK, &f);
35185 rc = (rc!=(-1)) ? SQLITE_OK : SQLITE_BUSY;
35186 }
35187
35188 /* Update the global lock state and do debug tracing */
35189 #ifdef SQLITE_DEBUG
@@ -45039,11 +45332,11 @@
45039 ** May you find forgiveness for yourself and forgive others.
45040 ** May you share freely, never taking more than you give.
45041 **
45042 ******************************************************************************
45043 **
45044 ** This file implements in-memory VFS. A database is held as a contiguous
45045 ** block of memory.
45046 **
45047 ** This file also implements interface sqlite3_serialize() and
45048 ** sqlite3_deserialize().
45049 */
@@ -50953,11 +51246,11 @@
50953 ** required size. */
50954 assert( pPager->eLock==EXCLUSIVE_LOCK );
50955 rc = pager_truncate(pPager, pPager->dbSize);
50956 }
50957
50958 if( rc==SQLITE_OK && bCommit && isOpen(pPager->fd) ){
50959 rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_COMMIT_PHASETWO, 0);
50960 if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
50961 }
50962
50963 if( !pPager->exclusiveMode
@@ -51772,13 +52065,11 @@
51772 ** state prior to the start of the transaction, so invoke the
51773 ** SQLITE_FCNTL_DB_UNCHANGED file-control method to disable the
51774 ** assertion that the transaction counter was modified.
51775 */
51776 #ifdef SQLITE_DEBUG
51777 if( pPager->fd->pMethods ){
51778 sqlite3OsFileControlHint(pPager->fd,SQLITE_FCNTL_DB_UNCHANGED,0);
51779 }
51780 #endif
51781
51782 /* If this playback is happening automatically as a result of an IO or
51783 ** malloc error that occurred after the change-counter was updated but
51784 ** before the transaction was committed, then the change-counter
@@ -52527,24 +52818,22 @@
52527 **
52528 ** If the busy-handler callback returns non-zero, the lock is
52529 ** retried. If it returns zero, then the SQLITE_BUSY error is
52530 ** returned to the caller of the pager API function.
52531 */
52532 SQLITE_PRIVATE void sqlite3PagerSetBusyhandler(
52533 Pager *pPager, /* Pager object */
52534 int (*xBusyHandler)(void *), /* Pointer to busy-handler function */
52535 void *pBusyHandlerArg /* Argument to pass to xBusyHandler */
52536 ){
 
52537 pPager->xBusyHandler = xBusyHandler;
52538 pPager->pBusyHandlerArg = pBusyHandlerArg;
52539
52540 if( isOpen(pPager->fd) ){
52541 void **ap = (void **)&pPager->xBusyHandler;
52542 assert( ((int(*)(void *))(ap[0]))==xBusyHandler );
52543 assert( ap[1]==pBusyHandlerArg );
52544 sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_BUSYHANDLER, (void *)ap);
52545 }
52546 }
52547
52548 /*
52549 ** Change the page size used by the Pager object. The new page size
52550 ** is passed in *pPageSize.
@@ -54516,10 +54805,11 @@
54516 Pager *pPager;
54517 assert( pPg!=0 );
54518 assert( pPg->pgno==1 );
54519 assert( (pPg->flags & PGHDR_MMAP)==0 ); /* Page1 is never memory mapped */
54520 pPager = pPg->pPager;
 
54521 sqlite3PcacheRelease(pPg);
54522 pagerUnlockIfUnused(pPager);
54523 }
54524
54525 /*
@@ -55111,16 +55401,13 @@
55111 ** If successful, or if called on a pager for which it is a no-op, this
55112 ** function returns SQLITE_OK. Otherwise, an IO error code is returned.
55113 */
55114 SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager, const char *zMaster){
55115 int rc = SQLITE_OK;
55116
55117 if( isOpen(pPager->fd) ){
55118 void *pArg = (void*)zMaster;
55119 rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SYNC, pArg);
55120 if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
55121 }
55122 if( rc==SQLITE_OK && !pPager->noSync ){
55123 assert( !MEMDB );
55124 rc = sqlite3OsSync(pPager->fd, pPager->syncFlags);
55125 }
55126 return rc;
@@ -55793,10 +56080,20 @@
55793 */
55794 SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager *pPager){
55795 return pPager->fd;
55796 }
55797
 
 
 
 
 
 
 
 
 
 
55798 /*
55799 ** Return the file handle for the journal file (if it exists).
55800 ** This will be either the rollback journal or the WAL file.
55801 */
55802 SQLITE_PRIVATE sqlite3_file *sqlite3PagerJrnlFile(Pager *pPager){
@@ -56253,10 +56550,11 @@
56253 (eMode==SQLITE_CHECKPOINT_PASSIVE ? 0 : pPager->xBusyHandler),
56254 pPager->pBusyHandlerArg,
56255 pPager->walSyncFlags, pPager->pageSize, (u8 *)pPager->pTmpSpace,
56256 pnLog, pnCkpt
56257 );
 
56258 }
56259 return rc;
56260 }
56261
56262 SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager){
@@ -63529,11 +63827,12 @@
63529 */
63530 static int btreeInvokeBusyHandler(void *pArg){
63531 BtShared *pBt = (BtShared*)pArg;
63532 assert( pBt->db );
63533 assert( sqlite3_mutex_held(pBt->db->mutex) );
63534 return sqlite3InvokeBusyHandler(&pBt->db->busyHandler);
 
63535 }
63536
63537 /*
63538 ** Open a database file.
63539 **
@@ -63707,11 +64006,11 @@
63707 if( rc!=SQLITE_OK ){
63708 goto btree_open_out;
63709 }
63710 pBt->openFlags = (u8)flags;
63711 pBt->db = db;
63712 sqlite3PagerSetBusyhandler(pBt->pPager, btreeInvokeBusyHandler, pBt);
63713 p->pBt = pBt;
63714
63715 pBt->pCursor = 0;
63716 pBt->pPage1 = 0;
63717 if( sqlite3PagerIsreadonly(pBt->pPager) ) pBt->btsFlags |= BTS_READ_ONLY;
@@ -64670,10 +64969,11 @@
64670 if( rc!=SQLITE_OK ){
64671 unlockBtreeIfUnused(pBt);
64672 }
64673 }while( (rc&0xFF)==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE &&
64674 btreeInvokeBusyHandler(pBt) );
 
64675
64676 if( rc==SQLITE_OK ){
64677 if( p->inTrans==TRANS_NONE ){
64678 pBt->nTransaction++;
64679 #ifndef SQLITE_OMIT_SHARED_CACHE
@@ -98715,25 +99015,65 @@
98715 ** This is the Expr node callback for sqlite3ExprImpliesNotNullRow().
98716 ** If the expression node requires that the table at pWalker->iCur
98717 ** have a non-NULL column, then set pWalker->eCode to 1 and abort.
98718 */
98719 static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
 
 
 
 
 
 
 
 
 
98720 if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune;
98721 switch( pExpr->op ){
 
 
98722 case TK_ISNULL:
98723 case TK_IS:
98724 case TK_OR:
 
 
98725 case TK_FUNCTION:
98726 case TK_AGG_FUNCTION:
 
 
 
 
 
 
 
98727 return WRC_Prune;
98728 case TK_COLUMN:
98729 case TK_AGG_COLUMN:
98730 if( pWalker->u.iCur==pExpr->iTable ){
98731 pWalker->eCode = 1;
98732 return WRC_Abort;
98733 }
98734 return WRC_Prune;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98735 default:
98736 return WRC_Continue;
98737 }
98738 }
98739
@@ -98740,10 +99080,17 @@
98740 /*
98741 ** Return true (non-zero) if expression p can only be true if at least
98742 ** one column of table iTab is non-null. In other words, return true
98743 ** if expression p will always be NULL or false if every column of iTab
98744 ** is NULL.
 
 
 
 
 
 
 
98745 **
98746 ** Terms of p that are marked with EP_FromJoin (and hence that come from
98747 ** the ON or USING clauses of LEFT JOINS) are excluded from the analysis.
98748 **
98749 ** This routine is used to check if a LEFT JOIN can be converted into
@@ -101005,11 +101352,11 @@
101005 }
101006 if( pTab->tnum==0 ){
101007 /* Do not gather statistics on views or virtual tables */
101008 return;
101009 }
101010 if( sqlite3_strlike("sqlite_%", pTab->zName, 0)==0 ){
101011 /* Do not gather statistics on system tables */
101012 return;
101013 }
101014 assert( sqlite3BtreeHoldsAllMutexes(db) );
101015 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
@@ -104066,11 +104413,11 @@
104066 if( !sqlite3ExprIsConstantOrFunction(pExpr, db->init.busy) ){
104067 sqlite3ErrorMsg(pParse, "default value of column [%s] is not constant",
104068 pCol->zName);
104069 }else{
104070 /* A copy of pExpr is used instead of the original, as pExpr contains
104071 ** tokens that point to volatile memory.
104072 */
104073 Expr x;
104074 sqlite3ExprDelete(db, pCol->pDflt);
104075 memset(&x, 0, sizeof(x));
104076 x.op = TK_SPAN;
@@ -104310,11 +104657,11 @@
104310 SQLITE_PRIVATE void sqlite3ChangeCookie(Parse *pParse, int iDb){
104311 sqlite3 *db = pParse->db;
104312 Vdbe *v = pParse->pVdbe;
104313 assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
104314 sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION,
104315 db->aDb[iDb].pSchema->schema_cookie+1);
104316 }
104317
104318 /*
104319 ** Measure the number of characters needed to output the given
104320 ** identifier. The number returned includes any quotes used
@@ -104988,11 +105335,11 @@
104988 Table *pSelTab; /* A fake table from which we get the result set */
104989 Select *pSel; /* Copy of the SELECT that implements the view */
104990 int nErr = 0; /* Number of errors encountered */
104991 int n; /* Temporarily holds the number of cursors assigned */
104992 sqlite3 *db = pParse->db; /* Database connection for malloc errors */
104993 #ifndef SQLITE_OMIT_VIRTUALTABLE
104994 int rc;
104995 #endif
104996 #ifndef SQLITE_OMIT_AUTHORIZATION
104997 sqlite3_xauth xAuth; /* Saved xAuth pointer */
104998 #endif
@@ -123694,11 +124041,10 @@
123694 ExprList *pOrderBy = pSub->pOrderBy;
123695 for(i=0; i<pOrderBy->nExpr; i++){
123696 pOrderBy->a[i].u.x.iOrderByCol = 0;
123697 }
123698 assert( pParent->pOrderBy==0 );
123699 assert( pSub->pPrior==0 );
123700 pParent->pOrderBy = pOrderBy;
123701 pSub->pOrderBy = 0;
123702 }
123703 pWhere = sqlite3ExprDup(db, pSub->pWhere, 0);
123704 if( isLeftJoin>0 ){
@@ -123778,12 +124124,13 @@
123778 ** (2) The inner query is the recursive part of a common table expression.
123779 **
123780 ** (3) The inner query has a LIMIT clause (since the changes to the WHERE
123781 ** close would change the meaning of the LIMIT).
123782 **
123783 ** (4) (** This restriction was removed on 2018-03-21. It used to read:
123784 ** The inner query is the right operand of a LEFT JOIN. **)
 
123785 **
123786 ** (5) The WHERE clause expression originates in the ON or USING clause
123787 ** of a LEFT JOIN where iCursor is not the right-hand table of that
123788 ** left join. An example:
123789 **
@@ -123801,11 +124148,12 @@
123801 */
123802 static int pushDownWhereTerms(
123803 Parse *pParse, /* Parse context (for malloc() and error reporting) */
123804 Select *pSubq, /* The subquery whose WHERE clause is to be augmented */
123805 Expr *pWhere, /* The WHERE clause of the outer query */
123806 int iCursor /* Cursor number of the subquery */
 
123807 ){
123808 Expr *pNew;
123809 int nChng = 0;
123810 if( pWhere==0 ) return 0;
123811 if( pSubq->selFlags & SF_Recursive ) return 0; /* restriction (2) */
@@ -123825,13 +124173,20 @@
123825
123826 if( pSubq->pLimit!=0 ){
123827 return 0; /* restriction (3) */
123828 }
123829 while( pWhere->op==TK_AND ){
123830 nChng += pushDownWhereTerms(pParse, pSubq, pWhere->pRight, iCursor);
 
123831 pWhere = pWhere->pLeft;
123832 }
 
 
 
 
 
 
123833 if( ExprHasProperty(pWhere,EP_FromJoin) && pWhere->iRightJoinTable!=iCursor ){
123834 return 0; /* restriction (5) */
123835 }
123836 if( sqlite3ExprIsTableConstant(pWhere, iCursor) ){
123837 nChng++;
@@ -124291,13 +124646,11 @@
124291 if( (selFlags & SF_Expanded)!=0 ){
124292 return WRC_Prune;
124293 }
124294 pTabList = p->pSrc;
124295 pEList = p->pEList;
124296 if( OK_IF_ALWAYS_TRUE(p->pWith) ){
124297 sqlite3WithPush(pParse, p->pWith, 0);
124298 }
124299
124300 /* Make sure cursor numbers have been assigned to all entries in
124301 ** the FROM clause of the SELECT statement.
124302 */
124303 sqlite3SrcListAssignCursors(pParse, pTabList);
@@ -125295,11 +125648,12 @@
125295
125296 /* Make copies of constant WHERE-clause terms in the outer query down
125297 ** inside the subquery. This can help the subquery to run more efficiently.
125298 */
125299 if( OptimizationEnabled(db, SQLITE_PushDown)
125300 && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor)
 
125301 ){
125302 #if SELECTTRACE_ENABLED
125303 if( sqlite3SelectTrace & 0x100 ){
125304 SELECTTRACE(0x100,pParse,p,("After WHERE-clause push-down:\n"));
125305 sqlite3TreeViewSelect(0, p, 0);
@@ -127755,11 +128109,11 @@
127755 iPk = pParse->nMem+1;
127756 pParse->nMem += nPk;
127757 regKey = ++pParse->nMem;
127758 iEph = pParse->nTab++;
127759
127760 sqlite3VdbeAddOp2(v, OP_Null, 0, iPk);
127761 addrOpen = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, iEph, nPk);
127762 sqlite3VdbeSetP4KeyInfo(pParse, pPk);
127763 }
127764
127765 /* Begin the database scan.
@@ -129927,11 +130281,11 @@
129927
129928 /*
129929 ** Trace output macros
129930 */
129931 #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
129932 /***/ int sqlite3WhereTrace;
129933 #endif
129934 #if defined(SQLITE_DEBUG) \
129935 && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_WHERETRACE))
129936 # define WHERETRACE(K,X) if(sqlite3WhereTrace&(K)) sqlite3DebugPrintf X
129937 # define WHERETRACE_ENABLED 1
@@ -132576,22 +132930,23 @@
132576 if( iLoop<3 && (pTerm->wtFlags & TERM_VARSELECT) ){
132577 if( iNext==0 ) iNext = 3;
132578 continue;
132579 }
132580
132581 if( pTerm->wtFlags & TERM_LIKECOND ){
132582 /* If the TERM_LIKECOND flag is set, that means that the range search
132583 ** is sufficient to guarantee that the LIKE operator is true, so we
132584 ** can skip the call to the like(A,B) function. But this only works
132585 ** for strings. So do not skip the call to the function on the pass
132586 ** that compares BLOBs. */
132587 #ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS
132588 continue;
132589 #else
132590 u32 x = pLevel->iLikeRepCntr;
132591 assert( x>0 );
132592 skipLikeAddr = sqlite3VdbeAddOp1(v, (x&1)?OP_IfNot:OP_If, (int)(x>>1));
 
132593 VdbeCoverage(v);
132594 #endif
132595 }
132596 #ifdef WHERETRACE_ENABLED /* 0xffff */
132597 if( sqlite3WhereTrace ){
@@ -136579,12 +136934,12 @@
136579 LogEst rLogSize; /* Logarithm of table size */
136580 WhereTerm *pTop = 0, *pBtm = 0; /* Top and bottom range constraints */
136581
136582 pNew = pBuilder->pNew;
136583 if( db->mallocFailed ) return SQLITE_NOMEM_BKPT;
136584 WHERETRACE(0x800, ("BEGIN addBtreeIdx(%s), nEq=%d\n",
136585 pProbe->zName, pNew->u.btree.nEq));
136586
136587 assert( (pNew->wsFlags & WHERE_VIRTUALTABLE)==0 );
136588 assert( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 );
136589 if( pNew->wsFlags & WHERE_BTM_LIMIT ){
136590 opMask = WO_LT|WO_LE;
@@ -136866,12 +137221,12 @@
136866 pNew->u.btree.nEq = saved_nEq;
136867 pNew->nSkip = saved_nSkip;
136868 pNew->wsFlags = saved_wsFlags;
136869 }
136870
136871 WHERETRACE(0x800, ("END addBtreeIdx(%s), nEq=%d, rc=%d\n",
136872 pProbe->zName, saved_nEq, rc));
136873 return rc;
136874 }
136875
136876 /*
136877 ** Return True if it is possible that pIndex might be useful in
@@ -137305,13 +137660,13 @@
137305 || j<0
137306 || j>=pWC->nTerm
137307 || pNew->aLTerm[iTerm]!=0
137308 || pIdxCons->usable==0
137309 ){
137310 rc = SQLITE_ERROR;
137311 sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
137312 return rc;
 
137313 }
137314 testcase( iTerm==nConstraint-1 );
137315 testcase( j==0 );
137316 testcase( j==pWC->nTerm-1 );
137317 pTerm = &pWC->a[j];
@@ -137335,10 +137690,19 @@
137335 }
137336 }
137337 pNew->u.vtab.omitMask &= ~mNoOmit;
137338
137339 pNew->nLTerm = mxTerm+1;
 
 
 
 
 
 
 
 
 
137340 assert( pNew->nLTerm<=pNew->nLSlot );
137341 pNew->u.vtab.idxNum = pIdxInfo->idxNum;
137342 pNew->u.vtab.needFree = pIdxInfo->needToFreeIdxStr;
137343 pIdxInfo->needToFreeIdxStr = 0;
137344 pNew->u.vtab.idxStr = pIdxInfo->idxStr;
@@ -137450,10 +137814,11 @@
137450 sqlite3DbFree(pParse->db, p);
137451 return SQLITE_NOMEM_BKPT;
137452 }
137453
137454 /* First call xBestIndex() with all constraints usable. */
 
137455 WHERETRACE(0x40, (" VirtualOne: all usable\n"));
137456 rc = whereLoopAddVirtualOne(pBuilder, mPrereq, ALLBITS, 0, p, mNoOmit, &bIn);
137457
137458 /* If the call to xBestIndex() with all terms enabled produced a plan
137459 ** that does not require any source tables (IOW: a plan with mBest==0),
@@ -137525,10 +137890,11 @@
137525 }
137526 }
137527
137528 if( p->needToFreeIdxStr ) sqlite3_free(p->idxStr);
137529 sqlite3DbFreeNN(pParse->db, p);
 
137530 return rc;
137531 }
137532 #endif /* SQLITE_OMIT_VIRTUALTABLE */
137533
137534 /*
@@ -139665,21 +140031,21 @@
139665 #define sqlite3ParserARG_SDECL Parse *pParse;
139666 #define sqlite3ParserARG_PDECL ,Parse *pParse
139667 #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
139668 #define sqlite3ParserARG_STORE yypParser->pParse = pParse
139669 #define YYFALLBACK 1
139670 #define YYNSTATE 466
139671 #define YYNRULE 330
139672 #define YYNTOKEN 143
139673 #define YY_MAX_SHIFT 465
139674 #define YY_MIN_SHIFTREDUCE 675
139675 #define YY_MAX_SHIFTREDUCE 1004
139676 #define YY_ERROR_ACTION 1005
139677 #define YY_ACCEPT_ACTION 1006
139678 #define YY_NO_ACTION 1007
139679 #define YY_MIN_REDUCE 1008
139680 #define YY_MAX_REDUCE 1337
139681 /************* End control #defines *******************************************/
139682
139683 /* Define the yytestcase() macro to be a no-op if is not already defined
139684 ** otherwise.
139685 **
@@ -139741,326 +140107,328 @@
139741 ** yy_reduce_ofst[] For each state, the offset into yy_action for
139742 ** shifting non-terminals after a reduce.
139743 ** yy_default[] Default action for each state.
139744 **
139745 *********** Begin parsing tables **********************************************/
139746 #define YY_ACTTAB_COUNT (1541)
139747 static const YYACTIONTYPE yy_action[] = {
139748 /* 0 */ 1006, 156, 156, 2, 1302, 90, 87, 179, 90, 87,
139749 /* 10 */ 179, 460, 1048, 460, 465, 1010, 460, 333, 1130, 335,
139750 /* 20 */ 246, 330, 112, 303, 439, 1258, 304, 419, 1129, 1087,
139751 /* 30 */ 72, 798, 50, 50, 50, 50, 331, 30, 30, 799,
139752 /* 40 */ 951, 364, 371, 97, 98, 88, 983, 983, 859, 862,
139753 /* 50 */ 851, 851, 95, 95, 96, 96, 96, 96, 120, 371,
139754 /* 60 */ 370, 120, 348, 22, 90, 87, 179, 438, 423, 438,
139755 /* 70 */ 440, 335, 420, 385, 90, 87, 179, 116, 73, 163,
139756 /* 80 */ 848, 848, 860, 863, 94, 94, 94, 94, 93, 93,
139757 /* 90 */ 92, 92, 92, 91, 361, 97, 98, 88, 983, 983,
139758 /* 100 */ 859, 862, 851, 851, 95, 95, 96, 96, 96, 96,
139759 /* 110 */ 718, 365, 339, 93, 93, 92, 92, 92, 91, 361,
139760 /* 120 */ 99, 371, 453, 335, 94, 94, 94, 94, 93, 93,
139761 /* 130 */ 92, 92, 92, 91, 361, 852, 94, 94, 94, 94,
139762 /* 140 */ 93, 93, 92, 92, 92, 91, 361, 97, 98, 88,
139763 /* 150 */ 983, 983, 859, 862, 851, 851, 95, 95, 96, 96,
139764 /* 160 */ 96, 96, 92, 92, 92, 91, 361, 838, 132, 195,
139765 /* 170 */ 58, 244, 412, 409, 408, 335, 457, 457, 457, 304,
139766 /* 180 */ 59, 332, 831, 407, 394, 962, 830, 391, 94, 94,
139767 /* 190 */ 94, 94, 93, 93, 92, 92, 92, 91, 361, 97,
139768 /* 200 */ 98, 88, 983, 983, 859, 862, 851, 851, 95, 95,
139769 /* 210 */ 96, 96, 96, 96, 426, 357, 460, 830, 830, 832,
139770 /* 220 */ 91, 361, 962, 963, 964, 195, 459, 335, 412, 409,
139771 /* 230 */ 408, 280, 361, 820, 132, 11, 11, 50, 50, 407,
139772 /* 240 */ 94, 94, 94, 94, 93, 93, 92, 92, 92, 91,
139773 /* 250 */ 361, 97, 98, 88, 983, 983, 859, 862, 851, 851,
139774 /* 260 */ 95, 95, 96, 96, 96, 96, 460, 221, 460, 264,
139775 /* 270 */ 375, 254, 438, 428, 1276, 1276, 383, 1074, 1053, 335,
139776 /* 280 */ 245, 422, 299, 713, 271, 271, 1074, 50, 50, 50,
139777 /* 290 */ 50, 962, 94, 94, 94, 94, 93, 93, 92, 92,
139778 /* 300 */ 92, 91, 361, 97, 98, 88, 983, 983, 859, 862,
139779 /* 310 */ 851, 851, 95, 95, 96, 96, 96, 96, 90, 87,
139780 /* 320 */ 179, 1306, 438, 437, 438, 418, 368, 253, 962, 963,
139781 /* 330 */ 964, 335, 360, 360, 360, 706, 359, 358, 324, 962,
139782 /* 340 */ 1281, 951, 364, 230, 94, 94, 94, 94, 93, 93,
139783 /* 350 */ 92, 92, 92, 91, 361, 97, 98, 88, 983, 983,
139784 /* 360 */ 859, 862, 851, 851, 95, 95, 96, 96, 96, 96,
139785 /* 370 */ 769, 460, 120, 226, 226, 366, 962, 963, 964, 1089,
139786 /* 380 */ 990, 900, 990, 335, 1057, 425, 421, 839, 759, 759,
139787 /* 390 */ 425, 427, 50, 50, 432, 381, 94, 94, 94, 94,
139788 /* 400 */ 93, 93, 92, 92, 92, 91, 361, 97, 98, 88,
139789 /* 410 */ 983, 983, 859, 862, 851, 851, 95, 95, 96, 96,
139790 /* 420 */ 96, 96, 460, 259, 460, 120, 117, 354, 942, 1332,
139791 /* 430 */ 942, 1333, 1332, 278, 1333, 335, 680, 681, 682, 825,
139792 /* 440 */ 201, 176, 303, 50, 50, 49, 49, 404, 94, 94,
139793 /* 450 */ 94, 94, 93, 93, 92, 92, 92, 91, 361, 97,
139794 /* 460 */ 98, 88, 983, 983, 859, 862, 851, 851, 95, 95,
139795 /* 470 */ 96, 96, 96, 96, 199, 460, 380, 265, 433, 380,
139796 /* 480 */ 265, 383, 256, 158, 258, 319, 1003, 335, 155, 940,
139797 /* 490 */ 177, 940, 273, 379, 276, 322, 34, 34, 302, 962,
139798 /* 500 */ 94, 94, 94, 94, 93, 93, 92, 92, 92, 91,
139799 /* 510 */ 361, 97, 98, 88, 983, 983, 859, 862, 851, 851,
139800 /* 520 */ 95, 95, 96, 96, 96, 96, 905, 905, 397, 460,
139801 /* 530 */ 301, 158, 101, 319, 941, 340, 962, 963, 964, 313,
139802 /* 540 */ 283, 449, 335, 327, 146, 1266, 1004, 257, 234, 248,
139803 /* 550 */ 35, 35, 94, 94, 94, 94, 93, 93, 92, 92,
139804 /* 560 */ 92, 91, 361, 709, 785, 1227, 97, 98, 88, 983,
139805 /* 570 */ 983, 859, 862, 851, 851, 95, 95, 96, 96, 96,
139806 /* 580 */ 96, 962, 1227, 1229, 245, 422, 838, 198, 197, 196,
139807 /* 590 */ 1079, 1079, 1077, 1077, 1004, 1334, 320, 335, 172, 171,
139808 /* 600 */ 709, 831, 159, 271, 271, 830, 76, 94, 94, 94,
139809 /* 610 */ 94, 93, 93, 92, 92, 92, 91, 361, 962, 963,
139810 /* 620 */ 964, 97, 98, 88, 983, 983, 859, 862, 851, 851,
139811 /* 630 */ 95, 95, 96, 96, 96, 96, 830, 830, 832, 1157,
139812 /* 640 */ 1157, 199, 1157, 173, 1227, 231, 232, 1282, 2, 335,
139813 /* 650 */ 271, 764, 271, 820, 271, 271, 763, 389, 389, 389,
139814 /* 660 */ 132, 79, 94, 94, 94, 94, 93, 93, 92, 92,
139815 /* 670 */ 92, 91, 361, 97, 98, 88, 983, 983, 859, 862,
139816 /* 680 */ 851, 851, 95, 95, 96, 96, 96, 96, 460, 264,
139817 /* 690 */ 223, 460, 1257, 783, 1223, 1157, 1086, 1082, 80, 271,
139818 /* 700 */ 78, 335, 340, 1031, 341, 344, 345, 902, 346, 10,
139819 /* 710 */ 10, 902, 25, 25, 94, 94, 94, 94, 93, 93,
139820 /* 720 */ 92, 92, 92, 91, 361, 97, 86, 88, 983, 983,
139821 /* 730 */ 859, 862, 851, 851, 95, 95, 96, 96, 96, 96,
139822 /* 740 */ 1157, 270, 395, 117, 233, 263, 235, 70, 456, 341,
139823 /* 750 */ 225, 176, 335, 1305, 342, 133, 736, 966, 980, 249,
139824 /* 760 */ 1150, 396, 325, 1085, 1028, 178, 94, 94, 94, 94,
139825 /* 770 */ 93, 93, 92, 92, 92, 91, 361, 98, 88, 983,
139826 /* 780 */ 983, 859, 862, 851, 851, 95, 95, 96, 96, 96,
139827 /* 790 */ 96, 783, 783, 132, 120, 966, 120, 120, 120, 798,
139828 /* 800 */ 252, 937, 335, 353, 321, 429, 355, 799, 822, 692,
139829 /* 810 */ 390, 203, 446, 450, 372, 716, 454, 94, 94, 94,
139830 /* 820 */ 94, 93, 93, 92, 92, 92, 91, 361, 88, 983,
139831 /* 830 */ 983, 859, 862, 851, 851, 95, 95, 96, 96, 96,
139832 /* 840 */ 96, 84, 455, 1225, 3, 1209, 120, 120, 382, 387,
139833 /* 850 */ 120, 203, 1271, 716, 384, 168, 266, 203, 458, 72,
139834 /* 860 */ 260, 1246, 84, 455, 178, 3, 378, 94, 94, 94,
139835 /* 870 */ 94, 93, 93, 92, 92, 92, 91, 361, 350, 458,
139836 /* 880 */ 1245, 362, 430, 213, 228, 290, 415, 285, 414, 200,
139837 /* 890 */ 783, 882, 444, 726, 725, 405, 283, 921, 209, 921,
139838 /* 900 */ 281, 132, 362, 72, 838, 289, 147, 733, 734, 392,
139839 /* 910 */ 81, 82, 922, 444, 922, 267, 288, 83, 362, 462,
139840 /* 920 */ 461, 272, 132, 830, 23, 838, 388, 923, 1216, 923,
139841 /* 930 */ 1056, 81, 82, 84, 455, 899, 3, 899, 83, 362,
139842 /* 940 */ 462, 461, 761, 962, 830, 75, 1, 443, 275, 747,
139843 /* 950 */ 458, 5, 962, 204, 830, 830, 832, 833, 18, 748,
139844 /* 960 */ 229, 962, 277, 19, 153, 317, 317, 316, 216, 314,
139845 /* 970 */ 279, 460, 689, 362, 1055, 830, 830, 832, 833, 18,
139846 /* 980 */ 962, 963, 964, 962, 444, 181, 460, 251, 981, 962,
139847 /* 990 */ 963, 964, 8, 8, 20, 250, 838, 1070, 962, 963,
139848 /* 1000 */ 964, 417, 81, 82, 768, 204, 347, 36, 36, 83,
139849 /* 1010 */ 362, 462, 461, 1054, 284, 830, 84, 455, 1123, 3,
139850 /* 1020 */ 962, 963, 964, 460, 183, 962, 981, 764, 889, 1107,
139851 /* 1030 */ 460, 184, 763, 458, 132, 182, 74, 455, 460, 3,
139852 /* 1040 */ 981, 898, 834, 898, 8, 8, 830, 830, 832, 833,
139853 /* 1050 */ 18, 8, 8, 458, 219, 1156, 362, 1103, 349, 8,
139854 /* 1060 */ 8, 240, 962, 963, 964, 236, 889, 444, 792, 336,
139855 /* 1070 */ 158, 203, 885, 435, 700, 209, 362, 114, 981, 838,
139856 /* 1080 */ 834, 227, 334, 1114, 441, 81, 82, 444, 442, 305,
139857 /* 1090 */ 784, 306, 83, 362, 462, 461, 369, 1162, 830, 838,
139858 /* 1100 */ 460, 1037, 237, 1030, 237, 81, 82, 7, 96, 96,
139859 /* 1110 */ 96, 96, 83, 362, 462, 461, 1019, 1018, 830, 1020,
139860 /* 1120 */ 1289, 37, 37, 400, 96, 96, 96, 96, 89, 830,
139861 /* 1130 */ 830, 832, 833, 18, 1100, 318, 962, 292, 94, 94,
139862 /* 1140 */ 94, 94, 93, 93, 92, 92, 92, 91, 361, 830,
139863 /* 1150 */ 830, 832, 833, 18, 94, 94, 94, 94, 93, 93,
139864 /* 1160 */ 92, 92, 92, 91, 361, 359, 358, 226, 226, 727,
139865 /* 1170 */ 294, 296, 460, 962, 963, 964, 460, 989, 160, 425,
139866 /* 1180 */ 170, 1295, 262, 460, 987, 374, 988, 386, 1145, 255,
139867 /* 1190 */ 326, 460, 373, 38, 38, 410, 174, 39, 39, 413,
139868 /* 1200 */ 460, 287, 460, 1053, 40, 40, 298, 728, 1220, 990,
139869 /* 1210 */ 445, 990, 26, 26, 1219, 460, 311, 460, 169, 1292,
139870 /* 1220 */ 460, 27, 27, 29, 29, 998, 460, 206, 135, 995,
139871 /* 1230 */ 1265, 1263, 460, 57, 60, 460, 41, 41, 42, 42,
139872 /* 1240 */ 460, 43, 43, 460, 343, 351, 460, 9, 9, 460,
139873 /* 1250 */ 144, 460, 130, 44, 44, 460, 103, 103, 460, 137,
139874 /* 1260 */ 70, 45, 45, 460, 46, 46, 460, 31, 31, 1142,
139875 /* 1270 */ 47, 47, 48, 48, 460, 376, 32, 32, 460, 122,
139876 /* 1280 */ 122, 460, 157, 460, 123, 123, 139, 124, 124, 460,
139877 /* 1290 */ 186, 460, 377, 460, 115, 54, 54, 460, 403, 33,
139878 /* 1300 */ 33, 460, 104, 104, 51, 51, 460, 161, 460, 140,
139879 /* 1310 */ 105, 105, 106, 106, 102, 102, 460, 141, 121, 121,
139880 /* 1320 */ 460, 142, 119, 119, 190, 460, 1152, 110, 110, 109,
139881 /* 1330 */ 109, 702, 460, 148, 393, 65, 460, 107, 107, 460,
139882 /* 1340 */ 323, 108, 108, 399, 460, 1234, 53, 53, 1214, 269,
139883 /* 1350 */ 154, 416, 1115, 55, 55, 220, 401, 52, 52, 191,
139884 /* 1360 */ 24, 24, 274, 192, 193, 28, 28, 1021, 328, 702,
139885 /* 1370 */ 1073, 352, 1072, 718, 1071, 431, 1111, 1064, 329, 1045,
139886 /* 1380 */ 69, 205, 6, 291, 1044, 286, 1112, 1043, 1304, 1110,
139887 /* 1390 */ 293, 300, 295, 297, 1063, 1200, 1109, 77, 241, 448,
139888 /* 1400 */ 356, 452, 436, 100, 214, 71, 434, 1027, 1093, 21,
139889 /* 1410 */ 463, 242, 243, 957, 215, 217, 218, 464, 309, 307,
139890 /* 1420 */ 308, 310, 1016, 125, 1250, 1251, 1011, 1249, 126, 127,
139891 /* 1430 */ 1248, 113, 676, 337, 238, 338, 134, 363, 167, 1041,
139892 /* 1440 */ 1040, 56, 247, 367, 180, 897, 111, 895, 136, 1038,
139893 /* 1450 */ 818, 128, 138, 750, 261, 911, 185, 143, 145, 61,
139894 /* 1460 */ 62, 63, 64, 129, 914, 187, 188, 910, 118, 12,
139895 /* 1470 */ 189, 903, 268, 992, 203, 162, 398, 150, 149, 691,
139896 /* 1480 */ 402, 288, 194, 406, 151, 411, 66, 13, 729, 239,
139897 /* 1490 */ 282, 14, 67, 131, 837, 836, 865, 758, 15, 4,
139898 /* 1500 */ 68, 762, 175, 222, 224, 424, 152, 869, 791, 202,
139899 /* 1510 */ 786, 75, 72, 880, 866, 864, 16, 17, 920, 207,
139900 /* 1520 */ 919, 208, 447, 946, 164, 211, 947, 210, 165, 451,
139901 /* 1530 */ 868, 166, 315, 835, 701, 85, 212, 1297, 312, 952,
139902 /* 1540 */ 1296,
 
 
139903 };
139904 static const YYCODETYPE yy_lookahead[] = {
139905 /* 0 */ 144, 145, 146, 147, 172, 222, 223, 224, 222, 223,
139906 /* 10 */ 224, 152, 180, 152, 148, 149, 152, 173, 176, 19,
139907 /* 20 */ 154, 173, 156, 152, 163, 242, 152, 163, 176, 163,
139908 /* 30 */ 26, 31, 173, 174, 173, 174, 173, 173, 174, 39,
139909 /* 40 */ 1, 2, 152, 43, 44, 45, 46, 47, 48, 49,
139910 /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 197, 169,
139911 /* 60 */ 170, 197, 188, 197, 222, 223, 224, 208, 209, 208,
139912 /* 70 */ 209, 19, 208, 152, 222, 223, 224, 22, 26, 24,
139913 /* 80 */ 46, 47, 48, 49, 84, 85, 86, 87, 88, 89,
139914 /* 90 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47,
139915 /* 100 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
139916 /* 110 */ 106, 245, 157, 88, 89, 90, 91, 92, 93, 94,
139917 /* 120 */ 68, 231, 251, 19, 84, 85, 86, 87, 88, 89,
139918 /* 130 */ 90, 91, 92, 93, 94, 101, 84, 85, 86, 87,
139919 /* 140 */ 88, 89, 90, 91, 92, 93, 94, 43, 44, 45,
139920 /* 150 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
139921 /* 160 */ 56, 57, 90, 91, 92, 93, 94, 82, 79, 99,
139922 /* 170 */ 66, 200, 102, 103, 104, 19, 168, 169, 170, 152,
139923 /* 180 */ 24, 210, 97, 113, 229, 59, 101, 232, 84, 85,
139924 /* 190 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 43,
139925 /* 200 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
139926 /* 210 */ 54, 55, 56, 57, 152, 188, 152, 132, 133, 134,
139927 /* 220 */ 93, 94, 96, 97, 98, 99, 152, 19, 102, 103,
139928 /* 230 */ 104, 23, 94, 72, 79, 173, 174, 173, 174, 113,
139929 /* 240 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
139930 /* 250 */ 94, 43, 44, 45, 46, 47, 48, 49, 50, 51,
139931 /* 260 */ 52, 53, 54, 55, 56, 57, 152, 171, 152, 108,
139932 /* 270 */ 109, 110, 208, 209, 119, 120, 152, 180, 181, 19,
139933 /* 280 */ 119, 120, 152, 23, 152, 152, 189, 173, 174, 173,
139934 /* 290 */ 174, 59, 84, 85, 86, 87, 88, 89, 90, 91,
139935 /* 300 */ 92, 93, 94, 43, 44, 45, 46, 47, 48, 49,
139936 /* 310 */ 50, 51, 52, 53, 54, 55, 56, 57, 222, 223,
139937 /* 320 */ 224, 186, 208, 209, 208, 209, 194, 194, 96, 97,
139938 /* 330 */ 98, 19, 168, 169, 170, 23, 88, 89, 163, 59,
139939 /* 340 */ 0, 1, 2, 219, 84, 85, 86, 87, 88, 89,
139940 /* 350 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47,
139941 /* 360 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
139942 /* 370 */ 90, 152, 197, 195, 196, 243, 96, 97, 98, 196,
139943 /* 380 */ 132, 11, 134, 19, 182, 207, 115, 23, 117, 118,
139944 /* 390 */ 207, 163, 173, 174, 152, 220, 84, 85, 86, 87,
139945 /* 400 */ 88, 89, 90, 91, 92, 93, 94, 43, 44, 45,
139946 /* 410 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
139947 /* 420 */ 56, 57, 152, 16, 152, 197, 171, 208, 22, 23,
139948 /* 430 */ 22, 23, 26, 16, 26, 19, 7, 8, 9, 23,
139949 /* 440 */ 212, 213, 152, 173, 174, 173, 174, 19, 84, 85,
139950 /* 450 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 43,
139951 /* 460 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
139952 /* 470 */ 54, 55, 56, 57, 46, 152, 109, 110, 208, 109,
139953 /* 480 */ 110, 152, 75, 152, 77, 22, 23, 19, 233, 83,
139954 /* 490 */ 152, 83, 75, 238, 77, 164, 173, 174, 226, 59,
139955 /* 500 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
139956 /* 510 */ 94, 43, 44, 45, 46, 47, 48, 49, 50, 51,
139957 /* 520 */ 52, 53, 54, 55, 56, 57, 108, 109, 110, 152,
139958 /* 530 */ 152, 152, 22, 22, 23, 107, 96, 97, 98, 160,
139959 /* 540 */ 112, 251, 19, 164, 22, 152, 83, 140, 219, 152,
139960 /* 550 */ 173, 174, 84, 85, 86, 87, 88, 89, 90, 91,
139961 /* 560 */ 92, 93, 94, 59, 124, 152, 43, 44, 45, 46,
139962 /* 570 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
139963 /* 580 */ 57, 59, 169, 170, 119, 120, 82, 108, 109, 110,
139964 /* 590 */ 191, 192, 191, 192, 83, 248, 249, 19, 88, 89,
139965 /* 600 */ 96, 97, 24, 152, 152, 101, 138, 84, 85, 86,
139966 /* 610 */ 87, 88, 89, 90, 91, 92, 93, 94, 96, 97,
139967 /* 620 */ 98, 43, 44, 45, 46, 47, 48, 49, 50, 51,
139968 /* 630 */ 52, 53, 54, 55, 56, 57, 132, 133, 134, 152,
139969 /* 640 */ 152, 46, 152, 26, 231, 194, 194, 146, 147, 19,
139970 /* 650 */ 152, 116, 152, 72, 152, 152, 121, 152, 152, 152,
139971 /* 660 */ 79, 138, 84, 85, 86, 87, 88, 89, 90, 91,
139972 /* 670 */ 92, 93, 94, 43, 44, 45, 46, 47, 48, 49,
139973 /* 680 */ 50, 51, 52, 53, 54, 55, 56, 57, 152, 108,
139974 /* 690 */ 23, 152, 194, 26, 194, 152, 194, 194, 137, 152,
139975 /* 700 */ 139, 19, 107, 166, 167, 218, 218, 29, 218, 173,
139976 /* 710 */ 174, 33, 173, 174, 84, 85, 86, 87, 88, 89,
139977 /* 720 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47,
139978 /* 730 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
139979 /* 740 */ 152, 194, 64, 171, 239, 239, 239, 130, 166, 167,
139980 /* 750 */ 212, 213, 19, 23, 246, 247, 26, 59, 26, 152,
139981 /* 760 */ 163, 218, 163, 163, 163, 98, 84, 85, 86, 87,
139982 /* 770 */ 88, 89, 90, 91, 92, 93, 94, 44, 45, 46,
139983 /* 780 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
139984 /* 790 */ 57, 124, 26, 79, 197, 97, 197, 197, 197, 31,
139985 /* 800 */ 152, 23, 19, 19, 26, 19, 218, 39, 23, 21,
139986 /* 810 */ 238, 26, 163, 163, 100, 59, 163, 84, 85, 86,
139987 /* 820 */ 87, 88, 89, 90, 91, 92, 93, 94, 45, 46,
139988 /* 830 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
139989 /* 840 */ 57, 19, 20, 152, 22, 23, 197, 197, 23, 19,
139990 /* 850 */ 197, 26, 152, 97, 23, 123, 23, 26, 36, 26,
139991 /* 860 */ 152, 152, 19, 20, 98, 22, 78, 84, 85, 86,
139992 /* 870 */ 87, 88, 89, 90, 91, 92, 93, 94, 94, 36,
139993 /* 880 */ 152, 59, 96, 99, 100, 101, 102, 103, 104, 105,
139994 /* 890 */ 124, 103, 70, 100, 101, 23, 112, 12, 26, 12,
139995 /* 900 */ 23, 79, 59, 26, 82, 101, 22, 7, 8, 152,
139996 /* 910 */ 88, 89, 27, 70, 27, 152, 112, 95, 96, 97,
139997 /* 920 */ 98, 152, 79, 101, 22, 82, 96, 42, 140, 42,
139998 /* 930 */ 182, 88, 89, 19, 20, 132, 22, 134, 95, 96,
139999 /* 940 */ 97, 98, 23, 59, 101, 26, 22, 62, 152, 62,
140000 /* 950 */ 36, 22, 59, 24, 132, 133, 134, 135, 136, 72,
140001 /* 960 */ 5, 59, 152, 22, 71, 10, 11, 12, 13, 14,
140002 /* 970 */ 152, 152, 17, 59, 182, 132, 133, 134, 135, 136,
140003 /* 980 */ 96, 97, 98, 59, 70, 30, 152, 32, 59, 96,
140004 /* 990 */ 97, 98, 173, 174, 53, 40, 82, 152, 96, 97,
140005 /* 1000 */ 98, 90, 88, 89, 90, 24, 187, 173, 174, 95,
140006 /* 1010 */ 96, 97, 98, 152, 152, 101, 19, 20, 152, 22,
140007 /* 1020 */ 96, 97, 98, 152, 69, 59, 97, 116, 59, 214,
140008 /* 1030 */ 152, 76, 121, 36, 79, 80, 19, 20, 152, 22,
140009 /* 1040 */ 59, 132, 59, 134, 173, 174, 132, 133, 134, 135,
140010 /* 1050 */ 136, 173, 174, 36, 234, 152, 59, 152, 187, 173,
140011 /* 1060 */ 174, 211, 96, 97, 98, 187, 97, 70, 23, 114,
140012 /* 1070 */ 152, 26, 23, 187, 23, 26, 59, 26, 97, 82,
140013 /* 1080 */ 97, 22, 164, 152, 152, 88, 89, 70, 192, 152,
140014 /* 1090 */ 124, 152, 95, 96, 97, 98, 141, 152, 101, 82,
140015 /* 1100 */ 152, 152, 184, 152, 186, 88, 89, 199, 54, 55,
140016 /* 1110 */ 56, 57, 95, 96, 97, 98, 152, 152, 101, 152,
140017 /* 1120 */ 152, 173, 174, 235, 54, 55, 56, 57, 58, 132,
140018 /* 1130 */ 133, 134, 135, 136, 211, 150, 59, 211, 84, 85,
140019 /* 1140 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 132,
140020 /* 1150 */ 133, 134, 135, 136, 84, 85, 86, 87, 88, 89,
140021 /* 1160 */ 90, 91, 92, 93, 94, 88, 89, 195, 196, 35,
140022 /* 1170 */ 211, 211, 152, 96, 97, 98, 152, 100, 198, 207,
140023 /* 1180 */ 171, 122, 240, 152, 107, 215, 109, 240, 202, 215,
140024 /* 1190 */ 202, 152, 220, 173, 174, 177, 185, 173, 174, 65,
140025 /* 1200 */ 152, 176, 152, 181, 173, 174, 215, 73, 176, 132,
140026 /* 1210 */ 228, 134, 173, 174, 176, 152, 201, 152, 199, 155,
140027 /* 1220 */ 152, 173, 174, 173, 174, 60, 152, 122, 244, 38,
140028 /* 1230 */ 159, 159, 152, 241, 241, 152, 173, 174, 173, 174,
140029 /* 1240 */ 152, 173, 174, 152, 159, 111, 152, 173, 174, 152,
140030 /* 1250 */ 22, 152, 43, 173, 174, 152, 173, 174, 152, 190,
140031 /* 1260 */ 130, 173, 174, 152, 173, 174, 152, 173, 174, 202,
140032 /* 1270 */ 173, 174, 173, 174, 152, 18, 173, 174, 152, 173,
140033 /* 1280 */ 174, 152, 221, 152, 173, 174, 193, 173, 174, 152,
140034 /* 1290 */ 158, 152, 159, 152, 22, 173, 174, 152, 18, 173,
140035 /* 1300 */ 174, 152, 173, 174, 173, 174, 152, 221, 152, 193,
140036 /* 1310 */ 173, 174, 173, 174, 173, 174, 152, 193, 173, 174,
140037 /* 1320 */ 152, 193, 173, 174, 158, 152, 190, 173, 174, 173,
140038 /* 1330 */ 174, 59, 152, 190, 159, 137, 152, 173, 174, 152,
140039 /* 1340 */ 202, 173, 174, 61, 152, 237, 173, 174, 202, 236,
140040 /* 1350 */ 22, 107, 159, 173, 174, 159, 178, 173, 174, 158,
140041 /* 1360 */ 173, 174, 159, 158, 158, 173, 174, 159, 178, 97,
140042 /* 1370 */ 175, 63, 175, 106, 175, 125, 217, 183, 178, 175,
140043 /* 1380 */ 107, 159, 22, 216, 177, 175, 217, 175, 175, 217,
140044 /* 1390 */ 216, 159, 216, 216, 183, 225, 217, 137, 227, 178,
140045 /* 1400 */ 94, 178, 126, 129, 25, 128, 127, 162, 206, 26,
140046 /* 1410 */ 161, 230, 230, 13, 153, 153, 6, 151, 203, 205,
140047 /* 1420 */ 204, 202, 151, 165, 171, 171, 151, 171, 165, 165,
140048 /* 1430 */ 171, 179, 4, 250, 179, 250, 247, 3, 22, 171,
140049 /* 1440 */ 171, 171, 142, 81, 15, 23, 16, 23, 131, 171,
140050 /* 1450 */ 120, 111, 123, 20, 16, 1, 125, 123, 131, 53,
140051 /* 1460 */ 53, 53, 53, 111, 96, 34, 122, 1, 5, 22,
140052 /* 1470 */ 107, 67, 140, 74, 26, 24, 41, 107, 67, 20,
140053 /* 1480 */ 19, 112, 105, 66, 22, 66, 22, 22, 28, 66,
140054 /* 1490 */ 23, 22, 22, 37, 23, 23, 23, 116, 22, 22,
140055 /* 1500 */ 26, 23, 122, 23, 23, 26, 22, 11, 96, 34,
140056 /* 1510 */ 124, 26, 26, 23, 23, 23, 34, 34, 23, 26,
140057 /* 1520 */ 23, 22, 24, 23, 22, 122, 23, 26, 22, 24,
140058 /* 1530 */ 23, 22, 15, 23, 23, 22, 122, 122, 23, 1,
140059 /* 1540 */ 122, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140060 /* 1550 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140061 /* 1560 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140062 /* 1570 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140063 /* 1580 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140064 /* 1590 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140065 /* 1600 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140066 /* 1610 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
@@ -140068,151 +140436,156 @@
140068 /* 1630 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140069 /* 1640 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140070 /* 1650 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140071 /* 1660 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140072 /* 1670 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140073 /* 1680 */ 252, 252, 252, 252,
 
 
140074 };
140075 #define YY_SHIFT_COUNT (465)
140076 #define YY_SHIFT_MIN (0)
140077 #define YY_SHIFT_MAX (1538)
140078 static const unsigned short int yy_shift_ofst[] = {
140079 /* 0 */ 39, 822, 955, 843, 997, 997, 997, 997, 0, 0,
140080 /* 10 */ 104, 630, 997, 997, 997, 997, 997, 997, 997, 1077,
140081 /* 20 */ 1077, 126, 161, 155, 52, 156, 208, 260, 312, 364,
140082 /* 30 */ 416, 468, 523, 578, 630, 630, 630, 630, 630, 630,
140083 /* 40 */ 630, 630, 630, 630, 630, 630, 630, 630, 630, 630,
140084 /* 50 */ 630, 682, 630, 733, 783, 783, 914, 997, 997, 997,
140085 /* 60 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997,
140086 /* 70 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997,
140087 /* 80 */ 997, 997, 997, 997, 997, 997, 997, 997, 1017, 997,
140088 /* 90 */ 997, 997, 997, 997, 997, 997, 997, 997, 997, 997,
140089 /* 100 */ 997, 997, 1070, 1054, 1054, 1054, 1054, 1054, 40, 25,
140090 /* 110 */ 72, 232, 788, 428, 248, 248, 232, 581, 367, 127,
140091 /* 120 */ 465, 138, 1541, 1541, 1541, 784, 784, 784, 522, 522,
140092 /* 130 */ 887, 887, 893, 406, 408, 232, 232, 232, 232, 232,
140093 /* 140 */ 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
140094 /* 150 */ 232, 232, 232, 232, 232, 370, 340, 714, 698, 698,
140095 /* 160 */ 465, 89, 89, 89, 89, 89, 89, 1541, 1541, 1541,
140096 /* 170 */ 504, 85, 85, 884, 70, 280, 902, 440, 966, 924,
140097 /* 180 */ 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
140098 /* 190 */ 232, 232, 232, 232, 232, 232, 1134, 1134, 1134, 232,
140099 /* 200 */ 232, 667, 232, 232, 232, 929, 232, 232, 885, 232,
140100 /* 210 */ 232, 232, 232, 232, 232, 232, 232, 232, 232, 418,
140101 /* 220 */ 678, 981, 981, 981, 981, 766, 271, 911, 510, 429,
140102 /* 230 */ 617, 786, 786, 830, 617, 830, 4, 730, 595, 768,
140103 /* 240 */ 786, 561, 768, 768, 732, 535, 55, 1165, 1105, 1105,
140104 /* 250 */ 1191, 1191, 1105, 1228, 1209, 1130, 1257, 1257, 1257, 1257,
140105 /* 260 */ 1105, 1280, 1130, 1228, 1209, 1209, 1130, 1105, 1280, 1198,
140106 /* 270 */ 1282, 1105, 1105, 1280, 1328, 1105, 1280, 1105, 1280, 1328,
140107 /* 280 */ 1244, 1244, 1244, 1308, 1328, 1244, 1267, 1244, 1308, 1244,
140108 /* 290 */ 1244, 1250, 1273, 1250, 1273, 1250, 1273, 1250, 1273, 1105,
140109 /* 300 */ 1360, 1105, 1260, 1328, 1306, 1306, 1328, 1274, 1276, 1277,
140110 /* 310 */ 1279, 1130, 1379, 1383, 1400, 1400, 1410, 1410, 1410, 1541,
140111 /* 320 */ 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541,
140112 /* 330 */ 1541, 1541, 1541, 1541, 1541, 34, 407, 463, 511, 417,
140113 /* 340 */ 479, 1272, 778, 941, 785, 825, 831, 833, 872, 877,
140114 /* 350 */ 756, 793, 900, 804, 919, 1045, 969, 1049, 803, 909,
140115 /* 360 */ 1051, 983, 1059, 1428, 1434, 1416, 1300, 1429, 1362, 1430,
140116 /* 370 */ 1422, 1424, 1330, 1317, 1340, 1329, 1433, 1331, 1438, 1454,
140117 /* 380 */ 1334, 1327, 1406, 1407, 1408, 1409, 1352, 1368, 1431, 1344,
140118 /* 390 */ 1466, 1463, 1447, 1363, 1332, 1404, 1448, 1411, 1399, 1435,
140119 /* 400 */ 1370, 1451, 1459, 1461, 1369, 1377, 1462, 1417, 1464, 1465,
140120 /* 410 */ 1467, 1469, 1419, 1460, 1470, 1423, 1456, 1471, 1472, 1473,
140121 /* 420 */ 1474, 1381, 1476, 1478, 1477, 1479, 1380, 1480, 1481, 1412,
140122 /* 430 */ 1475, 1484, 1386, 1485, 1482, 1486, 1483, 1490, 1485, 1491,
140123 /* 440 */ 1492, 1495, 1493, 1497, 1499, 1496, 1500, 1502, 1498, 1501,
140124 /* 450 */ 1503, 1506, 1505, 1501, 1507, 1509, 1510, 1511, 1513, 1403,
140125 /* 460 */ 1414, 1415, 1418, 1515, 1517, 1538,
140126 };
140127 #define YY_REDUCE_COUNT (334)
140128 #define YY_REDUCE_MIN (-217)
140129 #define YY_REDUCE_MAX (1278)
 
140130 static const short yy_reduce_ofst[] = {
140131 /* 0 */ -144, -139, -134, -136, -141, 64, 114, 116, -158, -148,
140132 /* 10 */ -217, 96, 819, 871, 878, 219, 270, 886, 272, -110,
140133 /* 20 */ 413, 918, 972, 228, -214, -214, -214, -214, -214, -214,
140134 /* 30 */ -214, -214, -214, -214, -214, -214, -214, -214, -214, -214,
140135 /* 40 */ -214, -214, -214, -214, -214, -214, -214, -214, -214, -214,
140136 /* 50 */ -214, -214, -214, -214, -214, -214, 62, 323, 377, 536,
140137 /* 60 */ 539, 834, 948, 1020, 1024, 1031, 1039, 1048, 1050, 1063,
140138 /* 70 */ 1065, 1068, 1074, 1080, 1083, 1088, 1091, 1094, 1097, 1099,
140139 /* 80 */ 1103, 1106, 1111, 1114, 1122, 1126, 1129, 1131, 1137, 1139,
140140 /* 90 */ 1141, 1145, 1149, 1154, 1156, 1164, 1168, 1173, 1180, 1184,
140141 /* 100 */ 1187, 1192, -214, -214, -214, -214, -214, -214, -214, -214,
140142 /* 110 */ -214, 132, -45, 97, 8, 164, 379, 175, 255, -214,
140143 /* 120 */ 178, -214, -214, -214, -214, -168, -168, -168, 124, 329,
140144 /* 130 */ 399, 401, -129, 347, 347, 331, 133, 451, 452, 498,
140145 /* 140 */ 500, 502, 503, 505, 487, 506, 488, 490, 507, 543,
140146 /* 150 */ 547, -126, 588, 290, 27, 572, 501, 597, 537, 582,
140147 /* 160 */ 183, 599, 600, 601, 649, 650, 653, 508, 538, -29,
140148 /* 170 */ -156, -152, -137, -79, 135, 74, 130, 242, 338, 378,
140149 /* 180 */ 393, 397, 607, 648, 691, 700, 708, 709, 728, 757,
140150 /* 190 */ 763, 769, 796, 810, 818, 845, 202, 748, 792, 861,
140151 /* 200 */ 862, 815, 866, 903, 905, 850, 931, 932, 896, 937,
140152 /* 210 */ 939, 945, 74, 949, 951, 964, 965, 967, 968, 888,
140153 /* 220 */ 820, 923, 926, 959, 960, 815, 980, 908, 1009, 985,
140154 /* 230 */ 986, 970, 974, 942, 988, 947, 1018, 1011, 1022, 1025,
140155 /* 240 */ 991, 982, 1032, 1038, 1015, 1019, 1064, 984, 1071, 1072,
140156 /* 250 */ 992, 993, 1085, 1061, 1069, 1067, 1093, 1116, 1124, 1128,
140157 /* 260 */ 1133, 1132, 1138, 1086, 1136, 1143, 1146, 1175, 1166, 1108,
140158 /* 270 */ 1113, 1193, 1196, 1201, 1178, 1203, 1205, 1208, 1206, 1190,
140159 /* 280 */ 1195, 1197, 1199, 1194, 1200, 1204, 1207, 1210, 1211, 1212,
140160 /* 290 */ 1213, 1159, 1167, 1169, 1174, 1172, 1176, 1179, 1177, 1222,
140161 /* 300 */ 1170, 1232, 1171, 1221, 1181, 1182, 1223, 1202, 1214, 1216,
140162 /* 310 */ 1215, 1219, 1245, 1249, 1261, 1262, 1266, 1271, 1275, 1183,
140163 /* 320 */ 1185, 1189, 1258, 1253, 1254, 1256, 1259, 1263, 1252, 1255,
140164 /* 330 */ 1268, 1269, 1270, 1278, 1264,
 
140165 };
140166 static const YYACTIONTYPE yy_default[] = {
140167 /* 0 */ 1286, 1276, 1276, 1276, 1209, 1209, 1209, 1209, 1133, 1133,
140168 /* 10 */ 1260, 1036, 1005, 1005, 1005, 1005, 1005, 1005, 1208, 1005,
140169 /* 20 */ 1005, 1005, 1005, 1108, 1139, 1005, 1005, 1005, 1005, 1210,
140170 /* 30 */ 1211, 1005, 1005, 1005, 1259, 1261, 1149, 1148, 1147, 1146,
140171 /* 40 */ 1242, 1120, 1144, 1137, 1141, 1210, 1204, 1205, 1203, 1207,
140172 /* 50 */ 1211, 1005, 1140, 1174, 1188, 1173, 1005, 1005, 1005, 1005,
140173 /* 60 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140174 /* 70 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140175 /* 80 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140176 /* 90 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140177 /* 100 */ 1005, 1005, 1182, 1187, 1194, 1186, 1183, 1176, 1175, 1177,
140178 /* 110 */ 1178, 1005, 1026, 1075, 1005, 1005, 1005, 1276, 1036, 1179,
140179 /* 120 */ 1005, 1180, 1191, 1190, 1189, 1267, 1294, 1293, 1005, 1005,
140180 /* 130 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140181 /* 140 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140182 /* 150 */ 1005, 1005, 1005, 1005, 1005, 1036, 1286, 1276, 1032, 1032,
140183 /* 160 */ 1005, 1276, 1276, 1276, 1276, 1276, 1276, 1272, 1108, 1099,
140184 /* 170 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140185 /* 180 */ 1005, 1264, 1262, 1005, 1224, 1005, 1005, 1005, 1005, 1005,
140186 /* 190 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140187 /* 200 */ 1005, 1005, 1005, 1005, 1005, 1104, 1005, 1005, 1005, 1005,
140188 /* 210 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1288, 1005,
140189 /* 220 */ 1237, 1104, 1104, 1104, 1104, 1106, 1088, 1098, 1036, 1012,
140190 /* 230 */ 1143, 1122, 1122, 1327, 1143, 1327, 1050, 1308, 1047, 1133,
140191 /* 240 */ 1122, 1206, 1133, 1133, 1105, 1098, 1005, 1330, 1113, 1113,
140192 /* 250 */ 1329, 1329, 1113, 1154, 1078, 1143, 1084, 1084, 1084, 1084,
140193 /* 260 */ 1113, 1023, 1143, 1154, 1078, 1078, 1143, 1113, 1023, 1241,
140194 /* 270 */ 1324, 1113, 1113, 1023, 1217, 1113, 1023, 1113, 1023, 1217,
140195 /* 280 */ 1076, 1076, 1076, 1065, 1217, 1076, 1050, 1076, 1065, 1076,
140196 /* 290 */ 1076, 1126, 1121, 1126, 1121, 1126, 1121, 1126, 1121, 1113,
140197 /* 300 */ 1212, 1113, 1005, 1217, 1221, 1221, 1217, 1138, 1127, 1136,
140198 /* 310 */ 1134, 1143, 1029, 1068, 1291, 1291, 1287, 1287, 1287, 1335,
140199 /* 320 */ 1335, 1272, 1303, 1036, 1036, 1036, 1036, 1303, 1052, 1052,
140200 /* 330 */ 1036, 1036, 1036, 1036, 1303, 1005, 1005, 1005, 1005, 1005,
140201 /* 340 */ 1005, 1298, 1005, 1226, 1005, 1005, 1005, 1005, 1005, 1005,
140202 /* 350 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140203 /* 360 */ 1005, 1005, 1159, 1005, 1008, 1269, 1005, 1005, 1268, 1005,
140204 /* 370 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140205 /* 380 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1326,
140206 /* 390 */ 1005, 1005, 1005, 1005, 1005, 1005, 1240, 1239, 1005, 1005,
140207 /* 400 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140208 /* 410 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
140209 /* 420 */ 1005, 1090, 1005, 1005, 1005, 1312, 1005, 1005, 1005, 1005,
140210 /* 430 */ 1005, 1005, 1005, 1135, 1005, 1128, 1005, 1005, 1317, 1005,
140211 /* 440 */ 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1278,
140212 /* 450 */ 1005, 1005, 1005, 1277, 1005, 1005, 1005, 1005, 1005, 1161,
140213 /* 460 */ 1005, 1160, 1164, 1005, 1017, 1005,
 
140214 };
140215 /********** End of lemon-generated parsing tables *****************************/
140216
140217 /* The next table maps tokens (terminal symbols) into fallback tokens.
140218 ** If a construct like the following:
@@ -140594,11 +140967,11 @@
140594 /* 192 */ "raisetype",
140595 /* 193 */ "ifexists",
140596 /* 194 */ "fullname",
140597 /* 195 */ "selectnowith",
140598 /* 196 */ "oneselect",
140599 /* 197 */ "with",
140600 /* 198 */ "multiselect_op",
140601 /* 199 */ "distinct",
140602 /* 200 */ "selcollist",
140603 /* 201 */ "from",
140604 /* 202 */ "where_opt",
@@ -140616,43 +140989,43 @@
140616 /* 214 */ "joinop",
140617 /* 215 */ "indexed_opt",
140618 /* 216 */ "on_opt",
140619 /* 217 */ "using_opt",
140620 /* 218 */ "idlist",
140621 /* 219 */ "setlist",
140622 /* 220 */ "insert_cmd",
140623 /* 221 */ "idlist_opt",
140624 /* 222 */ "likeop",
140625 /* 223 */ "between_op",
140626 /* 224 */ "in_op",
140627 /* 225 */ "paren_exprlist",
140628 /* 226 */ "case_operand",
140629 /* 227 */ "case_exprlist",
140630 /* 228 */ "case_else",
140631 /* 229 */ "uniqueflag",
140632 /* 230 */ "collate",
140633 /* 231 */ "nmnum",
140634 /* 232 */ "trigger_decl",
140635 /* 233 */ "trigger_cmd_list",
140636 /* 234 */ "trigger_time",
140637 /* 235 */ "trigger_event",
140638 /* 236 */ "foreach_clause",
140639 /* 237 */ "when_clause",
140640 /* 238 */ "trigger_cmd",
140641 /* 239 */ "trnm",
140642 /* 240 */ "tridxby",
140643 /* 241 */ "database_kw_opt",
140644 /* 242 */ "key_opt",
140645 /* 243 */ "add_column_fullname",
140646 /* 244 */ "kwcolumn_opt",
140647 /* 245 */ "create_vtab",
140648 /* 246 */ "vtabarglist",
140649 /* 247 */ "vtabarg",
140650 /* 248 */ "vtabargtoken",
140651 /* 249 */ "lp",
140652 /* 250 */ "anylist",
140653 /* 251 */ "wqlist",
140654 };
140655 #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
140656
140657 #ifndef NDEBUG
140658 /* For tracing reduce actions, the names of all rules are required.
@@ -140736,260 +141109,263 @@
140736 /* 75 */ "ifexists ::= IF EXISTS",
140737 /* 76 */ "ifexists ::=",
140738 /* 77 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select",
140739 /* 78 */ "cmd ::= DROP VIEW ifexists fullname",
140740 /* 79 */ "cmd ::= select",
140741 /* 80 */ "select ::= with selectnowith",
140742 /* 81 */ "selectnowith ::= selectnowith multiselect_op oneselect",
140743 /* 82 */ "multiselect_op ::= UNION",
140744 /* 83 */ "multiselect_op ::= UNION ALL",
140745 /* 84 */ "multiselect_op ::= EXCEPT|INTERSECT",
140746 /* 85 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
140747 /* 86 */ "values ::= VALUES LP nexprlist RP",
140748 /* 87 */ "values ::= values COMMA LP exprlist RP",
140749 /* 88 */ "distinct ::= DISTINCT",
140750 /* 89 */ "distinct ::= ALL",
140751 /* 90 */ "distinct ::=",
140752 /* 91 */ "sclp ::=",
140753 /* 92 */ "selcollist ::= sclp scanpt expr scanpt as",
140754 /* 93 */ "selcollist ::= sclp scanpt STAR",
140755 /* 94 */ "selcollist ::= sclp scanpt nm DOT STAR",
140756 /* 95 */ "as ::= AS nm",
140757 /* 96 */ "as ::=",
140758 /* 97 */ "from ::=",
140759 /* 98 */ "from ::= FROM seltablist",
140760 /* 99 */ "stl_prefix ::= seltablist joinop",
140761 /* 100 */ "stl_prefix ::=",
140762 /* 101 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
140763 /* 102 */ "seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt",
140764 /* 103 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
140765 /* 104 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
140766 /* 105 */ "dbnm ::=",
140767 /* 106 */ "dbnm ::= DOT nm",
140768 /* 107 */ "fullname ::= nm dbnm",
140769 /* 108 */ "joinop ::= COMMA|JOIN",
140770 /* 109 */ "joinop ::= JOIN_KW JOIN",
140771 /* 110 */ "joinop ::= JOIN_KW nm JOIN",
140772 /* 111 */ "joinop ::= JOIN_KW nm nm JOIN",
140773 /* 112 */ "on_opt ::= ON expr",
140774 /* 113 */ "on_opt ::=",
140775 /* 114 */ "indexed_opt ::=",
140776 /* 115 */ "indexed_opt ::= INDEXED BY nm",
140777 /* 116 */ "indexed_opt ::= NOT INDEXED",
140778 /* 117 */ "using_opt ::= USING LP idlist RP",
140779 /* 118 */ "using_opt ::=",
140780 /* 119 */ "orderby_opt ::=",
140781 /* 120 */ "orderby_opt ::= ORDER BY sortlist",
140782 /* 121 */ "sortlist ::= sortlist COMMA expr sortorder",
140783 /* 122 */ "sortlist ::= expr sortorder",
140784 /* 123 */ "sortorder ::= ASC",
140785 /* 124 */ "sortorder ::= DESC",
140786 /* 125 */ "sortorder ::=",
140787 /* 126 */ "groupby_opt ::=",
140788 /* 127 */ "groupby_opt ::= GROUP BY nexprlist",
140789 /* 128 */ "having_opt ::=",
140790 /* 129 */ "having_opt ::= HAVING expr",
140791 /* 130 */ "limit_opt ::=",
140792 /* 131 */ "limit_opt ::= LIMIT expr",
140793 /* 132 */ "limit_opt ::= LIMIT expr OFFSET expr",
140794 /* 133 */ "limit_opt ::= LIMIT expr COMMA expr",
140795 /* 134 */ "cmd ::= with DELETE FROM fullname indexed_opt where_opt",
140796 /* 135 */ "where_opt ::=",
140797 /* 136 */ "where_opt ::= WHERE expr",
140798 /* 137 */ "cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt",
140799 /* 138 */ "setlist ::= setlist COMMA nm EQ expr",
140800 /* 139 */ "setlist ::= setlist COMMA LP idlist RP EQ expr",
140801 /* 140 */ "setlist ::= nm EQ expr",
140802 /* 141 */ "setlist ::= LP idlist RP EQ expr",
140803 /* 142 */ "cmd ::= with insert_cmd INTO fullname idlist_opt select",
140804 /* 143 */ "cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES",
140805 /* 144 */ "insert_cmd ::= INSERT orconf",
140806 /* 145 */ "insert_cmd ::= REPLACE",
140807 /* 146 */ "idlist_opt ::=",
140808 /* 147 */ "idlist_opt ::= LP idlist RP",
140809 /* 148 */ "idlist ::= idlist COMMA nm",
140810 /* 149 */ "idlist ::= nm",
140811 /* 150 */ "expr ::= LP expr RP",
140812 /* 151 */ "expr ::= ID|INDEXED",
140813 /* 152 */ "expr ::= JOIN_KW",
140814 /* 153 */ "expr ::= nm DOT nm",
140815 /* 154 */ "expr ::= nm DOT nm DOT nm",
140816 /* 155 */ "term ::= NULL|FLOAT|BLOB",
140817 /* 156 */ "term ::= STRING",
140818 /* 157 */ "term ::= INTEGER",
140819 /* 158 */ "expr ::= VARIABLE",
140820 /* 159 */ "expr ::= expr COLLATE ID|STRING",
140821 /* 160 */ "expr ::= CAST LP expr AS typetoken RP",
140822 /* 161 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
140823 /* 162 */ "expr ::= ID|INDEXED LP STAR RP",
140824 /* 163 */ "term ::= CTIME_KW",
140825 /* 164 */ "expr ::= LP nexprlist COMMA expr RP",
140826 /* 165 */ "expr ::= expr AND expr",
140827 /* 166 */ "expr ::= expr OR expr",
140828 /* 167 */ "expr ::= expr LT|GT|GE|LE expr",
140829 /* 168 */ "expr ::= expr EQ|NE expr",
140830 /* 169 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
140831 /* 170 */ "expr ::= expr PLUS|MINUS expr",
140832 /* 171 */ "expr ::= expr STAR|SLASH|REM expr",
140833 /* 172 */ "expr ::= expr CONCAT expr",
140834 /* 173 */ "likeop ::= NOT LIKE_KW|MATCH",
140835 /* 174 */ "expr ::= expr likeop expr",
140836 /* 175 */ "expr ::= expr likeop expr ESCAPE expr",
140837 /* 176 */ "expr ::= expr ISNULL|NOTNULL",
140838 /* 177 */ "expr ::= expr NOT NULL",
140839 /* 178 */ "expr ::= expr IS expr",
140840 /* 179 */ "expr ::= expr IS NOT expr",
140841 /* 180 */ "expr ::= NOT expr",
140842 /* 181 */ "expr ::= BITNOT expr",
140843 /* 182 */ "expr ::= MINUS expr",
140844 /* 183 */ "expr ::= PLUS expr",
140845 /* 184 */ "between_op ::= BETWEEN",
140846 /* 185 */ "between_op ::= NOT BETWEEN",
140847 /* 186 */ "expr ::= expr between_op expr AND expr",
140848 /* 187 */ "in_op ::= IN",
140849 /* 188 */ "in_op ::= NOT IN",
140850 /* 189 */ "expr ::= expr in_op LP exprlist RP",
140851 /* 190 */ "expr ::= LP select RP",
140852 /* 191 */ "expr ::= expr in_op LP select RP",
140853 /* 192 */ "expr ::= expr in_op nm dbnm paren_exprlist",
140854 /* 193 */ "expr ::= EXISTS LP select RP",
140855 /* 194 */ "expr ::= CASE case_operand case_exprlist case_else END",
140856 /* 195 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
140857 /* 196 */ "case_exprlist ::= WHEN expr THEN expr",
140858 /* 197 */ "case_else ::= ELSE expr",
140859 /* 198 */ "case_else ::=",
140860 /* 199 */ "case_operand ::= expr",
140861 /* 200 */ "case_operand ::=",
140862 /* 201 */ "exprlist ::=",
140863 /* 202 */ "nexprlist ::= nexprlist COMMA expr",
140864 /* 203 */ "nexprlist ::= expr",
140865 /* 204 */ "paren_exprlist ::=",
140866 /* 205 */ "paren_exprlist ::= LP exprlist RP",
140867 /* 206 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
140868 /* 207 */ "uniqueflag ::= UNIQUE",
140869 /* 208 */ "uniqueflag ::=",
140870 /* 209 */ "eidlist_opt ::=",
140871 /* 210 */ "eidlist_opt ::= LP eidlist RP",
140872 /* 211 */ "eidlist ::= eidlist COMMA nm collate sortorder",
140873 /* 212 */ "eidlist ::= nm collate sortorder",
140874 /* 213 */ "collate ::=",
140875 /* 214 */ "collate ::= COLLATE ID|STRING",
140876 /* 215 */ "cmd ::= DROP INDEX ifexists fullname",
140877 /* 216 */ "cmd ::= VACUUM",
140878 /* 217 */ "cmd ::= VACUUM nm",
140879 /* 218 */ "cmd ::= PRAGMA nm dbnm",
140880 /* 219 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
140881 /* 220 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
140882 /* 221 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
140883 /* 222 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
140884 /* 223 */ "plus_num ::= PLUS INTEGER|FLOAT",
140885 /* 224 */ "minus_num ::= MINUS INTEGER|FLOAT",
140886 /* 225 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
140887 /* 226 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
140888 /* 227 */ "trigger_time ::= BEFORE|AFTER",
140889 /* 228 */ "trigger_time ::= INSTEAD OF",
140890 /* 229 */ "trigger_time ::=",
140891 /* 230 */ "trigger_event ::= DELETE|INSERT",
140892 /* 231 */ "trigger_event ::= UPDATE",
140893 /* 232 */ "trigger_event ::= UPDATE OF idlist",
140894 /* 233 */ "when_clause ::=",
140895 /* 234 */ "when_clause ::= WHEN expr",
140896 /* 235 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
140897 /* 236 */ "trigger_cmd_list ::= trigger_cmd SEMI",
140898 /* 237 */ "trnm ::= nm DOT nm",
140899 /* 238 */ "tridxby ::= INDEXED BY nm",
140900 /* 239 */ "tridxby ::= NOT INDEXED",
140901 /* 240 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt",
140902 /* 241 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt",
140903 /* 242 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
140904 /* 243 */ "trigger_cmd ::= scanpt select scanpt",
140905 /* 244 */ "expr ::= RAISE LP IGNORE RP",
140906 /* 245 */ "expr ::= RAISE LP raisetype COMMA nm RP",
140907 /* 246 */ "raisetype ::= ROLLBACK",
140908 /* 247 */ "raisetype ::= ABORT",
140909 /* 248 */ "raisetype ::= FAIL",
140910 /* 249 */ "cmd ::= DROP TRIGGER ifexists fullname",
140911 /* 250 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
140912 /* 251 */ "cmd ::= DETACH database_kw_opt expr",
140913 /* 252 */ "key_opt ::=",
140914 /* 253 */ "key_opt ::= KEY expr",
140915 /* 254 */ "cmd ::= REINDEX",
140916 /* 255 */ "cmd ::= REINDEX nm dbnm",
140917 /* 256 */ "cmd ::= ANALYZE",
140918 /* 257 */ "cmd ::= ANALYZE nm dbnm",
140919 /* 258 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
140920 /* 259 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
140921 /* 260 */ "add_column_fullname ::= fullname",
140922 /* 261 */ "cmd ::= create_vtab",
140923 /* 262 */ "cmd ::= create_vtab LP vtabarglist RP",
140924 /* 263 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
140925 /* 264 */ "vtabarg ::=",
140926 /* 265 */ "vtabargtoken ::= ANY",
140927 /* 266 */ "vtabargtoken ::= lp anylist RP",
140928 /* 267 */ "lp ::= LP",
140929 /* 268 */ "with ::=",
140930 /* 269 */ "with ::= WITH wqlist",
140931 /* 270 */ "with ::= WITH RECURSIVE wqlist",
140932 /* 271 */ "wqlist ::= nm eidlist_opt AS LP select RP",
140933 /* 272 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
140934 /* 273 */ "input ::= cmdlist",
140935 /* 274 */ "cmdlist ::= cmdlist ecmd",
140936 /* 275 */ "cmdlist ::= ecmd",
140937 /* 276 */ "ecmd ::= SEMI",
140938 /* 277 */ "ecmd ::= explain cmdx SEMI",
140939 /* 278 */ "explain ::=",
140940 /* 279 */ "trans_opt ::=",
140941 /* 280 */ "trans_opt ::= TRANSACTION",
140942 /* 281 */ "trans_opt ::= TRANSACTION nm",
140943 /* 282 */ "savepoint_opt ::= SAVEPOINT",
140944 /* 283 */ "savepoint_opt ::=",
140945 /* 284 */ "cmd ::= create_table create_table_args",
140946 /* 285 */ "columnlist ::= columnlist COMMA columnname carglist",
140947 /* 286 */ "columnlist ::= columnname carglist",
140948 /* 287 */ "nm ::= ID|INDEXED",
140949 /* 288 */ "nm ::= STRING",
140950 /* 289 */ "nm ::= JOIN_KW",
140951 /* 290 */ "typetoken ::= typename",
140952 /* 291 */ "typename ::= ID|STRING",
140953 /* 292 */ "signed ::= plus_num",
140954 /* 293 */ "signed ::= minus_num",
140955 /* 294 */ "carglist ::= carglist ccons",
140956 /* 295 */ "carglist ::=",
140957 /* 296 */ "ccons ::= NULL onconf",
140958 /* 297 */ "conslist_opt ::= COMMA conslist",
140959 /* 298 */ "conslist ::= conslist tconscomma tcons",
140960 /* 299 */ "conslist ::= tcons",
140961 /* 300 */ "tconscomma ::=",
140962 /* 301 */ "defer_subclause_opt ::= defer_subclause",
140963 /* 302 */ "resolvetype ::= raisetype",
140964 /* 303 */ "selectnowith ::= oneselect",
140965 /* 304 */ "oneselect ::= values",
140966 /* 305 */ "sclp ::= selcollist COMMA",
140967 /* 306 */ "as ::= ID|STRING",
140968 /* 307 */ "expr ::= term",
140969 /* 308 */ "likeop ::= LIKE_KW|MATCH",
140970 /* 309 */ "exprlist ::= nexprlist",
140971 /* 310 */ "nmnum ::= plus_num",
140972 /* 311 */ "nmnum ::= nm",
140973 /* 312 */ "nmnum ::= ON",
140974 /* 313 */ "nmnum ::= DELETE",
140975 /* 314 */ "nmnum ::= DEFAULT",
140976 /* 315 */ "plus_num ::= INTEGER|FLOAT",
140977 /* 316 */ "foreach_clause ::=",
140978 /* 317 */ "foreach_clause ::= FOR EACH ROW",
140979 /* 318 */ "trnm ::= nm",
140980 /* 319 */ "tridxby ::=",
140981 /* 320 */ "database_kw_opt ::= DATABASE",
140982 /* 321 */ "database_kw_opt ::=",
140983 /* 322 */ "kwcolumn_opt ::=",
140984 /* 323 */ "kwcolumn_opt ::= COLUMNKW",
140985 /* 324 */ "vtabarglist ::= vtabarg",
140986 /* 325 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
140987 /* 326 */ "vtabarg ::= vtabarg vtabargtoken",
140988 /* 327 */ "anylist ::=",
140989 /* 328 */ "anylist ::= anylist LP anylist RP",
140990 /* 329 */ "anylist ::= anylist ANY",
 
 
 
140991 };
140992 #endif /* NDEBUG */
140993
140994
140995 #if YYSTACKDEPTH<=0
@@ -141119,14 +141495,14 @@
141119 case 173: /* term */
141120 case 174: /* expr */
141121 case 202: /* where_opt */
141122 case 204: /* having_opt */
141123 case 216: /* on_opt */
141124 case 226: /* case_operand */
141125 case 228: /* case_else */
141126 case 237: /* when_clause */
141127 case 242: /* key_opt */
141128 {
141129 sqlite3ExprDelete(pParse->db, (yypminor->yy314));
141130 }
141131 break;
141132 case 178: /* eidlist_opt */
@@ -141136,13 +141512,13 @@
141136 case 203: /* groupby_opt */
141137 case 205: /* orderby_opt */
141138 case 208: /* nexprlist */
141139 case 209: /* exprlist */
141140 case 210: /* sclp */
141141 case 219: /* setlist */
141142 case 225: /* paren_exprlist */
141143 case 227: /* case_exprlist */
141144 {
141145 sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
141146 }
141147 break;
141148 case 194: /* fullname */
@@ -141151,30 +141527,29 @@
141151 case 213: /* stl_prefix */
141152 {
141153 sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
141154 }
141155 break;
141156 case 197: /* with */
141157 case 251: /* wqlist */
141158 {
141159 sqlite3WithDelete(pParse->db, (yypminor->yy451));
141160 }
141161 break;
141162 case 217: /* using_opt */
141163 case 218: /* idlist */
141164 case 221: /* idlist_opt */
141165 {
141166 sqlite3IdListDelete(pParse->db, (yypminor->yy384));
141167 }
141168 break;
141169 case 233: /* trigger_cmd_list */
141170 case 238: /* trigger_cmd */
141171 {
141172 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
141173 }
141174 break;
141175 case 235: /* trigger_event */
141176 {
141177 sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
141178 }
141179 break;
141180 /********* End destructor definitions *****************************************/
@@ -141549,260 +141924,263 @@
141549 { 193, -2 }, /* (75) ifexists ::= IF EXISTS */
141550 { 193, 0 }, /* (76) ifexists ::= */
141551 { 149, -9 }, /* (77) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
141552 { 149, -4 }, /* (78) cmd ::= DROP VIEW ifexists fullname */
141553 { 149, -1 }, /* (79) cmd ::= select */
141554 { 163, -2 }, /* (80) select ::= with selectnowith */
141555 { 195, -3 }, /* (81) selectnowith ::= selectnowith multiselect_op oneselect */
141556 { 198, -1 }, /* (82) multiselect_op ::= UNION */
141557 { 198, -2 }, /* (83) multiselect_op ::= UNION ALL */
141558 { 198, -1 }, /* (84) multiselect_op ::= EXCEPT|INTERSECT */
141559 { 196, -9 }, /* (85) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
141560 { 207, -4 }, /* (86) values ::= VALUES LP nexprlist RP */
141561 { 207, -5 }, /* (87) values ::= values COMMA LP exprlist RP */
141562 { 199, -1 }, /* (88) distinct ::= DISTINCT */
141563 { 199, -1 }, /* (89) distinct ::= ALL */
141564 { 199, 0 }, /* (90) distinct ::= */
141565 { 210, 0 }, /* (91) sclp ::= */
141566 { 200, -5 }, /* (92) selcollist ::= sclp scanpt expr scanpt as */
141567 { 200, -3 }, /* (93) selcollist ::= sclp scanpt STAR */
141568 { 200, -5 }, /* (94) selcollist ::= sclp scanpt nm DOT STAR */
141569 { 211, -2 }, /* (95) as ::= AS nm */
141570 { 211, 0 }, /* (96) as ::= */
141571 { 201, 0 }, /* (97) from ::= */
141572 { 201, -2 }, /* (98) from ::= FROM seltablist */
141573 { 213, -2 }, /* (99) stl_prefix ::= seltablist joinop */
141574 { 213, 0 }, /* (100) stl_prefix ::= */
141575 { 212, -7 }, /* (101) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
141576 { 212, -9 }, /* (102) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
141577 { 212, -7 }, /* (103) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
141578 { 212, -7 }, /* (104) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
141579 { 159, 0 }, /* (105) dbnm ::= */
141580 { 159, -2 }, /* (106) dbnm ::= DOT nm */
141581 { 194, -2 }, /* (107) fullname ::= nm dbnm */
141582 { 214, -1 }, /* (108) joinop ::= COMMA|JOIN */
141583 { 214, -2 }, /* (109) joinop ::= JOIN_KW JOIN */
141584 { 214, -3 }, /* (110) joinop ::= JOIN_KW nm JOIN */
141585 { 214, -4 }, /* (111) joinop ::= JOIN_KW nm nm JOIN */
141586 { 216, -2 }, /* (112) on_opt ::= ON expr */
141587 { 216, 0 }, /* (113) on_opt ::= */
141588 { 215, 0 }, /* (114) indexed_opt ::= */
141589 { 215, -3 }, /* (115) indexed_opt ::= INDEXED BY nm */
141590 { 215, -2 }, /* (116) indexed_opt ::= NOT INDEXED */
141591 { 217, -4 }, /* (117) using_opt ::= USING LP idlist RP */
141592 { 217, 0 }, /* (118) using_opt ::= */
141593 { 205, 0 }, /* (119) orderby_opt ::= */
141594 { 205, -3 }, /* (120) orderby_opt ::= ORDER BY sortlist */
141595 { 187, -4 }, /* (121) sortlist ::= sortlist COMMA expr sortorder */
141596 { 187, -2 }, /* (122) sortlist ::= expr sortorder */
141597 { 176, -1 }, /* (123) sortorder ::= ASC */
141598 { 176, -1 }, /* (124) sortorder ::= DESC */
141599 { 176, 0 }, /* (125) sortorder ::= */
141600 { 203, 0 }, /* (126) groupby_opt ::= */
141601 { 203, -3 }, /* (127) groupby_opt ::= GROUP BY nexprlist */
141602 { 204, 0 }, /* (128) having_opt ::= */
141603 { 204, -2 }, /* (129) having_opt ::= HAVING expr */
141604 { 206, 0 }, /* (130) limit_opt ::= */
141605 { 206, -2 }, /* (131) limit_opt ::= LIMIT expr */
141606 { 206, -4 }, /* (132) limit_opt ::= LIMIT expr OFFSET expr */
141607 { 206, -4 }, /* (133) limit_opt ::= LIMIT expr COMMA expr */
141608 { 149, -6 }, /* (134) cmd ::= with DELETE FROM fullname indexed_opt where_opt */
141609 { 202, 0 }, /* (135) where_opt ::= */
141610 { 202, -2 }, /* (136) where_opt ::= WHERE expr */
141611 { 149, -8 }, /* (137) cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */
141612 { 219, -5 }, /* (138) setlist ::= setlist COMMA nm EQ expr */
141613 { 219, -7 }, /* (139) setlist ::= setlist COMMA LP idlist RP EQ expr */
141614 { 219, -3 }, /* (140) setlist ::= nm EQ expr */
141615 { 219, -5 }, /* (141) setlist ::= LP idlist RP EQ expr */
141616 { 149, -6 }, /* (142) cmd ::= with insert_cmd INTO fullname idlist_opt select */
141617 { 149, -7 }, /* (143) cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */
141618 { 220, -2 }, /* (144) insert_cmd ::= INSERT orconf */
141619 { 220, -1 }, /* (145) insert_cmd ::= REPLACE */
141620 { 221, 0 }, /* (146) idlist_opt ::= */
141621 { 221, -3 }, /* (147) idlist_opt ::= LP idlist RP */
141622 { 218, -3 }, /* (148) idlist ::= idlist COMMA nm */
141623 { 218, -1 }, /* (149) idlist ::= nm */
141624 { 174, -3 }, /* (150) expr ::= LP expr RP */
141625 { 174, -1 }, /* (151) expr ::= ID|INDEXED */
141626 { 174, -1 }, /* (152) expr ::= JOIN_KW */
141627 { 174, -3 }, /* (153) expr ::= nm DOT nm */
141628 { 174, -5 }, /* (154) expr ::= nm DOT nm DOT nm */
141629 { 173, -1 }, /* (155) term ::= NULL|FLOAT|BLOB */
141630 { 173, -1 }, /* (156) term ::= STRING */
141631 { 173, -1 }, /* (157) term ::= INTEGER */
141632 { 174, -1 }, /* (158) expr ::= VARIABLE */
141633 { 174, -3 }, /* (159) expr ::= expr COLLATE ID|STRING */
141634 { 174, -6 }, /* (160) expr ::= CAST LP expr AS typetoken RP */
141635 { 174, -5 }, /* (161) expr ::= ID|INDEXED LP distinct exprlist RP */
141636 { 174, -4 }, /* (162) expr ::= ID|INDEXED LP STAR RP */
141637 { 173, -1 }, /* (163) term ::= CTIME_KW */
141638 { 174, -5 }, /* (164) expr ::= LP nexprlist COMMA expr RP */
141639 { 174, -3 }, /* (165) expr ::= expr AND expr */
141640 { 174, -3 }, /* (166) expr ::= expr OR expr */
141641 { 174, -3 }, /* (167) expr ::= expr LT|GT|GE|LE expr */
141642 { 174, -3 }, /* (168) expr ::= expr EQ|NE expr */
141643 { 174, -3 }, /* (169) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
141644 { 174, -3 }, /* (170) expr ::= expr PLUS|MINUS expr */
141645 { 174, -3 }, /* (171) expr ::= expr STAR|SLASH|REM expr */
141646 { 174, -3 }, /* (172) expr ::= expr CONCAT expr */
141647 { 222, -2 }, /* (173) likeop ::= NOT LIKE_KW|MATCH */
141648 { 174, -3 }, /* (174) expr ::= expr likeop expr */
141649 { 174, -5 }, /* (175) expr ::= expr likeop expr ESCAPE expr */
141650 { 174, -2 }, /* (176) expr ::= expr ISNULL|NOTNULL */
141651 { 174, -3 }, /* (177) expr ::= expr NOT NULL */
141652 { 174, -3 }, /* (178) expr ::= expr IS expr */
141653 { 174, -4 }, /* (179) expr ::= expr IS NOT expr */
141654 { 174, -2 }, /* (180) expr ::= NOT expr */
141655 { 174, -2 }, /* (181) expr ::= BITNOT expr */
141656 { 174, -2 }, /* (182) expr ::= MINUS expr */
141657 { 174, -2 }, /* (183) expr ::= PLUS expr */
141658 { 223, -1 }, /* (184) between_op ::= BETWEEN */
141659 { 223, -2 }, /* (185) between_op ::= NOT BETWEEN */
141660 { 174, -5 }, /* (186) expr ::= expr between_op expr AND expr */
141661 { 224, -1 }, /* (187) in_op ::= IN */
141662 { 224, -2 }, /* (188) in_op ::= NOT IN */
141663 { 174, -5 }, /* (189) expr ::= expr in_op LP exprlist RP */
141664 { 174, -3 }, /* (190) expr ::= LP select RP */
141665 { 174, -5 }, /* (191) expr ::= expr in_op LP select RP */
141666 { 174, -5 }, /* (192) expr ::= expr in_op nm dbnm paren_exprlist */
141667 { 174, -4 }, /* (193) expr ::= EXISTS LP select RP */
141668 { 174, -5 }, /* (194) expr ::= CASE case_operand case_exprlist case_else END */
141669 { 227, -5 }, /* (195) case_exprlist ::= case_exprlist WHEN expr THEN expr */
141670 { 227, -4 }, /* (196) case_exprlist ::= WHEN expr THEN expr */
141671 { 228, -2 }, /* (197) case_else ::= ELSE expr */
141672 { 228, 0 }, /* (198) case_else ::= */
141673 { 226, -1 }, /* (199) case_operand ::= expr */
141674 { 226, 0 }, /* (200) case_operand ::= */
141675 { 209, 0 }, /* (201) exprlist ::= */
141676 { 208, -3 }, /* (202) nexprlist ::= nexprlist COMMA expr */
141677 { 208, -1 }, /* (203) nexprlist ::= expr */
141678 { 225, 0 }, /* (204) paren_exprlist ::= */
141679 { 225, -3 }, /* (205) paren_exprlist ::= LP exprlist RP */
141680 { 149, -12 }, /* (206) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
141681 { 229, -1 }, /* (207) uniqueflag ::= UNIQUE */
141682 { 229, 0 }, /* (208) uniqueflag ::= */
141683 { 178, 0 }, /* (209) eidlist_opt ::= */
141684 { 178, -3 }, /* (210) eidlist_opt ::= LP eidlist RP */
141685 { 188, -5 }, /* (211) eidlist ::= eidlist COMMA nm collate sortorder */
141686 { 188, -3 }, /* (212) eidlist ::= nm collate sortorder */
141687 { 230, 0 }, /* (213) collate ::= */
141688 { 230, -2 }, /* (214) collate ::= COLLATE ID|STRING */
141689 { 149, -4 }, /* (215) cmd ::= DROP INDEX ifexists fullname */
141690 { 149, -1 }, /* (216) cmd ::= VACUUM */
141691 { 149, -2 }, /* (217) cmd ::= VACUUM nm */
141692 { 149, -3 }, /* (218) cmd ::= PRAGMA nm dbnm */
141693 { 149, -5 }, /* (219) cmd ::= PRAGMA nm dbnm EQ nmnum */
141694 { 149, -6 }, /* (220) cmd ::= PRAGMA nm dbnm LP nmnum RP */
141695 { 149, -5 }, /* (221) cmd ::= PRAGMA nm dbnm EQ minus_num */
141696 { 149, -6 }, /* (222) cmd ::= PRAGMA nm dbnm LP minus_num RP */
141697 { 169, -2 }, /* (223) plus_num ::= PLUS INTEGER|FLOAT */
141698 { 170, -2 }, /* (224) minus_num ::= MINUS INTEGER|FLOAT */
141699 { 149, -5 }, /* (225) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
141700 { 232, -11 }, /* (226) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
141701 { 234, -1 }, /* (227) trigger_time ::= BEFORE|AFTER */
141702 { 234, -2 }, /* (228) trigger_time ::= INSTEAD OF */
141703 { 234, 0 }, /* (229) trigger_time ::= */
141704 { 235, -1 }, /* (230) trigger_event ::= DELETE|INSERT */
141705 { 235, -1 }, /* (231) trigger_event ::= UPDATE */
141706 { 235, -3 }, /* (232) trigger_event ::= UPDATE OF idlist */
141707 { 237, 0 }, /* (233) when_clause ::= */
141708 { 237, -2 }, /* (234) when_clause ::= WHEN expr */
141709 { 233, -3 }, /* (235) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
141710 { 233, -2 }, /* (236) trigger_cmd_list ::= trigger_cmd SEMI */
141711 { 239, -3 }, /* (237) trnm ::= nm DOT nm */
141712 { 240, -3 }, /* (238) tridxby ::= INDEXED BY nm */
141713 { 240, -2 }, /* (239) tridxby ::= NOT INDEXED */
141714 { 238, -8 }, /* (240) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
141715 { 238, -7 }, /* (241) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */
141716 { 238, -6 }, /* (242) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
141717 { 238, -3 }, /* (243) trigger_cmd ::= scanpt select scanpt */
141718 { 174, -4 }, /* (244) expr ::= RAISE LP IGNORE RP */
141719 { 174, -6 }, /* (245) expr ::= RAISE LP raisetype COMMA nm RP */
141720 { 192, -1 }, /* (246) raisetype ::= ROLLBACK */
141721 { 192, -1 }, /* (247) raisetype ::= ABORT */
141722 { 192, -1 }, /* (248) raisetype ::= FAIL */
141723 { 149, -4 }, /* (249) cmd ::= DROP TRIGGER ifexists fullname */
141724 { 149, -6 }, /* (250) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
141725 { 149, -3 }, /* (251) cmd ::= DETACH database_kw_opt expr */
141726 { 242, 0 }, /* (252) key_opt ::= */
141727 { 242, -2 }, /* (253) key_opt ::= KEY expr */
141728 { 149, -1 }, /* (254) cmd ::= REINDEX */
141729 { 149, -3 }, /* (255) cmd ::= REINDEX nm dbnm */
141730 { 149, -1 }, /* (256) cmd ::= ANALYZE */
141731 { 149, -3 }, /* (257) cmd ::= ANALYZE nm dbnm */
141732 { 149, -6 }, /* (258) cmd ::= ALTER TABLE fullname RENAME TO nm */
141733 { 149, -7 }, /* (259) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
141734 { 243, -1 }, /* (260) add_column_fullname ::= fullname */
141735 { 149, -1 }, /* (261) cmd ::= create_vtab */
141736 { 149, -4 }, /* (262) cmd ::= create_vtab LP vtabarglist RP */
141737 { 245, -8 }, /* (263) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
141738 { 247, 0 }, /* (264) vtabarg ::= */
141739 { 248, -1 }, /* (265) vtabargtoken ::= ANY */
141740 { 248, -3 }, /* (266) vtabargtoken ::= lp anylist RP */
141741 { 249, -1 }, /* (267) lp ::= LP */
141742 { 197, 0 }, /* (268) with ::= */
141743 { 197, -2 }, /* (269) with ::= WITH wqlist */
141744 { 197, -3 }, /* (270) with ::= WITH RECURSIVE wqlist */
141745 { 251, -6 }, /* (271) wqlist ::= nm eidlist_opt AS LP select RP */
141746 { 251, -8 }, /* (272) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
141747 { 144, -1 }, /* (273) input ::= cmdlist */
141748 { 145, -2 }, /* (274) cmdlist ::= cmdlist ecmd */
141749 { 145, -1 }, /* (275) cmdlist ::= ecmd */
141750 { 146, -1 }, /* (276) ecmd ::= SEMI */
141751 { 146, -3 }, /* (277) ecmd ::= explain cmdx SEMI */
141752 { 147, 0 }, /* (278) explain ::= */
141753 { 151, 0 }, /* (279) trans_opt ::= */
141754 { 151, -1 }, /* (280) trans_opt ::= TRANSACTION */
141755 { 151, -2 }, /* (281) trans_opt ::= TRANSACTION nm */
141756 { 153, -1 }, /* (282) savepoint_opt ::= SAVEPOINT */
141757 { 153, 0 }, /* (283) savepoint_opt ::= */
141758 { 149, -2 }, /* (284) cmd ::= create_table create_table_args */
141759 { 160, -4 }, /* (285) columnlist ::= columnlist COMMA columnname carglist */
141760 { 160, -2 }, /* (286) columnlist ::= columnname carglist */
141761 { 152, -1 }, /* (287) nm ::= ID|INDEXED */
141762 { 152, -1 }, /* (288) nm ::= STRING */
141763 { 152, -1 }, /* (289) nm ::= JOIN_KW */
141764 { 166, -1 }, /* (290) typetoken ::= typename */
141765 { 167, -1 }, /* (291) typename ::= ID|STRING */
141766 { 168, -1 }, /* (292) signed ::= plus_num */
141767 { 168, -1 }, /* (293) signed ::= minus_num */
141768 { 165, -2 }, /* (294) carglist ::= carglist ccons */
141769 { 165, 0 }, /* (295) carglist ::= */
141770 { 172, -2 }, /* (296) ccons ::= NULL onconf */
141771 { 161, -2 }, /* (297) conslist_opt ::= COMMA conslist */
141772 { 184, -3 }, /* (298) conslist ::= conslist tconscomma tcons */
141773 { 184, -1 }, /* (299) conslist ::= tcons */
141774 { 185, 0 }, /* (300) tconscomma ::= */
141775 { 189, -1 }, /* (301) defer_subclause_opt ::= defer_subclause */
141776 { 191, -1 }, /* (302) resolvetype ::= raisetype */
141777 { 195, -1 }, /* (303) selectnowith ::= oneselect */
141778 { 196, -1 }, /* (304) oneselect ::= values */
141779 { 210, -2 }, /* (305) sclp ::= selcollist COMMA */
141780 { 211, -1 }, /* (306) as ::= ID|STRING */
141781 { 174, -1 }, /* (307) expr ::= term */
141782 { 222, -1 }, /* (308) likeop ::= LIKE_KW|MATCH */
141783 { 209, -1 }, /* (309) exprlist ::= nexprlist */
141784 { 231, -1 }, /* (310) nmnum ::= plus_num */
141785 { 231, -1 }, /* (311) nmnum ::= nm */
141786 { 231, -1 }, /* (312) nmnum ::= ON */
141787 { 231, -1 }, /* (313) nmnum ::= DELETE */
141788 { 231, -1 }, /* (314) nmnum ::= DEFAULT */
141789 { 169, -1 }, /* (315) plus_num ::= INTEGER|FLOAT */
141790 { 236, 0 }, /* (316) foreach_clause ::= */
141791 { 236, -3 }, /* (317) foreach_clause ::= FOR EACH ROW */
141792 { 239, -1 }, /* (318) trnm ::= nm */
141793 { 240, 0 }, /* (319) tridxby ::= */
141794 { 241, -1 }, /* (320) database_kw_opt ::= DATABASE */
141795 { 241, 0 }, /* (321) database_kw_opt ::= */
141796 { 244, 0 }, /* (322) kwcolumn_opt ::= */
141797 { 244, -1 }, /* (323) kwcolumn_opt ::= COLUMNKW */
141798 { 246, -1 }, /* (324) vtabarglist ::= vtabarg */
141799 { 246, -3 }, /* (325) vtabarglist ::= vtabarglist COMMA vtabarg */
141800 { 247, -2 }, /* (326) vtabarg ::= vtabarg vtabargtoken */
141801 { 250, 0 }, /* (327) anylist ::= */
141802 { 250, -4 }, /* (328) anylist ::= anylist LP anylist RP */
141803 { 250, -2 }, /* (329) anylist ::= anylist ANY */
 
 
 
141804 };
141805
141806 static void yy_accept(yyParser*); /* Forward Declaration */
141807
141808 /*
@@ -141932,12 +142310,12 @@
141932 case 21: /* table_options ::= */ yytestcase(yyruleno==21);
141933 case 42: /* autoinc ::= */ yytestcase(yyruleno==42);
141934 case 57: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==57);
141935 case 67: /* defer_subclause_opt ::= */ yytestcase(yyruleno==67);
141936 case 76: /* ifexists ::= */ yytestcase(yyruleno==76);
141937 case 90: /* distinct ::= */ yytestcase(yyruleno==90);
141938 case 213: /* collate ::= */ yytestcase(yyruleno==213);
141939 {yymsp[1].minor.yy4 = 0;}
141940 break;
141941 case 16: /* ifnotexists ::= IF NOT EXISTS */
141942 {yymsp[-2].minor.yy4 = 1;}
141943 break;
@@ -141969,11 +142347,11 @@
141969 case 23: /* columnname ::= nm typetoken */
141970 {sqlite3AddColumn(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
141971 break;
141972 case 24: /* typetoken ::= */
141973 case 60: /* conslist_opt ::= */ yytestcase(yyruleno==60);
141974 case 96: /* as ::= */ yytestcase(yyruleno==96);
141975 {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = 0;}
141976 break;
141977 case 25: /* typetoken ::= typename LP signed RP */
141978 {
141979 yymsp[-3].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
@@ -142080,18 +142458,18 @@
142080 case 55: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
142081 {yymsp[-2].minor.yy4 = 0;}
142082 break;
142083 case 56: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
142084 case 71: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==71);
142085 case 144: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==144);
142086 {yymsp[-1].minor.yy4 = yymsp[0].minor.yy4;}
142087 break;
142088 case 58: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
142089 case 75: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==75);
142090 case 185: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==185);
142091 case 188: /* in_op ::= NOT IN */ yytestcase(yyruleno==188);
142092 case 214: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==214);
142093 {yymsp[-1].minor.yy4 = 1;}
142094 break;
142095 case 59: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
142096 {yymsp[-1].minor.yy4 = 0;}
142097 break;
@@ -142123,11 +142501,11 @@
142123 break;
142124 case 72: /* resolvetype ::= IGNORE */
142125 {yymsp[0].minor.yy4 = OE_Ignore;}
142126 break;
142127 case 73: /* resolvetype ::= REPLACE */
142128 case 145: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==145);
142129 {yymsp[0].minor.yy4 = OE_Replace;}
142130 break;
142131 case 74: /* cmd ::= DROP TABLE ifexists fullname */
142132 {
142133 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
@@ -142148,23 +142526,44 @@
142148 SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0};
142149 sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
142150 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
142151 }
142152 break;
142153 case 80: /* select ::= with selectnowith */
 
 
 
 
 
 
 
 
 
 
 
 
142154 {
142155 Select *p = yymsp[0].minor.yy387;
142156 if( p ){
142157 p->pWith = yymsp[-1].minor.yy451;
142158 parserDoubleLinkSelect(pParse, p);
142159 }else{
142160 sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy451);
142161 }
142162 yymsp[-1].minor.yy387 = p; /*A-overwrites-W*/
142163 }
142164 break;
142165 case 81: /* selectnowith ::= selectnowith multiselect_op oneselect */
 
 
 
 
 
 
 
 
 
142166 {
142167 Select *pRhs = yymsp[0].minor.yy387;
142168 Select *pLhs = yymsp[-2].minor.yy387;
142169 if( pRhs && pRhs->pPrior ){
142170 SrcList *pFrom;
@@ -142184,18 +142583,18 @@
142184 sqlite3SelectDelete(pParse->db, pLhs);
142185 }
142186 yymsp[-2].minor.yy387 = pRhs;
142187 }
142188 break;
142189 case 82: /* multiselect_op ::= UNION */
142190 case 84: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==84);
142191 {yymsp[0].minor.yy4 = yymsp[0].major; /*A-overwrites-OP*/}
142192 break;
142193 case 83: /* multiselect_op ::= UNION ALL */
142194 {yymsp[-1].minor.yy4 = TK_ALL;}
142195 break;
142196 case 85: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
142197 {
142198 #if SELECTTRACE_ENABLED
142199 Token s = yymsp[-8].minor.yy0; /*A-overwrites-S*/
142200 #endif
142201 yymsp[-8].minor.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.yy314);
@@ -142222,16 +142621,16 @@
142222 }
142223 }
142224 #endif /* SELECTRACE_ENABLED */
142225 }
142226 break;
142227 case 86: /* values ::= VALUES LP nexprlist RP */
142228 {
142229 yymsp[-3].minor.yy387 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values,0);
142230 }
142231 break;
142232 case 87: /* values ::= values COMMA LP exprlist RP */
142233 {
142234 Select *pRight, *pLeft = yymsp[-4].minor.yy387;
142235 pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values|SF_MultiValue,0);
142236 if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
142237 if( pRight ){
@@ -142241,86 +142640,86 @@
142241 }else{
142242 yymsp[-4].minor.yy387 = pLeft;
142243 }
142244 }
142245 break;
142246 case 88: /* distinct ::= DISTINCT */
142247 {yymsp[0].minor.yy4 = SF_Distinct;}
142248 break;
142249 case 89: /* distinct ::= ALL */
142250 {yymsp[0].minor.yy4 = SF_All;}
142251 break;
142252 case 91: /* sclp ::= */
142253 case 119: /* orderby_opt ::= */ yytestcase(yyruleno==119);
142254 case 126: /* groupby_opt ::= */ yytestcase(yyruleno==126);
142255 case 201: /* exprlist ::= */ yytestcase(yyruleno==201);
142256 case 204: /* paren_exprlist ::= */ yytestcase(yyruleno==204);
142257 case 209: /* eidlist_opt ::= */ yytestcase(yyruleno==209);
142258 {yymsp[1].minor.yy322 = 0;}
142259 break;
142260 case 92: /* selcollist ::= sclp scanpt expr scanpt as */
142261 {
142262 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[-2].minor.yy314);
142263 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[0].minor.yy0, 1);
142264 sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy322,yymsp[-3].minor.yy336,yymsp[-1].minor.yy336);
142265 }
142266 break;
142267 case 93: /* selcollist ::= sclp scanpt STAR */
142268 {
142269 Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
142270 yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, p);
142271 }
142272 break;
142273 case 94: /* selcollist ::= sclp scanpt nm DOT STAR */
142274 {
142275 Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
142276 Expr *pLeft = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
142277 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
142278 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, pDot);
142279 }
142280 break;
142281 case 95: /* as ::= AS nm */
142282 case 106: /* dbnm ::= DOT nm */ yytestcase(yyruleno==106);
142283 case 223: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==223);
142284 case 224: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==224);
142285 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
142286 break;
142287 case 97: /* from ::= */
142288 {yymsp[1].minor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy259));}
142289 break;
142290 case 98: /* from ::= FROM seltablist */
142291 {
142292 yymsp[-1].minor.yy259 = yymsp[0].minor.yy259;
142293 sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy259);
142294 }
142295 break;
142296 case 99: /* stl_prefix ::= seltablist joinop */
142297 {
142298 if( ALWAYS(yymsp[-1].minor.yy259 && yymsp[-1].minor.yy259->nSrc>0) ) yymsp[-1].minor.yy259->a[yymsp[-1].minor.yy259->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy4;
142299 }
142300 break;
142301 case 100: /* stl_prefix ::= */
142302 {yymsp[1].minor.yy259 = 0;}
142303 break;
142304 case 101: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
142305 {
142306 yymsp[-6].minor.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);
142307 sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy259, &yymsp[-2].minor.yy0);
142308 }
142309 break;
142310 case 102: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
142311 {
142312 yymsp[-8].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy259,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
142313 sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy259, yymsp[-4].minor.yy322);
142314 }
142315 break;
142316 case 103: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
142317 {
142318 yymsp[-6].minor.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);
142319 }
142320 break;
142321 case 104: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
142322 {
142323 if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
142324 yymsp[-6].minor.yy259 = yymsp[-4].minor.yy259;
142325 }else if( yymsp[-4].minor.yy259->nSrc==1 ){
142326 yymsp[-6].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
@@ -142340,185 +142739,184 @@
142340 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,SF_NestedFrom,0);
142341 yymsp[-6].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
142342 }
142343 }
142344 break;
142345 case 105: /* dbnm ::= */
142346 case 114: /* indexed_opt ::= */ yytestcase(yyruleno==114);
142347 {yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
142348 break;
142349 case 107: /* fullname ::= nm dbnm */
142350 {yymsp[-1].minor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
142351 break;
142352 case 108: /* joinop ::= COMMA|JOIN */
 
 
 
142353 { yymsp[0].minor.yy4 = JT_INNER; }
142354 break;
142355 case 109: /* joinop ::= JOIN_KW JOIN */
142356 {yymsp[-1].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
142357 break;
142358 case 110: /* joinop ::= JOIN_KW nm JOIN */
142359 {yymsp[-2].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
142360 break;
142361 case 111: /* joinop ::= JOIN_KW nm nm JOIN */
142362 {yymsp[-3].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
142363 break;
142364 case 112: /* on_opt ::= ON expr */
142365 case 129: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==129);
142366 case 136: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==136);
142367 case 197: /* case_else ::= ELSE expr */ yytestcase(yyruleno==197);
142368 {yymsp[-1].minor.yy314 = yymsp[0].minor.yy314;}
142369 break;
142370 case 113: /* on_opt ::= */
142371 case 128: /* having_opt ::= */ yytestcase(yyruleno==128);
142372 case 130: /* limit_opt ::= */ yytestcase(yyruleno==130);
142373 case 135: /* where_opt ::= */ yytestcase(yyruleno==135);
142374 case 198: /* case_else ::= */ yytestcase(yyruleno==198);
142375 case 200: /* case_operand ::= */ yytestcase(yyruleno==200);
142376 {yymsp[1].minor.yy314 = 0;}
142377 break;
142378 case 115: /* indexed_opt ::= INDEXED BY nm */
142379 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
142380 break;
142381 case 116: /* indexed_opt ::= NOT INDEXED */
142382 {yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
142383 break;
142384 case 117: /* using_opt ::= USING LP idlist RP */
142385 {yymsp[-3].minor.yy384 = yymsp[-1].minor.yy384;}
142386 break;
142387 case 118: /* using_opt ::= */
142388 case 146: /* idlist_opt ::= */ yytestcase(yyruleno==146);
142389 {yymsp[1].minor.yy384 = 0;}
142390 break;
142391 case 120: /* orderby_opt ::= ORDER BY sortlist */
142392 case 127: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==127);
142393 {yymsp[-2].minor.yy322 = yymsp[0].minor.yy322;}
142394 break;
142395 case 121: /* sortlist ::= sortlist COMMA expr sortorder */
142396 {
142397 yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
142398 sqlite3ExprListSetSortOrder(yymsp[-3].minor.yy322,yymsp[0].minor.yy4);
142399 }
142400 break;
142401 case 122: /* sortlist ::= expr sortorder */
142402 {
142403 yymsp[-1].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314); /*A-overwrites-Y*/
142404 sqlite3ExprListSetSortOrder(yymsp[-1].minor.yy322,yymsp[0].minor.yy4);
142405 }
142406 break;
142407 case 123: /* sortorder ::= ASC */
142408 {yymsp[0].minor.yy4 = SQLITE_SO_ASC;}
142409 break;
142410 case 124: /* sortorder ::= DESC */
142411 {yymsp[0].minor.yy4 = SQLITE_SO_DESC;}
142412 break;
142413 case 125: /* sortorder ::= */
142414 {yymsp[1].minor.yy4 = SQLITE_SO_UNDEFINED;}
142415 break;
142416 case 131: /* limit_opt ::= LIMIT expr */
142417 {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy314,0);}
142418 break;
142419 case 132: /* limit_opt ::= LIMIT expr OFFSET expr */
142420 {yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy314,yymsp[0].minor.yy314);}
142421 break;
142422 case 133: /* limit_opt ::= LIMIT expr COMMA expr */
142423 {yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy314,yymsp[-2].minor.yy314);}
142424 break;
142425 case 134: /* cmd ::= with DELETE FROM fullname indexed_opt where_opt */
142426 {
142427 sqlite3WithPush(pParse, yymsp[-5].minor.yy451, 1);
142428 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
142429 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314,0,0);
142430 }
142431 break;
142432 case 137: /* cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */
142433 {
142434 sqlite3WithPush(pParse, yymsp[-7].minor.yy451, 1);
142435 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
142436 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
142437 sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy4,0,0);
142438 }
142439 break;
142440 case 138: /* setlist ::= setlist COMMA nm EQ expr */
142441 {
142442 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy314);
142443 sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, 1);
142444 }
142445 break;
142446 case 139: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
142447 {
142448 yymsp[-6].minor.yy322 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy322, yymsp[-3].minor.yy384, yymsp[0].minor.yy314);
142449 }
142450 break;
142451 case 140: /* setlist ::= nm EQ expr */
142452 {
142453 yylhsminor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy314);
142454 sqlite3ExprListSetName(pParse, yylhsminor.yy322, &yymsp[-2].minor.yy0, 1);
142455 }
142456 yymsp[-2].minor.yy322 = yylhsminor.yy322;
142457 break;
142458 case 141: /* setlist ::= LP idlist RP EQ expr */
142459 {
142460 yymsp[-4].minor.yy322 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy384, yymsp[0].minor.yy314);
142461 }
142462 break;
142463 case 142: /* cmd ::= with insert_cmd INTO fullname idlist_opt select */
142464 {
142465 sqlite3WithPush(pParse, yymsp[-5].minor.yy451, 1);
142466 sqlite3Insert(pParse, yymsp[-2].minor.yy259, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy4);
142467 }
142468 break;
142469 case 143: /* cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */
142470 {
142471 sqlite3WithPush(pParse, yymsp[-6].minor.yy451, 1);
142472 sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy4);
142473 }
142474 break;
142475 case 147: /* idlist_opt ::= LP idlist RP */
142476 {yymsp[-2].minor.yy384 = yymsp[-1].minor.yy384;}
142477 break;
142478 case 148: /* idlist ::= idlist COMMA nm */
142479 {yymsp[-2].minor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
142480 break;
142481 case 149: /* idlist ::= nm */
142482 {yymsp[0].minor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
142483 break;
142484 case 150: /* expr ::= LP expr RP */
142485 {yymsp[-2].minor.yy314 = yymsp[-1].minor.yy314;}
142486 break;
142487 case 151: /* expr ::= ID|INDEXED */
142488 case 152: /* expr ::= JOIN_KW */ yytestcase(yyruleno==152);
142489 {yymsp[0].minor.yy314=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
142490 break;
142491 case 153: /* expr ::= nm DOT nm */
142492 {
142493 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
142494 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
142495 yylhsminor.yy314 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
142496 }
142497 yymsp[-2].minor.yy314 = yylhsminor.yy314;
142498 break;
142499 case 154: /* expr ::= nm DOT nm DOT nm */
142500 {
142501 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
142502 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
142503 Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
142504 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
142505 yylhsminor.yy314 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
142506 }
142507 yymsp[-4].minor.yy314 = yylhsminor.yy314;
142508 break;
142509 case 155: /* term ::= NULL|FLOAT|BLOB */
142510 case 156: /* term ::= STRING */ yytestcase(yyruleno==156);
142511 {yymsp[0].minor.yy314=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
142512 break;
142513 case 157: /* term ::= INTEGER */
142514 {
142515 yylhsminor.yy314 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
142516 }
142517 yymsp[0].minor.yy314 = yylhsminor.yy314;
142518 break;
142519 case 158: /* expr ::= VARIABLE */
142520 {
142521 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
142522 u32 n = yymsp[0].minor.yy0.n;
142523 yymsp[0].minor.yy314 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
142524 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy314, n);
@@ -142536,22 +142934,22 @@
142536 if( yymsp[0].minor.yy314 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy314->iTable);
142537 }
142538 }
142539 }
142540 break;
142541 case 159: /* expr ::= expr COLLATE ID|STRING */
142542 {
142543 yymsp[-2].minor.yy314 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy314, &yymsp[0].minor.yy0, 1);
142544 }
142545 break;
142546 case 160: /* expr ::= CAST LP expr AS typetoken RP */
142547 {
142548 yymsp[-5].minor.yy314 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
142549 sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy314, yymsp[-3].minor.yy314, 0);
142550 }
142551 break;
142552 case 161: /* expr ::= ID|INDEXED LP distinct exprlist RP */
142553 {
142554 if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
142555 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
142556 }
142557 yylhsminor.yy314 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -142559,23 +142957,23 @@
142559 yylhsminor.yy314->flags |= EP_Distinct;
142560 }
142561 }
142562 yymsp[-4].minor.yy314 = yylhsminor.yy314;
142563 break;
142564 case 162: /* expr ::= ID|INDEXED LP STAR RP */
142565 {
142566 yylhsminor.yy314 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
142567 }
142568 yymsp[-3].minor.yy314 = yylhsminor.yy314;
142569 break;
142570 case 163: /* term ::= CTIME_KW */
142571 {
142572 yylhsminor.yy314 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
142573 }
142574 yymsp[0].minor.yy314 = yylhsminor.yy314;
142575 break;
142576 case 164: /* expr ::= LP nexprlist COMMA expr RP */
142577 {
142578 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy322, yymsp[-1].minor.yy314);
142579 yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
142580 if( yymsp[-4].minor.yy314 ){
142581 yymsp[-4].minor.yy314->x.pList = pList;
@@ -142582,24 +142980,24 @@
142582 }else{
142583 sqlite3ExprListDelete(pParse->db, pList);
142584 }
142585 }
142586 break;
142587 case 165: /* expr ::= expr AND expr */
142588 case 166: /* expr ::= expr OR expr */ yytestcase(yyruleno==166);
142589 case 167: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==167);
142590 case 168: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==168);
142591 case 169: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==169);
142592 case 170: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==170);
142593 case 171: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==171);
142594 case 172: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==172);
142595 {yymsp[-2].minor.yy314=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy314,yymsp[0].minor.yy314);}
142596 break;
142597 case 173: /* likeop ::= NOT LIKE_KW|MATCH */
142598 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
142599 break;
142600 case 174: /* expr ::= expr likeop expr */
142601 {
142602 ExprList *pList;
142603 int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
142604 yymsp[-1].minor.yy0.n &= 0x7fffffff;
142605 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy314);
@@ -142607,11 +143005,11 @@
142607 yymsp[-2].minor.yy314 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0);
142608 if( bNot ) yymsp[-2].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy314, 0);
142609 if( yymsp[-2].minor.yy314 ) yymsp[-2].minor.yy314->flags |= EP_InfixFunc;
142610 }
142611 break;
142612 case 175: /* expr ::= expr likeop expr ESCAPE expr */
142613 {
142614 ExprList *pList;
142615 int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
142616 yymsp[-3].minor.yy0.n &= 0x7fffffff;
142617 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314);
@@ -142620,43 +143018,43 @@
142620 yymsp[-4].minor.yy314 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0);
142621 if( bNot ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
142622 if( yymsp[-4].minor.yy314 ) yymsp[-4].minor.yy314->flags |= EP_InfixFunc;
142623 }
142624 break;
142625 case 176: /* expr ::= expr ISNULL|NOTNULL */
142626 {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy314,0);}
142627 break;
142628 case 177: /* expr ::= expr NOT NULL */
142629 {yymsp[-2].minor.yy314 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy314,0);}
142630 break;
142631 case 178: /* expr ::= expr IS expr */
142632 {
142633 yymsp[-2].minor.yy314 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy314,yymsp[0].minor.yy314);
142634 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy314, yymsp[-2].minor.yy314, TK_ISNULL);
142635 }
142636 break;
142637 case 179: /* expr ::= expr IS NOT expr */
142638 {
142639 yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy314,yymsp[0].minor.yy314);
142640 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy314, yymsp[-3].minor.yy314, TK_NOTNULL);
142641 }
142642 break;
142643 case 180: /* expr ::= NOT expr */
142644 case 181: /* expr ::= BITNOT expr */ yytestcase(yyruleno==181);
142645 {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy314, 0);/*A-overwrites-B*/}
142646 break;
142647 case 182: /* expr ::= MINUS expr */
142648 {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy314, 0);}
142649 break;
142650 case 183: /* expr ::= PLUS expr */
142651 {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, TK_UPLUS, yymsp[0].minor.yy314, 0);}
142652 break;
142653 case 184: /* between_op ::= BETWEEN */
142654 case 187: /* in_op ::= IN */ yytestcase(yyruleno==187);
142655 {yymsp[0].minor.yy4 = 0;}
142656 break;
142657 case 186: /* expr ::= expr between_op expr AND expr */
142658 {
142659 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314);
142660 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy314);
142661 yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy314, 0);
142662 if( yymsp[-4].minor.yy314 ){
@@ -142665,11 +143063,11 @@
142665 sqlite3ExprListDelete(pParse->db, pList);
142666 }
142667 if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
142668 }
142669 break;
142670 case 189: /* expr ::= expr in_op LP exprlist RP */
142671 {
142672 if( yymsp[-1].minor.yy322==0 ){
142673 /* Expressions of the form
142674 **
142675 ** expr1 IN ()
@@ -142717,41 +143115,41 @@
142717 }
142718 if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
142719 }
142720 }
142721 break;
142722 case 190: /* expr ::= LP select RP */
142723 {
142724 yymsp[-2].minor.yy314 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
142725 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy314, yymsp[-1].minor.yy387);
142726 }
142727 break;
142728 case 191: /* expr ::= expr in_op LP select RP */
142729 {
142730 yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy314, 0);
142731 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy314, yymsp[-1].minor.yy387);
142732 if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
142733 }
142734 break;
142735 case 192: /* expr ::= expr in_op nm dbnm paren_exprlist */
142736 {
142737 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
142738 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
142739 if( yymsp[0].minor.yy322 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy322);
142740 yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy314, 0);
142741 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy314, pSelect);
142742 if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
142743 }
142744 break;
142745 case 193: /* expr ::= EXISTS LP select RP */
142746 {
142747 Expr *p;
142748 p = yymsp[-3].minor.yy314 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
142749 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy387);
142750 }
142751 break;
142752 case 194: /* expr ::= CASE case_operand case_exprlist case_else END */
142753 {
142754 yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, 0);
142755 if( yymsp[-4].minor.yy314 ){
142756 yymsp[-4].minor.yy314->x.pList = yymsp[-1].minor.yy314 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy314) : yymsp[-2].minor.yy322;
142757 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy314);
@@ -142759,334 +143157,330 @@
142759 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
142760 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy314);
142761 }
142762 }
142763 break;
142764 case 195: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
142765 {
142766 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy314);
142767 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[0].minor.yy314);
142768 }
142769 break;
142770 case 196: /* case_exprlist ::= WHEN expr THEN expr */
142771 {
142772 yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314);
142773 yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, yymsp[0].minor.yy314);
142774 }
142775 break;
142776 case 199: /* case_operand ::= expr */
142777 {yymsp[0].minor.yy314 = yymsp[0].minor.yy314; /*A-overwrites-X*/}
142778 break;
142779 case 202: /* nexprlist ::= nexprlist COMMA expr */
142780 {yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy314);}
142781 break;
142782 case 203: /* nexprlist ::= expr */
142783 {yymsp[0].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy314); /*A-overwrites-Y*/}
142784 break;
142785 case 205: /* paren_exprlist ::= LP exprlist RP */
142786 case 210: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==210);
142787 {yymsp[-2].minor.yy322 = yymsp[-1].minor.yy322;}
142788 break;
142789 case 206: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
142790 {
142791 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
142792 sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy322, yymsp[-10].minor.yy4,
142793 &yymsp[-11].minor.yy0, yymsp[0].minor.yy314, SQLITE_SO_ASC, yymsp[-8].minor.yy4, SQLITE_IDXTYPE_APPDEF);
142794 }
142795 break;
142796 case 207: /* uniqueflag ::= UNIQUE */
142797 case 247: /* raisetype ::= ABORT */ yytestcase(yyruleno==247);
142798 {yymsp[0].minor.yy4 = OE_Abort;}
142799 break;
142800 case 208: /* uniqueflag ::= */
142801 {yymsp[1].minor.yy4 = OE_None;}
142802 break;
142803 case 211: /* eidlist ::= eidlist COMMA nm collate sortorder */
142804 {
142805 yymsp[-4].minor.yy322 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy4, yymsp[0].minor.yy4);
142806 }
142807 break;
142808 case 212: /* eidlist ::= nm collate sortorder */
142809 {
142810 yymsp[-2].minor.yy322 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy4, yymsp[0].minor.yy4); /*A-overwrites-Y*/
142811 }
142812 break;
142813 case 215: /* cmd ::= DROP INDEX ifexists fullname */
142814 {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
142815 break;
142816 case 216: /* cmd ::= VACUUM */
142817 {sqlite3Vacuum(pParse,0);}
142818 break;
142819 case 217: /* cmd ::= VACUUM nm */
142820 {sqlite3Vacuum(pParse,&yymsp[0].minor.yy0);}
142821 break;
142822 case 218: /* cmd ::= PRAGMA nm dbnm */
142823 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
142824 break;
142825 case 219: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
142826 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
142827 break;
142828 case 220: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
142829 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
142830 break;
142831 case 221: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
142832 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
142833 break;
142834 case 222: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
142835 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
142836 break;
142837 case 225: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
142838 {
142839 Token all;
142840 all.z = yymsp[-3].minor.yy0.z;
142841 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
142842 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
142843 }
142844 break;
142845 case 226: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
142846 {
142847 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);
142848 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
142849 }
142850 break;
142851 case 227: /* trigger_time ::= BEFORE|AFTER */
142852 { yymsp[0].minor.yy4 = yymsp[0].major; /*A-overwrites-X*/ }
142853 break;
142854 case 228: /* trigger_time ::= INSTEAD OF */
142855 { yymsp[-1].minor.yy4 = TK_INSTEAD;}
142856 break;
142857 case 229: /* trigger_time ::= */
142858 { yymsp[1].minor.yy4 = TK_BEFORE; }
142859 break;
142860 case 230: /* trigger_event ::= DELETE|INSERT */
142861 case 231: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==231);
142862 {yymsp[0].minor.yy90.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy90.b = 0;}
142863 break;
142864 case 232: /* trigger_event ::= UPDATE OF idlist */
142865 {yymsp[-2].minor.yy90.a = TK_UPDATE; yymsp[-2].minor.yy90.b = yymsp[0].minor.yy384;}
142866 break;
142867 case 233: /* when_clause ::= */
142868 case 252: /* key_opt ::= */ yytestcase(yyruleno==252);
142869 { yymsp[1].minor.yy314 = 0; }
142870 break;
142871 case 234: /* when_clause ::= WHEN expr */
142872 case 253: /* key_opt ::= KEY expr */ yytestcase(yyruleno==253);
142873 { yymsp[-1].minor.yy314 = yymsp[0].minor.yy314; }
142874 break;
142875 case 235: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
142876 {
142877 assert( yymsp[-2].minor.yy203!=0 );
142878 yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
142879 yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
142880 }
142881 break;
142882 case 236: /* trigger_cmd_list ::= trigger_cmd SEMI */
142883 {
142884 assert( yymsp[-1].minor.yy203!=0 );
142885 yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
142886 }
142887 break;
142888 case 237: /* trnm ::= nm DOT nm */
142889 {
142890 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
142891 sqlite3ErrorMsg(pParse,
142892 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
142893 "statements within triggers");
142894 }
142895 break;
142896 case 238: /* tridxby ::= INDEXED BY nm */
142897 {
142898 sqlite3ErrorMsg(pParse,
142899 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
142900 "within triggers");
142901 }
142902 break;
142903 case 239: /* tridxby ::= NOT INDEXED */
142904 {
142905 sqlite3ErrorMsg(pParse,
142906 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
142907 "within triggers");
142908 }
142909 break;
142910 case 240: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
142911 {yylhsminor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy314, yymsp[-6].minor.yy4, yymsp[-7].minor.yy0.z, yymsp[0].minor.yy336);}
142912 yymsp[-7].minor.yy203 = yylhsminor.yy203;
142913 break;
142914 case 241: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */
142915 {yylhsminor.yy203 = sqlite3TriggerInsertStep(pParse->db,&yymsp[-3].minor.yy0,yymsp[-2].minor.yy384,yymsp[-1].minor.yy387,yymsp[-5].minor.yy4,yymsp[-6].minor.yy336,yymsp[0].minor.yy336);/*yylhsminor.yy203-overwrites-yymsp[-5].minor.yy4*/}
142916 yymsp[-6].minor.yy203 = yylhsminor.yy203;
142917 break;
142918 case 242: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
142919 {yylhsminor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy314, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy336);}
142920 yymsp[-5].minor.yy203 = yylhsminor.yy203;
142921 break;
142922 case 243: /* trigger_cmd ::= scanpt select scanpt */
142923 {yylhsminor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy387, yymsp[-2].minor.yy336, yymsp[0].minor.yy336); /*yylhsminor.yy203-overwrites-yymsp[-1].minor.yy387*/}
142924 yymsp[-2].minor.yy203 = yylhsminor.yy203;
142925 break;
142926 case 244: /* expr ::= RAISE LP IGNORE RP */
142927 {
142928 yymsp[-3].minor.yy314 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
142929 if( yymsp[-3].minor.yy314 ){
142930 yymsp[-3].minor.yy314->affinity = OE_Ignore;
142931 }
142932 }
142933 break;
142934 case 245: /* expr ::= RAISE LP raisetype COMMA nm RP */
142935 {
142936 yymsp[-5].minor.yy314 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
142937 if( yymsp[-5].minor.yy314 ) {
142938 yymsp[-5].minor.yy314->affinity = (char)yymsp[-3].minor.yy4;
142939 }
142940 }
142941 break;
142942 case 246: /* raisetype ::= ROLLBACK */
142943 {yymsp[0].minor.yy4 = OE_Rollback;}
142944 break;
142945 case 248: /* raisetype ::= FAIL */
142946 {yymsp[0].minor.yy4 = OE_Fail;}
142947 break;
142948 case 249: /* cmd ::= DROP TRIGGER ifexists fullname */
142949 {
142950 sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
142951 }
142952 break;
142953 case 250: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
142954 {
142955 sqlite3Attach(pParse, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, yymsp[0].minor.yy314);
142956 }
142957 break;
142958 case 251: /* cmd ::= DETACH database_kw_opt expr */
142959 {
142960 sqlite3Detach(pParse, yymsp[0].minor.yy314);
142961 }
142962 break;
142963 case 254: /* cmd ::= REINDEX */
142964 {sqlite3Reindex(pParse, 0, 0);}
142965 break;
142966 case 255: /* cmd ::= REINDEX nm dbnm */
142967 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
142968 break;
142969 case 256: /* cmd ::= ANALYZE */
142970 {sqlite3Analyze(pParse, 0, 0);}
142971 break;
142972 case 257: /* cmd ::= ANALYZE nm dbnm */
142973 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
142974 break;
142975 case 258: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
142976 {
142977 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
142978 }
142979 break;
142980 case 259: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
142981 {
142982 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
142983 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
142984 }
142985 break;
142986 case 260: /* add_column_fullname ::= fullname */
142987 {
142988 disableLookaside(pParse);
142989 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
142990 }
142991 break;
142992 case 261: /* cmd ::= create_vtab */
142993 {sqlite3VtabFinishParse(pParse,0);}
142994 break;
142995 case 262: /* cmd ::= create_vtab LP vtabarglist RP */
142996 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
142997 break;
142998 case 263: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
142999 {
143000 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy4);
143001 }
143002 break;
143003 case 264: /* vtabarg ::= */
143004 {sqlite3VtabArgInit(pParse);}
143005 break;
143006 case 265: /* vtabargtoken ::= ANY */
143007 case 266: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==266);
143008 case 267: /* lp ::= LP */ yytestcase(yyruleno==267);
143009 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
143010 break;
143011 case 268: /* with ::= */
143012 {yymsp[1].minor.yy451 = 0;}
143013 break;
143014 case 269: /* with ::= WITH wqlist */
143015 { yymsp[-1].minor.yy451 = yymsp[0].minor.yy451; }
143016 break;
143017 case 270: /* with ::= WITH RECURSIVE wqlist */
143018 { yymsp[-2].minor.yy451 = yymsp[0].minor.yy451; }
143019 break;
143020 case 271: /* wqlist ::= nm eidlist_opt AS LP select RP */
143021 {
143022 yymsp[-5].minor.yy451 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy322, yymsp[-1].minor.yy387); /*A-overwrites-X*/
143023 }
143024 break;
143025 case 272: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
143026 {
143027 yymsp[-7].minor.yy451 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy451, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy322, yymsp[-1].minor.yy387);
143028 }
143029 break;
143030 default:
143031 /* (273) input ::= cmdlist */ yytestcase(yyruleno==273);
143032 /* (274) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==274);
143033 /* (275) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=275);
143034 /* (276) ecmd ::= SEMI */ yytestcase(yyruleno==276);
143035 /* (277) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==277);
143036 /* (278) explain ::= */ yytestcase(yyruleno==278);
143037 /* (279) trans_opt ::= */ yytestcase(yyruleno==279);
143038 /* (280) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==280);
143039 /* (281) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==281);
143040 /* (282) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==282);
143041 /* (283) savepoint_opt ::= */ yytestcase(yyruleno==283);
143042 /* (284) cmd ::= create_table create_table_args */ yytestcase(yyruleno==284);
143043 /* (285) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==285);
143044 /* (286) columnlist ::= columnname carglist */ yytestcase(yyruleno==286);
143045 /* (287) nm ::= ID|INDEXED */ yytestcase(yyruleno==287);
143046 /* (288) nm ::= STRING */ yytestcase(yyruleno==288);
143047 /* (289) nm ::= JOIN_KW */ yytestcase(yyruleno==289);
143048 /* (290) typetoken ::= typename */ yytestcase(yyruleno==290);
143049 /* (291) typename ::= ID|STRING */ yytestcase(yyruleno==291);
143050 /* (292) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=292);
143051 /* (293) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=293);
143052 /* (294) carglist ::= carglist ccons */ yytestcase(yyruleno==294);
143053 /* (295) carglist ::= */ yytestcase(yyruleno==295);
143054 /* (296) ccons ::= NULL onconf */ yytestcase(yyruleno==296);
143055 /* (297) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==297);
143056 /* (298) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==298);
143057 /* (299) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=299);
143058 /* (300) tconscomma ::= */ yytestcase(yyruleno==300);
143059 /* (301) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=301);
143060 /* (302) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=302);
143061 /* (303) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=303);
143062 /* (304) oneselect ::= values */ yytestcase(yyruleno==304);
143063 /* (305) sclp ::= selcollist COMMA */ yytestcase(yyruleno==305);
143064 /* (306) as ::= ID|STRING */ yytestcase(yyruleno==306);
143065 /* (307) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=307);
143066 /* (308) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==308);
143067 /* (309) exprlist ::= nexprlist */ yytestcase(yyruleno==309);
143068 /* (310) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=310);
143069 /* (311) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=311);
143070 /* (312) nmnum ::= ON */ yytestcase(yyruleno==312);
143071 /* (313) nmnum ::= DELETE */ yytestcase(yyruleno==313);
143072 /* (314) nmnum ::= DEFAULT */ yytestcase(yyruleno==314);
143073 /* (315) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==315);
143074 /* (316) foreach_clause ::= */ yytestcase(yyruleno==316);
143075 /* (317) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==317);
143076 /* (318) trnm ::= nm */ yytestcase(yyruleno==318);
143077 /* (319) tridxby ::= */ yytestcase(yyruleno==319);
143078 /* (320) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==320);
143079 /* (321) database_kw_opt ::= */ yytestcase(yyruleno==321);
143080 /* (322) kwcolumn_opt ::= */ yytestcase(yyruleno==322);
143081 /* (323) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==323);
143082 /* (324) vtabarglist ::= vtabarg */ yytestcase(yyruleno==324);
143083 /* (325) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==325);
143084 /* (326) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==326);
143085 /* (327) anylist ::= */ yytestcase(yyruleno==327);
143086 /* (328) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==328);
143087 /* (329) anylist ::= anylist ANY */ yytestcase(yyruleno==329);
 
143088 break;
143089 /********** End reduce actions ************************************************/
143090 };
143091 assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
143092 yygoto = yyRuleInfo[yyruleno].lhs;
@@ -146146,43 +146540,65 @@
146146 /*
146147 ** This routine implements a busy callback that sleeps and tries
146148 ** again until a timeout value is reached. The timeout value is
146149 ** an integer number of milliseconds passed in as the first
146150 ** argument.
 
 
 
146151 */
146152 static int sqliteDefaultBusyCallback(
146153 void *ptr, /* Database connection */
146154 int count /* Number of times table has been busy */
 
146155 ){
146156 #if SQLITE_OS_WIN || HAVE_USLEEP
 
 
146157 static const u8 delays[] =
146158 { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 };
146159 static const u8 totals[] =
146160 { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 };
146161 # define NDELAY ArraySize(delays)
146162 sqlite3 *db = (sqlite3 *)ptr;
146163 int timeout = db->busyTimeout;
146164 int delay, prior;
146165
 
 
 
 
 
 
 
 
 
 
 
 
 
146166 assert( count>=0 );
146167 if( count < NDELAY ){
146168 delay = delays[count];
146169 prior = totals[count];
146170 }else{
146171 delay = delays[NDELAY-1];
146172 prior = totals[NDELAY-1] + delay*(count-(NDELAY-1));
146173 }
146174 if( prior + delay > timeout ){
146175 delay = timeout - prior;
146176 if( delay<=0 ) return 0;
146177 }
146178 sqlite3OsSleep(db->pVfs, delay*1000);
146179 return 1;
146180 #else
 
 
146181 sqlite3 *db = (sqlite3 *)ptr;
146182 int timeout = ((sqlite3 *)ptr)->busyTimeout;
146183 if( (count+1)*1000 > timeout ){
 
146184 return 0;
146185 }
146186 sqlite3OsSleep(db->pVfs, 1000000);
146187 return 1;
146188 #endif
@@ -146189,18 +146605,29 @@
146189 }
146190
146191 /*
146192 ** Invoke the given busy handler.
146193 **
146194 ** This routine is called when an operation failed with a lock.
 
 
146195 ** If this routine returns non-zero, the lock is retried. If it
146196 ** returns 0, the operation aborts with an SQLITE_BUSY error.
146197 */
146198 SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p){
146199 int rc;
146200 if( NEVER(p==0) || p->xFunc==0 || p->nBusy<0 ) return 0;
146201 rc = p->xFunc(p->pArg, p->nBusy);
 
 
 
 
 
 
 
 
 
146202 if( rc==0 ){
146203 p->nBusy = -1;
146204 }else{
146205 p->nBusy++;
146206 }
@@ -146218,13 +146645,14 @@
146218 ){
146219 #ifdef SQLITE_ENABLE_API_ARMOR
146220 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
146221 #endif
146222 sqlite3_mutex_enter(db->mutex);
146223 db->busyHandler.xFunc = xBusy;
146224 db->busyHandler.pArg = pArg;
146225 db->busyHandler.nBusy = 0;
 
146226 db->busyTimeout = 0;
146227 sqlite3_mutex_leave(db->mutex);
146228 return SQLITE_OK;
146229 }
146230
@@ -146268,12 +146696,14 @@
146268 SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms){
146269 #ifdef SQLITE_ENABLE_API_ARMOR
146270 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
146271 #endif
146272 if( ms>0 ){
146273 sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
 
146274 db->busyTimeout = ms;
 
146275 }else{
146276 sqlite3_busy_handler(db, 0, 0);
146277 }
146278 return SQLITE_OK;
146279 }
@@ -148262,14 +148692,12 @@
148262 *(sqlite3_vfs**)pArg = sqlite3PagerVfs(pPager);
148263 rc = SQLITE_OK;
148264 }else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){
148265 *(sqlite3_file**)pArg = sqlite3PagerJrnlFile(pPager);
148266 rc = SQLITE_OK;
148267 }else if( fd->pMethods ){
148268 rc = sqlite3OsFileControl(fd, op, pArg);
148269 }else{
148270 rc = SQLITE_NOTFOUND;
148271 }
148272 sqlite3BtreeLeave(pBtree);
148273 }
148274 sqlite3_mutex_leave(db->mutex);
148275 return rc;
@@ -179336,11 +179764,11 @@
179336 /* If connected to a ZIPVFS backend, override the page size and
179337 ** offset with actual values obtained from ZIPVFS.
179338 */
179339 fd = sqlite3PagerFile(pPager);
179340 x[0] = pCsr->iPageno;
179341 if( fd->pMethods!=0 && sqlite3OsFileControl(fd, 230440, &x)==SQLITE_OK ){
179342 pCsr->iOffset = x[0];
179343 pCsr->szPage = (int)x[1];
179344 }
179345 }
179346
@@ -180102,11 +180530,11 @@
180102 ** input data. Input data may be supplied either as a single large buffer
180103 ** (e.g. sqlite3changeset_start()) or using a stream function (e.g.
180104 ** sqlite3changeset_start_strm()).
180105 */
180106 struct SessionInput {
180107 int bNoDiscard; /* If true, discard no data */
180108 int iCurrent; /* Offset in aData[] of current change */
180109 int iNext; /* Offset in aData[] of next change */
180110 u8 *aData; /* Pointer to buffer containing changeset */
180111 int nData; /* Number of bytes in aData */
180112
@@ -180266,12 +180694,12 @@
180266 ** of a patchset change is associated with the correspondingly positioned
180267 ** table column, counting from left to right within the CREATE TABLE
180268 ** statement.
180269 **
180270 ** For a DELETE change, all fields within the record except those associated
180271 ** with PRIMARY KEY columns are set to "undefined". The PRIMARY KEY fields
180272 ** contain the values identifying the row to delete.
180273 **
180274 ** For an UPDATE change, all fields except those associated with PRIMARY KEY
180275 ** columns and columns that are modified by the UPDATE are set to "undefined".
180276 ** PRIMARY KEY fields contain the values identifying the table row to update,
180277 ** and fields associated with modified columns contain the new column values.
@@ -180550,11 +180978,11 @@
180550 ** the type byte).
180551 */
180552 static int sessionSerialLen(u8 *a){
180553 int e = *a;
180554 int n;
180555 if( e==0 ) return 1;
180556 if( e==SQLITE_NULL ) return 1;
180557 if( e==SQLITE_INTEGER || e==SQLITE_FLOAT ) return 9;
180558 return sessionVarintGet(&a[1], &n) + 1 + n;
180559 }
180560
@@ -180630,11 +181058,11 @@
180630 for(iCol=0; iCol<pTab->nCol; iCol++){
180631 if( pTab->abPK[iCol] ){
180632 int n1 = sessionSerialLen(a1);
180633 int n2 = sessionSerialLen(a2);
180634
180635 if( pTab->abPK[iCol] && (n1!=n2 || memcmp(a1, a2, n1)) ){
180636 return 0;
180637 }
180638 a1 += n1;
180639 a2 += n2;
180640 }else{
@@ -180873,11 +181301,11 @@
180873 if( eType==SQLITE_TEXT ){
180874 z = sqlite3_value_text(pVal);
180875 }else{
180876 z = sqlite3_value_blob(pVal);
180877 }
180878 if( memcmp(a, z, n) ) return 0;
180879 a += n;
180880 }
180881 }
180882 }
180883
@@ -182217,10 +182645,11 @@
182217 if( 0==sqlite3_stricmp("sqlite_stat1", zTab) ){
182218 zSql = sqlite3_mprintf(
182219 "SELECT tbl, ?2, stat FROM %Q.sqlite_stat1 WHERE tbl IS ?1 AND "
182220 "idx IS (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)", zDb
182221 );
 
182222 }else{
182223 int i;
182224 const char *zSep = "";
182225 SessionBuffer buf = {0, 0, 0};
182226
@@ -182626,11 +183055,11 @@
182626 /*
182627 ** If the SessionInput object passed as the only argument is a streaming
182628 ** object and the buffer is full, discard some data to free up space.
182629 */
182630 static void sessionDiscardData(SessionInput *pIn){
182631 if( pIn->bEof && pIn->xInput && pIn->iNext>=SESSIONS_STRM_CHUNK_SIZE ){
182632 int nMove = pIn->buf.nBuf - pIn->iNext;
182633 assert( nMove>=0 );
182634 if( nMove>0 ){
182635 memmove(pIn->buf.aBuf, &pIn->buf.aBuf[pIn->iNext], nMove);
182636 }
@@ -182952,11 +183381,12 @@
182952 ** changes in the changeset.
182953 */
182954 static int sessionChangesetNext(
182955 sqlite3_changeset_iter *p, /* Changeset iterator */
182956 u8 **paRec, /* If non-NULL, store record pointer here */
182957 int *pnRec /* If non-NULL, store size of record here */
 
182958 ){
182959 int i;
182960 u8 op;
182961
182962 assert( (paRec==0 && pnRec==0) || (paRec && pnRec) );
@@ -182987,10 +183417,11 @@
182987 sessionDiscardData(&p->in);
182988 p->in.iCurrent = p->in.iNext;
182989
182990 op = p->in.aData[p->in.iNext++];
182991 while( op=='T' || op=='P' ){
 
182992 p->bPatchset = (op=='P');
182993 if( sessionChangesetReadTblhdr(p) ) return p->rc;
182994 if( (p->rc = sessionInputBuffer(&p->in, 2)) ) return p->rc;
182995 p->in.iCurrent = p->in.iNext;
182996 if( p->in.iNext>=p->in.nData ) return SQLITE_DONE;
@@ -183065,11 +183496,11 @@
183065 **
183066 ** This function may not be called on iterators passed to a conflict handler
183067 ** callback by changeset_apply().
183068 */
183069 SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *p){
183070 return sessionChangesetNext(p, 0, 0);
183071 }
183072
183073 /*
183074 ** The following function extracts information on the current change
183075 ** from a changeset iterator. It may only be called after changeset_next()
@@ -183444,10 +183875,12 @@
183444 const char **azCol; /* Array of column names */
183445 u8 *abPK; /* Boolean array - true if column is in PK */
183446 int bStat1; /* True if table is sqlite_stat1 */
183447 int bDeferConstraints; /* True to defer constraints */
183448 SessionBuffer constraints; /* Deferred constraints are stored here */
 
 
183449 };
183450
183451 /*
183452 ** Formulate a statement to DELETE a row from database db. Assuming a table
183453 ** structure like this:
@@ -183710,11 +184143,10 @@
183710 "DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS "
183711 "CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END "
183712 "AND (?4 OR stat IS ?3)"
183713 );
183714 }
183715 assert( rc==SQLITE_OK );
183716 return rc;
183717 }
183718
183719 /*
183720 ** A wrapper around sqlite3_bind_value() that detects an extra problem.
@@ -183824,10 +184256,58 @@
183824 if( rc!=SQLITE_ROW ) rc = sqlite3_reset(pSelect);
183825 }
183826
183827 return rc;
183828 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183829
183830 /*
183831 ** Invoke the conflict handler for the change that the changeset iterator
183832 ** currently points to.
183833 **
@@ -183900,11 +184380,11 @@
183900 /* Instead of invoking the conflict handler, append the change blob
183901 ** to the SessionApplyCtx.constraints buffer. */
183902 u8 *aBlob = &pIter->in.aData[pIter->in.iCurrent];
183903 int nBlob = pIter->in.iNext - pIter->in.iCurrent;
183904 sessionAppendBlob(&p->constraints, aBlob, nBlob, &rc);
183905 res = SQLITE_CHANGESET_OMIT;
183906 }else{
183907 /* No other row with the new.* primary key. */
183908 res = xConflict(pCtx, eType+1, pIter);
183909 if( res==SQLITE_CHANGESET_REPLACE ) rc = SQLITE_MISUSE;
183910 }
@@ -183926,10 +184406,13 @@
183926
183927 default:
183928 rc = SQLITE_MISUSE;
183929 break;
183930 }
 
 
 
183931 }
183932
183933 return rc;
183934 }
183935
@@ -184101,46 +184584,46 @@
184101 int bReplace = 0;
184102 int bRetry = 0;
184103 int rc;
184104
184105 rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, &bReplace, &bRetry);
184106 assert( rc==SQLITE_OK || (bRetry==0 && bReplace==0) );
184107
184108 /* If the bRetry flag is set, the change has not been applied due to an
184109 ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and
184110 ** a row with the correct PK is present in the db, but one or more other
184111 ** fields do not contain the expected values) and the conflict handler
184112 ** returned SQLITE_CHANGESET_REPLACE. In this case retry the operation,
184113 ** but pass NULL as the final argument so that sessionApplyOneOp() ignores
184114 ** the SQLITE_CHANGESET_DATA problem. */
184115 if( bRetry ){
184116 assert( pIter->op==SQLITE_UPDATE || pIter->op==SQLITE_DELETE );
184117 rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0);
184118 }
184119
184120 /* If the bReplace flag is set, the change is an INSERT that has not
184121 ** been performed because the database already contains a row with the
184122 ** specified primary key and the conflict handler returned
184123 ** SQLITE_CHANGESET_REPLACE. In this case remove the conflicting row
184124 ** before reattempting the INSERT. */
184125 else if( bReplace ){
184126 assert( pIter->op==SQLITE_INSERT );
184127 rc = sqlite3_exec(db, "SAVEPOINT replace_op", 0, 0, 0);
184128 if( rc==SQLITE_OK ){
184129 rc = sessionBindRow(pIter,
184130 sqlite3changeset_new, pApply->nCol, pApply->abPK, pApply->pDelete);
184131 sqlite3_bind_int(pApply->pDelete, pApply->nCol+1, 1);
184132 }
184133 if( rc==SQLITE_OK ){
184134 sqlite3_step(pApply->pDelete);
184135 rc = sqlite3_reset(pApply->pDelete);
184136 }
184137 if( rc==SQLITE_OK ){
184138 rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0);
184139 }
184140 if( rc==SQLITE_OK ){
184141 rc = sqlite3_exec(db, "RELEASE replace_op", 0, 0, 0);
184142 }
184143 }
184144
184145 return rc;
184146 }
@@ -184212,14 +184695,16 @@
184212 int(*xConflict)(
184213 void *pCtx, /* Copy of fifth arg to _apply() */
184214 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184215 sqlite3_changeset_iter *p /* Handle describing change and conflict */
184216 ),
184217 void *pCtx /* First argument passed to xConflict */
 
 
184218 ){
184219 int schemaMismatch = 0;
184220 int rc; /* Return code */
184221 const char *zTab = 0; /* Name of current table */
184222 int nTab = 0; /* Result of sqlite3Strlen30(zTab) */
184223 SessionApplyCtx sApply; /* changeset_apply() context object */
184224 int bPatchset;
184225
@@ -184226,11 +184711,13 @@
184226 assert( xConflict!=0 );
184227
184228 pIter->in.bNoDiscard = 1;
184229 memset(&sApply, 0, sizeof(sApply));
184230 sqlite3_mutex_enter(sqlite3_db_mutex(db));
184231 rc = sqlite3_exec(db, "SAVEPOINT changeset_apply", 0, 0, 0);
 
 
184232 if( rc==SQLITE_OK ){
184233 rc = sqlite3_exec(db, "PRAGMA defer_foreign_keys = 1", 0, 0, 0);
184234 }
184235 while( rc==SQLITE_OK && SQLITE_ROW==sqlite3changeset_next(pIter) ){
184236 int nCol;
@@ -184250,13 +184737,22 @@
184250 sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */
184251 sqlite3_finalize(sApply.pDelete);
184252 sqlite3_finalize(sApply.pUpdate);
184253 sqlite3_finalize(sApply.pInsert);
184254 sqlite3_finalize(sApply.pSelect);
184255 memset(&sApply, 0, sizeof(sApply));
184256 sApply.db = db;
 
 
 
 
 
 
 
 
184257 sApply.bDeferConstraints = 1;
 
 
184258
184259 /* If an xFilter() callback was specified, invoke it now. If the
184260 ** xFilter callback returns zero, skip this table. If it returns
184261 ** non-zero, proceed. */
184262 schemaMismatch = (xFilter && (0==xFilter(pCtx, zNew)));
@@ -184355,26 +184851,65 @@
184355 }
184356 }
184357 }
184358 sqlite3_exec(db, "PRAGMA defer_foreign_keys = 0", 0, 0, 0);
184359
184360 if( rc==SQLITE_OK ){
184361 rc = sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0);
184362 }else{
184363 sqlite3_exec(db, "ROLLBACK TO changeset_apply", 0, 0, 0);
184364 sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0);
 
 
184365 }
184366
 
 
 
 
 
184367 sqlite3_finalize(sApply.pInsert);
184368 sqlite3_finalize(sApply.pDelete);
184369 sqlite3_finalize(sApply.pUpdate);
184370 sqlite3_finalize(sApply.pSelect);
184371 sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */
184372 sqlite3_free((char*)sApply.constraints.aBuf);
 
184373 sqlite3_mutex_leave(sqlite3_db_mutex(db));
184374 return rc;
184375 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184376
184377 /*
184378 ** Apply the changeset passed via pChangeset/nChangeset to the main database
184379 ** attached to handle "db". Invoke the supplied conflict handler callback
184380 ** to resolve any conflicts encountered while applying the change.
@@ -184392,23 +184927,46 @@
184392 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184393 sqlite3_changeset_iter *p /* Handle describing change and conflict */
184394 ),
184395 void *pCtx /* First argument passed to xConflict */
184396 ){
184397 sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
184398 int rc = sqlite3changeset_start(&pIter, nChangeset, pChangeset);
184399 if( rc==SQLITE_OK ){
184400 rc = sessionChangesetApply(db, pIter, xFilter, xConflict, pCtx);
184401 }
184402 return rc;
184403 }
184404
184405 /*
184406 ** Apply the changeset passed via xInput/pIn to the main database
184407 ** attached to handle "db". Invoke the supplied conflict handler callback
184408 ** to resolve any conflicts encountered while applying the change.
184409 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184410 SQLITE_API int sqlite3changeset_apply_strm(
184411 sqlite3 *db, /* Apply change to "main" db of this handle */
184412 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
184413 void *pIn, /* First arg for xInput */
184414 int(*xFilter)(
@@ -184420,16 +184978,13 @@
184420 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184421 sqlite3_changeset_iter *p /* Handle describing change and conflict */
184422 ),
184423 void *pCtx /* First argument passed to xConflict */
184424 ){
184425 sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
184426 int rc = sqlite3changeset_start_strm(&pIter, xInput, pIn);
184427 if( rc==SQLITE_OK ){
184428 rc = sessionChangesetApply(db, pIter, xFilter, xConflict, pCtx);
184429 }
184430 return rc;
184431 }
184432
184433 /*
184434 ** sqlite3_changegroup handle.
184435 */
@@ -184444,31 +184999,90 @@
184444 ** part of an sqlite3changeset_concat() operation. A new change object is
184445 ** allocated and a pointer to it stored in *ppNew.
184446 */
184447 static int sessionChangeMerge(
184448 SessionTable *pTab, /* Table structure */
 
184449 int bPatchset, /* True for patchsets */
184450 SessionChange *pExist, /* Existing change */
184451 int op2, /* Second change operation */
184452 int bIndirect, /* True if second change is indirect */
184453 u8 *aRec, /* Second change record */
184454 int nRec, /* Number of bytes in aRec */
184455 SessionChange **ppNew /* OUT: Merged change */
184456 ){
184457 SessionChange *pNew = 0;
 
184458
184459 if( !pExist ){
184460 pNew = (SessionChange *)sqlite3_malloc(sizeof(SessionChange) + nRec);
184461 if( !pNew ){
184462 return SQLITE_NOMEM;
184463 }
184464 memset(pNew, 0, sizeof(SessionChange));
184465 pNew->op = op2;
184466 pNew->bIndirect = bIndirect;
184467 pNew->nRecord = nRec;
184468 pNew->aRecord = (u8*)&pNew[1];
184469 memcpy(pNew->aRecord, aRec, nRec);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184470 }else{
184471 int op1 = pExist->op;
184472
184473 /*
184474 ** op1=INSERT, op2=INSERT -> Unsupported. Discard op2.
@@ -184558,28 +185172,28 @@
184558 sqlite3_free(pExist);
184559 }
184560 }
184561
184562 *ppNew = pNew;
184563 return SQLITE_OK;
184564 }
184565
184566 /*
184567 ** Add all changes in the changeset traversed by the iterator passed as
184568 ** the first argument to the changegroup hash tables.
184569 */
184570 static int sessionChangesetToHash(
184571 sqlite3_changeset_iter *pIter, /* Iterator to read from */
184572 sqlite3_changegroup *pGrp /* Changegroup object to add changeset to */
 
184573 ){
184574 u8 *aRec;
184575 int nRec;
184576 int rc = SQLITE_OK;
184577 SessionTable *pTab = 0;
184578
184579
184580 while( SQLITE_ROW==sessionChangesetNext(pIter, &aRec, &nRec) ){
184581 const char *zNew;
184582 int nCol;
184583 int op;
184584 int iHash;
184585 int bIndirect;
@@ -184655,11 +185269,11 @@
184655 pTab->nEntry--;
184656 break;
184657 }
184658 }
184659
184660 rc = sessionChangeMerge(pTab,
184661 pIter->bPatchset, pExist, op, bIndirect, aRec, nRec, &pChange
184662 );
184663 if( rc ) break;
184664 if( pChange ){
184665 pChange->pNext = pTab->apChange[iHash];
@@ -184763,11 +185377,11 @@
184763 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
184764 int rc; /* Return code */
184765
184766 rc = sqlite3changeset_start(&pIter, nData, pData);
184767 if( rc==SQLITE_OK ){
184768 rc = sessionChangesetToHash(pIter, pGrp);
184769 }
184770 sqlite3changeset_finalize(pIter);
184771 return rc;
184772 }
184773
@@ -184794,11 +185408,11 @@
184794 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
184795 int rc; /* Return code */
184796
184797 rc = sqlite3changeset_start_strm(&pIter, xInput, pIn);
184798 if( rc==SQLITE_OK ){
184799 rc = sessionChangesetToHash(pIter, pGrp);
184800 }
184801 sqlite3changeset_finalize(pIter);
184802 return rc;
184803 }
184804
@@ -184878,10 +185492,353 @@
184878 }
184879 sqlite3changegroup_delete(pGrp);
184880
184881 return rc;
184882 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184883
184884 #endif /* SQLITE_ENABLE_SESSION && SQLITE_ENABLE_PREUPDATE_HOOK */
184885
184886 /************** End of sqlite3session.c **************************************/
184887 /************** Begin file json1.c *******************************************/
@@ -202602,10 +203559,16 @@
202602
202603 int aColMap[3];
202604 aColMap[0] = -1;
202605 aColMap[1] = nCol;
202606 aColMap[2] = nCol+1;
 
 
 
 
 
 
202607
202608 /* Set idxFlags flags for all WHERE clause terms that will be used. */
202609 for(i=0; i<pInfo->nConstraint; i++){
202610 struct sqlite3_index_constraint *p = &pInfo->aConstraint[i];
202611 int iCol = p->iColumn;
@@ -202621,15 +203584,15 @@
202621 /* As there exists an unusable MATCH constraint this is an
202622 ** unusable plan. Set a prohibitively high cost. */
202623 pInfo->estimatedCost = 1e50;
202624 return SQLITE_OK;
202625 }
202626 }else{
202627 int j;
202628 for(j=1; j<ArraySize(aConstraint); j++){
202629 struct Constraint *pC = &aConstraint[j];
202630 if( iCol==aColMap[pC->iCol] && p->op & pC->op && p->usable ){
202631 pC->iConsIndex = i;
202632 idxFlags |= pC->fts5op;
202633 }
202634 }
202635 }
@@ -204697,11 +205660,11 @@
204697 int nArg, /* Number of args */
204698 sqlite3_value **apUnused /* Function arguments */
204699 ){
204700 assert( nArg==0 );
204701 UNUSED_PARAM2(nArg, apUnused);
204702 sqlite3_result_text(pCtx, "fts5: 2018-03-22 17:13:44 eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27ef01", -1, SQLITE_TRANSIENT);
204703 }
204704
204705 static int fts5Init(sqlite3 *db){
204706 static const sqlite3_module fts5Mod = {
204707 /* iVersion */ 2,
@@ -208967,12 +209930,12 @@
208967 }
208968 #endif /* SQLITE_CORE */
208969 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
208970
208971 /************** End of stmt.c ************************************************/
208972 #if __LINE__!=208972
208973 #undef SQLITE_SOURCE_ID
208974 #define SQLITE_SOURCE_ID "2018-03-22 17:13:44 eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27alt2"
208975 #endif
208976 /* Return the source-id for this library */
208977 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
208978 /************************** End of sqlite3.c ******************************/
208979
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.23.1. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -1145,13 +1145,13 @@
1145 **
1146 ** See also: [sqlite3_libversion()],
1147 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1148 ** [sqlite_version()] and [sqlite_source_id()].
1149 */
1150 #define SQLITE_VERSION "3.23.1"
1151 #define SQLITE_VERSION_NUMBER 3023001
1152 #define SQLITE_SOURCE_ID "2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b"
1153
1154 /*
1155 ** CAPI3REF: Run-Time Library Version Numbers
1156 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1157 **
@@ -2086,10 +2086,16 @@
2086 ** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back.
2087 ** ^This file control takes the file descriptor out of batch write mode
2088 ** so that all subsequent write operations are independent.
2089 ** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without
2090 ** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE].
2091 **
2092 ** <li>[[SQLITE_FCNTL_LOCK_TIMEOUT]]
2093 ** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode causes attempts to obtain
2094 ** a file lock using the xLock or xShmLock methods of the VFS to wait
2095 ** for up to M milliseconds before failing, where M is the single
2096 ** unsigned integer parameter.
2097 ** </ul>
2098 */
2099 #define SQLITE_FCNTL_LOCKSTATE 1
2100 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
2101 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -2120,10 +2126,11 @@
2126 #define SQLITE_FCNTL_WIN32_GET_HANDLE 29
2127 #define SQLITE_FCNTL_PDB 30
2128 #define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31
2129 #define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32
2130 #define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33
2131 #define SQLITE_FCNTL_LOCK_TIMEOUT 34
2132
2133 /* deprecated names */
2134 #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
2135 #define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
2136 #define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -9833,11 +9840,11 @@
9840
9841 /*
9842 ** CAPI3REF: Deserialize a database
9843 **
9844 ** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the
9845 ** [database connection] D to disconnect from database S and then
9846 ** reopen S as an in-memory database based on the serialization contained
9847 ** in P. The serialized database P is N bytes in size. M is the size of
9848 ** the buffer P, which might be larger than N. If M is larger than N, and
9849 ** the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is
9850 ** permitted to add content to the in-memory database as long as the total
@@ -10974,23 +10981,22 @@
10981 SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*);
10982
10983 /*
10984 ** CAPI3REF: Apply A Changeset To A Database
10985 **
10986 ** Apply a changeset or patchset to a database. These functions attempt to
10987 ** update the "main" database attached to handle db with the changes found in
10988 ** the changeset passed via the second and third arguments.
10989 **
10990 ** The fourth argument (xFilter) passed to these functions is the "filter
10991 ** callback". If it is not NULL, then for each table affected by at least one
10992 ** change in the changeset, the filter callback is invoked with
10993 ** the table name as the second argument, and a copy of the context pointer
10994 ** passed as the sixth argument as the first. If the "filter callback"
10995 ** returns zero, then no attempt is made to apply any changes to the table.
10996 ** Otherwise, if the return value is non-zero or the xFilter argument to
10997 ** is NULL, all changes related to the table are attempted.
 
10998 **
10999 ** For each table that is not excluded by the filter callback, this function
11000 ** tests that the target database contains a compatible table. A table is
11001 ** considered compatible if all of the following are true:
11002 **
@@ -11031,11 +11037,11 @@
11037 ** the documentation for the three
11038 ** [SQLITE_CHANGESET_OMIT|available return values] for details.
11039 **
11040 ** <dl>
11041 ** <dt>DELETE Changes<dd>
11042 ** For each DELETE change, the function checks if the target database
11043 ** contains a row with the same primary key value (or values) as the
11044 ** original row values stored in the changeset. If it does, and the values
11045 ** stored in all non-primary key columns also match the values stored in
11046 ** the changeset the row is deleted from the target database.
11047 **
@@ -11076,11 +11082,11 @@
11082 ** This includes the case where the INSERT operation is re-attempted because
11083 ** an earlier call to the conflict handler function returned
11084 ** [SQLITE_CHANGESET_REPLACE].
11085 **
11086 ** <dt>UPDATE Changes<dd>
11087 ** For each UPDATE change, the function checks if the target database
11088 ** contains a row with the same primary key value (or values) as the
11089 ** original row values stored in the changeset. If it does, and the values
11090 ** stored in all modified non-primary key columns also match the values
11091 ** stored in the changeset the row is updated within the target database.
11092 **
@@ -11107,15 +11113,32 @@
11113 ** It is safe to execute SQL statements, including those that write to the
11114 ** table that the callback related to, from within the xConflict callback.
11115 ** This can be used to further customize the applications conflict
11116 ** resolution strategy.
11117 **
11118 ** All changes made by these functions are enclosed in a savepoint transaction.
11119 ** If any other error (aside from a constraint failure when attempting to
11120 ** write to the target database) occurs, then the savepoint transaction is
11121 ** rolled back, restoring the target database to its original state, and an
11122 ** SQLite error code returned.
11123 **
11124 ** If the output parameters (ppRebase) and (pnRebase) are non-NULL and
11125 ** the input is a changeset (not a patchset), then sqlite3changeset_apply_v2()
11126 ** may set (*ppRebase) to point to a "rebase" that may be used with the
11127 ** sqlite3_rebaser APIs buffer before returning. In this case (*pnRebase)
11128 ** is set to the size of the buffer in bytes. It is the responsibility of the
11129 ** caller to eventually free any such buffer using sqlite3_free(). The buffer
11130 ** is only allocated and populated if one or more conflicts were encountered
11131 ** while applying the patchset. See comments surrounding the sqlite3_rebaser
11132 ** APIs for further details.
11133 **
11134 ** The behavior of sqlite3changeset_apply_v2() and its streaming equivalent
11135 ** may be modified by passing a combination of
11136 ** [SQLITE_CHANGESETAPPLY_NOSAVEPOINT | supported flags] as the 9th parameter.
11137 **
11138 ** Note that the sqlite3changeset_apply_v2() API is still <b>experimental</b>
11139 ** and therefore subject to change.
11140 */
11141 SQLITE_API int sqlite3changeset_apply(
11142 sqlite3 *db, /* Apply change to "main" db of this handle */
11143 int nChangeset, /* Size of changeset in bytes */
11144 void *pChangeset, /* Changeset blob */
@@ -11128,10 +11151,45 @@
11151 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
11152 sqlite3_changeset_iter *p /* Handle describing change and conflict */
11153 ),
11154 void *pCtx /* First argument passed to xConflict */
11155 );
11156 SQLITE_API int sqlite3changeset_apply_v2(
11157 sqlite3 *db, /* Apply change to "main" db of this handle */
11158 int nChangeset, /* Size of changeset in bytes */
11159 void *pChangeset, /* Changeset blob */
11160 int(*xFilter)(
11161 void *pCtx, /* Copy of sixth arg to _apply() */
11162 const char *zTab /* Table name */
11163 ),
11164 int(*xConflict)(
11165 void *pCtx, /* Copy of sixth arg to _apply() */
11166 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
11167 sqlite3_changeset_iter *p /* Handle describing change and conflict */
11168 ),
11169 void *pCtx, /* First argument passed to xConflict */
11170 void **ppRebase, int *pnRebase, /* OUT: Rebase data */
11171 int flags /* Combination of SESSION_APPLY_* flags */
11172 );
11173
11174 /*
11175 ** CAPI3REF: Flags for sqlite3changeset_apply_v2
11176 **
11177 ** The following flags may passed via the 9th parameter to
11178 ** [sqlite3changeset_apply_v2] and [sqlite3changeset_apply_v2_strm]:
11179 **
11180 ** <dl>
11181 ** <dt>SQLITE_CHANGESETAPPLY_NOSAVEPOINT <dd>
11182 ** Usually, the sessions module encloses all operations performed by
11183 ** a single call to apply_v2() or apply_v2_strm() in a [SAVEPOINT]. The
11184 ** SAVEPOINT is committed if the changeset or patchset is successfully
11185 ** applied, or rolled back if an error occurs. Specifying this flag
11186 ** causes the sessions module to omit this savepoint. In this case, if the
11187 ** caller has an open transaction or savepoint when apply_v2() is called,
11188 ** it may revert the partially applied changeset by rolling it back.
11189 */
11190 #define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001
11191
11192 /*
11193 ** CAPI3REF: Constants Passed To The Conflict Handler
11194 **
11195 ** Values that may be passed as the second argument to a conflict-handler.
@@ -11225,19 +11283,175 @@
11283 */
11284 #define SQLITE_CHANGESET_OMIT 0
11285 #define SQLITE_CHANGESET_REPLACE 1
11286 #define SQLITE_CHANGESET_ABORT 2
11287
11288 /*
11289 ** CAPI3REF: Rebasing changesets
11290 ** EXPERIMENTAL
11291 **
11292 ** Suppose there is a site hosting a database in state S0. And that
11293 ** modifications are made that move that database to state S1 and a
11294 ** changeset recorded (the "local" changeset). Then, a changeset based
11295 ** on S0 is received from another site (the "remote" changeset) and
11296 ** applied to the database. The database is then in state
11297 ** (S1+"remote"), where the exact state depends on any conflict
11298 ** resolution decisions (OMIT or REPLACE) made while applying "remote".
11299 ** Rebasing a changeset is to update it to take those conflict
11300 ** resolution decisions into account, so that the same conflicts
11301 ** do not have to be resolved elsewhere in the network.
11302 **
11303 ** For example, if both the local and remote changesets contain an
11304 ** INSERT of the same key on "CREATE TABLE t1(a PRIMARY KEY, b)":
11305 **
11306 ** local: INSERT INTO t1 VALUES(1, 'v1');
11307 ** remote: INSERT INTO t1 VALUES(1, 'v2');
11308 **
11309 ** and the conflict resolution is REPLACE, then the INSERT change is
11310 ** removed from the local changeset (it was overridden). Or, if the
11311 ** conflict resolution was "OMIT", then the local changeset is modified
11312 ** to instead contain:
11313 **
11314 ** UPDATE t1 SET b = 'v2' WHERE a=1;
11315 **
11316 ** Changes within the local changeset are rebased as follows:
11317 **
11318 ** <dl>
11319 ** <dt>Local INSERT<dd>
11320 ** This may only conflict with a remote INSERT. If the conflict
11321 ** resolution was OMIT, then add an UPDATE change to the rebased
11322 ** changeset. Or, if the conflict resolution was REPLACE, add
11323 ** nothing to the rebased changeset.
11324 **
11325 ** <dt>Local DELETE<dd>
11326 ** This may conflict with a remote UPDATE or DELETE. In both cases the
11327 ** only possible resolution is OMIT. If the remote operation was a
11328 ** DELETE, then add no change to the rebased changeset. If the remote
11329 ** operation was an UPDATE, then the old.* fields of change are updated
11330 ** to reflect the new.* values in the UPDATE.
11331 **
11332 ** <dt>Local UPDATE<dd>
11333 ** This may conflict with a remote UPDATE or DELETE. If it conflicts
11334 ** with a DELETE, and the conflict resolution was OMIT, then the update
11335 ** is changed into an INSERT. Any undefined values in the new.* record
11336 ** from the update change are filled in using the old.* values from
11337 ** the conflicting DELETE. Or, if the conflict resolution was REPLACE,
11338 ** the UPDATE change is simply omitted from the rebased changeset.
11339 **
11340 ** If conflict is with a remote UPDATE and the resolution is OMIT, then
11341 ** the old.* values are rebased using the new.* values in the remote
11342 ** change. Or, if the resolution is REPLACE, then the change is copied
11343 ** into the rebased changeset with updates to columns also updated by
11344 ** the conflicting remote UPDATE removed. If this means no columns would
11345 ** be updated, the change is omitted.
11346 ** </dl>
11347 **
11348 ** A local change may be rebased against multiple remote changes
11349 ** simultaneously. If a single key is modified by multiple remote
11350 ** changesets, they are combined as follows before the local changeset
11351 ** is rebased:
11352 **
11353 ** <ul>
11354 ** <li> If there has been one or more REPLACE resolutions on a
11355 ** key, it is rebased according to a REPLACE.
11356 **
11357 ** <li> If there have been no REPLACE resolutions on a key, then
11358 ** the local changeset is rebased according to the most recent
11359 ** of the OMIT resolutions.
11360 ** </ul>
11361 **
11362 ** Note that conflict resolutions from multiple remote changesets are
11363 ** combined on a per-field basis, not per-row. This means that in the
11364 ** case of multiple remote UPDATE operations, some fields of a single
11365 ** local change may be rebased for REPLACE while others are rebased for
11366 ** OMIT.
11367 **
11368 ** In order to rebase a local changeset, the remote changeset must first
11369 ** be applied to the local database using sqlite3changeset_apply_v2() and
11370 ** the buffer of rebase information captured. Then:
11371 **
11372 ** <ol>
11373 ** <li> An sqlite3_rebaser object is created by calling
11374 ** sqlite3rebaser_create().
11375 ** <li> The new object is configured with the rebase buffer obtained from
11376 ** sqlite3changeset_apply_v2() by calling sqlite3rebaser_configure().
11377 ** If the local changeset is to be rebased against multiple remote
11378 ** changesets, then sqlite3rebaser_configure() should be called
11379 ** multiple times, in the same order that the multiple
11380 ** sqlite3changeset_apply_v2() calls were made.
11381 ** <li> Each local changeset is rebased by calling sqlite3rebaser_rebase().
11382 ** <li> The sqlite3_rebaser object is deleted by calling
11383 ** sqlite3rebaser_delete().
11384 ** </ol>
11385 */
11386 typedef struct sqlite3_rebaser sqlite3_rebaser;
11387
11388 /*
11389 ** CAPI3REF: Create a changeset rebaser object.
11390 ** EXPERIMENTAL
11391 **
11392 ** Allocate a new changeset rebaser object. If successful, set (*ppNew) to
11393 ** point to the new object and return SQLITE_OK. Otherwise, if an error
11394 ** occurs, return an SQLite error code (e.g. SQLITE_NOMEM) and set (*ppNew)
11395 ** to NULL.
11396 */
11397 SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew);
11398
11399 /*
11400 ** CAPI3REF: Configure a changeset rebaser object.
11401 ** EXPERIMENTAL
11402 **
11403 ** Configure the changeset rebaser object to rebase changesets according
11404 ** to the conflict resolutions described by buffer pRebase (size nRebase
11405 ** bytes), which must have been obtained from a previous call to
11406 ** sqlite3changeset_apply_v2().
11407 */
11408 SQLITE_API int sqlite3rebaser_configure(
11409 sqlite3_rebaser*,
11410 int nRebase, const void *pRebase
11411 );
11412
11413 /*
11414 ** CAPI3REF: Rebase a changeset
11415 ** EXPERIMENTAL
11416 **
11417 ** Argument pIn must point to a buffer containing a changeset nIn bytes
11418 ** in size. This function allocates and populates a buffer with a copy
11419 ** of the changeset rebased rebased according to the configuration of the
11420 ** rebaser object passed as the first argument. If successful, (*ppOut)
11421 ** is set to point to the new buffer containing the rebased changset and
11422 ** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the
11423 ** responsibility of the caller to eventually free the new buffer using
11424 ** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut)
11425 ** are set to zero and an SQLite error code returned.
11426 */
11427 SQLITE_API int sqlite3rebaser_rebase(
11428 sqlite3_rebaser*,
11429 int nIn, const void *pIn,
11430 int *pnOut, void **ppOut
11431 );
11432
11433 /*
11434 ** CAPI3REF: Delete a changeset rebaser object.
11435 ** EXPERIMENTAL
11436 **
11437 ** Delete the changeset rebaser object and all associated resources. There
11438 ** should be one call to this function for each successful invocation
11439 ** of sqlite3rebaser_create().
11440 */
11441 SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p);
11442
11443 /*
11444 ** CAPI3REF: Streaming Versions of API functions.
11445 **
11446 ** The six streaming API xxx_strm() functions serve similar purposes to the
11447 ** corresponding non-streaming API functions:
11448 **
11449 ** <table border=1 style="margin-left:8ex;margin-right:8ex">
11450 ** <tr><th>Streaming function<th>Non-streaming equivalent</th>
11451 ** <tr><td>sqlite3changeset_apply_strm<td>[sqlite3changeset_apply]
11452 ** <tr><td>sqlite3changeset_apply_strm_v2<td>[sqlite3changeset_apply_v2]
11453 ** <tr><td>sqlite3changeset_concat_strm<td>[sqlite3changeset_concat]
11454 ** <tr><td>sqlite3changeset_invert_strm<td>[sqlite3changeset_invert]
11455 ** <tr><td>sqlite3changeset_start_strm<td>[sqlite3changeset_start]
11456 ** <tr><td>sqlite3session_changeset_strm<td>[sqlite3session_changeset]
11457 ** <tr><td>sqlite3session_patchset_strm<td>[sqlite3session_patchset]
@@ -11328,10 +11542,27 @@
11542 void *pCtx, /* Copy of sixth arg to _apply() */
11543 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
11544 sqlite3_changeset_iter *p /* Handle describing change and conflict */
11545 ),
11546 void *pCtx /* First argument passed to xConflict */
11547 );
11548 SQLITE_API int sqlite3changeset_apply_v2_strm(
11549 sqlite3 *db, /* Apply change to "main" db of this handle */
11550 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
11551 void *pIn, /* First arg for xInput */
11552 int(*xFilter)(
11553 void *pCtx, /* Copy of sixth arg to _apply() */
11554 const char *zTab /* Table name */
11555 ),
11556 int(*xConflict)(
11557 void *pCtx, /* Copy of sixth arg to _apply() */
11558 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
11559 sqlite3_changeset_iter *p /* Handle describing change and conflict */
11560 ),
11561 void *pCtx, /* First argument passed to xConflict */
11562 void **ppRebase, int *pnRebase,
11563 int flags
11564 );
11565 SQLITE_API int sqlite3changeset_concat_strm(
11566 int (*xInputA)(void *pIn, void *pData, int *pnData),
11567 void *pInA,
11568 int (*xInputB)(void *pIn, void *pData, int *pnData),
@@ -11365,10 +11596,17 @@
11596 void *pIn
11597 );
11598 SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup*,
11599 int (*xOutput)(void *pOut, const void *pData, int nData),
11600 void *pOut
11601 );
11602 SQLITE_API int sqlite3rebaser_rebase_strm(
11603 sqlite3_rebaser *pRebaser,
11604 int (*xInput)(void *pIn, void *pData, int *pnData),
11605 void *pIn,
11606 int (*xOutput)(void *pOut, const void *pData, int nData),
11607 void *pOut
11608 );
11609
11610
11611 /*
11612 ** Make sure we can call this stuff from C++.
@@ -13245,13 +13483,14 @@
13483 ** handle is passed a pointer to sqlite.busyHandler. The busy-handler
13484 ** callback is currently invoked only from within pager.c.
13485 */
13486 typedef struct BusyHandler BusyHandler;
13487 struct BusyHandler {
13488 int (*xBusyHandler)(void *,int); /* The busy callback */
13489 void *pBusyArg; /* First arg to busy callback */
13490 int nBusy; /* Incremented with each busy call */
13491 u8 bExtraFileArg; /* Include sqlite3_file as callback arg */
13492 };
13493
13494 /*
13495 ** Name of the master database table. The master database table
13496 ** is a special table that holds the names and attributes of all
@@ -14456,11 +14695,11 @@
14695 );
14696 SQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager, sqlite3*);
14697 SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
14698
14699 /* Functions used to configure a Pager object. */
14700 SQLITE_PRIVATE void sqlite3PagerSetBusyHandler(Pager*, int(*)(void *), void *);
14701 SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager*, u32*, int);
14702 #ifdef SQLITE_HAS_CODEC
14703 SQLITE_PRIVATE void sqlite3PagerAlignReserve(Pager*,Pager*);
14704 #endif
14705 SQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager*, int);
@@ -14542,10 +14781,15 @@
14781 SQLITE_PRIVATE void *sqlite3PagerTempSpace(Pager*);
14782 SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager*);
14783 SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *, int, int, int *);
14784 SQLITE_PRIVATE void sqlite3PagerClearCache(Pager*);
14785 SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *);
14786 #ifdef SQLITE_ENABLE_SETLK_TIMEOUT
14787 SQLITE_PRIVATE void sqlite3PagerResetLockTimeout(Pager *pPager);
14788 #else
14789 # define sqlite3PagerResetLockTimeout(X)
14790 #endif
14791
14792 /* Functions used to truncate the database file. */
14793 SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager*,Pgno);
14794
14795 SQLITE_PRIVATE void sqlite3PagerRekey(DbPage*, Pgno, u16);
@@ -18099,11 +18343,11 @@
18343 SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *);
18344 SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *, SrcList *);
18345 SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(Parse*, u8, CollSeq *, const char*);
18346 SQLITE_PRIVATE char sqlite3AffinityType(const char*, u8*);
18347 SQLITE_PRIVATE void sqlite3Analyze(Parse*, Token*, Token*);
18348 SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler*, sqlite3_file*);
18349 SQLITE_PRIVATE int sqlite3FindDb(sqlite3*, Token*);
18350 SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *, const char *);
18351 SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3*,int iDB);
18352 SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3*,Index*);
18353 SQLITE_PRIVATE void sqlite3DefaultRowEst(Index*);
@@ -21069,12 +21313,15 @@
21313 ** really care if the VFS receives and understands the information since it
21314 ** is only a hint and can be safely ignored. The sqlite3OsFileControlHint()
21315 ** routine has no return value since the return value would be meaningless.
21316 */
21317 SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
21318 if( id->pMethods==0 ) return SQLITE_NOTFOUND;
21319 #ifdef SQLITE_TEST
21320 if( op!=SQLITE_FCNTL_COMMIT_PHASETWO
21321 && op!=SQLITE_FCNTL_LOCK_TIMEOUT
21322 ){
21323 /* Faults are not injected into COMMIT_PHASETWO because, assuming SQLite
21324 ** is using a regular VFS, it is called after the corresponding
21325 ** transaction has been committed. Injecting a fault at this point
21326 ** confuses the test scripts - the COMMIT comand returns SQLITE_NOMEM
21327 ** but the transaction is committed anyway.
@@ -21087,11 +21334,11 @@
21334 }
21335 #endif
21336 return id->pMethods->xFileControl(id, op, pArg);
21337 }
21338 SQLITE_PRIVATE void sqlite3OsFileControlHint(sqlite3_file *id, int op, void *pArg){
21339 if( id->pMethods ) (void)id->pMethods->xFileControl(id, op, pArg);
21340 }
21341
21342 SQLITE_PRIVATE int sqlite3OsSectorSize(sqlite3_file *id){
21343 int (*xSectorSize)(sqlite3_file*) = id->pMethods->xSectorSize;
21344 return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE);
@@ -31026,10 +31273,13 @@
31273 int openFlags; /* The flags specified at open() */
31274 #endif
31275 #if SQLITE_ENABLE_LOCKING_STYLE || defined(__APPLE__)
31276 unsigned fsFlags; /* cached details from statfs() */
31277 #endif
31278 #ifdef SQLITE_ENABLE_SETLK_TIMEOUT
31279 unsigned iBusyTimeout; /* Wait this many millisec on locks */
31280 #endif
31281 #if OS_VXWORKS
31282 struct vxworksFileId *pId; /* Unique file ID */
31283 #endif
31284 #ifdef SQLITE_DEBUG
31285 /* The next group of variables are used to track whether or not the
@@ -32459,10 +32709,47 @@
32709 OSTRACE(("TEST WR-LOCK %d %d %d (unix)\n", pFile->h, rc, reserved));
32710
32711 *pResOut = reserved;
32712 return rc;
32713 }
32714
32715 /*
32716 ** Set a posix-advisory-lock.
32717 **
32718 ** There are two versions of this routine. If compiled with
32719 ** SQLITE_ENABLE_SETLK_TIMEOUT then the routine has an extra parameter
32720 ** which is a pointer to a unixFile. If the unixFile->iBusyTimeout
32721 ** value is set, then it is the number of milliseconds to wait before
32722 ** failing the lock. The iBusyTimeout value is always reset back to
32723 ** zero on each call.
32724 **
32725 ** If SQLITE_ENABLE_SETLK_TIMEOUT is not defined, then do a non-blocking
32726 ** attempt to set the lock.
32727 */
32728 #ifndef SQLITE_ENABLE_SETLK_TIMEOUT
32729 # define osSetPosixAdvisoryLock(h,x,t) osFcntl(h,F_SETLK,x)
32730 #else
32731 static int osSetPosixAdvisoryLock(
32732 int h, /* The file descriptor on which to take the lock */
32733 struct flock *pLock, /* The description of the lock */
32734 unixFile *pFile /* Structure holding timeout value */
32735 ){
32736 int rc = osFcntl(h,F_SETLK,pLock);
32737 while( rc<0 && pFile->iBusyTimeout>0 ){
32738 /* On systems that support some kind of blocking file lock with a timeout,
32739 ** make appropriate changes here to invoke that blocking file lock. On
32740 ** generic posix, however, there is no such API. So we simply try the
32741 ** lock once every millisecond until either the timeout expires, or until
32742 ** the lock is obtained. */
32743 usleep(1000);
32744 rc = osFcntl(h,F_SETLK,pLock);
32745 pFile->iBusyTimeout--;
32746 }
32747 return rc;
32748 }
32749 #endif /* SQLITE_ENABLE_SETLK_TIMEOUT */
32750
32751
32752 /*
32753 ** Attempt to set a system-lock on the file pFile. The lock is
32754 ** described by pLock.
32755 **
@@ -32492,19 +32779,19 @@
32779 assert( pInode->nLock==0 );
32780 lock.l_whence = SEEK_SET;
32781 lock.l_start = SHARED_FIRST;
32782 lock.l_len = SHARED_SIZE;
32783 lock.l_type = F_WRLCK;
32784 rc = osSetPosixAdvisoryLock(pFile->h, &lock, pFile);
32785 if( rc<0 ) return rc;
32786 pInode->bProcessLock = 1;
32787 pInode->nLock++;
32788 }else{
32789 rc = 0;
32790 }
32791 }else{
32792 rc = osSetPosixAdvisoryLock(pFile->h, pLock, pFile);
32793 }
32794 return rc;
32795 }
32796
32797 /*
@@ -34860,10 +35147,16 @@
35147 }
35148 case SQLITE_FCNTL_HAS_MOVED: {
35149 *(int*)pArg = fileHasMoved(pFile);
35150 return SQLITE_OK;
35151 }
35152 #ifdef SQLITE_ENABLE_SETLK_TIMEOUT
35153 case SQLITE_FCNTL_LOCK_TIMEOUT: {
35154 pFile->iBusyTimeout = *(int*)pArg;
35155 return SQLITE_OK;
35156 }
35157 #endif
35158 #if SQLITE_MAX_MMAP_SIZE>0
35159 case SQLITE_FCNTL_MMAP_SIZE: {
35160 i64 newLimit = *(i64*)pArg;
35161 int rc = SQLITE_OK;
35162 if( newLimit>sqlite3GlobalConfig.mxMmap ){
@@ -35179,11 +35472,11 @@
35472 /* Initialize the locking parameters */
35473 f.l_type = lockType;
35474 f.l_whence = SEEK_SET;
35475 f.l_start = ofst;
35476 f.l_len = n;
35477 rc = osSetPosixAdvisoryLock(pShmNode->h, &f, pFile);
35478 rc = (rc!=(-1)) ? SQLITE_OK : SQLITE_BUSY;
35479 }
35480
35481 /* Update the global lock state and do debug tracing */
35482 #ifdef SQLITE_DEBUG
@@ -45039,11 +45332,11 @@
45332 ** May you find forgiveness for yourself and forgive others.
45333 ** May you share freely, never taking more than you give.
45334 **
45335 ******************************************************************************
45336 **
45337 ** This file implements an in-memory VFS. A database is held as a contiguous
45338 ** block of memory.
45339 **
45340 ** This file also implements interface sqlite3_serialize() and
45341 ** sqlite3_deserialize().
45342 */
@@ -50953,11 +51246,11 @@
51246 ** required size. */
51247 assert( pPager->eLock==EXCLUSIVE_LOCK );
51248 rc = pager_truncate(pPager, pPager->dbSize);
51249 }
51250
51251 if( rc==SQLITE_OK && bCommit ){
51252 rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_COMMIT_PHASETWO, 0);
51253 if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
51254 }
51255
51256 if( !pPager->exclusiveMode
@@ -51772,13 +52065,11 @@
52065 ** state prior to the start of the transaction, so invoke the
52066 ** SQLITE_FCNTL_DB_UNCHANGED file-control method to disable the
52067 ** assertion that the transaction counter was modified.
52068 */
52069 #ifdef SQLITE_DEBUG
52070 sqlite3OsFileControlHint(pPager->fd,SQLITE_FCNTL_DB_UNCHANGED,0);
 
 
52071 #endif
52072
52073 /* If this playback is happening automatically as a result of an IO or
52074 ** malloc error that occurred after the change-counter was updated but
52075 ** before the transaction was committed, then the change-counter
@@ -52527,24 +52818,22 @@
52818 **
52819 ** If the busy-handler callback returns non-zero, the lock is
52820 ** retried. If it returns zero, then the SQLITE_BUSY error is
52821 ** returned to the caller of the pager API function.
52822 */
52823 SQLITE_PRIVATE void sqlite3PagerSetBusyHandler(
52824 Pager *pPager, /* Pager object */
52825 int (*xBusyHandler)(void *), /* Pointer to busy-handler function */
52826 void *pBusyHandlerArg /* Argument to pass to xBusyHandler */
52827 ){
52828 void **ap;
52829 pPager->xBusyHandler = xBusyHandler;
52830 pPager->pBusyHandlerArg = pBusyHandlerArg;
52831 ap = (void **)&pPager->xBusyHandler;
52832 assert( ((int(*)(void *))(ap[0]))==xBusyHandler );
52833 assert( ap[1]==pBusyHandlerArg );
52834 sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_BUSYHANDLER, (void *)ap);
 
 
 
52835 }
52836
52837 /*
52838 ** Change the page size used by the Pager object. The new page size
52839 ** is passed in *pPageSize.
@@ -54516,10 +54805,11 @@
54805 Pager *pPager;
54806 assert( pPg!=0 );
54807 assert( pPg->pgno==1 );
54808 assert( (pPg->flags & PGHDR_MMAP)==0 ); /* Page1 is never memory mapped */
54809 pPager = pPg->pPager;
54810 sqlite3PagerResetLockTimeout(pPager);
54811 sqlite3PcacheRelease(pPg);
54812 pagerUnlockIfUnused(pPager);
54813 }
54814
54815 /*
@@ -55111,16 +55401,13 @@
55401 ** If successful, or if called on a pager for which it is a no-op, this
55402 ** function returns SQLITE_OK. Otherwise, an IO error code is returned.
55403 */
55404 SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager, const char *zMaster){
55405 int rc = SQLITE_OK;
55406 void *pArg = (void*)zMaster;
55407 rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SYNC, pArg);
55408 if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
 
 
 
55409 if( rc==SQLITE_OK && !pPager->noSync ){
55410 assert( !MEMDB );
55411 rc = sqlite3OsSync(pPager->fd, pPager->syncFlags);
55412 }
55413 return rc;
@@ -55793,10 +56080,20 @@
56080 */
56081 SQLITE_PRIVATE sqlite3_file *sqlite3PagerFile(Pager *pPager){
56082 return pPager->fd;
56083 }
56084
56085 #ifdef SQLITE_ENABLE_SETLK_TIMEOUT
56086 /*
56087 ** Reset the lock timeout for pager.
56088 */
56089 SQLITE_PRIVATE void sqlite3PagerResetLockTimeout(Pager *pPager){
56090 int x = 0;
56091 sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_LOCK_TIMEOUT, &x);
56092 }
56093 #endif
56094
56095 /*
56096 ** Return the file handle for the journal file (if it exists).
56097 ** This will be either the rollback journal or the WAL file.
56098 */
56099 SQLITE_PRIVATE sqlite3_file *sqlite3PagerJrnlFile(Pager *pPager){
@@ -56253,10 +56550,11 @@
56550 (eMode==SQLITE_CHECKPOINT_PASSIVE ? 0 : pPager->xBusyHandler),
56551 pPager->pBusyHandlerArg,
56552 pPager->walSyncFlags, pPager->pageSize, (u8 *)pPager->pTmpSpace,
56553 pnLog, pnCkpt
56554 );
56555 sqlite3PagerResetLockTimeout(pPager);
56556 }
56557 return rc;
56558 }
56559
56560 SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager){
@@ -63529,11 +63827,12 @@
63827 */
63828 static int btreeInvokeBusyHandler(void *pArg){
63829 BtShared *pBt = (BtShared*)pArg;
63830 assert( pBt->db );
63831 assert( sqlite3_mutex_held(pBt->db->mutex) );
63832 return sqlite3InvokeBusyHandler(&pBt->db->busyHandler,
63833 sqlite3PagerFile(pBt->pPager));
63834 }
63835
63836 /*
63837 ** Open a database file.
63838 **
@@ -63707,11 +64006,11 @@
64006 if( rc!=SQLITE_OK ){
64007 goto btree_open_out;
64008 }
64009 pBt->openFlags = (u8)flags;
64010 pBt->db = db;
64011 sqlite3PagerSetBusyHandler(pBt->pPager, btreeInvokeBusyHandler, pBt);
64012 p->pBt = pBt;
64013
64014 pBt->pCursor = 0;
64015 pBt->pPage1 = 0;
64016 if( sqlite3PagerIsreadonly(pBt->pPager) ) pBt->btsFlags |= BTS_READ_ONLY;
@@ -64670,10 +64969,11 @@
64969 if( rc!=SQLITE_OK ){
64970 unlockBtreeIfUnused(pBt);
64971 }
64972 }while( (rc&0xFF)==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE &&
64973 btreeInvokeBusyHandler(pBt) );
64974 sqlite3PagerResetLockTimeout(pBt->pPager);
64975
64976 if( rc==SQLITE_OK ){
64977 if( p->inTrans==TRANS_NONE ){
64978 pBt->nTransaction++;
64979 #ifndef SQLITE_OMIT_SHARED_CACHE
@@ -98715,25 +99015,65 @@
99015 ** This is the Expr node callback for sqlite3ExprImpliesNotNullRow().
99016 ** If the expression node requires that the table at pWalker->iCur
99017 ** have a non-NULL column, then set pWalker->eCode to 1 and abort.
99018 */
99019 static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
99020 /* This routine is only called for WHERE clause expressions and so it
99021 ** cannot have any TK_AGG_COLUMN entries because those are only found
99022 ** in HAVING clauses. We can get a TK_AGG_FUNCTION in a WHERE clause,
99023 ** but that is an illegal construct and the query will be rejected at
99024 ** a later stage of processing, so the TK_AGG_FUNCTION case does not
99025 ** need to be considered here. */
99026 assert( pExpr->op!=TK_AGG_COLUMN );
99027 testcase( pExpr->op==TK_AGG_FUNCTION );
99028
99029 if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune;
99030 switch( pExpr->op ){
99031 case TK_ISNOT:
99032 case TK_NOT:
99033 case TK_ISNULL:
99034 case TK_IS:
99035 case TK_OR:
99036 case TK_CASE:
99037 case TK_IN:
99038 case TK_FUNCTION:
99039 testcase( pExpr->op==TK_ISNOT );
99040 testcase( pExpr->op==TK_NOT );
99041 testcase( pExpr->op==TK_ISNULL );
99042 testcase( pExpr->op==TK_IS );
99043 testcase( pExpr->op==TK_OR );
99044 testcase( pExpr->op==TK_CASE );
99045 testcase( pExpr->op==TK_IN );
99046 testcase( pExpr->op==TK_FUNCTION );
99047 return WRC_Prune;
99048 case TK_COLUMN:
 
99049 if( pWalker->u.iCur==pExpr->iTable ){
99050 pWalker->eCode = 1;
99051 return WRC_Abort;
99052 }
99053 return WRC_Prune;
99054
99055 /* Virtual tables are allowed to use constraints like x=NULL. So
99056 ** a term of the form x=y does not prove that y is not null if x
99057 ** is the column of a virtual table */
99058 case TK_EQ:
99059 case TK_NE:
99060 case TK_LT:
99061 case TK_LE:
99062 case TK_GT:
99063 case TK_GE:
99064 testcase( pExpr->op==TK_EQ );
99065 testcase( pExpr->op==TK_NE );
99066 testcase( pExpr->op==TK_LT );
99067 testcase( pExpr->op==TK_LE );
99068 testcase( pExpr->op==TK_GT );
99069 testcase( pExpr->op==TK_GE );
99070 if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->pTab))
99071 || (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->pTab))
99072 ){
99073 return WRC_Prune;
99074 }
99075 default:
99076 return WRC_Continue;
99077 }
99078 }
99079
@@ -98740,10 +99080,17 @@
99080 /*
99081 ** Return true (non-zero) if expression p can only be true if at least
99082 ** one column of table iTab is non-null. In other words, return true
99083 ** if expression p will always be NULL or false if every column of iTab
99084 ** is NULL.
99085 **
99086 ** False negatives are acceptable. In other words, it is ok to return
99087 ** zero even if expression p will never be true of every column of iTab
99088 ** is NULL. A false negative is merely a missed optimization opportunity.
99089 **
99090 ** False positives are not allowed, however. A false positive may result
99091 ** in an incorrect answer.
99092 **
99093 ** Terms of p that are marked with EP_FromJoin (and hence that come from
99094 ** the ON or USING clauses of LEFT JOINS) are excluded from the analysis.
99095 **
99096 ** This routine is used to check if a LEFT JOIN can be converted into
@@ -101005,11 +101352,11 @@
101352 }
101353 if( pTab->tnum==0 ){
101354 /* Do not gather statistics on views or virtual tables */
101355 return;
101356 }
101357 if( sqlite3_strlike("sqlite\\_%", pTab->zName, '\\')==0 ){
101358 /* Do not gather statistics on system tables */
101359 return;
101360 }
101361 assert( sqlite3BtreeHoldsAllMutexes(db) );
101362 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
@@ -104066,11 +104413,11 @@
104413 if( !sqlite3ExprIsConstantOrFunction(pExpr, db->init.busy) ){
104414 sqlite3ErrorMsg(pParse, "default value of column [%s] is not constant",
104415 pCol->zName);
104416 }else{
104417 /* A copy of pExpr is used instead of the original, as pExpr contains
104418 ** tokens that point to volatile memory.
104419 */
104420 Expr x;
104421 sqlite3ExprDelete(db, pCol->pDflt);
104422 memset(&x, 0, sizeof(x));
104423 x.op = TK_SPAN;
@@ -104310,11 +104657,11 @@
104657 SQLITE_PRIVATE void sqlite3ChangeCookie(Parse *pParse, int iDb){
104658 sqlite3 *db = pParse->db;
104659 Vdbe *v = pParse->pVdbe;
104660 assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
104661 sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION,
104662 (int)(1+(unsigned)db->aDb[iDb].pSchema->schema_cookie));
104663 }
104664
104665 /*
104666 ** Measure the number of characters needed to output the given
104667 ** identifier. The number returned includes any quotes used
@@ -104988,11 +105335,11 @@
105335 Table *pSelTab; /* A fake table from which we get the result set */
105336 Select *pSel; /* Copy of the SELECT that implements the view */
105337 int nErr = 0; /* Number of errors encountered */
105338 int n; /* Temporarily holds the number of cursors assigned */
105339 sqlite3 *db = pParse->db; /* Database connection for malloc errors */
105340 #ifndef SQLITE_OMIT_VIRTUALTABLE
105341 int rc;
105342 #endif
105343 #ifndef SQLITE_OMIT_AUTHORIZATION
105344 sqlite3_xauth xAuth; /* Saved xAuth pointer */
105345 #endif
@@ -123694,11 +124041,10 @@
124041 ExprList *pOrderBy = pSub->pOrderBy;
124042 for(i=0; i<pOrderBy->nExpr; i++){
124043 pOrderBy->a[i].u.x.iOrderByCol = 0;
124044 }
124045 assert( pParent->pOrderBy==0 );
 
124046 pParent->pOrderBy = pOrderBy;
124047 pSub->pOrderBy = 0;
124048 }
124049 pWhere = sqlite3ExprDup(db, pSub->pWhere, 0);
124050 if( isLeftJoin>0 ){
@@ -123778,12 +124124,13 @@
124124 ** (2) The inner query is the recursive part of a common table expression.
124125 **
124126 ** (3) The inner query has a LIMIT clause (since the changes to the WHERE
124127 ** close would change the meaning of the LIMIT).
124128 **
124129 ** (4) The inner query is the right operand of a LEFT JOIN and the
124130 ** expression to be pushed down does not come from the ON clause
124131 ** on that LEFT JOIN.
124132 **
124133 ** (5) The WHERE clause expression originates in the ON or USING clause
124134 ** of a LEFT JOIN where iCursor is not the right-hand table of that
124135 ** left join. An example:
124136 **
@@ -123801,11 +124148,12 @@
124148 */
124149 static int pushDownWhereTerms(
124150 Parse *pParse, /* Parse context (for malloc() and error reporting) */
124151 Select *pSubq, /* The subquery whose WHERE clause is to be augmented */
124152 Expr *pWhere, /* The WHERE clause of the outer query */
124153 int iCursor, /* Cursor number of the subquery */
124154 int isLeftJoin /* True if pSubq is the right term of a LEFT JOIN */
124155 ){
124156 Expr *pNew;
124157 int nChng = 0;
124158 if( pWhere==0 ) return 0;
124159 if( pSubq->selFlags & SF_Recursive ) return 0; /* restriction (2) */
@@ -123825,13 +124173,20 @@
124173
124174 if( pSubq->pLimit!=0 ){
124175 return 0; /* restriction (3) */
124176 }
124177 while( pWhere->op==TK_AND ){
124178 nChng += pushDownWhereTerms(pParse, pSubq, pWhere->pRight,
124179 iCursor, isLeftJoin);
124180 pWhere = pWhere->pLeft;
124181 }
124182 if( isLeftJoin
124183 && (ExprHasProperty(pWhere,EP_FromJoin)==0
124184 || pWhere->iRightJoinTable!=iCursor)
124185 ){
124186 return 0; /* restriction (4) */
124187 }
124188 if( ExprHasProperty(pWhere,EP_FromJoin) && pWhere->iRightJoinTable!=iCursor ){
124189 return 0; /* restriction (5) */
124190 }
124191 if( sqlite3ExprIsTableConstant(pWhere, iCursor) ){
124192 nChng++;
@@ -124291,13 +124646,11 @@
124646 if( (selFlags & SF_Expanded)!=0 ){
124647 return WRC_Prune;
124648 }
124649 pTabList = p->pSrc;
124650 pEList = p->pEList;
124651 sqlite3WithPush(pParse, p->pWith, 0);
 
 
124652
124653 /* Make sure cursor numbers have been assigned to all entries in
124654 ** the FROM clause of the SELECT statement.
124655 */
124656 sqlite3SrcListAssignCursors(pParse, pTabList);
@@ -125295,11 +125648,12 @@
125648
125649 /* Make copies of constant WHERE-clause terms in the outer query down
125650 ** inside the subquery. This can help the subquery to run more efficiently.
125651 */
125652 if( OptimizationEnabled(db, SQLITE_PushDown)
125653 && pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor,
125654 (pItem->fg.jointype & JT_OUTER)!=0)
125655 ){
125656 #if SELECTTRACE_ENABLED
125657 if( sqlite3SelectTrace & 0x100 ){
125658 SELECTTRACE(0x100,pParse,p,("After WHERE-clause push-down:\n"));
125659 sqlite3TreeViewSelect(0, p, 0);
@@ -127755,11 +128109,11 @@
128109 iPk = pParse->nMem+1;
128110 pParse->nMem += nPk;
128111 regKey = ++pParse->nMem;
128112 iEph = pParse->nTab++;
128113
128114 sqlite3VdbeAddOp3(v, OP_Null, 0, iPk, iPk+nPk-1);
128115 addrOpen = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, iEph, nPk);
128116 sqlite3VdbeSetP4KeyInfo(pParse, pPk);
128117 }
128118
128119 /* Begin the database scan.
@@ -129927,11 +130281,11 @@
130281
130282 /*
130283 ** Trace output macros
130284 */
130285 #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
130286 /***/ extern int sqlite3WhereTrace;
130287 #endif
130288 #if defined(SQLITE_DEBUG) \
130289 && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_WHERETRACE))
130290 # define WHERETRACE(K,X) if(sqlite3WhereTrace&(K)) sqlite3DebugPrintf X
130291 # define WHERETRACE_ENABLED 1
@@ -132576,22 +132930,23 @@
132930 if( iLoop<3 && (pTerm->wtFlags & TERM_VARSELECT) ){
132931 if( iNext==0 ) iNext = 3;
132932 continue;
132933 }
132934
132935 if( (pTerm->wtFlags & TERM_LIKECOND)!=0 ){
132936 /* If the TERM_LIKECOND flag is set, that means that the range search
132937 ** is sufficient to guarantee that the LIKE operator is true, so we
132938 ** can skip the call to the like(A,B) function. But this only works
132939 ** for strings. So do not skip the call to the function on the pass
132940 ** that compares BLOBs. */
132941 #ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS
132942 continue;
132943 #else
132944 u32 x = pLevel->iLikeRepCntr;
132945 if( x>0 ){
132946 skipLikeAddr = sqlite3VdbeAddOp1(v, (x&1)?OP_IfNot:OP_If,(int)(x>>1));
132947 }
132948 VdbeCoverage(v);
132949 #endif
132950 }
132951 #ifdef WHERETRACE_ENABLED /* 0xffff */
132952 if( sqlite3WhereTrace ){
@@ -136579,12 +136934,12 @@
136934 LogEst rLogSize; /* Logarithm of table size */
136935 WhereTerm *pTop = 0, *pBtm = 0; /* Top and bottom range constraints */
136936
136937 pNew = pBuilder->pNew;
136938 if( db->mallocFailed ) return SQLITE_NOMEM_BKPT;
136939 WHERETRACE(0x800, ("BEGIN %s.addBtreeIdx(%s), nEq=%d\n",
136940 pProbe->pTable->zName,pProbe->zName, pNew->u.btree.nEq));
136941
136942 assert( (pNew->wsFlags & WHERE_VIRTUALTABLE)==0 );
136943 assert( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 );
136944 if( pNew->wsFlags & WHERE_BTM_LIMIT ){
136945 opMask = WO_LT|WO_LE;
@@ -136866,12 +137221,12 @@
137221 pNew->u.btree.nEq = saved_nEq;
137222 pNew->nSkip = saved_nSkip;
137223 pNew->wsFlags = saved_wsFlags;
137224 }
137225
137226 WHERETRACE(0x800, ("END %s.addBtreeIdx(%s), nEq=%d, rc=%d\n",
137227 pProbe->pTable->zName, pProbe->zName, saved_nEq, rc));
137228 return rc;
137229 }
137230
137231 /*
137232 ** Return True if it is possible that pIndex might be useful in
@@ -137305,13 +137660,13 @@
137660 || j<0
137661 || j>=pWC->nTerm
137662 || pNew->aLTerm[iTerm]!=0
137663 || pIdxCons->usable==0
137664 ){
 
137665 sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
137666 testcase( pIdxInfo->needToFreeIdxStr );
137667 return SQLITE_ERROR;
137668 }
137669 testcase( iTerm==nConstraint-1 );
137670 testcase( j==0 );
137671 testcase( j==pWC->nTerm-1 );
137672 pTerm = &pWC->a[j];
@@ -137335,10 +137690,19 @@
137690 }
137691 }
137692 pNew->u.vtab.omitMask &= ~mNoOmit;
137693
137694 pNew->nLTerm = mxTerm+1;
137695 for(i=0; i<=mxTerm; i++){
137696 if( pNew->aLTerm[i]==0 ){
137697 /* The non-zero argvIdx values must be contiguous. Raise an
137698 ** error if they are not */
137699 sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName);
137700 testcase( pIdxInfo->needToFreeIdxStr );
137701 return SQLITE_ERROR;
137702 }
137703 }
137704 assert( pNew->nLTerm<=pNew->nLSlot );
137705 pNew->u.vtab.idxNum = pIdxInfo->idxNum;
137706 pNew->u.vtab.needFree = pIdxInfo->needToFreeIdxStr;
137707 pIdxInfo->needToFreeIdxStr = 0;
137708 pNew->u.vtab.idxStr = pIdxInfo->idxStr;
@@ -137450,10 +137814,11 @@
137814 sqlite3DbFree(pParse->db, p);
137815 return SQLITE_NOMEM_BKPT;
137816 }
137817
137818 /* First call xBestIndex() with all constraints usable. */
137819 WHERETRACE(0x800, ("BEGIN %s.addVirtual()\n", pSrc->pTab->zName));
137820 WHERETRACE(0x40, (" VirtualOne: all usable\n"));
137821 rc = whereLoopAddVirtualOne(pBuilder, mPrereq, ALLBITS, 0, p, mNoOmit, &bIn);
137822
137823 /* If the call to xBestIndex() with all terms enabled produced a plan
137824 ** that does not require any source tables (IOW: a plan with mBest==0),
@@ -137525,10 +137890,11 @@
137890 }
137891 }
137892
137893 if( p->needToFreeIdxStr ) sqlite3_free(p->idxStr);
137894 sqlite3DbFreeNN(pParse->db, p);
137895 WHERETRACE(0x800, ("END %s.addVirtual(), rc=%d\n", pSrc->pTab->zName, rc));
137896 return rc;
137897 }
137898 #endif /* SQLITE_OMIT_VIRTUALTABLE */
137899
137900 /*
@@ -139665,21 +140031,21 @@
140031 #define sqlite3ParserARG_SDECL Parse *pParse;
140032 #define sqlite3ParserARG_PDECL ,Parse *pParse
140033 #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
140034 #define sqlite3ParserARG_STORE yypParser->pParse = pParse
140035 #define YYFALLBACK 1
140036 #define YYNSTATE 472
140037 #define YYNRULE 333
140038 #define YYNTOKEN 143
140039 #define YY_MAX_SHIFT 471
140040 #define YY_MIN_SHIFTREDUCE 681
140041 #define YY_MAX_SHIFTREDUCE 1013
140042 #define YY_ERROR_ACTION 1014
140043 #define YY_ACCEPT_ACTION 1015
140044 #define YY_NO_ACTION 1016
140045 #define YY_MIN_REDUCE 1017
140046 #define YY_MAX_REDUCE 1349
140047 /************* End control #defines *******************************************/
140048
140049 /* Define the yytestcase() macro to be a no-op if is not already defined
140050 ** otherwise.
140051 **
@@ -139741,326 +140107,328 @@
140107 ** yy_reduce_ofst[] For each state, the offset into yy_action for
140108 ** shifting non-terminals after a reduce.
140109 ** yy_default[] Default action for each state.
140110 **
140111 *********** Begin parsing tables **********************************************/
140112 #define YY_ACTTAB_COUNT (1566)
140113 static const YYACTIONTYPE yy_action[] = {
140114 /* 0 */ 1169, 1015, 167, 167, 1, 168, 466, 1313, 466, 1083,
140115 /* 10 */ 1062, 466, 97, 94, 183, 1057, 466, 329, 1083, 342,
140116 /* 20 */ 97, 94, 183, 459, 459, 459, 436, 57, 57, 57,
140117 /* 30 */ 57, 807, 57, 57, 367, 367, 367, 57, 57, 808,
140118 /* 40 */ 1270, 1088, 1088, 104, 105, 95, 991, 991, 868, 871,
140119 /* 50 */ 860, 860, 102, 102, 103, 103, 103, 103, 233, 233,
140120 /* 60 */ 326, 1011, 449, 437, 449, 446, 351, 449, 461, 1142,
140121 /* 70 */ 463, 342, 449, 426, 1316, 209, 180, 742, 80, 299,
140122 /* 80 */ 857, 857, 869, 872, 101, 101, 101, 101, 100, 100,
140123 /* 90 */ 99, 99, 99, 98, 368, 104, 105, 95, 991, 991,
140124 /* 100 */ 868, 871, 860, 860, 102, 102, 103, 103, 103, 103,
140125 /* 110 */ 99, 99, 99, 98, 368, 355, 97, 94, 183, 228,
140126 /* 120 */ 106, 1012, 407, 342, 101, 101, 101, 101, 100, 100,
140127 /* 130 */ 99, 99, 99, 98, 368, 861, 101, 101, 101, 101,
140128 /* 140 */ 100, 100, 99, 99, 99, 98, 368, 104, 105, 95,
140129 /* 150 */ 991, 991, 868, 871, 860, 860, 102, 102, 103, 103,
140130 /* 160 */ 103, 103, 201, 368, 375, 420, 417, 416, 387, 273,
140131 /* 170 */ 65, 97, 94, 183, 168, 342, 415, 951, 1343, 396,
140132 /* 180 */ 66, 1343, 320, 959, 371, 970, 334, 340, 101, 101,
140133 /* 190 */ 101, 101, 100, 100, 99, 99, 99, 98, 368, 104,
140134 /* 200 */ 105, 95, 991, 991, 868, 871, 860, 860, 102, 102,
140135 /* 210 */ 103, 103, 103, 103, 373, 100, 100, 99, 99, 99,
140136 /* 220 */ 98, 368, 970, 971, 972, 201, 1100, 342, 420, 417,
140137 /* 230 */ 416, 287, 366, 365, 337, 970, 1162, 463, 949, 415,
140138 /* 240 */ 101, 101, 101, 101, 100, 100, 99, 99, 99, 98,
140139 /* 250 */ 368, 104, 105, 95, 991, 991, 868, 871, 860, 860,
140140 /* 260 */ 102, 102, 103, 103, 103, 103, 777, 241, 233, 233,
140141 /* 270 */ 9, 847, 970, 971, 972, 390, 998, 1141, 998, 342,
140142 /* 280 */ 463, 252, 829, 719, 98, 368, 840, 298, 338, 142,
140143 /* 290 */ 839, 339, 101, 101, 101, 101, 100, 100, 99, 99,
140144 /* 300 */ 99, 98, 368, 104, 105, 95, 991, 991, 868, 871,
140145 /* 310 */ 860, 860, 102, 102, 103, 103, 103, 103, 272, 466,
140146 /* 320 */ 392, 839, 839, 841, 97, 94, 183, 390, 1317, 253,
140147 /* 330 */ 456, 342, 125, 166, 807, 712, 208, 407, 386, 970,
140148 /* 340 */ 57, 57, 808, 238, 101, 101, 101, 101, 100, 100,
140149 /* 350 */ 99, 99, 99, 98, 368, 104, 105, 95, 991, 991,
140150 /* 360 */ 868, 871, 860, 860, 102, 102, 103, 103, 103, 103,
140151 /* 370 */ 466, 108, 466, 267, 465, 442, 970, 971, 972, 261,
140152 /* 380 */ 951, 1344, 909, 342, 1344, 142, 829, 848, 1292, 959,
140153 /* 390 */ 371, 55, 55, 57, 57, 242, 101, 101, 101, 101,
140154 /* 400 */ 100, 100, 99, 99, 99, 98, 368, 104, 105, 95,
140155 /* 410 */ 991, 991, 868, 871, 860, 860, 102, 102, 103, 103,
140156 /* 420 */ 103, 103, 272, 382, 262, 253, 456, 310, 364, 253,
140157 /* 430 */ 456, 86, 264, 84, 266, 342, 441, 176, 175, 834,
140158 /* 440 */ 464, 949, 767, 767, 332, 313, 1094, 396, 101, 101,
140159 /* 450 */ 101, 101, 100, 100, 99, 99, 99, 98, 368, 104,
140160 /* 460 */ 105, 95, 991, 991, 868, 871, 860, 860, 102, 102,
140161 /* 470 */ 103, 103, 103, 103, 227, 227, 233, 233, 233, 233,
140162 /* 480 */ 387, 273, 234, 234, 326, 950, 463, 342, 463, 298,
140163 /* 490 */ 463, 914, 914, 404, 463, 1037, 123, 265, 27, 970,
140164 /* 500 */ 101, 101, 101, 101, 100, 100, 99, 99, 99, 98,
140165 /* 510 */ 368, 104, 105, 95, 991, 991, 868, 871, 860, 860,
140166 /* 520 */ 102, 102, 103, 103, 103, 103, 435, 233, 233, 466,
140167 /* 530 */ 285, 686, 687, 688, 127, 271, 970, 971, 972, 463,
140168 /* 540 */ 1345, 327, 342, 407, 157, 1012, 988, 13, 13, 181,
140169 /* 550 */ 41, 41, 101, 101, 101, 101, 100, 100, 99, 99,
140170 /* 560 */ 99, 98, 368, 715, 794, 378, 104, 105, 95, 991,
140171 /* 570 */ 991, 868, 871, 860, 860, 102, 102, 103, 103, 103,
140172 /* 580 */ 103, 970, 378, 377, 346, 239, 847, 1086, 1086, 280,
140173 /* 590 */ 1169, 283, 204, 203, 202, 177, 298, 342, 407, 298,
140174 /* 600 */ 715, 840, 169, 299, 407, 839, 82, 101, 101, 101,
140175 /* 610 */ 101, 100, 100, 99, 99, 99, 98, 368, 970, 971,
140176 /* 620 */ 972, 104, 105, 95, 991, 991, 868, 871, 860, 860,
140177 /* 630 */ 102, 102, 103, 103, 103, 103, 839, 839, 841, 362,
140178 /* 640 */ 240, 124, 1169, 172, 126, 378, 1269, 1169, 1066, 342,
140179 /* 650 */ 253, 456, 407, 407, 407, 396, 352, 401, 407, 429,
140180 /* 660 */ 398, 85, 101, 101, 101, 101, 100, 100, 99, 99,
140181 /* 670 */ 99, 98, 368, 104, 105, 95, 991, 991, 868, 871,
140182 /* 680 */ 860, 860, 102, 102, 103, 103, 103, 103, 1169, 466,
140183 /* 690 */ 230, 233, 233, 792, 1235, 1095, 1091, 1293, 1, 77,
140184 /* 700 */ 278, 342, 205, 463, 974, 911, 1040, 348, 353, 911,
140185 /* 710 */ 42, 42, 79, 403, 101, 101, 101, 101, 100, 100,
140186 /* 720 */ 99, 99, 99, 98, 368, 104, 93, 95, 991, 991,
140187 /* 730 */ 868, 871, 860, 860, 102, 102, 103, 103, 103, 103,
140188 /* 740 */ 402, 9, 974, 243, 772, 458, 348, 232, 180, 771,
140189 /* 750 */ 946, 312, 342, 328, 363, 349, 143, 831, 389, 1278,
140190 /* 760 */ 211, 211, 21, 347, 432, 182, 101, 101, 101, 101,
140191 /* 770 */ 100, 100, 99, 99, 99, 98, 368, 105, 95, 991,
140192 /* 780 */ 991, 868, 871, 860, 860, 102, 102, 103, 103, 103,
140193 /* 790 */ 103, 792, 724, 22, 732, 731, 233, 233, 1239, 256,
140194 /* 800 */ 391, 274, 342, 211, 79, 360, 257, 413, 463, 397,
140195 /* 810 */ 207, 288, 260, 450, 79, 1239, 1241, 101, 101, 101,
140196 /* 820 */ 101, 100, 100, 99, 99, 99, 98, 368, 95, 991,
140197 /* 830 */ 991, 868, 871, 860, 860, 102, 102, 103, 103, 103,
140198 /* 840 */ 103, 91, 457, 296, 3, 233, 233, 5, 438, 212,
140199 /* 850 */ 331, 394, 739, 740, 295, 898, 894, 463, 460, 207,
140200 /* 860 */ 801, 1237, 722, 211, 698, 843, 1283, 101, 101, 101,
140201 /* 870 */ 101, 100, 100, 99, 99, 99, 98, 368, 1239, 380,
140202 /* 880 */ 357, 369, 233, 233, 989, 219, 236, 297, 423, 292,
140203 /* 890 */ 422, 206, 454, 898, 463, 970, 91, 457, 290, 3,
140204 /* 900 */ 722, 142, 268, 843, 847, 466, 1258, 149, 388, 425,
140205 /* 910 */ 88, 89, 769, 460, 930, 87, 447, 90, 369, 468,
140206 /* 920 */ 467, 385, 989, 839, 1257, 439, 57, 57, 395, 931,
140207 /* 930 */ 1065, 158, 970, 971, 972, 772, 369, 471, 1019, 399,
140208 /* 940 */ 771, 253, 456, 254, 932, 119, 891, 454, 233, 233,
140209 /* 950 */ 4, 970, 1096, 275, 839, 839, 841, 842, 19, 847,
140210 /* 960 */ 463, 449, 448, 163, 453, 88, 89, 776, 970, 1127,
140211 /* 970 */ 279, 930, 90, 369, 468, 467, 91, 457, 839, 3,
140212 /* 980 */ 235, 1064, 466, 1228, 233, 233, 931, 970, 970, 971,
140213 /* 990 */ 972, 970, 908, 460, 908, 2, 463, 81, 457, 212,
140214 /* 1000 */ 3, 932, 282, 10, 10, 970, 971, 972, 189, 839,
140215 /* 1010 */ 839, 841, 842, 19, 460, 284, 369, 354, 907, 286,
140216 /* 1020 */ 907, 753, 466, 1079, 970, 971, 972, 454, 970, 971,
140217 /* 1030 */ 972, 754, 970, 1063, 989, 372, 792, 369, 1118, 847,
140218 /* 1040 */ 291, 452, 466, 10, 10, 88, 89, 142, 454, 168,
140219 /* 1050 */ 300, 412, 90, 369, 468, 467, 793, 356, 839, 706,
140220 /* 1060 */ 847, 341, 121, 10, 10, 301, 88, 89, 379, 970,
140221 /* 1070 */ 971, 972, 989, 90, 369, 468, 467, 244, 205, 839,
140222 /* 1080 */ 1306, 245, 1135, 245, 250, 1168, 1114, 253, 456, 839,
140223 /* 1090 */ 839, 841, 842, 19, 1125, 237, 122, 451, 1174, 733,
140224 /* 1100 */ 324, 324, 323, 222, 321, 466, 1046, 695, 182, 225,
140225 /* 1110 */ 839, 839, 841, 842, 19, 103, 103, 103, 103, 96,
140226 /* 1120 */ 185, 466, 259, 1039, 1028, 170, 10, 10, 1027, 421,
140227 /* 1130 */ 258, 1029, 1300, 708, 792, 466, 408, 734, 8, 347,
140228 /* 1140 */ 444, 174, 12, 12, 290, 101, 101, 101, 101, 100,
140229 /* 1150 */ 100, 99, 99, 99, 98, 368, 32, 32, 466, 187,
140230 /* 1160 */ 466, 1111, 103, 103, 103, 103, 188, 466, 325, 138,
140231 /* 1170 */ 186, 708, 303, 305, 307, 358, 970, 270, 393, 43,
140232 /* 1180 */ 43, 44, 44, 1157, 333, 178, 418, 294, 45, 45,
140233 /* 1190 */ 1232, 318, 101, 101, 101, 101, 100, 100, 99, 99,
140234 /* 1200 */ 99, 98, 368, 381, 343, 366, 365, 466, 263, 253,
140235 /* 1210 */ 456, 466, 1062, 970, 971, 972, 1231, 997, 309, 466,
140236 /* 1220 */ 455, 466, 427, 466, 995, 173, 996, 1303, 46, 46,
140237 /* 1230 */ 145, 376, 37, 37, 1006, 1277, 466, 214, 1275, 64,
140238 /* 1240 */ 47, 47, 33, 33, 34, 34, 1003, 67, 466, 998,
140239 /* 1250 */ 350, 998, 466, 155, 233, 233, 466, 36, 36, 24,
140240 /* 1260 */ 140, 77, 1154, 466, 383, 466, 463, 428, 466, 48,
140241 /* 1270 */ 48, 466, 147, 49, 49, 466, 150, 50, 50, 466,
140242 /* 1280 */ 151, 152, 466, 384, 11, 11, 51, 51, 466, 110,
140243 /* 1290 */ 110, 153, 52, 52, 411, 466, 38, 38, 466, 191,
140244 /* 1300 */ 53, 53, 466, 54, 54, 466, 400, 466, 330, 39,
140245 /* 1310 */ 39, 466, 1164, 466, 25, 466, 56, 56, 466, 131,
140246 /* 1320 */ 131, 72, 466, 132, 132, 159, 133, 133, 61, 61,
140247 /* 1330 */ 1226, 195, 40, 40, 111, 111, 58, 58, 406, 112,
140248 /* 1340 */ 112, 466, 277, 113, 113, 466, 226, 466, 1246, 466,
140249 /* 1350 */ 197, 466, 164, 466, 409, 466, 198, 466, 199, 466,
140250 /* 1360 */ 335, 281, 109, 109, 466, 1030, 130, 130, 129, 129,
140251 /* 1370 */ 117, 117, 116, 116, 114, 114, 115, 115, 60, 60,
140252 /* 1380 */ 62, 62, 466, 359, 466, 59, 59, 424, 1082, 1081,
140253 /* 1390 */ 1080, 724, 1073, 1054, 336, 293, 1053, 1052, 1315, 431,
140254 /* 1400 */ 361, 76, 248, 31, 31, 35, 35, 1072, 249, 440,
140255 /* 1410 */ 302, 434, 213, 1122, 6, 311, 1212, 107, 83, 251,
140256 /* 1420 */ 78, 1123, 445, 220, 443, 1036, 304, 23, 1121, 469,
140257 /* 1430 */ 965, 221, 223, 1104, 314, 224, 344, 317, 315, 316,
140258 /* 1440 */ 470, 306, 1025, 1120, 308, 1262, 1020, 134, 120, 246,
140259 /* 1450 */ 682, 370, 171, 255, 1263, 135, 184, 1261, 1260, 374,
140260 /* 1460 */ 118, 906, 904, 827, 1050, 146, 136, 137, 148, 1049,
140261 /* 1470 */ 63, 1047, 756, 190, 269, 920, 154, 156, 68, 69,
140262 /* 1480 */ 70, 71, 139, 923, 192, 193, 144, 919, 345, 128,
140263 /* 1490 */ 14, 194, 276, 211, 1000, 405, 196, 161, 912, 160,
140264 /* 1500 */ 26, 697, 410, 295, 200, 289, 414, 162, 419, 73,
140265 /* 1510 */ 15, 16, 141, 74, 28, 247, 846, 845, 735, 874,
140266 /* 1520 */ 954, 75, 430, 955, 29, 433, 179, 229, 231, 800,
140267 /* 1530 */ 165, 795, 87, 210, 889, 79, 875, 17, 873, 877,
140268 /* 1540 */ 929, 18, 928, 216, 215, 878, 20, 30, 462, 844,
140269 /* 1550 */ 707, 92, 766, 770, 7, 322, 217, 218, 319, 1308,
140270 /* 1560 */ 960, 1016, 1016, 1016, 1016, 1307,
140271 };
140272 static const YYCODETYPE yy_lookahead[] = {
140273 /* 0 */ 152, 144, 145, 146, 147, 152, 152, 172, 152, 180,
140274 /* 10 */ 181, 152, 223, 224, 225, 180, 152, 164, 189, 19,
140275 /* 20 */ 223, 224, 225, 168, 169, 170, 163, 173, 174, 173,
140276 /* 30 */ 174, 31, 173, 174, 168, 169, 170, 173, 174, 39,
140277 /* 40 */ 243, 191, 192, 43, 44, 45, 46, 47, 48, 49,
140278 /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 195, 196,
140279 /* 60 */ 22, 23, 208, 209, 208, 209, 218, 208, 209, 176,
140280 /* 70 */ 207, 19, 208, 209, 23, 212, 213, 26, 26, 152,
140281 /* 80 */ 46, 47, 48, 49, 84, 85, 86, 87, 88, 89,
140282 /* 90 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47,
140283 /* 100 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
140284 /* 110 */ 90, 91, 92, 93, 94, 188, 223, 224, 225, 171,
140285 /* 120 */ 68, 83, 152, 19, 84, 85, 86, 87, 88, 89,
140286 /* 130 */ 90, 91, 92, 93, 94, 101, 84, 85, 86, 87,
140287 /* 140 */ 88, 89, 90, 91, 92, 93, 94, 43, 44, 45,
140288 /* 150 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
140289 /* 160 */ 56, 57, 99, 94, 194, 102, 103, 104, 109, 110,
140290 /* 170 */ 66, 223, 224, 225, 152, 19, 113, 22, 23, 152,
140291 /* 180 */ 24, 26, 160, 1, 2, 59, 164, 173, 84, 85,
140292 /* 190 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 43,
140293 /* 200 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
140294 /* 210 */ 54, 55, 56, 57, 244, 88, 89, 90, 91, 92,
140295 /* 220 */ 93, 94, 96, 97, 98, 99, 196, 19, 102, 103,
140296 /* 230 */ 104, 23, 88, 89, 173, 59, 163, 207, 83, 113,
140297 /* 240 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
140298 /* 250 */ 94, 43, 44, 45, 46, 47, 48, 49, 50, 51,
140299 /* 260 */ 52, 53, 54, 55, 56, 57, 90, 240, 195, 196,
140300 /* 270 */ 171, 82, 96, 97, 98, 152, 132, 176, 134, 19,
140301 /* 280 */ 207, 200, 72, 23, 93, 94, 97, 152, 173, 79,
140302 /* 290 */ 101, 210, 84, 85, 86, 87, 88, 89, 90, 91,
140303 /* 300 */ 92, 93, 94, 43, 44, 45, 46, 47, 48, 49,
140304 /* 310 */ 50, 51, 52, 53, 54, 55, 56, 57, 108, 152,
140305 /* 320 */ 152, 132, 133, 134, 223, 224, 225, 152, 186, 119,
140306 /* 330 */ 120, 19, 197, 234, 31, 23, 26, 152, 239, 59,
140307 /* 340 */ 173, 174, 39, 220, 84, 85, 86, 87, 88, 89,
140308 /* 350 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47,
140309 /* 360 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
140310 /* 370 */ 152, 22, 152, 16, 152, 208, 96, 97, 98, 194,
140311 /* 380 */ 22, 23, 11, 19, 26, 79, 72, 23, 0, 1,
140312 /* 390 */ 2, 173, 174, 173, 174, 220, 84, 85, 86, 87,
140313 /* 400 */ 88, 89, 90, 91, 92, 93, 94, 43, 44, 45,
140314 /* 410 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
140315 /* 420 */ 56, 57, 108, 109, 110, 119, 120, 152, 208, 119,
140316 /* 430 */ 120, 137, 75, 139, 77, 19, 152, 88, 89, 23,
140317 /* 440 */ 115, 83, 117, 118, 163, 227, 163, 152, 84, 85,
140318 /* 450 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 43,
140319 /* 460 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
140320 /* 470 */ 54, 55, 56, 57, 195, 196, 195, 196, 195, 196,
140321 /* 480 */ 109, 110, 195, 196, 22, 23, 207, 19, 207, 152,
140322 /* 490 */ 207, 108, 109, 110, 207, 163, 22, 140, 24, 59,
140323 /* 500 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
140324 /* 510 */ 94, 43, 44, 45, 46, 47, 48, 49, 50, 51,
140325 /* 520 */ 52, 53, 54, 55, 56, 57, 152, 195, 196, 152,
140326 /* 530 */ 16, 7, 8, 9, 197, 240, 96, 97, 98, 207,
140327 /* 540 */ 249, 250, 19, 152, 22, 83, 26, 173, 174, 152,
140328 /* 550 */ 173, 174, 84, 85, 86, 87, 88, 89, 90, 91,
140329 /* 560 */ 92, 93, 94, 59, 124, 152, 43, 44, 45, 46,
140330 /* 570 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
140331 /* 580 */ 57, 59, 169, 170, 157, 194, 82, 191, 192, 75,
140332 /* 590 */ 152, 77, 108, 109, 110, 26, 152, 19, 152, 152,
140333 /* 600 */ 96, 97, 24, 152, 152, 101, 138, 84, 85, 86,
140334 /* 610 */ 87, 88, 89, 90, 91, 92, 93, 94, 96, 97,
140335 /* 620 */ 98, 43, 44, 45, 46, 47, 48, 49, 50, 51,
140336 /* 630 */ 52, 53, 54, 55, 56, 57, 132, 133, 134, 188,
140337 /* 640 */ 194, 197, 152, 123, 197, 232, 194, 152, 182, 19,
140338 /* 650 */ 119, 120, 152, 152, 152, 152, 218, 230, 152, 163,
140339 /* 660 */ 233, 138, 84, 85, 86, 87, 88, 89, 90, 91,
140340 /* 670 */ 92, 93, 94, 43, 44, 45, 46, 47, 48, 49,
140341 /* 680 */ 50, 51, 52, 53, 54, 55, 56, 57, 152, 152,
140342 /* 690 */ 23, 195, 196, 26, 194, 194, 194, 146, 147, 130,
140343 /* 700 */ 194, 19, 46, 207, 59, 29, 166, 167, 218, 33,
140344 /* 710 */ 173, 174, 26, 218, 84, 85, 86, 87, 88, 89,
140345 /* 720 */ 90, 91, 92, 93, 94, 43, 44, 45, 46, 47,
140346 /* 730 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
140347 /* 740 */ 64, 171, 97, 240, 116, 166, 167, 212, 213, 121,
140348 /* 750 */ 23, 152, 19, 26, 218, 247, 248, 23, 23, 152,
140349 /* 760 */ 26, 26, 22, 107, 163, 98, 84, 85, 86, 87,
140350 /* 770 */ 88, 89, 90, 91, 92, 93, 94, 44, 45, 46,
140351 /* 780 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
140352 /* 790 */ 57, 124, 106, 53, 100, 101, 195, 196, 152, 152,
140353 /* 800 */ 23, 23, 19, 26, 26, 19, 152, 23, 207, 239,
140354 /* 810 */ 26, 23, 152, 163, 26, 169, 170, 84, 85, 86,
140355 /* 820 */ 87, 88, 89, 90, 91, 92, 93, 94, 45, 46,
140356 /* 830 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
140357 /* 840 */ 57, 19, 20, 101, 22, 195, 196, 22, 19, 24,
140358 /* 850 */ 163, 19, 7, 8, 112, 59, 23, 207, 36, 26,
140359 /* 860 */ 23, 152, 59, 26, 21, 59, 152, 84, 85, 86,
140360 /* 870 */ 87, 88, 89, 90, 91, 92, 93, 94, 232, 221,
140361 /* 880 */ 94, 59, 195, 196, 59, 99, 100, 101, 102, 103,
140362 /* 890 */ 104, 105, 70, 97, 207, 59, 19, 20, 112, 22,
140363 /* 900 */ 97, 79, 152, 97, 82, 152, 152, 71, 221, 90,
140364 /* 910 */ 88, 89, 23, 36, 12, 26, 163, 95, 96, 97,
140365 /* 920 */ 98, 78, 97, 101, 152, 96, 173, 174, 96, 27,
140366 /* 930 */ 182, 22, 96, 97, 98, 116, 59, 148, 149, 152,
140367 /* 940 */ 121, 119, 120, 154, 42, 156, 103, 70, 195, 196,
140368 /* 950 */ 22, 59, 163, 152, 132, 133, 134, 135, 136, 82,
140369 /* 960 */ 207, 208, 209, 71, 62, 88, 89, 90, 59, 152,
140370 /* 970 */ 152, 12, 95, 96, 97, 98, 19, 20, 101, 22,
140371 /* 980 */ 22, 182, 152, 140, 195, 196, 27, 59, 96, 97,
140372 /* 990 */ 98, 59, 132, 36, 134, 22, 207, 19, 20, 24,
140373 /* 1000 */ 22, 42, 152, 173, 174, 96, 97, 98, 219, 132,
140374 /* 1010 */ 133, 134, 135, 136, 36, 152, 59, 187, 132, 152,
140375 /* 1020 */ 134, 62, 152, 152, 96, 97, 98, 70, 96, 97,
140376 /* 1030 */ 98, 72, 59, 152, 59, 246, 26, 59, 214, 82,
140377 /* 1040 */ 152, 192, 152, 173, 174, 88, 89, 79, 70, 152,
140378 /* 1050 */ 152, 19, 95, 96, 97, 98, 124, 187, 101, 23,
140379 /* 1060 */ 82, 164, 26, 173, 174, 152, 88, 89, 100, 96,
140380 /* 1070 */ 97, 98, 97, 95, 96, 97, 98, 187, 46, 101,
140381 /* 1080 */ 122, 184, 152, 186, 211, 152, 152, 119, 120, 132,
140382 /* 1090 */ 133, 134, 135, 136, 152, 5, 22, 152, 152, 35,
140383 /* 1100 */ 10, 11, 12, 13, 14, 152, 152, 17, 98, 235,
140384 /* 1110 */ 132, 133, 134, 135, 136, 54, 55, 56, 57, 58,
140385 /* 1120 */ 30, 152, 32, 152, 152, 198, 173, 174, 152, 65,
140386 /* 1130 */ 40, 152, 152, 59, 124, 152, 236, 73, 199, 107,
140387 /* 1140 */ 187, 171, 173, 174, 112, 84, 85, 86, 87, 88,
140388 /* 1150 */ 89, 90, 91, 92, 93, 94, 173, 174, 152, 69,
140389 /* 1160 */ 152, 211, 54, 55, 56, 57, 76, 152, 150, 79,
140390 /* 1170 */ 80, 97, 211, 211, 211, 111, 59, 241, 241, 173,
140391 /* 1180 */ 174, 173, 174, 202, 202, 185, 177, 176, 173, 174,
140392 /* 1190 */ 176, 201, 84, 85, 86, 87, 88, 89, 90, 91,
140393 /* 1200 */ 92, 93, 94, 215, 114, 88, 89, 152, 215, 119,
140394 /* 1210 */ 120, 152, 181, 96, 97, 98, 176, 100, 215, 152,
140395 /* 1220 */ 229, 152, 163, 152, 107, 199, 109, 155, 173, 174,
140396 /* 1230 */ 245, 141, 173, 174, 60, 159, 152, 122, 159, 242,
140397 /* 1240 */ 173, 174, 173, 174, 173, 174, 38, 242, 152, 132,
140398 /* 1250 */ 159, 134, 152, 22, 195, 196, 152, 173, 174, 222,
140399 /* 1260 */ 43, 130, 202, 152, 18, 152, 207, 208, 152, 173,
140400 /* 1270 */ 174, 152, 190, 173, 174, 152, 193, 173, 174, 152,
140401 /* 1280 */ 193, 193, 152, 159, 173, 174, 173, 174, 152, 173,
140402 /* 1290 */ 174, 193, 173, 174, 18, 152, 173, 174, 152, 158,
140403 /* 1300 */ 173, 174, 152, 173, 174, 152, 159, 152, 202, 173,
140404 /* 1310 */ 174, 152, 190, 152, 222, 152, 173, 174, 152, 173,
140405 /* 1320 */ 174, 137, 152, 173, 174, 190, 173, 174, 173, 174,
140406 /* 1330 */ 202, 158, 173, 174, 173, 174, 173, 174, 61, 173,
140407 /* 1340 */ 174, 152, 237, 173, 174, 152, 159, 152, 238, 152,
140408 /* 1350 */ 158, 152, 22, 152, 178, 152, 158, 152, 158, 152,
140409 /* 1360 */ 178, 159, 173, 174, 152, 159, 173, 174, 173, 174,
140410 /* 1370 */ 173, 174, 173, 174, 173, 174, 173, 174, 173, 174,
140411 /* 1380 */ 173, 174, 152, 63, 152, 173, 174, 107, 175, 175,
140412 /* 1390 */ 175, 106, 183, 175, 178, 175, 177, 175, 175, 178,
140413 /* 1400 */ 94, 107, 231, 173, 174, 173, 174, 183, 231, 125,
140414 /* 1410 */ 216, 178, 159, 217, 22, 159, 226, 129, 137, 228,
140415 /* 1420 */ 128, 217, 126, 25, 127, 162, 216, 26, 217, 161,
140416 /* 1430 */ 13, 153, 153, 206, 205, 6, 251, 202, 204, 203,
140417 /* 1440 */ 151, 216, 151, 217, 216, 171, 151, 165, 179, 179,
140418 /* 1450 */ 4, 3, 22, 142, 171, 165, 15, 171, 171, 81,
140419 /* 1460 */ 16, 23, 23, 120, 171, 131, 165, 111, 123, 171,
140420 /* 1470 */ 171, 171, 20, 125, 16, 1, 123, 131, 53, 53,
140421 /* 1480 */ 53, 53, 111, 96, 34, 122, 248, 1, 251, 5,
140422 /* 1490 */ 22, 107, 140, 26, 74, 41, 122, 107, 67, 67,
140423 /* 1500 */ 24, 20, 19, 112, 105, 23, 66, 22, 66, 22,
140424 /* 1510 */ 22, 22, 37, 22, 22, 66, 23, 23, 28, 23,
140425 /* 1520 */ 23, 26, 24, 23, 22, 24, 122, 23, 23, 96,
140426 /* 1530 */ 22, 124, 26, 34, 23, 26, 23, 34, 23, 23,
140427 /* 1540 */ 23, 34, 23, 22, 26, 11, 22, 22, 26, 23,
140428 /* 1550 */ 23, 22, 116, 23, 22, 15, 122, 122, 23, 122,
140429 /* 1560 */ 1, 252, 252, 252, 252, 122, 252, 252, 252, 252,
140430 /* 1570 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140431 /* 1580 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140432 /* 1590 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140433 /* 1600 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140434 /* 1610 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
@@ -140068,151 +140436,156 @@
140436 /* 1630 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140437 /* 1640 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140438 /* 1650 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140439 /* 1660 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140440 /* 1670 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140441 /* 1680 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140442 /* 1690 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
140443 /* 1700 */ 252, 252, 252, 252, 252, 252, 252, 252, 252,
140444 };
140445 #define YY_SHIFT_COUNT (471)
140446 #define YY_SHIFT_MIN (0)
140447 #define YY_SHIFT_MAX (1559)
140448 static const unsigned short int yy_shift_ofst[] = {
140449 /* 0 */ 182, 1090, 822, 822, 306, 957, 957, 957, 957, 210,
140450 /* 10 */ 0, 0, 104, 630, 957, 957, 957, 957, 957, 957,
140451 /* 20 */ 957, 1117, 1117, 126, 968, 306, 306, 306, 306, 306,
140452 /* 30 */ 306, 52, 156, 208, 260, 312, 364, 416, 468, 523,
140453 /* 40 */ 578, 630, 630, 630, 630, 630, 630, 630, 630, 630,
140454 /* 50 */ 630, 630, 630, 630, 630, 630, 630, 630, 682, 630,
140455 /* 60 */ 733, 783, 783, 877, 957, 957, 957, 957, 957, 957,
140456 /* 70 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 957,
140457 /* 80 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 957,
140458 /* 90 */ 957, 957, 957, 957, 957, 978, 957, 957, 957, 957,
140459 /* 100 */ 957, 957, 957, 957, 957, 957, 957, 957, 957, 1061,
140460 /* 110 */ 1108, 1108, 1108, 1108, 1108, 40, 127, 20, 280, 843,
140461 /* 120 */ 1032, 144, 144, 280, 310, 310, 310, 310, 59, 191,
140462 /* 130 */ 69, 1566, 1566, 1566, 786, 786, 786, 522, 836, 522,
140463 /* 140 */ 959, 959, 892, 155, 358, 280, 280, 280, 280, 280,
140464 /* 150 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
140465 /* 160 */ 280, 280, 280, 280, 280, 280, 371, 388, 645, 645,
140466 /* 170 */ 531, 1566, 1566, 1566, 504, 189, 189, 909, 63, 176,
140467 /* 180 */ 928, 440, 932, 973, 280, 280, 280, 280, 280, 314,
140468 /* 190 */ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
140469 /* 200 */ 280, 280, 1064, 1064, 1064, 280, 280, 280, 280, 667,
140470 /* 210 */ 280, 280, 280, 825, 280, 280, 902, 280, 280, 280,
140471 /* 220 */ 280, 280, 280, 280, 280, 383, 676, 325, 975, 975,
140472 /* 230 */ 975, 975, 1010, 325, 325, 819, 349, 524, 569, 829,
140473 /* 240 */ 829, 832, 569, 832, 686, 51, 656, 303, 303, 303,
140474 /* 250 */ 829, 294, 520, 628, 474, 1174, 1115, 1115, 1208, 1208,
140475 /* 260 */ 1115, 1231, 1217, 1131, 1246, 1246, 1246, 1246, 1115, 1276,
140476 /* 270 */ 1131, 1231, 1217, 1217, 1131, 1115, 1276, 1184, 1277, 1115,
140477 /* 280 */ 1276, 1330, 1115, 1276, 1115, 1276, 1330, 1280, 1280, 1280,
140478 /* 290 */ 1320, 1330, 1280, 1285, 1280, 1320, 1280, 1280, 1330, 1306,
140479 /* 300 */ 1306, 1330, 1284, 1294, 1284, 1294, 1284, 1294, 1284, 1294,
140480 /* 310 */ 1115, 1392, 1115, 1281, 1288, 1296, 1292, 1297, 1131, 1398,
140481 /* 320 */ 1401, 1417, 1417, 1429, 1429, 1429, 1566, 1566, 1566, 1566,
140482 /* 330 */ 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566,
140483 /* 340 */ 1566, 1566, 34, 357, 38, 462, 514, 484, 1074, 727,
140484 /* 350 */ 740, 734, 735, 777, 778, 784, 788, 803, 694, 845,
140485 /* 360 */ 742, 796, 833, 837, 889, 860, 886, 1036, 806, 958,
140486 /* 370 */ 1446, 1448, 1430, 1311, 1441, 1378, 1444, 1438, 1439, 1343,
140487 /* 380 */ 1334, 1356, 1345, 1452, 1348, 1458, 1474, 1353, 1346, 1425,
140488 /* 390 */ 1426, 1427, 1428, 1371, 1387, 1450, 1363, 1486, 1484, 1468,
140489 /* 400 */ 1384, 1352, 1431, 1467, 1432, 1420, 1454, 1374, 1390, 1476,
140490 /* 410 */ 1481, 1483, 1391, 1399, 1485, 1440, 1487, 1488, 1482, 1489,
140491 /* 420 */ 1442, 1490, 1491, 1449, 1475, 1493, 1494, 1496, 1495, 1497,
140492 /* 430 */ 1492, 1498, 1500, 1502, 1501, 1404, 1504, 1505, 1433, 1499,
140493 /* 440 */ 1508, 1407, 1506, 1503, 1509, 1507, 1511, 1513, 1515, 1506,
140494 /* 450 */ 1516, 1517, 1518, 1519, 1521, 1534, 1524, 1525, 1526, 1527,
140495 /* 460 */ 1529, 1530, 1532, 1522, 1436, 1434, 1435, 1437, 1443, 1535,
140496 /* 470 */ 1540, 1559,
140497 };
140498 #define YY_REDUCE_COUNT (341)
140499 #define YY_REDUCE_MIN (-211)
140500 #define YY_REDUCE_MAX (1301)
140501 static const short yy_reduce_ofst[] = {
140502 /* 0 */ -143, 789, 753, 1059, -137, -146, -144, -141, -136, 687,
140503 /* 10 */ -107, 101, -203, -52, 830, 870, 890, 167, 953, 218,
140504 /* 20 */ 220, 413, 646, 897, 73, 281, 283, 332, 496, 601,
140505 /* 30 */ 650, -211, -211, -211, -211, -211, -211, -211, -211, -211,
140506 /* 40 */ -211, -211, -211, -211, -211, -211, -211, -211, -211, -211,
140507 /* 50 */ -211, -211, -211, -211, -211, -211, -211, -211, -211, -211,
140508 /* 60 */ -211, -211, -211, 374, 377, 537, 969, 983, 1006, 1008,
140509 /* 70 */ 1015, 1055, 1067, 1069, 1071, 1084, 1096, 1100, 1104, 1111,
140510 /* 80 */ 1113, 1116, 1119, 1123, 1127, 1130, 1136, 1143, 1146, 1150,
140511 /* 90 */ 1153, 1155, 1159, 1161, 1163, 1166, 1170, 1189, 1193, 1195,
140512 /* 100 */ 1197, 1199, 1201, 1203, 1205, 1207, 1212, 1230, 1232, -211,
140513 /* 110 */ -211, -211, -211, -211, -211, -211, -211, -211, -30, 427,
140514 /* 120 */ -171, -145, -134, 22, 279, 287, 279, 287, 99, -211,
140515 /* 130 */ -211, -211, -211, -211, -165, -165, -165, 123, 135, 175,
140516 /* 140 */ -150, 396, 337, 291, 291, -147, 185, 391, 446, 444,
140517 /* 150 */ 452, 500, 501, 502, 27, -152, 295, 438, 490, 503,
140518 /* 160 */ 495, 506, -73, 447, 451, 536, 570, 551, 540, 579,
140519 /* 170 */ 30, 508, 535, 81, 14, 61, 115, 168, 142, 222,
140520 /* 180 */ 275, 284, 397, 599, 607, 647, 654, 660, 709, 658,
140521 /* 190 */ 714, 750, 754, 772, 787, 801, 817, 818, 850, 863,
140522 /* 200 */ 867, 871, 466, 748, 799, 881, 888, 898, 913, 824,
140523 /* 210 */ 930, 933, 934, 873, 942, 945, 849, 946, 222, 954,
140524 /* 220 */ 971, 972, 976, 979, 980, 900, 874, 927, 950, 961,
140525 /* 230 */ 962, 963, 824, 927, 927, 939, 970, 1018, 981, 988,
140526 /* 240 */ 993, 936, 982, 937, 1009, 1000, 1031, 1011, 1014, 1040,
140527 /* 250 */ 1003, 991, 990, 1026, 1072, 985, 1076, 1079, 997, 1005,
140528 /* 260 */ 1091, 1037, 1082, 1060, 1083, 1087, 1088, 1098, 1124, 1141,
140529 /* 270 */ 1106, 1092, 1122, 1135, 1128, 1147, 1173, 1110, 1105, 1187,
140530 /* 280 */ 1192, 1176, 1202, 1198, 1206, 1200, 1182, 1213, 1214, 1215,
140531 /* 290 */ 1209, 1216, 1218, 1219, 1220, 1224, 1222, 1223, 1221, 1171,
140532 /* 300 */ 1177, 1233, 1196, 1194, 1204, 1210, 1211, 1225, 1226, 1228,
140533 /* 310 */ 1253, 1190, 1256, 1191, 1227, 1229, 1234, 1236, 1235, 1263,
140534 /* 320 */ 1268, 1278, 1279, 1289, 1291, 1295, 1185, 1237, 1238, 1282,
140535 /* 330 */ 1274, 1283, 1286, 1287, 1290, 1269, 1270, 1293, 1298, 1299,
140536 /* 340 */ 1300, 1301,
140537 };
140538 static const YYACTIONTYPE yy_default[] = {
140539 /* 0 */ 1297, 1349, 1221, 1014, 1119, 1221, 1221, 1221, 1221, 1014,
140540 /* 10 */ 1145, 1145, 1272, 1045, 1014, 1014, 1014, 1014, 1014, 1220,
140541 /* 20 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140542 /* 30 */ 1014, 1151, 1014, 1014, 1014, 1014, 1222, 1223, 1014, 1014,
140543 /* 40 */ 1014, 1271, 1273, 1161, 1160, 1159, 1158, 1254, 1132, 1156,
140544 /* 50 */ 1149, 1153, 1216, 1217, 1215, 1219, 1222, 1223, 1014, 1152,
140545 /* 60 */ 1186, 1200, 1185, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140546 /* 70 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140547 /* 80 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140548 /* 90 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140549 /* 100 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1194,
140550 /* 110 */ 1199, 1206, 1198, 1195, 1188, 1187, 1189, 1190, 1014, 1035,
140551 /* 120 */ 1084, 1014, 1014, 1014, 1289, 1288, 1014, 1014, 1045, 1191,
140552 /* 130 */ 1192, 1203, 1202, 1201, 1279, 1305, 1304, 1014, 1014, 1014,
140553 /* 140 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140554 /* 150 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140555 /* 160 */ 1014, 1014, 1014, 1014, 1014, 1014, 1045, 1297, 1041, 1041,
140556 /* 170 */ 1014, 1284, 1119, 1110, 1014, 1014, 1014, 1014, 1014, 1014,
140557 /* 180 */ 1014, 1014, 1014, 1014, 1014, 1276, 1274, 1014, 1236, 1014,
140558 /* 190 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140559 /* 200 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140560 /* 210 */ 1014, 1014, 1014, 1115, 1014, 1014, 1014, 1014, 1014, 1014,
140561 /* 220 */ 1014, 1014, 1014, 1014, 1299, 1014, 1249, 1098, 1115, 1115,
140562 /* 230 */ 1115, 1115, 1117, 1099, 1097, 1109, 1045, 1021, 1155, 1134,
140563 /* 240 */ 1134, 1338, 1155, 1338, 1059, 1319, 1056, 1145, 1145, 1145,
140564 /* 250 */ 1134, 1218, 1116, 1109, 1014, 1341, 1124, 1124, 1340, 1340,
140565 /* 260 */ 1124, 1166, 1087, 1155, 1093, 1093, 1093, 1093, 1124, 1032,
140566 /* 270 */ 1155, 1166, 1087, 1087, 1155, 1124, 1032, 1253, 1335, 1124,
140567 /* 280 */ 1032, 1229, 1124, 1032, 1124, 1032, 1229, 1085, 1085, 1085,
140568 /* 290 */ 1074, 1229, 1085, 1059, 1085, 1074, 1085, 1085, 1229, 1233,
140569 /* 300 */ 1233, 1229, 1138, 1133, 1138, 1133, 1138, 1133, 1138, 1133,
140570 /* 310 */ 1124, 1224, 1124, 1014, 1150, 1139, 1148, 1146, 1155, 1038,
140571 /* 320 */ 1077, 1302, 1302, 1298, 1298, 1298, 1346, 1346, 1284, 1314,
140572 /* 330 */ 1045, 1045, 1045, 1045, 1314, 1061, 1061, 1045, 1045, 1045,
140573 /* 340 */ 1045, 1314, 1014, 1014, 1014, 1014, 1014, 1014, 1309, 1014,
140574 /* 350 */ 1238, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140575 /* 360 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1171,
140576 /* 370 */ 1014, 1017, 1281, 1014, 1014, 1280, 1014, 1014, 1014, 1014,
140577 /* 380 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140578 /* 390 */ 1014, 1014, 1014, 1014, 1014, 1014, 1337, 1014, 1014, 1014,
140579 /* 400 */ 1014, 1014, 1014, 1252, 1251, 1014, 1014, 1126, 1014, 1014,
140580 /* 410 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140581 /* 420 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140582 /* 430 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140583 /* 440 */ 1014, 1014, 1147, 1014, 1140, 1014, 1014, 1014, 1014, 1328,
140584 /* 450 */ 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014, 1014,
140585 /* 460 */ 1014, 1014, 1014, 1323, 1101, 1173, 1014, 1172, 1176, 1014,
140586 /* 470 */ 1026, 1014,
140587 };
140588 /********** End of lemon-generated parsing tables *****************************/
140589
140590 /* The next table maps tokens (terminal symbols) into fallback tokens.
140591 ** If a construct like the following:
@@ -140594,11 +140967,11 @@
140967 /* 192 */ "raisetype",
140968 /* 193 */ "ifexists",
140969 /* 194 */ "fullname",
140970 /* 195 */ "selectnowith",
140971 /* 196 */ "oneselect",
140972 /* 197 */ "wqlist",
140973 /* 198 */ "multiselect_op",
140974 /* 199 */ "distinct",
140975 /* 200 */ "selcollist",
140976 /* 201 */ "from",
140977 /* 202 */ "where_opt",
@@ -140616,43 +140989,43 @@
140989 /* 214 */ "joinop",
140990 /* 215 */ "indexed_opt",
140991 /* 216 */ "on_opt",
140992 /* 217 */ "using_opt",
140993 /* 218 */ "idlist",
140994 /* 219 */ "with",
140995 /* 220 */ "setlist",
140996 /* 221 */ "insert_cmd",
140997 /* 222 */ "idlist_opt",
140998 /* 223 */ "likeop",
140999 /* 224 */ "between_op",
141000 /* 225 */ "in_op",
141001 /* 226 */ "paren_exprlist",
141002 /* 227 */ "case_operand",
141003 /* 228 */ "case_exprlist",
141004 /* 229 */ "case_else",
141005 /* 230 */ "uniqueflag",
141006 /* 231 */ "collate",
141007 /* 232 */ "nmnum",
141008 /* 233 */ "trigger_decl",
141009 /* 234 */ "trigger_cmd_list",
141010 /* 235 */ "trigger_time",
141011 /* 236 */ "trigger_event",
141012 /* 237 */ "foreach_clause",
141013 /* 238 */ "when_clause",
141014 /* 239 */ "trigger_cmd",
141015 /* 240 */ "trnm",
141016 /* 241 */ "tridxby",
141017 /* 242 */ "database_kw_opt",
141018 /* 243 */ "key_opt",
141019 /* 244 */ "add_column_fullname",
141020 /* 245 */ "kwcolumn_opt",
141021 /* 246 */ "create_vtab",
141022 /* 247 */ "vtabarglist",
141023 /* 248 */ "vtabarg",
141024 /* 249 */ "vtabargtoken",
141025 /* 250 */ "lp",
141026 /* 251 */ "anylist",
141027 };
141028 #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
141029
141030 #ifndef NDEBUG
141031 /* For tracing reduce actions, the names of all rules are required.
@@ -140736,260 +141109,263 @@
141109 /* 75 */ "ifexists ::= IF EXISTS",
141110 /* 76 */ "ifexists ::=",
141111 /* 77 */ "cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select",
141112 /* 78 */ "cmd ::= DROP VIEW ifexists fullname",
141113 /* 79 */ "cmd ::= select",
141114 /* 80 */ "select ::= WITH wqlist selectnowith",
141115 /* 81 */ "select ::= WITH RECURSIVE wqlist selectnowith",
141116 /* 82 */ "select ::= selectnowith",
141117 /* 83 */ "selectnowith ::= selectnowith multiselect_op oneselect",
141118 /* 84 */ "multiselect_op ::= UNION",
141119 /* 85 */ "multiselect_op ::= UNION ALL",
141120 /* 86 */ "multiselect_op ::= EXCEPT|INTERSECT",
141121 /* 87 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
141122 /* 88 */ "values ::= VALUES LP nexprlist RP",
141123 /* 89 */ "values ::= values COMMA LP exprlist RP",
141124 /* 90 */ "distinct ::= DISTINCT",
141125 /* 91 */ "distinct ::= ALL",
141126 /* 92 */ "distinct ::=",
141127 /* 93 */ "sclp ::=",
141128 /* 94 */ "selcollist ::= sclp scanpt expr scanpt as",
141129 /* 95 */ "selcollist ::= sclp scanpt STAR",
141130 /* 96 */ "selcollist ::= sclp scanpt nm DOT STAR",
141131 /* 97 */ "as ::= AS nm",
141132 /* 98 */ "as ::=",
141133 /* 99 */ "from ::=",
141134 /* 100 */ "from ::= FROM seltablist",
141135 /* 101 */ "stl_prefix ::= seltablist joinop",
141136 /* 102 */ "stl_prefix ::=",
141137 /* 103 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
141138 /* 104 */ "seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt",
141139 /* 105 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
141140 /* 106 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
141141 /* 107 */ "dbnm ::=",
141142 /* 108 */ "dbnm ::= DOT nm",
141143 /* 109 */ "fullname ::= nm",
141144 /* 110 */ "fullname ::= nm DOT nm",
141145 /* 111 */ "joinop ::= COMMA|JOIN",
141146 /* 112 */ "joinop ::= JOIN_KW JOIN",
141147 /* 113 */ "joinop ::= JOIN_KW nm JOIN",
141148 /* 114 */ "joinop ::= JOIN_KW nm nm JOIN",
141149 /* 115 */ "on_opt ::= ON expr",
141150 /* 116 */ "on_opt ::=",
141151 /* 117 */ "indexed_opt ::=",
141152 /* 118 */ "indexed_opt ::= INDEXED BY nm",
141153 /* 119 */ "indexed_opt ::= NOT INDEXED",
141154 /* 120 */ "using_opt ::= USING LP idlist RP",
141155 /* 121 */ "using_opt ::=",
141156 /* 122 */ "orderby_opt ::=",
141157 /* 123 */ "orderby_opt ::= ORDER BY sortlist",
141158 /* 124 */ "sortlist ::= sortlist COMMA expr sortorder",
141159 /* 125 */ "sortlist ::= expr sortorder",
141160 /* 126 */ "sortorder ::= ASC",
141161 /* 127 */ "sortorder ::= DESC",
141162 /* 128 */ "sortorder ::=",
141163 /* 129 */ "groupby_opt ::=",
141164 /* 130 */ "groupby_opt ::= GROUP BY nexprlist",
141165 /* 131 */ "having_opt ::=",
141166 /* 132 */ "having_opt ::= HAVING expr",
141167 /* 133 */ "limit_opt ::=",
141168 /* 134 */ "limit_opt ::= LIMIT expr",
141169 /* 135 */ "limit_opt ::= LIMIT expr OFFSET expr",
141170 /* 136 */ "limit_opt ::= LIMIT expr COMMA expr",
141171 /* 137 */ "cmd ::= with DELETE FROM fullname indexed_opt where_opt",
141172 /* 138 */ "where_opt ::=",
141173 /* 139 */ "where_opt ::= WHERE expr",
141174 /* 140 */ "cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt",
141175 /* 141 */ "setlist ::= setlist COMMA nm EQ expr",
141176 /* 142 */ "setlist ::= setlist COMMA LP idlist RP EQ expr",
141177 /* 143 */ "setlist ::= nm EQ expr",
141178 /* 144 */ "setlist ::= LP idlist RP EQ expr",
141179 /* 145 */ "cmd ::= with insert_cmd INTO fullname idlist_opt select",
141180 /* 146 */ "cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES",
141181 /* 147 */ "insert_cmd ::= INSERT orconf",
141182 /* 148 */ "insert_cmd ::= REPLACE",
141183 /* 149 */ "idlist_opt ::=",
141184 /* 150 */ "idlist_opt ::= LP idlist RP",
141185 /* 151 */ "idlist ::= idlist COMMA nm",
141186 /* 152 */ "idlist ::= nm",
141187 /* 153 */ "expr ::= LP expr RP",
141188 /* 154 */ "expr ::= ID|INDEXED",
141189 /* 155 */ "expr ::= JOIN_KW",
141190 /* 156 */ "expr ::= nm DOT nm",
141191 /* 157 */ "expr ::= nm DOT nm DOT nm",
141192 /* 158 */ "term ::= NULL|FLOAT|BLOB",
141193 /* 159 */ "term ::= STRING",
141194 /* 160 */ "term ::= INTEGER",
141195 /* 161 */ "expr ::= VARIABLE",
141196 /* 162 */ "expr ::= expr COLLATE ID|STRING",
141197 /* 163 */ "expr ::= CAST LP expr AS typetoken RP",
141198 /* 164 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
141199 /* 165 */ "expr ::= ID|INDEXED LP STAR RP",
141200 /* 166 */ "term ::= CTIME_KW",
141201 /* 167 */ "expr ::= LP nexprlist COMMA expr RP",
141202 /* 168 */ "expr ::= expr AND expr",
141203 /* 169 */ "expr ::= expr OR expr",
141204 /* 170 */ "expr ::= expr LT|GT|GE|LE expr",
141205 /* 171 */ "expr ::= expr EQ|NE expr",
141206 /* 172 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
141207 /* 173 */ "expr ::= expr PLUS|MINUS expr",
141208 /* 174 */ "expr ::= expr STAR|SLASH|REM expr",
141209 /* 175 */ "expr ::= expr CONCAT expr",
141210 /* 176 */ "likeop ::= NOT LIKE_KW|MATCH",
141211 /* 177 */ "expr ::= expr likeop expr",
141212 /* 178 */ "expr ::= expr likeop expr ESCAPE expr",
141213 /* 179 */ "expr ::= expr ISNULL|NOTNULL",
141214 /* 180 */ "expr ::= expr NOT NULL",
141215 /* 181 */ "expr ::= expr IS expr",
141216 /* 182 */ "expr ::= expr IS NOT expr",
141217 /* 183 */ "expr ::= NOT expr",
141218 /* 184 */ "expr ::= BITNOT expr",
141219 /* 185 */ "expr ::= MINUS expr",
141220 /* 186 */ "expr ::= PLUS expr",
141221 /* 187 */ "between_op ::= BETWEEN",
141222 /* 188 */ "between_op ::= NOT BETWEEN",
141223 /* 189 */ "expr ::= expr between_op expr AND expr",
141224 /* 190 */ "in_op ::= IN",
141225 /* 191 */ "in_op ::= NOT IN",
141226 /* 192 */ "expr ::= expr in_op LP exprlist RP",
141227 /* 193 */ "expr ::= LP select RP",
141228 /* 194 */ "expr ::= expr in_op LP select RP",
141229 /* 195 */ "expr ::= expr in_op nm dbnm paren_exprlist",
141230 /* 196 */ "expr ::= EXISTS LP select RP",
141231 /* 197 */ "expr ::= CASE case_operand case_exprlist case_else END",
141232 /* 198 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
141233 /* 199 */ "case_exprlist ::= WHEN expr THEN expr",
141234 /* 200 */ "case_else ::= ELSE expr",
141235 /* 201 */ "case_else ::=",
141236 /* 202 */ "case_operand ::= expr",
141237 /* 203 */ "case_operand ::=",
141238 /* 204 */ "exprlist ::=",
141239 /* 205 */ "nexprlist ::= nexprlist COMMA expr",
141240 /* 206 */ "nexprlist ::= expr",
141241 /* 207 */ "paren_exprlist ::=",
141242 /* 208 */ "paren_exprlist ::= LP exprlist RP",
141243 /* 209 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
141244 /* 210 */ "uniqueflag ::= UNIQUE",
141245 /* 211 */ "uniqueflag ::=",
141246 /* 212 */ "eidlist_opt ::=",
141247 /* 213 */ "eidlist_opt ::= LP eidlist RP",
141248 /* 214 */ "eidlist ::= eidlist COMMA nm collate sortorder",
141249 /* 215 */ "eidlist ::= nm collate sortorder",
141250 /* 216 */ "collate ::=",
141251 /* 217 */ "collate ::= COLLATE ID|STRING",
141252 /* 218 */ "cmd ::= DROP INDEX ifexists fullname",
141253 /* 219 */ "cmd ::= VACUUM",
141254 /* 220 */ "cmd ::= VACUUM nm",
141255 /* 221 */ "cmd ::= PRAGMA nm dbnm",
141256 /* 222 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
141257 /* 223 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
141258 /* 224 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
141259 /* 225 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
141260 /* 226 */ "plus_num ::= PLUS INTEGER|FLOAT",
141261 /* 227 */ "minus_num ::= MINUS INTEGER|FLOAT",
141262 /* 228 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
141263 /* 229 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
141264 /* 230 */ "trigger_time ::= BEFORE|AFTER",
141265 /* 231 */ "trigger_time ::= INSTEAD OF",
141266 /* 232 */ "trigger_time ::=",
141267 /* 233 */ "trigger_event ::= DELETE|INSERT",
141268 /* 234 */ "trigger_event ::= UPDATE",
141269 /* 235 */ "trigger_event ::= UPDATE OF idlist",
141270 /* 236 */ "when_clause ::=",
141271 /* 237 */ "when_clause ::= WHEN expr",
141272 /* 238 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
141273 /* 239 */ "trigger_cmd_list ::= trigger_cmd SEMI",
141274 /* 240 */ "trnm ::= nm DOT nm",
141275 /* 241 */ "tridxby ::= INDEXED BY nm",
141276 /* 242 */ "tridxby ::= NOT INDEXED",
141277 /* 243 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt",
141278 /* 244 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt",
141279 /* 245 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
141280 /* 246 */ "trigger_cmd ::= scanpt select scanpt",
141281 /* 247 */ "expr ::= RAISE LP IGNORE RP",
141282 /* 248 */ "expr ::= RAISE LP raisetype COMMA nm RP",
141283 /* 249 */ "raisetype ::= ROLLBACK",
141284 /* 250 */ "raisetype ::= ABORT",
141285 /* 251 */ "raisetype ::= FAIL",
141286 /* 252 */ "cmd ::= DROP TRIGGER ifexists fullname",
141287 /* 253 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
141288 /* 254 */ "cmd ::= DETACH database_kw_opt expr",
141289 /* 255 */ "key_opt ::=",
141290 /* 256 */ "key_opt ::= KEY expr",
141291 /* 257 */ "cmd ::= REINDEX",
141292 /* 258 */ "cmd ::= REINDEX nm dbnm",
141293 /* 259 */ "cmd ::= ANALYZE",
141294 /* 260 */ "cmd ::= ANALYZE nm dbnm",
141295 /* 261 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
141296 /* 262 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
141297 /* 263 */ "add_column_fullname ::= fullname",
141298 /* 264 */ "cmd ::= create_vtab",
141299 /* 265 */ "cmd ::= create_vtab LP vtabarglist RP",
141300 /* 266 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
141301 /* 267 */ "vtabarg ::=",
141302 /* 268 */ "vtabargtoken ::= ANY",
141303 /* 269 */ "vtabargtoken ::= lp anylist RP",
141304 /* 270 */ "lp ::= LP",
141305 /* 271 */ "with ::= WITH wqlist",
141306 /* 272 */ "with ::= WITH RECURSIVE wqlist",
141307 /* 273 */ "wqlist ::= nm eidlist_opt AS LP select RP",
141308 /* 274 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
141309 /* 275 */ "input ::= cmdlist",
141310 /* 276 */ "cmdlist ::= cmdlist ecmd",
141311 /* 277 */ "cmdlist ::= ecmd",
141312 /* 278 */ "ecmd ::= SEMI",
141313 /* 279 */ "ecmd ::= explain cmdx SEMI",
141314 /* 280 */ "explain ::=",
141315 /* 281 */ "trans_opt ::=",
141316 /* 282 */ "trans_opt ::= TRANSACTION",
141317 /* 283 */ "trans_opt ::= TRANSACTION nm",
141318 /* 284 */ "savepoint_opt ::= SAVEPOINT",
141319 /* 285 */ "savepoint_opt ::=",
141320 /* 286 */ "cmd ::= create_table create_table_args",
141321 /* 287 */ "columnlist ::= columnlist COMMA columnname carglist",
141322 /* 288 */ "columnlist ::= columnname carglist",
141323 /* 289 */ "nm ::= ID|INDEXED",
141324 /* 290 */ "nm ::= STRING",
141325 /* 291 */ "nm ::= JOIN_KW",
141326 /* 292 */ "typetoken ::= typename",
141327 /* 293 */ "typename ::= ID|STRING",
141328 /* 294 */ "signed ::= plus_num",
141329 /* 295 */ "signed ::= minus_num",
141330 /* 296 */ "carglist ::= carglist ccons",
141331 /* 297 */ "carglist ::=",
141332 /* 298 */ "ccons ::= NULL onconf",
141333 /* 299 */ "conslist_opt ::= COMMA conslist",
141334 /* 300 */ "conslist ::= conslist tconscomma tcons",
141335 /* 301 */ "conslist ::= tcons",
141336 /* 302 */ "tconscomma ::=",
141337 /* 303 */ "defer_subclause_opt ::= defer_subclause",
141338 /* 304 */ "resolvetype ::= raisetype",
141339 /* 305 */ "selectnowith ::= oneselect",
141340 /* 306 */ "oneselect ::= values",
141341 /* 307 */ "sclp ::= selcollist COMMA",
141342 /* 308 */ "as ::= ID|STRING",
141343 /* 309 */ "expr ::= term",
141344 /* 310 */ "likeop ::= LIKE_KW|MATCH",
141345 /* 311 */ "exprlist ::= nexprlist",
141346 /* 312 */ "nmnum ::= plus_num",
141347 /* 313 */ "nmnum ::= nm",
141348 /* 314 */ "nmnum ::= ON",
141349 /* 315 */ "nmnum ::= DELETE",
141350 /* 316 */ "nmnum ::= DEFAULT",
141351 /* 317 */ "plus_num ::= INTEGER|FLOAT",
141352 /* 318 */ "foreach_clause ::=",
141353 /* 319 */ "foreach_clause ::= FOR EACH ROW",
141354 /* 320 */ "trnm ::= nm",
141355 /* 321 */ "tridxby ::=",
141356 /* 322 */ "database_kw_opt ::= DATABASE",
141357 /* 323 */ "database_kw_opt ::=",
141358 /* 324 */ "kwcolumn_opt ::=",
141359 /* 325 */ "kwcolumn_opt ::= COLUMNKW",
141360 /* 326 */ "vtabarglist ::= vtabarg",
141361 /* 327 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
141362 /* 328 */ "vtabarg ::= vtabarg vtabargtoken",
141363 /* 329 */ "anylist ::=",
141364 /* 330 */ "anylist ::= anylist LP anylist RP",
141365 /* 331 */ "anylist ::= anylist ANY",
141366 /* 332 */ "with ::=",
141367 };
141368 #endif /* NDEBUG */
141369
141370
141371 #if YYSTACKDEPTH<=0
@@ -141119,14 +141495,14 @@
141495 case 173: /* term */
141496 case 174: /* expr */
141497 case 202: /* where_opt */
141498 case 204: /* having_opt */
141499 case 216: /* on_opt */
141500 case 227: /* case_operand */
141501 case 229: /* case_else */
141502 case 238: /* when_clause */
141503 case 243: /* key_opt */
141504 {
141505 sqlite3ExprDelete(pParse->db, (yypminor->yy314));
141506 }
141507 break;
141508 case 178: /* eidlist_opt */
@@ -141136,13 +141512,13 @@
141512 case 203: /* groupby_opt */
141513 case 205: /* orderby_opt */
141514 case 208: /* nexprlist */
141515 case 209: /* exprlist */
141516 case 210: /* sclp */
141517 case 220: /* setlist */
141518 case 226: /* paren_exprlist */
141519 case 228: /* case_exprlist */
141520 {
141521 sqlite3ExprListDelete(pParse->db, (yypminor->yy322));
141522 }
141523 break;
141524 case 194: /* fullname */
@@ -141151,30 +141527,29 @@
141527 case 213: /* stl_prefix */
141528 {
141529 sqlite3SrcListDelete(pParse->db, (yypminor->yy259));
141530 }
141531 break;
141532 case 197: /* wqlist */
 
141533 {
141534 sqlite3WithDelete(pParse->db, (yypminor->yy451));
141535 }
141536 break;
141537 case 217: /* using_opt */
141538 case 218: /* idlist */
141539 case 222: /* idlist_opt */
141540 {
141541 sqlite3IdListDelete(pParse->db, (yypminor->yy384));
141542 }
141543 break;
141544 case 234: /* trigger_cmd_list */
141545 case 239: /* trigger_cmd */
141546 {
141547 sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203));
141548 }
141549 break;
141550 case 236: /* trigger_event */
141551 {
141552 sqlite3IdListDelete(pParse->db, (yypminor->yy90).b);
141553 }
141554 break;
141555 /********* End destructor definitions *****************************************/
@@ -141549,260 +141924,263 @@
141924 { 193, -2 }, /* (75) ifexists ::= IF EXISTS */
141925 { 193, 0 }, /* (76) ifexists ::= */
141926 { 149, -9 }, /* (77) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
141927 { 149, -4 }, /* (78) cmd ::= DROP VIEW ifexists fullname */
141928 { 149, -1 }, /* (79) cmd ::= select */
141929 { 163, -3 }, /* (80) select ::= WITH wqlist selectnowith */
141930 { 163, -4 }, /* (81) select ::= WITH RECURSIVE wqlist selectnowith */
141931 { 163, -1 }, /* (82) select ::= selectnowith */
141932 { 195, -3 }, /* (83) selectnowith ::= selectnowith multiselect_op oneselect */
141933 { 198, -1 }, /* (84) multiselect_op ::= UNION */
141934 { 198, -2 }, /* (85) multiselect_op ::= UNION ALL */
141935 { 198, -1 }, /* (86) multiselect_op ::= EXCEPT|INTERSECT */
141936 { 196, -9 }, /* (87) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
141937 { 207, -4 }, /* (88) values ::= VALUES LP nexprlist RP */
141938 { 207, -5 }, /* (89) values ::= values COMMA LP exprlist RP */
141939 { 199, -1 }, /* (90) distinct ::= DISTINCT */
141940 { 199, -1 }, /* (91) distinct ::= ALL */
141941 { 199, 0 }, /* (92) distinct ::= */
141942 { 210, 0 }, /* (93) sclp ::= */
141943 { 200, -5 }, /* (94) selcollist ::= sclp scanpt expr scanpt as */
141944 { 200, -3 }, /* (95) selcollist ::= sclp scanpt STAR */
141945 { 200, -5 }, /* (96) selcollist ::= sclp scanpt nm DOT STAR */
141946 { 211, -2 }, /* (97) as ::= AS nm */
141947 { 211, 0 }, /* (98) as ::= */
141948 { 201, 0 }, /* (99) from ::= */
141949 { 201, -2 }, /* (100) from ::= FROM seltablist */
141950 { 213, -2 }, /* (101) stl_prefix ::= seltablist joinop */
141951 { 213, 0 }, /* (102) stl_prefix ::= */
141952 { 212, -7 }, /* (103) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
141953 { 212, -9 }, /* (104) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
141954 { 212, -7 }, /* (105) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
141955 { 212, -7 }, /* (106) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
141956 { 159, 0 }, /* (107) dbnm ::= */
141957 { 159, -2 }, /* (108) dbnm ::= DOT nm */
141958 { 194, -1 }, /* (109) fullname ::= nm */
141959 { 194, -3 }, /* (110) fullname ::= nm DOT nm */
141960 { 214, -1 }, /* (111) joinop ::= COMMA|JOIN */
141961 { 214, -2 }, /* (112) joinop ::= JOIN_KW JOIN */
141962 { 214, -3 }, /* (113) joinop ::= JOIN_KW nm JOIN */
141963 { 214, -4 }, /* (114) joinop ::= JOIN_KW nm nm JOIN */
141964 { 216, -2 }, /* (115) on_opt ::= ON expr */
141965 { 216, 0 }, /* (116) on_opt ::= */
141966 { 215, 0 }, /* (117) indexed_opt ::= */
141967 { 215, -3 }, /* (118) indexed_opt ::= INDEXED BY nm */
141968 { 215, -2 }, /* (119) indexed_opt ::= NOT INDEXED */
141969 { 217, -4 }, /* (120) using_opt ::= USING LP idlist RP */
141970 { 217, 0 }, /* (121) using_opt ::= */
141971 { 205, 0 }, /* (122) orderby_opt ::= */
141972 { 205, -3 }, /* (123) orderby_opt ::= ORDER BY sortlist */
141973 { 187, -4 }, /* (124) sortlist ::= sortlist COMMA expr sortorder */
141974 { 187, -2 }, /* (125) sortlist ::= expr sortorder */
141975 { 176, -1 }, /* (126) sortorder ::= ASC */
141976 { 176, -1 }, /* (127) sortorder ::= DESC */
141977 { 176, 0 }, /* (128) sortorder ::= */
141978 { 203, 0 }, /* (129) groupby_opt ::= */
141979 { 203, -3 }, /* (130) groupby_opt ::= GROUP BY nexprlist */
141980 { 204, 0 }, /* (131) having_opt ::= */
141981 { 204, -2 }, /* (132) having_opt ::= HAVING expr */
141982 { 206, 0 }, /* (133) limit_opt ::= */
141983 { 206, -2 }, /* (134) limit_opt ::= LIMIT expr */
141984 { 206, -4 }, /* (135) limit_opt ::= LIMIT expr OFFSET expr */
141985 { 206, -4 }, /* (136) limit_opt ::= LIMIT expr COMMA expr */
141986 { 149, -6 }, /* (137) cmd ::= with DELETE FROM fullname indexed_opt where_opt */
141987 { 202, 0 }, /* (138) where_opt ::= */
141988 { 202, -2 }, /* (139) where_opt ::= WHERE expr */
141989 { 149, -8 }, /* (140) cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */
141990 { 220, -5 }, /* (141) setlist ::= setlist COMMA nm EQ expr */
141991 { 220, -7 }, /* (142) setlist ::= setlist COMMA LP idlist RP EQ expr */
141992 { 220, -3 }, /* (143) setlist ::= nm EQ expr */
141993 { 220, -5 }, /* (144) setlist ::= LP idlist RP EQ expr */
141994 { 149, -6 }, /* (145) cmd ::= with insert_cmd INTO fullname idlist_opt select */
141995 { 149, -7 }, /* (146) cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */
141996 { 221, -2 }, /* (147) insert_cmd ::= INSERT orconf */
141997 { 221, -1 }, /* (148) insert_cmd ::= REPLACE */
141998 { 222, 0 }, /* (149) idlist_opt ::= */
141999 { 222, -3 }, /* (150) idlist_opt ::= LP idlist RP */
142000 { 218, -3 }, /* (151) idlist ::= idlist COMMA nm */
142001 { 218, -1 }, /* (152) idlist ::= nm */
142002 { 174, -3 }, /* (153) expr ::= LP expr RP */
142003 { 174, -1 }, /* (154) expr ::= ID|INDEXED */
142004 { 174, -1 }, /* (155) expr ::= JOIN_KW */
142005 { 174, -3 }, /* (156) expr ::= nm DOT nm */
142006 { 174, -5 }, /* (157) expr ::= nm DOT nm DOT nm */
142007 { 173, -1 }, /* (158) term ::= NULL|FLOAT|BLOB */
142008 { 173, -1 }, /* (159) term ::= STRING */
142009 { 173, -1 }, /* (160) term ::= INTEGER */
142010 { 174, -1 }, /* (161) expr ::= VARIABLE */
142011 { 174, -3 }, /* (162) expr ::= expr COLLATE ID|STRING */
142012 { 174, -6 }, /* (163) expr ::= CAST LP expr AS typetoken RP */
142013 { 174, -5 }, /* (164) expr ::= ID|INDEXED LP distinct exprlist RP */
142014 { 174, -4 }, /* (165) expr ::= ID|INDEXED LP STAR RP */
142015 { 173, -1 }, /* (166) term ::= CTIME_KW */
142016 { 174, -5 }, /* (167) expr ::= LP nexprlist COMMA expr RP */
142017 { 174, -3 }, /* (168) expr ::= expr AND expr */
142018 { 174, -3 }, /* (169) expr ::= expr OR expr */
142019 { 174, -3 }, /* (170) expr ::= expr LT|GT|GE|LE expr */
142020 { 174, -3 }, /* (171) expr ::= expr EQ|NE expr */
142021 { 174, -3 }, /* (172) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
142022 { 174, -3 }, /* (173) expr ::= expr PLUS|MINUS expr */
142023 { 174, -3 }, /* (174) expr ::= expr STAR|SLASH|REM expr */
142024 { 174, -3 }, /* (175) expr ::= expr CONCAT expr */
142025 { 223, -2 }, /* (176) likeop ::= NOT LIKE_KW|MATCH */
142026 { 174, -3 }, /* (177) expr ::= expr likeop expr */
142027 { 174, -5 }, /* (178) expr ::= expr likeop expr ESCAPE expr */
142028 { 174, -2 }, /* (179) expr ::= expr ISNULL|NOTNULL */
142029 { 174, -3 }, /* (180) expr ::= expr NOT NULL */
142030 { 174, -3 }, /* (181) expr ::= expr IS expr */
142031 { 174, -4 }, /* (182) expr ::= expr IS NOT expr */
142032 { 174, -2 }, /* (183) expr ::= NOT expr */
142033 { 174, -2 }, /* (184) expr ::= BITNOT expr */
142034 { 174, -2 }, /* (185) expr ::= MINUS expr */
142035 { 174, -2 }, /* (186) expr ::= PLUS expr */
142036 { 224, -1 }, /* (187) between_op ::= BETWEEN */
142037 { 224, -2 }, /* (188) between_op ::= NOT BETWEEN */
142038 { 174, -5 }, /* (189) expr ::= expr between_op expr AND expr */
142039 { 225, -1 }, /* (190) in_op ::= IN */
142040 { 225, -2 }, /* (191) in_op ::= NOT IN */
142041 { 174, -5 }, /* (192) expr ::= expr in_op LP exprlist RP */
142042 { 174, -3 }, /* (193) expr ::= LP select RP */
142043 { 174, -5 }, /* (194) expr ::= expr in_op LP select RP */
142044 { 174, -5 }, /* (195) expr ::= expr in_op nm dbnm paren_exprlist */
142045 { 174, -4 }, /* (196) expr ::= EXISTS LP select RP */
142046 { 174, -5 }, /* (197) expr ::= CASE case_operand case_exprlist case_else END */
142047 { 228, -5 }, /* (198) case_exprlist ::= case_exprlist WHEN expr THEN expr */
142048 { 228, -4 }, /* (199) case_exprlist ::= WHEN expr THEN expr */
142049 { 229, -2 }, /* (200) case_else ::= ELSE expr */
142050 { 229, 0 }, /* (201) case_else ::= */
142051 { 227, -1 }, /* (202) case_operand ::= expr */
142052 { 227, 0 }, /* (203) case_operand ::= */
142053 { 209, 0 }, /* (204) exprlist ::= */
142054 { 208, -3 }, /* (205) nexprlist ::= nexprlist COMMA expr */
142055 { 208, -1 }, /* (206) nexprlist ::= expr */
142056 { 226, 0 }, /* (207) paren_exprlist ::= */
142057 { 226, -3 }, /* (208) paren_exprlist ::= LP exprlist RP */
142058 { 149, -12 }, /* (209) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
142059 { 230, -1 }, /* (210) uniqueflag ::= UNIQUE */
142060 { 230, 0 }, /* (211) uniqueflag ::= */
142061 { 178, 0 }, /* (212) eidlist_opt ::= */
142062 { 178, -3 }, /* (213) eidlist_opt ::= LP eidlist RP */
142063 { 188, -5 }, /* (214) eidlist ::= eidlist COMMA nm collate sortorder */
142064 { 188, -3 }, /* (215) eidlist ::= nm collate sortorder */
142065 { 231, 0 }, /* (216) collate ::= */
142066 { 231, -2 }, /* (217) collate ::= COLLATE ID|STRING */
142067 { 149, -4 }, /* (218) cmd ::= DROP INDEX ifexists fullname */
142068 { 149, -1 }, /* (219) cmd ::= VACUUM */
142069 { 149, -2 }, /* (220) cmd ::= VACUUM nm */
142070 { 149, -3 }, /* (221) cmd ::= PRAGMA nm dbnm */
142071 { 149, -5 }, /* (222) cmd ::= PRAGMA nm dbnm EQ nmnum */
142072 { 149, -6 }, /* (223) cmd ::= PRAGMA nm dbnm LP nmnum RP */
142073 { 149, -5 }, /* (224) cmd ::= PRAGMA nm dbnm EQ minus_num */
142074 { 149, -6 }, /* (225) cmd ::= PRAGMA nm dbnm LP minus_num RP */
142075 { 169, -2 }, /* (226) plus_num ::= PLUS INTEGER|FLOAT */
142076 { 170, -2 }, /* (227) minus_num ::= MINUS INTEGER|FLOAT */
142077 { 149, -5 }, /* (228) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
142078 { 233, -11 }, /* (229) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
142079 { 235, -1 }, /* (230) trigger_time ::= BEFORE|AFTER */
142080 { 235, -2 }, /* (231) trigger_time ::= INSTEAD OF */
142081 { 235, 0 }, /* (232) trigger_time ::= */
142082 { 236, -1 }, /* (233) trigger_event ::= DELETE|INSERT */
142083 { 236, -1 }, /* (234) trigger_event ::= UPDATE */
142084 { 236, -3 }, /* (235) trigger_event ::= UPDATE OF idlist */
142085 { 238, 0 }, /* (236) when_clause ::= */
142086 { 238, -2 }, /* (237) when_clause ::= WHEN expr */
142087 { 234, -3 }, /* (238) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
142088 { 234, -2 }, /* (239) trigger_cmd_list ::= trigger_cmd SEMI */
142089 { 240, -3 }, /* (240) trnm ::= nm DOT nm */
142090 { 241, -3 }, /* (241) tridxby ::= INDEXED BY nm */
142091 { 241, -2 }, /* (242) tridxby ::= NOT INDEXED */
142092 { 239, -8 }, /* (243) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
142093 { 239, -7 }, /* (244) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */
142094 { 239, -6 }, /* (245) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
142095 { 239, -3 }, /* (246) trigger_cmd ::= scanpt select scanpt */
142096 { 174, -4 }, /* (247) expr ::= RAISE LP IGNORE RP */
142097 { 174, -6 }, /* (248) expr ::= RAISE LP raisetype COMMA nm RP */
142098 { 192, -1 }, /* (249) raisetype ::= ROLLBACK */
142099 { 192, -1 }, /* (250) raisetype ::= ABORT */
142100 { 192, -1 }, /* (251) raisetype ::= FAIL */
142101 { 149, -4 }, /* (252) cmd ::= DROP TRIGGER ifexists fullname */
142102 { 149, -6 }, /* (253) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
142103 { 149, -3 }, /* (254) cmd ::= DETACH database_kw_opt expr */
142104 { 243, 0 }, /* (255) key_opt ::= */
142105 { 243, -2 }, /* (256) key_opt ::= KEY expr */
142106 { 149, -1 }, /* (257) cmd ::= REINDEX */
142107 { 149, -3 }, /* (258) cmd ::= REINDEX nm dbnm */
142108 { 149, -1 }, /* (259) cmd ::= ANALYZE */
142109 { 149, -3 }, /* (260) cmd ::= ANALYZE nm dbnm */
142110 { 149, -6 }, /* (261) cmd ::= ALTER TABLE fullname RENAME TO nm */
142111 { 149, -7 }, /* (262) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
142112 { 244, -1 }, /* (263) add_column_fullname ::= fullname */
142113 { 149, -1 }, /* (264) cmd ::= create_vtab */
142114 { 149, -4 }, /* (265) cmd ::= create_vtab LP vtabarglist RP */
142115 { 246, -8 }, /* (266) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
142116 { 248, 0 }, /* (267) vtabarg ::= */
142117 { 249, -1 }, /* (268) vtabargtoken ::= ANY */
142118 { 249, -3 }, /* (269) vtabargtoken ::= lp anylist RP */
142119 { 250, -1 }, /* (270) lp ::= LP */
142120 { 219, -2 }, /* (271) with ::= WITH wqlist */
142121 { 219, -3 }, /* (272) with ::= WITH RECURSIVE wqlist */
142122 { 197, -6 }, /* (273) wqlist ::= nm eidlist_opt AS LP select RP */
142123 { 197, -8 }, /* (274) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
142124 { 144, -1 }, /* (275) input ::= cmdlist */
142125 { 145, -2 }, /* (276) cmdlist ::= cmdlist ecmd */
142126 { 145, -1 }, /* (277) cmdlist ::= ecmd */
142127 { 146, -1 }, /* (278) ecmd ::= SEMI */
142128 { 146, -3 }, /* (279) ecmd ::= explain cmdx SEMI */
142129 { 147, 0 }, /* (280) explain ::= */
142130 { 151, 0 }, /* (281) trans_opt ::= */
142131 { 151, -1 }, /* (282) trans_opt ::= TRANSACTION */
142132 { 151, -2 }, /* (283) trans_opt ::= TRANSACTION nm */
142133 { 153, -1 }, /* (284) savepoint_opt ::= SAVEPOINT */
142134 { 153, 0 }, /* (285) savepoint_opt ::= */
142135 { 149, -2 }, /* (286) cmd ::= create_table create_table_args */
142136 { 160, -4 }, /* (287) columnlist ::= columnlist COMMA columnname carglist */
142137 { 160, -2 }, /* (288) columnlist ::= columnname carglist */
142138 { 152, -1 }, /* (289) nm ::= ID|INDEXED */
142139 { 152, -1 }, /* (290) nm ::= STRING */
142140 { 152, -1 }, /* (291) nm ::= JOIN_KW */
142141 { 166, -1 }, /* (292) typetoken ::= typename */
142142 { 167, -1 }, /* (293) typename ::= ID|STRING */
142143 { 168, -1 }, /* (294) signed ::= plus_num */
142144 { 168, -1 }, /* (295) signed ::= minus_num */
142145 { 165, -2 }, /* (296) carglist ::= carglist ccons */
142146 { 165, 0 }, /* (297) carglist ::= */
142147 { 172, -2 }, /* (298) ccons ::= NULL onconf */
142148 { 161, -2 }, /* (299) conslist_opt ::= COMMA conslist */
142149 { 184, -3 }, /* (300) conslist ::= conslist tconscomma tcons */
142150 { 184, -1 }, /* (301) conslist ::= tcons */
142151 { 185, 0 }, /* (302) tconscomma ::= */
142152 { 189, -1 }, /* (303) defer_subclause_opt ::= defer_subclause */
142153 { 191, -1 }, /* (304) resolvetype ::= raisetype */
142154 { 195, -1 }, /* (305) selectnowith ::= oneselect */
142155 { 196, -1 }, /* (306) oneselect ::= values */
142156 { 210, -2 }, /* (307) sclp ::= selcollist COMMA */
142157 { 211, -1 }, /* (308) as ::= ID|STRING */
142158 { 174, -1 }, /* (309) expr ::= term */
142159 { 223, -1 }, /* (310) likeop ::= LIKE_KW|MATCH */
142160 { 209, -1 }, /* (311) exprlist ::= nexprlist */
142161 { 232, -1 }, /* (312) nmnum ::= plus_num */
142162 { 232, -1 }, /* (313) nmnum ::= nm */
142163 { 232, -1 }, /* (314) nmnum ::= ON */
142164 { 232, -1 }, /* (315) nmnum ::= DELETE */
142165 { 232, -1 }, /* (316) nmnum ::= DEFAULT */
142166 { 169, -1 }, /* (317) plus_num ::= INTEGER|FLOAT */
142167 { 237, 0 }, /* (318) foreach_clause ::= */
142168 { 237, -3 }, /* (319) foreach_clause ::= FOR EACH ROW */
142169 { 240, -1 }, /* (320) trnm ::= nm */
142170 { 241, 0 }, /* (321) tridxby ::= */
142171 { 242, -1 }, /* (322) database_kw_opt ::= DATABASE */
142172 { 242, 0 }, /* (323) database_kw_opt ::= */
142173 { 245, 0 }, /* (324) kwcolumn_opt ::= */
142174 { 245, -1 }, /* (325) kwcolumn_opt ::= COLUMNKW */
142175 { 247, -1 }, /* (326) vtabarglist ::= vtabarg */
142176 { 247, -3 }, /* (327) vtabarglist ::= vtabarglist COMMA vtabarg */
142177 { 248, -2 }, /* (328) vtabarg ::= vtabarg vtabargtoken */
142178 { 251, 0 }, /* (329) anylist ::= */
142179 { 251, -4 }, /* (330) anylist ::= anylist LP anylist RP */
142180 { 251, -2 }, /* (331) anylist ::= anylist ANY */
142181 { 219, 0 }, /* (332) with ::= */
142182 };
142183
142184 static void yy_accept(yyParser*); /* Forward Declaration */
142185
142186 /*
@@ -141932,12 +142310,12 @@
142310 case 21: /* table_options ::= */ yytestcase(yyruleno==21);
142311 case 42: /* autoinc ::= */ yytestcase(yyruleno==42);
142312 case 57: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==57);
142313 case 67: /* defer_subclause_opt ::= */ yytestcase(yyruleno==67);
142314 case 76: /* ifexists ::= */ yytestcase(yyruleno==76);
142315 case 92: /* distinct ::= */ yytestcase(yyruleno==92);
142316 case 216: /* collate ::= */ yytestcase(yyruleno==216);
142317 {yymsp[1].minor.yy4 = 0;}
142318 break;
142319 case 16: /* ifnotexists ::= IF NOT EXISTS */
142320 {yymsp[-2].minor.yy4 = 1;}
142321 break;
@@ -141969,11 +142347,11 @@
142347 case 23: /* columnname ::= nm typetoken */
142348 {sqlite3AddColumn(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
142349 break;
142350 case 24: /* typetoken ::= */
142351 case 60: /* conslist_opt ::= */ yytestcase(yyruleno==60);
142352 case 98: /* as ::= */ yytestcase(yyruleno==98);
142353 {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = 0;}
142354 break;
142355 case 25: /* typetoken ::= typename LP signed RP */
142356 {
142357 yymsp[-3].minor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
@@ -142080,18 +142458,18 @@
142458 case 55: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
142459 {yymsp[-2].minor.yy4 = 0;}
142460 break;
142461 case 56: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
142462 case 71: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==71);
142463 case 147: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==147);
142464 {yymsp[-1].minor.yy4 = yymsp[0].minor.yy4;}
142465 break;
142466 case 58: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
142467 case 75: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==75);
142468 case 188: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==188);
142469 case 191: /* in_op ::= NOT IN */ yytestcase(yyruleno==191);
142470 case 217: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==217);
142471 {yymsp[-1].minor.yy4 = 1;}
142472 break;
142473 case 59: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
142474 {yymsp[-1].minor.yy4 = 0;}
142475 break;
@@ -142123,11 +142501,11 @@
142501 break;
142502 case 72: /* resolvetype ::= IGNORE */
142503 {yymsp[0].minor.yy4 = OE_Ignore;}
142504 break;
142505 case 73: /* resolvetype ::= REPLACE */
142506 case 148: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==148);
142507 {yymsp[0].minor.yy4 = OE_Replace;}
142508 break;
142509 case 74: /* cmd ::= DROP TABLE ifexists fullname */
142510 {
142511 sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4);
@@ -142148,23 +142526,44 @@
142526 SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0};
142527 sqlite3Select(pParse, yymsp[0].minor.yy387, &dest);
142528 sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387);
142529 }
142530 break;
142531 case 80: /* select ::= WITH wqlist selectnowith */
142532 {
142533 Select *p = yymsp[0].minor.yy387;
142534 if( p ){
142535 p->pWith = yymsp[-1].minor.yy451;
142536 parserDoubleLinkSelect(pParse, p);
142537 }else{
142538 sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy451);
142539 }
142540 yymsp[-2].minor.yy387 = p;
142541 }
142542 break;
142543 case 81: /* select ::= WITH RECURSIVE wqlist selectnowith */
142544 {
142545 Select *p = yymsp[0].minor.yy387;
142546 if( p ){
142547 p->pWith = yymsp[-1].minor.yy451;
142548 parserDoubleLinkSelect(pParse, p);
142549 }else{
142550 sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy451);
142551 }
142552 yymsp[-3].minor.yy387 = p;
142553 }
142554 break;
142555 case 82: /* select ::= selectnowith */
142556 {
142557 Select *p = yymsp[0].minor.yy387;
142558 if( p ){
142559 parserDoubleLinkSelect(pParse, p);
142560 }
142561 yymsp[0].minor.yy387 = p; /*A-overwrites-X*/
142562 }
142563 break;
142564 case 83: /* selectnowith ::= selectnowith multiselect_op oneselect */
142565 {
142566 Select *pRhs = yymsp[0].minor.yy387;
142567 Select *pLhs = yymsp[-2].minor.yy387;
142568 if( pRhs && pRhs->pPrior ){
142569 SrcList *pFrom;
@@ -142184,18 +142583,18 @@
142583 sqlite3SelectDelete(pParse->db, pLhs);
142584 }
142585 yymsp[-2].minor.yy387 = pRhs;
142586 }
142587 break;
142588 case 84: /* multiselect_op ::= UNION */
142589 case 86: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==86);
142590 {yymsp[0].minor.yy4 = yymsp[0].major; /*A-overwrites-OP*/}
142591 break;
142592 case 85: /* multiselect_op ::= UNION ALL */
142593 {yymsp[-1].minor.yy4 = TK_ALL;}
142594 break;
142595 case 87: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
142596 {
142597 #if SELECTTRACE_ENABLED
142598 Token s = yymsp[-8].minor.yy0; /*A-overwrites-S*/
142599 #endif
142600 yymsp[-8].minor.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.yy314);
@@ -142222,16 +142621,16 @@
142621 }
142622 }
142623 #endif /* SELECTRACE_ENABLED */
142624 }
142625 break;
142626 case 88: /* values ::= VALUES LP nexprlist RP */
142627 {
142628 yymsp[-3].minor.yy387 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values,0);
142629 }
142630 break;
142631 case 89: /* values ::= values COMMA LP exprlist RP */
142632 {
142633 Select *pRight, *pLeft = yymsp[-4].minor.yy387;
142634 pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy322,0,0,0,0,0,SF_Values|SF_MultiValue,0);
142635 if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
142636 if( pRight ){
@@ -142241,86 +142640,86 @@
142640 }else{
142641 yymsp[-4].minor.yy387 = pLeft;
142642 }
142643 }
142644 break;
142645 case 90: /* distinct ::= DISTINCT */
142646 {yymsp[0].minor.yy4 = SF_Distinct;}
142647 break;
142648 case 91: /* distinct ::= ALL */
142649 {yymsp[0].minor.yy4 = SF_All;}
142650 break;
142651 case 93: /* sclp ::= */
142652 case 122: /* orderby_opt ::= */ yytestcase(yyruleno==122);
142653 case 129: /* groupby_opt ::= */ yytestcase(yyruleno==129);
142654 case 204: /* exprlist ::= */ yytestcase(yyruleno==204);
142655 case 207: /* paren_exprlist ::= */ yytestcase(yyruleno==207);
142656 case 212: /* eidlist_opt ::= */ yytestcase(yyruleno==212);
142657 {yymsp[1].minor.yy322 = 0;}
142658 break;
142659 case 94: /* selcollist ::= sclp scanpt expr scanpt as */
142660 {
142661 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[-2].minor.yy314);
142662 if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[0].minor.yy0, 1);
142663 sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy322,yymsp[-3].minor.yy336,yymsp[-1].minor.yy336);
142664 }
142665 break;
142666 case 95: /* selcollist ::= sclp scanpt STAR */
142667 {
142668 Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
142669 yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, p);
142670 }
142671 break;
142672 case 96: /* selcollist ::= sclp scanpt nm DOT STAR */
142673 {
142674 Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
142675 Expr *pLeft = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
142676 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
142677 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, pDot);
142678 }
142679 break;
142680 case 97: /* as ::= AS nm */
142681 case 108: /* dbnm ::= DOT nm */ yytestcase(yyruleno==108);
142682 case 226: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==226);
142683 case 227: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==227);
142684 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
142685 break;
142686 case 99: /* from ::= */
142687 {yymsp[1].minor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy259));}
142688 break;
142689 case 100: /* from ::= FROM seltablist */
142690 {
142691 yymsp[-1].minor.yy259 = yymsp[0].minor.yy259;
142692 sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy259);
142693 }
142694 break;
142695 case 101: /* stl_prefix ::= seltablist joinop */
142696 {
142697 if( ALWAYS(yymsp[-1].minor.yy259 && yymsp[-1].minor.yy259->nSrc>0) ) yymsp[-1].minor.yy259->a[yymsp[-1].minor.yy259->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy4;
142698 }
142699 break;
142700 case 102: /* stl_prefix ::= */
142701 {yymsp[1].minor.yy259 = 0;}
142702 break;
142703 case 103: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
142704 {
142705 yymsp[-6].minor.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);
142706 sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy259, &yymsp[-2].minor.yy0);
142707 }
142708 break;
142709 case 104: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
142710 {
142711 yymsp[-8].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy259,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
142712 sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy259, yymsp[-4].minor.yy322);
142713 }
142714 break;
142715 case 105: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
142716 {
142717 yymsp[-6].minor.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);
142718 }
142719 break;
142720 case 106: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
142721 {
142722 if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){
142723 yymsp[-6].minor.yy259 = yymsp[-4].minor.yy259;
142724 }else if( yymsp[-4].minor.yy259->nSrc==1 ){
142725 yymsp[-6].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
@@ -142340,185 +142739,184 @@
142739 pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,SF_NestedFrom,0);
142740 yymsp[-6].minor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384);
142741 }
142742 }
142743 break;
142744 case 107: /* dbnm ::= */
142745 case 117: /* indexed_opt ::= */ yytestcase(yyruleno==117);
142746 {yymsp[1].minor.yy0.z=0; yymsp[1].minor.yy0.n=0;}
142747 break;
142748 case 109: /* fullname ::= nm */
142749 {yymsp[0].minor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
142750 break;
142751 case 110: /* fullname ::= nm DOT nm */
142752 {yymsp[-2].minor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
142753 break;
142754 case 111: /* joinop ::= COMMA|JOIN */
142755 { yymsp[0].minor.yy4 = JT_INNER; }
142756 break;
142757 case 112: /* joinop ::= JOIN_KW JOIN */
142758 {yymsp[-1].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
142759 break;
142760 case 113: /* joinop ::= JOIN_KW nm JOIN */
142761 {yymsp[-2].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
142762 break;
142763 case 114: /* joinop ::= JOIN_KW nm nm JOIN */
142764 {yymsp[-3].minor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
142765 break;
142766 case 115: /* on_opt ::= ON expr */
142767 case 132: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==132);
142768 case 139: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==139);
142769 case 200: /* case_else ::= ELSE expr */ yytestcase(yyruleno==200);
142770 {yymsp[-1].minor.yy314 = yymsp[0].minor.yy314;}
142771 break;
142772 case 116: /* on_opt ::= */
142773 case 131: /* having_opt ::= */ yytestcase(yyruleno==131);
142774 case 133: /* limit_opt ::= */ yytestcase(yyruleno==133);
142775 case 138: /* where_opt ::= */ yytestcase(yyruleno==138);
142776 case 201: /* case_else ::= */ yytestcase(yyruleno==201);
142777 case 203: /* case_operand ::= */ yytestcase(yyruleno==203);
142778 {yymsp[1].minor.yy314 = 0;}
142779 break;
142780 case 118: /* indexed_opt ::= INDEXED BY nm */
142781 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
142782 break;
142783 case 119: /* indexed_opt ::= NOT INDEXED */
142784 {yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
142785 break;
142786 case 120: /* using_opt ::= USING LP idlist RP */
142787 {yymsp[-3].minor.yy384 = yymsp[-1].minor.yy384;}
142788 break;
142789 case 121: /* using_opt ::= */
142790 case 149: /* idlist_opt ::= */ yytestcase(yyruleno==149);
142791 {yymsp[1].minor.yy384 = 0;}
142792 break;
142793 case 123: /* orderby_opt ::= ORDER BY sortlist */
142794 case 130: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==130);
142795 {yymsp[-2].minor.yy322 = yymsp[0].minor.yy322;}
142796 break;
142797 case 124: /* sortlist ::= sortlist COMMA expr sortorder */
142798 {
142799 yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314);
142800 sqlite3ExprListSetSortOrder(yymsp[-3].minor.yy322,yymsp[0].minor.yy4);
142801 }
142802 break;
142803 case 125: /* sortlist ::= expr sortorder */
142804 {
142805 yymsp[-1].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314); /*A-overwrites-Y*/
142806 sqlite3ExprListSetSortOrder(yymsp[-1].minor.yy322,yymsp[0].minor.yy4);
142807 }
142808 break;
142809 case 126: /* sortorder ::= ASC */
142810 {yymsp[0].minor.yy4 = SQLITE_SO_ASC;}
142811 break;
142812 case 127: /* sortorder ::= DESC */
142813 {yymsp[0].minor.yy4 = SQLITE_SO_DESC;}
142814 break;
142815 case 128: /* sortorder ::= */
142816 {yymsp[1].minor.yy4 = SQLITE_SO_UNDEFINED;}
142817 break;
142818 case 134: /* limit_opt ::= LIMIT expr */
142819 {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy314,0);}
142820 break;
142821 case 135: /* limit_opt ::= LIMIT expr OFFSET expr */
142822 {yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy314,yymsp[0].minor.yy314);}
142823 break;
142824 case 136: /* limit_opt ::= LIMIT expr COMMA expr */
142825 {yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy314,yymsp[-2].minor.yy314);}
142826 break;
142827 case 137: /* cmd ::= with DELETE FROM fullname indexed_opt where_opt */
142828 {
 
142829 sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0);
142830 sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314,0,0);
142831 }
142832 break;
142833 case 140: /* cmd ::= with UPDATE orconf fullname indexed_opt SET setlist where_opt */
142834 {
 
142835 sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0);
142836 sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list");
142837 sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy4,0,0);
142838 }
142839 break;
142840 case 141: /* setlist ::= setlist COMMA nm EQ expr */
142841 {
142842 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy314);
142843 sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, 1);
142844 }
142845 break;
142846 case 142: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
142847 {
142848 yymsp[-6].minor.yy322 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy322, yymsp[-3].minor.yy384, yymsp[0].minor.yy314);
142849 }
142850 break;
142851 case 143: /* setlist ::= nm EQ expr */
142852 {
142853 yylhsminor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy314);
142854 sqlite3ExprListSetName(pParse, yylhsminor.yy322, &yymsp[-2].minor.yy0, 1);
142855 }
142856 yymsp[-2].minor.yy322 = yylhsminor.yy322;
142857 break;
142858 case 144: /* setlist ::= LP idlist RP EQ expr */
142859 {
142860 yymsp[-4].minor.yy322 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy384, yymsp[0].minor.yy314);
142861 }
142862 break;
142863 case 145: /* cmd ::= with insert_cmd INTO fullname idlist_opt select */
142864 {
 
142865 sqlite3Insert(pParse, yymsp[-2].minor.yy259, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy4);
142866 }
142867 break;
142868 case 146: /* cmd ::= with insert_cmd INTO fullname idlist_opt DEFAULT VALUES */
142869 {
 
142870 sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy4);
142871 }
142872 break;
142873 case 150: /* idlist_opt ::= LP idlist RP */
142874 {yymsp[-2].minor.yy384 = yymsp[-1].minor.yy384;}
142875 break;
142876 case 151: /* idlist ::= idlist COMMA nm */
142877 {yymsp[-2].minor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);}
142878 break;
142879 case 152: /* idlist ::= nm */
142880 {yymsp[0].minor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
142881 break;
142882 case 153: /* expr ::= LP expr RP */
142883 {yymsp[-2].minor.yy314 = yymsp[-1].minor.yy314;}
142884 break;
142885 case 154: /* expr ::= ID|INDEXED */
142886 case 155: /* expr ::= JOIN_KW */ yytestcase(yyruleno==155);
142887 {yymsp[0].minor.yy314=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
142888 break;
142889 case 156: /* expr ::= nm DOT nm */
142890 {
142891 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
142892 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
142893 yylhsminor.yy314 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
142894 }
142895 yymsp[-2].minor.yy314 = yylhsminor.yy314;
142896 break;
142897 case 157: /* expr ::= nm DOT nm DOT nm */
142898 {
142899 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
142900 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
142901 Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
142902 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3);
142903 yylhsminor.yy314 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
142904 }
142905 yymsp[-4].minor.yy314 = yylhsminor.yy314;
142906 break;
142907 case 158: /* term ::= NULL|FLOAT|BLOB */
142908 case 159: /* term ::= STRING */ yytestcase(yyruleno==159);
142909 {yymsp[0].minor.yy314=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
142910 break;
142911 case 160: /* term ::= INTEGER */
142912 {
142913 yylhsminor.yy314 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
142914 }
142915 yymsp[0].minor.yy314 = yylhsminor.yy314;
142916 break;
142917 case 161: /* expr ::= VARIABLE */
142918 {
142919 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
142920 u32 n = yymsp[0].minor.yy0.n;
142921 yymsp[0].minor.yy314 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
142922 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy314, n);
@@ -142536,22 +142934,22 @@
142934 if( yymsp[0].minor.yy314 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy314->iTable);
142935 }
142936 }
142937 }
142938 break;
142939 case 162: /* expr ::= expr COLLATE ID|STRING */
142940 {
142941 yymsp[-2].minor.yy314 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy314, &yymsp[0].minor.yy0, 1);
142942 }
142943 break;
142944 case 163: /* expr ::= CAST LP expr AS typetoken RP */
142945 {
142946 yymsp[-5].minor.yy314 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
142947 sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy314, yymsp[-3].minor.yy314, 0);
142948 }
142949 break;
142950 case 164: /* expr ::= ID|INDEXED LP distinct exprlist RP */
142951 {
142952 if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
142953 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
142954 }
142955 yylhsminor.yy314 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0);
@@ -142559,23 +142957,23 @@
142957 yylhsminor.yy314->flags |= EP_Distinct;
142958 }
142959 }
142960 yymsp[-4].minor.yy314 = yylhsminor.yy314;
142961 break;
142962 case 165: /* expr ::= ID|INDEXED LP STAR RP */
142963 {
142964 yylhsminor.yy314 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
142965 }
142966 yymsp[-3].minor.yy314 = yylhsminor.yy314;
142967 break;
142968 case 166: /* term ::= CTIME_KW */
142969 {
142970 yylhsminor.yy314 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
142971 }
142972 yymsp[0].minor.yy314 = yylhsminor.yy314;
142973 break;
142974 case 167: /* expr ::= LP nexprlist COMMA expr RP */
142975 {
142976 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy322, yymsp[-1].minor.yy314);
142977 yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
142978 if( yymsp[-4].minor.yy314 ){
142979 yymsp[-4].minor.yy314->x.pList = pList;
@@ -142582,24 +142980,24 @@
142980 }else{
142981 sqlite3ExprListDelete(pParse->db, pList);
142982 }
142983 }
142984 break;
142985 case 168: /* expr ::= expr AND expr */
142986 case 169: /* expr ::= expr OR expr */ yytestcase(yyruleno==169);
142987 case 170: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==170);
142988 case 171: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==171);
142989 case 172: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==172);
142990 case 173: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==173);
142991 case 174: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==174);
142992 case 175: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==175);
142993 {yymsp[-2].minor.yy314=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy314,yymsp[0].minor.yy314);}
142994 break;
142995 case 176: /* likeop ::= NOT LIKE_KW|MATCH */
142996 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
142997 break;
142998 case 177: /* expr ::= expr likeop expr */
142999 {
143000 ExprList *pList;
143001 int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
143002 yymsp[-1].minor.yy0.n &= 0x7fffffff;
143003 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy314);
@@ -142607,11 +143005,11 @@
143005 yymsp[-2].minor.yy314 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0);
143006 if( bNot ) yymsp[-2].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy314, 0);
143007 if( yymsp[-2].minor.yy314 ) yymsp[-2].minor.yy314->flags |= EP_InfixFunc;
143008 }
143009 break;
143010 case 178: /* expr ::= expr likeop expr ESCAPE expr */
143011 {
143012 ExprList *pList;
143013 int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
143014 yymsp[-3].minor.yy0.n &= 0x7fffffff;
143015 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314);
@@ -142620,43 +143018,43 @@
143018 yymsp[-4].minor.yy314 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0);
143019 if( bNot ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
143020 if( yymsp[-4].minor.yy314 ) yymsp[-4].minor.yy314->flags |= EP_InfixFunc;
143021 }
143022 break;
143023 case 179: /* expr ::= expr ISNULL|NOTNULL */
143024 {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy314,0);}
143025 break;
143026 case 180: /* expr ::= expr NOT NULL */
143027 {yymsp[-2].minor.yy314 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy314,0);}
143028 break;
143029 case 181: /* expr ::= expr IS expr */
143030 {
143031 yymsp[-2].minor.yy314 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy314,yymsp[0].minor.yy314);
143032 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy314, yymsp[-2].minor.yy314, TK_ISNULL);
143033 }
143034 break;
143035 case 182: /* expr ::= expr IS NOT expr */
143036 {
143037 yymsp[-3].minor.yy314 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy314,yymsp[0].minor.yy314);
143038 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy314, yymsp[-3].minor.yy314, TK_NOTNULL);
143039 }
143040 break;
143041 case 183: /* expr ::= NOT expr */
143042 case 184: /* expr ::= BITNOT expr */ yytestcase(yyruleno==184);
143043 {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy314, 0);/*A-overwrites-B*/}
143044 break;
143045 case 185: /* expr ::= MINUS expr */
143046 {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy314, 0);}
143047 break;
143048 case 186: /* expr ::= PLUS expr */
143049 {yymsp[-1].minor.yy314 = sqlite3PExpr(pParse, TK_UPLUS, yymsp[0].minor.yy314, 0);}
143050 break;
143051 case 187: /* between_op ::= BETWEEN */
143052 case 190: /* in_op ::= IN */ yytestcase(yyruleno==190);
143053 {yymsp[0].minor.yy4 = 0;}
143054 break;
143055 case 189: /* expr ::= expr between_op expr AND expr */
143056 {
143057 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314);
143058 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy314);
143059 yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy314, 0);
143060 if( yymsp[-4].minor.yy314 ){
@@ -142665,11 +143063,11 @@
143063 sqlite3ExprListDelete(pParse->db, pList);
143064 }
143065 if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
143066 }
143067 break;
143068 case 192: /* expr ::= expr in_op LP exprlist RP */
143069 {
143070 if( yymsp[-1].minor.yy322==0 ){
143071 /* Expressions of the form
143072 **
143073 ** expr1 IN ()
@@ -142717,41 +143115,41 @@
143115 }
143116 if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
143117 }
143118 }
143119 break;
143120 case 193: /* expr ::= LP select RP */
143121 {
143122 yymsp[-2].minor.yy314 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
143123 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy314, yymsp[-1].minor.yy387);
143124 }
143125 break;
143126 case 194: /* expr ::= expr in_op LP select RP */
143127 {
143128 yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy314, 0);
143129 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy314, yymsp[-1].minor.yy387);
143130 if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
143131 }
143132 break;
143133 case 195: /* expr ::= expr in_op nm dbnm paren_exprlist */
143134 {
143135 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
143136 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
143137 if( yymsp[0].minor.yy322 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy322);
143138 yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy314, 0);
143139 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy314, pSelect);
143140 if( yymsp[-3].minor.yy4 ) yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy314, 0);
143141 }
143142 break;
143143 case 196: /* expr ::= EXISTS LP select RP */
143144 {
143145 Expr *p;
143146 p = yymsp[-3].minor.yy314 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
143147 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy387);
143148 }
143149 break;
143150 case 197: /* expr ::= CASE case_operand case_exprlist case_else END */
143151 {
143152 yymsp[-4].minor.yy314 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, 0);
143153 if( yymsp[-4].minor.yy314 ){
143154 yymsp[-4].minor.yy314->x.pList = yymsp[-1].minor.yy314 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy314) : yymsp[-2].minor.yy322;
143155 sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy314);
@@ -142759,334 +143157,330 @@
143157 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322);
143158 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy314);
143159 }
143160 }
143161 break;
143162 case 198: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
143163 {
143164 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy314);
143165 yymsp[-4].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[0].minor.yy314);
143166 }
143167 break;
143168 case 199: /* case_exprlist ::= WHEN expr THEN expr */
143169 {
143170 yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy314);
143171 yymsp[-3].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, yymsp[0].minor.yy314);
143172 }
143173 break;
143174 case 202: /* case_operand ::= expr */
143175 {yymsp[0].minor.yy314 = yymsp[0].minor.yy314; /*A-overwrites-X*/}
143176 break;
143177 case 205: /* nexprlist ::= nexprlist COMMA expr */
143178 {yymsp[-2].minor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy314);}
143179 break;
143180 case 206: /* nexprlist ::= expr */
143181 {yymsp[0].minor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy314); /*A-overwrites-Y*/}
143182 break;
143183 case 208: /* paren_exprlist ::= LP exprlist RP */
143184 case 213: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==213);
143185 {yymsp[-2].minor.yy322 = yymsp[-1].minor.yy322;}
143186 break;
143187 case 209: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
143188 {
143189 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
143190 sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy322, yymsp[-10].minor.yy4,
143191 &yymsp[-11].minor.yy0, yymsp[0].minor.yy314, SQLITE_SO_ASC, yymsp[-8].minor.yy4, SQLITE_IDXTYPE_APPDEF);
143192 }
143193 break;
143194 case 210: /* uniqueflag ::= UNIQUE */
143195 case 250: /* raisetype ::= ABORT */ yytestcase(yyruleno==250);
143196 {yymsp[0].minor.yy4 = OE_Abort;}
143197 break;
143198 case 211: /* uniqueflag ::= */
143199 {yymsp[1].minor.yy4 = OE_None;}
143200 break;
143201 case 214: /* eidlist ::= eidlist COMMA nm collate sortorder */
143202 {
143203 yymsp[-4].minor.yy322 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy322, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy4, yymsp[0].minor.yy4);
143204 }
143205 break;
143206 case 215: /* eidlist ::= nm collate sortorder */
143207 {
143208 yymsp[-2].minor.yy322 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy4, yymsp[0].minor.yy4); /*A-overwrites-Y*/
143209 }
143210 break;
143211 case 218: /* cmd ::= DROP INDEX ifexists fullname */
143212 {sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);}
143213 break;
143214 case 219: /* cmd ::= VACUUM */
143215 {sqlite3Vacuum(pParse,0);}
143216 break;
143217 case 220: /* cmd ::= VACUUM nm */
143218 {sqlite3Vacuum(pParse,&yymsp[0].minor.yy0);}
143219 break;
143220 case 221: /* cmd ::= PRAGMA nm dbnm */
143221 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
143222 break;
143223 case 222: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
143224 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
143225 break;
143226 case 223: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
143227 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
143228 break;
143229 case 224: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
143230 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
143231 break;
143232 case 225: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
143233 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
143234 break;
143235 case 228: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
143236 {
143237 Token all;
143238 all.z = yymsp[-3].minor.yy0.z;
143239 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
143240 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all);
143241 }
143242 break;
143243 case 229: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
143244 {
143245 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);
143246 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
143247 }
143248 break;
143249 case 230: /* trigger_time ::= BEFORE|AFTER */
143250 { yymsp[0].minor.yy4 = yymsp[0].major; /*A-overwrites-X*/ }
143251 break;
143252 case 231: /* trigger_time ::= INSTEAD OF */
143253 { yymsp[-1].minor.yy4 = TK_INSTEAD;}
143254 break;
143255 case 232: /* trigger_time ::= */
143256 { yymsp[1].minor.yy4 = TK_BEFORE; }
143257 break;
143258 case 233: /* trigger_event ::= DELETE|INSERT */
143259 case 234: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==234);
143260 {yymsp[0].minor.yy90.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy90.b = 0;}
143261 break;
143262 case 235: /* trigger_event ::= UPDATE OF idlist */
143263 {yymsp[-2].minor.yy90.a = TK_UPDATE; yymsp[-2].minor.yy90.b = yymsp[0].minor.yy384;}
143264 break;
143265 case 236: /* when_clause ::= */
143266 case 255: /* key_opt ::= */ yytestcase(yyruleno==255);
143267 { yymsp[1].minor.yy314 = 0; }
143268 break;
143269 case 237: /* when_clause ::= WHEN expr */
143270 case 256: /* key_opt ::= KEY expr */ yytestcase(yyruleno==256);
143271 { yymsp[-1].minor.yy314 = yymsp[0].minor.yy314; }
143272 break;
143273 case 238: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
143274 {
143275 assert( yymsp[-2].minor.yy203!=0 );
143276 yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203;
143277 yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203;
143278 }
143279 break;
143280 case 239: /* trigger_cmd_list ::= trigger_cmd SEMI */
143281 {
143282 assert( yymsp[-1].minor.yy203!=0 );
143283 yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203;
143284 }
143285 break;
143286 case 240: /* trnm ::= nm DOT nm */
143287 {
143288 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
143289 sqlite3ErrorMsg(pParse,
143290 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
143291 "statements within triggers");
143292 }
143293 break;
143294 case 241: /* tridxby ::= INDEXED BY nm */
143295 {
143296 sqlite3ErrorMsg(pParse,
143297 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
143298 "within triggers");
143299 }
143300 break;
143301 case 242: /* tridxby ::= NOT INDEXED */
143302 {
143303 sqlite3ErrorMsg(pParse,
143304 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
143305 "within triggers");
143306 }
143307 break;
143308 case 243: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
143309 {yylhsminor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy314, yymsp[-6].minor.yy4, yymsp[-7].minor.yy0.z, yymsp[0].minor.yy336);}
143310 yymsp[-7].minor.yy203 = yylhsminor.yy203;
143311 break;
143312 case 244: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select scanpt */
143313 {yylhsminor.yy203 = sqlite3TriggerInsertStep(pParse->db,&yymsp[-3].minor.yy0,yymsp[-2].minor.yy384,yymsp[-1].minor.yy387,yymsp[-5].minor.yy4,yymsp[-6].minor.yy336,yymsp[0].minor.yy336);/*yylhsminor.yy203-overwrites-yymsp[-5].minor.yy4*/}
143314 yymsp[-6].minor.yy203 = yylhsminor.yy203;
143315 break;
143316 case 245: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
143317 {yylhsminor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy314, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy336);}
143318 yymsp[-5].minor.yy203 = yylhsminor.yy203;
143319 break;
143320 case 246: /* trigger_cmd ::= scanpt select scanpt */
143321 {yylhsminor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy387, yymsp[-2].minor.yy336, yymsp[0].minor.yy336); /*yylhsminor.yy203-overwrites-yymsp[-1].minor.yy387*/}
143322 yymsp[-2].minor.yy203 = yylhsminor.yy203;
143323 break;
143324 case 247: /* expr ::= RAISE LP IGNORE RP */
143325 {
143326 yymsp[-3].minor.yy314 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
143327 if( yymsp[-3].minor.yy314 ){
143328 yymsp[-3].minor.yy314->affinity = OE_Ignore;
143329 }
143330 }
143331 break;
143332 case 248: /* expr ::= RAISE LP raisetype COMMA nm RP */
143333 {
143334 yymsp[-5].minor.yy314 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
143335 if( yymsp[-5].minor.yy314 ) {
143336 yymsp[-5].minor.yy314->affinity = (char)yymsp[-3].minor.yy4;
143337 }
143338 }
143339 break;
143340 case 249: /* raisetype ::= ROLLBACK */
143341 {yymsp[0].minor.yy4 = OE_Rollback;}
143342 break;
143343 case 251: /* raisetype ::= FAIL */
143344 {yymsp[0].minor.yy4 = OE_Fail;}
143345 break;
143346 case 252: /* cmd ::= DROP TRIGGER ifexists fullname */
143347 {
143348 sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4);
143349 }
143350 break;
143351 case 253: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
143352 {
143353 sqlite3Attach(pParse, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, yymsp[0].minor.yy314);
143354 }
143355 break;
143356 case 254: /* cmd ::= DETACH database_kw_opt expr */
143357 {
143358 sqlite3Detach(pParse, yymsp[0].minor.yy314);
143359 }
143360 break;
143361 case 257: /* cmd ::= REINDEX */
143362 {sqlite3Reindex(pParse, 0, 0);}
143363 break;
143364 case 258: /* cmd ::= REINDEX nm dbnm */
143365 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
143366 break;
143367 case 259: /* cmd ::= ANALYZE */
143368 {sqlite3Analyze(pParse, 0, 0);}
143369 break;
143370 case 260: /* cmd ::= ANALYZE nm dbnm */
143371 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
143372 break;
143373 case 261: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
143374 {
143375 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0);
143376 }
143377 break;
143378 case 262: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
143379 {
143380 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
143381 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
143382 }
143383 break;
143384 case 263: /* add_column_fullname ::= fullname */
143385 {
143386 disableLookaside(pParse);
143387 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259);
143388 }
143389 break;
143390 case 264: /* cmd ::= create_vtab */
143391 {sqlite3VtabFinishParse(pParse,0);}
143392 break;
143393 case 265: /* cmd ::= create_vtab LP vtabarglist RP */
143394 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
143395 break;
143396 case 266: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
143397 {
143398 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy4);
143399 }
143400 break;
143401 case 267: /* vtabarg ::= */
143402 {sqlite3VtabArgInit(pParse);}
143403 break;
143404 case 268: /* vtabargtoken ::= ANY */
143405 case 269: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==269);
143406 case 270: /* lp ::= LP */ yytestcase(yyruleno==270);
143407 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
143408 break;
143409 case 271: /* with ::= WITH wqlist */
143410 case 272: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==272);
143411 { sqlite3WithPush(pParse, yymsp[0].minor.yy451, 1); }
143412 break;
143413 case 273: /* wqlist ::= nm eidlist_opt AS LP select RP */
 
 
 
 
 
143414 {
143415 yymsp[-5].minor.yy451 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy322, yymsp[-1].minor.yy387); /*A-overwrites-X*/
143416 }
143417 break;
143418 case 274: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
143419 {
143420 yymsp[-7].minor.yy451 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy451, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy322, yymsp[-1].minor.yy387);
143421 }
143422 break;
143423 default:
143424 /* (275) input ::= cmdlist */ yytestcase(yyruleno==275);
143425 /* (276) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==276);
143426 /* (277) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=277);
143427 /* (278) ecmd ::= SEMI */ yytestcase(yyruleno==278);
143428 /* (279) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==279);
143429 /* (280) explain ::= */ yytestcase(yyruleno==280);
143430 /* (281) trans_opt ::= */ yytestcase(yyruleno==281);
143431 /* (282) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==282);
143432 /* (283) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==283);
143433 /* (284) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==284);
143434 /* (285) savepoint_opt ::= */ yytestcase(yyruleno==285);
143435 /* (286) cmd ::= create_table create_table_args */ yytestcase(yyruleno==286);
143436 /* (287) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==287);
143437 /* (288) columnlist ::= columnname carglist */ yytestcase(yyruleno==288);
143438 /* (289) nm ::= ID|INDEXED */ yytestcase(yyruleno==289);
143439 /* (290) nm ::= STRING */ yytestcase(yyruleno==290);
143440 /* (291) nm ::= JOIN_KW */ yytestcase(yyruleno==291);
143441 /* (292) typetoken ::= typename */ yytestcase(yyruleno==292);
143442 /* (293) typename ::= ID|STRING */ yytestcase(yyruleno==293);
143443 /* (294) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=294);
143444 /* (295) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=295);
143445 /* (296) carglist ::= carglist ccons */ yytestcase(yyruleno==296);
143446 /* (297) carglist ::= */ yytestcase(yyruleno==297);
143447 /* (298) ccons ::= NULL onconf */ yytestcase(yyruleno==298);
143448 /* (299) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==299);
143449 /* (300) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==300);
143450 /* (301) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=301);
143451 /* (302) tconscomma ::= */ yytestcase(yyruleno==302);
143452 /* (303) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=303);
143453 /* (304) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=304);
143454 /* (305) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=305);
143455 /* (306) oneselect ::= values */ yytestcase(yyruleno==306);
143456 /* (307) sclp ::= selcollist COMMA */ yytestcase(yyruleno==307);
143457 /* (308) as ::= ID|STRING */ yytestcase(yyruleno==308);
143458 /* (309) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=309);
143459 /* (310) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==310);
143460 /* (311) exprlist ::= nexprlist */ yytestcase(yyruleno==311);
143461 /* (312) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=312);
143462 /* (313) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=313);
143463 /* (314) nmnum ::= ON */ yytestcase(yyruleno==314);
143464 /* (315) nmnum ::= DELETE */ yytestcase(yyruleno==315);
143465 /* (316) nmnum ::= DEFAULT */ yytestcase(yyruleno==316);
143466 /* (317) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==317);
143467 /* (318) foreach_clause ::= */ yytestcase(yyruleno==318);
143468 /* (319) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==319);
143469 /* (320) trnm ::= nm */ yytestcase(yyruleno==320);
143470 /* (321) tridxby ::= */ yytestcase(yyruleno==321);
143471 /* (322) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==322);
143472 /* (323) database_kw_opt ::= */ yytestcase(yyruleno==323);
143473 /* (324) kwcolumn_opt ::= */ yytestcase(yyruleno==324);
143474 /* (325) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==325);
143475 /* (326) vtabarglist ::= vtabarg */ yytestcase(yyruleno==326);
143476 /* (327) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==327);
143477 /* (328) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==328);
143478 /* (329) anylist ::= */ yytestcase(yyruleno==329);
143479 /* (330) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==330);
143480 /* (331) anylist ::= anylist ANY */ yytestcase(yyruleno==331);
143481 /* (332) with ::= */ yytestcase(yyruleno==332);
143482 break;
143483 /********** End reduce actions ************************************************/
143484 };
143485 assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
143486 yygoto = yyRuleInfo[yyruleno].lhs;
@@ -146146,43 +146540,65 @@
146540 /*
146541 ** This routine implements a busy callback that sleeps and tries
146542 ** again until a timeout value is reached. The timeout value is
146543 ** an integer number of milliseconds passed in as the first
146544 ** argument.
146545 **
146546 ** Return non-zero to retry the lock. Return zero to stop trying
146547 ** and cause SQLite to return SQLITE_BUSY.
146548 */
146549 static int sqliteDefaultBusyCallback(
146550 void *ptr, /* Database connection */
146551 int count, /* Number of times table has been busy */
146552 sqlite3_file *pFile /* The file on which the lock occurred */
146553 ){
146554 #if SQLITE_OS_WIN || HAVE_USLEEP
146555 /* This case is for systems that have support for sleeping for fractions of
146556 ** a second. Examples: All windows systems, unix systems with usleep() */
146557 static const u8 delays[] =
146558 { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 };
146559 static const u8 totals[] =
146560 { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 };
146561 # define NDELAY ArraySize(delays)
146562 sqlite3 *db = (sqlite3 *)ptr;
146563 int tmout = db->busyTimeout;
146564 int delay, prior;
146565
146566 #ifdef SQLITE_ENABLE_SETLK_TIMEOUT
146567 if( sqlite3OsFileControl(pFile,SQLITE_FCNTL_LOCK_TIMEOUT,&tmout)==SQLITE_OK ){
146568 if( count ){
146569 tmout = 0;
146570 sqlite3OsFileControl(pFile, SQLITE_FCNTL_LOCK_TIMEOUT, &tmout);
146571 return 0;
146572 }else{
146573 return 1;
146574 }
146575 }
146576 #else
146577 UNUSED_PARAMETER(pFile);
146578 #endif
146579 assert( count>=0 );
146580 if( count < NDELAY ){
146581 delay = delays[count];
146582 prior = totals[count];
146583 }else{
146584 delay = delays[NDELAY-1];
146585 prior = totals[NDELAY-1] + delay*(count-(NDELAY-1));
146586 }
146587 if( prior + delay > tmout ){
146588 delay = tmout - prior;
146589 if( delay<=0 ) return 0;
146590 }
146591 sqlite3OsSleep(db->pVfs, delay*1000);
146592 return 1;
146593 #else
146594 /* This case for unix systems that lack usleep() support. Sleeping
146595 ** must be done in increments of whole seconds */
146596 sqlite3 *db = (sqlite3 *)ptr;
146597 int tmout = ((sqlite3 *)ptr)->busyTimeout;
146598 UNUSED_PARAMETER(pFile);
146599 if( (count+1)*1000 > tmout ){
146600 return 0;
146601 }
146602 sqlite3OsSleep(db->pVfs, 1000000);
146603 return 1;
146604 #endif
@@ -146189,18 +146605,29 @@
146605 }
146606
146607 /*
146608 ** Invoke the given busy handler.
146609 **
146610 ** This routine is called when an operation failed to acquire a
146611 ** lock on VFS file pFile.
146612 **
146613 ** If this routine returns non-zero, the lock is retried. If it
146614 ** returns 0, the operation aborts with an SQLITE_BUSY error.
146615 */
146616 SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p, sqlite3_file *pFile){
146617 int rc;
146618 if( p->xBusyHandler==0 || p->nBusy<0 ) return 0;
146619 if( p->bExtraFileArg ){
146620 /* Add an extra parameter with the pFile pointer to the end of the
146621 ** callback argument list */
146622 int (*xTra)(void*,int,sqlite3_file*);
146623 xTra = (int(*)(void*,int,sqlite3_file*))p->xBusyHandler;
146624 rc = xTra(p->pBusyArg, p->nBusy, pFile);
146625 }else{
146626 /* Legacy style busy handler callback */
146627 rc = p->xBusyHandler(p->pBusyArg, p->nBusy);
146628 }
146629 if( rc==0 ){
146630 p->nBusy = -1;
146631 }else{
146632 p->nBusy++;
146633 }
@@ -146218,13 +146645,14 @@
146645 ){
146646 #ifdef SQLITE_ENABLE_API_ARMOR
146647 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
146648 #endif
146649 sqlite3_mutex_enter(db->mutex);
146650 db->busyHandler.xBusyHandler = xBusy;
146651 db->busyHandler.pBusyArg = pArg;
146652 db->busyHandler.nBusy = 0;
146653 db->busyHandler.bExtraFileArg = 0;
146654 db->busyTimeout = 0;
146655 sqlite3_mutex_leave(db->mutex);
146656 return SQLITE_OK;
146657 }
146658
@@ -146268,12 +146696,14 @@
146696 SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms){
146697 #ifdef SQLITE_ENABLE_API_ARMOR
146698 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
146699 #endif
146700 if( ms>0 ){
146701 sqlite3_busy_handler(db, (int(*)(void*,int))sqliteDefaultBusyCallback,
146702 (void*)db);
146703 db->busyTimeout = ms;
146704 db->busyHandler.bExtraFileArg = 1;
146705 }else{
146706 sqlite3_busy_handler(db, 0, 0);
146707 }
146708 return SQLITE_OK;
146709 }
@@ -148262,14 +148692,12 @@
148692 *(sqlite3_vfs**)pArg = sqlite3PagerVfs(pPager);
148693 rc = SQLITE_OK;
148694 }else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){
148695 *(sqlite3_file**)pArg = sqlite3PagerJrnlFile(pPager);
148696 rc = SQLITE_OK;
148697 }else{
148698 rc = sqlite3OsFileControl(fd, op, pArg);
 
 
148699 }
148700 sqlite3BtreeLeave(pBtree);
148701 }
148702 sqlite3_mutex_leave(db->mutex);
148703 return rc;
@@ -179336,11 +179764,11 @@
179764 /* If connected to a ZIPVFS backend, override the page size and
179765 ** offset with actual values obtained from ZIPVFS.
179766 */
179767 fd = sqlite3PagerFile(pPager);
179768 x[0] = pCsr->iPageno;
179769 if( sqlite3OsFileControl(fd, 230440, &x)==SQLITE_OK ){
179770 pCsr->iOffset = x[0];
179771 pCsr->szPage = (int)x[1];
179772 }
179773 }
179774
@@ -180102,11 +180530,11 @@
180530 ** input data. Input data may be supplied either as a single large buffer
180531 ** (e.g. sqlite3changeset_start()) or using a stream function (e.g.
180532 ** sqlite3changeset_start_strm()).
180533 */
180534 struct SessionInput {
180535 int bNoDiscard; /* If true, do not discard in InputBuffer() */
180536 int iCurrent; /* Offset in aData[] of current change */
180537 int iNext; /* Offset in aData[] of next change */
180538 u8 *aData; /* Pointer to buffer containing changeset */
180539 int nData; /* Number of bytes in aData */
180540
@@ -180266,12 +180694,12 @@
180694 ** of a patchset change is associated with the correspondingly positioned
180695 ** table column, counting from left to right within the CREATE TABLE
180696 ** statement.
180697 **
180698 ** For a DELETE change, all fields within the record except those associated
180699 ** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the
180700 ** values identifying the row to delete.
180701 **
180702 ** For an UPDATE change, all fields except those associated with PRIMARY KEY
180703 ** columns and columns that are modified by the UPDATE are set to "undefined".
180704 ** PRIMARY KEY fields contain the values identifying the table row to update,
180705 ** and fields associated with modified columns contain the new column values.
@@ -180550,11 +180978,11 @@
180978 ** the type byte).
180979 */
180980 static int sessionSerialLen(u8 *a){
180981 int e = *a;
180982 int n;
180983 if( e==0 || e==0xFF ) return 1;
180984 if( e==SQLITE_NULL ) return 1;
180985 if( e==SQLITE_INTEGER || e==SQLITE_FLOAT ) return 9;
180986 return sessionVarintGet(&a[1], &n) + 1 + n;
180987 }
180988
@@ -180630,11 +181058,11 @@
181058 for(iCol=0; iCol<pTab->nCol; iCol++){
181059 if( pTab->abPK[iCol] ){
181060 int n1 = sessionSerialLen(a1);
181061 int n2 = sessionSerialLen(a2);
181062
181063 if( n1!=n2 || memcmp(a1, a2, n1) ){
181064 return 0;
181065 }
181066 a1 += n1;
181067 a2 += n2;
181068 }else{
@@ -180873,11 +181301,11 @@
181301 if( eType==SQLITE_TEXT ){
181302 z = sqlite3_value_text(pVal);
181303 }else{
181304 z = sqlite3_value_blob(pVal);
181305 }
181306 if( n>0 && memcmp(a, z, n) ) return 0;
181307 a += n;
181308 }
181309 }
181310 }
181311
@@ -182217,10 +182645,11 @@
182645 if( 0==sqlite3_stricmp("sqlite_stat1", zTab) ){
182646 zSql = sqlite3_mprintf(
182647 "SELECT tbl, ?2, stat FROM %Q.sqlite_stat1 WHERE tbl IS ?1 AND "
182648 "idx IS (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)", zDb
182649 );
182650 if( zSql==0 ) rc = SQLITE_NOMEM;
182651 }else{
182652 int i;
182653 const char *zSep = "";
182654 SessionBuffer buf = {0, 0, 0};
182655
@@ -182626,11 +183055,11 @@
183055 /*
183056 ** If the SessionInput object passed as the only argument is a streaming
183057 ** object and the buffer is full, discard some data to free up space.
183058 */
183059 static void sessionDiscardData(SessionInput *pIn){
183060 if( pIn->xInput && pIn->iNext>=SESSIONS_STRM_CHUNK_SIZE ){
183061 int nMove = pIn->buf.nBuf - pIn->iNext;
183062 assert( nMove>=0 );
183063 if( nMove>0 ){
183064 memmove(pIn->buf.aBuf, &pIn->buf.aBuf[pIn->iNext], nMove);
183065 }
@@ -182952,11 +183381,12 @@
183381 ** changes in the changeset.
183382 */
183383 static int sessionChangesetNext(
183384 sqlite3_changeset_iter *p, /* Changeset iterator */
183385 u8 **paRec, /* If non-NULL, store record pointer here */
183386 int *pnRec, /* If non-NULL, store size of record here */
183387 int *pbNew /* If non-NULL, true if new table */
183388 ){
183389 int i;
183390 u8 op;
183391
183392 assert( (paRec==0 && pnRec==0) || (paRec && pnRec) );
@@ -182987,10 +183417,11 @@
183417 sessionDiscardData(&p->in);
183418 p->in.iCurrent = p->in.iNext;
183419
183420 op = p->in.aData[p->in.iNext++];
183421 while( op=='T' || op=='P' ){
183422 if( pbNew ) *pbNew = 1;
183423 p->bPatchset = (op=='P');
183424 if( sessionChangesetReadTblhdr(p) ) return p->rc;
183425 if( (p->rc = sessionInputBuffer(&p->in, 2)) ) return p->rc;
183426 p->in.iCurrent = p->in.iNext;
183427 if( p->in.iNext>=p->in.nData ) return SQLITE_DONE;
@@ -183065,11 +183496,11 @@
183496 **
183497 ** This function may not be called on iterators passed to a conflict handler
183498 ** callback by changeset_apply().
183499 */
183500 SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *p){
183501 return sessionChangesetNext(p, 0, 0, 0);
183502 }
183503
183504 /*
183505 ** The following function extracts information on the current change
183506 ** from a changeset iterator. It may only be called after changeset_next()
@@ -183444,10 +183875,12 @@
183875 const char **azCol; /* Array of column names */
183876 u8 *abPK; /* Boolean array - true if column is in PK */
183877 int bStat1; /* True if table is sqlite_stat1 */
183878 int bDeferConstraints; /* True to defer constraints */
183879 SessionBuffer constraints; /* Deferred constraints are stored here */
183880 SessionBuffer rebase; /* Rebase information (if any) here */
183881 int bRebaseStarted; /* If table header is already in rebase */
183882 };
183883
183884 /*
183885 ** Formulate a statement to DELETE a row from database db. Assuming a table
183886 ** structure like this:
@@ -183710,11 +184143,10 @@
184143 "DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS "
184144 "CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END "
184145 "AND (?4 OR stat IS ?3)"
184146 );
184147 }
 
184148 return rc;
184149 }
184150
184151 /*
184152 ** A wrapper around sqlite3_bind_value() that detects an extra problem.
@@ -183824,10 +184256,58 @@
184256 if( rc!=SQLITE_ROW ) rc = sqlite3_reset(pSelect);
184257 }
184258
184259 return rc;
184260 }
184261
184262 /*
184263 ** This function is called from within sqlite3changset_apply_v2() when
184264 ** a conflict is encountered and resolved using conflict resolution
184265 ** mode eType (either SQLITE_CHANGESET_OMIT or SQLITE_CHANGESET_REPLACE)..
184266 ** It adds a conflict resolution record to the buffer in
184267 ** SessionApplyCtx.rebase, which will eventually be returned to the caller
184268 ** of apply_v2() as the "rebase" buffer.
184269 **
184270 ** Return SQLITE_OK if successful, or an SQLite error code otherwise.
184271 */
184272 static int sessionRebaseAdd(
184273 SessionApplyCtx *p, /* Apply context */
184274 int eType, /* Conflict resolution (OMIT or REPLACE) */
184275 sqlite3_changeset_iter *pIter /* Iterator pointing at current change */
184276 ){
184277 int rc = SQLITE_OK;
184278 int i;
184279 int eOp = pIter->op;
184280 if( p->bRebaseStarted==0 ){
184281 /* Append a table-header to the rebase buffer */
184282 const char *zTab = pIter->zTab;
184283 sessionAppendByte(&p->rebase, 'T', &rc);
184284 sessionAppendVarint(&p->rebase, p->nCol, &rc);
184285 sessionAppendBlob(&p->rebase, p->abPK, p->nCol, &rc);
184286 sessionAppendBlob(&p->rebase, (u8*)zTab, (int)strlen(zTab)+1, &rc);
184287 p->bRebaseStarted = 1;
184288 }
184289
184290 assert( eType==SQLITE_CHANGESET_REPLACE||eType==SQLITE_CHANGESET_OMIT );
184291 assert( eOp==SQLITE_DELETE || eOp==SQLITE_INSERT || eOp==SQLITE_UPDATE );
184292
184293 sessionAppendByte(&p->rebase,
184294 (eOp==SQLITE_DELETE ? SQLITE_DELETE : SQLITE_INSERT), &rc
184295 );
184296 sessionAppendByte(&p->rebase, (eType==SQLITE_CHANGESET_REPLACE), &rc);
184297 for(i=0; i<p->nCol; i++){
184298 sqlite3_value *pVal = 0;
184299 if( eOp==SQLITE_DELETE || (eOp==SQLITE_UPDATE && p->abPK[i]) ){
184300 sqlite3changeset_old(pIter, i, &pVal);
184301 }else{
184302 sqlite3changeset_new(pIter, i, &pVal);
184303 }
184304 sessionAppendValue(&p->rebase, pVal, &rc);
184305 }
184306
184307 return rc;
184308 }
184309
184310 /*
184311 ** Invoke the conflict handler for the change that the changeset iterator
184312 ** currently points to.
184313 **
@@ -183900,11 +184380,11 @@
184380 /* Instead of invoking the conflict handler, append the change blob
184381 ** to the SessionApplyCtx.constraints buffer. */
184382 u8 *aBlob = &pIter->in.aData[pIter->in.iCurrent];
184383 int nBlob = pIter->in.iNext - pIter->in.iCurrent;
184384 sessionAppendBlob(&p->constraints, aBlob, nBlob, &rc);
184385 return SQLITE_OK;
184386 }else{
184387 /* No other row with the new.* primary key. */
184388 res = xConflict(pCtx, eType+1, pIter);
184389 if( res==SQLITE_CHANGESET_REPLACE ) rc = SQLITE_MISUSE;
184390 }
@@ -183926,10 +184406,13 @@
184406
184407 default:
184408 rc = SQLITE_MISUSE;
184409 break;
184410 }
184411 if( rc==SQLITE_OK ){
184412 rc = sessionRebaseAdd(p, res, pIter);
184413 }
184414 }
184415
184416 return rc;
184417 }
184418
@@ -184101,46 +184584,46 @@
184584 int bReplace = 0;
184585 int bRetry = 0;
184586 int rc;
184587
184588 rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, &bReplace, &bRetry);
184589 if( rc==SQLITE_OK ){
184590 /* If the bRetry flag is set, the change has not been applied due to an
184591 ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and
184592 ** a row with the correct PK is present in the db, but one or more other
184593 ** fields do not contain the expected values) and the conflict handler
184594 ** returned SQLITE_CHANGESET_REPLACE. In this case retry the operation,
184595 ** but pass NULL as the final argument so that sessionApplyOneOp() ignores
184596 ** the SQLITE_CHANGESET_DATA problem. */
184597 if( bRetry ){
184598 assert( pIter->op==SQLITE_UPDATE || pIter->op==SQLITE_DELETE );
184599 rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0);
184600 }
184601
184602 /* If the bReplace flag is set, the change is an INSERT that has not
184603 ** been performed because the database already contains a row with the
184604 ** specified primary key and the conflict handler returned
184605 ** SQLITE_CHANGESET_REPLACE. In this case remove the conflicting row
184606 ** before reattempting the INSERT. */
184607 else if( bReplace ){
184608 assert( pIter->op==SQLITE_INSERT );
184609 rc = sqlite3_exec(db, "SAVEPOINT replace_op", 0, 0, 0);
184610 if( rc==SQLITE_OK ){
184611 rc = sessionBindRow(pIter,
184612 sqlite3changeset_new, pApply->nCol, pApply->abPK, pApply->pDelete);
184613 sqlite3_bind_int(pApply->pDelete, pApply->nCol+1, 1);
184614 }
184615 if( rc==SQLITE_OK ){
184616 sqlite3_step(pApply->pDelete);
184617 rc = sqlite3_reset(pApply->pDelete);
184618 }
184619 if( rc==SQLITE_OK ){
184620 rc = sessionApplyOneOp(pIter, pApply, xConflict, pCtx, 0, 0);
184621 }
184622 if( rc==SQLITE_OK ){
184623 rc = sqlite3_exec(db, "RELEASE replace_op", 0, 0, 0);
184624 }
184625 }
184626 }
184627
184628 return rc;
184629 }
@@ -184212,14 +184695,16 @@
184695 int(*xConflict)(
184696 void *pCtx, /* Copy of fifth arg to _apply() */
184697 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184698 sqlite3_changeset_iter *p /* Handle describing change and conflict */
184699 ),
184700 void *pCtx, /* First argument passed to xConflict */
184701 void **ppRebase, int *pnRebase, /* OUT: Rebase information */
184702 int flags /* SESSION_APPLY_XXX flags */
184703 ){
184704 int schemaMismatch = 0;
184705 int rc = SQLITE_OK; /* Return code */
184706 const char *zTab = 0; /* Name of current table */
184707 int nTab = 0; /* Result of sqlite3Strlen30(zTab) */
184708 SessionApplyCtx sApply; /* changeset_apply() context object */
184709 int bPatchset;
184710
@@ -184226,11 +184711,13 @@
184711 assert( xConflict!=0 );
184712
184713 pIter->in.bNoDiscard = 1;
184714 memset(&sApply, 0, sizeof(sApply));
184715 sqlite3_mutex_enter(sqlite3_db_mutex(db));
184716 if( (flags & SQLITE_CHANGESETAPPLY_NOSAVEPOINT)==0 ){
184717 rc = sqlite3_exec(db, "SAVEPOINT changeset_apply", 0, 0, 0);
184718 }
184719 if( rc==SQLITE_OK ){
184720 rc = sqlite3_exec(db, "PRAGMA defer_foreign_keys = 1", 0, 0, 0);
184721 }
184722 while( rc==SQLITE_OK && SQLITE_ROW==sqlite3changeset_next(pIter) ){
184723 int nCol;
@@ -184250,13 +184737,22 @@
184737 sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */
184738 sqlite3_finalize(sApply.pDelete);
184739 sqlite3_finalize(sApply.pUpdate);
184740 sqlite3_finalize(sApply.pInsert);
184741 sqlite3_finalize(sApply.pSelect);
 
184742 sApply.db = db;
184743 sApply.pDelete = 0;
184744 sApply.pUpdate = 0;
184745 sApply.pInsert = 0;
184746 sApply.pSelect = 0;
184747 sApply.nCol = 0;
184748 sApply.azCol = 0;
184749 sApply.abPK = 0;
184750 sApply.bStat1 = 0;
184751 sApply.bDeferConstraints = 1;
184752 sApply.bRebaseStarted = 0;
184753 memset(&sApply.constraints, 0, sizeof(SessionBuffer));
184754
184755 /* If an xFilter() callback was specified, invoke it now. If the
184756 ** xFilter callback returns zero, skip this table. If it returns
184757 ** non-zero, proceed. */
184758 schemaMismatch = (xFilter && (0==xFilter(pCtx, zNew)));
@@ -184355,26 +184851,65 @@
184851 }
184852 }
184853 }
184854 sqlite3_exec(db, "PRAGMA defer_foreign_keys = 0", 0, 0, 0);
184855
184856 if( (flags & SQLITE_CHANGESETAPPLY_NOSAVEPOINT)==0 ){
184857 if( rc==SQLITE_OK ){
184858 rc = sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0);
184859 }else{
184860 sqlite3_exec(db, "ROLLBACK TO changeset_apply", 0, 0, 0);
184861 sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0);
184862 }
184863 }
184864
184865 if( rc==SQLITE_OK && bPatchset==0 && ppRebase && pnRebase ){
184866 *ppRebase = (void*)sApply.rebase.aBuf;
184867 *pnRebase = sApply.rebase.nBuf;
184868 sApply.rebase.aBuf = 0;
184869 }
184870 sqlite3_finalize(sApply.pInsert);
184871 sqlite3_finalize(sApply.pDelete);
184872 sqlite3_finalize(sApply.pUpdate);
184873 sqlite3_finalize(sApply.pSelect);
184874 sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */
184875 sqlite3_free((char*)sApply.constraints.aBuf);
184876 sqlite3_free((char*)sApply.rebase.aBuf);
184877 sqlite3_mutex_leave(sqlite3_db_mutex(db));
184878 return rc;
184879 }
184880
184881 /*
184882 ** Apply the changeset passed via pChangeset/nChangeset to the main
184883 ** database attached to handle "db".
184884 */
184885 SQLITE_API int sqlite3changeset_apply_v2(
184886 sqlite3 *db, /* Apply change to "main" db of this handle */
184887 int nChangeset, /* Size of changeset in bytes */
184888 void *pChangeset, /* Changeset blob */
184889 int(*xFilter)(
184890 void *pCtx, /* Copy of sixth arg to _apply() */
184891 const char *zTab /* Table name */
184892 ),
184893 int(*xConflict)(
184894 void *pCtx, /* Copy of sixth arg to _apply() */
184895 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184896 sqlite3_changeset_iter *p /* Handle describing change and conflict */
184897 ),
184898 void *pCtx, /* First argument passed to xConflict */
184899 void **ppRebase, int *pnRebase,
184900 int flags
184901 ){
184902 sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
184903 int rc = sqlite3changeset_start(&pIter, nChangeset, pChangeset);
184904 if( rc==SQLITE_OK ){
184905 rc = sessionChangesetApply(
184906 db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags
184907 );
184908 }
184909 return rc;
184910 }
184911
184912 /*
184913 ** Apply the changeset passed via pChangeset/nChangeset to the main database
184914 ** attached to handle "db". Invoke the supplied conflict handler callback
184915 ** to resolve any conflicts encountered while applying the change.
@@ -184392,23 +184927,46 @@
184927 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184928 sqlite3_changeset_iter *p /* Handle describing change and conflict */
184929 ),
184930 void *pCtx /* First argument passed to xConflict */
184931 ){
184932 return sqlite3changeset_apply_v2(
184933 db, nChangeset, pChangeset, xFilter, xConflict, pCtx, 0, 0, 0
184934 );
 
 
 
184935 }
184936
184937 /*
184938 ** Apply the changeset passed via xInput/pIn to the main database
184939 ** attached to handle "db". Invoke the supplied conflict handler callback
184940 ** to resolve any conflicts encountered while applying the change.
184941 */
184942 SQLITE_API int sqlite3changeset_apply_v2_strm(
184943 sqlite3 *db, /* Apply change to "main" db of this handle */
184944 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
184945 void *pIn, /* First arg for xInput */
184946 int(*xFilter)(
184947 void *pCtx, /* Copy of sixth arg to _apply() */
184948 const char *zTab /* Table name */
184949 ),
184950 int(*xConflict)(
184951 void *pCtx, /* Copy of sixth arg to _apply() */
184952 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184953 sqlite3_changeset_iter *p /* Handle describing change and conflict */
184954 ),
184955 void *pCtx, /* First argument passed to xConflict */
184956 void **ppRebase, int *pnRebase,
184957 int flags
184958 ){
184959 sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
184960 int rc = sqlite3changeset_start_strm(&pIter, xInput, pIn);
184961 if( rc==SQLITE_OK ){
184962 rc = sessionChangesetApply(
184963 db, pIter, xFilter, xConflict, pCtx, ppRebase, pnRebase, flags
184964 );
184965 }
184966 return rc;
184967 }
184968 SQLITE_API int sqlite3changeset_apply_strm(
184969 sqlite3 *db, /* Apply change to "main" db of this handle */
184970 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
184971 void *pIn, /* First arg for xInput */
184972 int(*xFilter)(
@@ -184420,16 +184978,13 @@
184978 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
184979 sqlite3_changeset_iter *p /* Handle describing change and conflict */
184980 ),
184981 void *pCtx /* First argument passed to xConflict */
184982 ){
184983 return sqlite3changeset_apply_v2_strm(
184984 db, xInput, pIn, xFilter, xConflict, pCtx, 0, 0, 0
184985 );
 
 
 
184986 }
184987
184988 /*
184989 ** sqlite3_changegroup handle.
184990 */
@@ -184444,31 +184999,90 @@
184999 ** part of an sqlite3changeset_concat() operation. A new change object is
185000 ** allocated and a pointer to it stored in *ppNew.
185001 */
185002 static int sessionChangeMerge(
185003 SessionTable *pTab, /* Table structure */
185004 int bRebase, /* True for a rebase hash-table */
185005 int bPatchset, /* True for patchsets */
185006 SessionChange *pExist, /* Existing change */
185007 int op2, /* Second change operation */
185008 int bIndirect, /* True if second change is indirect */
185009 u8 *aRec, /* Second change record */
185010 int nRec, /* Number of bytes in aRec */
185011 SessionChange **ppNew /* OUT: Merged change */
185012 ){
185013 SessionChange *pNew = 0;
185014 int rc = SQLITE_OK;
185015
185016 if( !pExist ){
185017 pNew = (SessionChange *)sqlite3_malloc(sizeof(SessionChange) + nRec);
185018 if( !pNew ){
185019 return SQLITE_NOMEM;
185020 }
185021 memset(pNew, 0, sizeof(SessionChange));
185022 pNew->op = op2;
185023 pNew->bIndirect = bIndirect;
 
185024 pNew->aRecord = (u8*)&pNew[1];
185025 if( bIndirect==0 || bRebase==0 ){
185026 pNew->nRecord = nRec;
185027 memcpy(pNew->aRecord, aRec, nRec);
185028 }else{
185029 int i;
185030 u8 *pIn = aRec;
185031 u8 *pOut = pNew->aRecord;
185032 for(i=0; i<pTab->nCol; i++){
185033 int nIn = sessionSerialLen(pIn);
185034 if( *pIn==0 ){
185035 *pOut++ = 0;
185036 }else if( pTab->abPK[i]==0 ){
185037 *pOut++ = 0xFF;
185038 }else{
185039 memcpy(pOut, pIn, nIn);
185040 pOut += nIn;
185041 }
185042 pIn += nIn;
185043 }
185044 pNew->nRecord = pOut - pNew->aRecord;
185045 }
185046 }else if( bRebase ){
185047 if( pExist->op==SQLITE_DELETE && pExist->bIndirect ){
185048 *ppNew = pExist;
185049 }else{
185050 int nByte = nRec + pExist->nRecord + sizeof(SessionChange);
185051 pNew = (SessionChange*)sqlite3_malloc(nByte);
185052 if( pNew==0 ){
185053 rc = SQLITE_NOMEM;
185054 }else{
185055 int i;
185056 u8 *a1 = pExist->aRecord;
185057 u8 *a2 = aRec;
185058 u8 *pOut;
185059
185060 memset(pNew, 0, nByte);
185061 pNew->bIndirect = bIndirect || pExist->bIndirect;
185062 pNew->op = op2;
185063 pOut = pNew->aRecord = (u8*)&pNew[1];
185064
185065 for(i=0; i<pTab->nCol; i++){
185066 int n1 = sessionSerialLen(a1);
185067 int n2 = sessionSerialLen(a2);
185068 if( *a1==0xFF || (pTab->abPK[i]==0 && bIndirect) ){
185069 *pOut++ = 0xFF;
185070 }else if( *a2==0 ){
185071 memcpy(pOut, a1, n1);
185072 pOut += n1;
185073 }else{
185074 memcpy(pOut, a2, n2);
185075 pOut += n2;
185076 }
185077 a1 += n1;
185078 a2 += n2;
185079 }
185080 pNew->nRecord = pOut - pNew->aRecord;
185081 }
185082 sqlite3_free(pExist);
185083 }
185084 }else{
185085 int op1 = pExist->op;
185086
185087 /*
185088 ** op1=INSERT, op2=INSERT -> Unsupported. Discard op2.
@@ -184558,28 +185172,28 @@
185172 sqlite3_free(pExist);
185173 }
185174 }
185175
185176 *ppNew = pNew;
185177 return rc;
185178 }
185179
185180 /*
185181 ** Add all changes in the changeset traversed by the iterator passed as
185182 ** the first argument to the changegroup hash tables.
185183 */
185184 static int sessionChangesetToHash(
185185 sqlite3_changeset_iter *pIter, /* Iterator to read from */
185186 sqlite3_changegroup *pGrp, /* Changegroup object to add changeset to */
185187 int bRebase /* True if hash table is for rebasing */
185188 ){
185189 u8 *aRec;
185190 int nRec;
185191 int rc = SQLITE_OK;
185192 SessionTable *pTab = 0;
185193
185194 while( SQLITE_ROW==sessionChangesetNext(pIter, &aRec, &nRec, 0) ){
 
185195 const char *zNew;
185196 int nCol;
185197 int op;
185198 int iHash;
185199 int bIndirect;
@@ -184655,11 +185269,11 @@
185269 pTab->nEntry--;
185270 break;
185271 }
185272 }
185273
185274 rc = sessionChangeMerge(pTab, bRebase,
185275 pIter->bPatchset, pExist, op, bIndirect, aRec, nRec, &pChange
185276 );
185277 if( rc ) break;
185278 if( pChange ){
185279 pChange->pNext = pTab->apChange[iHash];
@@ -184763,11 +185377,11 @@
185377 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
185378 int rc; /* Return code */
185379
185380 rc = sqlite3changeset_start(&pIter, nData, pData);
185381 if( rc==SQLITE_OK ){
185382 rc = sessionChangesetToHash(pIter, pGrp, 0);
185383 }
185384 sqlite3changeset_finalize(pIter);
185385 return rc;
185386 }
185387
@@ -184794,11 +185408,11 @@
185408 sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */
185409 int rc; /* Return code */
185410
185411 rc = sqlite3changeset_start_strm(&pIter, xInput, pIn);
185412 if( rc==SQLITE_OK ){
185413 rc = sessionChangesetToHash(pIter, pGrp, 0);
185414 }
185415 sqlite3changeset_finalize(pIter);
185416 return rc;
185417 }
185418
@@ -184878,10 +185492,353 @@
185492 }
185493 sqlite3changegroup_delete(pGrp);
185494
185495 return rc;
185496 }
185497
185498 /*
185499 ** Changeset rebaser handle.
185500 */
185501 struct sqlite3_rebaser {
185502 sqlite3_changegroup grp; /* Hash table */
185503 };
185504
185505 /*
185506 ** Buffers a1 and a2 must both contain a sessions module record nCol
185507 ** fields in size. This function appends an nCol sessions module
185508 ** record to buffer pBuf that is a copy of a1, except that for
185509 ** each field that is undefined in a1[], swap in the field from a2[].
185510 */
185511 static void sessionAppendRecordMerge(
185512 SessionBuffer *pBuf, /* Buffer to append to */
185513 int nCol, /* Number of columns in each record */
185514 u8 *a1, int n1, /* Record 1 */
185515 u8 *a2, int n2, /* Record 2 */
185516 int *pRc /* IN/OUT: error code */
185517 ){
185518 sessionBufferGrow(pBuf, n1+n2, pRc);
185519 if( *pRc==SQLITE_OK ){
185520 int i;
185521 u8 *pOut = &pBuf->aBuf[pBuf->nBuf];
185522 for(i=0; i<nCol; i++){
185523 int nn1 = sessionSerialLen(a1);
185524 int nn2 = sessionSerialLen(a2);
185525 if( *a1==0 || *a1==0xFF ){
185526 memcpy(pOut, a2, nn2);
185527 pOut += nn2;
185528 }else{
185529 memcpy(pOut, a1, nn1);
185530 pOut += nn1;
185531 }
185532 a1 += nn1;
185533 a2 += nn2;
185534 }
185535
185536 pBuf->nBuf = pOut-pBuf->aBuf;
185537 assert( pBuf->nBuf<=pBuf->nAlloc );
185538 }
185539 }
185540
185541 /*
185542 ** This function is called when rebasing a local UPDATE change against one
185543 ** or more remote UPDATE changes. The aRec/nRec buffer contains the current
185544 ** old.* and new.* records for the change. The rebase buffer (a single
185545 ** record) is in aChange/nChange. The rebased change is appended to buffer
185546 ** pBuf.
185547 **
185548 ** Rebasing the UPDATE involves:
185549 **
185550 ** * Removing any changes to fields for which the corresponding field
185551 ** in the rebase buffer is set to "replaced" (type 0xFF). If this
185552 ** means the UPDATE change updates no fields, nothing is appended
185553 ** to the output buffer.
185554 **
185555 ** * For each field modified by the local change for which the
185556 ** corresponding field in the rebase buffer is not "undefined" (0x00)
185557 ** or "replaced" (0xFF), the old.* value is replaced by the value
185558 ** in the rebase buffer.
185559 */
185560 static void sessionAppendPartialUpdate(
185561 SessionBuffer *pBuf, /* Append record here */
185562 sqlite3_changeset_iter *pIter, /* Iterator pointed at local change */
185563 u8 *aRec, int nRec, /* Local change */
185564 u8 *aChange, int nChange, /* Record to rebase against */
185565 int *pRc /* IN/OUT: Return Code */
185566 ){
185567 sessionBufferGrow(pBuf, 2+nRec+nChange, pRc);
185568 if( *pRc==SQLITE_OK ){
185569 int bData = 0;
185570 u8 *pOut = &pBuf->aBuf[pBuf->nBuf];
185571 int i;
185572 u8 *a1 = aRec;
185573 u8 *a2 = aChange;
185574
185575 *pOut++ = SQLITE_UPDATE;
185576 *pOut++ = pIter->bIndirect;
185577 for(i=0; i<pIter->nCol; i++){
185578 int n1 = sessionSerialLen(a1);
185579 int n2 = sessionSerialLen(a2);
185580 if( pIter->abPK[i] || a2[0]==0 ){
185581 if( !pIter->abPK[i] ) bData = 1;
185582 memcpy(pOut, a1, n1);
185583 pOut += n1;
185584 }else if( a2[0]!=0xFF ){
185585 bData = 1;
185586 memcpy(pOut, a2, n2);
185587 pOut += n2;
185588 }else{
185589 *pOut++ = '\0';
185590 }
185591 a1 += n1;
185592 a2 += n2;
185593 }
185594 if( bData ){
185595 a2 = aChange;
185596 for(i=0; i<pIter->nCol; i++){
185597 int n1 = sessionSerialLen(a1);
185598 int n2 = sessionSerialLen(a2);
185599 if( pIter->abPK[i] || a2[0]!=0xFF ){
185600 memcpy(pOut, a1, n1);
185601 pOut += n1;
185602 }else{
185603 *pOut++ = '\0';
185604 }
185605 a1 += n1;
185606 a2 += n2;
185607 }
185608 pBuf->nBuf = (pOut - pBuf->aBuf);
185609 }
185610 }
185611 }
185612
185613 /*
185614 ** pIter is configured to iterate through a changeset. This function rebases
185615 ** that changeset according to the current configuration of the rebaser
185616 ** object passed as the first argument. If no error occurs and argument xOutput
185617 ** is not NULL, then the changeset is returned to the caller by invoking
185618 ** xOutput zero or more times and SQLITE_OK returned. Or, if xOutput is NULL,
185619 ** then (*ppOut) is set to point to a buffer containing the rebased changeset
185620 ** before this function returns. In this case (*pnOut) is set to the size of
185621 ** the buffer in bytes. It is the responsibility of the caller to eventually
185622 ** free the (*ppOut) buffer using sqlite3_free().
185623 **
185624 ** If an error occurs, an SQLite error code is returned. If ppOut and
185625 ** pnOut are not NULL, then the two output parameters are set to 0 before
185626 ** returning.
185627 */
185628 static int sessionRebase(
185629 sqlite3_rebaser *p, /* Rebaser hash table */
185630 sqlite3_changeset_iter *pIter, /* Input data */
185631 int (*xOutput)(void *pOut, const void *pData, int nData),
185632 void *pOut, /* Context for xOutput callback */
185633 int *pnOut, /* OUT: Number of bytes in output changeset */
185634 void **ppOut /* OUT: Inverse of pChangeset */
185635 ){
185636 int rc = SQLITE_OK;
185637 u8 *aRec = 0;
185638 int nRec = 0;
185639 int bNew = 0;
185640 SessionTable *pTab = 0;
185641 SessionBuffer sOut = {0,0,0};
185642
185643 while( SQLITE_ROW==sessionChangesetNext(pIter, &aRec, &nRec, &bNew) ){
185644 SessionChange *pChange = 0;
185645 int bDone = 0;
185646
185647 if( bNew ){
185648 const char *zTab = pIter->zTab;
185649 for(pTab=p->grp.pList; pTab; pTab=pTab->pNext){
185650 if( 0==sqlite3_stricmp(pTab->zName, zTab) ) break;
185651 }
185652 bNew = 0;
185653
185654 /* A patchset may not be rebased */
185655 if( pIter->bPatchset ){
185656 rc = SQLITE_ERROR;
185657 }
185658
185659 /* Append a table header to the output for this new table */
185660 sessionAppendByte(&sOut, pIter->bPatchset ? 'P' : 'T', &rc);
185661 sessionAppendVarint(&sOut, pIter->nCol, &rc);
185662 sessionAppendBlob(&sOut, pIter->abPK, pIter->nCol, &rc);
185663 sessionAppendBlob(&sOut,(u8*)pIter->zTab,(int)strlen(pIter->zTab)+1,&rc);
185664 }
185665
185666 if( pTab && rc==SQLITE_OK ){
185667 int iHash = sessionChangeHash(pTab, 0, aRec, pTab->nChange);
185668
185669 for(pChange=pTab->apChange[iHash]; pChange; pChange=pChange->pNext){
185670 if( sessionChangeEqual(pTab, 0, aRec, 0, pChange->aRecord) ){
185671 break;
185672 }
185673 }
185674 }
185675
185676 if( pChange ){
185677 assert( pChange->op==SQLITE_DELETE || pChange->op==SQLITE_INSERT );
185678 switch( pIter->op ){
185679 case SQLITE_INSERT:
185680 if( pChange->op==SQLITE_INSERT ){
185681 bDone = 1;
185682 if( pChange->bIndirect==0 ){
185683 sessionAppendByte(&sOut, SQLITE_UPDATE, &rc);
185684 sessionAppendByte(&sOut, pIter->bIndirect, &rc);
185685 sessionAppendBlob(&sOut, pChange->aRecord, pChange->nRecord, &rc);
185686 sessionAppendBlob(&sOut, aRec, nRec, &rc);
185687 }
185688 }
185689 break;
185690
185691 case SQLITE_UPDATE:
185692 bDone = 1;
185693 if( pChange->op==SQLITE_DELETE ){
185694 if( pChange->bIndirect==0 ){
185695 u8 *pCsr = aRec;
185696 sessionSkipRecord(&pCsr, pIter->nCol);
185697 sessionAppendByte(&sOut, SQLITE_INSERT, &rc);
185698 sessionAppendByte(&sOut, pIter->bIndirect, &rc);
185699 sessionAppendRecordMerge(&sOut, pIter->nCol,
185700 pCsr, nRec-(pCsr-aRec),
185701 pChange->aRecord, pChange->nRecord, &rc
185702 );
185703 }
185704 }else{
185705 sessionAppendPartialUpdate(&sOut, pIter,
185706 aRec, nRec, pChange->aRecord, pChange->nRecord, &rc
185707 );
185708 }
185709 break;
185710
185711 default:
185712 assert( pIter->op==SQLITE_DELETE );
185713 bDone = 1;
185714 if( pChange->op==SQLITE_INSERT ){
185715 sessionAppendByte(&sOut, SQLITE_DELETE, &rc);
185716 sessionAppendByte(&sOut, pIter->bIndirect, &rc);
185717 sessionAppendRecordMerge(&sOut, pIter->nCol,
185718 pChange->aRecord, pChange->nRecord, aRec, nRec, &rc
185719 );
185720 }
185721 break;
185722 }
185723 }
185724
185725 if( bDone==0 ){
185726 sessionAppendByte(&sOut, pIter->op, &rc);
185727 sessionAppendByte(&sOut, pIter->bIndirect, &rc);
185728 sessionAppendBlob(&sOut, aRec, nRec, &rc);
185729 }
185730 if( rc==SQLITE_OK && xOutput && sOut.nBuf>SESSIONS_STRM_CHUNK_SIZE ){
185731 rc = xOutput(pOut, sOut.aBuf, sOut.nBuf);
185732 sOut.nBuf = 0;
185733 }
185734 if( rc ) break;
185735 }
185736
185737 if( rc!=SQLITE_OK ){
185738 sqlite3_free(sOut.aBuf);
185739 memset(&sOut, 0, sizeof(sOut));
185740 }
185741
185742 if( rc==SQLITE_OK ){
185743 if( xOutput ){
185744 if( sOut.nBuf>0 ){
185745 rc = xOutput(pOut, sOut.aBuf, sOut.nBuf);
185746 }
185747 }else{
185748 *ppOut = (void*)sOut.aBuf;
185749 *pnOut = sOut.nBuf;
185750 sOut.aBuf = 0;
185751 }
185752 }
185753 sqlite3_free(sOut.aBuf);
185754 return rc;
185755 }
185756
185757 /*
185758 ** Create a new rebaser object.
185759 */
185760 SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew){
185761 int rc = SQLITE_OK;
185762 sqlite3_rebaser *pNew;
185763
185764 pNew = sqlite3_malloc(sizeof(sqlite3_rebaser));
185765 if( pNew==0 ){
185766 rc = SQLITE_NOMEM;
185767 }else{
185768 memset(pNew, 0, sizeof(sqlite3_rebaser));
185769 }
185770 *ppNew = pNew;
185771 return rc;
185772 }
185773
185774 /*
185775 ** Call this one or more times to configure a rebaser.
185776 */
185777 SQLITE_API int sqlite3rebaser_configure(
185778 sqlite3_rebaser *p,
185779 int nRebase, const void *pRebase
185780 ){
185781 sqlite3_changeset_iter *pIter = 0; /* Iterator opened on pData/nData */
185782 int rc; /* Return code */
185783 rc = sqlite3changeset_start(&pIter, nRebase, (void*)pRebase);
185784 if( rc==SQLITE_OK ){
185785 rc = sessionChangesetToHash(pIter, &p->grp, 1);
185786 }
185787 sqlite3changeset_finalize(pIter);
185788 return rc;
185789 }
185790
185791 /*
185792 ** Rebase a changeset according to current rebaser configuration
185793 */
185794 SQLITE_API int sqlite3rebaser_rebase(
185795 sqlite3_rebaser *p,
185796 int nIn, const void *pIn,
185797 int *pnOut, void **ppOut
185798 ){
185799 sqlite3_changeset_iter *pIter = 0; /* Iterator to skip through input */
185800 int rc = sqlite3changeset_start(&pIter, nIn, (void*)pIn);
185801
185802 if( rc==SQLITE_OK ){
185803 rc = sessionRebase(p, pIter, 0, 0, pnOut, ppOut);
185804 sqlite3changeset_finalize(pIter);
185805 }
185806
185807 return rc;
185808 }
185809
185810 /*
185811 ** Rebase a changeset according to current rebaser configuration
185812 */
185813 SQLITE_API int sqlite3rebaser_rebase_strm(
185814 sqlite3_rebaser *p,
185815 int (*xInput)(void *pIn, void *pData, int *pnData),
185816 void *pIn,
185817 int (*xOutput)(void *pOut, const void *pData, int nData),
185818 void *pOut
185819 ){
185820 sqlite3_changeset_iter *pIter = 0; /* Iterator to skip through input */
185821 int rc = sqlite3changeset_start_strm(&pIter, xInput, pIn);
185822
185823 if( rc==SQLITE_OK ){
185824 rc = sessionRebase(p, pIter, xOutput, pOut, 0, 0);
185825 sqlite3changeset_finalize(pIter);
185826 }
185827
185828 return rc;
185829 }
185830
185831 /*
185832 ** Destroy a rebaser object
185833 */
185834 SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p){
185835 if( p ){
185836 sessionDeleteTable(p->grp.pList);
185837 sqlite3_free(p);
185838 }
185839 }
185840
185841 #endif /* SQLITE_ENABLE_SESSION && SQLITE_ENABLE_PREUPDATE_HOOK */
185842
185843 /************** End of sqlite3session.c **************************************/
185844 /************** Begin file json1.c *******************************************/
@@ -202602,10 +203559,16 @@
203559
203560 int aColMap[3];
203561 aColMap[0] = -1;
203562 aColMap[1] = nCol;
203563 aColMap[2] = nCol+1;
203564
203565 assert( SQLITE_INDEX_CONSTRAINT_EQ<SQLITE_INDEX_CONSTRAINT_MATCH );
203566 assert( SQLITE_INDEX_CONSTRAINT_GT<SQLITE_INDEX_CONSTRAINT_MATCH );
203567 assert( SQLITE_INDEX_CONSTRAINT_LE<SQLITE_INDEX_CONSTRAINT_MATCH );
203568 assert( SQLITE_INDEX_CONSTRAINT_GE<SQLITE_INDEX_CONSTRAINT_MATCH );
203569 assert( SQLITE_INDEX_CONSTRAINT_LE<SQLITE_INDEX_CONSTRAINT_MATCH );
203570
203571 /* Set idxFlags flags for all WHERE clause terms that will be used. */
203572 for(i=0; i<pInfo->nConstraint; i++){
203573 struct sqlite3_index_constraint *p = &pInfo->aConstraint[i];
203574 int iCol = p->iColumn;
@@ -202621,15 +203584,15 @@
203584 /* As there exists an unusable MATCH constraint this is an
203585 ** unusable plan. Set a prohibitively high cost. */
203586 pInfo->estimatedCost = 1e50;
203587 return SQLITE_OK;
203588 }
203589 }else if( p->op<=SQLITE_INDEX_CONSTRAINT_MATCH ){
203590 int j;
203591 for(j=1; j<ArraySize(aConstraint); j++){
203592 struct Constraint *pC = &aConstraint[j];
203593 if( iCol==aColMap[pC->iCol] && (p->op & pC->op) && p->usable ){
203594 pC->iConsIndex = i;
203595 idxFlags |= pC->fts5op;
203596 }
203597 }
203598 }
@@ -204697,11 +205660,11 @@
205660 int nArg, /* Number of args */
205661 sqlite3_value **apUnused /* Function arguments */
205662 ){
205663 assert( nArg==0 );
205664 UNUSED_PARAM2(nArg, apUnused);
205665 sqlite3_result_text(pCtx, "fts5: 2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b", -1, SQLITE_TRANSIENT);
205666 }
205667
205668 static int fts5Init(sqlite3 *db){
205669 static const sqlite3_module fts5Mod = {
205670 /* iVersion */ 2,
@@ -208967,12 +209930,12 @@
209930 }
209931 #endif /* SQLITE_CORE */
209932 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
209933
209934 /************** End of stmt.c ************************************************/
209935 #if __LINE__!=209935
209936 #undef SQLITE_SOURCE_ID
209937 #define SQLITE_SOURCE_ID "2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd14alt2"
209938 #endif
209939 /* Return the source-id for this library */
209940 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
209941 /************************** End of sqlite3.c ******************************/
209942
+254 -16
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121121
**
122122
** See also: [sqlite3_libversion()],
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126
-#define SQLITE_VERSION "3.23.0"
127
-#define SQLITE_VERSION_NUMBER 3023000
128
-#define SQLITE_SOURCE_ID "2018-03-22 17:13:44 eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27ef01"
126
+#define SQLITE_VERSION "3.23.1"
127
+#define SQLITE_VERSION_NUMBER 3023001
128
+#define SQLITE_SOURCE_ID "2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
@@ -1062,10 +1062,16 @@
10621062
** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back.
10631063
** ^This file control takes the file descriptor out of batch write mode
10641064
** so that all subsequent write operations are independent.
10651065
** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without
10661066
** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE].
1067
+**
1068
+** <li>[[SQLITE_FCNTL_LOCK_TIMEOUT]]
1069
+** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode causes attempts to obtain
1070
+** a file lock using the xLock or xShmLock methods of the VFS to wait
1071
+** for up to M milliseconds before failing, where M is the single
1072
+** unsigned integer parameter.
10671073
** </ul>
10681074
*/
10691075
#define SQLITE_FCNTL_LOCKSTATE 1
10701076
#define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
10711077
#define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -1096,10 +1102,11 @@
10961102
#define SQLITE_FCNTL_WIN32_GET_HANDLE 29
10971103
#define SQLITE_FCNTL_PDB 30
10981104
#define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31
10991105
#define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32
11001106
#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33
1107
+#define SQLITE_FCNTL_LOCK_TIMEOUT 34
11011108
11021109
/* deprecated names */
11031110
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
11041111
#define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
11051112
#define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -8809,11 +8816,11 @@
88098816
88108817
/*
88118818
** CAPI3REF: Deserialize a database
88128819
**
88138820
** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the
8814
-** [database connection] D to disconnection from database S and then
8821
+** [database connection] D to disconnect from database S and then
88158822
** reopen S as an in-memory database based on the serialization contained
88168823
** in P. The serialized database P is N bytes in size. M is the size of
88178824
** the buffer P, which might be larger than N. If M is larger than N, and
88188825
** the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is
88198826
** permitted to add content to the in-memory database as long as the total
@@ -9950,23 +9957,22 @@
99509957
SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*);
99519958
99529959
/*
99539960
** CAPI3REF: Apply A Changeset To A Database
99549961
**
9955
-** Apply a changeset to a database. This function attempts to update the
9956
-** "main" database attached to handle db with the changes found in the
9957
-** changeset passed via the second and third arguments.
9962
+** Apply a changeset or patchset to a database. These functions attempt to
9963
+** update the "main" database attached to handle db with the changes found in
9964
+** the changeset passed via the second and third arguments.
99589965
**
9959
-** The fourth argument (xFilter) passed to this function is the "filter
9966
+** The fourth argument (xFilter) passed to these functions is the "filter
99609967
** callback". If it is not NULL, then for each table affected by at least one
99619968
** change in the changeset, the filter callback is invoked with
99629969
** the table name as the second argument, and a copy of the context pointer
9963
-** passed as the sixth argument to this function as the first. If the "filter
9964
-** callback" returns zero, then no attempt is made to apply any changes to
9965
-** the table. Otherwise, if the return value is non-zero or the xFilter
9966
-** argument to this function is NULL, all changes related to the table are
9967
-** attempted.
9970
+** passed as the sixth argument as the first. If the "filter callback"
9971
+** returns zero, then no attempt is made to apply any changes to the table.
9972
+** Otherwise, if the return value is non-zero or the xFilter argument to
9973
+** is NULL, all changes related to the table are attempted.
99689974
**
99699975
** For each table that is not excluded by the filter callback, this function
99709976
** tests that the target database contains a compatible table. A table is
99719977
** considered compatible if all of the following are true:
99729978
**
@@ -10007,11 +10013,11 @@
1000710013
** the documentation for the three
1000810014
** [SQLITE_CHANGESET_OMIT|available return values] for details.
1000910015
**
1001010016
** <dl>
1001110017
** <dt>DELETE Changes<dd>
10012
-** For each DELETE change, this function checks if the target database
10018
+** For each DELETE change, the function checks if the target database
1001310019
** contains a row with the same primary key value (or values) as the
1001410020
** original row values stored in the changeset. If it does, and the values
1001510021
** stored in all non-primary key columns also match the values stored in
1001610022
** the changeset the row is deleted from the target database.
1001710023
**
@@ -10052,11 +10058,11 @@
1005210058
** This includes the case where the INSERT operation is re-attempted because
1005310059
** an earlier call to the conflict handler function returned
1005410060
** [SQLITE_CHANGESET_REPLACE].
1005510061
**
1005610062
** <dt>UPDATE Changes<dd>
10057
-** For each UPDATE change, this function checks if the target database
10063
+** For each UPDATE change, the function checks if the target database
1005810064
** contains a row with the same primary key value (or values) as the
1005910065
** original row values stored in the changeset. If it does, and the values
1006010066
** stored in all modified non-primary key columns also match the values
1006110067
** stored in the changeset the row is updated within the target database.
1006210068
**
@@ -10083,15 +10089,32 @@
1008310089
** It is safe to execute SQL statements, including those that write to the
1008410090
** table that the callback related to, from within the xConflict callback.
1008510091
** This can be used to further customize the applications conflict
1008610092
** resolution strategy.
1008710093
**
10088
-** All changes made by this function are enclosed in a savepoint transaction.
10094
+** All changes made by these functions are enclosed in a savepoint transaction.
1008910095
** If any other error (aside from a constraint failure when attempting to
1009010096
** write to the target database) occurs, then the savepoint transaction is
1009110097
** rolled back, restoring the target database to its original state, and an
1009210098
** SQLite error code returned.
10099
+**
10100
+** If the output parameters (ppRebase) and (pnRebase) are non-NULL and
10101
+** the input is a changeset (not a patchset), then sqlite3changeset_apply_v2()
10102
+** may set (*ppRebase) to point to a "rebase" that may be used with the
10103
+** sqlite3_rebaser APIs buffer before returning. In this case (*pnRebase)
10104
+** is set to the size of the buffer in bytes. It is the responsibility of the
10105
+** caller to eventually free any such buffer using sqlite3_free(). The buffer
10106
+** is only allocated and populated if one or more conflicts were encountered
10107
+** while applying the patchset. See comments surrounding the sqlite3_rebaser
10108
+** APIs for further details.
10109
+**
10110
+** The behavior of sqlite3changeset_apply_v2() and its streaming equivalent
10111
+** may be modified by passing a combination of
10112
+** [SQLITE_CHANGESETAPPLY_NOSAVEPOINT | supported flags] as the 9th parameter.
10113
+**
10114
+** Note that the sqlite3changeset_apply_v2() API is still <b>experimental</b>
10115
+** and therefore subject to change.
1009310116
*/
1009410117
SQLITE_API int sqlite3changeset_apply(
1009510118
sqlite3 *db, /* Apply change to "main" db of this handle */
1009610119
int nChangeset, /* Size of changeset in bytes */
1009710120
void *pChangeset, /* Changeset blob */
@@ -10104,10 +10127,45 @@
1010410127
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
1010510128
sqlite3_changeset_iter *p /* Handle describing change and conflict */
1010610129
),
1010710130
void *pCtx /* First argument passed to xConflict */
1010810131
);
10132
+SQLITE_API int sqlite3changeset_apply_v2(
10133
+ sqlite3 *db, /* Apply change to "main" db of this handle */
10134
+ int nChangeset, /* Size of changeset in bytes */
10135
+ void *pChangeset, /* Changeset blob */
10136
+ int(*xFilter)(
10137
+ void *pCtx, /* Copy of sixth arg to _apply() */
10138
+ const char *zTab /* Table name */
10139
+ ),
10140
+ int(*xConflict)(
10141
+ void *pCtx, /* Copy of sixth arg to _apply() */
10142
+ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
10143
+ sqlite3_changeset_iter *p /* Handle describing change and conflict */
10144
+ ),
10145
+ void *pCtx, /* First argument passed to xConflict */
10146
+ void **ppRebase, int *pnRebase, /* OUT: Rebase data */
10147
+ int flags /* Combination of SESSION_APPLY_* flags */
10148
+);
10149
+
10150
+/*
10151
+** CAPI3REF: Flags for sqlite3changeset_apply_v2
10152
+**
10153
+** The following flags may passed via the 9th parameter to
10154
+** [sqlite3changeset_apply_v2] and [sqlite3changeset_apply_v2_strm]:
10155
+**
10156
+** <dl>
10157
+** <dt>SQLITE_CHANGESETAPPLY_NOSAVEPOINT <dd>
10158
+** Usually, the sessions module encloses all operations performed by
10159
+** a single call to apply_v2() or apply_v2_strm() in a [SAVEPOINT]. The
10160
+** SAVEPOINT is committed if the changeset or patchset is successfully
10161
+** applied, or rolled back if an error occurs. Specifying this flag
10162
+** causes the sessions module to omit this savepoint. In this case, if the
10163
+** caller has an open transaction or savepoint when apply_v2() is called,
10164
+** it may revert the partially applied changeset by rolling it back.
10165
+*/
10166
+#define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001
1010910167
1011010168
/*
1011110169
** CAPI3REF: Constants Passed To The Conflict Handler
1011210170
**
1011310171
** Values that may be passed as the second argument to a conflict-handler.
@@ -10201,19 +10259,175 @@
1020110259
*/
1020210260
#define SQLITE_CHANGESET_OMIT 0
1020310261
#define SQLITE_CHANGESET_REPLACE 1
1020410262
#define SQLITE_CHANGESET_ABORT 2
1020510263
10264
+/*
10265
+** CAPI3REF: Rebasing changesets
10266
+** EXPERIMENTAL
10267
+**
10268
+** Suppose there is a site hosting a database in state S0. And that
10269
+** modifications are made that move that database to state S1 and a
10270
+** changeset recorded (the "local" changeset). Then, a changeset based
10271
+** on S0 is received from another site (the "remote" changeset) and
10272
+** applied to the database. The database is then in state
10273
+** (S1+"remote"), where the exact state depends on any conflict
10274
+** resolution decisions (OMIT or REPLACE) made while applying "remote".
10275
+** Rebasing a changeset is to update it to take those conflict
10276
+** resolution decisions into account, so that the same conflicts
10277
+** do not have to be resolved elsewhere in the network.
10278
+**
10279
+** For example, if both the local and remote changesets contain an
10280
+** INSERT of the same key on "CREATE TABLE t1(a PRIMARY KEY, b)":
10281
+**
10282
+** local: INSERT INTO t1 VALUES(1, 'v1');
10283
+** remote: INSERT INTO t1 VALUES(1, 'v2');
10284
+**
10285
+** and the conflict resolution is REPLACE, then the INSERT change is
10286
+** removed from the local changeset (it was overridden). Or, if the
10287
+** conflict resolution was "OMIT", then the local changeset is modified
10288
+** to instead contain:
10289
+**
10290
+** UPDATE t1 SET b = 'v2' WHERE a=1;
10291
+**
10292
+** Changes within the local changeset are rebased as follows:
10293
+**
10294
+** <dl>
10295
+** <dt>Local INSERT<dd>
10296
+** This may only conflict with a remote INSERT. If the conflict
10297
+** resolution was OMIT, then add an UPDATE change to the rebased
10298
+** changeset. Or, if the conflict resolution was REPLACE, add
10299
+** nothing to the rebased changeset.
10300
+**
10301
+** <dt>Local DELETE<dd>
10302
+** This may conflict with a remote UPDATE or DELETE. In both cases the
10303
+** only possible resolution is OMIT. If the remote operation was a
10304
+** DELETE, then add no change to the rebased changeset. If the remote
10305
+** operation was an UPDATE, then the old.* fields of change are updated
10306
+** to reflect the new.* values in the UPDATE.
10307
+**
10308
+** <dt>Local UPDATE<dd>
10309
+** This may conflict with a remote UPDATE or DELETE. If it conflicts
10310
+** with a DELETE, and the conflict resolution was OMIT, then the update
10311
+** is changed into an INSERT. Any undefined values in the new.* record
10312
+** from the update change are filled in using the old.* values from
10313
+** the conflicting DELETE. Or, if the conflict resolution was REPLACE,
10314
+** the UPDATE change is simply omitted from the rebased changeset.
10315
+**
10316
+** If conflict is with a remote UPDATE and the resolution is OMIT, then
10317
+** the old.* values are rebased using the new.* values in the remote
10318
+** change. Or, if the resolution is REPLACE, then the change is copied
10319
+** into the rebased changeset with updates to columns also updated by
10320
+** the conflicting remote UPDATE removed. If this means no columns would
10321
+** be updated, the change is omitted.
10322
+** </dl>
10323
+**
10324
+** A local change may be rebased against multiple remote changes
10325
+** simultaneously. If a single key is modified by multiple remote
10326
+** changesets, they are combined as follows before the local changeset
10327
+** is rebased:
10328
+**
10329
+** <ul>
10330
+** <li> If there has been one or more REPLACE resolutions on a
10331
+** key, it is rebased according to a REPLACE.
10332
+**
10333
+** <li> If there have been no REPLACE resolutions on a key, then
10334
+** the local changeset is rebased according to the most recent
10335
+** of the OMIT resolutions.
10336
+** </ul>
10337
+**
10338
+** Note that conflict resolutions from multiple remote changesets are
10339
+** combined on a per-field basis, not per-row. This means that in the
10340
+** case of multiple remote UPDATE operations, some fields of a single
10341
+** local change may be rebased for REPLACE while others are rebased for
10342
+** OMIT.
10343
+**
10344
+** In order to rebase a local changeset, the remote changeset must first
10345
+** be applied to the local database using sqlite3changeset_apply_v2() and
10346
+** the buffer of rebase information captured. Then:
10347
+**
10348
+** <ol>
10349
+** <li> An sqlite3_rebaser object is created by calling
10350
+** sqlite3rebaser_create().
10351
+** <li> The new object is configured with the rebase buffer obtained from
10352
+** sqlite3changeset_apply_v2() by calling sqlite3rebaser_configure().
10353
+** If the local changeset is to be rebased against multiple remote
10354
+** changesets, then sqlite3rebaser_configure() should be called
10355
+** multiple times, in the same order that the multiple
10356
+** sqlite3changeset_apply_v2() calls were made.
10357
+** <li> Each local changeset is rebased by calling sqlite3rebaser_rebase().
10358
+** <li> The sqlite3_rebaser object is deleted by calling
10359
+** sqlite3rebaser_delete().
10360
+** </ol>
10361
+*/
10362
+typedef struct sqlite3_rebaser sqlite3_rebaser;
10363
+
10364
+/*
10365
+** CAPI3REF: Create a changeset rebaser object.
10366
+** EXPERIMENTAL
10367
+**
10368
+** Allocate a new changeset rebaser object. If successful, set (*ppNew) to
10369
+** point to the new object and return SQLITE_OK. Otherwise, if an error
10370
+** occurs, return an SQLite error code (e.g. SQLITE_NOMEM) and set (*ppNew)
10371
+** to NULL.
10372
+*/
10373
+SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew);
10374
+
10375
+/*
10376
+** CAPI3REF: Configure a changeset rebaser object.
10377
+** EXPERIMENTAL
10378
+**
10379
+** Configure the changeset rebaser object to rebase changesets according
10380
+** to the conflict resolutions described by buffer pRebase (size nRebase
10381
+** bytes), which must have been obtained from a previous call to
10382
+** sqlite3changeset_apply_v2().
10383
+*/
10384
+SQLITE_API int sqlite3rebaser_configure(
10385
+ sqlite3_rebaser*,
10386
+ int nRebase, const void *pRebase
10387
+);
10388
+
10389
+/*
10390
+** CAPI3REF: Rebase a changeset
10391
+** EXPERIMENTAL
10392
+**
10393
+** Argument pIn must point to a buffer containing a changeset nIn bytes
10394
+** in size. This function allocates and populates a buffer with a copy
10395
+** of the changeset rebased rebased according to the configuration of the
10396
+** rebaser object passed as the first argument. If successful, (*ppOut)
10397
+** is set to point to the new buffer containing the rebased changset and
10398
+** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the
10399
+** responsibility of the caller to eventually free the new buffer using
10400
+** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut)
10401
+** are set to zero and an SQLite error code returned.
10402
+*/
10403
+SQLITE_API int sqlite3rebaser_rebase(
10404
+ sqlite3_rebaser*,
10405
+ int nIn, const void *pIn,
10406
+ int *pnOut, void **ppOut
10407
+);
10408
+
10409
+/*
10410
+** CAPI3REF: Delete a changeset rebaser object.
10411
+** EXPERIMENTAL
10412
+**
10413
+** Delete the changeset rebaser object and all associated resources. There
10414
+** should be one call to this function for each successful invocation
10415
+** of sqlite3rebaser_create().
10416
+*/
10417
+SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p);
10418
+
1020610419
/*
1020710420
** CAPI3REF: Streaming Versions of API functions.
1020810421
**
1020910422
** The six streaming API xxx_strm() functions serve similar purposes to the
1021010423
** corresponding non-streaming API functions:
1021110424
**
1021210425
** <table border=1 style="margin-left:8ex;margin-right:8ex">
1021310426
** <tr><th>Streaming function<th>Non-streaming equivalent</th>
1021410427
** <tr><td>sqlite3changeset_apply_strm<td>[sqlite3changeset_apply]
10428
+** <tr><td>sqlite3changeset_apply_strm_v2<td>[sqlite3changeset_apply_v2]
1021510429
** <tr><td>sqlite3changeset_concat_strm<td>[sqlite3changeset_concat]
1021610430
** <tr><td>sqlite3changeset_invert_strm<td>[sqlite3changeset_invert]
1021710431
** <tr><td>sqlite3changeset_start_strm<td>[sqlite3changeset_start]
1021810432
** <tr><td>sqlite3session_changeset_strm<td>[sqlite3session_changeset]
1021910433
** <tr><td>sqlite3session_patchset_strm<td>[sqlite3session_patchset]
@@ -10304,10 +10518,27 @@
1030410518
void *pCtx, /* Copy of sixth arg to _apply() */
1030510519
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
1030610520
sqlite3_changeset_iter *p /* Handle describing change and conflict */
1030710521
),
1030810522
void *pCtx /* First argument passed to xConflict */
10523
+);
10524
+SQLITE_API int sqlite3changeset_apply_v2_strm(
10525
+ sqlite3 *db, /* Apply change to "main" db of this handle */
10526
+ int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
10527
+ void *pIn, /* First arg for xInput */
10528
+ int(*xFilter)(
10529
+ void *pCtx, /* Copy of sixth arg to _apply() */
10530
+ const char *zTab /* Table name */
10531
+ ),
10532
+ int(*xConflict)(
10533
+ void *pCtx, /* Copy of sixth arg to _apply() */
10534
+ int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
10535
+ sqlite3_changeset_iter *p /* Handle describing change and conflict */
10536
+ ),
10537
+ void *pCtx, /* First argument passed to xConflict */
10538
+ void **ppRebase, int *pnRebase,
10539
+ int flags
1030910540
);
1031010541
SQLITE_API int sqlite3changeset_concat_strm(
1031110542
int (*xInputA)(void *pIn, void *pData, int *pnData),
1031210543
void *pInA,
1031310544
int (*xInputB)(void *pIn, void *pData, int *pnData),
@@ -10341,10 +10572,17 @@
1034110572
void *pIn
1034210573
);
1034310574
SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup*,
1034410575
int (*xOutput)(void *pOut, const void *pData, int nData),
1034510576
void *pOut
10577
+);
10578
+SQLITE_API int sqlite3rebaser_rebase_strm(
10579
+ sqlite3_rebaser *pRebaser,
10580
+ int (*xInput)(void *pIn, void *pData, int *pnData),
10581
+ void *pIn,
10582
+ int (*xOutput)(void *pOut, const void *pData, int nData),
10583
+ void *pOut
1034610584
);
1034710585
1034810586
1034910587
/*
1035010588
** Make sure we can call this stuff from C++.
1035110589
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121 **
122 ** See also: [sqlite3_libversion()],
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.23.0"
127 #define SQLITE_VERSION_NUMBER 3023000
128 #define SQLITE_SOURCE_ID "2018-03-22 17:13:44 eb4f452e354065d610ff57a6a9312ad119b6b0cc467f9dff105f0718bc27ef01"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -1062,10 +1062,16 @@
1062 ** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back.
1063 ** ^This file control takes the file descriptor out of batch write mode
1064 ** so that all subsequent write operations are independent.
1065 ** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without
1066 ** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE].
 
 
 
 
 
 
1067 ** </ul>
1068 */
1069 #define SQLITE_FCNTL_LOCKSTATE 1
1070 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
1071 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -1096,10 +1102,11 @@
1096 #define SQLITE_FCNTL_WIN32_GET_HANDLE 29
1097 #define SQLITE_FCNTL_PDB 30
1098 #define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31
1099 #define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32
1100 #define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33
 
1101
1102 /* deprecated names */
1103 #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
1104 #define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
1105 #define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -8809,11 +8816,11 @@
8809
8810 /*
8811 ** CAPI3REF: Deserialize a database
8812 **
8813 ** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the
8814 ** [database connection] D to disconnection from database S and then
8815 ** reopen S as an in-memory database based on the serialization contained
8816 ** in P. The serialized database P is N bytes in size. M is the size of
8817 ** the buffer P, which might be larger than N. If M is larger than N, and
8818 ** the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is
8819 ** permitted to add content to the in-memory database as long as the total
@@ -9950,23 +9957,22 @@
9950 SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*);
9951
9952 /*
9953 ** CAPI3REF: Apply A Changeset To A Database
9954 **
9955 ** Apply a changeset to a database. This function attempts to update the
9956 ** "main" database attached to handle db with the changes found in the
9957 ** changeset passed via the second and third arguments.
9958 **
9959 ** The fourth argument (xFilter) passed to this function is the "filter
9960 ** callback". If it is not NULL, then for each table affected by at least one
9961 ** change in the changeset, the filter callback is invoked with
9962 ** the table name as the second argument, and a copy of the context pointer
9963 ** passed as the sixth argument to this function as the first. If the "filter
9964 ** callback" returns zero, then no attempt is made to apply any changes to
9965 ** the table. Otherwise, if the return value is non-zero or the xFilter
9966 ** argument to this function is NULL, all changes related to the table are
9967 ** attempted.
9968 **
9969 ** For each table that is not excluded by the filter callback, this function
9970 ** tests that the target database contains a compatible table. A table is
9971 ** considered compatible if all of the following are true:
9972 **
@@ -10007,11 +10013,11 @@
10007 ** the documentation for the three
10008 ** [SQLITE_CHANGESET_OMIT|available return values] for details.
10009 **
10010 ** <dl>
10011 ** <dt>DELETE Changes<dd>
10012 ** For each DELETE change, this function checks if the target database
10013 ** contains a row with the same primary key value (or values) as the
10014 ** original row values stored in the changeset. If it does, and the values
10015 ** stored in all non-primary key columns also match the values stored in
10016 ** the changeset the row is deleted from the target database.
10017 **
@@ -10052,11 +10058,11 @@
10052 ** This includes the case where the INSERT operation is re-attempted because
10053 ** an earlier call to the conflict handler function returned
10054 ** [SQLITE_CHANGESET_REPLACE].
10055 **
10056 ** <dt>UPDATE Changes<dd>
10057 ** For each UPDATE change, this function checks if the target database
10058 ** contains a row with the same primary key value (or values) as the
10059 ** original row values stored in the changeset. If it does, and the values
10060 ** stored in all modified non-primary key columns also match the values
10061 ** stored in the changeset the row is updated within the target database.
10062 **
@@ -10083,15 +10089,32 @@
10083 ** It is safe to execute SQL statements, including those that write to the
10084 ** table that the callback related to, from within the xConflict callback.
10085 ** This can be used to further customize the applications conflict
10086 ** resolution strategy.
10087 **
10088 ** All changes made by this function are enclosed in a savepoint transaction.
10089 ** If any other error (aside from a constraint failure when attempting to
10090 ** write to the target database) occurs, then the savepoint transaction is
10091 ** rolled back, restoring the target database to its original state, and an
10092 ** SQLite error code returned.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10093 */
10094 SQLITE_API int sqlite3changeset_apply(
10095 sqlite3 *db, /* Apply change to "main" db of this handle */
10096 int nChangeset, /* Size of changeset in bytes */
10097 void *pChangeset, /* Changeset blob */
@@ -10104,10 +10127,45 @@
10104 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
10105 sqlite3_changeset_iter *p /* Handle describing change and conflict */
10106 ),
10107 void *pCtx /* First argument passed to xConflict */
10108 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10109
10110 /*
10111 ** CAPI3REF: Constants Passed To The Conflict Handler
10112 **
10113 ** Values that may be passed as the second argument to a conflict-handler.
@@ -10201,19 +10259,175 @@
10201 */
10202 #define SQLITE_CHANGESET_OMIT 0
10203 #define SQLITE_CHANGESET_REPLACE 1
10204 #define SQLITE_CHANGESET_ABORT 2
10205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10206 /*
10207 ** CAPI3REF: Streaming Versions of API functions.
10208 **
10209 ** The six streaming API xxx_strm() functions serve similar purposes to the
10210 ** corresponding non-streaming API functions:
10211 **
10212 ** <table border=1 style="margin-left:8ex;margin-right:8ex">
10213 ** <tr><th>Streaming function<th>Non-streaming equivalent</th>
10214 ** <tr><td>sqlite3changeset_apply_strm<td>[sqlite3changeset_apply]
 
10215 ** <tr><td>sqlite3changeset_concat_strm<td>[sqlite3changeset_concat]
10216 ** <tr><td>sqlite3changeset_invert_strm<td>[sqlite3changeset_invert]
10217 ** <tr><td>sqlite3changeset_start_strm<td>[sqlite3changeset_start]
10218 ** <tr><td>sqlite3session_changeset_strm<td>[sqlite3session_changeset]
10219 ** <tr><td>sqlite3session_patchset_strm<td>[sqlite3session_patchset]
@@ -10304,10 +10518,27 @@
10304 void *pCtx, /* Copy of sixth arg to _apply() */
10305 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
10306 sqlite3_changeset_iter *p /* Handle describing change and conflict */
10307 ),
10308 void *pCtx /* First argument passed to xConflict */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10309 );
10310 SQLITE_API int sqlite3changeset_concat_strm(
10311 int (*xInputA)(void *pIn, void *pData, int *pnData),
10312 void *pInA,
10313 int (*xInputB)(void *pIn, void *pData, int *pnData),
@@ -10341,10 +10572,17 @@
10341 void *pIn
10342 );
10343 SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup*,
10344 int (*xOutput)(void *pOut, const void *pData, int nData),
10345 void *pOut
 
 
 
 
 
 
 
10346 );
10347
10348
10349 /*
10350 ** Make sure we can call this stuff from C++.
10351
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,13 +121,13 @@
121 **
122 ** See also: [sqlite3_libversion()],
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.23.1"
127 #define SQLITE_VERSION_NUMBER 3023001
128 #define SQLITE_SOURCE_ID "2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -1062,10 +1062,16 @@
1062 ** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back.
1063 ** ^This file control takes the file descriptor out of batch write mode
1064 ** so that all subsequent write operations are independent.
1065 ** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without
1066 ** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE].
1067 **
1068 ** <li>[[SQLITE_FCNTL_LOCK_TIMEOUT]]
1069 ** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode causes attempts to obtain
1070 ** a file lock using the xLock or xShmLock methods of the VFS to wait
1071 ** for up to M milliseconds before failing, where M is the single
1072 ** unsigned integer parameter.
1073 ** </ul>
1074 */
1075 #define SQLITE_FCNTL_LOCKSTATE 1
1076 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
1077 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -1096,10 +1102,11 @@
1102 #define SQLITE_FCNTL_WIN32_GET_HANDLE 29
1103 #define SQLITE_FCNTL_PDB 30
1104 #define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE 31
1105 #define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE 32
1106 #define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33
1107 #define SQLITE_FCNTL_LOCK_TIMEOUT 34
1108
1109 /* deprecated names */
1110 #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
1111 #define SQLITE_SET_LOCKPROXYFILE SQLITE_FCNTL_SET_LOCKPROXYFILE
1112 #define SQLITE_LAST_ERRNO SQLITE_FCNTL_LAST_ERRNO
@@ -8809,11 +8816,11 @@
8816
8817 /*
8818 ** CAPI3REF: Deserialize a database
8819 **
8820 ** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the
8821 ** [database connection] D to disconnect from database S and then
8822 ** reopen S as an in-memory database based on the serialization contained
8823 ** in P. The serialized database P is N bytes in size. M is the size of
8824 ** the buffer P, which might be larger than N. If M is larger than N, and
8825 ** the SQLITE_DESERIALIZE_READONLY bit is not set in F, then SQLite is
8826 ** permitted to add content to the in-memory database as long as the total
@@ -9950,23 +9957,22 @@
9957 SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*);
9958
9959 /*
9960 ** CAPI3REF: Apply A Changeset To A Database
9961 **
9962 ** Apply a changeset or patchset to a database. These functions attempt to
9963 ** update the "main" database attached to handle db with the changes found in
9964 ** the changeset passed via the second and third arguments.
9965 **
9966 ** The fourth argument (xFilter) passed to these functions is the "filter
9967 ** callback". If it is not NULL, then for each table affected by at least one
9968 ** change in the changeset, the filter callback is invoked with
9969 ** the table name as the second argument, and a copy of the context pointer
9970 ** passed as the sixth argument as the first. If the "filter callback"
9971 ** returns zero, then no attempt is made to apply any changes to the table.
9972 ** Otherwise, if the return value is non-zero or the xFilter argument to
9973 ** is NULL, all changes related to the table are attempted.
 
9974 **
9975 ** For each table that is not excluded by the filter callback, this function
9976 ** tests that the target database contains a compatible table. A table is
9977 ** considered compatible if all of the following are true:
9978 **
@@ -10007,11 +10013,11 @@
10013 ** the documentation for the three
10014 ** [SQLITE_CHANGESET_OMIT|available return values] for details.
10015 **
10016 ** <dl>
10017 ** <dt>DELETE Changes<dd>
10018 ** For each DELETE change, the function checks if the target database
10019 ** contains a row with the same primary key value (or values) as the
10020 ** original row values stored in the changeset. If it does, and the values
10021 ** stored in all non-primary key columns also match the values stored in
10022 ** the changeset the row is deleted from the target database.
10023 **
@@ -10052,11 +10058,11 @@
10058 ** This includes the case where the INSERT operation is re-attempted because
10059 ** an earlier call to the conflict handler function returned
10060 ** [SQLITE_CHANGESET_REPLACE].
10061 **
10062 ** <dt>UPDATE Changes<dd>
10063 ** For each UPDATE change, the function checks if the target database
10064 ** contains a row with the same primary key value (or values) as the
10065 ** original row values stored in the changeset. If it does, and the values
10066 ** stored in all modified non-primary key columns also match the values
10067 ** stored in the changeset the row is updated within the target database.
10068 **
@@ -10083,15 +10089,32 @@
10089 ** It is safe to execute SQL statements, including those that write to the
10090 ** table that the callback related to, from within the xConflict callback.
10091 ** This can be used to further customize the applications conflict
10092 ** resolution strategy.
10093 **
10094 ** All changes made by these functions are enclosed in a savepoint transaction.
10095 ** If any other error (aside from a constraint failure when attempting to
10096 ** write to the target database) occurs, then the savepoint transaction is
10097 ** rolled back, restoring the target database to its original state, and an
10098 ** SQLite error code returned.
10099 **
10100 ** If the output parameters (ppRebase) and (pnRebase) are non-NULL and
10101 ** the input is a changeset (not a patchset), then sqlite3changeset_apply_v2()
10102 ** may set (*ppRebase) to point to a "rebase" that may be used with the
10103 ** sqlite3_rebaser APIs buffer before returning. In this case (*pnRebase)
10104 ** is set to the size of the buffer in bytes. It is the responsibility of the
10105 ** caller to eventually free any such buffer using sqlite3_free(). The buffer
10106 ** is only allocated and populated if one or more conflicts were encountered
10107 ** while applying the patchset. See comments surrounding the sqlite3_rebaser
10108 ** APIs for further details.
10109 **
10110 ** The behavior of sqlite3changeset_apply_v2() and its streaming equivalent
10111 ** may be modified by passing a combination of
10112 ** [SQLITE_CHANGESETAPPLY_NOSAVEPOINT | supported flags] as the 9th parameter.
10113 **
10114 ** Note that the sqlite3changeset_apply_v2() API is still <b>experimental</b>
10115 ** and therefore subject to change.
10116 */
10117 SQLITE_API int sqlite3changeset_apply(
10118 sqlite3 *db, /* Apply change to "main" db of this handle */
10119 int nChangeset, /* Size of changeset in bytes */
10120 void *pChangeset, /* Changeset blob */
@@ -10104,10 +10127,45 @@
10127 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
10128 sqlite3_changeset_iter *p /* Handle describing change and conflict */
10129 ),
10130 void *pCtx /* First argument passed to xConflict */
10131 );
10132 SQLITE_API int sqlite3changeset_apply_v2(
10133 sqlite3 *db, /* Apply change to "main" db of this handle */
10134 int nChangeset, /* Size of changeset in bytes */
10135 void *pChangeset, /* Changeset blob */
10136 int(*xFilter)(
10137 void *pCtx, /* Copy of sixth arg to _apply() */
10138 const char *zTab /* Table name */
10139 ),
10140 int(*xConflict)(
10141 void *pCtx, /* Copy of sixth arg to _apply() */
10142 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
10143 sqlite3_changeset_iter *p /* Handle describing change and conflict */
10144 ),
10145 void *pCtx, /* First argument passed to xConflict */
10146 void **ppRebase, int *pnRebase, /* OUT: Rebase data */
10147 int flags /* Combination of SESSION_APPLY_* flags */
10148 );
10149
10150 /*
10151 ** CAPI3REF: Flags for sqlite3changeset_apply_v2
10152 **
10153 ** The following flags may passed via the 9th parameter to
10154 ** [sqlite3changeset_apply_v2] and [sqlite3changeset_apply_v2_strm]:
10155 **
10156 ** <dl>
10157 ** <dt>SQLITE_CHANGESETAPPLY_NOSAVEPOINT <dd>
10158 ** Usually, the sessions module encloses all operations performed by
10159 ** a single call to apply_v2() or apply_v2_strm() in a [SAVEPOINT]. The
10160 ** SAVEPOINT is committed if the changeset or patchset is successfully
10161 ** applied, or rolled back if an error occurs. Specifying this flag
10162 ** causes the sessions module to omit this savepoint. In this case, if the
10163 ** caller has an open transaction or savepoint when apply_v2() is called,
10164 ** it may revert the partially applied changeset by rolling it back.
10165 */
10166 #define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001
10167
10168 /*
10169 ** CAPI3REF: Constants Passed To The Conflict Handler
10170 **
10171 ** Values that may be passed as the second argument to a conflict-handler.
@@ -10201,19 +10259,175 @@
10259 */
10260 #define SQLITE_CHANGESET_OMIT 0
10261 #define SQLITE_CHANGESET_REPLACE 1
10262 #define SQLITE_CHANGESET_ABORT 2
10263
10264 /*
10265 ** CAPI3REF: Rebasing changesets
10266 ** EXPERIMENTAL
10267 **
10268 ** Suppose there is a site hosting a database in state S0. And that
10269 ** modifications are made that move that database to state S1 and a
10270 ** changeset recorded (the "local" changeset). Then, a changeset based
10271 ** on S0 is received from another site (the "remote" changeset) and
10272 ** applied to the database. The database is then in state
10273 ** (S1+"remote"), where the exact state depends on any conflict
10274 ** resolution decisions (OMIT or REPLACE) made while applying "remote".
10275 ** Rebasing a changeset is to update it to take those conflict
10276 ** resolution decisions into account, so that the same conflicts
10277 ** do not have to be resolved elsewhere in the network.
10278 **
10279 ** For example, if both the local and remote changesets contain an
10280 ** INSERT of the same key on "CREATE TABLE t1(a PRIMARY KEY, b)":
10281 **
10282 ** local: INSERT INTO t1 VALUES(1, 'v1');
10283 ** remote: INSERT INTO t1 VALUES(1, 'v2');
10284 **
10285 ** and the conflict resolution is REPLACE, then the INSERT change is
10286 ** removed from the local changeset (it was overridden). Or, if the
10287 ** conflict resolution was "OMIT", then the local changeset is modified
10288 ** to instead contain:
10289 **
10290 ** UPDATE t1 SET b = 'v2' WHERE a=1;
10291 **
10292 ** Changes within the local changeset are rebased as follows:
10293 **
10294 ** <dl>
10295 ** <dt>Local INSERT<dd>
10296 ** This may only conflict with a remote INSERT. If the conflict
10297 ** resolution was OMIT, then add an UPDATE change to the rebased
10298 ** changeset. Or, if the conflict resolution was REPLACE, add
10299 ** nothing to the rebased changeset.
10300 **
10301 ** <dt>Local DELETE<dd>
10302 ** This may conflict with a remote UPDATE or DELETE. In both cases the
10303 ** only possible resolution is OMIT. If the remote operation was a
10304 ** DELETE, then add no change to the rebased changeset. If the remote
10305 ** operation was an UPDATE, then the old.* fields of change are updated
10306 ** to reflect the new.* values in the UPDATE.
10307 **
10308 ** <dt>Local UPDATE<dd>
10309 ** This may conflict with a remote UPDATE or DELETE. If it conflicts
10310 ** with a DELETE, and the conflict resolution was OMIT, then the update
10311 ** is changed into an INSERT. Any undefined values in the new.* record
10312 ** from the update change are filled in using the old.* values from
10313 ** the conflicting DELETE. Or, if the conflict resolution was REPLACE,
10314 ** the UPDATE change is simply omitted from the rebased changeset.
10315 **
10316 ** If conflict is with a remote UPDATE and the resolution is OMIT, then
10317 ** the old.* values are rebased using the new.* values in the remote
10318 ** change. Or, if the resolution is REPLACE, then the change is copied
10319 ** into the rebased changeset with updates to columns also updated by
10320 ** the conflicting remote UPDATE removed. If this means no columns would
10321 ** be updated, the change is omitted.
10322 ** </dl>
10323 **
10324 ** A local change may be rebased against multiple remote changes
10325 ** simultaneously. If a single key is modified by multiple remote
10326 ** changesets, they are combined as follows before the local changeset
10327 ** is rebased:
10328 **
10329 ** <ul>
10330 ** <li> If there has been one or more REPLACE resolutions on a
10331 ** key, it is rebased according to a REPLACE.
10332 **
10333 ** <li> If there have been no REPLACE resolutions on a key, then
10334 ** the local changeset is rebased according to the most recent
10335 ** of the OMIT resolutions.
10336 ** </ul>
10337 **
10338 ** Note that conflict resolutions from multiple remote changesets are
10339 ** combined on a per-field basis, not per-row. This means that in the
10340 ** case of multiple remote UPDATE operations, some fields of a single
10341 ** local change may be rebased for REPLACE while others are rebased for
10342 ** OMIT.
10343 **
10344 ** In order to rebase a local changeset, the remote changeset must first
10345 ** be applied to the local database using sqlite3changeset_apply_v2() and
10346 ** the buffer of rebase information captured. Then:
10347 **
10348 ** <ol>
10349 ** <li> An sqlite3_rebaser object is created by calling
10350 ** sqlite3rebaser_create().
10351 ** <li> The new object is configured with the rebase buffer obtained from
10352 ** sqlite3changeset_apply_v2() by calling sqlite3rebaser_configure().
10353 ** If the local changeset is to be rebased against multiple remote
10354 ** changesets, then sqlite3rebaser_configure() should be called
10355 ** multiple times, in the same order that the multiple
10356 ** sqlite3changeset_apply_v2() calls were made.
10357 ** <li> Each local changeset is rebased by calling sqlite3rebaser_rebase().
10358 ** <li> The sqlite3_rebaser object is deleted by calling
10359 ** sqlite3rebaser_delete().
10360 ** </ol>
10361 */
10362 typedef struct sqlite3_rebaser sqlite3_rebaser;
10363
10364 /*
10365 ** CAPI3REF: Create a changeset rebaser object.
10366 ** EXPERIMENTAL
10367 **
10368 ** Allocate a new changeset rebaser object. If successful, set (*ppNew) to
10369 ** point to the new object and return SQLITE_OK. Otherwise, if an error
10370 ** occurs, return an SQLite error code (e.g. SQLITE_NOMEM) and set (*ppNew)
10371 ** to NULL.
10372 */
10373 SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew);
10374
10375 /*
10376 ** CAPI3REF: Configure a changeset rebaser object.
10377 ** EXPERIMENTAL
10378 **
10379 ** Configure the changeset rebaser object to rebase changesets according
10380 ** to the conflict resolutions described by buffer pRebase (size nRebase
10381 ** bytes), which must have been obtained from a previous call to
10382 ** sqlite3changeset_apply_v2().
10383 */
10384 SQLITE_API int sqlite3rebaser_configure(
10385 sqlite3_rebaser*,
10386 int nRebase, const void *pRebase
10387 );
10388
10389 /*
10390 ** CAPI3REF: Rebase a changeset
10391 ** EXPERIMENTAL
10392 **
10393 ** Argument pIn must point to a buffer containing a changeset nIn bytes
10394 ** in size. This function allocates and populates a buffer with a copy
10395 ** of the changeset rebased rebased according to the configuration of the
10396 ** rebaser object passed as the first argument. If successful, (*ppOut)
10397 ** is set to point to the new buffer containing the rebased changset and
10398 ** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the
10399 ** responsibility of the caller to eventually free the new buffer using
10400 ** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut)
10401 ** are set to zero and an SQLite error code returned.
10402 */
10403 SQLITE_API int sqlite3rebaser_rebase(
10404 sqlite3_rebaser*,
10405 int nIn, const void *pIn,
10406 int *pnOut, void **ppOut
10407 );
10408
10409 /*
10410 ** CAPI3REF: Delete a changeset rebaser object.
10411 ** EXPERIMENTAL
10412 **
10413 ** Delete the changeset rebaser object and all associated resources. There
10414 ** should be one call to this function for each successful invocation
10415 ** of sqlite3rebaser_create().
10416 */
10417 SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p);
10418
10419 /*
10420 ** CAPI3REF: Streaming Versions of API functions.
10421 **
10422 ** The six streaming API xxx_strm() functions serve similar purposes to the
10423 ** corresponding non-streaming API functions:
10424 **
10425 ** <table border=1 style="margin-left:8ex;margin-right:8ex">
10426 ** <tr><th>Streaming function<th>Non-streaming equivalent</th>
10427 ** <tr><td>sqlite3changeset_apply_strm<td>[sqlite3changeset_apply]
10428 ** <tr><td>sqlite3changeset_apply_strm_v2<td>[sqlite3changeset_apply_v2]
10429 ** <tr><td>sqlite3changeset_concat_strm<td>[sqlite3changeset_concat]
10430 ** <tr><td>sqlite3changeset_invert_strm<td>[sqlite3changeset_invert]
10431 ** <tr><td>sqlite3changeset_start_strm<td>[sqlite3changeset_start]
10432 ** <tr><td>sqlite3session_changeset_strm<td>[sqlite3session_changeset]
10433 ** <tr><td>sqlite3session_patchset_strm<td>[sqlite3session_patchset]
@@ -10304,10 +10518,27 @@
10518 void *pCtx, /* Copy of sixth arg to _apply() */
10519 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
10520 sqlite3_changeset_iter *p /* Handle describing change and conflict */
10521 ),
10522 void *pCtx /* First argument passed to xConflict */
10523 );
10524 SQLITE_API int sqlite3changeset_apply_v2_strm(
10525 sqlite3 *db, /* Apply change to "main" db of this handle */
10526 int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
10527 void *pIn, /* First arg for xInput */
10528 int(*xFilter)(
10529 void *pCtx, /* Copy of sixth arg to _apply() */
10530 const char *zTab /* Table name */
10531 ),
10532 int(*xConflict)(
10533 void *pCtx, /* Copy of sixth arg to _apply() */
10534 int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
10535 sqlite3_changeset_iter *p /* Handle describing change and conflict */
10536 ),
10537 void *pCtx, /* First argument passed to xConflict */
10538 void **ppRebase, int *pnRebase,
10539 int flags
10540 );
10541 SQLITE_API int sqlite3changeset_concat_strm(
10542 int (*xInputA)(void *pIn, void *pData, int *pnData),
10543 void *pInA,
10544 int (*xInputB)(void *pIn, void *pData, int *pnData),
@@ -10341,10 +10572,17 @@
10572 void *pIn
10573 );
10574 SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup*,
10575 int (*xOutput)(void *pOut, const void *pData, int nData),
10576 void *pOut
10577 );
10578 SQLITE_API int sqlite3rebaser_rebase_strm(
10579 sqlite3_rebaser *pRebaser,
10580 int (*xInput)(void *pIn, void *pData, int *pnData),
10581 void *pIn,
10582 int (*xOutput)(void *pOut, const void *pData, int nData),
10583 void *pOut
10584 );
10585
10586
10587 /*
10588 ** Make sure we can call this stuff from C++.
10589
+45 -4
--- src/tar.c
+++ src/tar.c
@@ -646,18 +646,55 @@
646646
glob_free(pInclude);
647647
glob_free(pExclude);
648648
blob_write_to_file(&tarball, g.argv[3]);
649649
blob_reset(&tarball);
650650
}
651
+
652
+/*
653
+** Check to see if the input string is of the form:
654
+**
655
+** checkin-name/filename.ext
656
+**
657
+** In other words, check to see if the input contains a single '/'
658
+** character that separates a valid check-in name from a filename.
659
+**
660
+** If the condition is true, return the check-in name and set the
661
+** input string to be the filename.
662
+**
663
+** If the condition is false, return NULL
664
+*/
665
+char *tar_uuid_from_name(char **pzName){
666
+ char *zName = *pzName;
667
+ int i, n;
668
+ for(i=n=0; zName[i]; i++){
669
+ if( zName[i]=='/' ){
670
+ if( n==0 ) n = i;
671
+ else return 0;
672
+ }
673
+ }
674
+ if( n==0 ) return 0;
675
+ if( zName[n+1]==0 ) return 0;
676
+ zName[n] = 0;
677
+ *pzName = fossil_strdup(&zName[n+1]);
678
+ return zName;
679
+}
651680
652681
/*
653682
** WEBPAGE: tarball
654683
** URL: /tarball
655684
**
656685
** Generate a compressed tarball for the check-in specified by the "r"
657686
** query parameter. Return that compressed tarball as the HTTP reply
658687
** content.
688
+**
689
+** The r= and name= query parameters can be specified as extensions to the
690
+** URI. Example, the following URIs are all equivalent:
691
+**
692
+** /tarball/release/xyz.tar.gz
693
+** /tarball?r=release&name=xyz.tar.gz
694
+** /tarball/xyz.tar.gz?r=release
695
+** /tarball?name=release/xyz.tar.gz
659696
**
660697
** Query parameters:
661698
**
662699
** name=NAME[.tar.gz] The base name of the output file. The default
663700
** value is a configuration parameter in the project
@@ -665,12 +702,15 @@
665702
** extension, is used as the top-most directory name.
666703
**
667704
** r=TAG The check-in that is turned into a compressed tarball.
668705
** Defaults to "trunk". This query parameter used to
669706
** be called "uuid" and "uuid" is still accepted for
670
-** backwards compatibility. If omitted, the default
671
-** check-in name is "trunk".
707
+** backwards compatibility. If the name= query parameter
708
+** contains one "/" character then the part before the /
709
+** is the TAG and the part after the / is the true name.
710
+** If no TAG is specified by any of the above means, then
711
+** "trunk" is used as the default.
672712
**
673713
** in=PATTERN Only include files that match the comma-separate
674714
** list of GLOB patterns in PATTERN, as with ex=
675715
**
676716
** ex=PATTERN Omit any file that match PATTERN. PATTERN is a
@@ -691,21 +731,22 @@
691731
const char *z;
692732
693733
login_check_credentials();
694734
if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; }
695735
load_control();
696
- zName = mprintf("%s", PD("name",""));
697
- nName = strlen(zName);
736
+ zName = fossil_strdup(PD("name",""));
698737
z = P("r");
699738
if( z==0 ) z = P("uuid");
739
+ if( z==0 ) z = tar_uuid_from_name(&zName);
700740
if( z==0 ) z = "trunk";
701741
g.zOpenRevision = zRid = fossil_strdup(z);
702742
nRid = strlen(zRid);
703743
zInclude = P("in");
704744
if( zInclude ) pInclude = glob_create(zInclude);
705745
zExclude = P("ex");
706746
if( zExclude ) pExclude = glob_create(zExclude);
747
+ nName = strlen(zName);
707748
if( nName>7 && fossil_strcmp(&zName[nName-7], ".tar.gz")==0 ){
708749
/* Special case: Remove the ".tar.gz" suffix. */
709750
nName -= 7;
710751
zName[nName] = 0;
711752
}else{
712753
--- src/tar.c
+++ src/tar.c
@@ -646,18 +646,55 @@
646 glob_free(pInclude);
647 glob_free(pExclude);
648 blob_write_to_file(&tarball, g.argv[3]);
649 blob_reset(&tarball);
650 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
651
652 /*
653 ** WEBPAGE: tarball
654 ** URL: /tarball
655 **
656 ** Generate a compressed tarball for the check-in specified by the "r"
657 ** query parameter. Return that compressed tarball as the HTTP reply
658 ** content.
 
 
 
 
 
 
 
 
659 **
660 ** Query parameters:
661 **
662 ** name=NAME[.tar.gz] The base name of the output file. The default
663 ** value is a configuration parameter in the project
@@ -665,12 +702,15 @@
665 ** extension, is used as the top-most directory name.
666 **
667 ** r=TAG The check-in that is turned into a compressed tarball.
668 ** Defaults to "trunk". This query parameter used to
669 ** be called "uuid" and "uuid" is still accepted for
670 ** backwards compatibility. If omitted, the default
671 ** check-in name is "trunk".
 
 
 
672 **
673 ** in=PATTERN Only include files that match the comma-separate
674 ** list of GLOB patterns in PATTERN, as with ex=
675 **
676 ** ex=PATTERN Omit any file that match PATTERN. PATTERN is a
@@ -691,21 +731,22 @@
691 const char *z;
692
693 login_check_credentials();
694 if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; }
695 load_control();
696 zName = mprintf("%s", PD("name",""));
697 nName = strlen(zName);
698 z = P("r");
699 if( z==0 ) z = P("uuid");
 
700 if( z==0 ) z = "trunk";
701 g.zOpenRevision = zRid = fossil_strdup(z);
702 nRid = strlen(zRid);
703 zInclude = P("in");
704 if( zInclude ) pInclude = glob_create(zInclude);
705 zExclude = P("ex");
706 if( zExclude ) pExclude = glob_create(zExclude);
 
707 if( nName>7 && fossil_strcmp(&zName[nName-7], ".tar.gz")==0 ){
708 /* Special case: Remove the ".tar.gz" suffix. */
709 nName -= 7;
710 zName[nName] = 0;
711 }else{
712
--- src/tar.c
+++ src/tar.c
@@ -646,18 +646,55 @@
646 glob_free(pInclude);
647 glob_free(pExclude);
648 blob_write_to_file(&tarball, g.argv[3]);
649 blob_reset(&tarball);
650 }
651
652 /*
653 ** Check to see if the input string is of the form:
654 **
655 ** checkin-name/filename.ext
656 **
657 ** In other words, check to see if the input contains a single '/'
658 ** character that separates a valid check-in name from a filename.
659 **
660 ** If the condition is true, return the check-in name and set the
661 ** input string to be the filename.
662 **
663 ** If the condition is false, return NULL
664 */
665 char *tar_uuid_from_name(char **pzName){
666 char *zName = *pzName;
667 int i, n;
668 for(i=n=0; zName[i]; i++){
669 if( zName[i]=='/' ){
670 if( n==0 ) n = i;
671 else return 0;
672 }
673 }
674 if( n==0 ) return 0;
675 if( zName[n+1]==0 ) return 0;
676 zName[n] = 0;
677 *pzName = fossil_strdup(&zName[n+1]);
678 return zName;
679 }
680
681 /*
682 ** WEBPAGE: tarball
683 ** URL: /tarball
684 **
685 ** Generate a compressed tarball for the check-in specified by the "r"
686 ** query parameter. Return that compressed tarball as the HTTP reply
687 ** content.
688 **
689 ** The r= and name= query parameters can be specified as extensions to the
690 ** URI. Example, the following URIs are all equivalent:
691 **
692 ** /tarball/release/xyz.tar.gz
693 ** /tarball?r=release&name=xyz.tar.gz
694 ** /tarball/xyz.tar.gz?r=release
695 ** /tarball?name=release/xyz.tar.gz
696 **
697 ** Query parameters:
698 **
699 ** name=NAME[.tar.gz] The base name of the output file. The default
700 ** value is a configuration parameter in the project
@@ -665,12 +702,15 @@
702 ** extension, is used as the top-most directory name.
703 **
704 ** r=TAG The check-in that is turned into a compressed tarball.
705 ** Defaults to "trunk". This query parameter used to
706 ** be called "uuid" and "uuid" is still accepted for
707 ** backwards compatibility. If the name= query parameter
708 ** contains one "/" character then the part before the /
709 ** is the TAG and the part after the / is the true name.
710 ** If no TAG is specified by any of the above means, then
711 ** "trunk" is used as the default.
712 **
713 ** in=PATTERN Only include files that match the comma-separate
714 ** list of GLOB patterns in PATTERN, as with ex=
715 **
716 ** ex=PATTERN Omit any file that match PATTERN. PATTERN is a
@@ -691,21 +731,22 @@
731 const char *z;
732
733 login_check_credentials();
734 if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; }
735 load_control();
736 zName = fossil_strdup(PD("name",""));
 
737 z = P("r");
738 if( z==0 ) z = P("uuid");
739 if( z==0 ) z = tar_uuid_from_name(&zName);
740 if( z==0 ) z = "trunk";
741 g.zOpenRevision = zRid = fossil_strdup(z);
742 nRid = strlen(zRid);
743 zInclude = P("in");
744 if( zInclude ) pInclude = glob_create(zInclude);
745 zExclude = P("ex");
746 if( zExclude ) pExclude = glob_create(zExclude);
747 nName = strlen(zName);
748 if( nName>7 && fossil_strcmp(&zName[nName-7], ".tar.gz")==0 ){
749 /* Special case: Remove the ".tar.gz" suffix. */
750 nName -= 7;
751 zName[nName] = 0;
752 }else{
753
+11 -1
--- src/zip.c
+++ src/zip.c
@@ -836,10 +836,19 @@
836836
** WEBPAGE: zip
837837
**
838838
** Generate a ZIP or SQL archive for the check-in specified by the "r"
839839
** query parameter. Return the archive as the HTTP reply content.
840840
**
841
+** If the NAME contains one "/" then the part before the "/" is taken
842
+** as the TAG and the part after the "/" becomes the true name. Hence,
843
+** the following URLs are all equivalent:
844
+**
845
+** /sqlar/508c42a6398f8/download.sqlar
846
+** /sqlar?r=508c42a6398f8&name=download.sqlar
847
+** /sqlar/download.sqlar?r=508c42a6398f8
848
+** /sqlar?name=508c42a6398f8/download.sqlar
849
+**
841850
** Query parameters:
842851
**
843852
** name=NAME The base name of the output file. The default
844853
** value is a configuration parameter in the project
845854
** settings. A prefix of the name, omitting the
@@ -883,14 +892,15 @@
883892
eType = ARCHIVE_ZIP;
884893
zType = "ZIP";
885894
}
886895
load_control();
887896
zName = mprintf("%s", PD("name",""));
888
- nName = strlen(zName);
889897
z = P("r");
890898
if( z==0 ) z = P("uuid");
899
+ if( z==0 ) z = tar_uuid_from_name(&zName);
891900
if( z==0 ) z = "trunk";
901
+ nName = strlen(zName);
892902
g.zOpenRevision = zRid = fossil_strdup(z);
893903
nRid = strlen(zRid);
894904
zInclude = P("in");
895905
if( zInclude ) pInclude = glob_create(zInclude);
896906
zExclude = P("ex");
897907
--- src/zip.c
+++ src/zip.c
@@ -836,10 +836,19 @@
836 ** WEBPAGE: zip
837 **
838 ** Generate a ZIP or SQL archive for the check-in specified by the "r"
839 ** query parameter. Return the archive as the HTTP reply content.
840 **
 
 
 
 
 
 
 
 
 
841 ** Query parameters:
842 **
843 ** name=NAME The base name of the output file. The default
844 ** value is a configuration parameter in the project
845 ** settings. A prefix of the name, omitting the
@@ -883,14 +892,15 @@
883 eType = ARCHIVE_ZIP;
884 zType = "ZIP";
885 }
886 load_control();
887 zName = mprintf("%s", PD("name",""));
888 nName = strlen(zName);
889 z = P("r");
890 if( z==0 ) z = P("uuid");
 
891 if( z==0 ) z = "trunk";
 
892 g.zOpenRevision = zRid = fossil_strdup(z);
893 nRid = strlen(zRid);
894 zInclude = P("in");
895 if( zInclude ) pInclude = glob_create(zInclude);
896 zExclude = P("ex");
897
--- src/zip.c
+++ src/zip.c
@@ -836,10 +836,19 @@
836 ** WEBPAGE: zip
837 **
838 ** Generate a ZIP or SQL archive for the check-in specified by the "r"
839 ** query parameter. Return the archive as the HTTP reply content.
840 **
841 ** If the NAME contains one "/" then the part before the "/" is taken
842 ** as the TAG and the part after the "/" becomes the true name. Hence,
843 ** the following URLs are all equivalent:
844 **
845 ** /sqlar/508c42a6398f8/download.sqlar
846 ** /sqlar?r=508c42a6398f8&name=download.sqlar
847 ** /sqlar/download.sqlar?r=508c42a6398f8
848 ** /sqlar?name=508c42a6398f8/download.sqlar
849 **
850 ** Query parameters:
851 **
852 ** name=NAME The base name of the output file. The default
853 ** value is a configuration parameter in the project
854 ** settings. A prefix of the name, omitting the
@@ -883,14 +892,15 @@
892 eType = ARCHIVE_ZIP;
893 zType = "ZIP";
894 }
895 load_control();
896 zName = mprintf("%s", PD("name",""));
 
897 z = P("r");
898 if( z==0 ) z = P("uuid");
899 if( z==0 ) z = tar_uuid_from_name(&zName);
900 if( z==0 ) z = "trunk";
901 nName = strlen(zName);
902 g.zOpenRevision = zRid = fossil_strdup(z);
903 nRid = strlen(zRid);
904 zInclude = P("in");
905 if( zInclude ) pInclude = glob_create(zInclude);
906 zExclude = P("ex");
907
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -83,17 +83,17 @@
8383
8484
# define the SQLite files, which need special flags on compile
8585
SQLITESRC=sqlite3.c
8686
ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf))
8787
SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj))
88
-SQLITEDEFINES=-DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_USE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_WIN32_NO_ANSI
88
+SQLITEDEFINES=-DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_WIN32_NO_ANSI
8989
9090
# define the SQLite shell files, which need special flags on compile
9191
SQLITESHELLSRC=shell.c
9292
ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf))
9393
SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj))
94
-SQLITESHELLDEFINES=-DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_USE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
94
+SQLITESHELLDEFINES=-DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
9595
9696
# define the th scripting files, which need special flags on compile
9797
THSRC=th.c th_lang.c
9898
ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf))
9999
THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100100
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -83,17 +83,17 @@
83
84 # define the SQLite files, which need special flags on compile
85 SQLITESRC=sqlite3.c
86 ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf))
87 SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj))
88 SQLITEDEFINES=-DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_USE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_WIN32_NO_ANSI
89
90 # define the SQLite shell files, which need special flags on compile
91 SQLITESHELLSRC=shell.c
92 ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf))
93 SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj))
94 SQLITESHELLDEFINES=-DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_USE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
95
96 # define the th scripting files, which need special flags on compile
97 THSRC=th.c th_lang.c
98 ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf))
99 THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -83,17 +83,17 @@
83
84 # define the SQLite files, which need special flags on compile
85 SQLITESRC=sqlite3.c
86 ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf))
87 SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj))
88 SQLITEDEFINES=-DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_WIN32_NO_ANSI
89
90 # define the SQLite shell files, which need special flags on compile
91 SQLITESHELLSRC=shell.c
92 ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf))
93 SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj))
94 SQLITESHELLDEFINES=-DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
95
96 # define the th scripting files, which need special flags on compile
97 THSRC=th.c th_lang.c
98 ORIGTHSRC=$(foreach sf,$(THSRC),$(SRCDIR)$(sf))
99 THOBJ=$(foreach sf,$(THSRC),$(sf:.c=.obj))
100
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -24,13 +24,13 @@
2424
CFLAGS = -o
2525
BCC = $(DMDIR)\bin\dmc $(CFLAGS)
2626
TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
2727
LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32
2828
29
-SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_USE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB
29
+SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB
3030
31
-SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_USE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
31
+SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
3232
3333
SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c file_.c finfo_.c foci_.c fshell_.c fusefs_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
3434
3535
OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
3636
3737
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -24,13 +24,13 @@
24 CFLAGS = -o
25 BCC = $(DMDIR)\bin\dmc $(CFLAGS)
26 TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
27 LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32
28
29 SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_USE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB
30
31 SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_USE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c file_.c finfo_.c foci_.c fshell_.c fusefs_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -24,13 +24,13 @@
24 CFLAGS = -o
25 BCC = $(DMDIR)\bin\dmc $(CFLAGS)
26 TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
27 LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32
28
29 SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB
30
31 SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_USE_ALLOCA -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_INTROSPECTION_PRAGMAS -DSQLITE_ENABLE_DBPAGE_VTAB -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
32
33 SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c file_.c finfo_.c foci_.c fshell_.c fusefs_.c glob_.c graph_.c gzip_.c hname_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c piechart_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c security_audit_.c setup_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
34
35 OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
36
37
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -174,11 +174,11 @@
174174
#### The directories where the OpenSSL include and library files are located.
175175
# The recommended usage here is to use the Sysinternals junction tool
176176
# to create a hard link between an "openssl-1.x" sub-directory of the
177177
# Fossil source code directory and the target OpenSSL source directory.
178178
#
179
-OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
179
+OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
180180
OPENSSLINCDIR = $(OPENSSLDIR)/include
181181
OPENSSLLIBDIR = $(OPENSSLDIR)
182182
183183
#### Either the directory where the Tcl library is installed or the Tcl
184184
# source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
22972297
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
22982298
-DSQLITE_ENABLE_DBSTAT_VTAB \
22992299
-DSQLITE_ENABLE_JSON1 \
23002300
-DSQLITE_ENABLE_FTS5 \
23012301
-DSQLITE_ENABLE_STMTVTAB \
2302
- -DSQLITE_USE_ZLIB \
2302
+ -DSQLITE_HAVE_ZLIB \
23032303
-DSQLITE_INTROSPECTION_PRAGMAS \
23042304
-DSQLITE_ENABLE_DBPAGE_VTAB \
23052305
-DSQLITE_WIN32_NO_ANSI \
23062306
$(MINGW_OPTIONS) \
23072307
-DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
23272327
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
23282328
-DSQLITE_ENABLE_DBSTAT_VTAB \
23292329
-DSQLITE_ENABLE_JSON1 \
23302330
-DSQLITE_ENABLE_FTS5 \
23312331
-DSQLITE_ENABLE_STMTVTAB \
2332
- -DSQLITE_USE_ZLIB \
2332
+ -DSQLITE_HAVE_ZLIB \
23332333
-DSQLITE_INTROSPECTION_PRAGMAS \
23342334
-DSQLITE_ENABLE_DBPAGE_VTAB \
23352335
-Dmain=sqlite3_shell \
23362336
-DSQLITE_SHELL_IS_UTF8=1 \
23372337
-DSQLITE_OMIT_LOAD_EXTENSION=1 \
23382338
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -174,11 +174,11 @@
174 #### The directories where the OpenSSL include and library files are located.
175 # The recommended usage here is to use the Sysinternals junction tool
176 # to create a hard link between an "openssl-1.x" sub-directory of the
177 # Fossil source code directory and the target OpenSSL source directory.
178 #
179 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
180 OPENSSLINCDIR = $(OPENSSLDIR)/include
181 OPENSSLLIBDIR = $(OPENSSLDIR)
182
183 #### Either the directory where the Tcl library is installed or the Tcl
184 # source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
2297 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2298 -DSQLITE_ENABLE_DBSTAT_VTAB \
2299 -DSQLITE_ENABLE_JSON1 \
2300 -DSQLITE_ENABLE_FTS5 \
2301 -DSQLITE_ENABLE_STMTVTAB \
2302 -DSQLITE_USE_ZLIB \
2303 -DSQLITE_INTROSPECTION_PRAGMAS \
2304 -DSQLITE_ENABLE_DBPAGE_VTAB \
2305 -DSQLITE_WIN32_NO_ANSI \
2306 $(MINGW_OPTIONS) \
2307 -DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
2327 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2328 -DSQLITE_ENABLE_DBSTAT_VTAB \
2329 -DSQLITE_ENABLE_JSON1 \
2330 -DSQLITE_ENABLE_FTS5 \
2331 -DSQLITE_ENABLE_STMTVTAB \
2332 -DSQLITE_USE_ZLIB \
2333 -DSQLITE_INTROSPECTION_PRAGMAS \
2334 -DSQLITE_ENABLE_DBPAGE_VTAB \
2335 -Dmain=sqlite3_shell \
2336 -DSQLITE_SHELL_IS_UTF8=1 \
2337 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
2338
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -174,11 +174,11 @@
174 #### The directories where the OpenSSL include and library files are located.
175 # The recommended usage here is to use the Sysinternals junction tool
176 # to create a hard link between an "openssl-1.x" sub-directory of the
177 # Fossil source code directory and the target OpenSSL source directory.
178 #
179 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
180 OPENSSLINCDIR = $(OPENSSLDIR)/include
181 OPENSSLLIBDIR = $(OPENSSLDIR)
182
183 #### Either the directory where the Tcl library is installed or the Tcl
184 # source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
2297 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2298 -DSQLITE_ENABLE_DBSTAT_VTAB \
2299 -DSQLITE_ENABLE_JSON1 \
2300 -DSQLITE_ENABLE_FTS5 \
2301 -DSQLITE_ENABLE_STMTVTAB \
2302 -DSQLITE_HAVE_ZLIB \
2303 -DSQLITE_INTROSPECTION_PRAGMAS \
2304 -DSQLITE_ENABLE_DBPAGE_VTAB \
2305 -DSQLITE_WIN32_NO_ANSI \
2306 $(MINGW_OPTIONS) \
2307 -DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
2327 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2328 -DSQLITE_ENABLE_DBSTAT_VTAB \
2329 -DSQLITE_ENABLE_JSON1 \
2330 -DSQLITE_ENABLE_FTS5 \
2331 -DSQLITE_ENABLE_STMTVTAB \
2332 -DSQLITE_HAVE_ZLIB \
2333 -DSQLITE_INTROSPECTION_PRAGMAS \
2334 -DSQLITE_ENABLE_DBPAGE_VTAB \
2335 -Dmain=sqlite3_shell \
2336 -DSQLITE_SHELL_IS_UTF8=1 \
2337 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
2338
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -174,11 +174,11 @@
174174
#### The directories where the OpenSSL include and library files are located.
175175
# The recommended usage here is to use the Sysinternals junction tool
176176
# to create a hard link between an "openssl-1.x" sub-directory of the
177177
# Fossil source code directory and the target OpenSSL source directory.
178178
#
179
-OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
179
+OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
180180
OPENSSLINCDIR = $(OPENSSLDIR)/include
181181
OPENSSLLIBDIR = $(OPENSSLDIR)
182182
183183
#### Either the directory where the Tcl library is installed or the Tcl
184184
# source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
22972297
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
22982298
-DSQLITE_ENABLE_DBSTAT_VTAB \
22992299
-DSQLITE_ENABLE_JSON1 \
23002300
-DSQLITE_ENABLE_FTS5 \
23012301
-DSQLITE_ENABLE_STMTVTAB \
2302
- -DSQLITE_USE_ZLIB \
2302
+ -DSQLITE_HAVE_ZLIB \
23032303
-DSQLITE_INTROSPECTION_PRAGMAS \
23042304
-DSQLITE_ENABLE_DBPAGE_VTAB \
23052305
-DSQLITE_WIN32_NO_ANSI \
23062306
$(MINGW_OPTIONS) \
23072307
-DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
23272327
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
23282328
-DSQLITE_ENABLE_DBSTAT_VTAB \
23292329
-DSQLITE_ENABLE_JSON1 \
23302330
-DSQLITE_ENABLE_FTS5 \
23312331
-DSQLITE_ENABLE_STMTVTAB \
2332
- -DSQLITE_USE_ZLIB \
2332
+ -DSQLITE_HAVE_ZLIB \
23332333
-DSQLITE_INTROSPECTION_PRAGMAS \
23342334
-DSQLITE_ENABLE_DBPAGE_VTAB \
23352335
-Dmain=sqlite3_shell \
23362336
-DSQLITE_SHELL_IS_UTF8=1 \
23372337
-DSQLITE_OMIT_LOAD_EXTENSION=1 \
23382338
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -174,11 +174,11 @@
174 #### The directories where the OpenSSL include and library files are located.
175 # The recommended usage here is to use the Sysinternals junction tool
176 # to create a hard link between an "openssl-1.x" sub-directory of the
177 # Fossil source code directory and the target OpenSSL source directory.
178 #
179 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
180 OPENSSLINCDIR = $(OPENSSLDIR)/include
181 OPENSSLLIBDIR = $(OPENSSLDIR)
182
183 #### Either the directory where the Tcl library is installed or the Tcl
184 # source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
2297 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2298 -DSQLITE_ENABLE_DBSTAT_VTAB \
2299 -DSQLITE_ENABLE_JSON1 \
2300 -DSQLITE_ENABLE_FTS5 \
2301 -DSQLITE_ENABLE_STMTVTAB \
2302 -DSQLITE_USE_ZLIB \
2303 -DSQLITE_INTROSPECTION_PRAGMAS \
2304 -DSQLITE_ENABLE_DBPAGE_VTAB \
2305 -DSQLITE_WIN32_NO_ANSI \
2306 $(MINGW_OPTIONS) \
2307 -DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
2327 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2328 -DSQLITE_ENABLE_DBSTAT_VTAB \
2329 -DSQLITE_ENABLE_JSON1 \
2330 -DSQLITE_ENABLE_FTS5 \
2331 -DSQLITE_ENABLE_STMTVTAB \
2332 -DSQLITE_USE_ZLIB \
2333 -DSQLITE_INTROSPECTION_PRAGMAS \
2334 -DSQLITE_ENABLE_DBPAGE_VTAB \
2335 -Dmain=sqlite3_shell \
2336 -DSQLITE_SHELL_IS_UTF8=1 \
2337 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
2338
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -174,11 +174,11 @@
174 #### The directories where the OpenSSL include and library files are located.
175 # The recommended usage here is to use the Sysinternals junction tool
176 # to create a hard link between an "openssl-1.x" sub-directory of the
177 # Fossil source code directory and the target OpenSSL source directory.
178 #
179 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
180 OPENSSLINCDIR = $(OPENSSLDIR)/include
181 OPENSSLLIBDIR = $(OPENSSLDIR)
182
183 #### Either the directory where the Tcl library is installed or the Tcl
184 # source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
2297 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2298 -DSQLITE_ENABLE_DBSTAT_VTAB \
2299 -DSQLITE_ENABLE_JSON1 \
2300 -DSQLITE_ENABLE_FTS5 \
2301 -DSQLITE_ENABLE_STMTVTAB \
2302 -DSQLITE_HAVE_ZLIB \
2303 -DSQLITE_INTROSPECTION_PRAGMAS \
2304 -DSQLITE_ENABLE_DBPAGE_VTAB \
2305 -DSQLITE_WIN32_NO_ANSI \
2306 $(MINGW_OPTIONS) \
2307 -DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
2327 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2328 -DSQLITE_ENABLE_DBSTAT_VTAB \
2329 -DSQLITE_ENABLE_JSON1 \
2330 -DSQLITE_ENABLE_FTS5 \
2331 -DSQLITE_ENABLE_STMTVTAB \
2332 -DSQLITE_HAVE_ZLIB \
2333 -DSQLITE_INTROSPECTION_PRAGMAS \
2334 -DSQLITE_ENABLE_DBPAGE_VTAB \
2335 -Dmain=sqlite3_shell \
2336 -DSQLITE_SHELL_IS_UTF8=1 \
2337 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
2338
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -174,11 +174,11 @@
174174
#### The directories where the OpenSSL include and library files are located.
175175
# The recommended usage here is to use the Sysinternals junction tool
176176
# to create a hard link between an "openssl-1.x" sub-directory of the
177177
# Fossil source code directory and the target OpenSSL source directory.
178178
#
179
-OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
179
+OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
180180
OPENSSLINCDIR = $(OPENSSLDIR)/include
181181
OPENSSLLIBDIR = $(OPENSSLDIR)
182182
183183
#### Either the directory where the Tcl library is installed or the Tcl
184184
# source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
22972297
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
22982298
-DSQLITE_ENABLE_DBSTAT_VTAB \
22992299
-DSQLITE_ENABLE_JSON1 \
23002300
-DSQLITE_ENABLE_FTS5 \
23012301
-DSQLITE_ENABLE_STMTVTAB \
2302
- -DSQLITE_USE_ZLIB \
2302
+ -DSQLITE_HAVE_ZLIB \
23032303
-DSQLITE_INTROSPECTION_PRAGMAS \
23042304
-DSQLITE_ENABLE_DBPAGE_VTAB \
23052305
-DSQLITE_WIN32_NO_ANSI \
23062306
$(MINGW_OPTIONS) \
23072307
-DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
23272327
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
23282328
-DSQLITE_ENABLE_DBSTAT_VTAB \
23292329
-DSQLITE_ENABLE_JSON1 \
23302330
-DSQLITE_ENABLE_FTS5 \
23312331
-DSQLITE_ENABLE_STMTVTAB \
2332
- -DSQLITE_USE_ZLIB \
2332
+ -DSQLITE_HAVE_ZLIB \
23332333
-DSQLITE_INTROSPECTION_PRAGMAS \
23342334
-DSQLITE_ENABLE_DBPAGE_VTAB \
23352335
-Dmain=sqlite3_shell \
23362336
-DSQLITE_SHELL_IS_UTF8=1 \
23372337
-DSQLITE_OMIT_LOAD_EXTENSION=1 \
23382338
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -174,11 +174,11 @@
174 #### The directories where the OpenSSL include and library files are located.
175 # The recommended usage here is to use the Sysinternals junction tool
176 # to create a hard link between an "openssl-1.x" sub-directory of the
177 # Fossil source code directory and the target OpenSSL source directory.
178 #
179 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
180 OPENSSLINCDIR = $(OPENSSLDIR)/include
181 OPENSSLLIBDIR = $(OPENSSLDIR)
182
183 #### Either the directory where the Tcl library is installed or the Tcl
184 # source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
2297 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2298 -DSQLITE_ENABLE_DBSTAT_VTAB \
2299 -DSQLITE_ENABLE_JSON1 \
2300 -DSQLITE_ENABLE_FTS5 \
2301 -DSQLITE_ENABLE_STMTVTAB \
2302 -DSQLITE_USE_ZLIB \
2303 -DSQLITE_INTROSPECTION_PRAGMAS \
2304 -DSQLITE_ENABLE_DBPAGE_VTAB \
2305 -DSQLITE_WIN32_NO_ANSI \
2306 $(MINGW_OPTIONS) \
2307 -DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
2327 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2328 -DSQLITE_ENABLE_DBSTAT_VTAB \
2329 -DSQLITE_ENABLE_JSON1 \
2330 -DSQLITE_ENABLE_FTS5 \
2331 -DSQLITE_ENABLE_STMTVTAB \
2332 -DSQLITE_USE_ZLIB \
2333 -DSQLITE_INTROSPECTION_PRAGMAS \
2334 -DSQLITE_ENABLE_DBPAGE_VTAB \
2335 -Dmain=sqlite3_shell \
2336 -DSQLITE_SHELL_IS_UTF8=1 \
2337 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
2338
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -174,11 +174,11 @@
174 #### The directories where the OpenSSL include and library files are located.
175 # The recommended usage here is to use the Sysinternals junction tool
176 # to create a hard link between an "openssl-1.x" sub-directory of the
177 # Fossil source code directory and the target OpenSSL source directory.
178 #
179 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
180 OPENSSLINCDIR = $(OPENSSLDIR)/include
181 OPENSSLLIBDIR = $(OPENSSLDIR)
182
183 #### Either the directory where the Tcl library is installed or the Tcl
184 # source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
2297 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2298 -DSQLITE_ENABLE_DBSTAT_VTAB \
2299 -DSQLITE_ENABLE_JSON1 \
2300 -DSQLITE_ENABLE_FTS5 \
2301 -DSQLITE_ENABLE_STMTVTAB \
2302 -DSQLITE_HAVE_ZLIB \
2303 -DSQLITE_INTROSPECTION_PRAGMAS \
2304 -DSQLITE_ENABLE_DBPAGE_VTAB \
2305 -DSQLITE_WIN32_NO_ANSI \
2306 $(MINGW_OPTIONS) \
2307 -DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
2327 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2328 -DSQLITE_ENABLE_DBSTAT_VTAB \
2329 -DSQLITE_ENABLE_JSON1 \
2330 -DSQLITE_ENABLE_FTS5 \
2331 -DSQLITE_ENABLE_STMTVTAB \
2332 -DSQLITE_HAVE_ZLIB \
2333 -DSQLITE_INTROSPECTION_PRAGMAS \
2334 -DSQLITE_ENABLE_DBPAGE_VTAB \
2335 -Dmain=sqlite3_shell \
2336 -DSQLITE_SHELL_IS_UTF8=1 \
2337 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
2338
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -174,11 +174,11 @@
174174
#### The directories where the OpenSSL include and library files are located.
175175
# The recommended usage here is to use the Sysinternals junction tool
176176
# to create a hard link between an "openssl-1.x" sub-directory of the
177177
# Fossil source code directory and the target OpenSSL source directory.
178178
#
179
-OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
179
+OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
180180
OPENSSLINCDIR = $(OPENSSLDIR)/include
181181
OPENSSLLIBDIR = $(OPENSSLDIR)
182182
183183
#### Either the directory where the Tcl library is installed or the Tcl
184184
# source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
22972297
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
22982298
-DSQLITE_ENABLE_DBSTAT_VTAB \
22992299
-DSQLITE_ENABLE_JSON1 \
23002300
-DSQLITE_ENABLE_FTS5 \
23012301
-DSQLITE_ENABLE_STMTVTAB \
2302
- -DSQLITE_USE_ZLIB \
2302
+ -DSQLITE_HAVE_ZLIB \
23032303
-DSQLITE_INTROSPECTION_PRAGMAS \
23042304
-DSQLITE_ENABLE_DBPAGE_VTAB \
23052305
-DSQLITE_WIN32_NO_ANSI \
23062306
$(MINGW_OPTIONS) \
23072307
-DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
23272327
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
23282328
-DSQLITE_ENABLE_DBSTAT_VTAB \
23292329
-DSQLITE_ENABLE_JSON1 \
23302330
-DSQLITE_ENABLE_FTS5 \
23312331
-DSQLITE_ENABLE_STMTVTAB \
2332
- -DSQLITE_USE_ZLIB \
2332
+ -DSQLITE_HAVE_ZLIB \
23332333
-DSQLITE_INTROSPECTION_PRAGMAS \
23342334
-DSQLITE_ENABLE_DBPAGE_VTAB \
23352335
-Dmain=sqlite3_shell \
23362336
-DSQLITE_SHELL_IS_UTF8=1 \
23372337
-DSQLITE_OMIT_LOAD_EXTENSION=1 \
23382338
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -174,11 +174,11 @@
174 #### The directories where the OpenSSL include and library files are located.
175 # The recommended usage here is to use the Sysinternals junction tool
176 # to create a hard link between an "openssl-1.x" sub-directory of the
177 # Fossil source code directory and the target OpenSSL source directory.
178 #
179 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.0h
180 OPENSSLINCDIR = $(OPENSSLDIR)/include
181 OPENSSLLIBDIR = $(OPENSSLDIR)
182
183 #### Either the directory where the Tcl library is installed or the Tcl
184 # source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
2297 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2298 -DSQLITE_ENABLE_DBSTAT_VTAB \
2299 -DSQLITE_ENABLE_JSON1 \
2300 -DSQLITE_ENABLE_FTS5 \
2301 -DSQLITE_ENABLE_STMTVTAB \
2302 -DSQLITE_USE_ZLIB \
2303 -DSQLITE_INTROSPECTION_PRAGMAS \
2304 -DSQLITE_ENABLE_DBPAGE_VTAB \
2305 -DSQLITE_WIN32_NO_ANSI \
2306 $(MINGW_OPTIONS) \
2307 -DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
2327 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2328 -DSQLITE_ENABLE_DBSTAT_VTAB \
2329 -DSQLITE_ENABLE_JSON1 \
2330 -DSQLITE_ENABLE_FTS5 \
2331 -DSQLITE_ENABLE_STMTVTAB \
2332 -DSQLITE_USE_ZLIB \
2333 -DSQLITE_INTROSPECTION_PRAGMAS \
2334 -DSQLITE_ENABLE_DBPAGE_VTAB \
2335 -Dmain=sqlite3_shell \
2336 -DSQLITE_SHELL_IS_UTF8=1 \
2337 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
2338
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -174,11 +174,11 @@
174 #### The directories where the OpenSSL include and library files are located.
175 # The recommended usage here is to use the Sysinternals junction tool
176 # to create a hard link between an "openssl-1.x" sub-directory of the
177 # Fossil source code directory and the target OpenSSL source directory.
178 #
179 OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.1.1-pre4
180 OPENSSLINCDIR = $(OPENSSLDIR)/include
181 OPENSSLLIBDIR = $(OPENSSLDIR)
182
183 #### Either the directory where the Tcl library is installed or the Tcl
184 # source code directory resides (depending on the value of the macro
@@ -2297,11 +2297,11 @@
2297 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2298 -DSQLITE_ENABLE_DBSTAT_VTAB \
2299 -DSQLITE_ENABLE_JSON1 \
2300 -DSQLITE_ENABLE_FTS5 \
2301 -DSQLITE_ENABLE_STMTVTAB \
2302 -DSQLITE_HAVE_ZLIB \
2303 -DSQLITE_INTROSPECTION_PRAGMAS \
2304 -DSQLITE_ENABLE_DBPAGE_VTAB \
2305 -DSQLITE_WIN32_NO_ANSI \
2306 $(MINGW_OPTIONS) \
2307 -DSQLITE_USE_MALLOC_H \
@@ -2327,11 +2327,11 @@
2327 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2328 -DSQLITE_ENABLE_DBSTAT_VTAB \
2329 -DSQLITE_ENABLE_JSON1 \
2330 -DSQLITE_ENABLE_FTS5 \
2331 -DSQLITE_ENABLE_STMTVTAB \
2332 -DSQLITE_HAVE_ZLIB \
2333 -DSQLITE_INTROSPECTION_PRAGMAS \
2334 -DSQLITE_ENABLE_DBPAGE_VTAB \
2335 -Dmain=sqlite3_shell \
2336 -DSQLITE_SHELL_IS_UTF8=1 \
2337 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
2338
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -98,11 +98,11 @@
9898
!ifndef USE_SEE
9999
USE_SEE = 0
100100
!endif
101101
102102
!if $(FOSSIL_ENABLE_SSL)!=0
103
-SSLDIR = $(B)\compat\openssl-1.1.0h
103
+SSLDIR = $(B)\compat\openssl-1.1.1-pre4
104104
SSLINCDIR = $(SSLDIR)\inc32
105105
!if $(FOSSIL_DYNAMIC_BUILD)!=0
106106
SSLLIBDIR = $(SSLDIR)\out32dll
107107
!else
108108
SSLLIBDIR = $(SSLDIR)\out32
@@ -333,11 +333,11 @@
333333
/DSQLITE_ENABLE_FTS3_PARENTHESIS \
334334
/DSQLITE_ENABLE_DBSTAT_VTAB \
335335
/DSQLITE_ENABLE_JSON1 \
336336
/DSQLITE_ENABLE_FTS5 \
337337
/DSQLITE_ENABLE_STMTVTAB \
338
- /DSQLITE_USE_ZLIB \
338
+ /DSQLITE_HAVE_ZLIB \
339339
/DSQLITE_INTROSPECTION_PRAGMAS \
340340
/DSQLITE_ENABLE_DBPAGE_VTAB \
341341
/DSQLITE_WIN32_NO_ANSI
342342
343343
SHELL_OPTIONS = /DNDEBUG=1 \
@@ -360,11 +360,11 @@
360360
/DSQLITE_ENABLE_FTS3_PARENTHESIS \
361361
/DSQLITE_ENABLE_DBSTAT_VTAB \
362362
/DSQLITE_ENABLE_JSON1 \
363363
/DSQLITE_ENABLE_FTS5 \
364364
/DSQLITE_ENABLE_STMTVTAB \
365
- /DSQLITE_USE_ZLIB \
365
+ /DSQLITE_HAVE_ZLIB \
366366
/DSQLITE_INTROSPECTION_PRAGMAS \
367367
/DSQLITE_ENABLE_DBPAGE_VTAB \
368368
/Dmain=sqlite3_shell \
369369
/DSQLITE_SHELL_IS_UTF8=1 \
370370
/DSQLITE_OMIT_LOAD_EXTENSION=1 \
371371
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -98,11 +98,11 @@
98 !ifndef USE_SEE
99 USE_SEE = 0
100 !endif
101
102 !if $(FOSSIL_ENABLE_SSL)!=0
103 SSLDIR = $(B)\compat\openssl-1.1.0h
104 SSLINCDIR = $(SSLDIR)\inc32
105 !if $(FOSSIL_DYNAMIC_BUILD)!=0
106 SSLLIBDIR = $(SSLDIR)\out32dll
107 !else
108 SSLLIBDIR = $(SSLDIR)\out32
@@ -333,11 +333,11 @@
333 /DSQLITE_ENABLE_FTS3_PARENTHESIS \
334 /DSQLITE_ENABLE_DBSTAT_VTAB \
335 /DSQLITE_ENABLE_JSON1 \
336 /DSQLITE_ENABLE_FTS5 \
337 /DSQLITE_ENABLE_STMTVTAB \
338 /DSQLITE_USE_ZLIB \
339 /DSQLITE_INTROSPECTION_PRAGMAS \
340 /DSQLITE_ENABLE_DBPAGE_VTAB \
341 /DSQLITE_WIN32_NO_ANSI
342
343 SHELL_OPTIONS = /DNDEBUG=1 \
@@ -360,11 +360,11 @@
360 /DSQLITE_ENABLE_FTS3_PARENTHESIS \
361 /DSQLITE_ENABLE_DBSTAT_VTAB \
362 /DSQLITE_ENABLE_JSON1 \
363 /DSQLITE_ENABLE_FTS5 \
364 /DSQLITE_ENABLE_STMTVTAB \
365 /DSQLITE_USE_ZLIB \
366 /DSQLITE_INTROSPECTION_PRAGMAS \
367 /DSQLITE_ENABLE_DBPAGE_VTAB \
368 /Dmain=sqlite3_shell \
369 /DSQLITE_SHELL_IS_UTF8=1 \
370 /DSQLITE_OMIT_LOAD_EXTENSION=1 \
371
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -98,11 +98,11 @@
98 !ifndef USE_SEE
99 USE_SEE = 0
100 !endif
101
102 !if $(FOSSIL_ENABLE_SSL)!=0
103 SSLDIR = $(B)\compat\openssl-1.1.1-pre4
104 SSLINCDIR = $(SSLDIR)\inc32
105 !if $(FOSSIL_DYNAMIC_BUILD)!=0
106 SSLLIBDIR = $(SSLDIR)\out32dll
107 !else
108 SSLLIBDIR = $(SSLDIR)\out32
@@ -333,11 +333,11 @@
333 /DSQLITE_ENABLE_FTS3_PARENTHESIS \
334 /DSQLITE_ENABLE_DBSTAT_VTAB \
335 /DSQLITE_ENABLE_JSON1 \
336 /DSQLITE_ENABLE_FTS5 \
337 /DSQLITE_ENABLE_STMTVTAB \
338 /DSQLITE_HAVE_ZLIB \
339 /DSQLITE_INTROSPECTION_PRAGMAS \
340 /DSQLITE_ENABLE_DBPAGE_VTAB \
341 /DSQLITE_WIN32_NO_ANSI
342
343 SHELL_OPTIONS = /DNDEBUG=1 \
@@ -360,11 +360,11 @@
360 /DSQLITE_ENABLE_FTS3_PARENTHESIS \
361 /DSQLITE_ENABLE_DBSTAT_VTAB \
362 /DSQLITE_ENABLE_JSON1 \
363 /DSQLITE_ENABLE_FTS5 \
364 /DSQLITE_ENABLE_STMTVTAB \
365 /DSQLITE_HAVE_ZLIB \
366 /DSQLITE_INTROSPECTION_PRAGMAS \
367 /DSQLITE_ENABLE_DBPAGE_VTAB \
368 /Dmain=sqlite3_shell \
369 /DSQLITE_SHELL_IS_UTF8=1 \
370 /DSQLITE_OMIT_LOAD_EXTENSION=1 \
371
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -98,11 +98,11 @@
9898
!ifndef USE_SEE
9999
USE_SEE = 0
100100
!endif
101101
102102
!if $(FOSSIL_ENABLE_SSL)!=0
103
-SSLDIR = $(B)\compat\openssl-1.1.0h
103
+SSLDIR = $(B)\compat\openssl-1.1.1-pre4
104104
SSLINCDIR = $(SSLDIR)\inc32
105105
!if $(FOSSIL_DYNAMIC_BUILD)!=0
106106
SSLLIBDIR = $(SSLDIR)\out32dll
107107
!else
108108
SSLLIBDIR = $(SSLDIR)\out32
@@ -333,11 +333,11 @@
333333
/DSQLITE_ENABLE_FTS3_PARENTHESIS \
334334
/DSQLITE_ENABLE_DBSTAT_VTAB \
335335
/DSQLITE_ENABLE_JSON1 \
336336
/DSQLITE_ENABLE_FTS5 \
337337
/DSQLITE_ENABLE_STMTVTAB \
338
- /DSQLITE_USE_ZLIB \
338
+ /DSQLITE_HAVE_ZLIB \
339339
/DSQLITE_INTROSPECTION_PRAGMAS \
340340
/DSQLITE_ENABLE_DBPAGE_VTAB \
341341
/DSQLITE_WIN32_NO_ANSI
342342
343343
SHELL_OPTIONS = /DNDEBUG=1 \
@@ -360,11 +360,11 @@
360360
/DSQLITE_ENABLE_FTS3_PARENTHESIS \
361361
/DSQLITE_ENABLE_DBSTAT_VTAB \
362362
/DSQLITE_ENABLE_JSON1 \
363363
/DSQLITE_ENABLE_FTS5 \
364364
/DSQLITE_ENABLE_STMTVTAB \
365
- /DSQLITE_USE_ZLIB \
365
+ /DSQLITE_HAVE_ZLIB \
366366
/DSQLITE_INTROSPECTION_PRAGMAS \
367367
/DSQLITE_ENABLE_DBPAGE_VTAB \
368368
/Dmain=sqlite3_shell \
369369
/DSQLITE_SHELL_IS_UTF8=1 \
370370
/DSQLITE_OMIT_LOAD_EXTENSION=1 \
371371
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -98,11 +98,11 @@
98 !ifndef USE_SEE
99 USE_SEE = 0
100 !endif
101
102 !if $(FOSSIL_ENABLE_SSL)!=0
103 SSLDIR = $(B)\compat\openssl-1.1.0h
104 SSLINCDIR = $(SSLDIR)\inc32
105 !if $(FOSSIL_DYNAMIC_BUILD)!=0
106 SSLLIBDIR = $(SSLDIR)\out32dll
107 !else
108 SSLLIBDIR = $(SSLDIR)\out32
@@ -333,11 +333,11 @@
333 /DSQLITE_ENABLE_FTS3_PARENTHESIS \
334 /DSQLITE_ENABLE_DBSTAT_VTAB \
335 /DSQLITE_ENABLE_JSON1 \
336 /DSQLITE_ENABLE_FTS5 \
337 /DSQLITE_ENABLE_STMTVTAB \
338 /DSQLITE_USE_ZLIB \
339 /DSQLITE_INTROSPECTION_PRAGMAS \
340 /DSQLITE_ENABLE_DBPAGE_VTAB \
341 /DSQLITE_WIN32_NO_ANSI
342
343 SHELL_OPTIONS = /DNDEBUG=1 \
@@ -360,11 +360,11 @@
360 /DSQLITE_ENABLE_FTS3_PARENTHESIS \
361 /DSQLITE_ENABLE_DBSTAT_VTAB \
362 /DSQLITE_ENABLE_JSON1 \
363 /DSQLITE_ENABLE_FTS5 \
364 /DSQLITE_ENABLE_STMTVTAB \
365 /DSQLITE_USE_ZLIB \
366 /DSQLITE_INTROSPECTION_PRAGMAS \
367 /DSQLITE_ENABLE_DBPAGE_VTAB \
368 /Dmain=sqlite3_shell \
369 /DSQLITE_SHELL_IS_UTF8=1 \
370 /DSQLITE_OMIT_LOAD_EXTENSION=1 \
371
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -98,11 +98,11 @@
98 !ifndef USE_SEE
99 USE_SEE = 0
100 !endif
101
102 !if $(FOSSIL_ENABLE_SSL)!=0
103 SSLDIR = $(B)\compat\openssl-1.1.1-pre4
104 SSLINCDIR = $(SSLDIR)\inc32
105 !if $(FOSSIL_DYNAMIC_BUILD)!=0
106 SSLLIBDIR = $(SSLDIR)\out32dll
107 !else
108 SSLLIBDIR = $(SSLDIR)\out32
@@ -333,11 +333,11 @@
333 /DSQLITE_ENABLE_FTS3_PARENTHESIS \
334 /DSQLITE_ENABLE_DBSTAT_VTAB \
335 /DSQLITE_ENABLE_JSON1 \
336 /DSQLITE_ENABLE_FTS5 \
337 /DSQLITE_ENABLE_STMTVTAB \
338 /DSQLITE_HAVE_ZLIB \
339 /DSQLITE_INTROSPECTION_PRAGMAS \
340 /DSQLITE_ENABLE_DBPAGE_VTAB \
341 /DSQLITE_WIN32_NO_ANSI
342
343 SHELL_OPTIONS = /DNDEBUG=1 \
@@ -360,11 +360,11 @@
360 /DSQLITE_ENABLE_FTS3_PARENTHESIS \
361 /DSQLITE_ENABLE_DBSTAT_VTAB \
362 /DSQLITE_ENABLE_JSON1 \
363 /DSQLITE_ENABLE_FTS5 \
364 /DSQLITE_ENABLE_STMTVTAB \
365 /DSQLITE_HAVE_ZLIB \
366 /DSQLITE_INTROSPECTION_PRAGMAS \
367 /DSQLITE_ENABLE_DBPAGE_VTAB \
368 /Dmain=sqlite3_shell \
369 /DSQLITE_SHELL_IS_UTF8=1 \
370 /DSQLITE_OMIT_LOAD_EXTENSION=1 \
371
+1 -1
--- www/build.wiki
+++ www/build.wiki
@@ -136,11 +136,11 @@
136136
the optional <a href="https://www.openssl.org/">OpenSSL</a> support,
137137
first <a href="https://www.openssl.org/source/">download the official
138138
source code for OpenSSL</a> and extract it to an appropriately named
139139
"<b>openssl-X.Y.ZA</b>" subdirectory within the local
140140
[/tree?ci=trunk&name=compat | compat] directory (e.g.
141
-"<b>compat/openssl-1.1.0h</b>"), then make sure that some recent
141
+"<b>compat/openssl-1.1.1-pre4</b>"), then make sure that some recent
142142
<a href="http://www.perl.org/">Perl</a> binaries are installed locally,
143143
and finally run one of the following commands:
144144
<blockquote><pre>
145145
nmake /f Makefile.msc FOSSIL_ENABLE_SSL=1 FOSSIL_BUILD_SSL=1 PERLDIR=C:\full\path\to\Perl\bin
146146
</pre></blockquote>
147147
--- www/build.wiki
+++ www/build.wiki
@@ -136,11 +136,11 @@
136 the optional <a href="https://www.openssl.org/">OpenSSL</a> support,
137 first <a href="https://www.openssl.org/source/">download the official
138 source code for OpenSSL</a> and extract it to an appropriately named
139 "<b>openssl-X.Y.ZA</b>" subdirectory within the local
140 [/tree?ci=trunk&name=compat | compat] directory (e.g.
141 "<b>compat/openssl-1.1.0h</b>"), then make sure that some recent
142 <a href="http://www.perl.org/">Perl</a> binaries are installed locally,
143 and finally run one of the following commands:
144 <blockquote><pre>
145 nmake /f Makefile.msc FOSSIL_ENABLE_SSL=1 FOSSIL_BUILD_SSL=1 PERLDIR=C:\full\path\to\Perl\bin
146 </pre></blockquote>
147
--- www/build.wiki
+++ www/build.wiki
@@ -136,11 +136,11 @@
136 the optional <a href="https://www.openssl.org/">OpenSSL</a> support,
137 first <a href="https://www.openssl.org/source/">download the official
138 source code for OpenSSL</a> and extract it to an appropriately named
139 "<b>openssl-X.Y.ZA</b>" subdirectory within the local
140 [/tree?ci=trunk&name=compat | compat] directory (e.g.
141 "<b>compat/openssl-1.1.1-pre4</b>"), then make sure that some recent
142 <a href="http://www.perl.org/">Perl</a> binaries are installed locally,
143 and finally run one of the following commands:
144 <blockquote><pre>
145 nmake /f Makefile.msc FOSSIL_ENABLE_SSL=1 FOSSIL_BUILD_SSL=1 PERLDIR=C:\full\path\to\Perl\bin
146 </pre></blockquote>
147
+1 -1
--- www/build.wiki
+++ www/build.wiki
@@ -136,11 +136,11 @@
136136
the optional <a href="https://www.openssl.org/">OpenSSL</a> support,
137137
first <a href="https://www.openssl.org/source/">download the official
138138
source code for OpenSSL</a> and extract it to an appropriately named
139139
"<b>openssl-X.Y.ZA</b>" subdirectory within the local
140140
[/tree?ci=trunk&name=compat | compat] directory (e.g.
141
-"<b>compat/openssl-1.1.0h</b>"), then make sure that some recent
141
+"<b>compat/openssl-1.1.1-pre4</b>"), then make sure that some recent
142142
<a href="http://www.perl.org/">Perl</a> binaries are installed locally,
143143
and finally run one of the following commands:
144144
<blockquote><pre>
145145
nmake /f Makefile.msc FOSSIL_ENABLE_SSL=1 FOSSIL_BUILD_SSL=1 PERLDIR=C:\full\path\to\Perl\bin
146146
</pre></blockquote>
147147
--- www/build.wiki
+++ www/build.wiki
@@ -136,11 +136,11 @@
136 the optional <a href="https://www.openssl.org/">OpenSSL</a> support,
137 first <a href="https://www.openssl.org/source/">download the official
138 source code for OpenSSL</a> and extract it to an appropriately named
139 "<b>openssl-X.Y.ZA</b>" subdirectory within the local
140 [/tree?ci=trunk&name=compat | compat] directory (e.g.
141 "<b>compat/openssl-1.1.0h</b>"), then make sure that some recent
142 <a href="http://www.perl.org/">Perl</a> binaries are installed locally,
143 and finally run one of the following commands:
144 <blockquote><pre>
145 nmake /f Makefile.msc FOSSIL_ENABLE_SSL=1 FOSSIL_BUILD_SSL=1 PERLDIR=C:\full\path\to\Perl\bin
146 </pre></blockquote>
147
--- www/build.wiki
+++ www/build.wiki
@@ -136,11 +136,11 @@
136 the optional <a href="https://www.openssl.org/">OpenSSL</a> support,
137 first <a href="https://www.openssl.org/source/">download the official
138 source code for OpenSSL</a> and extract it to an appropriately named
139 "<b>openssl-X.Y.ZA</b>" subdirectory within the local
140 [/tree?ci=trunk&name=compat | compat] directory (e.g.
141 "<b>compat/openssl-1.1.1-pre4</b>"), then make sure that some recent
142 <a href="http://www.perl.org/">Perl</a> binaries are installed locally,
143 and finally run one of the following commands:
144 <blockquote><pre>
145 nmake /f Makefile.msc FOSSIL_ENABLE_SSL=1 FOSSIL_BUILD_SSL=1 PERLDIR=C:\full\path\to\Perl\bin
146 </pre></blockquote>
147

Keyboard Shortcuts

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