Fossil SCM

Merge latest updates from trunk.

andybradford 2016-10-05 03:03 stash-fixes merge
Commit 4c1971147ec54a3abfc332451f97a001f8bcda3e
+21 -8
--- src/add.c
+++ src/add.c
@@ -71,29 +71,42 @@
7171
".fos-journal",
7272
".fos-wal",
7373
".fos-shm",
7474
};
7575
76
- /* Names of auxiliary files generated by SQLite when the "manifest"
77
- ** property is enabled
76
+ /* Possible names of auxiliary files generated when the "manifest" property
77
+ ** is used
7878
*/
79
- static const char *const azManifest[] = {
80
- "manifest",
81
- "manifest.uuid",
79
+ static const struct {
80
+ const char *fname;
81
+ int flg;
82
+ }aManifestflags[] = {
83
+ { "manifest", MFESTFLG_RAW },
84
+ { "manifest.uuid", MFESTFLG_UUID },
85
+ { "manifest.tags", MFESTFLG_TAGS }
8286
};
87
+ static const char *azManifests[3];
8388
8489
/*
8590
** Names of repository files, if they exist in the checkout.
8691
*/
8792
static const char *azRepo[4] = { 0, 0, 0, 0 };
8893
8994
/* Cached setting "manifest" */
9095
static int cachedManifest = -1;
96
+ static int numManifests;
9197
9298
if( cachedManifest == -1 ){
99
+ int i;
93100
Blob repo;
94
- cachedManifest = db_get_boolean("manifest",0);
101
+ cachedManifest = db_get_manifest_setting();
102
+ numManifests = 0;
103
+ for(i=0; i<count(aManifestflags); i++){
104
+ if( cachedManifest&aManifestflags[i].flg ) {
105
+ azManifests[numManifests++] = aManifestflags[i].fname;
106
+ }
107
+ }
95108
blob_zero(&repo);
96109
if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
97110
const char *zRepo = blob_str(&repo);
98111
azRepo[0] = zRepo;
99112
azRepo[1] = mprintf("%s-journal", zRepo);
@@ -104,12 +117,12 @@
104117
105118
if( N<0 ) return 0;
106119
if( N<count(azName) ) return azName[N];
107120
N -= count(azName);
108121
if( cachedManifest ){
109
- if( N<count(azManifest) ) return azManifest[N];
110
- N -= count(azManifest);
122
+ if( N<numManifests ) return azManifests[N];
123
+ N -= numManifests;
111124
}
112125
if( !omitRepo && N<count(azRepo) ) return azRepo[N];
113126
return 0;
114127
}
115128
116129
--- src/add.c
+++ src/add.c
@@ -71,29 +71,42 @@
71 ".fos-journal",
72 ".fos-wal",
73 ".fos-shm",
74 };
75
76 /* Names of auxiliary files generated by SQLite when the "manifest"
77 ** property is enabled
78 */
79 static const char *const azManifest[] = {
80 "manifest",
81 "manifest.uuid",
 
 
 
 
82 };
 
83
84 /*
85 ** Names of repository files, if they exist in the checkout.
86 */
87 static const char *azRepo[4] = { 0, 0, 0, 0 };
88
89 /* Cached setting "manifest" */
90 static int cachedManifest = -1;
 
91
92 if( cachedManifest == -1 ){
 
93 Blob repo;
94 cachedManifest = db_get_boolean("manifest",0);
 
 
 
 
 
 
95 blob_zero(&repo);
96 if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
97 const char *zRepo = blob_str(&repo);
98 azRepo[0] = zRepo;
99 azRepo[1] = mprintf("%s-journal", zRepo);
@@ -104,12 +117,12 @@
104
105 if( N<0 ) return 0;
106 if( N<count(azName) ) return azName[N];
107 N -= count(azName);
108 if( cachedManifest ){
109 if( N<count(azManifest) ) return azManifest[N];
110 N -= count(azManifest);
111 }
112 if( !omitRepo && N<count(azRepo) ) return azRepo[N];
113 return 0;
114 }
115
116
--- src/add.c
+++ src/add.c
@@ -71,29 +71,42 @@
71 ".fos-journal",
72 ".fos-wal",
73 ".fos-shm",
74 };
75
76 /* Possible names of auxiliary files generated when the "manifest" property
77 ** is used
78 */
79 static const struct {
80 const char *fname;
81 int flg;
82 }aManifestflags[] = {
83 { "manifest", MFESTFLG_RAW },
84 { "manifest.uuid", MFESTFLG_UUID },
85 { "manifest.tags", MFESTFLG_TAGS }
86 };
87 static const char *azManifests[3];
88
89 /*
90 ** Names of repository files, if they exist in the checkout.
91 */
92 static const char *azRepo[4] = { 0, 0, 0, 0 };
93
94 /* Cached setting "manifest" */
95 static int cachedManifest = -1;
96 static int numManifests;
97
98 if( cachedManifest == -1 ){
99 int i;
100 Blob repo;
101 cachedManifest = db_get_manifest_setting();
102 numManifests = 0;
103 for(i=0; i<count(aManifestflags); i++){
104 if( cachedManifest&aManifestflags[i].flg ) {
105 azManifests[numManifests++] = aManifestflags[i].fname;
106 }
107 }
108 blob_zero(&repo);
109 if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
110 const char *zRepo = blob_str(&repo);
111 azRepo[0] = zRepo;
112 azRepo[1] = mprintf("%s-journal", zRepo);
@@ -104,12 +117,12 @@
117
118 if( N<0 ) return 0;
119 if( N<count(azName) ) return azName[N];
120 N -= count(azName);
121 if( cachedManifest ){
122 if( N<numManifests ) return azManifests[N];
123 N -= numManifests;
124 }
125 if( !omitRepo && N<count(azRepo) ) return azRepo[N];
126 return 0;
127 }
128
129
+2 -2
--- src/allrepo.c
+++ src/allrepo.c
@@ -375,11 +375,11 @@
375375
" FROM global_config"
376376
" WHERE substr(name, 1, 5)=='repo:'"
377377
" ORDER BY 1"
378378
);
379379
}
380
- db_multi_exec("CREATE TEMP TABLE todel(x TEXT)");
380
+ db_multi_exec("CREATE TEMP TABLE toDel(x TEXT)");
381381
db_prepare(&q, "SELECT name, tag FROM repolist ORDER BY 1");
382382
while( db_step(&q)==SQLITE_ROW ){
383383
const char *zFilename = db_column_text(&q, 0);
384384
#if !USE_SEE
385385
if( sqlite3_strglob("*.efossil", zFilename)==0 ) continue;
@@ -386,11 +386,11 @@
386386
#endif
387387
if( file_access(zFilename, F_OK)
388388
|| !file_is_canonical(zFilename)
389389
|| (useCheckouts && file_isdir(zFilename)!=1)
390390
){
391
- db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1));
391
+ db_multi_exec("INSERT INTO toDel VALUES(%Q)", db_column_text(&q, 1));
392392
nToDel++;
393393
continue;
394394
}
395395
if( zCmd[0]=='l' ){
396396
fossil_print("%s\n", zFilename);
397397
--- src/allrepo.c
+++ src/allrepo.c
@@ -375,11 +375,11 @@
375 " FROM global_config"
376 " WHERE substr(name, 1, 5)=='repo:'"
377 " ORDER BY 1"
378 );
379 }
380 db_multi_exec("CREATE TEMP TABLE todel(x TEXT)");
381 db_prepare(&q, "SELECT name, tag FROM repolist ORDER BY 1");
382 while( db_step(&q)==SQLITE_ROW ){
383 const char *zFilename = db_column_text(&q, 0);
384 #if !USE_SEE
385 if( sqlite3_strglob("*.efossil", zFilename)==0 ) continue;
@@ -386,11 +386,11 @@
386 #endif
387 if( file_access(zFilename, F_OK)
388 || !file_is_canonical(zFilename)
389 || (useCheckouts && file_isdir(zFilename)!=1)
390 ){
391 db_multi_exec("INSERT INTO todel VALUES(%Q)", db_column_text(&q, 1));
392 nToDel++;
393 continue;
394 }
395 if( zCmd[0]=='l' ){
396 fossil_print("%s\n", zFilename);
397
--- src/allrepo.c
+++ src/allrepo.c
@@ -375,11 +375,11 @@
375 " FROM global_config"
376 " WHERE substr(name, 1, 5)=='repo:'"
377 " ORDER BY 1"
378 );
379 }
380 db_multi_exec("CREATE TEMP TABLE toDel(x TEXT)");
381 db_prepare(&q, "SELECT name, tag FROM repolist ORDER BY 1");
382 while( db_step(&q)==SQLITE_ROW ){
383 const char *zFilename = db_column_text(&q, 0);
384 #if !USE_SEE
385 if( sqlite3_strglob("*.efossil", zFilename)==0 ) continue;
@@ -386,11 +386,11 @@
386 #endif
387 if( file_access(zFilename, F_OK)
388 || !file_is_canonical(zFilename)
389 || (useCheckouts && file_isdir(zFilename)!=1)
390 ){
391 db_multi_exec("INSERT INTO toDel VALUES(%Q)", db_column_text(&q, 1));
392 nToDel++;
393 continue;
394 }
395 if( zCmd[0]=='l' ){
396 fossil_print("%s\n", zFilename);
397
+11 -5
--- src/blob.c
+++ src/blob.c
@@ -851,27 +851,33 @@
851851
int blob_write_to_file(Blob *pBlob, const char *zFilename){
852852
FILE *out;
853853
int nWrote;
854854
855855
if( zFilename[0]==0 || (zFilename[0]=='-' && zFilename[1]==0) ){
856
- nWrote = blob_size(pBlob);
856
+ blob_is_init(pBlob);
857857
#if defined(_WIN32)
858
- if( fossil_utf8_to_console(blob_buffer(pBlob), nWrote, 0) >= 0 ){
859
- return nWrote;
860
- }
858
+ nWrote = fossil_utf8_to_console(blob_buffer(pBlob), blob_size(pBlob), 0);
859
+ if( nWrote>=0 ) return nWrote;
861860
fflush(stdout);
862861
_setmode(_fileno(stdout), _O_BINARY);
863862
#endif
864
- fwrite(blob_buffer(pBlob), 1, nWrote, stdout);
863
+ nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), stdout);
865864
#if defined(_WIN32)
866865
fflush(stdout);
867866
_setmode(_fileno(stdout), _O_TEXT);
868867
#endif
869868
}else{
870869
file_mkfolder(zFilename, 1, 0);
871870
out = fossil_fopen(zFilename, "wb");
872871
if( out==0 ){
872
+#if _WIN32
873
+ const char *zReserved = file_is_win_reserved(zFilename);
874
+ if( zReserved ){
875
+ fossil_fatal("cannot open \"%s\" because \"%s\" is "
876
+ "a reserved name on Windows", zFilename, zReserved);
877
+ }
878
+#endif
873879
fossil_fatal_recursive("unable to open file \"%s\" for writing",
874880
zFilename);
875881
return 0;
876882
}
877883
blob_is_init(pBlob);
878884
--- src/blob.c
+++ src/blob.c
@@ -851,27 +851,33 @@
851 int blob_write_to_file(Blob *pBlob, const char *zFilename){
852 FILE *out;
853 int nWrote;
854
855 if( zFilename[0]==0 || (zFilename[0]=='-' && zFilename[1]==0) ){
856 nWrote = blob_size(pBlob);
857 #if defined(_WIN32)
858 if( fossil_utf8_to_console(blob_buffer(pBlob), nWrote, 0) >= 0 ){
859 return nWrote;
860 }
861 fflush(stdout);
862 _setmode(_fileno(stdout), _O_BINARY);
863 #endif
864 fwrite(blob_buffer(pBlob), 1, nWrote, stdout);
865 #if defined(_WIN32)
866 fflush(stdout);
867 _setmode(_fileno(stdout), _O_TEXT);
868 #endif
869 }else{
870 file_mkfolder(zFilename, 1, 0);
871 out = fossil_fopen(zFilename, "wb");
872 if( out==0 ){
 
 
 
 
 
 
 
873 fossil_fatal_recursive("unable to open file \"%s\" for writing",
874 zFilename);
875 return 0;
876 }
877 blob_is_init(pBlob);
878
--- src/blob.c
+++ src/blob.c
@@ -851,27 +851,33 @@
851 int blob_write_to_file(Blob *pBlob, const char *zFilename){
852 FILE *out;
853 int nWrote;
854
855 if( zFilename[0]==0 || (zFilename[0]=='-' && zFilename[1]==0) ){
856 blob_is_init(pBlob);
857 #if defined(_WIN32)
858 nWrote = fossil_utf8_to_console(blob_buffer(pBlob), blob_size(pBlob), 0);
859 if( nWrote>=0 ) return nWrote;
 
860 fflush(stdout);
861 _setmode(_fileno(stdout), _O_BINARY);
862 #endif
863 nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), stdout);
864 #if defined(_WIN32)
865 fflush(stdout);
866 _setmode(_fileno(stdout), _O_TEXT);
867 #endif
868 }else{
869 file_mkfolder(zFilename, 1, 0);
870 out = fossil_fopen(zFilename, "wb");
871 if( out==0 ){
872 #if _WIN32
873 const char *zReserved = file_is_win_reserved(zFilename);
874 if( zReserved ){
875 fossil_fatal("cannot open \"%s\" because \"%s\" is "
876 "a reserved name on Windows", zFilename, zReserved);
877 }
878 #endif
879 fossil_fatal_recursive("unable to open file \"%s\" for writing",
880 zFilename);
881 return 0;
882 }
883 blob_is_init(pBlob);
884
+13 -3
--- src/checkin.c
+++ src/checkin.c
@@ -1869,11 +1869,11 @@
18691869
sCiInfo.zUserOvrd = find_option("user-override",0,1);
18701870
db_must_be_within_tree();
18711871
noSign = db_get_boolean("omitsign", 0)|noSign;
18721872
if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
18731873
useCksum = db_get_boolean("repo-cksum", 1);
1874
- outputManifest = db_get_boolean("manifest", 0);
1874
+ outputManifest = db_get_manifest_setting();
18751875
verify_all_options();
18761876
18771877
/* Escape special characters in tags and put all tags in sorted order */
18781878
if( nTag ){
18791879
int i;
@@ -2230,11 +2230,11 @@
22302230
** and rollback the transaction.
22312231
*/
22322232
if( dryRunFlag ){
22332233
blob_write_to_file(&manifest, "");
22342234
}
2235
- if( outputManifest ){
2235
+ if( outputManifest & MFESTFLG_RAW ){
22362236
zManifestFile = mprintf("%smanifest", g.zLocalRoot);
22372237
blob_write_to_file(&manifest, zManifestFile);
22382238
blob_reset(&manifest);
22392239
blob_read_from_file(&manifest, zManifestFile);
22402240
free(zManifestFile);
@@ -2264,11 +2264,11 @@
22642264
}
22652265
}
22662266
db_finalize(&q);
22672267
22682268
fossil_print("New_Version: %s\n", zUuid);
2269
- if( outputManifest ){
2269
+ if( outputManifest & MFESTFLG_UUID ){
22702270
zManifestFile = mprintf("%smanifest.uuid", g.zLocalRoot);
22712271
blob_zero(&muuid);
22722272
blob_appendf(&muuid, "%s\n", zUuid);
22732273
blob_write_to_file(&muuid, zManifestFile);
22742274
free(zManifestFile);
@@ -2346,13 +2346,23 @@
23462346
if( dryRunFlag ){
23472347
db_end_transaction(1);
23482348
exit(1);
23492349
}
23502350
db_end_transaction(0);
2351
+
2352
+ if( outputManifest & MFESTFLG_TAGS ){
2353
+ Blob tagslist;
2354
+ zManifestFile = mprintf("%smanifest.tags", g.zLocalRoot);
2355
+ blob_zero(&tagslist);
2356
+ get_checkin_taglist(nvid, &tagslist);
2357
+ blob_write_to_file(&tagslist, zManifestFile);
2358
+ blob_reset(&tagslist);
2359
+ free(zManifestFile);
2360
+ }
23512361
23522362
if( !g.markPrivate ){
23532363
autosync_loop(SYNC_PUSH|SYNC_PULL, db_get_int("autosync-tries", 1), 0);
23542364
}
23552365
if( count_nonbranch_children(vid)>1 ){
23562366
fossil_print("**** warning: a fork has occurred *****\n");
23572367
}
23582368
}
23592369
--- src/checkin.c
+++ src/checkin.c
@@ -1869,11 +1869,11 @@
1869 sCiInfo.zUserOvrd = find_option("user-override",0,1);
1870 db_must_be_within_tree();
1871 noSign = db_get_boolean("omitsign", 0)|noSign;
1872 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
1873 useCksum = db_get_boolean("repo-cksum", 1);
1874 outputManifest = db_get_boolean("manifest", 0);
1875 verify_all_options();
1876
1877 /* Escape special characters in tags and put all tags in sorted order */
1878 if( nTag ){
1879 int i;
@@ -2230,11 +2230,11 @@
2230 ** and rollback the transaction.
2231 */
2232 if( dryRunFlag ){
2233 blob_write_to_file(&manifest, "");
2234 }
2235 if( outputManifest ){
2236 zManifestFile = mprintf("%smanifest", g.zLocalRoot);
2237 blob_write_to_file(&manifest, zManifestFile);
2238 blob_reset(&manifest);
2239 blob_read_from_file(&manifest, zManifestFile);
2240 free(zManifestFile);
@@ -2264,11 +2264,11 @@
2264 }
2265 }
2266 db_finalize(&q);
2267
2268 fossil_print("New_Version: %s\n", zUuid);
2269 if( outputManifest ){
2270 zManifestFile = mprintf("%smanifest.uuid", g.zLocalRoot);
2271 blob_zero(&muuid);
2272 blob_appendf(&muuid, "%s\n", zUuid);
2273 blob_write_to_file(&muuid, zManifestFile);
2274 free(zManifestFile);
@@ -2346,13 +2346,23 @@
2346 if( dryRunFlag ){
2347 db_end_transaction(1);
2348 exit(1);
2349 }
2350 db_end_transaction(0);
 
 
 
 
 
 
 
 
 
 
2351
2352 if( !g.markPrivate ){
2353 autosync_loop(SYNC_PUSH|SYNC_PULL, db_get_int("autosync-tries", 1), 0);
2354 }
2355 if( count_nonbranch_children(vid)>1 ){
2356 fossil_print("**** warning: a fork has occurred *****\n");
2357 }
2358 }
2359
--- src/checkin.c
+++ src/checkin.c
@@ -1869,11 +1869,11 @@
1869 sCiInfo.zUserOvrd = find_option("user-override",0,1);
1870 db_must_be_within_tree();
1871 noSign = db_get_boolean("omitsign", 0)|noSign;
1872 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
1873 useCksum = db_get_boolean("repo-cksum", 1);
1874 outputManifest = db_get_manifest_setting();
1875 verify_all_options();
1876
1877 /* Escape special characters in tags and put all tags in sorted order */
1878 if( nTag ){
1879 int i;
@@ -2230,11 +2230,11 @@
2230 ** and rollback the transaction.
2231 */
2232 if( dryRunFlag ){
2233 blob_write_to_file(&manifest, "");
2234 }
2235 if( outputManifest & MFESTFLG_RAW ){
2236 zManifestFile = mprintf("%smanifest", g.zLocalRoot);
2237 blob_write_to_file(&manifest, zManifestFile);
2238 blob_reset(&manifest);
2239 blob_read_from_file(&manifest, zManifestFile);
2240 free(zManifestFile);
@@ -2264,11 +2264,11 @@
2264 }
2265 }
2266 db_finalize(&q);
2267
2268 fossil_print("New_Version: %s\n", zUuid);
2269 if( outputManifest & MFESTFLG_UUID ){
2270 zManifestFile = mprintf("%smanifest.uuid", g.zLocalRoot);
2271 blob_zero(&muuid);
2272 blob_appendf(&muuid, "%s\n", zUuid);
2273 blob_write_to_file(&muuid, zManifestFile);
2274 free(zManifestFile);
@@ -2346,13 +2346,23 @@
2346 if( dryRunFlag ){
2347 db_end_transaction(1);
2348 exit(1);
2349 }
2350 db_end_transaction(0);
2351
2352 if( outputManifest & MFESTFLG_TAGS ){
2353 Blob tagslist;
2354 zManifestFile = mprintf("%smanifest.tags", g.zLocalRoot);
2355 blob_zero(&tagslist);
2356 get_checkin_taglist(nvid, &tagslist);
2357 blob_write_to_file(&tagslist, zManifestFile);
2358 blob_reset(&tagslist);
2359 free(zManifestFile);
2360 }
2361
2362 if( !g.markPrivate ){
2363 autosync_loop(SYNC_PUSH|SYNC_PULL, db_get_int("autosync-tries", 1), 0);
2364 }
2365 if( count_nonbranch_children(vid)>1 ){
2366 fossil_print("**** warning: a fork has occurred *****\n");
2367 }
2368 }
2369
+65 -7
--- src/checkout.c
+++ src/checkout.c
@@ -127,44 +127,102 @@
127127
128128
/*
129129
** If the "manifest" setting is true, then automatically generate
130130
** files named "manifest" and "manifest.uuid" containing, respectively,
131131
** the text of the manifest and the artifact ID of the manifest.
132
+** If the manifest setting is set, but is not a boolean value, then treat
133
+** each character as a flag to enable writing "manifest", "manifest.uuid" or
134
+** "manifest.tags".
132135
*/
133136
void manifest_to_disk(int vid){
134137
char *zManFile;
135138
Blob manifest;
136139
Blob hash;
140
+ Blob taglist;
141
+ int flg;
142
+
143
+ flg = db_get_manifest_setting();
137144
138
- if( db_get_boolean("manifest",0) ){
145
+ if( flg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
139146
blob_zero(&manifest);
140147
content_get(vid, &manifest);
141
- zManFile = mprintf("%smanifest", g.zLocalRoot);
142148
blob_zero(&hash);
143149
sha1sum_blob(&manifest, &hash);
144150
sterilize_manifest(&manifest);
151
+ }
152
+ if( flg & MFESTFLG_RAW ){
153
+ zManFile = mprintf("%smanifest", g.zLocalRoot);
145154
blob_write_to_file(&manifest, zManFile);
146155
free(zManFile);
147
- zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
148
- blob_append(&hash, "\n", 1);
149
- blob_write_to_file(&hash, zManFile);
150
- free(zManFile);
151
- blob_reset(&hash);
152156
}else{
153157
if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest'") ){
154158
zManFile = mprintf("%smanifest", g.zLocalRoot);
155159
file_delete(zManFile);
156160
free(zManFile);
157161
}
162
+ }
163
+ if( flg & MFESTFLG_UUID ){
164
+ zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
165
+ blob_append(&hash, "\n", 1);
166
+ blob_write_to_file(&hash, zManFile);
167
+ free(zManFile);
168
+ blob_reset(&hash);
169
+ }else{
158170
if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.uuid'") ){
159171
zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
160172
file_delete(zManFile);
161173
free(zManFile);
162174
}
163175
}
176
+ if( flg & MFESTFLG_TAGS ){
177
+ blob_zero(&taglist);
178
+ zManFile = mprintf("%smanifest.tags", g.zLocalRoot);
179
+ get_checkin_taglist(vid, &taglist);
180
+ blob_write_to_file(&taglist, zManFile);
181
+ free(zManFile);
182
+ blob_reset(&taglist);
183
+ }else{
184
+ if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.tags'") ){
185
+ zManFile = mprintf("%smanifest.tags", g.zLocalRoot);
186
+ file_delete(zManFile);
187
+ free(zManFile);
188
+ }
189
+ }
190
+}
164191
192
+/*
193
+** Find the branch name and all symbolic tags for a particular check-in
194
+** identified by "rid".
195
+**
196
+** The branch name is actually only extracted if this procedure is run
197
+** from within a local check-out. And the branch name is not the branch
198
+** name for "rid" but rather the branch name for the current check-out.
199
+** It is unclear if the rid parameter is always the same as the current
200
+** check-out.
201
+*/
202
+void get_checkin_taglist(int rid, Blob *pOut){
203
+ Stmt stmt;
204
+ char *zCurrent;
205
+ blob_reset(pOut);
206
+ zCurrent = db_text(0, "SELECT value FROM tagxref"
207
+ " WHERE rid=%d AND tagid=%d", rid, TAG_BRANCH);
208
+ blob_appendf(pOut, "branch %s\n", zCurrent);
209
+ db_prepare(&stmt, "SELECT substr(tagname, 5)"
210
+ " FROM tagxref, tag"
211
+ " WHERE tagxref.rid=%d"
212
+ " AND tagxref.tagtype>0"
213
+ " AND tag.tagid=tagxref.tagid"
214
+ " AND tag.tagname GLOB 'sym-*'", rid);
215
+ while( db_step(&stmt)==SQLITE_ROW ){
216
+ const char *zName;
217
+ zName = db_column_text(&stmt, 0);
218
+ blob_appendf(pOut, "tag %s\n", zName);
219
+ }
220
+ db_reset(&stmt);
221
+ db_finalize(&stmt);
165222
}
223
+
166224
167225
/*
168226
** COMMAND: checkout*
169227
** COMMAND: co*
170228
**
171229
--- src/checkout.c
+++ src/checkout.c
@@ -127,44 +127,102 @@
127
128 /*
129 ** If the "manifest" setting is true, then automatically generate
130 ** files named "manifest" and "manifest.uuid" containing, respectively,
131 ** the text of the manifest and the artifact ID of the manifest.
 
 
 
132 */
133 void manifest_to_disk(int vid){
134 char *zManFile;
135 Blob manifest;
136 Blob hash;
 
 
 
 
137
138 if( db_get_boolean("manifest",0) ){
139 blob_zero(&manifest);
140 content_get(vid, &manifest);
141 zManFile = mprintf("%smanifest", g.zLocalRoot);
142 blob_zero(&hash);
143 sha1sum_blob(&manifest, &hash);
144 sterilize_manifest(&manifest);
 
 
 
145 blob_write_to_file(&manifest, zManFile);
146 free(zManFile);
147 zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
148 blob_append(&hash, "\n", 1);
149 blob_write_to_file(&hash, zManFile);
150 free(zManFile);
151 blob_reset(&hash);
152 }else{
153 if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest'") ){
154 zManFile = mprintf("%smanifest", g.zLocalRoot);
155 file_delete(zManFile);
156 free(zManFile);
157 }
 
 
 
 
 
 
 
 
158 if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.uuid'") ){
159 zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
160 file_delete(zManFile);
161 free(zManFile);
162 }
163 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165 }
 
166
167 /*
168 ** COMMAND: checkout*
169 ** COMMAND: co*
170 **
171
--- src/checkout.c
+++ src/checkout.c
@@ -127,44 +127,102 @@
127
128 /*
129 ** If the "manifest" setting is true, then automatically generate
130 ** files named "manifest" and "manifest.uuid" containing, respectively,
131 ** the text of the manifest and the artifact ID of the manifest.
132 ** If the manifest setting is set, but is not a boolean value, then treat
133 ** each character as a flag to enable writing "manifest", "manifest.uuid" or
134 ** "manifest.tags".
135 */
136 void manifest_to_disk(int vid){
137 char *zManFile;
138 Blob manifest;
139 Blob hash;
140 Blob taglist;
141 int flg;
142
143 flg = db_get_manifest_setting();
144
145 if( flg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
146 blob_zero(&manifest);
147 content_get(vid, &manifest);
 
148 blob_zero(&hash);
149 sha1sum_blob(&manifest, &hash);
150 sterilize_manifest(&manifest);
151 }
152 if( flg & MFESTFLG_RAW ){
153 zManFile = mprintf("%smanifest", g.zLocalRoot);
154 blob_write_to_file(&manifest, zManFile);
155 free(zManFile);
 
 
 
 
 
156 }else{
157 if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest'") ){
158 zManFile = mprintf("%smanifest", g.zLocalRoot);
159 file_delete(zManFile);
160 free(zManFile);
161 }
162 }
163 if( flg & MFESTFLG_UUID ){
164 zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
165 blob_append(&hash, "\n", 1);
166 blob_write_to_file(&hash, zManFile);
167 free(zManFile);
168 blob_reset(&hash);
169 }else{
170 if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.uuid'") ){
171 zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
172 file_delete(zManFile);
173 free(zManFile);
174 }
175 }
176 if( flg & MFESTFLG_TAGS ){
177 blob_zero(&taglist);
178 zManFile = mprintf("%smanifest.tags", g.zLocalRoot);
179 get_checkin_taglist(vid, &taglist);
180 blob_write_to_file(&taglist, zManFile);
181 free(zManFile);
182 blob_reset(&taglist);
183 }else{
184 if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.tags'") ){
185 zManFile = mprintf("%smanifest.tags", g.zLocalRoot);
186 file_delete(zManFile);
187 free(zManFile);
188 }
189 }
190 }
191
192 /*
193 ** Find the branch name and all symbolic tags for a particular check-in
194 ** identified by "rid".
195 **
196 ** The branch name is actually only extracted if this procedure is run
197 ** from within a local check-out. And the branch name is not the branch
198 ** name for "rid" but rather the branch name for the current check-out.
199 ** It is unclear if the rid parameter is always the same as the current
200 ** check-out.
201 */
202 void get_checkin_taglist(int rid, Blob *pOut){
203 Stmt stmt;
204 char *zCurrent;
205 blob_reset(pOut);
206 zCurrent = db_text(0, "SELECT value FROM tagxref"
207 " WHERE rid=%d AND tagid=%d", rid, TAG_BRANCH);
208 blob_appendf(pOut, "branch %s\n", zCurrent);
209 db_prepare(&stmt, "SELECT substr(tagname, 5)"
210 " FROM tagxref, tag"
211 " WHERE tagxref.rid=%d"
212 " AND tagxref.tagtype>0"
213 " AND tag.tagid=tagxref.tagid"
214 " AND tag.tagname GLOB 'sym-*'", rid);
215 while( db_step(&stmt)==SQLITE_ROW ){
216 const char *zName;
217 zName = db_column_text(&stmt, 0);
218 blob_appendf(pOut, "tag %s\n", zName);
219 }
220 db_reset(&stmt);
221 db_finalize(&stmt);
222 }
223
224
225 /*
226 ** COMMAND: checkout*
227 ** COMMAND: co*
228 **
229
+43 -4
--- src/db.c
+++ src/db.c
@@ -2270,10 +2270,46 @@
22702270
return db_int(dflt, "SELECT value FROM vvar WHERE name=%Q", zName);
22712271
}
22722272
void db_lset_int(const char *zName, int value){
22732273
db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value);
22742274
}
2275
+
2276
+#if INTERFACE
2277
+/* Manifest generation flags */
2278
+#define MFESTFLG_RAW 0x01
2279
+#define MFESTFLG_UUID 0x02
2280
+#define MFESTFLG_TAGS 0x04
2281
+#endif /* INTERFACE */
2282
+
2283
+/*
2284
+** Get the manifest setting. For backwards compatibility first check if the
2285
+** value is a boolean. If it's not a boolean, treat each character as a flag
2286
+** to enable a manifest type. This system puts certain boundary conditions on
2287
+** which letters can be used to represent flags (any permutation of flags must
2288
+** not be able to fully form one of the boolean values).
2289
+*/
2290
+int db_get_manifest_setting(void){
2291
+ int flg;
2292
+ char *zNVVal = db_get("manifest", "off");
2293
+ char *zVal = db_get_versioned("manifest", zNVVal);
2294
+ if( is_false(zVal) ){
2295
+ return 0;
2296
+ }else if( is_truth(zVal) ) {
2297
+ return MFESTFLG_RAW|MFESTFLG_UUID;
2298
+ }
2299
+ flg = 0;
2300
+ while( *zVal ){
2301
+ switch( *zVal ){
2302
+ case 'r': flg |= MFESTFLG_RAW; break;
2303
+ case 'u': flg |= MFESTFLG_UUID; break;
2304
+ case 't': flg |= MFESTFLG_TAGS; break;
2305
+ }
2306
+ zVal++;
2307
+ }
2308
+ return flg;
2309
+}
2310
+
22752311
22762312
/*
22772313
** Record the name of a local repository in the global_config() database.
22782314
** The repository filename %s is recorded as an entry with a "name" field
22792315
** of the following form:
@@ -2570,11 +2606,11 @@
25702606
{ "https-login", 0, 0, 0, 0, "off" },
25712607
{ "ignore-glob", 0, 40, 1, 0, "" },
25722608
{ "keep-glob", 0, 40, 1, 0, "" },
25732609
{ "localauth", 0, 0, 0, 0, "off" },
25742610
{ "main-branch", 0, 40, 0, 0, "trunk" },
2575
- { "manifest", 0, 0, 1, 0, "off" },
2611
+ { "manifest", 0, 5, 0, 0, "off" },
25762612
{ "max-loadavg", 0, 25, 0, 0, "0.0" },
25772613
{ "max-upload", 0, 25, 0, 0, "250000" },
25782614
{ "mtime-changes", 0, 0, 0, 0, "on" },
25792615
#if FOSSIL_ENABLE_LEGACY_MV_RM
25802616
{ "mv-rm-files", 0, 0, 0, 0, "off" },
@@ -2775,13 +2811,16 @@
27752811
** false, all HTTP requests from localhost have
27762812
** unrestricted access to the repository.
27772813
**
27782814
** main-branch The primary branch for the project. Default: trunk
27792815
**
2780
-** manifest If enabled, automatically create files "manifest" and
2781
-** (versionable) "manifest.uuid" in every checkout. The SQLite and
2782
-** Fossil repositories both require this. Default: off.
2816
+** manifest If set to a true boolean value, automatically create
2817
+** (versionable) files "manifest" and "manifest.uuid" in every checkout.
2818
+** Optionally use combinations of characters 'r'
2819
+** for "manifest", 'u' for "manifest.uuid" and 't' for
2820
+** "manifest.tags". The SQLite and Fossil repositories
2821
+** both require manifests. Default: off.
27832822
**
27842823
** max-loadavg Some CPU-intensive web pages (ex: /zip, /tarball, /blame)
27852824
** are disallowed if the system load average goes above this
27862825
** value. "0.0" means no limit. This only works on unix.
27872826
** Only local settings of this value make a difference since
27882827
--- src/db.c
+++ src/db.c
@@ -2270,10 +2270,46 @@
2270 return db_int(dflt, "SELECT value FROM vvar WHERE name=%Q", zName);
2271 }
2272 void db_lset_int(const char *zName, int value){
2273 db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value);
2274 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2275
2276 /*
2277 ** Record the name of a local repository in the global_config() database.
2278 ** The repository filename %s is recorded as an entry with a "name" field
2279 ** of the following form:
@@ -2570,11 +2606,11 @@
2570 { "https-login", 0, 0, 0, 0, "off" },
2571 { "ignore-glob", 0, 40, 1, 0, "" },
2572 { "keep-glob", 0, 40, 1, 0, "" },
2573 { "localauth", 0, 0, 0, 0, "off" },
2574 { "main-branch", 0, 40, 0, 0, "trunk" },
2575 { "manifest", 0, 0, 1, 0, "off" },
2576 { "max-loadavg", 0, 25, 0, 0, "0.0" },
2577 { "max-upload", 0, 25, 0, 0, "250000" },
2578 { "mtime-changes", 0, 0, 0, 0, "on" },
2579 #if FOSSIL_ENABLE_LEGACY_MV_RM
2580 { "mv-rm-files", 0, 0, 0, 0, "off" },
@@ -2775,13 +2811,16 @@
2775 ** false, all HTTP requests from localhost have
2776 ** unrestricted access to the repository.
2777 **
2778 ** main-branch The primary branch for the project. Default: trunk
2779 **
2780 ** manifest If enabled, automatically create files "manifest" and
2781 ** (versionable) "manifest.uuid" in every checkout. The SQLite and
2782 ** Fossil repositories both require this. Default: off.
 
 
 
2783 **
2784 ** max-loadavg Some CPU-intensive web pages (ex: /zip, /tarball, /blame)
2785 ** are disallowed if the system load average goes above this
2786 ** value. "0.0" means no limit. This only works on unix.
2787 ** Only local settings of this value make a difference since
2788
--- src/db.c
+++ src/db.c
@@ -2270,10 +2270,46 @@
2270 return db_int(dflt, "SELECT value FROM vvar WHERE name=%Q", zName);
2271 }
2272 void db_lset_int(const char *zName, int value){
2273 db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value);
2274 }
2275
2276 #if INTERFACE
2277 /* Manifest generation flags */
2278 #define MFESTFLG_RAW 0x01
2279 #define MFESTFLG_UUID 0x02
2280 #define MFESTFLG_TAGS 0x04
2281 #endif /* INTERFACE */
2282
2283 /*
2284 ** Get the manifest setting. For backwards compatibility first check if the
2285 ** value is a boolean. If it's not a boolean, treat each character as a flag
2286 ** to enable a manifest type. This system puts certain boundary conditions on
2287 ** which letters can be used to represent flags (any permutation of flags must
2288 ** not be able to fully form one of the boolean values).
2289 */
2290 int db_get_manifest_setting(void){
2291 int flg;
2292 char *zNVVal = db_get("manifest", "off");
2293 char *zVal = db_get_versioned("manifest", zNVVal);
2294 if( is_false(zVal) ){
2295 return 0;
2296 }else if( is_truth(zVal) ) {
2297 return MFESTFLG_RAW|MFESTFLG_UUID;
2298 }
2299 flg = 0;
2300 while( *zVal ){
2301 switch( *zVal ){
2302 case 'r': flg |= MFESTFLG_RAW; break;
2303 case 'u': flg |= MFESTFLG_UUID; break;
2304 case 't': flg |= MFESTFLG_TAGS; break;
2305 }
2306 zVal++;
2307 }
2308 return flg;
2309 }
2310
2311
2312 /*
2313 ** Record the name of a local repository in the global_config() database.
2314 ** The repository filename %s is recorded as an entry with a "name" field
2315 ** of the following form:
@@ -2570,11 +2606,11 @@
2606 { "https-login", 0, 0, 0, 0, "off" },
2607 { "ignore-glob", 0, 40, 1, 0, "" },
2608 { "keep-glob", 0, 40, 1, 0, "" },
2609 { "localauth", 0, 0, 0, 0, "off" },
2610 { "main-branch", 0, 40, 0, 0, "trunk" },
2611 { "manifest", 0, 5, 0, 0, "off" },
2612 { "max-loadavg", 0, 25, 0, 0, "0.0" },
2613 { "max-upload", 0, 25, 0, 0, "250000" },
2614 { "mtime-changes", 0, 0, 0, 0, "on" },
2615 #if FOSSIL_ENABLE_LEGACY_MV_RM
2616 { "mv-rm-files", 0, 0, 0, 0, "off" },
@@ -2775,13 +2811,16 @@
2811 ** false, all HTTP requests from localhost have
2812 ** unrestricted access to the repository.
2813 **
2814 ** main-branch The primary branch for the project. Default: trunk
2815 **
2816 ** manifest If set to a true boolean value, automatically create
2817 ** (versionable) files "manifest" and "manifest.uuid" in every checkout.
2818 ** Optionally use combinations of characters 'r'
2819 ** for "manifest", 'u' for "manifest.uuid" and 't' for
2820 ** "manifest.tags". The SQLite and Fossil repositories
2821 ** both require manifests. Default: off.
2822 **
2823 ** max-loadavg Some CPU-intensive web pages (ex: /zip, /tarball, /blame)
2824 ** are disallowed if the system load average goes above this
2825 ** value. "0.0" means no limit. This only works on unix.
2826 ** Only local settings of this value make a difference since
2827
+35 -34
--- src/diff.c
+++ src/diff.c
@@ -137,45 +137,42 @@
137137
const char *z,
138138
int n,
139139
int *pnLine,
140140
u64 diffFlags
141141
){
142
- int nLine, i, j, k, s, x;
142
+ int nLine, i, k, nn, s, x;
143143
unsigned int h, h2;
144144
DLine *a;
145
+ const char *zNL, *z2;
145146
146
- /* Count the number of lines. Allocate space to hold
147
- ** the returned array.
147
+ /* Count the number of lines in the input file. Include the last line
148
+ ** in the count even if it lacks the \n terminator
148149
*/
149
- for(i=j=0, nLine=1; i<n; i++, j++){
150
- int c = z[i];
151
- if( c==0 ){
152
- return 0;
153
- }
154
- if( c=='\n' && z[i+1]!=0 ){
155
- nLine++;
156
- if( j>LENGTH_MASK ){
157
- return 0;
158
- }
159
- j = 0;
160
- }
161
- }
162
- if( j>LENGTH_MASK ){
163
- return 0;
164
- }
165
- a = fossil_malloc( nLine*sizeof(a[0]) );
166
- memset(a, 0, nLine*sizeof(a[0]) );
167
- if( n==0 ){
150
+ for(nLine=0, z2=z; (zNL = strchr(z2,'\n'))!=0; z2=zNL+1, nLine++){}
151
+ if( z2[0]!=0 ){
152
+ nLine++;
153
+ do{ z2++; }while( z2[0] );
154
+ }
155
+ if( n!=(int)(z2-z) ) return 0;
156
+
157
+ a = fossil_malloc( sizeof(a[0])*nLine );
158
+ memset(a, 0, sizeof(a[0])*nLine);
159
+ if( nLine==0 ){
168160
*pnLine = 0;
169161
return a;
170162
}
171
-
172
- /* Fill in the array */
173
- for(i=0; i<nLine; i++){
174
- for(j=0; z[j] && z[j]!='\n'; j++){}
163
+ i = 0;
164
+ do{
165
+ zNL = strchr(z,'\n');
166
+ if( zNL==0 ) zNL = z+strlen(z);
167
+ nn = (int)(zNL - z);
168
+ if( nn>LENGTH_MASK ){
169
+ fossil_free(a);
170
+ return 0;
171
+ }
175172
a[i].z = z;
176
- k = j;
173
+ k = nn;
177174
if( diffFlags & DIFF_STRIP_EOLCR ){
178175
if( k>0 && z[k-1]=='\r' ){ k--; }
179176
}
180177
a[i].n = k;
181178
s = 0;
@@ -187,26 +184,30 @@
187184
while( s<k && fossil_isspace(z[s]) ){ s++; }
188185
for(h=0, x=s; x<k; x++){
189186
if( fossil_isspace(z[x]) ){
190187
++numws;
191188
}else{
192
- h = h ^ (h<<2) ^ z[x];
189
+ h += z[x];
190
+ h *= 0x9e3779b1;
193191
}
194192
}
195193
k -= numws;
196194
}else{
197195
for(h=0, x=s; x<k; x++){
198
- h = h ^ (h<<2) ^ z[x];
196
+ h += z[x];
197
+ h *= 0x9e3779b1;
199198
}
200199
}
201200
a[i].indent = s;
202201
a[i].h = h = (h<<LENGTH_MASK_SZ) | (k-s);
203202
h2 = h % nLine;
204203
a[i].iNext = a[h2].iHash;
205204
a[h2].iHash = i+1;
206
- z += j+1;
207
- }
205
+ z += nn+1;
206
+ i++;
207
+ }while( zNL[0] && zNL[1] );
208
+ assert( i==nLine );
208209
209210
/* Return results */
210211
*pnLine = nLine;
211212
return a;
212213
}
@@ -963,23 +964,23 @@
963964
if( nA>250 ) nA = 250;
964965
if( nB>250 ) nB = 250;
965966
avg = (nA+nB)/2;
966967
if( avg==0 ) return 0;
967968
if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0;
968
- memset(aFirst, 0, sizeof(aFirst));
969
+ memset(aFirst, 0xff, sizeof(aFirst));
969970
zA--; zB--; /* Make both zA[] and zB[] 1-indexed */
970971
for(i=nB; i>0; i--){
971972
c = (unsigned char)zB[i];
972973
aNext[i] = aFirst[c];
973974
aFirst[c] = i;
974975
}
975976
best = 0;
976977
for(i=1; i<=nA-best; i++){
977978
c = (unsigned char)zA[i];
978
- for(j=aFirst[c]; j>0 && j<nB-best; j = aNext[j]){
979
+ for(j=aFirst[c]; j<nB-best && memcmp(&zA[i],&zB[j],best)==0; j = aNext[j]){
979980
int limit = minInt(nA-i, nB-j);
980
- for(k=1; k<=limit && zA[k+i]==zB[k+j]; k++){}
981
+ for(k=best; k<=limit && zA[k+i]==zB[k+j]; k++){}
981982
if( k>best ) best = k;
982983
}
983984
}
984985
score = (best>avg) ? 0 : (avg - best)*100/avg;
985986
986987
--- src/diff.c
+++ src/diff.c
@@ -137,45 +137,42 @@
137 const char *z,
138 int n,
139 int *pnLine,
140 u64 diffFlags
141 ){
142 int nLine, i, j, k, s, x;
143 unsigned int h, h2;
144 DLine *a;
 
145
146 /* Count the number of lines. Allocate space to hold
147 ** the returned array.
148 */
149 for(i=j=0, nLine=1; i<n; i++, j++){
150 int c = z[i];
151 if( c==0 ){
152 return 0;
153 }
154 if( c=='\n' && z[i+1]!=0 ){
155 nLine++;
156 if( j>LENGTH_MASK ){
157 return 0;
158 }
159 j = 0;
160 }
161 }
162 if( j>LENGTH_MASK ){
163 return 0;
164 }
165 a = fossil_malloc( nLine*sizeof(a[0]) );
166 memset(a, 0, nLine*sizeof(a[0]) );
167 if( n==0 ){
168 *pnLine = 0;
169 return a;
170 }
171
172 /* Fill in the array */
173 for(i=0; i<nLine; i++){
174 for(j=0; z[j] && z[j]!='\n'; j++){}
 
 
 
 
 
175 a[i].z = z;
176 k = j;
177 if( diffFlags & DIFF_STRIP_EOLCR ){
178 if( k>0 && z[k-1]=='\r' ){ k--; }
179 }
180 a[i].n = k;
181 s = 0;
@@ -187,26 +184,30 @@
187 while( s<k && fossil_isspace(z[s]) ){ s++; }
188 for(h=0, x=s; x<k; x++){
189 if( fossil_isspace(z[x]) ){
190 ++numws;
191 }else{
192 h = h ^ (h<<2) ^ z[x];
 
193 }
194 }
195 k -= numws;
196 }else{
197 for(h=0, x=s; x<k; x++){
198 h = h ^ (h<<2) ^ z[x];
 
199 }
200 }
201 a[i].indent = s;
202 a[i].h = h = (h<<LENGTH_MASK_SZ) | (k-s);
203 h2 = h % nLine;
204 a[i].iNext = a[h2].iHash;
205 a[h2].iHash = i+1;
206 z += j+1;
207 }
 
 
208
209 /* Return results */
210 *pnLine = nLine;
211 return a;
212 }
@@ -963,23 +964,23 @@
963 if( nA>250 ) nA = 250;
964 if( nB>250 ) nB = 250;
965 avg = (nA+nB)/2;
966 if( avg==0 ) return 0;
967 if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0;
968 memset(aFirst, 0, sizeof(aFirst));
969 zA--; zB--; /* Make both zA[] and zB[] 1-indexed */
970 for(i=nB; i>0; i--){
971 c = (unsigned char)zB[i];
972 aNext[i] = aFirst[c];
973 aFirst[c] = i;
974 }
975 best = 0;
976 for(i=1; i<=nA-best; i++){
977 c = (unsigned char)zA[i];
978 for(j=aFirst[c]; j>0 && j<nB-best; j = aNext[j]){
979 int limit = minInt(nA-i, nB-j);
980 for(k=1; k<=limit && zA[k+i]==zB[k+j]; k++){}
981 if( k>best ) best = k;
982 }
983 }
984 score = (best>avg) ? 0 : (avg - best)*100/avg;
985
986
--- src/diff.c
+++ src/diff.c
@@ -137,45 +137,42 @@
137 const char *z,
138 int n,
139 int *pnLine,
140 u64 diffFlags
141 ){
142 int nLine, i, k, nn, s, x;
143 unsigned int h, h2;
144 DLine *a;
145 const char *zNL, *z2;
146
147 /* Count the number of lines in the input file. Include the last line
148 ** in the count even if it lacks the \n terminator
149 */
150 for(nLine=0, z2=z; (zNL = strchr(z2,'\n'))!=0; z2=zNL+1, nLine++){}
151 if( z2[0]!=0 ){
152 nLine++;
153 do{ z2++; }while( z2[0] );
154 }
155 if( n!=(int)(z2-z) ) return 0;
156
157 a = fossil_malloc( sizeof(a[0])*nLine );
158 memset(a, 0, sizeof(a[0])*nLine);
159 if( nLine==0 ){
 
 
 
 
 
 
 
 
 
160 *pnLine = 0;
161 return a;
162 }
163 i = 0;
164 do{
165 zNL = strchr(z,'\n');
166 if( zNL==0 ) zNL = z+strlen(z);
167 nn = (int)(zNL - z);
168 if( nn>LENGTH_MASK ){
169 fossil_free(a);
170 return 0;
171 }
172 a[i].z = z;
173 k = nn;
174 if( diffFlags & DIFF_STRIP_EOLCR ){
175 if( k>0 && z[k-1]=='\r' ){ k--; }
176 }
177 a[i].n = k;
178 s = 0;
@@ -187,26 +184,30 @@
184 while( s<k && fossil_isspace(z[s]) ){ s++; }
185 for(h=0, x=s; x<k; x++){
186 if( fossil_isspace(z[x]) ){
187 ++numws;
188 }else{
189 h += z[x];
190 h *= 0x9e3779b1;
191 }
192 }
193 k -= numws;
194 }else{
195 for(h=0, x=s; x<k; x++){
196 h += z[x];
197 h *= 0x9e3779b1;
198 }
199 }
200 a[i].indent = s;
201 a[i].h = h = (h<<LENGTH_MASK_SZ) | (k-s);
202 h2 = h % nLine;
203 a[i].iNext = a[h2].iHash;
204 a[h2].iHash = i+1;
205 z += nn+1;
206 i++;
207 }while( zNL[0] && zNL[1] );
208 assert( i==nLine );
209
210 /* Return results */
211 *pnLine = nLine;
212 return a;
213 }
@@ -963,23 +964,23 @@
964 if( nA>250 ) nA = 250;
965 if( nB>250 ) nB = 250;
966 avg = (nA+nB)/2;
967 if( avg==0 ) return 0;
968 if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0;
969 memset(aFirst, 0xff, sizeof(aFirst));
970 zA--; zB--; /* Make both zA[] and zB[] 1-indexed */
971 for(i=nB; i>0; i--){
972 c = (unsigned char)zB[i];
973 aNext[i] = aFirst[c];
974 aFirst[c] = i;
975 }
976 best = 0;
977 for(i=1; i<=nA-best; i++){
978 c = (unsigned char)zA[i];
979 for(j=aFirst[c]; j<nB-best && memcmp(&zA[i],&zB[j],best)==0; j = aNext[j]){
980 int limit = minInt(nA-i, nB-j);
981 for(k=best; k<=limit && zA[k+i]==zB[k+j]; k++){}
982 if( k>best ) best = k;
983 }
984 }
985 score = (best>avg) ? 0 : (avg - best)*100/avg;
986
987
+26 -5
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -773,10 +773,13 @@
773773
**
774774
** If the "--to VERSION" option appears, it specifies the check-in from
775775
** which the second version of the file or files is taken. If there is
776776
** no "--to" option then the (possibly edited) files in the current check-out
777777
** are used.
778
+**
779
+** The "--checkin VERSION" option shows the changes made by
780
+** check-in VERSION relative to its primary parent.
778781
**
779782
** The "-i" command-line option forces the use of the internal diff logic
780783
** rather than any external diff program that might be configured using
781784
** the "setting" command. If no external diff program is configured, then
782785
** the "-i" option is a no-op. The "-i" option converts "gdiff" into "diff".
@@ -793,10 +796,11 @@
793796
**
794797
** Options:
795798
** --binary PATTERN Treat files that match the glob PATTERN as binary
796799
** --branch BRANCH Show diff of all changes on BRANCH
797800
** --brief Show filenames only
801
+** --checkin VERSION Show diff of all changes in VERSION
798802
** --context|-c N Use N lines of context
799803
** --diff-binary BOOL Include binary files when using external commands
800804
** --exec-abs-paths Force absolute path names with external commands.
801805
** --exec-rel-paths Force relative path names with external commands.
802806
** --from|-r VERSION Select VERSION as source for the diff
@@ -816,10 +820,11 @@
816820
int isGDiff; /* True for gdiff. False for normal diff */
817821
int isInternDiff; /* True for internal diff */
818822
int verboseFlag; /* True if -v or --verbose flag is used */
819823
const char *zFrom; /* Source version number */
820824
const char *zTo; /* Target version number */
825
+ const char *zCheckin; /* Check-in version number */
821826
const char *zBranch; /* Branch to diff */
822827
const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
823828
const char *zBinGlob = 0; /* Treat file names matching this as binary */
824829
int fIncludeBinary = 0; /* Include binary files for external diff */
825830
int againstUndo = 0; /* Diff against files in the undo buffer */
@@ -832,28 +837,33 @@
832837
}
833838
isGDiff = g.argv[1][0]=='g';
834839
isInternDiff = find_option("internal","i",0)!=0;
835840
zFrom = find_option("from", "r", 1);
836841
zTo = find_option("to", 0, 1);
842
+ zCheckin = find_option("checkin", 0, 1);
837843
zBranch = find_option("branch", 0, 1);
838844
againstUndo = find_option("undo",0,0)!=0;
839845
diffFlags = diff_options();
840846
verboseFlag = find_option("verbose","v",0)!=0;
841847
if( !verboseFlag ){
842848
verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */
843849
}
844850
if( verboseFlag ) diffFlags |= DIFF_VERBOSE;
845
- if( againstUndo && (zFrom!=0 || zTo!=0 || zBranch!=0) ){
846
- fossil_fatal("cannot use --undo together with --from or --to or --branch");
851
+ if( againstUndo && ( zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){
852
+ fossil_fatal("cannot use --undo together with --from, --to, --checkin,"
853
+ " or --branch");
847854
}
848855
if( zBranch ){
849
- if( zTo || zFrom ){
850
- fossil_fatal("cannot use --from or --to with --branch");
856
+ if( zTo || zFrom || zCheckin ){
857
+ fossil_fatal("cannot use --from, --to, or --checkin with --branch");
851858
}
852859
zTo = zBranch;
853860
zFrom = mprintf("root:%s", zBranch);
854861
}
862
+ if( zCheckin!=0 && ( zFrom!=0 || zTo!=0 ) ){
863
+ fossil_fatal("cannot use --checkin together with --from or --to");
864
+ }
855865
if( zTo==0 || againstUndo ){
856866
db_must_be_within_tree();
857867
}else if( zFrom==0 ){
858868
fossil_fatal("must use --from if --to is present");
859869
}else{
@@ -881,10 +891,21 @@
881891
}
882892
pFileDir[i-2].nName = blob_size(&fname);
883893
pFileDir[i-2].nUsed = 0;
884894
blob_reset(&fname);
885895
}
896
+ }
897
+ if ( zCheckin!=0 ){
898
+ int ridTo = name_to_typed_rid(zCheckin, "ci");
899
+ zTo = zCheckin;
900
+ zFrom = db_text(0,
901
+ "SELECT uuid FROM blob, plink"
902
+ " WHERE plink.cid=%d AND plink.isprim AND plink.pid=blob.rid",
903
+ ridTo);
904
+ if( zFrom==0 ){
905
+ fossil_fatal("check-in %s has no parent", zTo);
906
+ }
886907
}
887908
if( againstUndo ){
888909
if( db_lget_int("undo_available",0)==0 ){
889910
fossil_print("No undo or redo is available\n");
890911
return;
@@ -901,11 +922,11 @@
901922
if( pFileDir ){
902923
int i;
903924
for(i=0; pFileDir[i].zName; i++){
904925
if( pFileDir[i].nUsed==0
905926
&& strcmp(pFileDir[0].zName,".")!=0
906
- && !file_isdir(g.argv[i+2])
927
+ && !file_wd_isdir(g.argv[i+2])
907928
){
908929
fossil_fatal("not found: '%s'", g.argv[i+2]);
909930
}
910931
fossil_free(pFileDir[i].zName);
911932
}
912933
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -773,10 +773,13 @@
773 **
774 ** If the "--to VERSION" option appears, it specifies the check-in from
775 ** which the second version of the file or files is taken. If there is
776 ** no "--to" option then the (possibly edited) files in the current check-out
777 ** are used.
 
 
 
778 **
779 ** The "-i" command-line option forces the use of the internal diff logic
780 ** rather than any external diff program that might be configured using
781 ** the "setting" command. If no external diff program is configured, then
782 ** the "-i" option is a no-op. The "-i" option converts "gdiff" into "diff".
@@ -793,10 +796,11 @@
793 **
794 ** Options:
795 ** --binary PATTERN Treat files that match the glob PATTERN as binary
796 ** --branch BRANCH Show diff of all changes on BRANCH
797 ** --brief Show filenames only
 
798 ** --context|-c N Use N lines of context
799 ** --diff-binary BOOL Include binary files when using external commands
800 ** --exec-abs-paths Force absolute path names with external commands.
801 ** --exec-rel-paths Force relative path names with external commands.
802 ** --from|-r VERSION Select VERSION as source for the diff
@@ -816,10 +820,11 @@
816 int isGDiff; /* True for gdiff. False for normal diff */
817 int isInternDiff; /* True for internal diff */
818 int verboseFlag; /* True if -v or --verbose flag is used */
819 const char *zFrom; /* Source version number */
820 const char *zTo; /* Target version number */
 
821 const char *zBranch; /* Branch to diff */
822 const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
823 const char *zBinGlob = 0; /* Treat file names matching this as binary */
824 int fIncludeBinary = 0; /* Include binary files for external diff */
825 int againstUndo = 0; /* Diff against files in the undo buffer */
@@ -832,28 +837,33 @@
832 }
833 isGDiff = g.argv[1][0]=='g';
834 isInternDiff = find_option("internal","i",0)!=0;
835 zFrom = find_option("from", "r", 1);
836 zTo = find_option("to", 0, 1);
 
837 zBranch = find_option("branch", 0, 1);
838 againstUndo = find_option("undo",0,0)!=0;
839 diffFlags = diff_options();
840 verboseFlag = find_option("verbose","v",0)!=0;
841 if( !verboseFlag ){
842 verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */
843 }
844 if( verboseFlag ) diffFlags |= DIFF_VERBOSE;
845 if( againstUndo && (zFrom!=0 || zTo!=0 || zBranch!=0) ){
846 fossil_fatal("cannot use --undo together with --from or --to or --branch");
 
847 }
848 if( zBranch ){
849 if( zTo || zFrom ){
850 fossil_fatal("cannot use --from or --to with --branch");
851 }
852 zTo = zBranch;
853 zFrom = mprintf("root:%s", zBranch);
854 }
 
 
 
855 if( zTo==0 || againstUndo ){
856 db_must_be_within_tree();
857 }else if( zFrom==0 ){
858 fossil_fatal("must use --from if --to is present");
859 }else{
@@ -881,10 +891,21 @@
881 }
882 pFileDir[i-2].nName = blob_size(&fname);
883 pFileDir[i-2].nUsed = 0;
884 blob_reset(&fname);
885 }
 
 
 
 
 
 
 
 
 
 
 
886 }
887 if( againstUndo ){
888 if( db_lget_int("undo_available",0)==0 ){
889 fossil_print("No undo or redo is available\n");
890 return;
@@ -901,11 +922,11 @@
901 if( pFileDir ){
902 int i;
903 for(i=0; pFileDir[i].zName; i++){
904 if( pFileDir[i].nUsed==0
905 && strcmp(pFileDir[0].zName,".")!=0
906 && !file_isdir(g.argv[i+2])
907 ){
908 fossil_fatal("not found: '%s'", g.argv[i+2]);
909 }
910 fossil_free(pFileDir[i].zName);
911 }
912
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -773,10 +773,13 @@
773 **
774 ** If the "--to VERSION" option appears, it specifies the check-in from
775 ** which the second version of the file or files is taken. If there is
776 ** no "--to" option then the (possibly edited) files in the current check-out
777 ** are used.
778 **
779 ** The "--checkin VERSION" option shows the changes made by
780 ** check-in VERSION relative to its primary parent.
781 **
782 ** The "-i" command-line option forces the use of the internal diff logic
783 ** rather than any external diff program that might be configured using
784 ** the "setting" command. If no external diff program is configured, then
785 ** the "-i" option is a no-op. The "-i" option converts "gdiff" into "diff".
@@ -793,10 +796,11 @@
796 **
797 ** Options:
798 ** --binary PATTERN Treat files that match the glob PATTERN as binary
799 ** --branch BRANCH Show diff of all changes on BRANCH
800 ** --brief Show filenames only
801 ** --checkin VERSION Show diff of all changes in VERSION
802 ** --context|-c N Use N lines of context
803 ** --diff-binary BOOL Include binary files when using external commands
804 ** --exec-abs-paths Force absolute path names with external commands.
805 ** --exec-rel-paths Force relative path names with external commands.
806 ** --from|-r VERSION Select VERSION as source for the diff
@@ -816,10 +820,11 @@
820 int isGDiff; /* True for gdiff. False for normal diff */
821 int isInternDiff; /* True for internal diff */
822 int verboseFlag; /* True if -v or --verbose flag is used */
823 const char *zFrom; /* Source version number */
824 const char *zTo; /* Target version number */
825 const char *zCheckin; /* Check-in version number */
826 const char *zBranch; /* Branch to diff */
827 const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
828 const char *zBinGlob = 0; /* Treat file names matching this as binary */
829 int fIncludeBinary = 0; /* Include binary files for external diff */
830 int againstUndo = 0; /* Diff against files in the undo buffer */
@@ -832,28 +837,33 @@
837 }
838 isGDiff = g.argv[1][0]=='g';
839 isInternDiff = find_option("internal","i",0)!=0;
840 zFrom = find_option("from", "r", 1);
841 zTo = find_option("to", 0, 1);
842 zCheckin = find_option("checkin", 0, 1);
843 zBranch = find_option("branch", 0, 1);
844 againstUndo = find_option("undo",0,0)!=0;
845 diffFlags = diff_options();
846 verboseFlag = find_option("verbose","v",0)!=0;
847 if( !verboseFlag ){
848 verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */
849 }
850 if( verboseFlag ) diffFlags |= DIFF_VERBOSE;
851 if( againstUndo && ( zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){
852 fossil_fatal("cannot use --undo together with --from, --to, --checkin,"
853 " or --branch");
854 }
855 if( zBranch ){
856 if( zTo || zFrom || zCheckin ){
857 fossil_fatal("cannot use --from, --to, or --checkin with --branch");
858 }
859 zTo = zBranch;
860 zFrom = mprintf("root:%s", zBranch);
861 }
862 if( zCheckin!=0 && ( zFrom!=0 || zTo!=0 ) ){
863 fossil_fatal("cannot use --checkin together with --from or --to");
864 }
865 if( zTo==0 || againstUndo ){
866 db_must_be_within_tree();
867 }else if( zFrom==0 ){
868 fossil_fatal("must use --from if --to is present");
869 }else{
@@ -881,10 +891,21 @@
891 }
892 pFileDir[i-2].nName = blob_size(&fname);
893 pFileDir[i-2].nUsed = 0;
894 blob_reset(&fname);
895 }
896 }
897 if ( zCheckin!=0 ){
898 int ridTo = name_to_typed_rid(zCheckin, "ci");
899 zTo = zCheckin;
900 zFrom = db_text(0,
901 "SELECT uuid FROM blob, plink"
902 " WHERE plink.cid=%d AND plink.isprim AND plink.pid=blob.rid",
903 ridTo);
904 if( zFrom==0 ){
905 fossil_fatal("check-in %s has no parent", zTo);
906 }
907 }
908 if( againstUndo ){
909 if( db_lget_int("undo_available",0)==0 ){
910 fossil_print("No undo or redo is available\n");
911 return;
@@ -901,11 +922,11 @@
922 if( pFileDir ){
923 int i;
924 for(i=0; pFileDir[i].zName; i++){
925 if( pFileDir[i].nUsed==0
926 && strcmp(pFileDir[0].zName,".")!=0
927 && !file_wd_isdir(g.argv[i+2])
928 ){
929 fossil_fatal("not found: '%s'", g.argv[i+2]);
930 }
931 fossil_free(pFileDir[i].zName);
932 }
933
+62 -11
--- src/file.c
+++ src/file.c
@@ -293,24 +293,36 @@
293293
}
294294
return rc ? 0 : (S_ISDIR(fileStat.st_mode) ? 1 : 2);
295295
}
296296
297297
/*
298
-** Same as file_isdir(), but takes into account symlinks.
298
+** Same as file_isdir(), but takes into account symlinks. Return 1 if
299
+** zFilename is a directory -OR- a symlink that points to a directory.
300
+** Return 0 if zFilename does not exist. Return 2 if zFilename exists
301
+** but is something other than a directory.
299302
*/
300303
int file_wd_isdir(const char *zFilename){
301304
int rc;
305
+ char *zFN;
302306
303
- if( zFilename ){
304
- char *zFN = mprintf("%s", zFilename);
305
- file_simplify_name(zFN, -1, 0);
306
- rc = getStat(zFN, 1);
307
- free(zFN);
307
+ zFN = mprintf("%s", zFilename);
308
+ file_simplify_name(zFN, -1, 0);
309
+ rc = getStat(zFN, 1);
310
+ if( rc ){
311
+ rc = 0; /* It does not exist at all. */
312
+ }else if( S_ISDIR(fileStat.st_mode) ){
313
+ rc = 1; /* It exists and is a real directory. */
314
+ }else if( S_ISLNK(fileStat.st_mode) ){
315
+ Blob content;
316
+ blob_read_link(&content, zFN); /* It exists and is a link. */
317
+ rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */
318
+ blob_reset(&content);
308319
}else{
309
- rc = getStat(0, 1);
320
+ rc = 2; /* It exists and is something else. */
310321
}
311
- return rc ? 0 : (S_ISDIR(fileStat.st_mode) ? 1 : 2);
322
+ free(zFN);
323
+ return rc;
312324
}
313325
314326
315327
/*
316328
** Wrapper around the access() system call.
@@ -471,16 +483,16 @@
471483
#if !defined(_WIN32)
472484
struct stat buf;
473485
if( fossil_stat(zFilename, &buf, 1)!=0 || S_ISLNK(buf.st_mode) ) return 0;
474486
if( onoff ){
475487
int targetMode = (buf.st_mode & 0444)>>2;
476
- if( (buf.st_mode & 0100) == 0 ){
488
+ if( (buf.st_mode & 0100)==0 ){
477489
chmod(zFilename, buf.st_mode | targetMode);
478490
rc = 1;
479491
}
480492
}else{
481
- if( (buf.st_mode & 0100) != 0 ){
493
+ if( (buf.st_mode & 0100)!=0 ){
482494
chmod(zFilename, buf.st_mode & ~0111);
483495
rc = 1;
484496
}
485497
}
486498
#endif /* _WIN32 */
@@ -600,11 +612,11 @@
600612
** The if stops us from trying to create a directory of a drive letter
601613
** C: in this example.
602614
*/
603615
if( !(i==2 && zName[1]==':') ){
604616
#endif
605
- if( file_mkdir(zName, forceFlag) && file_isdir(zName)!=1 ){
617
+ if( file_mkdir(zName, forceFlag) && file_wd_isdir(zName)!=1 ){
606618
if (errorReturn <= 0) {
607619
fossil_fatal_recursive("unable to create directory %s", zName);
608620
}
609621
rc = errorReturn;
610622
break;
@@ -1384,5 +1396,44 @@
13841396
#else
13851397
FILE *f = fopen(zName, zMode);
13861398
#endif
13871399
return f;
13881400
}
1401
+
1402
+/*
1403
+** Return non-NULL if zFilename contains pathname elements that
1404
+** are reserved on Windows. The returned string is the disallowed
1405
+** path element.
1406
+*/
1407
+const char *file_is_win_reserved(const char *zPath){
1408
+ static const char *azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" };
1409
+ static char zReturn[5];
1410
+ int i;
1411
+ while( zPath[0] ){
1412
+ for(i=0; i<ArraySize(azRes); i++){
1413
+ if( sqlite3_strnicmp(zPath, azRes[i], 3)==0
1414
+ && ((i>=4 && fossil_isdigit(zPath[3])
1415
+ && (zPath[4]=='/' || zPath[4]=='.' || zPath[4]==0))
1416
+ || (i<4 && (zPath[3]=='/' || zPath[3]=='.' || zPath[3]==0)))
1417
+ ){
1418
+ sqlite3_snprintf(5,zReturn,"%.*s", i>=4 ? 4 : 3, zPath);
1419
+ return zReturn;
1420
+ }
1421
+ }
1422
+ while( zPath[0] && zPath[0]!='/' ) zPath++;
1423
+ while( zPath[0]=='/' ) zPath++;
1424
+ }
1425
+ return 0;
1426
+}
1427
+
1428
+/*
1429
+** COMMAND: test-valid-for-windows
1430
+** Usage: fossil test-valid-for-windows FILENAME ....
1431
+**
1432
+** Show which filenames are not valid for Windows
1433
+*/
1434
+void file_test_valid_for_windows(void){
1435
+ int i;
1436
+ for(i=2; i<g.argc; i++){
1437
+ fossil_print("%s %s\n", file_is_win_reserved(g.argv[i]), g.argv[i]);
1438
+ }
1439
+}
13891440
--- src/file.c
+++ src/file.c
@@ -293,24 +293,36 @@
293 }
294 return rc ? 0 : (S_ISDIR(fileStat.st_mode) ? 1 : 2);
295 }
296
297 /*
298 ** Same as file_isdir(), but takes into account symlinks.
 
 
 
299 */
300 int file_wd_isdir(const char *zFilename){
301 int rc;
 
302
303 if( zFilename ){
304 char *zFN = mprintf("%s", zFilename);
305 file_simplify_name(zFN, -1, 0);
306 rc = getStat(zFN, 1);
307 free(zFN);
 
 
 
 
 
 
 
308 }else{
309 rc = getStat(0, 1);
310 }
311 return rc ? 0 : (S_ISDIR(fileStat.st_mode) ? 1 : 2);
 
312 }
313
314
315 /*
316 ** Wrapper around the access() system call.
@@ -471,16 +483,16 @@
471 #if !defined(_WIN32)
472 struct stat buf;
473 if( fossil_stat(zFilename, &buf, 1)!=0 || S_ISLNK(buf.st_mode) ) return 0;
474 if( onoff ){
475 int targetMode = (buf.st_mode & 0444)>>2;
476 if( (buf.st_mode & 0100) == 0 ){
477 chmod(zFilename, buf.st_mode | targetMode);
478 rc = 1;
479 }
480 }else{
481 if( (buf.st_mode & 0100) != 0 ){
482 chmod(zFilename, buf.st_mode & ~0111);
483 rc = 1;
484 }
485 }
486 #endif /* _WIN32 */
@@ -600,11 +612,11 @@
600 ** The if stops us from trying to create a directory of a drive letter
601 ** C: in this example.
602 */
603 if( !(i==2 && zName[1]==':') ){
604 #endif
605 if( file_mkdir(zName, forceFlag) && file_isdir(zName)!=1 ){
606 if (errorReturn <= 0) {
607 fossil_fatal_recursive("unable to create directory %s", zName);
608 }
609 rc = errorReturn;
610 break;
@@ -1384,5 +1396,44 @@
1384 #else
1385 FILE *f = fopen(zName, zMode);
1386 #endif
1387 return f;
1388 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1389
--- src/file.c
+++ src/file.c
@@ -293,24 +293,36 @@
293 }
294 return rc ? 0 : (S_ISDIR(fileStat.st_mode) ? 1 : 2);
295 }
296
297 /*
298 ** Same as file_isdir(), but takes into account symlinks. Return 1 if
299 ** zFilename is a directory -OR- a symlink that points to a directory.
300 ** Return 0 if zFilename does not exist. Return 2 if zFilename exists
301 ** but is something other than a directory.
302 */
303 int file_wd_isdir(const char *zFilename){
304 int rc;
305 char *zFN;
306
307 zFN = mprintf("%s", zFilename);
308 file_simplify_name(zFN, -1, 0);
309 rc = getStat(zFN, 1);
310 if( rc ){
311 rc = 0; /* It does not exist at all. */
312 }else if( S_ISDIR(fileStat.st_mode) ){
313 rc = 1; /* It exists and is a real directory. */
314 }else if( S_ISLNK(fileStat.st_mode) ){
315 Blob content;
316 blob_read_link(&content, zFN); /* It exists and is a link. */
317 rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */
318 blob_reset(&content);
319 }else{
320 rc = 2; /* It exists and is something else. */
321 }
322 free(zFN);
323 return rc;
324 }
325
326
327 /*
328 ** Wrapper around the access() system call.
@@ -471,16 +483,16 @@
483 #if !defined(_WIN32)
484 struct stat buf;
485 if( fossil_stat(zFilename, &buf, 1)!=0 || S_ISLNK(buf.st_mode) ) return 0;
486 if( onoff ){
487 int targetMode = (buf.st_mode & 0444)>>2;
488 if( (buf.st_mode & 0100)==0 ){
489 chmod(zFilename, buf.st_mode | targetMode);
490 rc = 1;
491 }
492 }else{
493 if( (buf.st_mode & 0100)!=0 ){
494 chmod(zFilename, buf.st_mode & ~0111);
495 rc = 1;
496 }
497 }
498 #endif /* _WIN32 */
@@ -600,11 +612,11 @@
612 ** The if stops us from trying to create a directory of a drive letter
613 ** C: in this example.
614 */
615 if( !(i==2 && zName[1]==':') ){
616 #endif
617 if( file_mkdir(zName, forceFlag) && file_wd_isdir(zName)!=1 ){
618 if (errorReturn <= 0) {
619 fossil_fatal_recursive("unable to create directory %s", zName);
620 }
621 rc = errorReturn;
622 break;
@@ -1384,5 +1396,44 @@
1396 #else
1397 FILE *f = fopen(zName, zMode);
1398 #endif
1399 return f;
1400 }
1401
1402 /*
1403 ** Return non-NULL if zFilename contains pathname elements that
1404 ** are reserved on Windows. The returned string is the disallowed
1405 ** path element.
1406 */
1407 const char *file_is_win_reserved(const char *zPath){
1408 static const char *azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" };
1409 static char zReturn[5];
1410 int i;
1411 while( zPath[0] ){
1412 for(i=0; i<ArraySize(azRes); i++){
1413 if( sqlite3_strnicmp(zPath, azRes[i], 3)==0
1414 && ((i>=4 && fossil_isdigit(zPath[3])
1415 && (zPath[4]=='/' || zPath[4]=='.' || zPath[4]==0))
1416 || (i<4 && (zPath[3]=='/' || zPath[3]=='.' || zPath[3]==0)))
1417 ){
1418 sqlite3_snprintf(5,zReturn,"%.*s", i>=4 ? 4 : 3, zPath);
1419 return zReturn;
1420 }
1421 }
1422 while( zPath[0] && zPath[0]!='/' ) zPath++;
1423 while( zPath[0]=='/' ) zPath++;
1424 }
1425 return 0;
1426 }
1427
1428 /*
1429 ** COMMAND: test-valid-for-windows
1430 ** Usage: fossil test-valid-for-windows FILENAME ....
1431 **
1432 ** Show which filenames are not valid for Windows
1433 */
1434 void file_test_valid_for_windows(void){
1435 int i;
1436 for(i=2; i<g.argc; i++){
1437 fossil_print("%s %s\n", file_is_win_reserved(g.argv[i]), g.argv[i]);
1438 }
1439 }
1440
+1 -1
--- src/finfo.c
+++ src/finfo.c
@@ -705,11 +705,11 @@
705705
int isExec = db_column_int(&q,6);
706706
int isAux = db_column_int(&q,7);
707707
@ <tr>
708708
@ <td><a href='%R/finfo?name=%t(zName)'>%h(zName)</a></td>
709709
if( zParent ){
710
- @ <td><a href='%R/info/%!S(zPid)'>%S(zParent)</a></td>
710
+ @ <td><a href='%R/info/%!S(zParent)'>%S(zParent)</a></td>
711711
}else{
712712
@ <td><i>(New)</i></td>
713713
}
714714
@ <td align='center'>%s(isAux?"&#x2713;":"")</td>
715715
if( zFid ){
716716
--- src/finfo.c
+++ src/finfo.c
@@ -705,11 +705,11 @@
705 int isExec = db_column_int(&q,6);
706 int isAux = db_column_int(&q,7);
707 @ <tr>
708 @ <td><a href='%R/finfo?name=%t(zName)'>%h(zName)</a></td>
709 if( zParent ){
710 @ <td><a href='%R/info/%!S(zPid)'>%S(zParent)</a></td>
711 }else{
712 @ <td><i>(New)</i></td>
713 }
714 @ <td align='center'>%s(isAux?"&#x2713;":"")</td>
715 if( zFid ){
716
--- src/finfo.c
+++ src/finfo.c
@@ -705,11 +705,11 @@
705 int isExec = db_column_int(&q,6);
706 int isAux = db_column_int(&q,7);
707 @ <tr>
708 @ <td><a href='%R/finfo?name=%t(zName)'>%h(zName)</a></td>
709 if( zParent ){
710 @ <td><a href='%R/info/%!S(zParent)'>%S(zParent)</a></td>
711 }else{
712 @ <td><i>(New)</i></td>
713 }
714 @ <td align='center'>%s(isAux?"&#x2713;":"")</td>
715 if( zFid ){
716
--- src/main.mk
+++ src/main.mk
@@ -498,10 +498,12 @@
498498
-DSQLITE_OMIT_DECLTYPE \
499499
-DSQLITE_OMIT_DEPRECATED \
500500
-DSQLITE_OMIT_PROGRESS_CALLBACK \
501501
-DSQLITE_OMIT_SHARED_CACHE \
502502
-DSQLITE_OMIT_LOAD_EXTENSION \
503
+ -DSQLITE_MAX_EXPR_DEPTH=0 \
504
+ -DSQLITE_USE_ALLOCA \
503505
-DSQLITE_ENABLE_LOCKING_STYLE=0 \
504506
-DSQLITE_DEFAULT_FILE_FORMAT=4 \
505507
-DSQLITE_ENABLE_EXPLAIN_COMMENTS \
506508
-DSQLITE_ENABLE_FTS4 \
507509
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
508510
--- src/main.mk
+++ src/main.mk
@@ -498,10 +498,12 @@
498 -DSQLITE_OMIT_DECLTYPE \
499 -DSQLITE_OMIT_DEPRECATED \
500 -DSQLITE_OMIT_PROGRESS_CALLBACK \
501 -DSQLITE_OMIT_SHARED_CACHE \
502 -DSQLITE_OMIT_LOAD_EXTENSION \
 
 
503 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
504 -DSQLITE_DEFAULT_FILE_FORMAT=4 \
505 -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
506 -DSQLITE_ENABLE_FTS4 \
507 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
508
--- src/main.mk
+++ src/main.mk
@@ -498,10 +498,12 @@
498 -DSQLITE_OMIT_DECLTYPE \
499 -DSQLITE_OMIT_DEPRECATED \
500 -DSQLITE_OMIT_PROGRESS_CALLBACK \
501 -DSQLITE_OMIT_SHARED_CACHE \
502 -DSQLITE_OMIT_LOAD_EXTENSION \
503 -DSQLITE_MAX_EXPR_DEPTH=0 \
504 -DSQLITE_USE_ALLOCA \
505 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
506 -DSQLITE_DEFAULT_FILE_FORMAT=4 \
507 -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
508 -DSQLITE_ENABLE_FTS4 \
509 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
510
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -164,10 +164,12 @@
164164
-DSQLITE_OMIT_DECLTYPE
165165
-DSQLITE_OMIT_DEPRECATED
166166
-DSQLITE_OMIT_PROGRESS_CALLBACK
167167
-DSQLITE_OMIT_SHARED_CACHE
168168
-DSQLITE_OMIT_LOAD_EXTENSION
169
+ -DSQLITE_MAX_EXPR_DEPTH=0
170
+ -DSQLITE_USE_ALLOCA
169171
-DSQLITE_ENABLE_LOCKING_STYLE=0
170172
-DSQLITE_DEFAULT_FILE_FORMAT=4
171173
-DSQLITE_ENABLE_EXPLAIN_COMMENTS
172174
-DSQLITE_ENABLE_FTS4
173175
-DSQLITE_ENABLE_FTS3_PARENTHESIS
174176
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -164,10 +164,12 @@
164 -DSQLITE_OMIT_DECLTYPE
165 -DSQLITE_OMIT_DEPRECATED
166 -DSQLITE_OMIT_PROGRESS_CALLBACK
167 -DSQLITE_OMIT_SHARED_CACHE
168 -DSQLITE_OMIT_LOAD_EXTENSION
 
 
169 -DSQLITE_ENABLE_LOCKING_STYLE=0
170 -DSQLITE_DEFAULT_FILE_FORMAT=4
171 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
172 -DSQLITE_ENABLE_FTS4
173 -DSQLITE_ENABLE_FTS3_PARENTHESIS
174
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -164,10 +164,12 @@
164 -DSQLITE_OMIT_DECLTYPE
165 -DSQLITE_OMIT_DEPRECATED
166 -DSQLITE_OMIT_PROGRESS_CALLBACK
167 -DSQLITE_OMIT_SHARED_CACHE
168 -DSQLITE_OMIT_LOAD_EXTENSION
169 -DSQLITE_MAX_EXPR_DEPTH=0
170 -DSQLITE_USE_ALLOCA
171 -DSQLITE_ENABLE_LOCKING_STYLE=0
172 -DSQLITE_DEFAULT_FILE_FORMAT=4
173 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
174 -DSQLITE_ENABLE_FTS4
175 -DSQLITE_ENABLE_FTS3_PARENTHESIS
176
+1074 -1084
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -381,11 +381,11 @@
381381
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
382382
** [sqlite_version()] and [sqlite_source_id()].
383383
*/
384384
#define SQLITE_VERSION "3.15.0"
385385
#define SQLITE_VERSION_NUMBER 3015000
386
-#define SQLITE_SOURCE_ID "2016-09-22 18:53:13 c3774c6a5fe48af91fda28e9e18c6ed9053ea992"
386
+#define SQLITE_SOURCE_ID "2016-10-04 12:20:12 3a9d802fda10585654332b314d317250dc5d894e"
387387
388388
/*
389389
** CAPI3REF: Run-Time Library Version Numbers
390390
** KEYWORDS: sqlite3_version, sqlite3_sourceid
391391
**
@@ -8915,11 +8915,11 @@
89158915
89168916
/*
89178917
** CAPI3REF: Set a table filter on a Session Object.
89188918
**
89198919
** The second argument (xFilter) is the "filter callback". For changes to rows
8920
-** in tables that are not attached to the Session oject, the filter is called
8920
+** in tables that are not attached to the Session object, the filter is called
89218921
** to determine whether changes to the table's rows should be tracked or not.
89228922
** If xFilter returns 0, changes is not tracked. Note that once a table is
89238923
** attached, xFilter will not be called again.
89248924
*/
89258925
void sqlite3session_table_filter(
@@ -9181,11 +9181,11 @@
91819181
** Assuming the changeset blob was created by one of the
91829182
** [sqlite3session_changeset()], [sqlite3changeset_concat()] or
91839183
** [sqlite3changeset_invert()] functions, all changes within the changeset
91849184
** that apply to a single table are grouped together. This means that when
91859185
** an application iterates through a changeset using an iterator created by
9186
-** this function, all changes that relate to a single table are visted
9186
+** this function, all changes that relate to a single table are visited
91879187
** consecutively. There is no chance that the iterator will visit a change
91889188
** the applies to table X, then one for table Y, and then later on visit
91899189
** another change for table X.
91909190
*/
91919191
int sqlite3changeset_start(
@@ -9268,11 +9268,11 @@
92689268
** If successful, *pabPK is set to point to an array of nCol entries, where
92699269
** nCol is the number of columns in the table. Elements of *pabPK are set to
92709270
** 0x01 if the corresponding column is part of the tables primary key, or
92719271
** 0x00 if it is not.
92729272
**
9273
-** If argumet pnCol is not NULL, then *pnCol is set to the number of columns
9273
+** If argument pnCol is not NULL, then *pnCol is set to the number of columns
92749274
** in the table.
92759275
**
92769276
** If this function is called when the iterator does not point to a valid
92779277
** entry, SQLITE_MISUSE is returned and the output variables zeroed. Otherwise,
92789278
** SQLITE_OK is returned and the output variables populated as described
@@ -9543,11 +9543,11 @@
95439543
** Rows within the changeset and changegroup are identified by the values in
95449544
** their PRIMARY KEY columns. A change in the changeset is considered to
95459545
** apply to the same row as a change already present in the changegroup if
95469546
** the two rows have the same primary key.
95479547
**
9548
-** Changes to rows that that do not already appear in the changegroup are
9548
+** Changes to rows that do not already appear in the changegroup are
95499549
** simply copied into it. Or, if both the new changeset and the changegroup
95509550
** contain changes that apply to a single row, the final contents of the
95519551
** changegroup depends on the type of each change, as follows:
95529552
**
95539553
** <table border=1 style="margin-left:8ex;margin-right:8ex">
@@ -11411,13 +11411,13 @@
1141111411
#define TK_GROUP 127
1141211412
#define TK_HAVING 128
1141311413
#define TK_LIMIT 129
1141411414
#define TK_WHERE 130
1141511415
#define TK_INTO 131
11416
-#define TK_INTEGER 132
11417
-#define TK_FLOAT 133
11418
-#define TK_BLOB 134
11416
+#define TK_FLOAT 132
11417
+#define TK_BLOB 133
11418
+#define TK_INTEGER 134
1141911419
#define TK_VARIABLE 135
1142011420
#define TK_CASE 136
1142111421
#define TK_WHEN 137
1142211422
#define TK_THEN 138
1142311423
#define TK_ELSE 139
@@ -12682,12 +12682,12 @@
1268212682
#define OP_IdxDelete 127 /* synopsis: key=r[P2@P3] */
1268312683
#define OP_Seek 128 /* synopsis: Move P3 to P1.rowid */
1268412684
#define OP_IdxRowid 129 /* synopsis: r[P2]=rowid */
1268512685
#define OP_Destroy 130
1268612686
#define OP_Clear 131
12687
-#define OP_ResetSorter 132
12688
-#define OP_Real 133 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
12687
+#define OP_Real 132 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
12688
+#define OP_ResetSorter 133
1268912689
#define OP_CreateIndex 134 /* synopsis: r[P2]=root iDb=P1 */
1269012690
#define OP_CreateTable 135 /* synopsis: r[P2]=root iDb=P1 */
1269112691
#define OP_ParseSchema 136
1269212692
#define OP_LoadAnalysis 137
1269312693
#define OP_DropTable 138
@@ -12741,11 +12741,11 @@
1274112741
/* 88 */ 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,\
1274212742
/* 96 */ 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\
1274312743
/* 104 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
1274412744
/* 112 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
1274512745
/* 120 */ 0x00, 0x00, 0x00, 0x10, 0x00, 0x04, 0x04, 0x00,\
12746
-/* 128 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x10,\
12746
+/* 128 */ 0x00, 0x10, 0x10, 0x00, 0x10, 0x00, 0x10, 0x10,\
1274712747
/* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10,\
1274812748
/* 144 */ 0x00, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,\
1274912749
/* 152 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\
1275012750
/* 160 */ 0x00, 0x00, 0x00,}
1275112751
@@ -14963,10 +14963,11 @@
1496314963
#define EP_Unlikely 0x040000 /* unlikely() or likelihood() function */
1496414964
#define EP_ConstFunc 0x080000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */
1496514965
#define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */
1496614966
#define EP_Subquery 0x200000 /* Tree contains a TK_SELECT operator */
1496714967
#define EP_Alias 0x400000 /* Is an alias for a result set column */
14968
+#define EP_Leaf 0x800000 /* Expr.pLeft, .pRight, .u.pSelect all NULL */
1496814969
1496914970
/*
1497014971
** Combinations of two or more EP_* flags
1497114972
*/
1497214973
#define EP_Propagate (EP_Collate|EP_Subquery) /* Propagate these bits up tree */
@@ -15514,39 +15515,27 @@
1551415515
u8 mayAbort; /* True if statement may throw an ABORT exception */
1551515516
u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */
1551615517
u8 okConstFactor; /* OK to factor out constants */
1551715518
u8 disableLookaside; /* Number of times lookaside has been disabled */
1551815519
u8 nColCache; /* Number of entries in aColCache[] */
15519
- int aTempReg[8]; /* Holding area for temporary registers */
1552015520
int nRangeReg; /* Size of the temporary register block */
1552115521
int iRangeReg; /* First register in temporary register block */
1552215522
int nErr; /* Number of errors seen */
1552315523
int nTab; /* Number of previously allocated VDBE cursors */
1552415524
int nMem; /* Number of memory cells used so far */
15525
- int nSet; /* Number of sets used so far */
1552615525
int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */
1552715526
int szOpAlloc; /* Bytes of memory space allocated for Vdbe.aOp[] */
15528
- int iFixedOp; /* Never back out opcodes iFixedOp-1 or earlier */
1552915527
int ckBase; /* Base register of data during check constraints */
1553015528
int iSelfTab; /* Table of an index whose exprs are being coded */
1553115529
int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
1553215530
int iCacheCnt; /* Counter used to generate aColCache[].lru values */
1553315531
int nLabel; /* Number of labels used */
1553415532
int *aLabel; /* Space to hold the labels */
15535
- struct yColCache {
15536
- int iTable; /* Table cursor number */
15537
- i16 iColumn; /* Table column number */
15538
- u8 tempReg; /* iReg is a temp register that needs to be freed */
15539
- int iLevel; /* Nesting level */
15540
- int iReg; /* Reg with value of this column. 0 means none. */
15541
- int lru; /* Least recently used entry has the smallest value */
15542
- } aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */
1554315533
ExprList *pConstExpr;/* Constant expressions */
1554415534
Token constraintName;/* Name of the constraint currently being parsed */
1554515535
yDbMask writeMask; /* Start a write transaction on these databases */
1554615536
yDbMask cookieMask; /* Bitmask of schema verified databases */
15547
- int cookieValue[SQLITE_MAX_ATTACHED+2]; /* Values of cookies to verify */
1554815537
int regRowid; /* Register holding rowid of CREATE TABLE entry */
1554915538
int regRoot; /* Register holding root page number for new objects */
1555015539
int nMaxArg; /* Max args passed to user function by sub-program */
1555115540
#if SELECTTRACE_ENABLED
1555215541
int nSelect; /* Number of SELECT statements seen */
@@ -15555,21 +15544,38 @@
1555515544
#ifndef SQLITE_OMIT_SHARED_CACHE
1555615545
int nTableLock; /* Number of locks in aTableLock */
1555715546
TableLock *aTableLock; /* Required table locks for shared-cache mode */
1555815547
#endif
1555915548
AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */
15560
-
15561
- /* Information used while coding trigger programs. */
1556215549
Parse *pToplevel; /* Parse structure for main program (or NULL) */
1556315550
Table *pTriggerTab; /* Table triggers are being coded for */
1556415551
int addrCrTab; /* Address of OP_CreateTable opcode on CREATE TABLE */
1556515552
u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
1556615553
u32 oldmask; /* Mask of old.* columns referenced */
1556715554
u32 newmask; /* Mask of new.* columns referenced */
1556815555
u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */
1556915556
u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */
1557015557
u8 disableTriggers; /* True to disable triggers */
15558
+
15559
+ /**************************************************************************
15560
+ ** Fields above must be initialized to zero. The fields that follow,
15561
+ ** down to the beginning of the recursive section, do not need to be
15562
+ ** initialized as they will be set before being used. The boundary is
15563
+ ** determined by offsetof(Parse,aColCache).
15564
+ **************************************************************************/
15565
+
15566
+ struct yColCache {
15567
+ int iTable; /* Table cursor number */
15568
+ i16 iColumn; /* Table column number */
15569
+ u8 tempReg; /* iReg is a temp register that needs to be freed */
15570
+ int iLevel; /* Nesting level */
15571
+ int iReg; /* Reg with value of this column. 0 means none. */
15572
+ int lru; /* Least recently used entry has the smallest value */
15573
+ } aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */
15574
+ int aTempReg[8]; /* Holding area for temporary registers */
15575
+ Token sNameToken; /* Token with unqualified schema object name */
15576
+ Token sLastToken; /* The last token parsed */
1557115577
1557215578
/************************************************************************
1557315579
** Above is constant between recursions. Below is reset before and after
1557415580
** each recursion. The boundary between these two regions is determined
1557515581
** using offsetof(Parse,nVar) so the nVar field must be the first field
@@ -15582,11 +15588,10 @@
1558215588
u8 explain; /* True if the EXPLAIN flag is found on the query */
1558315589
#ifndef SQLITE_OMIT_VIRTUALTABLE
1558415590
u8 declareVtab; /* True if inside sqlite3_declare_vtab() */
1558515591
int nVtabLock; /* Number of virtual tables to lock */
1558615592
#endif
15587
- int nAlias; /* Number of aliased result set columns */
1558815593
int nHeight; /* Expression tree height of current sub-select */
1558915594
#ifndef SQLITE_OMIT_EXPLAIN
1559015595
int iSelectId; /* ID of current select for EXPLAIN output */
1559115596
int iNextSelectId; /* Next available select ID for EXPLAIN output */
1559215597
#endif
@@ -15594,12 +15599,10 @@
1559415599
Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
1559515600
const char *zTail; /* All SQL text past the last semicolon parsed */
1559615601
Table *pNewTable; /* A table being constructed by CREATE TABLE */
1559715602
Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */
1559815603
const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
15599
- Token sNameToken; /* Token with unqualified schema object name */
15600
- Token sLastToken; /* The last token parsed */
1560115604
#ifndef SQLITE_OMIT_VIRTUALTABLE
1560215605
Token sArg; /* Complete text of a module argument */
1560315606
Table **apVtabLock; /* Pointer to virtual tables needing locking */
1560415607
#endif
1560515608
Table *pZombieTab; /* List of Table objects to delete after code gen */
@@ -15606,10 +15609,18 @@
1560615609
TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */
1560715610
With *pWith; /* Current WITH clause, or NULL */
1560815611
With *pWithToFree; /* Free this WITH object at the end of the parse */
1560915612
};
1561015613
15614
+/*
15615
+** Sizes and pointers of various parts of the Parse object.
15616
+*/
15617
+#define PARSE_HDR_SZ offsetof(Parse,aColCache) /* Recursive part w/o aColCache*/
15618
+#define PARSE_RECURSE_SZ offsetof(Parse,nVar) /* Recursive part */
15619
+#define PARSE_TAIL_SZ (sizeof(Parse)-PARSE_RECURSE_SZ) /* Non-recursive part */
15620
+#define PARSE_TAIL(X) (((char*)(X))+PARSE_RECURSE_SZ) /* Pointer to tail */
15621
+
1561115622
/*
1561215623
** Return true if currently inside an sqlite3_declare_vtab() call.
1561315624
*/
1561415625
#ifdef SQLITE_OMIT_VIRTUALTABLE
1561515626
#define IN_DECLARE_VTAB 0
@@ -16169,11 +16180,11 @@
1616916180
SQLITE_PRIVATE void sqlite3ExprAttachSubtrees(sqlite3*,Expr*,Expr*,Expr*);
1617016181
SQLITE_PRIVATE Expr *sqlite3PExpr(Parse*, int, Expr*, Expr*, const Token*);
1617116182
SQLITE_PRIVATE void sqlite3PExprAddSelect(Parse*, Expr*, Select*);
1617216183
SQLITE_PRIVATE Expr *sqlite3ExprAnd(sqlite3*,Expr*, Expr*);
1617316184
SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*);
16174
-SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*);
16185
+SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*, u32);
1617516186
SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*);
1617616187
SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
1617716188
SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
1617816189
SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList*,int);
1617916190
SQLITE_PRIVATE void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int);
@@ -16989,20 +17000,17 @@
1698917000
** If x is a lower-case ASCII character, then its upper-case equivalent
1699017001
** is (x - 0x20). Therefore toupper() can be implemented as:
1699117002
**
1699217003
** (x & ~(map[x]&0x20))
1699317004
**
16994
-** Standard function tolower() is implemented using the sqlite3UpperToLower[]
17005
+** The equivalent of tolower() is implemented using the sqlite3UpperToLower[]
1699517006
** array. tolower() is used more often than toupper() by SQLite.
1699617007
**
16997
-** Bit 0x40 is set if the character non-alphanumeric and can be used in an
17008
+** Bit 0x40 is set if the character is non-alphanumeric and can be used in an
1699817009
** SQLite identifier. Identifiers are alphanumerics, "_", "$", and any
1699917010
** non-ASCII UTF character. Hence the test for whether or not a character is
1700017011
** part of an identifier is 0x46.
17001
-**
17002
-** SQLite's versions are identical to the standard versions assuming a
17003
-** locale of "C". They are implemented as macros in sqliteInt.h.
1700417012
*/
1700517013
#ifdef SQLITE_ASCII
1700617014
SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = {
1700717015
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00..07 ........ */
1700817016
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, /* 08..0f ........ */
@@ -17071,11 +17079,11 @@
1707117079
#ifndef SQLITE_SORTER_PMASZ
1707217080
# define SQLITE_SORTER_PMASZ 250
1707317081
#endif
1707417082
1707517083
/* Statement journals spill to disk when their size exceeds the following
17076
-** threashold (in bytes). 0 means that statement journals are created and
17084
+** threshold (in bytes). 0 means that statement journals are created and
1707717085
** written to disk immediately (the default behavior for SQLite versions
1707817086
** before 3.12.0). -1 means always keep the entire statement journal in
1707917087
** memory. (The statement journal is also always held entirely in memory
1708017088
** if journal_mode=MEMORY or if temp_store=MEMORY, regardless of this
1708117089
** setting.)
@@ -17159,11 +17167,11 @@
1715917167
1716017168
/*
1716117169
** The value of the "pending" byte must be 0x40000000 (1 byte past the
1716217170
** 1-gibabyte boundary) in a compatible database. SQLite never uses
1716317171
** the database page that contains the pending byte. It never attempts
17164
-** to read or write that page. The pending byte page is set assign
17172
+** to read or write that page. The pending byte page is set aside
1716517173
** for use by the VFS layers as space for managing file locks.
1716617174
**
1716717175
** During testing, it is often desirable to move the pending byte to
1716817176
** a different position in the file. This allows code that has to
1716917177
** deal with the pending byte to run on files that are much smaller
@@ -17719,13 +17727,10 @@
1771917727
typedef unsigned Bool;
1772017728
1772117729
/* Opaque type used by code in vdbesort.c */
1772217730
typedef struct VdbeSorter VdbeSorter;
1772317731
17724
-/* Opaque type used by the explainer */
17725
-typedef struct Explain Explain;
17726
-
1772717732
/* Elements of the linked list at Vdbe.pAuxData */
1772817733
typedef struct AuxData AuxData;
1772917734
1773017735
/* Types of VDBE cursors */
1773117736
#define CURTYPE_BTREE 0
@@ -17796,10 +17801,16 @@
1779617801
/* 2*nField extra array elements allocated for aType[], beyond the one
1779717802
** static element declared in the structure. nField total array slots for
1779817803
** aType[] and nField+1 array slots for aOffset[] */
1779917804
};
1780017805
17806
+
17807
+/*
17808
+** A value for VdbeCursor.cacheStatus that means the cache is always invalid.
17809
+*/
17810
+#define CACHE_STALE 0
17811
+
1780117812
/*
1780217813
** When a sub-program is executed (OP_Program), a structure of this type
1780317814
** is allocated to store the current value of the program counter, as
1780417815
** well as the current memory cell array and various other frame specific
1780517816
** values stored in the Vdbe struct. When the sub-program is finished,
@@ -17840,15 +17851,10 @@
1784017851
int nDbChange; /* Value of db->nChange */
1784117852
};
1784217853
1784317854
#define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))])
1784417855
17845
-/*
17846
-** A value for VdbeCursor.cacheValid that means the cache is always invalid.
17847
-*/
17848
-#define CACHE_STALE 0
17849
-
1785017856
/*
1785117857
** Internally, the vdbe manipulates nearly all SQL values as Mem
1785217858
** structures. Each Mem struct may cache multiple representations (string,
1785317859
** integer etc.) of the same value.
1785417860
*/
@@ -17985,22 +17991,10 @@
1798517991
u8 fErrorOrAux; /* isError!=0 or pVdbe->pAuxData modified */
1798617992
u8 argc; /* Number of arguments */
1798717993
sqlite3_value *argv[1]; /* Argument set */
1798817994
};
1798917995
17990
-/*
17991
-** An Explain object accumulates indented output which is helpful
17992
-** in describing recursive data structures.
17993
-*/
17994
-struct Explain {
17995
- Vdbe *pVdbe; /* Attach the explanation to this Vdbe */
17996
- StrAccum str; /* The string being accumulated */
17997
- int nIndent; /* Number of elements in aIndent */
17998
- u16 aIndent[100]; /* Levels of indentation */
17999
- char zBase[100]; /* Initial space */
18000
-};
18001
-
1800217996
/* A bitfield type for use inside of structures. Always follow with :N where
1800317997
** N is the number of bits.
1800417998
*/
1800517999
typedef unsigned bft; /* Bit Field Type */
1800618000
@@ -18021,57 +18015,61 @@
1802118015
** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare()
1802218016
** is really a pointer to an instance of this structure.
1802318017
*/
1802418018
struct Vdbe {
1802518019
sqlite3 *db; /* The database connection that owns this statement */
18020
+ Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
18021
+ Parse *pParse; /* Parsing context used to create this Vdbe */
18022
+ ynVar nVar; /* Number of entries in aVar[] */
18023
+ ynVar nzVar; /* Number of entries in azVar[] */
18024
+ u32 magic; /* Magic number for sanity checking */
18025
+ int nMem; /* Number of memory locations currently allocated */
18026
+ int nCursor; /* Number of slots in apCsr[] */
18027
+ u32 cacheCtr; /* VdbeCursor row cache generation counter */
18028
+ int pc; /* The program counter */
18029
+ int rc; /* Value to return */
18030
+ int nChange; /* Number of db changes made since last reset */
18031
+ int iStatement; /* Statement number (or 0 if has not opened stmt) */
18032
+ i64 iCurrentTime; /* Value of julianday('now') for this statement */
18033
+ i64 nFkConstraint; /* Number of imm. FK constraints this VM */
18034
+ i64 nStmtDefCons; /* Number of def. constraints when stmt started */
18035
+ i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
18036
+
18037
+ /* When allocating a new Vdbe object, all of the fields below should be
18038
+ ** initialized to zero or NULL */
18039
+
1802618040
Op *aOp; /* Space to hold the virtual machine's program */
1802718041
Mem *aMem; /* The memory locations */
1802818042
Mem **apArg; /* Arguments to currently executing user function */
1802918043
Mem *aColName; /* Column names to return */
1803018044
Mem *pResultSet; /* Pointer to an array of results */
18031
- Parse *pParse; /* Parsing context used to create this Vdbe */
18032
- int nMem; /* Number of memory locations currently allocated */
18033
- int nOp; /* Number of instructions in the program */
18034
- int nCursor; /* Number of slots in apCsr[] */
18035
- u32 magic; /* Magic number for sanity checking */
1803618045
char *zErrMsg; /* Error message written here */
18037
- Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
1803818046
VdbeCursor **apCsr; /* One element of this array for each open cursor */
1803918047
Mem *aVar; /* Values for the OP_Variable opcode. */
1804018048
char **azVar; /* Name of variables */
18041
- ynVar nVar; /* Number of entries in aVar[] */
18042
- ynVar nzVar; /* Number of entries in azVar[] */
18043
- u32 cacheCtr; /* VdbeCursor row cache generation counter */
18044
- int pc; /* The program counter */
18045
- int rc; /* Value to return */
18049
+#ifndef SQLITE_OMIT_TRACE
18050
+ i64 startTime; /* Time when query started - used for profiling */
18051
+#endif
18052
+ int nOp; /* Number of instructions in the program */
1804618053
#ifdef SQLITE_DEBUG
1804718054
int rcApp; /* errcode set by sqlite3_result_error_code() */
1804818055
#endif
1804918056
u16 nResColumn; /* Number of columns in one row of the result set */
1805018057
u8 errorAction; /* Recovery action to do in case of an error */
18058
+ u8 minWriteFileFormat; /* Minimum file format for writable database files */
1805118059
bft expired:1; /* True if the VM needs to be recompiled */
1805218060
bft doingRerun:1; /* True if rerunning after an auto-reprepare */
18053
- u8 minWriteFileFormat; /* Minimum file format for writable database files */
1805418061
bft explain:2; /* True if EXPLAIN present on SQL command */
1805518062
bft changeCntOn:1; /* True to update the change-counter */
1805618063
bft runOnlyOnce:1; /* Automatically expire on reset */
1805718064
bft usesStmtJournal:1; /* True if uses a statement journal */
1805818065
bft readOnly:1; /* True for statements that do not write */
1805918066
bft bIsReader:1; /* True for statements that read */
1806018067
bft isPrepareV2:1; /* True if prepared with prepare_v2() */
18061
- int nChange; /* Number of db changes made since last reset */
1806218068
yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */
1806318069
yDbMask lockMask; /* Subset of btreeMask that requires a lock */
18064
- int iStatement; /* Statement number (or 0 if has not opened stmt) */
1806518070
u32 aCounter[5]; /* Counters used by sqlite3_stmt_status() */
18066
-#ifndef SQLITE_OMIT_TRACE
18067
- i64 startTime; /* Time when query started - used for profiling */
18068
-#endif
18069
- i64 iCurrentTime; /* Value of julianday('now') for this statement */
18070
- i64 nFkConstraint; /* Number of imm. FK constraints this VM */
18071
- i64 nStmtDefCons; /* Number of def. constraints when stmt started */
18072
- i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
1807318071
char *zSql; /* Text of the SQL statement that generated this */
1807418072
void *pFree; /* Free this when deleting the vdbe */
1807518073
VdbeFrame *pFrame; /* Parent frame */
1807618074
VdbeFrame *pDelFrame; /* List of frame objects to free on VM reset */
1807718075
int nFrame; /* Number of frames in pFrame list */
@@ -18086,14 +18084,15 @@
1808618084
};
1808718085
1808818086
/*
1808918087
** The following are allowed values for Vdbe.magic
1809018088
*/
18091
-#define VDBE_MAGIC_INIT 0x26bceaa5 /* Building a VDBE program */
18092
-#define VDBE_MAGIC_RUN 0xbdf20da3 /* VDBE is ready to execute */
18093
-#define VDBE_MAGIC_HALT 0x519c2973 /* VDBE has completed execution */
18094
-#define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */
18089
+#define VDBE_MAGIC_INIT 0x16bceaa5 /* Building a VDBE program */
18090
+#define VDBE_MAGIC_RUN 0x2df20da3 /* VDBE is ready to execute */
18091
+#define VDBE_MAGIC_HALT 0x319c2973 /* VDBE has completed execution */
18092
+#define VDBE_MAGIC_RESET 0x48fa9f76 /* Reset and ready to run again */
18093
+#define VDBE_MAGIC_DEAD 0x5606c3c8 /* The VDBE has been deallocated */
1809518094
1809618095
/*
1809718096
** Structure used to store the context required by the
1809818097
** sqlite3_preupdate_*() API functions.
1809918098
*/
@@ -28775,11 +28774,15 @@
2877528774
*/
2877628775
static unsigned int strHash(const char *z){
2877728776
unsigned int h = 0;
2877828777
unsigned char c;
2877928778
while( (c = (unsigned char)*z++)!=0 ){ /*OPTIMIZATION-IF-TRUE*/
28780
- h = (h<<3) ^ h ^ sqlite3UpperToLower[c];
28779
+ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510).
28780
+ ** 0x9e3779b1 is 2654435761 which is the closest prime number to
28781
+ ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */
28782
+ h += sqlite3UpperToLower[c];
28783
+ h *= 0x9e3779b1;
2878128784
}
2878228785
return h;
2878328786
}
2878428787
2878528788
@@ -29131,12 +29134,12 @@
2913129134
/* 127 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
2913229135
/* 128 */ "Seek" OpHelp("Move P3 to P1.rowid"),
2913329136
/* 129 */ "IdxRowid" OpHelp("r[P2]=rowid"),
2913429137
/* 130 */ "Destroy" OpHelp(""),
2913529138
/* 131 */ "Clear" OpHelp(""),
29136
- /* 132 */ "ResetSorter" OpHelp(""),
29137
- /* 133 */ "Real" OpHelp("r[P2]=P4"),
29139
+ /* 132 */ "Real" OpHelp("r[P2]=P4"),
29140
+ /* 133 */ "ResetSorter" OpHelp(""),
2913829141
/* 134 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"),
2913929142
/* 135 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"),
2914029143
/* 136 */ "ParseSchema" OpHelp(""),
2914129144
/* 137 */ "LoadAnalysis" OpHelp(""),
2914229145
/* 138 */ "DropTable" OpHelp(""),
@@ -44018,11 +44021,11 @@
4401844021
){
4401944022
PgHdr *pPgHdr;
4402044023
assert( pPage!=0 );
4402144024
pPgHdr = (PgHdr*)pPage->pExtra;
4402244025
assert( pPgHdr->pPage==0 );
44023
- memset(pPgHdr, 0, sizeof(PgHdr));
44026
+ memset(&pPgHdr->pDirty, 0, sizeof(PgHdr) - offsetof(PgHdr,pDirty));
4402444027
pPgHdr->pPage = pPage;
4402544028
pPgHdr->pData = pPage->pBuf;
4402644029
pPgHdr->pExtra = (void *)&pPgHdr[1];
4402744030
memset(pPgHdr->pExtra, 0, pCache->szExtra);
4402844031
pPgHdr->pCache = pCache;
@@ -58984,11 +58987,11 @@
5898458987
int bias, /* Bias search to the high end */
5898558988
int *pRes /* Write search results here */
5898658989
){
5898758990
int rc; /* Status code */
5898858991
UnpackedRecord *pIdxKey; /* Unpacked index key */
58989
- char aSpace[200]; /* Temp space for pIdxKey - to avoid a malloc */
58992
+ char aSpace[384]; /* Temp space for pIdxKey - to avoid a malloc */
5899058993
char *pFree = 0;
5899158994
5899258995
if( pKey ){
5899358996
assert( nKey==(i64)(int)nKey );
5899458997
pIdxKey = sqlite3VdbeAllocUnpackedRecord(
@@ -64321,12 +64324,10 @@
6432164324
nSrc = pX->nData;
6432264325
assert( pPage->intKeyLeaf ); /* fillInCell() only called for leaves */
6432364326
nHeader += putVarint32(&pCell[nHeader], nPayload);
6432464327
nHeader += putVarint(&pCell[nHeader], *(u64*)&pX->nKey);
6432564328
}else{
64326
- assert( pX->nData==0 );
64327
- assert( pX->nZero==0 );
6432864329
assert( pX->nKey<=0x7fffffff && pX->pKey!=0 );
6432964330
nSrc = nPayload = (int)pX->nKey;
6433064331
pSrc = pX->pKey;
6433164332
nHeader += putVarint32(&pCell[nHeader], nPayload);
6433264333
}
@@ -68022,26 +68023,20 @@
6802268023
*/
6802368024
static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
6802468025
int i = sqlite3FindDbName(pDb, zDb);
6802568026
6802668027
if( i==1 ){
68027
- Parse *pParse;
68028
+ Parse sParse;
6802868029
int rc = 0;
68029
- pParse = sqlite3StackAllocZero(pErrorDb, sizeof(*pParse));
68030
- if( pParse==0 ){
68031
- sqlite3ErrorWithMsg(pErrorDb, SQLITE_NOMEM, "out of memory");
68032
- rc = SQLITE_NOMEM_BKPT;
68033
- }else{
68034
- pParse->db = pDb;
68035
- if( sqlite3OpenTempDatabase(pParse) ){
68036
- sqlite3ErrorWithMsg(pErrorDb, pParse->rc, "%s", pParse->zErrMsg);
68037
- rc = SQLITE_ERROR;
68038
- }
68039
- sqlite3DbFree(pErrorDb, pParse->zErrMsg);
68040
- sqlite3ParserReset(pParse);
68041
- sqlite3StackFree(pErrorDb, pParse);
68042
- }
68030
+ memset(&sParse, 0, sizeof(sParse));
68031
+ sParse.db = pDb;
68032
+ if( sqlite3OpenTempDatabase(&sParse) ){
68033
+ sqlite3ErrorWithMsg(pErrorDb, sParse.rc, "%s", sParse.zErrMsg);
68034
+ rc = SQLITE_ERROR;
68035
+ }
68036
+ sqlite3DbFree(pErrorDb, sParse.zErrMsg);
68037
+ sqlite3ParserReset(&sParse);
6804368038
if( rc ){
6804468039
return 0;
6804568040
}
6804668041
}
6804768042
@@ -69041,10 +69036,11 @@
6904169036
assert( (pMem->flags&MEM_RowSet)==0 );
6904269037
assert( EIGHT_BYTE_ALIGNMENT(pMem) );
6904369038
6904469039
6904569040
if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
69041
+ pMem->enc = 0;
6904669042
return SQLITE_NOMEM_BKPT;
6904769043
}
6904869044
6904969045
/* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8
6905069046
** string representation of the value. Then, if the required encoding
@@ -70017,14 +70013,11 @@
7001770013
sqlite3_value *pVal = 0;
7001870014
int negInt = 1;
7001970015
const char *zNeg = "";
7002070016
int rc = SQLITE_OK;
7002170017
70022
- if( !pExpr ){
70023
- *ppVal = 0;
70024
- return SQLITE_OK;
70025
- }
70018
+ assert( pExpr!=0 );
7002670019
while( (op = pExpr->op)==TK_UPLUS || op==TK_SPAN ) pExpr = pExpr->pLeft;
7002770020
if( NEVER(op==TK_REGISTER) ) op = pExpr->op2;
7002870021
7002970022
/* Compressed expressions only appear when parsing the DEFAULT clause
7003070023
** on a table column definition, and hence only when pCtx==0. This
@@ -70144,11 +70137,11 @@
7014470137
Expr *pExpr, /* The expression to evaluate */
7014570138
u8 enc, /* Encoding to use */
7014670139
u8 affinity, /* Affinity to use */
7014770140
sqlite3_value **ppVal /* Write the new value here */
7014870141
){
70149
- return valueFromExpr(db, pExpr, enc, affinity, ppVal, 0);
70142
+ return pExpr ? valueFromExpr(db, pExpr, enc, affinity, ppVal, 0) : 0;
7015070143
}
7015170144
7015270145
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
7015370146
/*
7015470147
** The implementation of the sqlite_record() function. This function accepts
@@ -70487,12 +70480,13 @@
7048770480
** Create a new virtual database engine.
7048870481
*/
7048970482
SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse *pParse){
7049070483
sqlite3 *db = pParse->db;
7049170484
Vdbe *p;
70492
- p = sqlite3DbMallocZero(db, sizeof(Vdbe) );
70485
+ p = sqlite3DbMallocRawNN(db, sizeof(Vdbe) );
7049370486
if( p==0 ) return 0;
70487
+ memset(&p->aOp, 0, sizeof(Vdbe)-offsetof(Vdbe,aOp));
7049470488
p->db = db;
7049570489
if( db->pVdbe ){
7049670490
db->pVdbe->pPrev = p;
7049770491
}
7049870492
p->pNext = db->pVdbe;
@@ -70650,13 +70644,12 @@
7065070644
#endif
7065170645
#ifdef SQLITE_DEBUG
7065270646
if( p->db->flags & SQLITE_VdbeAddopTrace ){
7065370647
int jj, kk;
7065470648
Parse *pParse = p->pParse;
70655
- for(jj=kk=0; jj<SQLITE_N_COLCACHE; jj++){
70649
+ for(jj=kk=0; jj<pParse->nColCache; jj++){
7065670650
struct yColCache *x = pParse->aColCache + jj;
70657
- if( x->iLevel>pParse->iCacheLevel || x->iReg==0 ) continue;
7065870651
printf(" r[%d]={%d:%d}", x->iReg, x->iTable, x->iColumn);
7065970652
kk++;
7066070653
}
7066170654
if( kk ) printf("\n");
7066270655
sqlite3VdbePrintOp(0, i, &p->aOp[i]);
@@ -70840,11 +70833,10 @@
7084070833
assert( j<p->nLabel );
7084170834
assert( j>=0 );
7084270835
if( p->aLabel ){
7084370836
p->aLabel[j] = v->nOp;
7084470837
}
70845
- p->iFixedOp = v->nOp - 1;
7084670838
}
7084770839
7084870840
/*
7084970841
** Mark the VDBE as one that can only be run one time.
7085070842
*/
@@ -71231,19 +71223,19 @@
7123171223
}
7123271224
SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, u32 addr, int val){
7123371225
sqlite3VdbeGetOp(p,addr)->p3 = val;
7123471226
}
7123571227
SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe *p, u8 p5){
71236
- if( !p->db->mallocFailed ) p->aOp[p->nOp-1].p5 = p5;
71228
+ assert( p->nOp>0 || p->db->mallocFailed );
71229
+ if( p->nOp>0 ) p->aOp[p->nOp-1].p5 = p5;
7123771230
}
7123871231
7123971232
/*
7124071233
** Change the P2 operand of instruction addr so that it points to
7124171234
** the address of the next instruction to be coded.
7124271235
*/
7124371236
SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
71244
- p->pParse->iFixedOp = p->nOp - 1;
7124571237
sqlite3VdbeChangeP2(p, addr, p->nOp);
7124671238
}
7124771239
7124871240
7124971241
/*
@@ -71362,11 +71354,11 @@
7136271354
/*
7136371355
** If the last opcode is "op" and it is not a jump destination,
7136471356
** then remove it. Return true if and only if an opcode was removed.
7136571357
*/
7136671358
SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){
71367
- if( (p->nOp-1)>(p->pParse->iFixedOp) && p->aOp[p->nOp-1].opcode==op ){
71359
+ if( p->nOp>0 && p->aOp[p->nOp-1].opcode==op ){
7136871360
return sqlite3VdbeChangeToNoop(p, p->nOp-1);
7136971361
}else{
7137071362
return 0;
7137171363
}
7137271364
}
@@ -71924,10 +71916,25 @@
7192471916
zCom
7192571917
);
7192671918
fflush(pOut);
7192771919
}
7192871920
#endif
71921
+
71922
+/*
71923
+** Initialize an array of N Mem element.
71924
+*/
71925
+static void initMemArray(Mem *p, int N, sqlite3 *db, u16 flags){
71926
+ while( (N--)>0 ){
71927
+ p->db = db;
71928
+ p->flags = flags;
71929
+ p->szMalloc = 0;
71930
+#ifdef SQLITE_DEBUG
71931
+ p->pScopyFrom = 0;
71932
+#endif
71933
+ p++;
71934
+ }
71935
+}
7192971936
7193071937
/*
7193171938
** Release an array of N Mem elements
7193271939
*/
7193371940
static void releaseMemArray(Mem *p, int N){
@@ -72136,10 +72143,11 @@
7213672143
return SQLITE_ERROR;
7213772144
}
7213872145
pMem->flags = MEM_Str|MEM_Term;
7213972146
zP4 = displayP4(pOp, pMem->z, pMem->szMalloc);
7214072147
if( zP4!=pMem->z ){
72148
+ pMem->n = 0;
7214172149
sqlite3VdbeMemSetStr(pMem, zP4, -1, SQLITE_UTF8, 0);
7214272150
}else{
7214372151
assert( pMem->z!=0 );
7214472152
pMem->n = sqlite3Strlen30(pMem->z);
7214572153
pMem->enc = SQLITE_UTF8;
@@ -72278,11 +72286,11 @@
7227872286
SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *p){
7227972287
#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
7228072288
int i;
7228172289
#endif
7228272290
assert( p!=0 );
72283
- assert( p->magic==VDBE_MAGIC_INIT );
72291
+ assert( p->magic==VDBE_MAGIC_INIT || p->magic==VDBE_MAGIC_RESET );
7228472292
7228572293
/* There should be at least one opcode.
7228672294
*/
7228772295
assert( p->nOp>0 );
7228872296
@@ -72367,14 +72375,11 @@
7236772375
n = ROUND8(sizeof(Op)*p->nOp); /* Bytes of opcode memory used */
7236872376
x.pSpace = &((u8*)p->aOp)[n]; /* Unused opcode memory */
7236972377
assert( EIGHT_BYTE_ALIGNMENT(x.pSpace) );
7237072378
x.nFree = ROUNDDOWN8(pParse->szOpAlloc - n); /* Bytes of unused memory */
7237172379
assert( x.nFree>=0 );
72372
- if( x.nFree>0 ){
72373
- memset(x.pSpace, 0, x.nFree);
72374
- assert( EIGHT_BYTE_ALIGNMENT(&x.pSpace[x.nFree]) );
72375
- }
72380
+ assert( EIGHT_BYTE_ALIGNMENT(&x.pSpace[x.nFree]) );
7237672381
7237772382
resolveP2Values(p, &nArg);
7237872383
p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort);
7237972384
if( pParse->explain && nMem<10 ){
7238072385
nMem = 10;
@@ -72399,34 +72404,34 @@
7239972404
p->apCsr = allocSpace(&x, p->apCsr, nCursor*sizeof(VdbeCursor*));
7240072405
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
7240172406
p->anExec = allocSpace(&x, p->anExec, p->nOp*sizeof(i64));
7240272407
#endif
7240372408
if( x.nNeeded==0 ) break;
72404
- x.pSpace = p->pFree = sqlite3DbMallocZero(db, x.nNeeded);
72409
+ x.pSpace = p->pFree = sqlite3DbMallocRawNN(db, x.nNeeded);
7240572410
x.nFree = x.nNeeded;
7240672411
}while( !db->mallocFailed );
7240772412
72408
- p->nCursor = nCursor;
72409
- if( p->aVar ){
72410
- p->nVar = (ynVar)nVar;
72411
- for(n=0; n<nVar; n++){
72412
- p->aVar[n].flags = MEM_Null;
72413
- p->aVar[n].db = db;
72414
- }
72415
- }
7241672413
p->nzVar = pParse->nzVar;
7241772414
p->azVar = pParse->azVar;
7241872415
pParse->nzVar = 0;
7241972416
pParse->azVar = 0;
72420
- if( p->aMem ){
72421
- p->nMem = nMem;
72422
- for(n=0; n<nMem; n++){
72423
- p->aMem[n].flags = MEM_Undefined;
72424
- p->aMem[n].db = db;
72425
- }
72426
- }
7242772417
p->explain = pParse->explain;
72418
+ if( db->mallocFailed ){
72419
+ p->nVar = 0;
72420
+ p->nCursor = 0;
72421
+ p->nMem = 0;
72422
+ }else{
72423
+ p->nCursor = nCursor;
72424
+ p->nVar = (ynVar)nVar;
72425
+ initMemArray(p->aVar, nVar, db, MEM_Null);
72426
+ p->nMem = nMem;
72427
+ initMemArray(p->aMem, nMem, db, MEM_Undefined);
72428
+ memset(p->apCsr, 0, nCursor*sizeof(VdbeCursor*));
72429
+#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
72430
+ memset(p->anExec, 0, p->nOp*sizeof(i64));
72431
+#endif
72432
+ }
7242872433
sqlite3VdbeRewind(p);
7242972434
}
7243072435
7243172436
/*
7243272437
** Close a VDBE cursor and release all the resources that cursor
@@ -72574,17 +72579,13 @@
7257472579
7257572580
releaseMemArray(p->aColName, p->nResColumn*COLNAME_N);
7257672581
sqlite3DbFree(db, p->aColName);
7257772582
n = nResColumn*COLNAME_N;
7257872583
p->nResColumn = (u16)nResColumn;
72579
- p->aColName = pColName = (Mem*)sqlite3DbMallocZero(db, sizeof(Mem)*n );
72584
+ p->aColName = pColName = (Mem*)sqlite3DbMallocRawNN(db, sizeof(Mem)*n );
7258072585
if( p->aColName==0 ) return;
72581
- while( n-- > 0 ){
72582
- pColName->flags = MEM_Null;
72583
- pColName->db = p->db;
72584
- pColName++;
72585
- }
72586
+ initMemArray(p->aColName, n, p->db, MEM_Null);
7258672587
}
7258772588
7258872589
/*
7258972590
** Set the name of the idx'th column to be returned by the SQL statement.
7259072591
** zName must be a pointer to a nul terminated string.
@@ -73342,11 +73343,11 @@
7334273343
fclose(out);
7334373344
}
7334473345
}
7334573346
#endif
7334673347
p->iCurrentTime = 0;
73347
- p->magic = VDBE_MAGIC_INIT;
73348
+ p->magic = VDBE_MAGIC_RESET;
7334873349
return p->rc & db->errMask;
7334973350
}
7335073351
7335173352
/*
7335273353
** Clean up and delete a VDBE after execution. Return an integer which is
@@ -73406,23 +73407,25 @@
7340673407
*/
7340773408
SQLITE_PRIVATE void sqlite3VdbeClearObject(sqlite3 *db, Vdbe *p){
7340873409
SubProgram *pSub, *pNext;
7340973410
int i;
7341073411
assert( p->db==0 || p->db==db );
73411
- releaseMemArray(p->aVar, p->nVar);
7341273412
releaseMemArray(p->aColName, p->nResColumn*COLNAME_N);
7341373413
for(pSub=p->pProgram; pSub; pSub=pNext){
7341473414
pNext = pSub->pNext;
7341573415
vdbeFreeOpArray(db, pSub->aOp, pSub->nOp);
7341673416
sqlite3DbFree(db, pSub);
7341773417
}
73418
- for(i=p->nzVar-1; i>=0; i--) sqlite3DbFree(db, p->azVar[i]);
73419
- sqlite3DbFree(db, p->azVar);
73418
+ if( p->magic!=VDBE_MAGIC_INIT ){
73419
+ releaseMemArray(p->aVar, p->nVar);
73420
+ for(i=p->nzVar-1; i>=0; i--) sqlite3DbFree(db, p->azVar[i]);
73421
+ sqlite3DbFree(db, p->azVar);
73422
+ sqlite3DbFree(db, p->pFree);
73423
+ }
7342073424
vdbeFreeOpArray(db, p->aOp, p->nOp);
7342173425
sqlite3DbFree(db, p->aColName);
7342273426
sqlite3DbFree(db, p->zSql);
73423
- sqlite3DbFree(db, p->pFree);
7342473427
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
7342573428
for(i=0; i<p->nScan; i++){
7342673429
sqlite3DbFree(db, p->aScan[i].zName);
7342773430
}
7342873431
sqlite3DbFree(db, p->aScan);
@@ -76047,18 +76050,17 @@
7604776050
static Mem *columnMem(sqlite3_stmt *pStmt, int i){
7604876051
Vdbe *pVm;
7604976052
Mem *pOut;
7605076053
7605176054
pVm = (Vdbe *)pStmt;
76052
- if( pVm && pVm->pResultSet!=0 && i<pVm->nResColumn && i>=0 ){
76053
- sqlite3_mutex_enter(pVm->db->mutex);
76055
+ if( pVm==0 ) return (Mem*)columnNullValue();
76056
+ assert( pVm->db );
76057
+ sqlite3_mutex_enter(pVm->db->mutex);
76058
+ if( pVm->pResultSet!=0 && i<pVm->nResColumn && i>=0 ){
7605476059
pOut = &pVm->pResultSet[i];
7605576060
}else{
76056
- if( pVm && ALWAYS(pVm->db) ){
76057
- sqlite3_mutex_enter(pVm->db->mutex);
76058
- sqlite3Error(pVm->db, SQLITE_RANGE);
76059
- }
76061
+ sqlite3Error(pVm->db, SQLITE_RANGE);
7606076062
pOut = (Mem*)columnNullValue();
7606176063
}
7606276064
return pOut;
7606376065
}
7606476066
@@ -76087,10 +76089,12 @@
7608776089
** SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR
7608876090
** and _finalize() will return NOMEM.
7608976091
*/
7609076092
Vdbe *p = (Vdbe *)pStmt;
7609176093
if( p ){
76094
+ assert( p->db!=0 );
76095
+ assert( sqlite3_mutex_held(p->db->mutex) );
7609276096
p->rc = sqlite3ApiExit(p->db, p->rc);
7609376097
sqlite3_mutex_leave(p->db->mutex);
7609476098
}
7609576099
}
7609676100
@@ -76663,11 +76667,11 @@
7666376667
/*
7666476668
** Return true if the prepared statement is in need of being reset.
7666576669
*/
7666676670
SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
7666776671
Vdbe *v = (Vdbe*)pStmt;
76668
- return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
76672
+ return v!=0 && v->magic==VDBE_MAGIC_RUN && v->pc>=0;
7666976673
}
7667076674
7667176675
/*
7667276676
** Return a pointer to the next prepared statement after pStmt associated
7667376677
** with database connection pDb. If pStmt is NULL, return the first
@@ -78415,15 +78419,17 @@
7841578419
u16 nullFlag;
7841678420
pOut = out2Prerelease(p, pOp);
7841778421
cnt = pOp->p3-pOp->p2;
7841878422
assert( pOp->p3<=(p->nMem+1 - p->nCursor) );
7841978423
pOut->flags = nullFlag = pOp->p1 ? (MEM_Null|MEM_Cleared) : MEM_Null;
78424
+ pOut->n = 0;
7842078425
while( cnt>0 ){
7842178426
pOut++;
7842278427
memAboutToChange(p, pOut);
7842378428
sqlite3VdbeMemSetNull(pOut);
7842478429
pOut->flags = nullFlag;
78430
+ pOut->n = 0;
7842578431
cnt--;
7842678432
}
7842778433
break;
7842878434
}
7842978435
@@ -80487,14 +80493,13 @@
8048780493
p->nStmtDefCons = db->nDeferredCons;
8048880494
p->nStmtDefImmCons = db->nDeferredImmCons;
8048980495
}
8049080496
8049180497
/* Gather the schema version number for checking:
80492
- ** IMPLEMENTATION-OF: R-32195-19465 The schema version is used by SQLite
80493
- ** each time a query is executed to ensure that the internal cache of the
80494
- ** schema used when compiling the SQL query matches the schema of the
80495
- ** database against which the compiled query is actually executed.
80498
+ ** IMPLEMENTATION-OF: R-03189-51135 As each SQL statement runs, the schema
80499
+ ** version is checked to ensure that the schema has not changed since the
80500
+ ** SQL statement was prepared.
8049680501
*/
8049780502
sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&iMeta);
8049880503
iGen = db->aDb[pOp->p1].pSchema->iGeneration;
8049980504
}else{
8050080505
iGen = iMeta = 0;
@@ -81746,11 +81751,11 @@
8174681751
** change count is incremented (otherwise not).
8174781752
**
8174881753
** P1 must not be pseudo-table. It has to be a real table with
8174981754
** multiple rows.
8175081755
**
81751
-** If P4 is not NULL then it points to a Table struture. In this case either
81756
+** If P4 is not NULL then it points to a Table object. In this case either
8175281757
** the update or pre-update hook, or both, may be invoked. The P1 cursor must
8175381758
** have been positioned using OP_NotFound prior to invoking this opcode in
8175481759
** this case. Specifically, if one is configured, the pre-update hook is
8175581760
** invoked if P4 is not NULL. The update-hook is invoked if one is configured,
8175681761
** P4 is not NULL, and the OPFLAG_NCHANGE flag is set in P2.
@@ -82337,13 +82342,10 @@
8233782342
if( pOp->opcode==OP_SorterInsert ){
8233882343
rc = sqlite3VdbeSorterWrite(pC, pIn2);
8233982344
}else{
8234082345
x.nKey = pIn2->n;
8234182346
x.pKey = pIn2->z;
82342
- x.nData = 0;
82343
- x.nZero = 0;
82344
- x.pData = 0;
8234582347
rc = sqlite3BtreeInsert(pC->uc.pCursor, &x, pOp->p3,
8234682348
((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0)
8234782349
);
8234882350
assert( pC->deferredMoveto==0 );
8234982351
pC->cacheStatus = CACHE_STALE;
@@ -88036,11 +88038,13 @@
8803688038
static SQLITE_NOINLINE int walkExpr(Walker *pWalker, Expr *pExpr){
8803788039
int rc;
8803888040
testcase( ExprHasProperty(pExpr, EP_TokenOnly) );
8803988041
testcase( ExprHasProperty(pExpr, EP_Reduced) );
8804088042
rc = pWalker->xExprCallback(pWalker, pExpr);
88041
- if( rc || ExprHasProperty(pExpr,EP_TokenOnly) ) return rc & WRC_Abort;
88043
+ if( rc || ExprHasProperty(pExpr,(EP_TokenOnly|EP_Leaf)) ){
88044
+ return rc & WRC_Abort;
88045
+ }
8804288046
if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort;
8804388047
if( pExpr->pRight && walkExpr(pWalker, pExpr->pRight) ) return WRC_Abort;
8804488048
if( ExprHasProperty(pExpr, EP_xIsSelect) ){
8804588049
if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort;
8804688050
}else if( pExpr->x.pList ){
@@ -88780,11 +88784,10 @@
8878088784
const char *zDb;
8878188785
Expr *pRight;
8878288786
8878388787
/* if( pSrcList==0 ) break; */
8878488788
notValid(pParse, pNC, "the \".\" operator", NC_IdxExpr);
88785
- /*notValid(pParse, pNC, "the \".\" operator", NC_PartIdx|NC_IsCheck, 1);*/
8878688789
pRight = pExpr->pRight;
8878788790
if( pRight->op==TK_ID ){
8878888791
zDb = 0;
8878988792
zTable = pExpr->pLeft->u.zToken;
8879088793
zColumn = pRight->u.zToken;
@@ -88809,11 +88812,11 @@
8880988812
const char *zId; /* The function name. */
8881088813
FuncDef *pDef; /* Information about the function */
8881188814
u8 enc = ENC(pParse->db); /* The database encoding */
8881288815
8881388816
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
88814
- notValid(pParse, pNC, "functions", NC_PartIdx);
88817
+// notValid(pParse, pNC, "functions", NC_PartIdx);
8881588818
zId = pExpr->u.zToken;
8881688819
nId = sqlite3Strlen30(zId);
8881788820
pDef = sqlite3FindFunction(pParse->db, zId, n, enc, 0);
8881888821
if( pDef==0 ){
8881988822
pDef = sqlite3FindFunction(pParse->db, zId, -2, enc, 0);
@@ -88869,11 +88872,12 @@
8886988872
}
8887088873
if( (pDef->funcFlags & SQLITE_FUNC_CONSTANT)==0 ){
8887188874
/* Date/time functions that use 'now', and other functions like
8887288875
** sqlite_version() that might change over time cannot be used
8887388876
** in an index. */
88874
- notValid(pParse, pNC, "non-deterministic functions", NC_IdxExpr);
88877
+ notValid(pParse, pNC, "non-deterministic functions",
88878
+ NC_IdxExpr|NC_PartIdx);
8887588879
}
8887688880
}
8887788881
if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){
8887888882
sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
8887988883
pNC->nErr++;
@@ -90409,11 +90413,11 @@
9040990413
** stored in u.zToken. Instead, the integer values is written
9041090414
** into u.iValue and the EP_IntValue flag is set. No extra storage
9041190415
** is allocated to hold the integer text and the dequote flag is ignored.
9041290416
*/
9041390417
SQLITE_PRIVATE Expr *sqlite3ExprAlloc(
90414
- sqlite3 *db, /* Handle for sqlite3DbMallocZero() (may be null) */
90418
+ sqlite3 *db, /* Handle for sqlite3DbMallocRawNN() */
9041590419
int op, /* Expression opcode */
9041690420
const Token *pToken, /* Token argument. Might be NULL */
9041790421
int dequote /* True to dequote */
9041890422
){
9041990423
Expr *pNew;
@@ -90627,40 +90631,40 @@
9062790631
** Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number
9062890632
** as the previous instance of the same wildcard. Or if this is the first
9062990633
** instance of the wildcard, the next sequential variable number is
9063090634
** assigned.
9063190635
*/
90632
-SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
90636
+SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr, u32 n){
9063390637
sqlite3 *db = pParse->db;
9063490638
const char *z;
9063590639
9063690640
if( pExpr==0 ) return;
9063790641
assert( !ExprHasProperty(pExpr, EP_IntValue|EP_Reduced|EP_TokenOnly) );
9063890642
z = pExpr->u.zToken;
9063990643
assert( z!=0 );
9064090644
assert( z[0]!=0 );
90645
+ assert( n==sqlite3Strlen30(z) );
9064190646
if( z[1]==0 ){
9064290647
/* Wildcard of the form "?". Assign the next variable number */
9064390648
assert( z[0]=='?' );
9064490649
pExpr->iColumn = (ynVar)(++pParse->nVar);
9064590650
}else{
90646
- ynVar x = 0;
90647
- u32 n = sqlite3Strlen30(z);
90651
+ ynVar x;
9064890652
if( z[0]=='?' ){
9064990653
/* Wildcard of the form "?nnn". Convert "nnn" to an integer and
9065090654
** use it as the variable number */
9065190655
i64 i;
9065290656
int bOk = 0==sqlite3Atoi64(&z[1], &i, n-1, SQLITE_UTF8);
90653
- pExpr->iColumn = x = (ynVar)i;
90657
+ x = (ynVar)i;
9065490658
testcase( i==0 );
9065590659
testcase( i==1 );
9065690660
testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 );
9065790661
testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] );
9065890662
if( bOk==0 || i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
9065990663
sqlite3ErrorMsg(pParse, "variable number must be between ?1 and ?%d",
9066090664
db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]);
90661
- x = 0;
90665
+ return;
9066290666
}
9066390667
if( i>pParse->nVar ){
9066490668
pParse->nVar = (int)i;
9066590669
}
9066690670
}else{
@@ -90667,37 +90671,35 @@
9066790671
/* Wildcards like ":aaa", "$aaa" or "@aaa". Reuse the same variable
9066890672
** number as the prior appearance of the same name, or if the name
9066990673
** has never appeared before, reuse the same variable number
9067090674
*/
9067190675
ynVar i;
90672
- for(i=0; i<pParse->nzVar; i++){
90676
+ for(i=x=0; i<pParse->nzVar; i++){
9067390677
if( pParse->azVar[i] && strcmp(pParse->azVar[i],z)==0 ){
90674
- pExpr->iColumn = x = (ynVar)i+1;
90675
- break;
90676
- }
90677
- }
90678
- if( x==0 ) x = pExpr->iColumn = (ynVar)(++pParse->nVar);
90679
- }
90680
- if( x>0 ){
90681
- if( x>pParse->nzVar ){
90682
- char **a;
90683
- a = sqlite3DbRealloc(db, pParse->azVar, x*sizeof(a[0]));
90684
- if( a==0 ){
90685
- assert( db->mallocFailed ); /* Error reported through mallocFailed */
90686
- return;
90687
- }
90688
- pParse->azVar = a;
90689
- memset(&a[pParse->nzVar], 0, (x-pParse->nzVar)*sizeof(a[0]));
90690
- pParse->nzVar = x;
90691
- }
90692
- if( z[0]!='?' || pParse->azVar[x-1]==0 ){
90693
- sqlite3DbFree(db, pParse->azVar[x-1]);
90694
- pParse->azVar[x-1] = sqlite3DbStrNDup(db, z, n);
90695
- }
90696
- }
90697
- }
90698
- if( !pParse->nErr && pParse->nVar>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
90678
+ x = (ynVar)i+1;
90679
+ break;
90680
+ }
90681
+ }
90682
+ if( x==0 ) x = (ynVar)(++pParse->nVar);
90683
+ }
90684
+ pExpr->iColumn = x;
90685
+ if( x>pParse->nzVar ){
90686
+ char **a;
90687
+ a = sqlite3DbRealloc(db, pParse->azVar, x*sizeof(a[0]));
90688
+ if( a==0 ){
90689
+ assert( db->mallocFailed ); /* Error reported through mallocFailed */
90690
+ return;
90691
+ }
90692
+ pParse->azVar = a;
90693
+ memset(&a[pParse->nzVar], 0, (x-pParse->nzVar)*sizeof(a[0]));
90694
+ pParse->nzVar = x;
90695
+ }
90696
+ if( pParse->azVar[x-1]==0 ){
90697
+ pParse->azVar[x-1] = sqlite3DbStrNDup(db, z, n);
90698
+ }
90699
+ }
90700
+ if( pParse->nVar>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
9069990701
sqlite3ErrorMsg(pParse, "too many SQL variables");
9070090702
}
9070190703
}
9070290704
9070390705
/*
@@ -90705,22 +90707,29 @@
9070590707
*/
9070690708
static SQLITE_NOINLINE void sqlite3ExprDeleteNN(sqlite3 *db, Expr *p){
9070790709
assert( p!=0 );
9070890710
/* Sanity check: Assert that the IntValue is non-negative if it exists */
9070990711
assert( !ExprHasProperty(p, EP_IntValue) || p->u.iValue>=0 );
90710
- if( !ExprHasProperty(p, EP_TokenOnly) ){
90712
+#ifdef SQLITE_DEBUG
90713
+ if( ExprHasProperty(p, EP_Leaf) && !ExprHasProperty(p, EP_TokenOnly) ){
90714
+ assert( p->pLeft==0 );
90715
+ assert( p->pRight==0 );
90716
+ assert( p->x.pSelect==0 );
90717
+ }
90718
+#endif
90719
+ if( !ExprHasProperty(p, (EP_TokenOnly|EP_Leaf)) ){
9071190720
/* The Expr.x union is never used at the same time as Expr.pRight */
9071290721
assert( p->x.pList==0 || p->pRight==0 );
9071390722
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft);
9071490723
sqlite3ExprDelete(db, p->pRight);
90715
- if( ExprHasProperty(p, EP_MemToken) ) sqlite3DbFree(db, p->u.zToken);
9071690724
if( ExprHasProperty(p, EP_xIsSelect) ){
9071790725
sqlite3SelectDelete(db, p->x.pSelect);
9071890726
}else{
9071990727
sqlite3ExprListDelete(db, p->x.pList);
9072090728
}
9072190729
}
90730
+ if( ExprHasProperty(p, EP_MemToken) ) sqlite3DbFree(db, p->u.zToken);
9072290731
if( !ExprHasProperty(p, EP_Static) ){
9072390732
sqlite3DbFree(db, p);
9072490733
}
9072590734
}
9072690735
SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){
@@ -90893,11 +90902,11 @@
9089390902
if( nToken ){
9089490903
char *zToken = pNew->u.zToken = (char*)&zAlloc[nNewSize];
9089590904
memcpy(zToken, p->u.zToken, nToken);
9089690905
}
9089790906
90898
- if( 0==((p->flags|pNew->flags) & EP_TokenOnly) ){
90907
+ if( 0==((p->flags|pNew->flags) & (EP_TokenOnly|EP_Leaf)) ){
9089990908
/* Fill in the pNew->x.pSelect or pNew->x.pList member. */
9090090909
if( ExprHasProperty(p, EP_xIsSelect) ){
9090190910
pNew->x.pSelect = sqlite3SelectDup(db, p->x.pSelect, dupFlags);
9090290911
}else{
9090390912
pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, dupFlags);
@@ -90905,21 +90914,21 @@
9090590914
}
9090690915
9090790916
/* Fill in pNew->pLeft and pNew->pRight. */
9090890917
if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly) ){
9090990918
zAlloc += dupedExprNodeSize(p, dupFlags);
90910
- if( ExprHasProperty(pNew, EP_Reduced) ){
90919
+ if( !ExprHasProperty(pNew, EP_TokenOnly|EP_Leaf) ){
9091190920
pNew->pLeft = p->pLeft ?
9091290921
exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0;
9091390922
pNew->pRight = p->pRight ?
9091490923
exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0;
9091590924
}
9091690925
if( pzBuffer ){
9091790926
*pzBuffer = zAlloc;
9091890927
}
9091990928
}else{
90920
- if( !ExprHasProperty(p, EP_TokenOnly) ){
90929
+ if( !ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){
9092190930
if( pNew->op==TK_SELECT_COLUMN ){
9092290931
pNew->pLeft = p->pLeft;
9092390932
}else{
9092490933
pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
9092590934
}
@@ -92276,12 +92285,12 @@
9227692285
dest.eDest = SRT_Exists;
9227792286
sqlite3VdbeAddOp2(v, OP_Integer, 0, dest.iSDParm);
9227892287
VdbeComment((v, "Init EXISTS result"));
9227992288
}
9228092289
sqlite3ExprDelete(pParse->db, pSel->pLimit);
92281
- pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0,
92282
- &sqlite3IntTokens[1]);
92290
+ pSel->pLimit = sqlite3ExprAlloc(pParse->db, TK_INTEGER,
92291
+ &sqlite3IntTokens[1], 0);
9228392292
pSel->iLimit = 0;
9228492293
pSel->selFlags &= ~SF_MultiValue;
9228592294
if( sqlite3Select(pParse, pSel, &dest) ){
9228692295
return 0;
9228792296
}
@@ -92646,36 +92655,23 @@
9264692655
#endif
9264792656
}
9264892657
}
9264992658
}
9265092659
92651
-#if defined(SQLITE_DEBUG)
92652
-/*
92653
-** Verify the consistency of the column cache
92654
-*/
92655
-static int cacheIsValid(Parse *pParse){
92656
- int i, n;
92657
- for(i=n=0; i<SQLITE_N_COLCACHE; i++){
92658
- if( pParse->aColCache[i].iReg>0 ) n++;
92659
- }
92660
- return n==pParse->nColCache;
92661
-}
92662
-#endif
92663
-
92664
-/*
92665
-** Clear a cache entry.
92666
-*/
92667
-static void cacheEntryClear(Parse *pParse, struct yColCache *p){
92668
- if( p->tempReg ){
92660
+/*
92661
+** Erase column-cache entry number i
92662
+*/
92663
+static void cacheEntryClear(Parse *pParse, int i){
92664
+ if( pParse->aColCache[i].tempReg ){
9266992665
if( pParse->nTempReg<ArraySize(pParse->aTempReg) ){
92670
- pParse->aTempReg[pParse->nTempReg++] = p->iReg;
92666
+ pParse->aTempReg[pParse->nTempReg++] = pParse->aColCache[i].iReg;
9267192667
}
92672
- p->tempReg = 0;
9267392668
}
92674
- p->iReg = 0;
9267592669
pParse->nColCache--;
92676
- assert( pParse->db->mallocFailed || cacheIsValid(pParse) );
92670
+ if( i<pParse->nColCache ){
92671
+ pParse->aColCache[i] = pParse->aColCache[pParse->nColCache];
92672
+ }
9267792673
}
9267892674
9267992675
9268092676
/*
9268192677
** Record in the column cache that a particular column from a
@@ -92701,64 +92697,52 @@
9270192697
**
9270292698
** Actually, the way the column cache is currently used, we are guaranteed
9270392699
** that the object will never already be in cache. Verify this guarantee.
9270492700
*/
9270592701
#ifndef NDEBUG
92706
- for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92707
- assert( p->iReg==0 || p->iTable!=iTab || p->iColumn!=iCol );
92702
+ for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
92703
+ assert( p->iTable!=iTab || p->iColumn!=iCol );
9270892704
}
9270992705
#endif
9271092706
92711
- /* Find an empty slot and replace it */
92712
- for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92713
- if( p->iReg==0 ){
92714
- p->iLevel = pParse->iCacheLevel;
92715
- p->iTable = iTab;
92716
- p->iColumn = iCol;
92717
- p->iReg = iReg;
92718
- p->tempReg = 0;
92719
- p->lru = pParse->iCacheCnt++;
92720
- pParse->nColCache++;
92721
- assert( pParse->db->mallocFailed || cacheIsValid(pParse) );
92722
- return;
92723
- }
92724
- }
92725
-
92726
- /* Replace the last recently used */
92727
- minLru = 0x7fffffff;
92728
- idxLru = -1;
92729
- for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92730
- if( p->lru<minLru ){
92731
- idxLru = i;
92732
- minLru = p->lru;
92733
- }
92734
- }
92735
- if( ALWAYS(idxLru>=0) ){
92707
+ /* If the cache is already full, delete the least recently used entry */
92708
+ if( pParse->nColCache>=SQLITE_N_COLCACHE ){
92709
+ minLru = 0x7fffffff;
92710
+ idxLru = -1;
92711
+ for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92712
+ if( p->lru<minLru ){
92713
+ idxLru = i;
92714
+ minLru = p->lru;
92715
+ }
92716
+ }
9273692717
p = &pParse->aColCache[idxLru];
92737
- p->iLevel = pParse->iCacheLevel;
92738
- p->iTable = iTab;
92739
- p->iColumn = iCol;
92740
- p->iReg = iReg;
92741
- p->tempReg = 0;
92742
- p->lru = pParse->iCacheCnt++;
92743
- assert( cacheIsValid(pParse) );
92744
- return;
92745
- }
92718
+ }else{
92719
+ p = &pParse->aColCache[pParse->nColCache++];
92720
+ }
92721
+
92722
+ /* Add the new entry to the end of the cache */
92723
+ p->iLevel = pParse->iCacheLevel;
92724
+ p->iTable = iTab;
92725
+ p->iColumn = iCol;
92726
+ p->iReg = iReg;
92727
+ p->tempReg = 0;
92728
+ p->lru = pParse->iCacheCnt++;
9274692729
}
9274792730
9274892731
/*
9274992732
** Indicate that registers between iReg..iReg+nReg-1 are being overwritten.
9275092733
** Purge the range of registers from the column cache.
9275192734
*/
9275292735
SQLITE_PRIVATE void sqlite3ExprCacheRemove(Parse *pParse, int iReg, int nReg){
92753
- struct yColCache *p;
92754
- if( iReg<=0 || pParse->nColCache==0 ) return;
92755
- p = &pParse->aColCache[SQLITE_N_COLCACHE-1];
92756
- while(1){
92757
- if( p->iReg >= iReg && p->iReg < iReg+nReg ) cacheEntryClear(pParse, p);
92758
- if( p==pParse->aColCache ) break;
92759
- p--;
92736
+ int i = 0;
92737
+ while( i<pParse->nColCache ){
92738
+ struct yColCache *p = &pParse->aColCache[i];
92739
+ if( p->iReg >= iReg && p->iReg < iReg+nReg ){
92740
+ cacheEntryClear(pParse, i);
92741
+ }else{
92742
+ i++;
92743
+ }
9276092744
}
9276192745
}
9276292746
9276392747
/*
9276492748
** Remember the current column cache context. Any new entries added
@@ -92778,22 +92762,23 @@
9277892762
** Remove from the column cache any entries that were added since the
9277992763
** the previous sqlite3ExprCachePush operation. In other words, restore
9278092764
** the cache to the state it was in prior the most recent Push.
9278192765
*/
9278292766
SQLITE_PRIVATE void sqlite3ExprCachePop(Parse *pParse){
92783
- int i;
92784
- struct yColCache *p;
92767
+ int i = 0;
9278592768
assert( pParse->iCacheLevel>=1 );
9278692769
pParse->iCacheLevel--;
9278792770
#ifdef SQLITE_DEBUG
9278892771
if( pParse->db->flags & SQLITE_VdbeAddopTrace ){
9278992772
printf("POP to %d\n", pParse->iCacheLevel);
9279092773
}
9279192774
#endif
92792
- for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92793
- if( p->iReg && p->iLevel>pParse->iCacheLevel ){
92794
- cacheEntryClear(pParse, p);
92775
+ while( i<pParse->nColCache ){
92776
+ if( pParse->aColCache[i].iLevel>pParse->iCacheLevel ){
92777
+ cacheEntryClear(pParse, i);
92778
+ }else{
92779
+ i++;
9279592780
}
9279692781
}
9279792782
}
9279892783
9279992784
/*
@@ -92803,11 +92788,11 @@
9280392788
** get them all.
9280492789
*/
9280592790
static void sqlite3ExprCachePinRegister(Parse *pParse, int iReg){
9280692791
int i;
9280792792
struct yColCache *p;
92808
- for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92793
+ for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
9280992794
if( p->iReg==iReg ){
9281092795
p->tempReg = 0;
9281192796
}
9281292797
}
9281392798
}
@@ -92881,12 +92866,12 @@
9288192866
){
9288292867
Vdbe *v = pParse->pVdbe;
9288392868
int i;
9288492869
struct yColCache *p;
9288592870
92886
- for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92887
- if( p->iReg>0 && p->iTable==iTable && p->iColumn==iColumn ){
92871
+ for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
92872
+ if( p->iTable==iTable && p->iColumn==iColumn ){
9288892873
p->lru = pParse->iCacheCnt++;
9288992874
sqlite3ExprCachePinRegister(pParse, p->iReg);
9289092875
return p->iReg;
9289192876
}
9289292877
}
@@ -92914,22 +92899,24 @@
9291492899
/*
9291592900
** Clear all column cache entries.
9291692901
*/
9291792902
SQLITE_PRIVATE void sqlite3ExprCacheClear(Parse *pParse){
9291892903
int i;
92919
- struct yColCache *p;
9292092904
9292192905
#if SQLITE_DEBUG
9292292906
if( pParse->db->flags & SQLITE_VdbeAddopTrace ){
9292392907
printf("CLEAR\n");
9292492908
}
9292592909
#endif
92926
- for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92927
- if( p->iReg ){
92928
- cacheEntryClear(pParse, p);
92910
+ for(i=0; i<pParse->nColCache; i++){
92911
+ if( pParse->aColCache[i].tempReg
92912
+ && pParse->nTempReg<ArraySize(pParse->aTempReg)
92913
+ ){
92914
+ pParse->aTempReg[pParse->nTempReg++] = pParse->aColCache[i].iReg;
9292992915
}
9293092916
}
92917
+ pParse->nColCache = 0;
9293192918
}
9293292919
9293392920
/*
9293492921
** Record the fact that an affinity change has occurred on iCount
9293592922
** registers starting with iStart.
@@ -92957,11 +92944,11 @@
9295792944
** and does not appear in a normal build.
9295892945
*/
9295992946
static int usedAsColumnCache(Parse *pParse, int iFrom, int iTo){
9296092947
int i;
9296192948
struct yColCache *p;
92962
- for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92949
+ for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
9296392950
int r = p->iReg;
9296492951
if( r>=iFrom && r<=iTo ) return 1; /*NO_TEST*/
9296592952
}
9296692953
return 0;
9296792954
}
@@ -94653,11 +94640,11 @@
9465394640
*/
9465494641
SQLITE_PRIVATE void sqlite3ReleaseTempReg(Parse *pParse, int iReg){
9465594642
if( iReg && pParse->nTempReg<ArraySize(pParse->aTempReg) ){
9465694643
int i;
9465794644
struct yColCache *p;
94658
- for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
94645
+ for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
9465994646
if( p->iReg==iReg ){
9466094647
p->tempReg = 1;
9466194648
return;
9466294649
}
9466394650
}
@@ -97959,11 +97946,11 @@
9795997946
}else{
9796097947
sqlite3ErrorMsg(pFix->pParse, "%s cannot use variables", pFix->zType);
9796197948
return 1;
9796297949
}
9796397950
}
97964
- if( ExprHasProperty(pExpr, EP_TokenOnly) ) break;
97951
+ if( ExprHasProperty(pExpr, EP_TokenOnly|EP_Leaf) ) break;
9796597952
if( ExprHasProperty(pExpr, EP_xIsSelect) ){
9796697953
if( sqlite3FixSelect(pFix, pExpr->x.pSelect) ) return 1;
9796797954
}else{
9796897955
if( sqlite3FixExprList(pFix, pExpr->x.pList) ) return 1;
9796997956
}
@@ -98423,11 +98410,10 @@
9842398410
*/
9842498411
v = sqlite3GetVdbe(pParse);
9842598412
assert( !pParse->isMultiWrite
9842698413
|| sqlite3VdbeAssertMayAbort(v, pParse->mayAbort));
9842798414
if( v ){
98428
- while( sqlite3VdbeDeletePriorOpcode(v, OP_Close) ){}
9842998415
sqlite3VdbeAddOp0(v, OP_Halt);
9843098416
9843198417
#if SQLITE_USER_AUTHENTICATION
9843298418
if( pParse->nTableLock>0 && db->init.busy==0 ){
9843398419
sqlite3UserAuthInit(db);
@@ -98450,18 +98436,20 @@
9845098436
){
9845198437
int iDb, i;
9845298438
assert( sqlite3VdbeGetOp(v, 0)->opcode==OP_Init );
9845398439
sqlite3VdbeJumpHere(v, 0);
9845498440
for(iDb=0; iDb<db->nDb; iDb++){
98441
+ Schema *pSchema;
9845598442
if( DbMaskTest(pParse->cookieMask, iDb)==0 ) continue;
9845698443
sqlite3VdbeUsesBtree(v, iDb);
98444
+ pSchema = db->aDb[iDb].pSchema;
9845798445
sqlite3VdbeAddOp4Int(v,
9845898446
OP_Transaction, /* Opcode */
9845998447
iDb, /* P1 */
9846098448
DbMaskTest(pParse->writeMask,iDb), /* P2 */
98461
- pParse->cookieValue[iDb], /* P3 */
98462
- db->aDb[iDb].pSchema->iGeneration /* P4 */
98449
+ pSchema->schema_cookie, /* P3 */
98450
+ pSchema->iGeneration /* P4 */
9846398451
);
9846498452
if( db->init.busy==0 ) sqlite3VdbeChangeP5(v, 1);
9846598453
VdbeComment((v,
9846698454
"usesStmtJournal=%d", pParse->mayAbort && pParse->isMultiWrite));
9846798455
}
@@ -98508,20 +98496,10 @@
9850898496
sqlite3VdbeMakeReady(v, pParse);
9850998497
pParse->rc = SQLITE_DONE;
9851098498
}else{
9851198499
pParse->rc = SQLITE_ERROR;
9851298500
}
98513
-
98514
- /* We are done with this Parse object. There is no need to de-initialize it */
98515
-#if 0
98516
- pParse->colNamesSet = 0;
98517
- pParse->nTab = 0;
98518
- pParse->nMem = 0;
98519
- pParse->nSet = 0;
98520
- pParse->nVar = 0;
98521
- DbMaskZero(pParse->cookieMask);
98522
-#endif
9852398501
}
9852498502
9852598503
/*
9852698504
** Run the parser and code generator recursively in order to generate
9852798505
** code for the SQL statement given onto the end of the pParse context
@@ -98537,12 +98515,11 @@
9853798515
SQLITE_PRIVATE void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){
9853898516
va_list ap;
9853998517
char *zSql;
9854098518
char *zErrMsg = 0;
9854198519
sqlite3 *db = pParse->db;
98542
-# define SAVE_SZ (sizeof(Parse) - offsetof(Parse,nVar))
98543
- char saveBuf[SAVE_SZ];
98520
+ char saveBuf[PARSE_TAIL_SZ];
9854498521
9854598522
if( pParse->nErr ) return;
9854698523
assert( pParse->nested<10 ); /* Nesting should only be of limited depth */
9854798524
va_start(ap, zFormat);
9854898525
zSql = sqlite3VMPrintf(db, zFormat, ap);
@@ -98549,16 +98526,16 @@
9854998526
va_end(ap);
9855098527
if( zSql==0 ){
9855198528
return; /* A malloc must have failed */
9855298529
}
9855398530
pParse->nested++;
98554
- memcpy(saveBuf, &pParse->nVar, SAVE_SZ);
98555
- memset(&pParse->nVar, 0, SAVE_SZ);
98531
+ memcpy(saveBuf, PARSE_TAIL(pParse), PARSE_TAIL_SZ);
98532
+ memset(PARSE_TAIL(pParse), 0, PARSE_TAIL_SZ);
9855698533
sqlite3RunParser(pParse, zSql, &zErrMsg);
9855798534
sqlite3DbFree(db, zErrMsg);
9855898535
sqlite3DbFree(db, zSql);
98559
- memcpy(&pParse->nVar, saveBuf, SAVE_SZ);
98536
+ memcpy(PARSE_TAIL(pParse), saveBuf, PARSE_TAIL_SZ);
9856098537
pParse->nested--;
9856198538
}
9856298539
9856398540
#if SQLITE_USER_AUTHENTICATION
9856498541
/*
@@ -99735,10 +99712,13 @@
9973599712
** This plan is not completely bullet-proof. It is possible for
9973699713
** the schema to change multiple times and for the cookie to be
9973799714
** set back to prior value. But schema changes are infrequent
9973899715
** and the probability of hitting the same cookie value is only
9973999716
** 1 chance in 2^32. So we're safe enough.
99717
+**
99718
+** IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments
99719
+** the schema-version whenever the schema changes.
9974099720
*/
9974199721
SQLITE_PRIVATE void sqlite3ChangeCookie(Parse *pParse, int iDb){
9974299722
sqlite3 *db = pParse->db;
9974399723
Vdbe *v = pParse->pVdbe;
9974499724
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
@@ -102318,19 +102298,17 @@
102318102298
** will occur at the end of the top-level VDBE and will be generated
102319102299
** later, by sqlite3FinishCoding().
102320102300
*/
102321102301
SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
102322102302
Parse *pToplevel = sqlite3ParseToplevel(pParse);
102323
- sqlite3 *db = pToplevel->db;
102324102303
102325
- assert( iDb>=0 && iDb<db->nDb );
102326
- assert( db->aDb[iDb].pBt!=0 || iDb==1 );
102304
+ assert( iDb>=0 && iDb<pParse->db->nDb );
102305
+ assert( pParse->db->aDb[iDb].pBt!=0 || iDb==1 );
102327102306
assert( iDb<SQLITE_MAX_ATTACHED+2 );
102328
- assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
102307
+ assert( sqlite3SchemaMutexHeld(pParse->db, iDb, 0) );
102329102308
if( DbMaskTest(pToplevel->cookieMask, iDb)==0 ){
102330102309
DbMaskSet(pToplevel->cookieMask, iDb);
102331
- pToplevel->cookieValue[iDb] = db->aDb[iDb].pSchema->schema_cookie;
102332102310
if( !OMIT_TEMPDB && iDb==1 ){
102333102311
sqlite3OpenTempDatabase(pToplevel);
102334102312
}
102335102313
}
102336102314
}
@@ -107192,14 +107170,14 @@
107192107170
}else if( action==OE_SetDflt ){
107193107171
Expr *pDflt = pFKey->pFrom->aCol[iFromCol].pDflt;
107194107172
if( pDflt ){
107195107173
pNew = sqlite3ExprDup(db, pDflt, 0);
107196107174
}else{
107197
- pNew = sqlite3PExpr(pParse, TK_NULL, 0, 0, 0);
107175
+ pNew = sqlite3ExprAlloc(db, TK_NULL, 0, 0);
107198107176
}
107199107177
}else{
107200
- pNew = sqlite3PExpr(pParse, TK_NULL, 0, 0, 0);
107178
+ pNew = sqlite3ExprAlloc(db, TK_NULL, 0, 0);
107201107179
}
107202107180
pList = sqlite3ExprListAppend(pParse, pList, pNew);
107203107181
sqlite3ExprListSetName(pParse, pList, &tFromCol, 0);
107204107182
}
107205107183
}
@@ -109538,10 +109516,11 @@
109538109516
}
109539109517
if( emptySrcTest ) sqlite3VdbeJumpHere(v, emptySrcTest);
109540109518
sqlite3ReleaseTempReg(pParse, regRowid);
109541109519
sqlite3ReleaseTempReg(pParse, regData);
109542109520
if( emptyDestTest ){
109521
+ sqlite3AutoincrementEnd(pParse);
109543109522
sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_OK, 0);
109544109523
sqlite3VdbeJumpHere(v, emptyDestTest);
109545109524
sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
109546109525
return 0;
109547109526
}else{
@@ -114034,22 +114013,18 @@
114034114013
int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
114035114014
Vdbe *pReprepare, /* VM being reprepared */
114036114015
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
114037114016
const char **pzTail /* OUT: End of parsed string */
114038114017
){
114039
- Parse *pParse; /* Parsing context */
114040114018
char *zErrMsg = 0; /* Error message */
114041114019
int rc = SQLITE_OK; /* Result code */
114042114020
int i; /* Loop counter */
114043
-
114044
- /* Allocate the parsing context */
114045
- pParse = sqlite3StackAllocZero(db, sizeof(*pParse));
114046
- if( pParse==0 ){
114047
- rc = SQLITE_NOMEM_BKPT;
114048
- goto end_prepare;
114049
- }
114050
- pParse->pReprepare = pReprepare;
114021
+ Parse sParse; /* Parsing context */
114022
+
114023
+ memset(&sParse, 0, PARSE_HDR_SZ);
114024
+ memset(PARSE_TAIL(&sParse), 0, PARSE_TAIL_SZ);
114025
+ sParse.pReprepare = pReprepare;
114051114026
assert( ppStmt && *ppStmt==0 );
114052114027
/* assert( !db->mallocFailed ); // not true with SQLITE_USE_ALLOCA */
114053114028
assert( sqlite3_mutex_held(db->mutex) );
114054114029
114055114030
/* Check to verify that it is possible to get a read lock on all
@@ -114089,12 +114064,11 @@
114089114064
}
114090114065
}
114091114066
114092114067
sqlite3VtabUnlockList(db);
114093114068
114094
- pParse->db = db;
114095
- pParse->nQueryLoop = 0; /* Logarithmic, so 0 really means 1 */
114069
+ sParse.db = db;
114096114070
if( nBytes>=0 && (nBytes==0 || zSql[nBytes-1]!=0) ){
114097114071
char *zSqlCopy;
114098114072
int mxLen = db->aLimit[SQLITE_LIMIT_SQL_LENGTH];
114099114073
testcase( nBytes==mxLen );
114100114074
testcase( nBytes==mxLen+1 );
@@ -114103,65 +114077,65 @@
114103114077
rc = sqlite3ApiExit(db, SQLITE_TOOBIG);
114104114078
goto end_prepare;
114105114079
}
114106114080
zSqlCopy = sqlite3DbStrNDup(db, zSql, nBytes);
114107114081
if( zSqlCopy ){
114108
- sqlite3RunParser(pParse, zSqlCopy, &zErrMsg);
114109
- pParse->zTail = &zSql[pParse->zTail-zSqlCopy];
114082
+ sqlite3RunParser(&sParse, zSqlCopy, &zErrMsg);
114083
+ sParse.zTail = &zSql[sParse.zTail-zSqlCopy];
114110114084
sqlite3DbFree(db, zSqlCopy);
114111114085
}else{
114112
- pParse->zTail = &zSql[nBytes];
114086
+ sParse.zTail = &zSql[nBytes];
114113114087
}
114114114088
}else{
114115
- sqlite3RunParser(pParse, zSql, &zErrMsg);
114089
+ sqlite3RunParser(&sParse, zSql, &zErrMsg);
114116114090
}
114117
- assert( 0==pParse->nQueryLoop );
114091
+ assert( 0==sParse.nQueryLoop );
114118114092
114119
- if( pParse->rc==SQLITE_DONE ) pParse->rc = SQLITE_OK;
114120
- if( pParse->checkSchema ){
114121
- schemaIsValid(pParse);
114093
+ if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK;
114094
+ if( sParse.checkSchema ){
114095
+ schemaIsValid(&sParse);
114122114096
}
114123114097
if( db->mallocFailed ){
114124
- pParse->rc = SQLITE_NOMEM_BKPT;
114098
+ sParse.rc = SQLITE_NOMEM_BKPT;
114125114099
}
114126114100
if( pzTail ){
114127
- *pzTail = pParse->zTail;
114101
+ *pzTail = sParse.zTail;
114128114102
}
114129
- rc = pParse->rc;
114103
+ rc = sParse.rc;
114130114104
114131114105
#ifndef SQLITE_OMIT_EXPLAIN
114132
- if( rc==SQLITE_OK && pParse->pVdbe && pParse->explain ){
114106
+ if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){
114133114107
static const char * const azColName[] = {
114134114108
"addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment",
114135114109
"selectid", "order", "from", "detail"
114136114110
};
114137114111
int iFirst, mx;
114138
- if( pParse->explain==2 ){
114139
- sqlite3VdbeSetNumCols(pParse->pVdbe, 4);
114112
+ if( sParse.explain==2 ){
114113
+ sqlite3VdbeSetNumCols(sParse.pVdbe, 4);
114140114114
iFirst = 8;
114141114115
mx = 12;
114142114116
}else{
114143
- sqlite3VdbeSetNumCols(pParse->pVdbe, 8);
114117
+ sqlite3VdbeSetNumCols(sParse.pVdbe, 8);
114144114118
iFirst = 0;
114145114119
mx = 8;
114146114120
}
114147114121
for(i=iFirst; i<mx; i++){
114148
- sqlite3VdbeSetColName(pParse->pVdbe, i-iFirst, COLNAME_NAME,
114122
+ sqlite3VdbeSetColName(sParse.pVdbe, i-iFirst, COLNAME_NAME,
114149114123
azColName[i], SQLITE_STATIC);
114150114124
}
114151114125
}
114152114126
#endif
114153114127
114154114128
if( db->init.busy==0 ){
114155
- Vdbe *pVdbe = pParse->pVdbe;
114156
- sqlite3VdbeSetSql(pVdbe, zSql, (int)(pParse->zTail-zSql), saveSqlFlag);
114129
+ Vdbe *pVdbe = sParse.pVdbe;
114130
+ sqlite3VdbeSetSql(pVdbe, zSql, (int)(sParse.zTail-zSql), saveSqlFlag);
114157114131
}
114158
- if( pParse->pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){
114159
- sqlite3VdbeFinalize(pParse->pVdbe);
114132
+ if( sParse.pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){
114133
+ sqlite3VdbeFinalize(sParse.pVdbe);
114160114134
assert(!(*ppStmt));
114161114135
}else{
114162
- *ppStmt = (sqlite3_stmt*)pParse->pVdbe;
114136
+ *ppStmt = (sqlite3_stmt*)sParse.pVdbe;
114163114137
}
114164114138
114165114139
if( zErrMsg ){
114166114140
sqlite3ErrorWithMsg(db, rc, "%s", zErrMsg);
114167114141
sqlite3DbFree(db, zErrMsg);
@@ -114168,20 +114142,19 @@
114168114142
}else{
114169114143
sqlite3Error(db, rc);
114170114144
}
114171114145
114172114146
/* Delete any TriggerPrg structures allocated while parsing this statement. */
114173
- while( pParse->pTriggerPrg ){
114174
- TriggerPrg *pT = pParse->pTriggerPrg;
114175
- pParse->pTriggerPrg = pT->pNext;
114147
+ while( sParse.pTriggerPrg ){
114148
+ TriggerPrg *pT = sParse.pTriggerPrg;
114149
+ sParse.pTriggerPrg = pT->pNext;
114176114150
sqlite3DbFree(db, pT);
114177114151
}
114178114152
114179114153
end_prepare:
114180114154
114181
- sqlite3ParserReset(pParse);
114182
- sqlite3StackFree(db, pParse);
114155
+ sqlite3ParserReset(&sParse);
114183114156
rc = sqlite3ApiExit(db, rc);
114184114157
assert( (rc&db->errMask)==rc );
114185114158
return rc;
114186114159
}
114187114160
static int sqlite3LockAndPrepare(
@@ -115382,11 +115355,11 @@
115382115355
** Allocate a KeyInfo object sufficient for an index of N key columns and
115383115356
** X extra columns.
115384115357
*/
115385115358
SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3 *db, int N, int X){
115386115359
int nExtra = (N+X)*(sizeof(CollSeq*)+1);
115387
- KeyInfo *p = sqlite3DbMallocRaw(db, sizeof(KeyInfo) + nExtra);
115360
+ KeyInfo *p = sqlite3DbMallocRawNN(db, sizeof(KeyInfo) + nExtra);
115388115361
if( p ){
115389115362
p->aSortOrder = (u8*)&p->aColl[N+X];
115390115363
p->nField = (u16)N;
115391115364
p->nXField = (u16)X;
115392115365
p->enc = ENC(db);
@@ -118072,16 +118045,17 @@
118072118045
pWhere = sqlite3ExprDup(db, pSub->pWhere, 0);
118073118046
if( subqueryIsAgg ){
118074118047
assert( pParent->pHaving==0 );
118075118048
pParent->pHaving = pParent->pWhere;
118076118049
pParent->pWhere = pWhere;
118077
- pParent->pHaving = sqlite3ExprAnd(db, pParent->pHaving,
118078
- sqlite3ExprDup(db, pSub->pHaving, 0));
118050
+ pParent->pHaving = sqlite3ExprAnd(db,
118051
+ sqlite3ExprDup(db, pSub->pHaving, 0), pParent->pHaving
118052
+ );
118079118053
assert( pParent->pGroupBy==0 );
118080118054
pParent->pGroupBy = sqlite3ExprListDup(db, pSub->pGroupBy, 0);
118081118055
}else{
118082
- pParent->pWhere = sqlite3ExprAnd(db, pParent->pWhere, pWhere);
118056
+ pParent->pWhere = sqlite3ExprAnd(db, pWhere, pParent->pWhere);
118083118057
}
118084118058
substSelect(db, pParent, iParent, pSub->pEList, 0);
118085118059
118086118060
/* The flattened query is distinct if either the inner or the
118087118061
** outer query is distinct.
@@ -124041,24 +124015,24 @@
124041124015
** in prereqRight and prereqAll. The default is 64 bits, hence SQLite
124042124016
** is only able to process joins with 64 or fewer tables.
124043124017
*/
124044124018
struct WhereTerm {
124045124019
Expr *pExpr; /* Pointer to the subexpression that is this term */
124020
+ WhereClause *pWC; /* The clause this term is part of */
124021
+ LogEst truthProb; /* Probability of truth for this expression */
124022
+ u16 wtFlags; /* TERM_xxx bit flags. See below */
124023
+ u16 eOperator; /* A WO_xx value describing <op> */
124024
+ u8 nChild; /* Number of children that must disable us */
124025
+ u8 eMatchOp; /* Op for vtab MATCH/LIKE/GLOB/REGEXP terms */
124046124026
int iParent; /* Disable pWC->a[iParent] when this term disabled */
124047124027
int leftCursor; /* Cursor number of X in "X <op> <expr>" */
124048124028
int iField; /* Field in (?,?,?) IN (SELECT...) vector */
124049124029
union {
124050124030
int leftColumn; /* Column number of X in "X <op> <expr>" */
124051124031
WhereOrInfo *pOrInfo; /* Extra information if (eOperator & WO_OR)!=0 */
124052124032
WhereAndInfo *pAndInfo; /* Extra information if (eOperator& WO_AND)!=0 */
124053124033
} u;
124054
- LogEst truthProb; /* Probability of truth for this expression */
124055
- u16 eOperator; /* A WO_xx value describing <op> */
124056
- u16 wtFlags; /* TERM_xxx bit flags. See below */
124057
- u8 nChild; /* Number of children that must disable us */
124058
- u8 eMatchOp; /* Op for vtab MATCH/LIKE/GLOB/REGEXP terms */
124059
- WhereClause *pWC; /* The clause this term is part of */
124060124034
Bitmask prereqRight; /* Bitmask of tables used by pExpr->pRight */
124061124035
Bitmask prereqAll; /* Bitmask of tables referenced by pExpr */
124062124036
};
124063124037
124064124038
/*
@@ -124207,29 +124181,29 @@
124207124181
struct WhereInfo {
124208124182
Parse *pParse; /* Parsing and code generating context */
124209124183
SrcList *pTabList; /* List of tables in the join */
124210124184
ExprList *pOrderBy; /* The ORDER BY clause or NULL */
124211124185
ExprList *pDistinctSet; /* DISTINCT over all these values */
124212
- WhereLoop *pLoops; /* List of all WhereLoop objects */
124213
- Bitmask revMask; /* Mask of ORDER BY terms that need reversing */
124214
- LogEst nRowOut; /* Estimated number of output rows */
124215124186
LogEst iLimit; /* LIMIT if wctrlFlags has WHERE_USE_LIMIT */
124187
+ int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */
124188
+ int iContinue; /* Jump here to continue with next record */
124189
+ int iBreak; /* Jump here to break out of the loop */
124190
+ int savedNQueryLoop; /* pParse->nQueryLoop outside the WHERE loop */
124216124191
u16 wctrlFlags; /* Flags originally passed to sqlite3WhereBegin() */
124192
+ u8 nLevel; /* Number of nested loop */
124217124193
i8 nOBSat; /* Number of ORDER BY terms satisfied by indices */
124218124194
u8 sorted; /* True if really sorted (not just grouped) */
124219124195
u8 eOnePass; /* ONEPASS_OFF, or _SINGLE, or _MULTI */
124220124196
u8 untestedTerms; /* Not all WHERE terms resolved by outer loop */
124221124197
u8 eDistinct; /* One of the WHERE_DISTINCT_* values */
124222
- u8 nLevel; /* Number of nested loop */
124223124198
u8 bOrderedInnerLoop; /* True if only the inner-most loop is ordered */
124224124199
int iTop; /* The very beginning of the WHERE loop */
124225
- int iContinue; /* Jump here to continue with next record */
124226
- int iBreak; /* Jump here to break out of the loop */
124227
- int savedNQueryLoop; /* pParse->nQueryLoop outside the WHERE loop */
124228
- int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */
124229
- WhereMaskSet sMaskSet; /* Map cursor numbers to bitmasks */
124200
+ WhereLoop *pLoops; /* List of all WhereLoop objects */
124201
+ Bitmask revMask; /* Mask of ORDER BY terms that need reversing */
124202
+ LogEst nRowOut; /* Estimated number of output rows */
124230124203
WhereClause sWC; /* Decomposition of the WHERE clause */
124204
+ WhereMaskSet sMaskSet; /* Map cursor numbers to bitmasks */
124231124205
WhereLevel a[1]; /* Information about each nest loop in WHERE */
124232124206
};
124233124207
124234124208
/*
124235124209
** Private interfaces - callable only by other where.c routines.
@@ -126315,11 +126289,11 @@
126315126289
** and we are coding the t1 loop and the t2 loop has not yet coded,
126316126290
** then we cannot use the "t1.a=t2.b" constraint, but we can code
126317126291
** the implied "t1.a=123" constraint.
126318126292
*/
126319126293
for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){
126320
- Expr *pE, *pEAlt;
126294
+ Expr *pE, sEAlt;
126321126295
WhereTerm *pAlt;
126322126296
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
126323126297
if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) continue;
126324126298
if( (pTerm->eOperator & WO_EQUIV)==0 ) continue;
126325126299
if( pTerm->leftCursor!=iCur ) continue;
@@ -126333,17 +126307,13 @@
126333126307
if( pAlt->wtFlags & (TERM_CODED) ) continue;
126334126308
testcase( pAlt->eOperator & WO_EQ );
126335126309
testcase( pAlt->eOperator & WO_IS );
126336126310
testcase( pAlt->eOperator & WO_IN );
126337126311
VdbeModuleComment((v, "begin transitive constraint"));
126338
- pEAlt = sqlite3StackAllocRaw(db, sizeof(*pEAlt));
126339
- if( pEAlt ){
126340
- *pEAlt = *pAlt->pExpr;
126341
- pEAlt->pLeft = pE->pLeft;
126342
- sqlite3ExprIfFalse(pParse, pEAlt, addrCont, SQLITE_JUMPIFNULL);
126343
- sqlite3StackFree(db, pEAlt);
126344
- }
126312
+ sEAlt = *pAlt->pExpr;
126313
+ sEAlt.pLeft = pE->pLeft;
126314
+ sqlite3ExprIfFalse(pParse, &sEAlt, addrCont, SQLITE_JUMPIFNULL);
126345126315
}
126346126316
126347126317
/* For a LEFT OUTER JOIN, generate code that will record the fact that
126348126318
** at least one row of the right table has matched the left table.
126349126319
*/
@@ -126448,11 +126418,10 @@
126448126418
memcpy(pWC->a, pOld, sizeof(pWC->a[0])*pWC->nTerm);
126449126419
if( pOld!=pWC->aStatic ){
126450126420
sqlite3DbFree(db, pOld);
126451126421
}
126452126422
pWC->nSlot = sqlite3DbMallocSize(db, pWC->a)/sizeof(pWC->a[0]);
126453
- memset(&pWC->a[pWC->nTerm], 0, sizeof(pWC->a[0])*(pWC->nSlot-pWC->nTerm));
126454126423
}
126455126424
pTerm = &pWC->a[idx = pWC->nTerm++];
126456126425
if( p && ExprHasProperty(p, EP_Unlikely) ){
126457126426
pTerm->truthProb = sqlite3LogEst(p->iTable) - 270;
126458126427
}else{
@@ -126460,10 +126429,12 @@
126460126429
}
126461126430
pTerm->pExpr = sqlite3ExprSkipCollate(p);
126462126431
pTerm->wtFlags = wtFlags;
126463126432
pTerm->pWC = pWC;
126464126433
pTerm->iParent = -1;
126434
+ memset(&pTerm->eOperator, 0,
126435
+ sizeof(WhereTerm) - offsetof(WhereTerm,eOperator));
126465126436
return idx;
126466126437
}
126467126438
126468126439
/*
126469126440
** Return TRUE if the given operator is one of the operators that is
@@ -127618,11 +127589,11 @@
127618127589
int idxNew;
127619127590
WhereTerm *pNewTerm;
127620127591
127621127592
pNewExpr = sqlite3PExpr(pParse, TK_GT,
127622127593
sqlite3ExprDup(db, pLeft, 0),
127623
- sqlite3PExpr(pParse, TK_NULL, 0, 0, 0), 0);
127594
+ sqlite3ExprAlloc(db, TK_NULL, 0, 0), 0);
127624127595
127625127596
idxNew = whereClauseInsert(pWC, pNewExpr,
127626127597
TERM_VIRTUAL|TERM_DYNAMIC|TERM_VNULL);
127627127598
if( idxNew ){
127628127599
pNewTerm = &pWC->a[idxNew];
@@ -127796,11 +127767,11 @@
127796127767
if( k>=pTab->nCol ){
127797127768
sqlite3ErrorMsg(pParse, "too many arguments on %s() - max %d",
127798127769
pTab->zName, j);
127799127770
return;
127800127771
}
127801
- pColRef = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
127772
+ pColRef = sqlite3ExprAlloc(pParse->db, TK_COLUMN, 0, 0);
127802127773
if( pColRef==0 ) return;
127803127774
pColRef->iTable = pItem->iCursor;
127804127775
pColRef->iColumn = k++;
127805127776
pColRef->pTab = pTab;
127806127777
pTerm = sqlite3PExpr(pParse, TK_EQ, pColRef,
@@ -132218,26 +132189,29 @@
132218132189
** and the WhereMaskSet structure. Since WhereClause contains an 8-byte
132219132190
** field (type Bitmask) it must be aligned on an 8-byte boundary on
132220132191
** some architectures. Hence the ROUND8() below.
132221132192
*/
132222132193
nByteWInfo = ROUND8(sizeof(WhereInfo)+(nTabList-1)*sizeof(WhereLevel));
132223
- pWInfo = sqlite3DbMallocZero(db, nByteWInfo + sizeof(WhereLoop));
132194
+ pWInfo = sqlite3DbMallocRawNN(db, nByteWInfo + sizeof(WhereLoop));
132224132195
if( db->mallocFailed ){
132225132196
sqlite3DbFree(db, pWInfo);
132226132197
pWInfo = 0;
132227132198
goto whereBeginError;
132228132199
}
132229
- pWInfo->aiCurOnePass[0] = pWInfo->aiCurOnePass[1] = -1;
132230
- pWInfo->nLevel = nTabList;
132231132200
pWInfo->pParse = pParse;
132232132201
pWInfo->pTabList = pTabList;
132233132202
pWInfo->pOrderBy = pOrderBy;
132234132203
pWInfo->pDistinctSet = pDistinctSet;
132204
+ pWInfo->aiCurOnePass[0] = pWInfo->aiCurOnePass[1] = -1;
132205
+ pWInfo->nLevel = nTabList;
132235132206
pWInfo->iBreak = pWInfo->iContinue = sqlite3VdbeMakeLabel(v);
132236132207
pWInfo->wctrlFlags = wctrlFlags;
132237132208
pWInfo->iLimit = iAuxArg;
132238132209
pWInfo->savedNQueryLoop = pParse->nQueryLoop;
132210
+ memset(&pWInfo->nOBSat, 0,
132211
+ offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat));
132212
+ memset(&pWInfo->a[0], 0, sizeof(WhereLoop)+nTabList*sizeof(WhereLevel));
132239132213
assert( pWInfo->eOnePass==ONEPASS_OFF ); /* ONEPASS defaults to OFF */
132240132214
pMaskSet = &pWInfo->sMaskSet;
132241132215
sWLB.pWInfo = pWInfo;
132242132216
sWLB.pWC = &pWInfo->sWC;
132243132217
sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo);
@@ -132844,19 +132818,10 @@
132844132818
struct LimitVal {
132845132819
Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */
132846132820
Expr *pOffset; /* The OFFSET expression. NULL if there is none */
132847132821
};
132848132822
132849
-/*
132850
-** An instance of this structure is used to store the LIKE,
132851
-** GLOB, NOT LIKE, and NOT GLOB operators.
132852
-*/
132853
-struct LikeOp {
132854
- Token eOperator; /* "like" or "glob" or "regexp" */
132855
- int bNot; /* True if the NOT keyword is present */
132856
-};
132857
-
132858132823
/*
132859132824
** An instance of the following structure describes the event of a
132860132825
** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT,
132861132826
** TK_DELETE, or TK_INSTEAD. If the event is of the form
132862132827
**
@@ -132864,15 +132829,10 @@
132864132829
**
132865132830
** Then the "b" IdList records the list "a,b,c".
132866132831
*/
132867132832
struct TrigEvent { int a; IdList * b; };
132868132833
132869
-/*
132870
-** An instance of this structure holds the ATTACH key and the key type.
132871
-*/
132872
-struct AttachKey { int type; Token key; };
132873
-
132874132834
/*
132875132835
** Disable lookaside memory allocation for objects that might be
132876132836
** shared across database connections.
132877132837
*/
132878132838
static void disableLookaside(Parse *pParse){
@@ -132915,11 +132875,28 @@
132915132875
/* Construct a new Expr object from a single identifier. Use the
132916132876
** new Expr to populate pOut. Set the span of pOut to be the identifier
132917132877
** that created the expression.
132918132878
*/
132919132879
static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token t){
132920
- pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, &t);
132880
+ Expr *p = sqlite3DbMallocRawNN(pParse->db, sizeof(Expr)+t.n+1);
132881
+ if( p ){
132882
+ memset(p, 0, sizeof(Expr));
132883
+ p->op = (u8)op;
132884
+ p->flags = EP_Leaf;
132885
+ p->iAgg = -1;
132886
+ p->u.zToken = (char*)&p[1];
132887
+ memcpy(p->u.zToken, t.z, t.n);
132888
+ p->u.zToken[t.n] = 0;
132889
+ if( sqlite3Isquote(p->u.zToken[0]) ){
132890
+ if( p->u.zToken[0]=='"' ) p->flags |= EP_DblQuoted;
132891
+ sqlite3Dequote(p->u.zToken);
132892
+ }
132893
+#if SQLITE_MAX_EXPR_DEPTH>0
132894
+ p->nHeight = 1;
132895
+#endif
132896
+ }
132897
+ pOut->pExpr = p;
132921132898
pOut->zStart = t.z;
132922132899
pOut->zEnd = &t.z[t.n];
132923132900
}
132924132901
132925132902
/* This routine constructs a binary expression node out of two ExprSpan
@@ -133078,11 +133055,10 @@
133078133055
Select* yy243;
133079133056
IdList* yy254;
133080133057
With* yy285;
133081133058
struct TrigEvent yy332;
133082133059
struct LimitVal yy354;
133083
- struct LikeOp yy392;
133084133060
struct {int value; int mask;} yy497;
133085133061
} YYMINORTYPE;
133086133062
#ifndef YYSTACKDEPTH
133087133063
#define YYSTACKDEPTH 100
133088133064
#endif
@@ -133090,19 +133066,19 @@
133090133066
#define sqlite3ParserARG_PDECL ,Parse *pParse
133091133067
#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
133092133068
#define sqlite3ParserARG_STORE yypParser->pParse = pParse
133093133069
#define YYFALLBACK 1
133094133070
#define YYNSTATE 456
133095
-#define YYNRULE 331
133071
+#define YYNRULE 332
133096133072
#define YY_MAX_SHIFT 455
133097
-#define YY_MIN_SHIFTREDUCE 667
133098
-#define YY_MAX_SHIFTREDUCE 997
133099
-#define YY_MIN_REDUCE 998
133100
-#define YY_MAX_REDUCE 1328
133101
-#define YY_ERROR_ACTION 1329
133102
-#define YY_ACCEPT_ACTION 1330
133103
-#define YY_NO_ACTION 1331
133073
+#define YY_MIN_SHIFTREDUCE 668
133074
+#define YY_MAX_SHIFTREDUCE 999
133075
+#define YY_MIN_REDUCE 1000
133076
+#define YY_MAX_REDUCE 1331
133077
+#define YY_ERROR_ACTION 1332
133078
+#define YY_ACCEPT_ACTION 1333
133079
+#define YY_NO_ACTION 1334
133104133080
/************* End control #defines *******************************************/
133105133081
133106133082
/* Define the yytestcase() macro to be a no-op if is not already defined
133107133083
** otherwise.
133108133084
**
@@ -133170,170 +133146,169 @@
133170133146
** yy_reduce_ofst[] For each state, the offset into yy_action for
133171133147
** shifting non-terminals after a reduce.
133172133148
** yy_default[] Default action for each state.
133173133149
**
133174133150
*********** Begin parsing tables **********************************************/
133175
-#define YY_ACTTAB_COUNT (1571)
133151
+#define YY_ACTTAB_COUNT (1567)
133176133152
static const YYACTIONTYPE yy_action[] = {
133177
- /* 0 */ 325, 830, 351, 824, 5, 203, 203, 818, 99, 100,
133178
- /* 10 */ 90, 840, 840, 852, 855, 844, 844, 97, 97, 98,
133153
+ /* 0 */ 325, 832, 351, 825, 5, 203, 203, 819, 99, 100,
133154
+ /* 10 */ 90, 842, 842, 854, 857, 846, 846, 97, 97, 98,
133179133155
/* 20 */ 98, 98, 98, 301, 96, 96, 96, 96, 95, 95,
133180
- /* 30 */ 94, 94, 94, 93, 351, 325, 975, 975, 823, 823,
133181
- /* 40 */ 823, 945, 354, 99, 100, 90, 840, 840, 852, 855,
133182
- /* 50 */ 844, 844, 97, 97, 98, 98, 98, 98, 338, 96,
133156
+ /* 30 */ 94, 94, 94, 93, 351, 325, 977, 977, 824, 824,
133157
+ /* 40 */ 826, 947, 354, 99, 100, 90, 842, 842, 854, 857,
133158
+ /* 50 */ 846, 846, 97, 97, 98, 98, 98, 98, 338, 96,
133183133159
/* 60 */ 96, 96, 96, 95, 95, 94, 94, 94, 93, 351,
133184
- /* 70 */ 95, 95, 94, 94, 94, 93, 351, 790, 975, 975,
133185
- /* 80 */ 325, 94, 94, 94, 93, 351, 791, 75, 99, 100,
133186
- /* 90 */ 90, 840, 840, 852, 855, 844, 844, 97, 97, 98,
133160
+ /* 70 */ 95, 95, 94, 94, 94, 93, 351, 791, 977, 977,
133161
+ /* 80 */ 325, 94, 94, 94, 93, 351, 792, 75, 99, 100,
133162
+ /* 90 */ 90, 842, 842, 854, 857, 846, 846, 97, 97, 98,
133187133163
/* 100 */ 98, 98, 98, 450, 96, 96, 96, 96, 95, 95,
133188
- /* 110 */ 94, 94, 94, 93, 351, 1330, 155, 155, 2, 325,
133164
+ /* 110 */ 94, 94, 94, 93, 351, 1333, 155, 155, 2, 325,
133189133165
/* 120 */ 275, 146, 132, 52, 52, 93, 351, 99, 100, 90,
133190
- /* 130 */ 840, 840, 852, 855, 844, 844, 97, 97, 98, 98,
133166
+ /* 130 */ 842, 842, 854, 857, 846, 846, 97, 97, 98, 98,
133191133167
/* 140 */ 98, 98, 101, 96, 96, 96, 96, 95, 95, 94,
133192
- /* 150 */ 94, 94, 93, 351, 956, 956, 325, 268, 428, 413,
133193
- /* 160 */ 411, 61, 751, 751, 99, 100, 90, 840, 840, 852,
133194
- /* 170 */ 855, 844, 844, 97, 97, 98, 98, 98, 98, 60,
133168
+ /* 150 */ 94, 94, 93, 351, 958, 958, 325, 268, 428, 413,
133169
+ /* 160 */ 411, 61, 752, 752, 99, 100, 90, 842, 842, 854,
133170
+ /* 170 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 60,
133195133171
/* 180 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133196
- /* 190 */ 351, 325, 270, 329, 273, 277, 957, 958, 250, 99,
133197
- /* 200 */ 100, 90, 840, 840, 852, 855, 844, 844, 97, 97,
133172
+ /* 190 */ 351, 325, 270, 329, 273, 277, 959, 960, 250, 99,
133173
+ /* 200 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
133198133174
/* 210 */ 98, 98, 98, 98, 301, 96, 96, 96, 96, 95,
133199
- /* 220 */ 95, 94, 94, 94, 93, 351, 325, 936, 1323, 697,
133200
- /* 230 */ 705, 1323, 242, 412, 99, 100, 90, 840, 840, 852,
133201
- /* 240 */ 855, 844, 844, 97, 97, 98, 98, 98, 98, 347,
133175
+ /* 220 */ 95, 94, 94, 94, 93, 351, 325, 938, 1326, 698,
133176
+ /* 230 */ 706, 1326, 242, 412, 99, 100, 90, 842, 842, 854,
133177
+ /* 240 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 347,
133202133178
/* 250 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133203
- /* 260 */ 351, 325, 936, 1324, 384, 698, 1324, 381, 379, 99,
133204
- /* 270 */ 100, 90, 840, 840, 852, 855, 844, 844, 97, 97,
133205
- /* 280 */ 98, 98, 98, 98, 700, 96, 96, 96, 96, 95,
133179
+ /* 260 */ 351, 325, 938, 1327, 384, 699, 1327, 381, 379, 99,
133180
+ /* 270 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
133181
+ /* 280 */ 98, 98, 98, 98, 701, 96, 96, 96, 96, 95,
133206133182
/* 290 */ 95, 94, 94, 94, 93, 351, 325, 92, 89, 178,
133207
- /* 300 */ 831, 934, 373, 699, 99, 100, 90, 840, 840, 852,
133208
- /* 310 */ 855, 844, 844, 97, 97, 98, 98, 98, 98, 375,
133183
+ /* 300 */ 833, 936, 373, 700, 99, 100, 90, 842, 842, 854,
133184
+ /* 310 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 375,
133209133185
/* 320 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133210
- /* 330 */ 351, 325, 1273, 945, 354, 817, 934, 738, 738, 99,
133211
- /* 340 */ 100, 90, 840, 840, 852, 855, 844, 844, 97, 97,
133186
+ /* 330 */ 351, 325, 1276, 947, 354, 818, 936, 739, 739, 99,
133187
+ /* 340 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
133212133188
/* 350 */ 98, 98, 98, 98, 230, 96, 96, 96, 96, 95,
133213
- /* 360 */ 95, 94, 94, 94, 93, 351, 325, 967, 227, 92,
133214
- /* 370 */ 89, 178, 373, 300, 99, 100, 90, 840, 840, 852,
133215
- /* 380 */ 855, 844, 844, 97, 97, 98, 98, 98, 98, 919,
133189
+ /* 360 */ 95, 94, 94, 94, 93, 351, 325, 969, 227, 92,
133190
+ /* 370 */ 89, 178, 373, 300, 99, 100, 90, 842, 842, 854,
133191
+ /* 380 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 921,
133216133192
/* 390 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133217
- /* 400 */ 351, 325, 449, 447, 447, 447, 147, 736, 736, 99,
133218
- /* 410 */ 100, 90, 840, 840, 852, 855, 844, 844, 97, 97,
133193
+ /* 400 */ 351, 325, 449, 447, 447, 447, 147, 737, 737, 99,
133194
+ /* 410 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
133219133195
/* 420 */ 98, 98, 98, 98, 296, 96, 96, 96, 96, 95,
133220
- /* 430 */ 95, 94, 94, 94, 93, 351, 325, 419, 231, 956,
133221
- /* 440 */ 956, 158, 25, 422, 99, 100, 90, 840, 840, 852,
133222
- /* 450 */ 855, 844, 844, 97, 97, 98, 98, 98, 98, 450,
133196
+ /* 430 */ 95, 94, 94, 94, 93, 351, 325, 419, 231, 958,
133197
+ /* 440 */ 958, 158, 25, 422, 99, 100, 90, 842, 842, 854,
133198
+ /* 450 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 450,
133223133199
/* 460 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133224
- /* 470 */ 351, 443, 224, 224, 420, 956, 956, 960, 325, 52,
133225
- /* 480 */ 52, 957, 958, 176, 415, 78, 99, 100, 90, 840,
133226
- /* 490 */ 840, 852, 855, 844, 844, 97, 97, 98, 98, 98,
133200
+ /* 470 */ 351, 443, 224, 224, 420, 958, 958, 962, 325, 52,
133201
+ /* 480 */ 52, 959, 960, 176, 415, 78, 99, 100, 90, 842,
133202
+ /* 490 */ 842, 854, 857, 846, 846, 97, 97, 98, 98, 98,
133227133203
/* 500 */ 98, 379, 96, 96, 96, 96, 95, 95, 94, 94,
133228
- /* 510 */ 94, 93, 351, 325, 428, 418, 298, 957, 958, 960,
133229
- /* 520 */ 81, 99, 88, 90, 840, 840, 852, 855, 844, 844,
133230
- /* 530 */ 97, 97, 98, 98, 98, 98, 716, 96, 96, 96,
133231
- /* 540 */ 96, 95, 95, 94, 94, 94, 93, 351, 325, 841,
133232
- /* 550 */ 841, 853, 856, 994, 318, 343, 379, 100, 90, 840,
133233
- /* 560 */ 840, 852, 855, 844, 844, 97, 97, 98, 98, 98,
133204
+ /* 510 */ 94, 93, 351, 325, 428, 418, 298, 959, 960, 962,
133205
+ /* 520 */ 81, 99, 88, 90, 842, 842, 854, 857, 846, 846,
133206
+ /* 530 */ 97, 97, 98, 98, 98, 98, 717, 96, 96, 96,
133207
+ /* 540 */ 96, 95, 95, 94, 94, 94, 93, 351, 325, 843,
133208
+ /* 550 */ 843, 855, 858, 996, 318, 343, 379, 100, 90, 842,
133209
+ /* 560 */ 842, 854, 857, 846, 846, 97, 97, 98, 98, 98,
133234133210
/* 570 */ 98, 450, 96, 96, 96, 96, 95, 95, 94, 94,
133235133211
/* 580 */ 94, 93, 351, 325, 350, 350, 350, 260, 377, 340,
133236
- /* 590 */ 927, 52, 52, 90, 840, 840, 852, 855, 844, 844,
133212
+ /* 590 */ 929, 52, 52, 90, 842, 842, 854, 857, 846, 846,
133237133213
/* 600 */ 97, 97, 98, 98, 98, 98, 361, 96, 96, 96,
133238133214
/* 610 */ 96, 95, 95, 94, 94, 94, 93, 351, 86, 445,
133239
- /* 620 */ 845, 3, 1200, 361, 360, 378, 344, 812, 956, 956,
133240
- /* 630 */ 1297, 86, 445, 728, 3, 212, 169, 287, 405, 282,
133241
- /* 640 */ 404, 199, 232, 450, 300, 759, 83, 84, 280, 245,
133215
+ /* 620 */ 847, 3, 1203, 361, 360, 378, 344, 813, 958, 958,
133216
+ /* 630 */ 1300, 86, 445, 729, 3, 212, 169, 287, 405, 282,
133217
+ /* 640 */ 404, 199, 232, 450, 300, 760, 83, 84, 280, 245,
133242133218
/* 650 */ 262, 365, 251, 85, 352, 352, 92, 89, 178, 83,
133243133219
/* 660 */ 84, 242, 412, 52, 52, 448, 85, 352, 352, 246,
133244
- /* 670 */ 957, 958, 194, 455, 669, 402, 399, 398, 448, 243,
133245
- /* 680 */ 221, 114, 434, 775, 361, 450, 397, 268, 746, 224,
133246
- /* 690 */ 224, 132, 132, 198, 830, 434, 452, 451, 428, 427,
133247
- /* 700 */ 818, 415, 733, 712, 132, 52, 52, 830, 268, 452,
133248
- /* 710 */ 451, 733, 194, 818, 363, 402, 399, 398, 450, 1268,
133249
- /* 720 */ 1268, 23, 956, 956, 86, 445, 397, 3, 228, 429,
133250
- /* 730 */ 893, 823, 823, 823, 825, 19, 203, 719, 52, 52,
133251
- /* 740 */ 428, 408, 439, 249, 823, 823, 823, 825, 19, 229,
133252
- /* 750 */ 403, 153, 83, 84, 760, 177, 241, 450, 720, 85,
133253
- /* 760 */ 352, 352, 120, 157, 957, 958, 58, 975, 409, 355,
133254
- /* 770 */ 330, 448, 268, 428, 430, 320, 789, 32, 32, 86,
133255
- /* 780 */ 445, 775, 3, 341, 98, 98, 98, 98, 434, 96,
133220
+ /* 670 */ 959, 960, 194, 455, 670, 402, 399, 398, 448, 243,
133221
+ /* 680 */ 221, 114, 434, 776, 361, 450, 397, 268, 747, 224,
133222
+ /* 690 */ 224, 132, 132, 198, 832, 434, 452, 451, 428, 427,
133223
+ /* 700 */ 819, 415, 734, 713, 132, 52, 52, 832, 268, 452,
133224
+ /* 710 */ 451, 734, 194, 819, 363, 402, 399, 398, 450, 1271,
133225
+ /* 720 */ 1271, 23, 958, 958, 86, 445, 397, 3, 228, 429,
133226
+ /* 730 */ 895, 824, 824, 826, 827, 19, 203, 720, 52, 52,
133227
+ /* 740 */ 428, 408, 439, 249, 824, 824, 826, 827, 19, 229,
133228
+ /* 750 */ 403, 153, 83, 84, 761, 177, 241, 450, 721, 85,
133229
+ /* 760 */ 352, 352, 120, 157, 959, 960, 58, 977, 409, 355,
133230
+ /* 770 */ 330, 448, 268, 428, 430, 320, 790, 32, 32, 86,
133231
+ /* 780 */ 445, 776, 3, 341, 98, 98, 98, 98, 434, 96,
133256133232
/* 790 */ 96, 96, 96, 95, 95, 94, 94, 94, 93, 351,
133257
- /* 800 */ 830, 120, 452, 451, 812, 885, 818, 83, 84, 975,
133258
- /* 810 */ 812, 132, 410, 918, 85, 352, 352, 132, 407, 788,
133259
- /* 820 */ 956, 956, 92, 89, 178, 915, 448, 262, 370, 261,
133260
- /* 830 */ 82, 912, 80, 262, 370, 261, 932, 823, 823, 823,
133261
- /* 840 */ 825, 19, 257, 434, 96, 96, 96, 96, 95, 95,
133262
- /* 850 */ 94, 94, 94, 93, 351, 830, 268, 452, 451, 956,
133263
- /* 860 */ 956, 818, 957, 958, 120, 92, 89, 178, 943, 2,
133264
- /* 870 */ 916, 963, 268, 1, 766, 76, 445, 761, 3, 707,
133265
- /* 880 */ 899, 899, 387, 956, 956, 756, 917, 371, 739, 777,
133266
- /* 890 */ 755, 907, 823, 823, 823, 825, 19, 883, 740, 450,
133267
- /* 900 */ 24, 957, 958, 83, 84, 369, 956, 956, 708, 226,
133268
- /* 910 */ 85, 352, 352, 745, 315, 314, 313, 215, 311, 10,
133269
- /* 920 */ 10, 682, 448, 349, 348, 957, 958, 887, 776, 691,
133270
- /* 930 */ 331, 956, 956, 337, 157, 450, 268, 103, 450, 434,
133271
- /* 940 */ 450, 816, 310, 906, 887, 889, 321, 450, 957, 958,
133272
- /* 950 */ 708, 830, 775, 452, 451, 10, 10, 818, 10, 10,
133273
- /* 960 */ 52, 52, 171, 170, 180, 225, 248, 10, 10, 339,
133274
- /* 970 */ 701, 701, 233, 957, 958, 247, 982, 741, 450, 956,
133275
- /* 980 */ 956, 425, 157, 980, 685, 981, 182, 912, 823, 823,
133276
- /* 990 */ 823, 825, 19, 183, 324, 423, 132, 181, 51, 51,
133277
- /* 1000 */ 715, 349, 348, 394, 256, 887, 334, 915, 983, 983,
133278
- /* 1010 */ 830, 417, 824, 234, 198, 234, 818, 268, 326, 382,
133279
- /* 1020 */ 120, 957, 958, 264, 177, 98, 98, 98, 98, 91,
133233
+ /* 800 */ 832, 120, 452, 451, 813, 887, 819, 83, 84, 977,
133234
+ /* 810 */ 813, 132, 410, 920, 85, 352, 352, 132, 407, 789,
133235
+ /* 820 */ 958, 958, 92, 89, 178, 917, 448, 262, 370, 261,
133236
+ /* 830 */ 82, 914, 80, 262, 370, 261, 776, 824, 824, 826,
133237
+ /* 840 */ 827, 19, 934, 434, 96, 96, 96, 96, 95, 95,
133238
+ /* 850 */ 94, 94, 94, 93, 351, 832, 74, 452, 451, 958,
133239
+ /* 860 */ 958, 819, 959, 960, 120, 92, 89, 178, 945, 2,
133240
+ /* 870 */ 918, 965, 268, 1, 976, 76, 445, 762, 3, 708,
133241
+ /* 880 */ 901, 901, 387, 958, 958, 757, 919, 371, 740, 778,
133242
+ /* 890 */ 756, 257, 824, 824, 826, 827, 19, 417, 741, 450,
133243
+ /* 900 */ 24, 959, 960, 83, 84, 369, 958, 958, 177, 226,
133244
+ /* 910 */ 85, 352, 352, 885, 315, 314, 313, 215, 311, 10,
133245
+ /* 920 */ 10, 683, 448, 349, 348, 959, 960, 909, 777, 157,
133246
+ /* 930 */ 120, 958, 958, 337, 776, 416, 711, 310, 450, 434,
133247
+ /* 940 */ 450, 321, 450, 791, 103, 200, 175, 450, 959, 960,
133248
+ /* 950 */ 908, 832, 792, 452, 451, 9, 9, 819, 10, 10,
133249
+ /* 960 */ 52, 52, 51, 51, 180, 716, 248, 10, 10, 171,
133250
+ /* 970 */ 170, 167, 339, 959, 960, 247, 984, 702, 702, 450,
133251
+ /* 980 */ 715, 233, 686, 982, 889, 983, 182, 914, 824, 824,
133252
+ /* 990 */ 826, 827, 19, 183, 256, 423, 132, 181, 394, 10,
133253
+ /* 1000 */ 10, 889, 891, 749, 958, 958, 917, 268, 985, 198,
133254
+ /* 1010 */ 985, 349, 348, 425, 415, 299, 817, 832, 326, 825,
133255
+ /* 1020 */ 120, 332, 133, 819, 268, 98, 98, 98, 98, 91,
133280133256
/* 1030 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133281
- /* 1040 */ 351, 816, 416, 371, 120, 359, 816, 823, 823, 823,
133282
- /* 1050 */ 775, 299, 916, 450, 368, 197, 196, 195, 358, 200,
133283
- /* 1060 */ 175, 380, 9, 9, 450, 1287, 875, 714, 917, 450,
133284
- /* 1070 */ 433, 237, 450, 36, 36, 132, 253, 450, 255, 450,
133285
- /* 1080 */ 117, 450, 809, 362, 37, 37, 983, 983, 450, 12,
133286
- /* 1090 */ 12, 330, 27, 27, 446, 331, 280, 38, 38, 39,
133287
- /* 1100 */ 39, 40, 40, 1207, 450, 816, 335, 356, 41, 41,
133288
- /* 1110 */ 450, 336, 450, 695, 450, 120, 450, 332, 133, 450,
133289
- /* 1120 */ 268, 450, 269, 450, 42, 42, 450, 816, 254, 450,
133290
- /* 1130 */ 28, 28, 29, 29, 31, 31, 43, 43, 450, 44,
133291
- /* 1140 */ 44, 45, 45, 11, 11, 450, 46, 46, 450, 105,
133292
- /* 1150 */ 105, 450, 748, 713, 450, 695, 450, 910, 47, 47,
133293
- /* 1160 */ 450, 267, 450, 415, 450, 48, 48, 450, 33, 33,
133294
- /* 1170 */ 386, 49, 49, 450, 50, 50, 34, 34, 450, 172,
133295
- /* 1180 */ 122, 122, 123, 123, 124, 124, 450, 56, 56, 450,
133296
- /* 1190 */ 120, 450, 345, 35, 35, 450, 790, 450, 106, 106,
133297
- /* 1200 */ 450, 74, 450, 974, 450, 791, 53, 53, 432, 107,
133298
- /* 1210 */ 107, 108, 108, 450, 272, 104, 104, 121, 121, 450,
133299
- /* 1220 */ 119, 119, 112, 112, 111, 111, 450, 317, 996, 450,
133300
- /* 1230 */ 118, 450, 162, 109, 109, 317, 935, 450, 896, 110,
133301
- /* 1240 */ 110, 450, 895, 744, 688, 436, 55, 55, 20, 57,
133302
- /* 1250 */ 57, 54, 54, 440, 444, 756, 385, 26, 26, 274,
133303
- /* 1260 */ 755, 30, 30, 21, 672, 673, 674, 223, 175, 931,
133304
- /* 1270 */ 814, 372, 319, 202, 202, 882, 120, 120, 120, 374,
133305
- /* 1280 */ 826, 710, 202, 72, 276, 263, 120, 120, 74, 395,
133306
- /* 1290 */ 278, 286, 208, 74, 718, 717, 725, 726, 892, 892,
133307
- /* 1300 */ 167, 997, 285, 753, 729, 784, 77, 878, 202, 997,
133308
- /* 1310 */ 208, 693, 891, 891, 116, 281, 782, 882, 390, 815,
133309
- /* 1320 */ 762, 773, 826, 431, 302, 303, 822, 218, 696, 289,
133310
- /* 1330 */ 690, 291, 293, 679, 678, 680, 950, 159, 316, 7,
133311
- /* 1340 */ 364, 252, 259, 804, 909, 376, 400, 295, 308, 173,
133312
- /* 1350 */ 435, 953, 168, 991, 135, 205, 926, 924, 59, 988,
133313
- /* 1360 */ 62, 284, 880, 333, 879, 712, 144, 156, 130, 72,
133314
- /* 1370 */ 366, 367, 393, 185, 189, 160, 383, 67, 389, 266,
133315
- /* 1380 */ 137, 894, 774, 219, 154, 139, 190, 140, 391, 271,
133316
- /* 1390 */ 191, 141, 142, 801, 681, 148, 811, 342, 322, 192,
133317
- /* 1400 */ 406, 732, 911, 874, 723, 731, 323, 710, 730, 71,
133318
- /* 1410 */ 704, 204, 283, 703, 6, 79, 421, 702, 965, 770,
133319
- /* 1420 */ 297, 346, 426, 102, 722, 288, 73, 424, 213, 951,
133320
- /* 1430 */ 771, 438, 22, 290, 687, 769, 442, 453, 239, 217,
133321
- /* 1440 */ 214, 668, 125, 353, 126, 216, 454, 166, 676, 115,
133322
- /* 1450 */ 675, 235, 244, 179, 670, 357, 810, 113, 890, 888,
133323
- /* 1460 */ 292, 136, 128, 752, 304, 768, 294, 305, 138, 742,
133324
- /* 1470 */ 306, 307, 127, 184, 860, 258, 905, 145, 143, 238,
133325
- /* 1480 */ 63, 64, 65, 66, 240, 129, 908, 186, 187, 904,
133326
- /* 1490 */ 8, 13, 188, 265, 897, 149, 202, 985, 388, 684,
133327
- /* 1500 */ 150, 161, 392, 285, 193, 279, 151, 396, 68, 14,
133328
- /* 1510 */ 401, 15, 327, 721, 328, 134, 69, 70, 236, 131,
133329
- /* 1520 */ 829, 828, 858, 750, 16, 201, 754, 4, 783, 220,
133330
- /* 1530 */ 414, 174, 222, 152, 77, 778, 74, 17, 18, 873,
133331
- /* 1540 */ 859, 857, 914, 862, 913, 207, 206, 940, 163, 437,
133332
- /* 1550 */ 946, 941, 164, 209, 210, 441, 861, 165, 312, 827,
133333
- /* 1560 */ 694, 87, 1000, 309, 211, 1000, 1000, 1000, 1000, 1289,
133334
- /* 1570 */ 1288,
133257
+ /* 1040 */ 351, 157, 810, 371, 382, 359, 959, 960, 358, 268,
133258
+ /* 1050 */ 450, 918, 368, 324, 824, 824, 826, 450, 709, 450,
133259
+ /* 1060 */ 264, 380, 889, 450, 877, 746, 253, 919, 255, 433,
133260
+ /* 1070 */ 36, 36, 234, 450, 234, 120, 269, 37, 37, 12,
133261
+ /* 1080 */ 12, 334, 272, 27, 27, 450, 330, 118, 450, 162,
133262
+ /* 1090 */ 742, 280, 450, 38, 38, 450, 985, 356, 985, 450,
133263
+ /* 1100 */ 709, 1210, 450, 132, 450, 39, 39, 450, 40, 40,
133264
+ /* 1110 */ 450, 362, 41, 41, 450, 42, 42, 450, 254, 28,
133265
+ /* 1120 */ 28, 450, 29, 29, 31, 31, 450, 43, 43, 450,
133266
+ /* 1130 */ 44, 44, 450, 714, 45, 45, 450, 11, 11, 767,
133267
+ /* 1140 */ 450, 46, 46, 450, 268, 450, 105, 105, 450, 47,
133268
+ /* 1150 */ 47, 450, 48, 48, 450, 237, 33, 33, 450, 172,
133269
+ /* 1160 */ 49, 49, 450, 50, 50, 34, 34, 274, 122, 122,
133270
+ /* 1170 */ 450, 123, 123, 450, 124, 124, 450, 898, 56, 56,
133271
+ /* 1180 */ 450, 897, 35, 35, 450, 267, 450, 817, 450, 817,
133272
+ /* 1190 */ 106, 106, 450, 53, 53, 385, 107, 107, 450, 817,
133273
+ /* 1200 */ 108, 108, 817, 450, 104, 104, 121, 121, 119, 119,
133274
+ /* 1210 */ 450, 117, 112, 112, 450, 276, 450, 225, 111, 111,
133275
+ /* 1220 */ 450, 730, 450, 109, 109, 450, 673, 674, 675, 912,
133276
+ /* 1230 */ 110, 110, 317, 998, 55, 55, 57, 57, 692, 331,
133277
+ /* 1240 */ 54, 54, 26, 26, 696, 30, 30, 317, 937, 197,
133278
+ /* 1250 */ 196, 195, 335, 281, 336, 446, 331, 745, 689, 436,
133279
+ /* 1260 */ 440, 444, 120, 72, 386, 223, 175, 345, 757, 933,
133280
+ /* 1270 */ 20, 286, 319, 756, 815, 372, 374, 202, 202, 202,
133281
+ /* 1280 */ 263, 395, 285, 74, 208, 21, 696, 719, 718, 884,
133282
+ /* 1290 */ 120, 120, 120, 120, 120, 754, 278, 828, 77, 74,
133283
+ /* 1300 */ 726, 727, 785, 783, 880, 202, 999, 208, 894, 893,
133284
+ /* 1310 */ 894, 893, 694, 816, 763, 116, 774, 1290, 431, 432,
133285
+ /* 1320 */ 302, 999, 390, 303, 823, 697, 691, 680, 159, 289,
133286
+ /* 1330 */ 679, 884, 681, 952, 291, 218, 293, 7, 316, 828,
133287
+ /* 1340 */ 173, 805, 259, 364, 252, 911, 376, 713, 295, 435,
133288
+ /* 1350 */ 308, 168, 955, 993, 135, 400, 990, 284, 882, 881,
133289
+ /* 1360 */ 205, 928, 926, 59, 333, 62, 144, 156, 130, 72,
133290
+ /* 1370 */ 802, 366, 367, 393, 137, 185, 189, 160, 139, 383,
133291
+ /* 1380 */ 67, 896, 140, 141, 142, 148, 389, 812, 775, 266,
133292
+ /* 1390 */ 219, 190, 154, 391, 913, 876, 271, 406, 191, 322,
133293
+ /* 1400 */ 682, 733, 192, 342, 732, 724, 731, 711, 723, 421,
133294
+ /* 1410 */ 705, 71, 323, 6, 204, 771, 288, 79, 297, 346,
133295
+ /* 1420 */ 772, 704, 290, 283, 703, 770, 292, 294, 967, 239,
133296
+ /* 1430 */ 769, 102, 862, 438, 426, 240, 424, 442, 73, 213,
133297
+ /* 1440 */ 688, 238, 22, 453, 953, 214, 217, 216, 454, 677,
133298
+ /* 1450 */ 676, 671, 753, 125, 115, 235, 126, 669, 353, 166,
133299
+ /* 1460 */ 127, 244, 179, 357, 306, 304, 305, 307, 113, 892,
133300
+ /* 1470 */ 327, 890, 811, 328, 134, 128, 136, 138, 743, 258,
133301
+ /* 1480 */ 907, 184, 143, 129, 910, 186, 63, 64, 145, 187,
133302
+ /* 1490 */ 906, 65, 8, 66, 13, 188, 202, 899, 265, 149,
133303
+ /* 1500 */ 987, 388, 150, 685, 161, 392, 285, 193, 279, 396,
133304
+ /* 1510 */ 151, 401, 68, 14, 15, 722, 69, 236, 831, 131,
133305
+ /* 1520 */ 830, 860, 70, 751, 16, 414, 755, 4, 174, 220,
133306
+ /* 1530 */ 222, 784, 201, 152, 779, 77, 74, 17, 18, 875,
133307
+ /* 1540 */ 861, 859, 916, 864, 915, 207, 206, 942, 163, 437,
133308
+ /* 1550 */ 948, 943, 164, 209, 1002, 441, 863, 165, 210, 829,
133309
+ /* 1560 */ 695, 87, 312, 211, 1292, 1291, 309,
133335133310
};
133336133311
static const YYCODETYPE yy_lookahead[] = {
133337133312
/* 0 */ 19, 95, 53, 97, 22, 24, 24, 101, 27, 28,
133338133313
/* 10 */ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
133339133314
/* 20 */ 39, 40, 41, 152, 43, 44, 45, 46, 47, 48,
@@ -133415,87 +133390,86 @@
133415133390
/* 780 */ 20, 124, 22, 111, 38, 39, 40, 41, 83, 43,
133416133391
/* 790 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
133417133392
/* 800 */ 95, 196, 97, 98, 85, 152, 101, 47, 48, 97,
133418133393
/* 810 */ 85, 92, 207, 193, 54, 55, 56, 92, 49, 175,
133419133394
/* 820 */ 55, 56, 221, 222, 223, 12, 66, 108, 109, 110,
133420
- /* 830 */ 137, 163, 139, 108, 109, 110, 152, 132, 133, 134,
133395
+ /* 830 */ 137, 163, 139, 108, 109, 110, 26, 132, 133, 134,
133421133396
/* 840 */ 135, 136, 152, 83, 43, 44, 45, 46, 47, 48,
133422
- /* 850 */ 49, 50, 51, 52, 53, 95, 152, 97, 98, 55,
133397
+ /* 850 */ 49, 50, 51, 52, 53, 95, 26, 97, 98, 55,
133423133398
/* 860 */ 56, 101, 97, 98, 196, 221, 222, 223, 146, 147,
133424
- /* 870 */ 57, 171, 152, 22, 213, 19, 20, 49, 22, 179,
133399
+ /* 870 */ 57, 171, 152, 22, 26, 19, 20, 49, 22, 179,
133425133400
/* 880 */ 108, 109, 110, 55, 56, 116, 73, 219, 75, 124,
133426
- /* 890 */ 121, 152, 132, 133, 134, 135, 136, 193, 85, 152,
133427
- /* 900 */ 232, 97, 98, 47, 48, 237, 55, 56, 55, 5,
133401
+ /* 890 */ 121, 152, 132, 133, 134, 135, 136, 163, 85, 152,
133402
+ /* 900 */ 232, 97, 98, 47, 48, 237, 55, 56, 98, 5,
133428133403
/* 910 */ 54, 55, 56, 193, 10, 11, 12, 13, 14, 172,
133429
- /* 920 */ 173, 17, 66, 47, 48, 97, 98, 152, 124, 166,
133430
- /* 930 */ 167, 55, 56, 186, 152, 152, 152, 22, 152, 83,
133431
- /* 940 */ 152, 152, 160, 152, 169, 170, 164, 152, 97, 98,
133432
- /* 950 */ 97, 95, 26, 97, 98, 172, 173, 101, 172, 173,
133433
- /* 960 */ 172, 173, 47, 48, 60, 22, 62, 172, 173, 186,
133434
- /* 970 */ 55, 56, 186, 97, 98, 71, 100, 193, 152, 55,
133435
- /* 980 */ 56, 186, 152, 107, 21, 109, 82, 163, 132, 133,
133436
- /* 990 */ 134, 135, 136, 89, 164, 207, 92, 93, 172, 173,
133437
- /* 1000 */ 181, 47, 48, 19, 16, 230, 217, 12, 132, 133,
133438
- /* 1010 */ 95, 163, 97, 183, 30, 185, 101, 152, 114, 152,
133439
- /* 1020 */ 196, 97, 98, 152, 98, 38, 39, 40, 41, 42,
133404
+ /* 920 */ 173, 17, 66, 47, 48, 97, 98, 152, 124, 152,
133405
+ /* 930 */ 196, 55, 56, 186, 124, 152, 106, 160, 152, 83,
133406
+ /* 940 */ 152, 164, 152, 61, 22, 211, 212, 152, 97, 98,
133407
+ /* 950 */ 152, 95, 70, 97, 98, 172, 173, 101, 172, 173,
133408
+ /* 960 */ 172, 173, 172, 173, 60, 181, 62, 172, 173, 47,
133409
+ /* 970 */ 48, 123, 186, 97, 98, 71, 100, 55, 56, 152,
133410
+ /* 980 */ 181, 186, 21, 107, 152, 109, 82, 163, 132, 133,
133411
+ /* 990 */ 134, 135, 136, 89, 16, 207, 92, 93, 19, 172,
133412
+ /* 1000 */ 173, 169, 170, 195, 55, 56, 12, 152, 132, 30,
133413
+ /* 1010 */ 134, 47, 48, 186, 206, 225, 152, 95, 114, 97,
133414
+ /* 1020 */ 196, 245, 246, 101, 152, 38, 39, 40, 41, 42,
133440133415
/* 1030 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
133441
- /* 1040 */ 53, 152, 152, 219, 196, 141, 152, 132, 133, 134,
133442
- /* 1050 */ 124, 225, 57, 152, 91, 108, 109, 110, 193, 211,
133443
- /* 1060 */ 212, 237, 172, 173, 152, 122, 103, 181, 73, 152,
133444
- /* 1070 */ 75, 210, 152, 172, 173, 92, 88, 152, 90, 152,
133445
- /* 1080 */ 22, 152, 163, 100, 172, 173, 132, 133, 152, 172,
133446
- /* 1090 */ 173, 107, 172, 173, 166, 167, 112, 172, 173, 172,
133447
- /* 1100 */ 173, 172, 173, 140, 152, 152, 217, 242, 172, 173,
133448
- /* 1110 */ 152, 217, 152, 55, 152, 196, 152, 245, 246, 152,
133449
- /* 1120 */ 152, 152, 152, 152, 172, 173, 152, 152, 140, 152,
133450
- /* 1130 */ 172, 173, 172, 173, 172, 173, 172, 173, 152, 172,
133451
- /* 1140 */ 173, 172, 173, 172, 173, 152, 172, 173, 152, 172,
133452
- /* 1150 */ 173, 152, 195, 152, 152, 97, 152, 163, 172, 173,
133453
- /* 1160 */ 152, 193, 152, 206, 152, 172, 173, 152, 172, 173,
133454
- /* 1170 */ 217, 172, 173, 152, 172, 173, 172, 173, 152, 26,
133455
- /* 1180 */ 172, 173, 172, 173, 172, 173, 152, 172, 173, 152,
133456
- /* 1190 */ 196, 152, 217, 172, 173, 152, 61, 152, 172, 173,
133457
- /* 1200 */ 152, 26, 152, 26, 152, 70, 172, 173, 191, 172,
133458
- /* 1210 */ 173, 172, 173, 152, 152, 172, 173, 172, 173, 152,
133459
- /* 1220 */ 172, 173, 172, 173, 172, 173, 152, 22, 23, 152,
133460
- /* 1230 */ 22, 152, 24, 172, 173, 22, 23, 152, 59, 172,
133461
- /* 1240 */ 173, 152, 63, 163, 163, 163, 172, 173, 22, 172,
133462
- /* 1250 */ 173, 172, 173, 163, 163, 116, 77, 172, 173, 152,
133463
- /* 1260 */ 121, 172, 173, 37, 7, 8, 9, 211, 212, 23,
133464
- /* 1270 */ 23, 23, 26, 26, 26, 55, 196, 196, 196, 23,
133465
- /* 1280 */ 55, 106, 26, 130, 152, 23, 196, 196, 26, 23,
133466
- /* 1290 */ 23, 101, 26, 26, 100, 101, 7, 8, 132, 133,
133467
- /* 1300 */ 123, 96, 112, 23, 152, 23, 26, 23, 26, 96,
133468
- /* 1310 */ 26, 23, 132, 133, 26, 152, 152, 97, 234, 152,
133469
- /* 1320 */ 152, 152, 97, 152, 152, 152, 152, 233, 152, 210,
133470
- /* 1330 */ 152, 210, 210, 152, 152, 152, 152, 197, 150, 198,
133471
- /* 1340 */ 214, 214, 239, 201, 201, 239, 176, 214, 200, 184,
133472
- /* 1350 */ 227, 155, 198, 67, 243, 122, 159, 159, 240, 69,
133473
- /* 1360 */ 240, 175, 175, 159, 175, 180, 22, 220, 27, 130,
133474
- /* 1370 */ 18, 159, 18, 158, 158, 220, 159, 137, 74, 235,
133475
- /* 1380 */ 189, 236, 159, 159, 22, 192, 158, 192, 177, 159,
133476
- /* 1390 */ 158, 192, 192, 201, 159, 189, 189, 76, 177, 158,
133477
- /* 1400 */ 107, 174, 201, 201, 182, 174, 177, 106, 174, 107,
133478
- /* 1410 */ 174, 159, 174, 176, 22, 137, 125, 174, 174, 216,
133479
- /* 1420 */ 159, 53, 126, 129, 182, 215, 128, 127, 25, 13,
133480
- /* 1430 */ 216, 177, 26, 215, 162, 216, 177, 161, 229, 6,
133481
- /* 1440 */ 153, 4, 165, 3, 165, 153, 151, 22, 151, 178,
133482
- /* 1450 */ 151, 178, 142, 15, 151, 94, 120, 16, 23, 23,
133483
- /* 1460 */ 215, 131, 111, 205, 204, 216, 215, 203, 123, 20,
133484
- /* 1470 */ 202, 201, 165, 125, 224, 16, 1, 131, 123, 226,
133485
- /* 1480 */ 37, 37, 37, 37, 229, 111, 56, 64, 122, 1,
133486
- /* 1490 */ 5, 22, 107, 140, 80, 80, 26, 87, 72, 20,
133487
- /* 1500 */ 107, 24, 19, 112, 105, 23, 22, 79, 22, 22,
133488
- /* 1510 */ 79, 22, 249, 58, 249, 246, 22, 26, 79, 68,
133489
- /* 1520 */ 23, 23, 23, 116, 22, 64, 23, 22, 56, 23,
133490
- /* 1530 */ 26, 122, 23, 22, 26, 124, 26, 64, 64, 23,
133416
+ /* 1040 */ 53, 152, 163, 219, 152, 141, 97, 98, 193, 152,
133417
+ /* 1050 */ 152, 57, 91, 164, 132, 133, 134, 152, 55, 152,
133418
+ /* 1060 */ 152, 237, 230, 152, 103, 193, 88, 73, 90, 75,
133419
+ /* 1070 */ 172, 173, 183, 152, 185, 196, 152, 172, 173, 172,
133420
+ /* 1080 */ 173, 217, 152, 172, 173, 152, 107, 22, 152, 24,
133421
+ /* 1090 */ 193, 112, 152, 172, 173, 152, 132, 242, 134, 152,
133422
+ /* 1100 */ 97, 140, 152, 92, 152, 172, 173, 152, 172, 173,
133423
+ /* 1110 */ 152, 100, 172, 173, 152, 172, 173, 152, 140, 172,
133424
+ /* 1120 */ 173, 152, 172, 173, 172, 173, 152, 172, 173, 152,
133425
+ /* 1130 */ 172, 173, 152, 152, 172, 173, 152, 172, 173, 213,
133426
+ /* 1140 */ 152, 172, 173, 152, 152, 152, 172, 173, 152, 172,
133427
+ /* 1150 */ 173, 152, 172, 173, 152, 210, 172, 173, 152, 26,
133428
+ /* 1160 */ 172, 173, 152, 172, 173, 172, 173, 152, 172, 173,
133429
+ /* 1170 */ 152, 172, 173, 152, 172, 173, 152, 59, 172, 173,
133430
+ /* 1180 */ 152, 63, 172, 173, 152, 193, 152, 152, 152, 152,
133431
+ /* 1190 */ 172, 173, 152, 172, 173, 77, 172, 173, 152, 152,
133432
+ /* 1200 */ 172, 173, 152, 152, 172, 173, 172, 173, 172, 173,
133433
+ /* 1210 */ 152, 22, 172, 173, 152, 152, 152, 22, 172, 173,
133434
+ /* 1220 */ 152, 152, 152, 172, 173, 152, 7, 8, 9, 163,
133435
+ /* 1230 */ 172, 173, 22, 23, 172, 173, 172, 173, 166, 167,
133436
+ /* 1240 */ 172, 173, 172, 173, 55, 172, 173, 22, 23, 108,
133437
+ /* 1250 */ 109, 110, 217, 152, 217, 166, 167, 163, 163, 163,
133438
+ /* 1260 */ 163, 163, 196, 130, 217, 211, 212, 217, 116, 23,
133439
+ /* 1270 */ 22, 101, 26, 121, 23, 23, 23, 26, 26, 26,
133440
+ /* 1280 */ 23, 23, 112, 26, 26, 37, 97, 100, 101, 55,
133441
+ /* 1290 */ 196, 196, 196, 196, 196, 23, 23, 55, 26, 26,
133442
+ /* 1300 */ 7, 8, 23, 152, 23, 26, 96, 26, 132, 132,
133443
+ /* 1310 */ 134, 134, 23, 152, 152, 26, 152, 122, 152, 191,
133444
+ /* 1320 */ 152, 96, 234, 152, 152, 152, 152, 152, 197, 210,
133445
+ /* 1330 */ 152, 97, 152, 152, 210, 233, 210, 198, 150, 97,
133446
+ /* 1340 */ 184, 201, 239, 214, 214, 201, 239, 180, 214, 227,
133447
+ /* 1350 */ 200, 198, 155, 67, 243, 176, 69, 175, 175, 175,
133448
+ /* 1360 */ 122, 159, 159, 240, 159, 240, 22, 220, 27, 130,
133449
+ /* 1370 */ 201, 18, 159, 18, 189, 158, 158, 220, 192, 159,
133450
+ /* 1380 */ 137, 236, 192, 192, 192, 189, 74, 189, 159, 235,
133451
+ /* 1390 */ 159, 158, 22, 177, 201, 201, 159, 107, 158, 177,
133452
+ /* 1400 */ 159, 174, 158, 76, 174, 182, 174, 106, 182, 125,
133453
+ /* 1410 */ 174, 107, 177, 22, 159, 216, 215, 137, 159, 53,
133454
+ /* 1420 */ 216, 176, 215, 174, 174, 216, 215, 215, 174, 229,
133455
+ /* 1430 */ 216, 129, 224, 177, 126, 229, 127, 177, 128, 25,
133456
+ /* 1440 */ 162, 226, 26, 161, 13, 153, 6, 153, 151, 151,
133457
+ /* 1450 */ 151, 151, 205, 165, 178, 178, 165, 4, 3, 22,
133458
+ /* 1460 */ 165, 142, 15, 94, 202, 204, 203, 201, 16, 23,
133459
+ /* 1470 */ 249, 23, 120, 249, 246, 111, 131, 123, 20, 16,
133460
+ /* 1480 */ 1, 125, 123, 111, 56, 64, 37, 37, 131, 122,
133461
+ /* 1490 */ 1, 37, 5, 37, 22, 107, 26, 80, 140, 80,
133462
+ /* 1500 */ 87, 72, 107, 20, 24, 19, 112, 105, 23, 79,
133463
+ /* 1510 */ 22, 79, 22, 22, 22, 58, 22, 79, 23, 68,
133464
+ /* 1520 */ 23, 23, 26, 116, 22, 26, 23, 22, 122, 23,
133465
+ /* 1530 */ 23, 56, 64, 22, 124, 26, 26, 64, 64, 23,
133491133466
/* 1540 */ 23, 23, 23, 11, 23, 22, 26, 23, 22, 24,
133492
- /* 1550 */ 1, 23, 22, 26, 122, 24, 23, 22, 15, 23,
133493
- /* 1560 */ 23, 22, 251, 23, 122, 251, 251, 251, 251, 122,
133494
- /* 1570 */ 122,
133467
+ /* 1550 */ 1, 23, 22, 26, 251, 24, 23, 22, 122, 23,
133468
+ /* 1560 */ 23, 22, 15, 122, 122, 122, 23,
133495133469
};
133496
-#define YY_SHIFT_USE_DFLT (1571)
133470
+#define YY_SHIFT_USE_DFLT (1567)
133497133471
#define YY_SHIFT_COUNT (455)
133498133472
#define YY_SHIFT_MIN (-94)
133499133473
#define YY_SHIFT_MAX (1549)
133500133474
static const short yy_shift_ofst[] = {
133501133475
/* 0 */ 40, 599, 904, 612, 760, 760, 760, 760, 725, -19,
@@ -133507,132 +133481,132 @@
133507133481
/* 60 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133508133482
/* 70 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133509133483
/* 80 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133510133484
/* 90 */ 856, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133511133485
/* 100 */ 760, 760, 760, 760, 987, 746, 746, 746, 746, 746,
133512
- /* 110 */ 801, 23, 32, 924, 963, 984, 954, 954, 924, 73,
133513
- /* 120 */ 113, -51, 1571, 1571, 1571, 536, 536, 536, 99, 99,
133514
- /* 130 */ 813, 813, 667, 205, 240, 924, 924, 924, 924, 924,
133515
- /* 140 */ 924, 924, 924, 924, 924, 924, 924, 924, 924, 924,
133516
- /* 150 */ 924, 924, 924, 924, 924, 332, 983, 422, 422, 113,
133517
- /* 160 */ 30, 30, 30, 30, 30, 30, 1571, 1571, 1571, 915,
133518
- /* 170 */ -94, -94, 384, 613, 828, 420, 765, 804, 851, 924,
133519
- /* 180 */ 924, 924, 924, 924, 924, 924, 924, 924, 924, 924,
133520
- /* 190 */ 924, 924, 924, 924, 924, 672, 672, 672, 924, 924,
133521
- /* 200 */ 657, 924, 924, 924, -18, 924, 924, 995, 924, 924,
133522
- /* 210 */ 924, 924, 924, 924, 924, 924, 924, 924, 772, 1179,
133523
- /* 220 */ 712, 712, 712, 926, 45, 769, 1257, 1153, 418, 418,
133524
- /* 230 */ 569, 1153, 569, 1175, 607, 663, 1135, 418, 693, 1135,
133525
- /* 240 */ 1135, 1177, 1139, 1208, 1286, 1233, 1233, 1290, 1290, 1233,
133526
- /* 250 */ 1344, 1341, 1239, 1352, 1352, 1352, 1352, 1233, 1354, 1239,
133527
- /* 260 */ 1344, 1341, 1341, 1239, 1233, 1354, 1240, 1304, 1233, 1233,
133528
- /* 270 */ 1354, 1362, 1233, 1354, 1233, 1354, 1362, 1293, 1293, 1293,
133529
- /* 280 */ 1321, 1362, 1293, 1301, 1293, 1321, 1293, 1293, 1291, 1302,
133530
- /* 290 */ 1291, 1302, 1291, 1302, 1291, 1302, 1233, 1392, 1233, 1278,
133531
- /* 300 */ 1362, 1368, 1368, 1362, 1294, 1296, 1298, 1300, 1239, 1403,
133532
- /* 310 */ 1406, 1416, 1416, 1433, 1433, 1433, 1433, 1571, 1571, 1571,
133533
- /* 320 */ 1571, 1571, 1571, 1571, 1571, 519, 988, 1205, 1213, 104,
133534
- /* 330 */ 947, 1058, 1246, 1226, 1247, 1248, 1256, 1262, 1266, 1267,
133535
- /* 340 */ 853, 1194, 1289, 1190, 1280, 1282, 1220, 1284, 1166, 1180,
133536
- /* 350 */ 1288, 1225, 943, 1437, 1440, 1425, 1310, 1438, 1361, 1441,
133537
- /* 360 */ 1435, 1436, 1336, 1330, 1351, 1345, 1449, 1348, 1459, 1475,
133538
- /* 370 */ 1355, 1346, 1443, 1444, 1445, 1446, 1374, 1430, 1423, 1366,
133539
- /* 380 */ 1488, 1485, 1469, 1385, 1353, 1414, 1470, 1415, 1410, 1426,
133540
- /* 390 */ 1393, 1477, 1479, 1483, 1391, 1399, 1484, 1428, 1486, 1487,
133541
- /* 400 */ 1482, 1489, 1431, 1455, 1494, 1439, 1451, 1497, 1498, 1499,
133542
- /* 410 */ 1491, 1407, 1502, 1503, 1505, 1504, 1409, 1506, 1509, 1472,
133543
- /* 420 */ 1461, 1511, 1411, 1508, 1473, 1510, 1474, 1516, 1508, 1517,
133486
+ /* 110 */ 801, 23, 32, 949, 961, 979, 964, 964, 949, 73,
133487
+ /* 120 */ 113, -51, 1567, 1567, 1567, 536, 536, 536, 99, 99,
133488
+ /* 130 */ 813, 813, 667, 205, 240, 949, 949, 949, 949, 949,
133489
+ /* 140 */ 949, 949, 949, 949, 949, 949, 949, 949, 949, 949,
133490
+ /* 150 */ 949, 949, 949, 949, 949, 332, 1011, 422, 422, 113,
133491
+ /* 160 */ 30, 30, 30, 30, 30, 30, 1567, 1567, 1567, 922,
133492
+ /* 170 */ -94, -94, 384, 613, 828, 420, 765, 804, 851, 949,
133493
+ /* 180 */ 949, 949, 949, 949, 949, 949, 949, 949, 949, 949,
133494
+ /* 190 */ 949, 949, 949, 949, 949, 672, 672, 672, 949, 949,
133495
+ /* 200 */ 657, 949, 949, 949, -18, 949, 949, 994, 949, 949,
133496
+ /* 210 */ 949, 949, 949, 949, 949, 949, 949, 949, 772, 1118,
133497
+ /* 220 */ 712, 712, 712, 810, 45, 769, 1219, 1133, 418, 418,
133498
+ /* 230 */ 569, 1133, 569, 830, 607, 663, 882, 418, 693, 882,
133499
+ /* 240 */ 882, 848, 1152, 1065, 1286, 1238, 1238, 1287, 1287, 1238,
133500
+ /* 250 */ 1344, 1341, 1239, 1353, 1353, 1353, 1353, 1238, 1355, 1239,
133501
+ /* 260 */ 1344, 1341, 1341, 1239, 1238, 1355, 1243, 1312, 1238, 1238,
133502
+ /* 270 */ 1355, 1370, 1238, 1355, 1238, 1355, 1370, 1290, 1290, 1290,
133503
+ /* 280 */ 1327, 1370, 1290, 1301, 1290, 1327, 1290, 1290, 1284, 1304,
133504
+ /* 290 */ 1284, 1304, 1284, 1304, 1284, 1304, 1238, 1391, 1238, 1280,
133505
+ /* 300 */ 1370, 1366, 1366, 1370, 1302, 1308, 1310, 1309, 1239, 1414,
133506
+ /* 310 */ 1416, 1431, 1431, 1440, 1440, 1440, 1440, 1567, 1567, 1567,
133507
+ /* 320 */ 1567, 1567, 1567, 1567, 1567, 519, 978, 1210, 1225, 104,
133508
+ /* 330 */ 1141, 1189, 1246, 1248, 1251, 1252, 1253, 1257, 1258, 1273,
133509
+ /* 340 */ 1003, 1187, 1293, 1170, 1272, 1279, 1234, 1281, 1176, 1177,
133510
+ /* 350 */ 1289, 1242, 1195, 1453, 1455, 1437, 1319, 1447, 1369, 1452,
133511
+ /* 360 */ 1446, 1448, 1352, 1345, 1364, 1354, 1458, 1356, 1463, 1479,
133512
+ /* 370 */ 1359, 1357, 1449, 1450, 1454, 1456, 1372, 1428, 1421, 1367,
133513
+ /* 380 */ 1489, 1487, 1472, 1388, 1358, 1417, 1470, 1419, 1413, 1429,
133514
+ /* 390 */ 1395, 1480, 1483, 1486, 1394, 1402, 1488, 1430, 1490, 1491,
133515
+ /* 400 */ 1485, 1492, 1432, 1457, 1494, 1438, 1451, 1495, 1497, 1498,
133516
+ /* 410 */ 1496, 1407, 1502, 1503, 1505, 1499, 1406, 1506, 1507, 1475,
133517
+ /* 420 */ 1468, 1511, 1410, 1509, 1473, 1510, 1474, 1516, 1509, 1517,
133544133518
/* 430 */ 1518, 1519, 1520, 1521, 1523, 1532, 1524, 1526, 1525, 1527,
133545
- /* 440 */ 1528, 1530, 1531, 1527, 1533, 1535, 1536, 1537, 1539, 1432,
133546
- /* 450 */ 1442, 1447, 1448, 1540, 1543, 1549,
133519
+ /* 440 */ 1528, 1530, 1531, 1527, 1533, 1535, 1536, 1537, 1539, 1436,
133520
+ /* 450 */ 1441, 1442, 1443, 1543, 1547, 1549,
133547133521
};
133548133522
#define YY_REDUCE_USE_DFLT (-130)
133549133523
#define YY_REDUCE_COUNT (324)
133550133524
#define YY_REDUCE_MIN (-129)
133551
-#define YY_REDUCE_MAX (1307)
133525
+#define YY_REDUCE_MAX (1300)
133552133526
static const short yy_reduce_ofst[] = {
133553133527
/* 0 */ -29, 566, 525, 605, -49, 307, 491, 533, 668, 435,
133554
- /* 10 */ 601, 644, 148, 747, 783, 786, 419, 788, 795, 826,
133555
- /* 20 */ 454, 775, 830, 495, 824, 848, 76, 76, 76, 76,
133528
+ /* 10 */ 601, 644, 148, 747, 786, 795, 419, 788, 827, 790,
133529
+ /* 20 */ 454, 832, 889, 495, 824, 734, 76, 76, 76, 76,
133556133530
/* 30 */ 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
133557133531
/* 40 */ 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
133558
- /* 50 */ 76, 76, 76, 76, 76, 76, 76, 76, 890, 901,
133559
- /* 60 */ 912, 917, 920, 925, 927, 929, 936, 952, 958, 960,
133560
- /* 70 */ 962, 964, 967, 969, 971, 974, 977, 986, 993, 996,
133561
- /* 80 */ 999, 1002, 1004, 1008, 1010, 1012, 1015, 1021, 1026, 1034,
133562
- /* 90 */ 1037, 1039, 1043, 1045, 1048, 1050, 1052, 1061, 1067, 1074,
133563
- /* 100 */ 1077, 1079, 1085, 1089, 76, 76, 76, 76, 76, 76,
133564
- /* 110 */ 76, 76, 76, 865, 36, 523, 235, 416, 782, 76,
133532
+ /* 50 */ 76, 76, 76, 76, 76, 76, 76, 76, 783, 898,
133533
+ /* 60 */ 905, 907, 911, 921, 933, 936, 940, 943, 947, 950,
133534
+ /* 70 */ 952, 955, 958, 962, 965, 969, 974, 977, 980, 984,
133535
+ /* 80 */ 988, 991, 993, 996, 999, 1002, 1006, 1010, 1018, 1021,
133536
+ /* 90 */ 1024, 1028, 1032, 1034, 1036, 1040, 1046, 1051, 1058, 1062,
133537
+ /* 100 */ 1064, 1068, 1070, 1073, 76, 76, 76, 76, 76, 76,
133538
+ /* 110 */ 76, 76, 76, 855, 36, 523, 235, 416, 777, 76,
133565133539
/* 120 */ 278, 76, 76, 76, 76, 700, 700, 700, 150, 220,
133566133540
/* 130 */ 147, 217, 221, 306, 306, 611, 5, 535, 556, 620,
133567
- /* 140 */ 704, 720, 784, 116, 789, 349, 889, 894, 404, 953,
133568
- /* 150 */ 968, -129, 975, 492, 62, 722, 919, 763, 928, 957,
133569
- /* 160 */ 994, 1080, 1081, 1082, 1090, 1091, 872, 1056, 557, 57,
133541
+ /* 140 */ 720, 872, 897, 116, 864, 349, 1035, 1037, 404, 1047,
133542
+ /* 150 */ 992, -129, 1050, 492, 62, 722, 879, 1072, 1089, 808,
133543
+ /* 160 */ 1066, 1094, 1095, 1096, 1097, 1098, 776, 1054, 557, 57,
133570133544
/* 170 */ 112, 131, 167, 182, 250, 272, 291, 331, 364, 438,
133571
- /* 180 */ 497, 517, 591, 653, 684, 690, 739, 791, 867, 871,
133572
- /* 190 */ 970, 1062, 1107, 1132, 1152, 355, 819, 886, 1001, 1163,
133573
- /* 200 */ 661, 1164, 1167, 1168, 861, 1169, 1171, 1017, 1172, 1173,
133574
- /* 210 */ 1174, 250, 1176, 1178, 1181, 1182, 1183, 1184, 1084, 1094,
133575
- /* 220 */ 1119, 1121, 1122, 661, 1140, 1141, 1188, 1142, 1126, 1127,
133576
- /* 230 */ 1103, 1143, 1106, 1170, 1165, 1185, 1186, 1133, 1123, 1187,
133577
- /* 240 */ 1189, 1148, 1154, 1196, 1111, 1197, 1198, 1118, 1120, 1204,
133578
- /* 250 */ 1147, 1191, 1192, 1193, 1195, 1199, 1200, 1212, 1215, 1201,
133579
- /* 260 */ 1155, 1206, 1207, 1202, 1217, 1216, 1145, 1144, 1223, 1224,
133580
- /* 270 */ 1228, 1211, 1230, 1232, 1235, 1241, 1221, 1227, 1231, 1234,
133581
- /* 280 */ 1222, 1229, 1236, 1237, 1238, 1242, 1243, 1244, 1203, 1210,
133582
- /* 290 */ 1214, 1218, 1219, 1245, 1249, 1251, 1252, 1250, 1261, 1253,
133583
- /* 300 */ 1254, 1209, 1255, 1259, 1258, 1260, 1264, 1268, 1270, 1272,
133584
- /* 310 */ 1276, 1287, 1292, 1295, 1297, 1299, 1303, 1263, 1265, 1269,
133585
- /* 320 */ 1277, 1279, 1271, 1273, 1307,
133545
+ /* 180 */ 497, 517, 591, 653, 690, 739, 775, 798, 892, 908,
133546
+ /* 190 */ 924, 930, 1015, 1063, 1069, 355, 784, 799, 981, 1101,
133547
+ /* 200 */ 926, 1151, 1161, 1162, 945, 1164, 1166, 1128, 1168, 1171,
133548
+ /* 210 */ 1172, 250, 1173, 1174, 1175, 1178, 1180, 1181, 1088, 1102,
133549
+ /* 220 */ 1119, 1124, 1126, 926, 1131, 1139, 1188, 1140, 1129, 1130,
133550
+ /* 230 */ 1103, 1144, 1107, 1179, 1156, 1167, 1182, 1134, 1122, 1183,
133551
+ /* 240 */ 1184, 1150, 1153, 1197, 1111, 1202, 1203, 1123, 1125, 1205,
133552
+ /* 250 */ 1147, 1185, 1169, 1186, 1190, 1191, 1192, 1213, 1217, 1193,
133553
+ /* 260 */ 1157, 1196, 1198, 1194, 1220, 1218, 1145, 1154, 1229, 1231,
133554
+ /* 270 */ 1233, 1216, 1237, 1240, 1241, 1244, 1222, 1227, 1230, 1232,
133555
+ /* 280 */ 1223, 1235, 1236, 1245, 1249, 1226, 1250, 1254, 1199, 1201,
133556
+ /* 290 */ 1204, 1207, 1209, 1211, 1214, 1212, 1255, 1208, 1259, 1215,
133557
+ /* 300 */ 1256, 1200, 1206, 1260, 1247, 1261, 1263, 1262, 1266, 1278,
133558
+ /* 310 */ 1282, 1292, 1294, 1297, 1298, 1299, 1300, 1221, 1224, 1228,
133559
+ /* 320 */ 1288, 1291, 1276, 1277, 1295,
133586133560
};
133587133561
static const YYACTIONTYPE yy_default[] = {
133588
- /* 0 */ 1278, 1268, 1268, 1268, 1200, 1200, 1200, 1200, 1268, 1094,
133589
- /* 10 */ 1123, 1123, 1252, 1329, 1329, 1329, 1329, 1329, 1329, 1199,
133590
- /* 20 */ 1329, 1329, 1329, 1329, 1268, 1098, 1129, 1329, 1329, 1329,
133591
- /* 30 */ 1329, 1201, 1202, 1329, 1329, 1329, 1251, 1253, 1139, 1138,
133592
- /* 40 */ 1137, 1136, 1234, 1110, 1134, 1127, 1131, 1201, 1195, 1196,
133593
- /* 50 */ 1194, 1198, 1202, 1329, 1130, 1164, 1179, 1163, 1329, 1329,
133594
- /* 60 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133595
- /* 70 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133596
- /* 80 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133597
- /* 90 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133598
- /* 100 */ 1329, 1329, 1329, 1329, 1173, 1178, 1185, 1177, 1174, 1166,
133599
- /* 110 */ 1165, 1167, 1168, 1329, 1017, 1065, 1329, 1329, 1329, 1169,
133600
- /* 120 */ 1329, 1170, 1182, 1181, 1180, 1259, 1286, 1285, 1329, 1329,
133601
- /* 130 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133602
- /* 140 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133603
- /* 150 */ 1329, 1329, 1329, 1329, 1329, 1278, 1268, 1023, 1023, 1329,
133604
- /* 160 */ 1268, 1268, 1268, 1268, 1268, 1268, 1264, 1098, 1089, 1329,
133605
- /* 170 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133606
- /* 180 */ 1256, 1254, 1329, 1215, 1329, 1329, 1329, 1329, 1329, 1329,
133607
- /* 190 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133608
- /* 200 */ 1329, 1329, 1329, 1329, 1094, 1329, 1329, 1329, 1329, 1329,
133609
- /* 210 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1280, 1329, 1229,
133610
- /* 220 */ 1094, 1094, 1094, 1096, 1078, 1088, 1002, 1133, 1112, 1112,
133611
- /* 230 */ 1318, 1133, 1318, 1040, 1300, 1037, 1123, 1112, 1197, 1123,
133612
- /* 240 */ 1123, 1095, 1088, 1329, 1321, 1103, 1103, 1320, 1320, 1103,
133613
- /* 250 */ 1144, 1068, 1133, 1074, 1074, 1074, 1074, 1103, 1014, 1133,
133614
- /* 260 */ 1144, 1068, 1068, 1133, 1103, 1014, 1233, 1315, 1103, 1103,
133615
- /* 270 */ 1014, 1208, 1103, 1014, 1103, 1014, 1208, 1066, 1066, 1066,
133616
- /* 280 */ 1055, 1208, 1066, 1040, 1066, 1055, 1066, 1066, 1116, 1111,
133617
- /* 290 */ 1116, 1111, 1116, 1111, 1116, 1111, 1103, 1203, 1103, 1329,
133618
- /* 300 */ 1208, 1212, 1212, 1208, 1128, 1117, 1126, 1124, 1133, 1020,
133619
- /* 310 */ 1058, 1283, 1283, 1279, 1279, 1279, 1279, 1326, 1326, 1264,
133620
- /* 320 */ 1295, 1295, 1042, 1042, 1295, 1329, 1329, 1329, 1329, 1329,
133621
- /* 330 */ 1329, 1290, 1329, 1217, 1329, 1329, 1329, 1329, 1329, 1329,
133622
- /* 340 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133623
- /* 350 */ 1329, 1329, 1150, 1329, 998, 1261, 1329, 1329, 1260, 1329,
133624
- /* 360 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133625
- /* 370 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1317,
133626
- /* 380 */ 1329, 1329, 1329, 1329, 1329, 1329, 1232, 1231, 1329, 1329,
133627
- /* 390 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133628
- /* 400 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133629
- /* 410 */ 1329, 1080, 1329, 1329, 1329, 1304, 1329, 1329, 1329, 1329,
133630
- /* 420 */ 1329, 1329, 1329, 1125, 1329, 1118, 1329, 1329, 1308, 1329,
133631
- /* 430 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1270,
133632
- /* 440 */ 1329, 1329, 1329, 1269, 1329, 1329, 1329, 1329, 1329, 1152,
133633
- /* 450 */ 1329, 1151, 1155, 1329, 1008, 1329,
133562
+ /* 0 */ 1281, 1271, 1271, 1271, 1203, 1203, 1203, 1203, 1271, 1096,
133563
+ /* 10 */ 1125, 1125, 1255, 1332, 1332, 1332, 1332, 1332, 1332, 1202,
133564
+ /* 20 */ 1332, 1332, 1332, 1332, 1271, 1100, 1131, 1332, 1332, 1332,
133565
+ /* 30 */ 1332, 1204, 1205, 1332, 1332, 1332, 1254, 1256, 1141, 1140,
133566
+ /* 40 */ 1139, 1138, 1237, 1112, 1136, 1129, 1133, 1204, 1198, 1199,
133567
+ /* 50 */ 1197, 1201, 1205, 1332, 1132, 1167, 1182, 1166, 1332, 1332,
133568
+ /* 60 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133569
+ /* 70 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133570
+ /* 80 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133571
+ /* 90 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133572
+ /* 100 */ 1332, 1332, 1332, 1332, 1176, 1181, 1188, 1180, 1177, 1169,
133573
+ /* 110 */ 1168, 1170, 1171, 1332, 1019, 1067, 1332, 1332, 1332, 1172,
133574
+ /* 120 */ 1332, 1173, 1185, 1184, 1183, 1262, 1289, 1288, 1332, 1332,
133575
+ /* 130 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133576
+ /* 140 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133577
+ /* 150 */ 1332, 1332, 1332, 1332, 1332, 1281, 1271, 1025, 1025, 1332,
133578
+ /* 160 */ 1271, 1271, 1271, 1271, 1271, 1271, 1267, 1100, 1091, 1332,
133579
+ /* 170 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133580
+ /* 180 */ 1259, 1257, 1332, 1218, 1332, 1332, 1332, 1332, 1332, 1332,
133581
+ /* 190 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133582
+ /* 200 */ 1332, 1332, 1332, 1332, 1096, 1332, 1332, 1332, 1332, 1332,
133583
+ /* 210 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1283, 1332, 1232,
133584
+ /* 220 */ 1096, 1096, 1096, 1098, 1080, 1090, 1004, 1135, 1114, 1114,
133585
+ /* 230 */ 1321, 1135, 1321, 1042, 1303, 1039, 1125, 1114, 1200, 1125,
133586
+ /* 240 */ 1125, 1097, 1090, 1332, 1324, 1105, 1105, 1323, 1323, 1105,
133587
+ /* 250 */ 1146, 1070, 1135, 1076, 1076, 1076, 1076, 1105, 1016, 1135,
133588
+ /* 260 */ 1146, 1070, 1070, 1135, 1105, 1016, 1236, 1318, 1105, 1105,
133589
+ /* 270 */ 1016, 1211, 1105, 1016, 1105, 1016, 1211, 1068, 1068, 1068,
133590
+ /* 280 */ 1057, 1211, 1068, 1042, 1068, 1057, 1068, 1068, 1118, 1113,
133591
+ /* 290 */ 1118, 1113, 1118, 1113, 1118, 1113, 1105, 1206, 1105, 1332,
133592
+ /* 300 */ 1211, 1215, 1215, 1211, 1130, 1119, 1128, 1126, 1135, 1022,
133593
+ /* 310 */ 1060, 1286, 1286, 1282, 1282, 1282, 1282, 1329, 1329, 1267,
133594
+ /* 320 */ 1298, 1298, 1044, 1044, 1298, 1332, 1332, 1332, 1332, 1332,
133595
+ /* 330 */ 1332, 1293, 1332, 1220, 1332, 1332, 1332, 1332, 1332, 1332,
133596
+ /* 340 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133597
+ /* 350 */ 1332, 1332, 1152, 1332, 1000, 1264, 1332, 1332, 1263, 1332,
133598
+ /* 360 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133599
+ /* 370 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1320,
133600
+ /* 380 */ 1332, 1332, 1332, 1332, 1332, 1332, 1235, 1234, 1332, 1332,
133601
+ /* 390 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133602
+ /* 400 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133603
+ /* 410 */ 1332, 1082, 1332, 1332, 1332, 1307, 1332, 1332, 1332, 1332,
133604
+ /* 420 */ 1332, 1332, 1332, 1127, 1332, 1120, 1332, 1332, 1311, 1332,
133605
+ /* 430 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1273,
133606
+ /* 440 */ 1332, 1332, 1332, 1272, 1332, 1332, 1332, 1332, 1332, 1154,
133607
+ /* 450 */ 1332, 1153, 1157, 1332, 1010, 1332,
133634133608
};
133635133609
/********** End of lemon-generated parsing tables *****************************/
133636133610
133637133611
/* The next table maps tokens (terminal symbols) into fallback tokens.
133638133612
** If a construct like the following:
@@ -133862,11 +133836,11 @@
133862133836
"DEFERRABLE", "FOREIGN", "DROP", "UNION",
133863133837
"ALL", "EXCEPT", "INTERSECT", "SELECT",
133864133838
"VALUES", "DISTINCT", "DOT", "FROM",
133865133839
"JOIN", "USING", "ORDER", "GROUP",
133866133840
"HAVING", "LIMIT", "WHERE", "INTO",
133867
- "INTEGER", "FLOAT", "BLOB", "VARIABLE",
133841
+ "FLOAT", "BLOB", "INTEGER", "VARIABLE",
133868133842
"CASE", "WHEN", "THEN", "ELSE",
133869133843
"INDEX", "ALTER", "ADD", "error",
133870133844
"input", "cmdlist", "ecmd", "explain",
133871133845
"cmdx", "cmd", "transtype", "trans_opt",
133872133846
"nm", "savepoint_opt", "create_table", "create_table_args",
@@ -134055,185 +134029,186 @@
134055134029
/* 151 */ "term ::= NULL",
134056134030
/* 152 */ "expr ::= ID|INDEXED",
134057134031
/* 153 */ "expr ::= JOIN_KW",
134058134032
/* 154 */ "expr ::= nm DOT nm",
134059134033
/* 155 */ "expr ::= nm DOT nm DOT nm",
134060
- /* 156 */ "term ::= INTEGER|FLOAT|BLOB",
134034
+ /* 156 */ "term ::= FLOAT|BLOB",
134061134035
/* 157 */ "term ::= STRING",
134062
- /* 158 */ "expr ::= VARIABLE",
134063
- /* 159 */ "expr ::= expr COLLATE ID|STRING",
134064
- /* 160 */ "expr ::= CAST LP expr AS typetoken RP",
134065
- /* 161 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
134066
- /* 162 */ "expr ::= ID|INDEXED LP STAR RP",
134067
- /* 163 */ "term ::= CTIME_KW",
134068
- /* 164 */ "expr ::= LP nexprlist COMMA expr RP",
134069
- /* 165 */ "expr ::= expr AND expr",
134070
- /* 166 */ "expr ::= expr OR expr",
134071
- /* 167 */ "expr ::= expr LT|GT|GE|LE expr",
134072
- /* 168 */ "expr ::= expr EQ|NE expr",
134073
- /* 169 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
134074
- /* 170 */ "expr ::= expr PLUS|MINUS expr",
134075
- /* 171 */ "expr ::= expr STAR|SLASH|REM expr",
134076
- /* 172 */ "expr ::= expr CONCAT expr",
134077
- /* 173 */ "likeop ::= LIKE_KW|MATCH",
134078
- /* 174 */ "likeop ::= NOT LIKE_KW|MATCH",
134079
- /* 175 */ "expr ::= expr likeop expr",
134080
- /* 176 */ "expr ::= expr likeop expr ESCAPE expr",
134081
- /* 177 */ "expr ::= expr ISNULL|NOTNULL",
134082
- /* 178 */ "expr ::= expr NOT NULL",
134083
- /* 179 */ "expr ::= expr IS expr",
134084
- /* 180 */ "expr ::= expr IS NOT expr",
134085
- /* 181 */ "expr ::= NOT expr",
134086
- /* 182 */ "expr ::= BITNOT expr",
134087
- /* 183 */ "expr ::= MINUS expr",
134088
- /* 184 */ "expr ::= PLUS expr",
134089
- /* 185 */ "between_op ::= BETWEEN",
134090
- /* 186 */ "between_op ::= NOT BETWEEN",
134091
- /* 187 */ "expr ::= expr between_op expr AND expr",
134092
- /* 188 */ "in_op ::= IN",
134093
- /* 189 */ "in_op ::= NOT IN",
134094
- /* 190 */ "expr ::= expr in_op LP exprlist RP",
134095
- /* 191 */ "expr ::= LP select RP",
134096
- /* 192 */ "expr ::= expr in_op LP select RP",
134097
- /* 193 */ "expr ::= expr in_op nm dbnm paren_exprlist",
134098
- /* 194 */ "expr ::= EXISTS LP select RP",
134099
- /* 195 */ "expr ::= CASE case_operand case_exprlist case_else END",
134100
- /* 196 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
134101
- /* 197 */ "case_exprlist ::= WHEN expr THEN expr",
134102
- /* 198 */ "case_else ::= ELSE expr",
134103
- /* 199 */ "case_else ::=",
134104
- /* 200 */ "case_operand ::= expr",
134105
- /* 201 */ "case_operand ::=",
134106
- /* 202 */ "exprlist ::=",
134107
- /* 203 */ "nexprlist ::= nexprlist COMMA expr",
134108
- /* 204 */ "nexprlist ::= expr",
134109
- /* 205 */ "paren_exprlist ::=",
134110
- /* 206 */ "paren_exprlist ::= LP exprlist RP",
134111
- /* 207 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
134112
- /* 208 */ "uniqueflag ::= UNIQUE",
134113
- /* 209 */ "uniqueflag ::=",
134114
- /* 210 */ "eidlist_opt ::=",
134115
- /* 211 */ "eidlist_opt ::= LP eidlist RP",
134116
- /* 212 */ "eidlist ::= eidlist COMMA nm collate sortorder",
134117
- /* 213 */ "eidlist ::= nm collate sortorder",
134118
- /* 214 */ "collate ::=",
134119
- /* 215 */ "collate ::= COLLATE ID|STRING",
134120
- /* 216 */ "cmd ::= DROP INDEX ifexists fullname",
134121
- /* 217 */ "cmd ::= VACUUM",
134122
- /* 218 */ "cmd ::= VACUUM nm",
134123
- /* 219 */ "cmd ::= PRAGMA nm dbnm",
134124
- /* 220 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
134125
- /* 221 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
134126
- /* 222 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
134127
- /* 223 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
134128
- /* 224 */ "plus_num ::= PLUS INTEGER|FLOAT",
134129
- /* 225 */ "minus_num ::= MINUS INTEGER|FLOAT",
134130
- /* 226 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
134131
- /* 227 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
134132
- /* 228 */ "trigger_time ::= BEFORE",
134133
- /* 229 */ "trigger_time ::= AFTER",
134134
- /* 230 */ "trigger_time ::= INSTEAD OF",
134135
- /* 231 */ "trigger_time ::=",
134136
- /* 232 */ "trigger_event ::= DELETE|INSERT",
134137
- /* 233 */ "trigger_event ::= UPDATE",
134138
- /* 234 */ "trigger_event ::= UPDATE OF idlist",
134139
- /* 235 */ "when_clause ::=",
134140
- /* 236 */ "when_clause ::= WHEN expr",
134141
- /* 237 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
134142
- /* 238 */ "trigger_cmd_list ::= trigger_cmd SEMI",
134143
- /* 239 */ "trnm ::= nm DOT nm",
134144
- /* 240 */ "tridxby ::= INDEXED BY nm",
134145
- /* 241 */ "tridxby ::= NOT INDEXED",
134146
- /* 242 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt",
134147
- /* 243 */ "trigger_cmd ::= insert_cmd INTO trnm idlist_opt select",
134148
- /* 244 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt",
134149
- /* 245 */ "trigger_cmd ::= select",
134150
- /* 246 */ "expr ::= RAISE LP IGNORE RP",
134151
- /* 247 */ "expr ::= RAISE LP raisetype COMMA nm RP",
134152
- /* 248 */ "raisetype ::= ROLLBACK",
134153
- /* 249 */ "raisetype ::= ABORT",
134154
- /* 250 */ "raisetype ::= FAIL",
134155
- /* 251 */ "cmd ::= DROP TRIGGER ifexists fullname",
134156
- /* 252 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
134157
- /* 253 */ "cmd ::= DETACH database_kw_opt expr",
134158
- /* 254 */ "key_opt ::=",
134159
- /* 255 */ "key_opt ::= KEY expr",
134160
- /* 256 */ "cmd ::= REINDEX",
134161
- /* 257 */ "cmd ::= REINDEX nm dbnm",
134162
- /* 258 */ "cmd ::= ANALYZE",
134163
- /* 259 */ "cmd ::= ANALYZE nm dbnm",
134164
- /* 260 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
134165
- /* 261 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
134166
- /* 262 */ "add_column_fullname ::= fullname",
134167
- /* 263 */ "cmd ::= create_vtab",
134168
- /* 264 */ "cmd ::= create_vtab LP vtabarglist RP",
134169
- /* 265 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
134170
- /* 266 */ "vtabarg ::=",
134171
- /* 267 */ "vtabargtoken ::= ANY",
134172
- /* 268 */ "vtabargtoken ::= lp anylist RP",
134173
- /* 269 */ "lp ::= LP",
134174
- /* 270 */ "with ::=",
134175
- /* 271 */ "with ::= WITH wqlist",
134176
- /* 272 */ "with ::= WITH RECURSIVE wqlist",
134177
- /* 273 */ "wqlist ::= nm eidlist_opt AS LP select RP",
134178
- /* 274 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
134179
- /* 275 */ "input ::= cmdlist",
134180
- /* 276 */ "cmdlist ::= cmdlist ecmd",
134181
- /* 277 */ "cmdlist ::= ecmd",
134182
- /* 278 */ "ecmd ::= SEMI",
134183
- /* 279 */ "ecmd ::= explain cmdx SEMI",
134184
- /* 280 */ "explain ::=",
134185
- /* 281 */ "trans_opt ::=",
134186
- /* 282 */ "trans_opt ::= TRANSACTION",
134187
- /* 283 */ "trans_opt ::= TRANSACTION nm",
134188
- /* 284 */ "savepoint_opt ::= SAVEPOINT",
134189
- /* 285 */ "savepoint_opt ::=",
134190
- /* 286 */ "cmd ::= create_table create_table_args",
134191
- /* 287 */ "columnlist ::= columnlist COMMA columnname carglist",
134192
- /* 288 */ "columnlist ::= columnname carglist",
134193
- /* 289 */ "nm ::= ID|INDEXED",
134194
- /* 290 */ "nm ::= STRING",
134195
- /* 291 */ "nm ::= JOIN_KW",
134196
- /* 292 */ "typetoken ::= typename",
134197
- /* 293 */ "typename ::= ID|STRING",
134198
- /* 294 */ "signed ::= plus_num",
134199
- /* 295 */ "signed ::= minus_num",
134200
- /* 296 */ "carglist ::= carglist ccons",
134201
- /* 297 */ "carglist ::=",
134202
- /* 298 */ "ccons ::= NULL onconf",
134203
- /* 299 */ "conslist_opt ::= COMMA conslist",
134204
- /* 300 */ "conslist ::= conslist tconscomma tcons",
134205
- /* 301 */ "conslist ::= tcons",
134206
- /* 302 */ "tconscomma ::=",
134207
- /* 303 */ "defer_subclause_opt ::= defer_subclause",
134208
- /* 304 */ "resolvetype ::= raisetype",
134209
- /* 305 */ "selectnowith ::= oneselect",
134210
- /* 306 */ "oneselect ::= values",
134211
- /* 307 */ "sclp ::= selcollist COMMA",
134212
- /* 308 */ "as ::= ID|STRING",
134213
- /* 309 */ "expr ::= term",
134214
- /* 310 */ "exprlist ::= nexprlist",
134215
- /* 311 */ "nmnum ::= plus_num",
134216
- /* 312 */ "nmnum ::= nm",
134217
- /* 313 */ "nmnum ::= ON",
134218
- /* 314 */ "nmnum ::= DELETE",
134219
- /* 315 */ "nmnum ::= DEFAULT",
134220
- /* 316 */ "plus_num ::= INTEGER|FLOAT",
134221
- /* 317 */ "foreach_clause ::=",
134222
- /* 318 */ "foreach_clause ::= FOR EACH ROW",
134223
- /* 319 */ "trnm ::= nm",
134224
- /* 320 */ "tridxby ::=",
134225
- /* 321 */ "database_kw_opt ::= DATABASE",
134226
- /* 322 */ "database_kw_opt ::=",
134227
- /* 323 */ "kwcolumn_opt ::=",
134228
- /* 324 */ "kwcolumn_opt ::= COLUMNKW",
134229
- /* 325 */ "vtabarglist ::= vtabarg",
134230
- /* 326 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
134231
- /* 327 */ "vtabarg ::= vtabarg vtabargtoken",
134232
- /* 328 */ "anylist ::=",
134233
- /* 329 */ "anylist ::= anylist LP anylist RP",
134234
- /* 330 */ "anylist ::= anylist ANY",
134036
+ /* 158 */ "term ::= INTEGER",
134037
+ /* 159 */ "expr ::= VARIABLE",
134038
+ /* 160 */ "expr ::= expr COLLATE ID|STRING",
134039
+ /* 161 */ "expr ::= CAST LP expr AS typetoken RP",
134040
+ /* 162 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
134041
+ /* 163 */ "expr ::= ID|INDEXED LP STAR RP",
134042
+ /* 164 */ "term ::= CTIME_KW",
134043
+ /* 165 */ "expr ::= LP nexprlist COMMA expr RP",
134044
+ /* 166 */ "expr ::= expr AND expr",
134045
+ /* 167 */ "expr ::= expr OR expr",
134046
+ /* 168 */ "expr ::= expr LT|GT|GE|LE expr",
134047
+ /* 169 */ "expr ::= expr EQ|NE expr",
134048
+ /* 170 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
134049
+ /* 171 */ "expr ::= expr PLUS|MINUS expr",
134050
+ /* 172 */ "expr ::= expr STAR|SLASH|REM expr",
134051
+ /* 173 */ "expr ::= expr CONCAT expr",
134052
+ /* 174 */ "likeop ::= LIKE_KW|MATCH",
134053
+ /* 175 */ "likeop ::= NOT LIKE_KW|MATCH",
134054
+ /* 176 */ "expr ::= expr likeop expr",
134055
+ /* 177 */ "expr ::= expr likeop expr ESCAPE expr",
134056
+ /* 178 */ "expr ::= expr ISNULL|NOTNULL",
134057
+ /* 179 */ "expr ::= expr NOT NULL",
134058
+ /* 180 */ "expr ::= expr IS expr",
134059
+ /* 181 */ "expr ::= expr IS NOT expr",
134060
+ /* 182 */ "expr ::= NOT expr",
134061
+ /* 183 */ "expr ::= BITNOT expr",
134062
+ /* 184 */ "expr ::= MINUS expr",
134063
+ /* 185 */ "expr ::= PLUS expr",
134064
+ /* 186 */ "between_op ::= BETWEEN",
134065
+ /* 187 */ "between_op ::= NOT BETWEEN",
134066
+ /* 188 */ "expr ::= expr between_op expr AND expr",
134067
+ /* 189 */ "in_op ::= IN",
134068
+ /* 190 */ "in_op ::= NOT IN",
134069
+ /* 191 */ "expr ::= expr in_op LP exprlist RP",
134070
+ /* 192 */ "expr ::= LP select RP",
134071
+ /* 193 */ "expr ::= expr in_op LP select RP",
134072
+ /* 194 */ "expr ::= expr in_op nm dbnm paren_exprlist",
134073
+ /* 195 */ "expr ::= EXISTS LP select RP",
134074
+ /* 196 */ "expr ::= CASE case_operand case_exprlist case_else END",
134075
+ /* 197 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
134076
+ /* 198 */ "case_exprlist ::= WHEN expr THEN expr",
134077
+ /* 199 */ "case_else ::= ELSE expr",
134078
+ /* 200 */ "case_else ::=",
134079
+ /* 201 */ "case_operand ::= expr",
134080
+ /* 202 */ "case_operand ::=",
134081
+ /* 203 */ "exprlist ::=",
134082
+ /* 204 */ "nexprlist ::= nexprlist COMMA expr",
134083
+ /* 205 */ "nexprlist ::= expr",
134084
+ /* 206 */ "paren_exprlist ::=",
134085
+ /* 207 */ "paren_exprlist ::= LP exprlist RP",
134086
+ /* 208 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
134087
+ /* 209 */ "uniqueflag ::= UNIQUE",
134088
+ /* 210 */ "uniqueflag ::=",
134089
+ /* 211 */ "eidlist_opt ::=",
134090
+ /* 212 */ "eidlist_opt ::= LP eidlist RP",
134091
+ /* 213 */ "eidlist ::= eidlist COMMA nm collate sortorder",
134092
+ /* 214 */ "eidlist ::= nm collate sortorder",
134093
+ /* 215 */ "collate ::=",
134094
+ /* 216 */ "collate ::= COLLATE ID|STRING",
134095
+ /* 217 */ "cmd ::= DROP INDEX ifexists fullname",
134096
+ /* 218 */ "cmd ::= VACUUM",
134097
+ /* 219 */ "cmd ::= VACUUM nm",
134098
+ /* 220 */ "cmd ::= PRAGMA nm dbnm",
134099
+ /* 221 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
134100
+ /* 222 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
134101
+ /* 223 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
134102
+ /* 224 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
134103
+ /* 225 */ "plus_num ::= PLUS INTEGER|FLOAT",
134104
+ /* 226 */ "minus_num ::= MINUS INTEGER|FLOAT",
134105
+ /* 227 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
134106
+ /* 228 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
134107
+ /* 229 */ "trigger_time ::= BEFORE",
134108
+ /* 230 */ "trigger_time ::= AFTER",
134109
+ /* 231 */ "trigger_time ::= INSTEAD OF",
134110
+ /* 232 */ "trigger_time ::=",
134111
+ /* 233 */ "trigger_event ::= DELETE|INSERT",
134112
+ /* 234 */ "trigger_event ::= UPDATE",
134113
+ /* 235 */ "trigger_event ::= UPDATE OF idlist",
134114
+ /* 236 */ "when_clause ::=",
134115
+ /* 237 */ "when_clause ::= WHEN expr",
134116
+ /* 238 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
134117
+ /* 239 */ "trigger_cmd_list ::= trigger_cmd SEMI",
134118
+ /* 240 */ "trnm ::= nm DOT nm",
134119
+ /* 241 */ "tridxby ::= INDEXED BY nm",
134120
+ /* 242 */ "tridxby ::= NOT INDEXED",
134121
+ /* 243 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt",
134122
+ /* 244 */ "trigger_cmd ::= insert_cmd INTO trnm idlist_opt select",
134123
+ /* 245 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt",
134124
+ /* 246 */ "trigger_cmd ::= select",
134125
+ /* 247 */ "expr ::= RAISE LP IGNORE RP",
134126
+ /* 248 */ "expr ::= RAISE LP raisetype COMMA nm RP",
134127
+ /* 249 */ "raisetype ::= ROLLBACK",
134128
+ /* 250 */ "raisetype ::= ABORT",
134129
+ /* 251 */ "raisetype ::= FAIL",
134130
+ /* 252 */ "cmd ::= DROP TRIGGER ifexists fullname",
134131
+ /* 253 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
134132
+ /* 254 */ "cmd ::= DETACH database_kw_opt expr",
134133
+ /* 255 */ "key_opt ::=",
134134
+ /* 256 */ "key_opt ::= KEY expr",
134135
+ /* 257 */ "cmd ::= REINDEX",
134136
+ /* 258 */ "cmd ::= REINDEX nm dbnm",
134137
+ /* 259 */ "cmd ::= ANALYZE",
134138
+ /* 260 */ "cmd ::= ANALYZE nm dbnm",
134139
+ /* 261 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
134140
+ /* 262 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
134141
+ /* 263 */ "add_column_fullname ::= fullname",
134142
+ /* 264 */ "cmd ::= create_vtab",
134143
+ /* 265 */ "cmd ::= create_vtab LP vtabarglist RP",
134144
+ /* 266 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
134145
+ /* 267 */ "vtabarg ::=",
134146
+ /* 268 */ "vtabargtoken ::= ANY",
134147
+ /* 269 */ "vtabargtoken ::= lp anylist RP",
134148
+ /* 270 */ "lp ::= LP",
134149
+ /* 271 */ "with ::=",
134150
+ /* 272 */ "with ::= WITH wqlist",
134151
+ /* 273 */ "with ::= WITH RECURSIVE wqlist",
134152
+ /* 274 */ "wqlist ::= nm eidlist_opt AS LP select RP",
134153
+ /* 275 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
134154
+ /* 276 */ "input ::= cmdlist",
134155
+ /* 277 */ "cmdlist ::= cmdlist ecmd",
134156
+ /* 278 */ "cmdlist ::= ecmd",
134157
+ /* 279 */ "ecmd ::= SEMI",
134158
+ /* 280 */ "ecmd ::= explain cmdx SEMI",
134159
+ /* 281 */ "explain ::=",
134160
+ /* 282 */ "trans_opt ::=",
134161
+ /* 283 */ "trans_opt ::= TRANSACTION",
134162
+ /* 284 */ "trans_opt ::= TRANSACTION nm",
134163
+ /* 285 */ "savepoint_opt ::= SAVEPOINT",
134164
+ /* 286 */ "savepoint_opt ::=",
134165
+ /* 287 */ "cmd ::= create_table create_table_args",
134166
+ /* 288 */ "columnlist ::= columnlist COMMA columnname carglist",
134167
+ /* 289 */ "columnlist ::= columnname carglist",
134168
+ /* 290 */ "nm ::= ID|INDEXED",
134169
+ /* 291 */ "nm ::= STRING",
134170
+ /* 292 */ "nm ::= JOIN_KW",
134171
+ /* 293 */ "typetoken ::= typename",
134172
+ /* 294 */ "typename ::= ID|STRING",
134173
+ /* 295 */ "signed ::= plus_num",
134174
+ /* 296 */ "signed ::= minus_num",
134175
+ /* 297 */ "carglist ::= carglist ccons",
134176
+ /* 298 */ "carglist ::=",
134177
+ /* 299 */ "ccons ::= NULL onconf",
134178
+ /* 300 */ "conslist_opt ::= COMMA conslist",
134179
+ /* 301 */ "conslist ::= conslist tconscomma tcons",
134180
+ /* 302 */ "conslist ::= tcons",
134181
+ /* 303 */ "tconscomma ::=",
134182
+ /* 304 */ "defer_subclause_opt ::= defer_subclause",
134183
+ /* 305 */ "resolvetype ::= raisetype",
134184
+ /* 306 */ "selectnowith ::= oneselect",
134185
+ /* 307 */ "oneselect ::= values",
134186
+ /* 308 */ "sclp ::= selcollist COMMA",
134187
+ /* 309 */ "as ::= ID|STRING",
134188
+ /* 310 */ "expr ::= term",
134189
+ /* 311 */ "exprlist ::= nexprlist",
134190
+ /* 312 */ "nmnum ::= plus_num",
134191
+ /* 313 */ "nmnum ::= nm",
134192
+ /* 314 */ "nmnum ::= ON",
134193
+ /* 315 */ "nmnum ::= DELETE",
134194
+ /* 316 */ "nmnum ::= DEFAULT",
134195
+ /* 317 */ "plus_num ::= INTEGER|FLOAT",
134196
+ /* 318 */ "foreach_clause ::=",
134197
+ /* 319 */ "foreach_clause ::= FOR EACH ROW",
134198
+ /* 320 */ "trnm ::= nm",
134199
+ /* 321 */ "tridxby ::=",
134200
+ /* 322 */ "database_kw_opt ::= DATABASE",
134201
+ /* 323 */ "database_kw_opt ::=",
134202
+ /* 324 */ "kwcolumn_opt ::=",
134203
+ /* 325 */ "kwcolumn_opt ::= COLUMNKW",
134204
+ /* 326 */ "vtabarglist ::= vtabarg",
134205
+ /* 327 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
134206
+ /* 328 */ "vtabarg ::= vtabarg vtabargtoken",
134207
+ /* 329 */ "anylist ::=",
134208
+ /* 330 */ "anylist ::= anylist LP anylist RP",
134209
+ /* 331 */ "anylist ::= anylist ANY",
134235134210
};
134236134211
#endif /* NDEBUG */
134237134212
134238134213
134239134214
#if YYSTACKDEPTH<=0
@@ -134811,10 +134786,11 @@
134811134786
{ 173, 1 },
134812134787
{ 173, 3 },
134813134788
{ 173, 5 },
134814134789
{ 172, 1 },
134815134790
{ 172, 1 },
134791
+ { 172, 1 },
134816134792
{ 173, 1 },
134817134793
{ 173, 3 },
134818134794
{ 173, 6 },
134819134795
{ 173, 5 },
134820134796
{ 173, 4 },
@@ -135105,11 +135081,11 @@
135105135081
case 42: /* autoinc ::= */ yytestcase(yyruleno==42);
135106135082
case 57: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==57);
135107135083
case 67: /* defer_subclause_opt ::= */ yytestcase(yyruleno==67);
135108135084
case 76: /* ifexists ::= */ yytestcase(yyruleno==76);
135109135085
case 90: /* distinct ::= */ yytestcase(yyruleno==90);
135110
- case 214: /* collate ::= */ yytestcase(yyruleno==214);
135086
+ case 215: /* collate ::= */ yytestcase(yyruleno==215);
135111135087
{yymsp[1].minor.yy194 = 0;}
135112135088
break;
135113135089
case 17: /* ifnotexists ::= IF NOT EXISTS */
135114135090
{yymsp[-2].minor.yy194 = 1;}
135115135091
break;
@@ -135249,13 +135225,13 @@
135249135225
case 144: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==144);
135250135226
{yymsp[-1].minor.yy194 = yymsp[0].minor.yy194;}
135251135227
break;
135252135228
case 58: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
135253135229
case 75: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==75);
135254
- case 186: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==186);
135255
- case 189: /* in_op ::= NOT IN */ yytestcase(yyruleno==189);
135256
- case 215: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==215);
135230
+ case 187: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==187);
135231
+ case 190: /* in_op ::= NOT IN */ yytestcase(yyruleno==190);
135232
+ case 216: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==216);
135257135233
{yymsp[-1].minor.yy194 = 1;}
135258135234
break;
135259135235
case 59: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
135260135236
{yymsp[-1].minor.yy194 = 0;}
135261135237
break;
@@ -135415,13 +135391,13 @@
135415135391
{yymsp[0].minor.yy194 = SF_All;}
135416135392
break;
135417135393
case 91: /* sclp ::= */
135418135394
case 119: /* orderby_opt ::= */ yytestcase(yyruleno==119);
135419135395
case 126: /* groupby_opt ::= */ yytestcase(yyruleno==126);
135420
- case 202: /* exprlist ::= */ yytestcase(yyruleno==202);
135421
- case 205: /* paren_exprlist ::= */ yytestcase(yyruleno==205);
135422
- case 210: /* eidlist_opt ::= */ yytestcase(yyruleno==210);
135396
+ case 203: /* exprlist ::= */ yytestcase(yyruleno==203);
135397
+ case 206: /* paren_exprlist ::= */ yytestcase(yyruleno==206);
135398
+ case 211: /* eidlist_opt ::= */ yytestcase(yyruleno==211);
135423135399
{yymsp[1].minor.yy148 = 0;}
135424135400
break;
135425135401
case 92: /* selcollist ::= sclp expr as */
135426135402
{
135427135403
yymsp[-2].minor.yy148 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy148, yymsp[-1].minor.yy190.pExpr);
@@ -135435,20 +135411,20 @@
135435135411
yymsp[-1].minor.yy148 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy148, p);
135436135412
}
135437135413
break;
135438135414
case 94: /* selcollist ::= sclp nm DOT STAR */
135439135415
{
135440
- Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0, &yymsp[0].minor.yy0);
135416
+ Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0, 0);
135441135417
Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
135442135418
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
135443135419
yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy148, pDot);
135444135420
}
135445135421
break;
135446135422
case 95: /* as ::= AS nm */
135447135423
case 106: /* dbnm ::= DOT nm */ yytestcase(yyruleno==106);
135448
- case 224: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==224);
135449
- case 225: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==225);
135424
+ case 225: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==225);
135425
+ case 226: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==226);
135450135426
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
135451135427
break;
135452135428
case 97: /* from ::= */
135453135429
{yymsp[1].minor.yy185 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy185));}
135454135430
break;
@@ -135527,18 +135503,18 @@
135527135503
{yymsp[-3].minor.yy194 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
135528135504
break;
135529135505
case 112: /* on_opt ::= ON expr */
135530135506
case 129: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==129);
135531135507
case 136: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==136);
135532
- case 198: /* case_else ::= ELSE expr */ yytestcase(yyruleno==198);
135508
+ case 199: /* case_else ::= ELSE expr */ yytestcase(yyruleno==199);
135533135509
{yymsp[-1].minor.yy72 = yymsp[0].minor.yy190.pExpr;}
135534135510
break;
135535135511
case 113: /* on_opt ::= */
135536135512
case 128: /* having_opt ::= */ yytestcase(yyruleno==128);
135537135513
case 135: /* where_opt ::= */ yytestcase(yyruleno==135);
135538
- case 199: /* case_else ::= */ yytestcase(yyruleno==199);
135539
- case 201: /* case_operand ::= */ yytestcase(yyruleno==201);
135514
+ case 200: /* case_else ::= */ yytestcase(yyruleno==200);
135515
+ case 202: /* case_operand ::= */ yytestcase(yyruleno==202);
135540135516
{yymsp[1].minor.yy72 = 0;}
135541135517
break;
135542135518
case 115: /* indexed_opt ::= INDEXED BY nm */
135543135519
{yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
135544135520
break;
@@ -135650,41 +135626,51 @@
135650135626
break;
135651135627
case 150: /* expr ::= LP expr RP */
135652135628
{spanSet(&yymsp[-2].minor.yy190,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-B*/ yymsp[-2].minor.yy190.pExpr = yymsp[-1].minor.yy190.pExpr;}
135653135629
break;
135654135630
case 151: /* term ::= NULL */
135655
- case 156: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==156);
135631
+ case 156: /* term ::= FLOAT|BLOB */ yytestcase(yyruleno==156);
135656135632
case 157: /* term ::= STRING */ yytestcase(yyruleno==157);
135657135633
{spanExpr(&yymsp[0].minor.yy190,pParse,yymsp[0].major,yymsp[0].minor.yy0);/*A-overwrites-X*/}
135658135634
break;
135659135635
case 152: /* expr ::= ID|INDEXED */
135660135636
case 153: /* expr ::= JOIN_KW */ yytestcase(yyruleno==153);
135661135637
{spanExpr(&yymsp[0].minor.yy190,pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
135662135638
break;
135663135639
case 154: /* expr ::= nm DOT nm */
135664135640
{
135665
- Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
135666
- Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
135641
+ Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
135642
+ Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
135667135643
spanSet(&yymsp[-2].minor.yy190,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
135668135644
yymsp[-2].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
135669135645
}
135670135646
break;
135671135647
case 155: /* expr ::= nm DOT nm DOT nm */
135672135648
{
135673
- Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
135674
- Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
135675
- Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
135649
+ Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
135650
+ Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
135651
+ Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
135676135652
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
135677135653
spanSet(&yymsp[-4].minor.yy190,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
135678135654
yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
135679135655
}
135680135656
break;
135681
- case 158: /* expr ::= VARIABLE */
135657
+ case 158: /* term ::= INTEGER */
135658
+{
135659
+ yylhsminor.yy190.pExpr = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
135660
+ yylhsminor.yy190.zStart = yymsp[0].minor.yy0.z;
135661
+ yylhsminor.yy190.zEnd = yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n;
135662
+ if( yylhsminor.yy190.pExpr ) yylhsminor.yy190.pExpr->flags |= EP_Leaf;
135663
+}
135664
+ yymsp[0].minor.yy190 = yylhsminor.yy190;
135665
+ break;
135666
+ case 159: /* expr ::= VARIABLE */
135682135667
{
135683135668
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
135669
+ u32 n = yymsp[0].minor.yy0.n;
135684135670
spanExpr(&yymsp[0].minor.yy190, pParse, TK_VARIABLE, yymsp[0].minor.yy0);
135685
- sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy190.pExpr);
135671
+ sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy190.pExpr, n);
135686135672
}else{
135687135673
/* When doing a nested parse, one can include terms in an expression
135688135674
** that look like this: #1 #2 ... These terms refer to registers
135689135675
** in the virtual machine. #N is the N-th register. */
135690135676
Token t = yymsp[0].minor.yy0; /*A-overwrites-X*/
@@ -135692,29 +135678,29 @@
135692135678
spanSet(&yymsp[0].minor.yy190, &t, &t);
135693135679
if( pParse->nested==0 ){
135694135680
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
135695135681
yymsp[0].minor.yy190.pExpr = 0;
135696135682
}else{
135697
- yymsp[0].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &t);
135683
+ yymsp[0].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, 0);
135698135684
if( yymsp[0].minor.yy190.pExpr ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy190.pExpr->iTable);
135699135685
}
135700135686
}
135701135687
}
135702135688
break;
135703
- case 159: /* expr ::= expr COLLATE ID|STRING */
135689
+ case 160: /* expr ::= expr COLLATE ID|STRING */
135704135690
{
135705135691
yymsp[-2].minor.yy190.pExpr = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy190.pExpr, &yymsp[0].minor.yy0, 1);
135706135692
yymsp[-2].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
135707135693
}
135708135694
break;
135709
- case 160: /* expr ::= CAST LP expr AS typetoken RP */
135695
+ case 161: /* expr ::= CAST LP expr AS typetoken RP */
135710135696
{
135711135697
spanSet(&yymsp[-5].minor.yy190,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
135712135698
yymsp[-5].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy190.pExpr, 0, &yymsp[-1].minor.yy0);
135713135699
}
135714135700
break;
135715
- case 161: /* expr ::= ID|INDEXED LP distinct exprlist RP */
135701
+ case 162: /* expr ::= ID|INDEXED LP distinct exprlist RP */
135716135702
{
135717135703
if( yymsp[-1].minor.yy148 && yymsp[-1].minor.yy148->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
135718135704
sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
135719135705
}
135720135706
yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy148, &yymsp[-4].minor.yy0);
@@ -135723,25 +135709,25 @@
135723135709
yylhsminor.yy190.pExpr->flags |= EP_Distinct;
135724135710
}
135725135711
}
135726135712
yymsp[-4].minor.yy190 = yylhsminor.yy190;
135727135713
break;
135728
- case 162: /* expr ::= ID|INDEXED LP STAR RP */
135714
+ case 163: /* expr ::= ID|INDEXED LP STAR RP */
135729135715
{
135730135716
yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
135731135717
spanSet(&yylhsminor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
135732135718
}
135733135719
yymsp[-3].minor.yy190 = yylhsminor.yy190;
135734135720
break;
135735
- case 163: /* term ::= CTIME_KW */
135721
+ case 164: /* term ::= CTIME_KW */
135736135722
{
135737135723
yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
135738135724
spanSet(&yylhsminor.yy190, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
135739135725
}
135740135726
yymsp[0].minor.yy190 = yylhsminor.yy190;
135741135727
break;
135742
- case 164: /* expr ::= LP nexprlist COMMA expr RP */
135728
+ case 165: /* expr ::= LP nexprlist COMMA expr RP */
135743135729
{
135744135730
ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy148, yymsp[-1].minor.yy190.pExpr);
135745135731
yylhsminor.yy190.pExpr = sqlite3PExpr(pParse, TK_VECTOR, 0, 0, 0);
135746135732
if( yylhsminor.yy190.pExpr ){
135747135733
yylhsminor.yy190.pExpr->x.pList = pList;
@@ -135750,82 +135736,86 @@
135750135736
sqlite3ExprListDelete(pParse->db, pList);
135751135737
}
135752135738
}
135753135739
yymsp[-4].minor.yy190 = yylhsminor.yy190;
135754135740
break;
135755
- case 165: /* expr ::= expr AND expr */
135756
- case 166: /* expr ::= expr OR expr */ yytestcase(yyruleno==166);
135757
- case 167: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==167);
135758
- case 168: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==168);
135759
- case 169: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==169);
135760
- case 170: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==170);
135761
- case 171: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==171);
135762
- case 172: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==172);
135741
+ case 166: /* expr ::= expr AND expr */
135742
+ case 167: /* expr ::= expr OR expr */ yytestcase(yyruleno==167);
135743
+ case 168: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==168);
135744
+ case 169: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==169);
135745
+ case 170: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==170);
135746
+ case 171: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==171);
135747
+ case 172: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==172);
135748
+ case 173: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==173);
135763135749
{spanBinaryExpr(pParse,yymsp[-1].major,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy190);}
135764135750
break;
135765
- case 173: /* likeop ::= LIKE_KW|MATCH */
135766
-{yymsp[0].minor.yy392.eOperator = yymsp[0].minor.yy0; yymsp[0].minor.yy392.bNot = 0;/*A-overwrites-X*/}
135751
+ case 174: /* likeop ::= LIKE_KW|MATCH */
135752
+{yymsp[0].minor.yy0=yymsp[0].minor.yy0;/*A-overwrites-X*/}
135767135753
break;
135768
- case 174: /* likeop ::= NOT LIKE_KW|MATCH */
135769
-{yymsp[-1].minor.yy392.eOperator = yymsp[0].minor.yy0; yymsp[-1].minor.yy392.bNot = 1;}
135754
+ case 175: /* likeop ::= NOT LIKE_KW|MATCH */
135755
+{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
135770135756
break;
135771
- case 175: /* expr ::= expr likeop expr */
135757
+ case 176: /* expr ::= expr likeop expr */
135772135758
{
135773135759
ExprList *pList;
135760
+ int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
135761
+ yymsp[-1].minor.yy0.n &= 0x7fffffff;
135774135762
pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy190.pExpr);
135775135763
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy190.pExpr);
135776
- yymsp[-2].minor.yy190.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy392.eOperator);
135777
- exprNot(pParse, yymsp[-1].minor.yy392.bNot, &yymsp[-2].minor.yy190);
135764
+ yymsp[-2].minor.yy190.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0);
135765
+ exprNot(pParse, bNot, &yymsp[-2].minor.yy190);
135778135766
yymsp[-2].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
135779135767
if( yymsp[-2].minor.yy190.pExpr ) yymsp[-2].minor.yy190.pExpr->flags |= EP_InfixFunc;
135780135768
}
135781135769
break;
135782
- case 176: /* expr ::= expr likeop expr ESCAPE expr */
135770
+ case 177: /* expr ::= expr likeop expr ESCAPE expr */
135783135771
{
135784135772
ExprList *pList;
135773
+ int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
135774
+ yymsp[-3].minor.yy0.n &= 0x7fffffff;
135785135775
pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
135786135776
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy190.pExpr);
135787135777
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy190.pExpr);
135788
- yymsp[-4].minor.yy190.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy392.eOperator);
135789
- exprNot(pParse, yymsp[-3].minor.yy392.bNot, &yymsp[-4].minor.yy190);
135778
+ yymsp[-4].minor.yy190.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0);
135779
+ exprNot(pParse, bNot, &yymsp[-4].minor.yy190);
135790135780
yymsp[-4].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
135791135781
if( yymsp[-4].minor.yy190.pExpr ) yymsp[-4].minor.yy190.pExpr->flags |= EP_InfixFunc;
135792135782
}
135793135783
break;
135794
- case 177: /* expr ::= expr ISNULL|NOTNULL */
135784
+ case 178: /* expr ::= expr ISNULL|NOTNULL */
135795135785
{spanUnaryPostfix(pParse,yymsp[0].major,&yymsp[-1].minor.yy190,&yymsp[0].minor.yy0);}
135796135786
break;
135797
- case 178: /* expr ::= expr NOT NULL */
135787
+ case 179: /* expr ::= expr NOT NULL */
135798135788
{spanUnaryPostfix(pParse,TK_NOTNULL,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy0);}
135799135789
break;
135800
- case 179: /* expr ::= expr IS expr */
135790
+ case 180: /* expr ::= expr IS expr */
135801135791
{
135802135792
spanBinaryExpr(pParse,TK_IS,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy190);
135803135793
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy190.pExpr, yymsp[-2].minor.yy190.pExpr, TK_ISNULL);
135804135794
}
135805135795
break;
135806
- case 180: /* expr ::= expr IS NOT expr */
135796
+ case 181: /* expr ::= expr IS NOT expr */
135807135797
{
135808135798
spanBinaryExpr(pParse,TK_ISNOT,&yymsp[-3].minor.yy190,&yymsp[0].minor.yy190);
135809135799
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy190.pExpr, yymsp[-3].minor.yy190.pExpr, TK_NOTNULL);
135810135800
}
135811135801
break;
135812
- case 181: /* expr ::= NOT expr */
135813
- case 182: /* expr ::= BITNOT expr */ yytestcase(yyruleno==182);
135802
+ case 182: /* expr ::= NOT expr */
135803
+ case 183: /* expr ::= BITNOT expr */ yytestcase(yyruleno==183);
135814135804
{spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,yymsp[-1].major,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
135815135805
break;
135816
- case 183: /* expr ::= MINUS expr */
135806
+ case 184: /* expr ::= MINUS expr */
135817135807
{spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,TK_UMINUS,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
135818135808
break;
135819
- case 184: /* expr ::= PLUS expr */
135809
+ case 185: /* expr ::= PLUS expr */
135820135810
{spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,TK_UPLUS,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
135821135811
break;
135822
- case 185: /* between_op ::= BETWEEN */
135823
- case 188: /* in_op ::= IN */ yytestcase(yyruleno==188);
135812
+ case 186: /* between_op ::= BETWEEN */
135813
+ case 189: /* in_op ::= IN */ yytestcase(yyruleno==189);
135824135814
{yymsp[0].minor.yy194 = 0;}
135825135815
break;
135826
- case 187: /* expr ::= expr between_op expr AND expr */
135816
+ case 188: /* expr ::= expr between_op expr AND expr */
135827135817
{
135828135818
ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
135829135819
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy190.pExpr);
135830135820
yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy190.pExpr, 0, 0);
135831135821
if( yymsp[-4].minor.yy190.pExpr ){
@@ -135835,11 +135825,11 @@
135835135825
}
135836135826
exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135837135827
yymsp[-4].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
135838135828
}
135839135829
break;
135840
- case 190: /* expr ::= expr in_op LP exprlist RP */
135830
+ case 191: /* expr ::= expr in_op LP exprlist RP */
135841135831
{
135842135832
if( yymsp[-1].minor.yy148==0 ){
135843135833
/* Expressions of the form
135844135834
**
135845135835
** expr1 IN ()
@@ -135888,26 +135878,26 @@
135888135878
exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135889135879
}
135890135880
yymsp[-4].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
135891135881
}
135892135882
break;
135893
- case 191: /* expr ::= LP select RP */
135883
+ case 192: /* expr ::= LP select RP */
135894135884
{
135895135885
spanSet(&yymsp[-2].minor.yy190,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-B*/
135896135886
yymsp[-2].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
135897135887
sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy190.pExpr, yymsp[-1].minor.yy243);
135898135888
}
135899135889
break;
135900
- case 192: /* expr ::= expr in_op LP select RP */
135890
+ case 193: /* expr ::= expr in_op LP select RP */
135901135891
{
135902135892
yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy190.pExpr, 0, 0);
135903135893
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy190.pExpr, yymsp[-1].minor.yy243);
135904135894
exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135905135895
yymsp[-4].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
135906135896
}
135907135897
break;
135908
- case 193: /* expr ::= expr in_op nm dbnm paren_exprlist */
135898
+ case 194: /* expr ::= expr in_op nm dbnm paren_exprlist */
135909135899
{
135910135900
SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
135911135901
Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
135912135902
if( yymsp[0].minor.yy148 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy148);
135913135903
yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy190.pExpr, 0, 0);
@@ -135914,19 +135904,19 @@
135914135904
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy190.pExpr, pSelect);
135915135905
exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135916135906
yymsp[-4].minor.yy190.zEnd = yymsp[-1].minor.yy0.z ? &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n] : &yymsp[-2].minor.yy0.z[yymsp[-2].minor.yy0.n];
135917135907
}
135918135908
break;
135919
- case 194: /* expr ::= EXISTS LP select RP */
135909
+ case 195: /* expr ::= EXISTS LP select RP */
135920135910
{
135921135911
Expr *p;
135922135912
spanSet(&yymsp[-3].minor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-B*/
135923135913
p = yymsp[-3].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
135924135914
sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy243);
135925135915
}
135926135916
break;
135927
- case 195: /* expr ::= CASE case_operand case_exprlist case_else END */
135917
+ case 196: /* expr ::= CASE case_operand case_exprlist case_else END */
135928135918
{
135929135919
spanSet(&yymsp[-4].minor.yy190,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-C*/
135930135920
yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy72, 0, 0);
135931135921
if( yymsp[-4].minor.yy190.pExpr ){
135932135922
yymsp[-4].minor.yy190.pExpr->x.pList = yymsp[-1].minor.yy72 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy148,yymsp[-1].minor.yy72) : yymsp[-2].minor.yy148;
@@ -135935,334 +135925,334 @@
135935135925
sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy148);
135936135926
sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy72);
135937135927
}
135938135928
}
135939135929
break;
135940
- case 196: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
135930
+ case 197: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
135941135931
{
135942135932
yymsp[-4].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy148, yymsp[-2].minor.yy190.pExpr);
135943135933
yymsp[-4].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy148, yymsp[0].minor.yy190.pExpr);
135944135934
}
135945135935
break;
135946
- case 197: /* case_exprlist ::= WHEN expr THEN expr */
135936
+ case 198: /* case_exprlist ::= WHEN expr THEN expr */
135947135937
{
135948135938
yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
135949135939
yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy148, yymsp[0].minor.yy190.pExpr);
135950135940
}
135951135941
break;
135952
- case 200: /* case_operand ::= expr */
135942
+ case 201: /* case_operand ::= expr */
135953135943
{yymsp[0].minor.yy72 = yymsp[0].minor.yy190.pExpr; /*A-overwrites-X*/}
135954135944
break;
135955
- case 203: /* nexprlist ::= nexprlist COMMA expr */
135945
+ case 204: /* nexprlist ::= nexprlist COMMA expr */
135956135946
{yymsp[-2].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy148,yymsp[0].minor.yy190.pExpr);}
135957135947
break;
135958
- case 204: /* nexprlist ::= expr */
135948
+ case 205: /* nexprlist ::= expr */
135959135949
{yymsp[0].minor.yy148 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy190.pExpr); /*A-overwrites-Y*/}
135960135950
break;
135961
- case 206: /* paren_exprlist ::= LP exprlist RP */
135962
- case 211: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==211);
135951
+ case 207: /* paren_exprlist ::= LP exprlist RP */
135952
+ case 212: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==212);
135963135953
{yymsp[-2].minor.yy148 = yymsp[-1].minor.yy148;}
135964135954
break;
135965
- case 207: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
135955
+ case 208: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
135966135956
{
135967135957
sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
135968135958
sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy148, yymsp[-10].minor.yy194,
135969135959
&yymsp[-11].minor.yy0, yymsp[0].minor.yy72, SQLITE_SO_ASC, yymsp[-8].minor.yy194, SQLITE_IDXTYPE_APPDEF);
135970135960
}
135971135961
break;
135972
- case 208: /* uniqueflag ::= UNIQUE */
135973
- case 249: /* raisetype ::= ABORT */ yytestcase(yyruleno==249);
135962
+ case 209: /* uniqueflag ::= UNIQUE */
135963
+ case 250: /* raisetype ::= ABORT */ yytestcase(yyruleno==250);
135974135964
{yymsp[0].minor.yy194 = OE_Abort;}
135975135965
break;
135976
- case 209: /* uniqueflag ::= */
135966
+ case 210: /* uniqueflag ::= */
135977135967
{yymsp[1].minor.yy194 = OE_None;}
135978135968
break;
135979
- case 212: /* eidlist ::= eidlist COMMA nm collate sortorder */
135969
+ case 213: /* eidlist ::= eidlist COMMA nm collate sortorder */
135980135970
{
135981135971
yymsp[-4].minor.yy148 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy148, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy194, yymsp[0].minor.yy194);
135982135972
}
135983135973
break;
135984
- case 213: /* eidlist ::= nm collate sortorder */
135974
+ case 214: /* eidlist ::= nm collate sortorder */
135985135975
{
135986135976
yymsp[-2].minor.yy148 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy194, yymsp[0].minor.yy194); /*A-overwrites-Y*/
135987135977
}
135988135978
break;
135989
- case 216: /* cmd ::= DROP INDEX ifexists fullname */
135979
+ case 217: /* cmd ::= DROP INDEX ifexists fullname */
135990135980
{sqlite3DropIndex(pParse, yymsp[0].minor.yy185, yymsp[-1].minor.yy194);}
135991135981
break;
135992
- case 217: /* cmd ::= VACUUM */
135982
+ case 218: /* cmd ::= VACUUM */
135993135983
{sqlite3Vacuum(pParse,0);}
135994135984
break;
135995
- case 218: /* cmd ::= VACUUM nm */
135985
+ case 219: /* cmd ::= VACUUM nm */
135996135986
{sqlite3Vacuum(pParse,&yymsp[0].minor.yy0);}
135997135987
break;
135998
- case 219: /* cmd ::= PRAGMA nm dbnm */
135988
+ case 220: /* cmd ::= PRAGMA nm dbnm */
135999135989
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
136000135990
break;
136001
- case 220: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
135991
+ case 221: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
136002135992
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
136003135993
break;
136004
- case 221: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
135994
+ case 222: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
136005135995
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
136006135996
break;
136007
- case 222: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
135997
+ case 223: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
136008135998
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
136009135999
break;
136010
- case 223: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
136000
+ case 224: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
136011136001
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
136012136002
break;
136013
- case 226: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
136003
+ case 227: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
136014136004
{
136015136005
Token all;
136016136006
all.z = yymsp[-3].minor.yy0.z;
136017136007
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
136018136008
sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy145, &all);
136019136009
}
136020136010
break;
136021
- case 227: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
136011
+ case 228: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
136022136012
{
136023136013
sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy194, yymsp[-4].minor.yy332.a, yymsp[-4].minor.yy332.b, yymsp[-2].minor.yy185, yymsp[0].minor.yy72, yymsp[-10].minor.yy194, yymsp[-8].minor.yy194);
136024136014
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
136025136015
}
136026136016
break;
136027
- case 228: /* trigger_time ::= BEFORE */
136017
+ case 229: /* trigger_time ::= BEFORE */
136028136018
{ yymsp[0].minor.yy194 = TK_BEFORE; }
136029136019
break;
136030
- case 229: /* trigger_time ::= AFTER */
136020
+ case 230: /* trigger_time ::= AFTER */
136031136021
{ yymsp[0].minor.yy194 = TK_AFTER; }
136032136022
break;
136033
- case 230: /* trigger_time ::= INSTEAD OF */
136023
+ case 231: /* trigger_time ::= INSTEAD OF */
136034136024
{ yymsp[-1].minor.yy194 = TK_INSTEAD;}
136035136025
break;
136036
- case 231: /* trigger_time ::= */
136026
+ case 232: /* trigger_time ::= */
136037136027
{ yymsp[1].minor.yy194 = TK_BEFORE; }
136038136028
break;
136039
- case 232: /* trigger_event ::= DELETE|INSERT */
136040
- case 233: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==233);
136029
+ case 233: /* trigger_event ::= DELETE|INSERT */
136030
+ case 234: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==234);
136041136031
{yymsp[0].minor.yy332.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy332.b = 0;}
136042136032
break;
136043
- case 234: /* trigger_event ::= UPDATE OF idlist */
136033
+ case 235: /* trigger_event ::= UPDATE OF idlist */
136044136034
{yymsp[-2].minor.yy332.a = TK_UPDATE; yymsp[-2].minor.yy332.b = yymsp[0].minor.yy254;}
136045136035
break;
136046
- case 235: /* when_clause ::= */
136047
- case 254: /* key_opt ::= */ yytestcase(yyruleno==254);
136036
+ case 236: /* when_clause ::= */
136037
+ case 255: /* key_opt ::= */ yytestcase(yyruleno==255);
136048136038
{ yymsp[1].minor.yy72 = 0; }
136049136039
break;
136050
- case 236: /* when_clause ::= WHEN expr */
136051
- case 255: /* key_opt ::= KEY expr */ yytestcase(yyruleno==255);
136040
+ case 237: /* when_clause ::= WHEN expr */
136041
+ case 256: /* key_opt ::= KEY expr */ yytestcase(yyruleno==256);
136052136042
{ yymsp[-1].minor.yy72 = yymsp[0].minor.yy190.pExpr; }
136053136043
break;
136054
- case 237: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
136044
+ case 238: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
136055136045
{
136056136046
assert( yymsp[-2].minor.yy145!=0 );
136057136047
yymsp[-2].minor.yy145->pLast->pNext = yymsp[-1].minor.yy145;
136058136048
yymsp[-2].minor.yy145->pLast = yymsp[-1].minor.yy145;
136059136049
}
136060136050
break;
136061
- case 238: /* trigger_cmd_list ::= trigger_cmd SEMI */
136051
+ case 239: /* trigger_cmd_list ::= trigger_cmd SEMI */
136062136052
{
136063136053
assert( yymsp[-1].minor.yy145!=0 );
136064136054
yymsp[-1].minor.yy145->pLast = yymsp[-1].minor.yy145;
136065136055
}
136066136056
break;
136067
- case 239: /* trnm ::= nm DOT nm */
136057
+ case 240: /* trnm ::= nm DOT nm */
136068136058
{
136069136059
yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
136070136060
sqlite3ErrorMsg(pParse,
136071136061
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
136072136062
"statements within triggers");
136073136063
}
136074136064
break;
136075
- case 240: /* tridxby ::= INDEXED BY nm */
136065
+ case 241: /* tridxby ::= INDEXED BY nm */
136076136066
{
136077136067
sqlite3ErrorMsg(pParse,
136078136068
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
136079136069
"within triggers");
136080136070
}
136081136071
break;
136082
- case 241: /* tridxby ::= NOT INDEXED */
136072
+ case 242: /* tridxby ::= NOT INDEXED */
136083136073
{
136084136074
sqlite3ErrorMsg(pParse,
136085136075
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
136086136076
"within triggers");
136087136077
}
136088136078
break;
136089
- case 242: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
136079
+ case 243: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
136090136080
{yymsp[-6].minor.yy145 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy148, yymsp[0].minor.yy72, yymsp[-5].minor.yy194);}
136091136081
break;
136092
- case 243: /* trigger_cmd ::= insert_cmd INTO trnm idlist_opt select */
136082
+ case 244: /* trigger_cmd ::= insert_cmd INTO trnm idlist_opt select */
136093136083
{yymsp[-4].minor.yy145 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy254, yymsp[0].minor.yy243, yymsp[-4].minor.yy194);/*A-overwrites-R*/}
136094136084
break;
136095
- case 244: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
136085
+ case 245: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
136096136086
{yymsp[-4].minor.yy145 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy72);}
136097136087
break;
136098
- case 245: /* trigger_cmd ::= select */
136088
+ case 246: /* trigger_cmd ::= select */
136099136089
{yymsp[0].minor.yy145 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy243); /*A-overwrites-X*/}
136100136090
break;
136101
- case 246: /* expr ::= RAISE LP IGNORE RP */
136091
+ case 247: /* expr ::= RAISE LP IGNORE RP */
136102136092
{
136103136093
spanSet(&yymsp[-3].minor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
136104136094
yymsp[-3].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
136105136095
if( yymsp[-3].minor.yy190.pExpr ){
136106136096
yymsp[-3].minor.yy190.pExpr->affinity = OE_Ignore;
136107136097
}
136108136098
}
136109136099
break;
136110
- case 247: /* expr ::= RAISE LP raisetype COMMA nm RP */
136100
+ case 248: /* expr ::= RAISE LP raisetype COMMA nm RP */
136111136101
{
136112136102
spanSet(&yymsp[-5].minor.yy190,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
136113136103
yymsp[-5].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
136114136104
if( yymsp[-5].minor.yy190.pExpr ) {
136115136105
yymsp[-5].minor.yy190.pExpr->affinity = (char)yymsp[-3].minor.yy194;
136116136106
}
136117136107
}
136118136108
break;
136119
- case 248: /* raisetype ::= ROLLBACK */
136109
+ case 249: /* raisetype ::= ROLLBACK */
136120136110
{yymsp[0].minor.yy194 = OE_Rollback;}
136121136111
break;
136122
- case 250: /* raisetype ::= FAIL */
136112
+ case 251: /* raisetype ::= FAIL */
136123136113
{yymsp[0].minor.yy194 = OE_Fail;}
136124136114
break;
136125
- case 251: /* cmd ::= DROP TRIGGER ifexists fullname */
136115
+ case 252: /* cmd ::= DROP TRIGGER ifexists fullname */
136126136116
{
136127136117
sqlite3DropTrigger(pParse,yymsp[0].minor.yy185,yymsp[-1].minor.yy194);
136128136118
}
136129136119
break;
136130
- case 252: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
136120
+ case 253: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
136131136121
{
136132136122
sqlite3Attach(pParse, yymsp[-3].minor.yy190.pExpr, yymsp[-1].minor.yy190.pExpr, yymsp[0].minor.yy72);
136133136123
}
136134136124
break;
136135
- case 253: /* cmd ::= DETACH database_kw_opt expr */
136125
+ case 254: /* cmd ::= DETACH database_kw_opt expr */
136136136126
{
136137136127
sqlite3Detach(pParse, yymsp[0].minor.yy190.pExpr);
136138136128
}
136139136129
break;
136140
- case 256: /* cmd ::= REINDEX */
136130
+ case 257: /* cmd ::= REINDEX */
136141136131
{sqlite3Reindex(pParse, 0, 0);}
136142136132
break;
136143
- case 257: /* cmd ::= REINDEX nm dbnm */
136133
+ case 258: /* cmd ::= REINDEX nm dbnm */
136144136134
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
136145136135
break;
136146
- case 258: /* cmd ::= ANALYZE */
136136
+ case 259: /* cmd ::= ANALYZE */
136147136137
{sqlite3Analyze(pParse, 0, 0);}
136148136138
break;
136149
- case 259: /* cmd ::= ANALYZE nm dbnm */
136139
+ case 260: /* cmd ::= ANALYZE nm dbnm */
136150136140
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
136151136141
break;
136152
- case 260: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
136142
+ case 261: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
136153136143
{
136154136144
sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy185,&yymsp[0].minor.yy0);
136155136145
}
136156136146
break;
136157
- case 261: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
136147
+ case 262: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
136158136148
{
136159136149
yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
136160136150
sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
136161136151
}
136162136152
break;
136163
- case 262: /* add_column_fullname ::= fullname */
136153
+ case 263: /* add_column_fullname ::= fullname */
136164136154
{
136165136155
disableLookaside(pParse);
136166136156
sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy185);
136167136157
}
136168136158
break;
136169
- case 263: /* cmd ::= create_vtab */
136159
+ case 264: /* cmd ::= create_vtab */
136170136160
{sqlite3VtabFinishParse(pParse,0);}
136171136161
break;
136172
- case 264: /* cmd ::= create_vtab LP vtabarglist RP */
136162
+ case 265: /* cmd ::= create_vtab LP vtabarglist RP */
136173136163
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
136174136164
break;
136175
- case 265: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
136165
+ case 266: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
136176136166
{
136177136167
sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy194);
136178136168
}
136179136169
break;
136180
- case 266: /* vtabarg ::= */
136170
+ case 267: /* vtabarg ::= */
136181136171
{sqlite3VtabArgInit(pParse);}
136182136172
break;
136183
- case 267: /* vtabargtoken ::= ANY */
136184
- case 268: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==268);
136185
- case 269: /* lp ::= LP */ yytestcase(yyruleno==269);
136173
+ case 268: /* vtabargtoken ::= ANY */
136174
+ case 269: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==269);
136175
+ case 270: /* lp ::= LP */ yytestcase(yyruleno==270);
136186136176
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
136187136177
break;
136188
- case 270: /* with ::= */
136178
+ case 271: /* with ::= */
136189136179
{yymsp[1].minor.yy285 = 0;}
136190136180
break;
136191
- case 271: /* with ::= WITH wqlist */
136181
+ case 272: /* with ::= WITH wqlist */
136192136182
{ yymsp[-1].minor.yy285 = yymsp[0].minor.yy285; }
136193136183
break;
136194
- case 272: /* with ::= WITH RECURSIVE wqlist */
136184
+ case 273: /* with ::= WITH RECURSIVE wqlist */
136195136185
{ yymsp[-2].minor.yy285 = yymsp[0].minor.yy285; }
136196136186
break;
136197
- case 273: /* wqlist ::= nm eidlist_opt AS LP select RP */
136187
+ case 274: /* wqlist ::= nm eidlist_opt AS LP select RP */
136198136188
{
136199136189
yymsp[-5].minor.yy285 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy148, yymsp[-1].minor.yy243); /*A-overwrites-X*/
136200136190
}
136201136191
break;
136202
- case 274: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
136192
+ case 275: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
136203136193
{
136204136194
yymsp[-7].minor.yy285 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy285, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy148, yymsp[-1].minor.yy243);
136205136195
}
136206136196
break;
136207136197
default:
136208
- /* (275) input ::= cmdlist */ yytestcase(yyruleno==275);
136209
- /* (276) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==276);
136210
- /* (277) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=277);
136211
- /* (278) ecmd ::= SEMI */ yytestcase(yyruleno==278);
136212
- /* (279) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==279);
136213
- /* (280) explain ::= */ yytestcase(yyruleno==280);
136214
- /* (281) trans_opt ::= */ yytestcase(yyruleno==281);
136215
- /* (282) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==282);
136216
- /* (283) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==283);
136217
- /* (284) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==284);
136218
- /* (285) savepoint_opt ::= */ yytestcase(yyruleno==285);
136219
- /* (286) cmd ::= create_table create_table_args */ yytestcase(yyruleno==286);
136220
- /* (287) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==287);
136221
- /* (288) columnlist ::= columnname carglist */ yytestcase(yyruleno==288);
136222
- /* (289) nm ::= ID|INDEXED */ yytestcase(yyruleno==289);
136223
- /* (290) nm ::= STRING */ yytestcase(yyruleno==290);
136224
- /* (291) nm ::= JOIN_KW */ yytestcase(yyruleno==291);
136225
- /* (292) typetoken ::= typename */ yytestcase(yyruleno==292);
136226
- /* (293) typename ::= ID|STRING */ yytestcase(yyruleno==293);
136227
- /* (294) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=294);
136228
- /* (295) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=295);
136229
- /* (296) carglist ::= carglist ccons */ yytestcase(yyruleno==296);
136230
- /* (297) carglist ::= */ yytestcase(yyruleno==297);
136231
- /* (298) ccons ::= NULL onconf */ yytestcase(yyruleno==298);
136232
- /* (299) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==299);
136233
- /* (300) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==300);
136234
- /* (301) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=301);
136235
- /* (302) tconscomma ::= */ yytestcase(yyruleno==302);
136236
- /* (303) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=303);
136237
- /* (304) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=304);
136238
- /* (305) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=305);
136239
- /* (306) oneselect ::= values */ yytestcase(yyruleno==306);
136240
- /* (307) sclp ::= selcollist COMMA */ yytestcase(yyruleno==307);
136241
- /* (308) as ::= ID|STRING */ yytestcase(yyruleno==308);
136242
- /* (309) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=309);
136243
- /* (310) exprlist ::= nexprlist */ yytestcase(yyruleno==310);
136244
- /* (311) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=311);
136245
- /* (312) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=312);
136246
- /* (313) nmnum ::= ON */ yytestcase(yyruleno==313);
136247
- /* (314) nmnum ::= DELETE */ yytestcase(yyruleno==314);
136248
- /* (315) nmnum ::= DEFAULT */ yytestcase(yyruleno==315);
136249
- /* (316) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==316);
136250
- /* (317) foreach_clause ::= */ yytestcase(yyruleno==317);
136251
- /* (318) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==318);
136252
- /* (319) trnm ::= nm */ yytestcase(yyruleno==319);
136253
- /* (320) tridxby ::= */ yytestcase(yyruleno==320);
136254
- /* (321) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==321);
136255
- /* (322) database_kw_opt ::= */ yytestcase(yyruleno==322);
136256
- /* (323) kwcolumn_opt ::= */ yytestcase(yyruleno==323);
136257
- /* (324) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==324);
136258
- /* (325) vtabarglist ::= vtabarg */ yytestcase(yyruleno==325);
136259
- /* (326) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==326);
136260
- /* (327) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==327);
136261
- /* (328) anylist ::= */ yytestcase(yyruleno==328);
136262
- /* (329) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==329);
136263
- /* (330) anylist ::= anylist ANY */ yytestcase(yyruleno==330);
136198
+ /* (276) input ::= cmdlist */ yytestcase(yyruleno==276);
136199
+ /* (277) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==277);
136200
+ /* (278) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=278);
136201
+ /* (279) ecmd ::= SEMI */ yytestcase(yyruleno==279);
136202
+ /* (280) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==280);
136203
+ /* (281) explain ::= */ yytestcase(yyruleno==281);
136204
+ /* (282) trans_opt ::= */ yytestcase(yyruleno==282);
136205
+ /* (283) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==283);
136206
+ /* (284) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==284);
136207
+ /* (285) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==285);
136208
+ /* (286) savepoint_opt ::= */ yytestcase(yyruleno==286);
136209
+ /* (287) cmd ::= create_table create_table_args */ yytestcase(yyruleno==287);
136210
+ /* (288) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==288);
136211
+ /* (289) columnlist ::= columnname carglist */ yytestcase(yyruleno==289);
136212
+ /* (290) nm ::= ID|INDEXED */ yytestcase(yyruleno==290);
136213
+ /* (291) nm ::= STRING */ yytestcase(yyruleno==291);
136214
+ /* (292) nm ::= JOIN_KW */ yytestcase(yyruleno==292);
136215
+ /* (293) typetoken ::= typename */ yytestcase(yyruleno==293);
136216
+ /* (294) typename ::= ID|STRING */ yytestcase(yyruleno==294);
136217
+ /* (295) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=295);
136218
+ /* (296) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=296);
136219
+ /* (297) carglist ::= carglist ccons */ yytestcase(yyruleno==297);
136220
+ /* (298) carglist ::= */ yytestcase(yyruleno==298);
136221
+ /* (299) ccons ::= NULL onconf */ yytestcase(yyruleno==299);
136222
+ /* (300) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==300);
136223
+ /* (301) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==301);
136224
+ /* (302) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=302);
136225
+ /* (303) tconscomma ::= */ yytestcase(yyruleno==303);
136226
+ /* (304) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=304);
136227
+ /* (305) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=305);
136228
+ /* (306) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=306);
136229
+ /* (307) oneselect ::= values */ yytestcase(yyruleno==307);
136230
+ /* (308) sclp ::= selcollist COMMA */ yytestcase(yyruleno==308);
136231
+ /* (309) as ::= ID|STRING */ yytestcase(yyruleno==309);
136232
+ /* (310) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=310);
136233
+ /* (311) exprlist ::= nexprlist */ yytestcase(yyruleno==311);
136234
+ /* (312) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=312);
136235
+ /* (313) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=313);
136236
+ /* (314) nmnum ::= ON */ yytestcase(yyruleno==314);
136237
+ /* (315) nmnum ::= DELETE */ yytestcase(yyruleno==315);
136238
+ /* (316) nmnum ::= DEFAULT */ yytestcase(yyruleno==316);
136239
+ /* (317) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==317);
136240
+ /* (318) foreach_clause ::= */ yytestcase(yyruleno==318);
136241
+ /* (319) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==319);
136242
+ /* (320) trnm ::= nm */ yytestcase(yyruleno==320);
136243
+ /* (321) tridxby ::= */ yytestcase(yyruleno==321);
136244
+ /* (322) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==322);
136245
+ /* (323) database_kw_opt ::= */ yytestcase(yyruleno==323);
136246
+ /* (324) kwcolumn_opt ::= */ yytestcase(yyruleno==324);
136247
+ /* (325) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==325);
136248
+ /* (326) vtabarglist ::= vtabarg */ yytestcase(yyruleno==326);
136249
+ /* (327) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==327);
136250
+ /* (328) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==328);
136251
+ /* (329) anylist ::= */ yytestcase(yyruleno==329);
136252
+ /* (330) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==330);
136253
+ /* (331) anylist ::= anylist ANY */ yytestcase(yyruleno==331);
136264136254
break;
136265136255
/********** End reduce actions ************************************************/
136266136256
};
136267136257
assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
136268136258
yygoto = yyRuleInfo[yyruleno].lhs;
@@ -136449,11 +136439,11 @@
136449136439
}
136450136440
#endif
136451136441
yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
136452136442
yymajor = YYNOCODE;
136453136443
}else{
136454
- while( yypParser->yytos >= &yypParser->yystack
136444
+ while( yypParser->yytos >= yypParser->yystack
136455136445
&& yymx != YYERRORSYMBOL
136456136446
&& (yyact = yy_find_reduce_action(
136457136447
yypParser->yytos->stateno,
136458136448
YYERRORSYMBOL)) >= YY_MIN_REDUCE
136459136449
){
@@ -181140,11 +181130,11 @@
181140181130
}
181141181131
#endif
181142181132
fts5yy_destructor(fts5yypParser, (fts5YYCODETYPE)fts5yymajor, &fts5yyminorunion);
181143181133
fts5yymajor = fts5YYNOCODE;
181144181134
}else{
181145
- while( fts5yypParser->fts5yytos >= &fts5yypParser->fts5yystack
181135
+ while( fts5yypParser->fts5yytos >= fts5yypParser->fts5yystack
181146181136
&& fts5yymx != fts5YYERRORSYMBOL
181147181137
&& (fts5yyact = fts5yy_find_reduce_action(
181148181138
fts5yypParser->fts5yytos->stateno,
181149181139
fts5YYERRORSYMBOL)) >= fts5YY_MIN_REDUCE
181150181140
){
@@ -195597,11 +195587,11 @@
195597195587
int nArg, /* Number of args */
195598195588
sqlite3_value **apUnused /* Function arguments */
195599195589
){
195600195590
assert( nArg==0 );
195601195591
UNUSED_PARAM2(nArg, apUnused);
195602
- sqlite3_result_text(pCtx, "fts5: 2016-09-21 19:43:34 0741812d7fcd558479e4849fbb3ba8d03738d018", -1, SQLITE_TRANSIENT);
195592
+ sqlite3_result_text(pCtx, "fts5: 2016-10-04 00:47:26 b10d0f939c82c4de3faa90b86de9ec4a89992856", -1, SQLITE_TRANSIENT);
195603195593
}
195604195594
195605195595
static int fts5Init(sqlite3 *db){
195606195596
static const sqlite3_module fts5Mod = {
195607195597
/* iVersion */ 2,
195608195598
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -381,11 +381,11 @@
381 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
382 ** [sqlite_version()] and [sqlite_source_id()].
383 */
384 #define SQLITE_VERSION "3.15.0"
385 #define SQLITE_VERSION_NUMBER 3015000
386 #define SQLITE_SOURCE_ID "2016-09-22 18:53:13 c3774c6a5fe48af91fda28e9e18c6ed9053ea992"
387
388 /*
389 ** CAPI3REF: Run-Time Library Version Numbers
390 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
391 **
@@ -8915,11 +8915,11 @@
8915
8916 /*
8917 ** CAPI3REF: Set a table filter on a Session Object.
8918 **
8919 ** The second argument (xFilter) is the "filter callback". For changes to rows
8920 ** in tables that are not attached to the Session oject, the filter is called
8921 ** to determine whether changes to the table's rows should be tracked or not.
8922 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8923 ** attached, xFilter will not be called again.
8924 */
8925 void sqlite3session_table_filter(
@@ -9181,11 +9181,11 @@
9181 ** Assuming the changeset blob was created by one of the
9182 ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or
9183 ** [sqlite3changeset_invert()] functions, all changes within the changeset
9184 ** that apply to a single table are grouped together. This means that when
9185 ** an application iterates through a changeset using an iterator created by
9186 ** this function, all changes that relate to a single table are visted
9187 ** consecutively. There is no chance that the iterator will visit a change
9188 ** the applies to table X, then one for table Y, and then later on visit
9189 ** another change for table X.
9190 */
9191 int sqlite3changeset_start(
@@ -9268,11 +9268,11 @@
9268 ** If successful, *pabPK is set to point to an array of nCol entries, where
9269 ** nCol is the number of columns in the table. Elements of *pabPK are set to
9270 ** 0x01 if the corresponding column is part of the tables primary key, or
9271 ** 0x00 if it is not.
9272 **
9273 ** If argumet pnCol is not NULL, then *pnCol is set to the number of columns
9274 ** in the table.
9275 **
9276 ** If this function is called when the iterator does not point to a valid
9277 ** entry, SQLITE_MISUSE is returned and the output variables zeroed. Otherwise,
9278 ** SQLITE_OK is returned and the output variables populated as described
@@ -9543,11 +9543,11 @@
9543 ** Rows within the changeset and changegroup are identified by the values in
9544 ** their PRIMARY KEY columns. A change in the changeset is considered to
9545 ** apply to the same row as a change already present in the changegroup if
9546 ** the two rows have the same primary key.
9547 **
9548 ** Changes to rows that that do not already appear in the changegroup are
9549 ** simply copied into it. Or, if both the new changeset and the changegroup
9550 ** contain changes that apply to a single row, the final contents of the
9551 ** changegroup depends on the type of each change, as follows:
9552 **
9553 ** <table border=1 style="margin-left:8ex;margin-right:8ex">
@@ -11411,13 +11411,13 @@
11411 #define TK_GROUP 127
11412 #define TK_HAVING 128
11413 #define TK_LIMIT 129
11414 #define TK_WHERE 130
11415 #define TK_INTO 131
11416 #define TK_INTEGER 132
11417 #define TK_FLOAT 133
11418 #define TK_BLOB 134
11419 #define TK_VARIABLE 135
11420 #define TK_CASE 136
11421 #define TK_WHEN 137
11422 #define TK_THEN 138
11423 #define TK_ELSE 139
@@ -12682,12 +12682,12 @@
12682 #define OP_IdxDelete 127 /* synopsis: key=r[P2@P3] */
12683 #define OP_Seek 128 /* synopsis: Move P3 to P1.rowid */
12684 #define OP_IdxRowid 129 /* synopsis: r[P2]=rowid */
12685 #define OP_Destroy 130
12686 #define OP_Clear 131
12687 #define OP_ResetSorter 132
12688 #define OP_Real 133 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
12689 #define OP_CreateIndex 134 /* synopsis: r[P2]=root iDb=P1 */
12690 #define OP_CreateTable 135 /* synopsis: r[P2]=root iDb=P1 */
12691 #define OP_ParseSchema 136
12692 #define OP_LoadAnalysis 137
12693 #define OP_DropTable 138
@@ -12741,11 +12741,11 @@
12741 /* 88 */ 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,\
12742 /* 96 */ 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\
12743 /* 104 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
12744 /* 112 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
12745 /* 120 */ 0x00, 0x00, 0x00, 0x10, 0x00, 0x04, 0x04, 0x00,\
12746 /* 128 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x10,\
12747 /* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10,\
12748 /* 144 */ 0x00, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,\
12749 /* 152 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\
12750 /* 160 */ 0x00, 0x00, 0x00,}
12751
@@ -14963,10 +14963,11 @@
14963 #define EP_Unlikely 0x040000 /* unlikely() or likelihood() function */
14964 #define EP_ConstFunc 0x080000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */
14965 #define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */
14966 #define EP_Subquery 0x200000 /* Tree contains a TK_SELECT operator */
14967 #define EP_Alias 0x400000 /* Is an alias for a result set column */
 
14968
14969 /*
14970 ** Combinations of two or more EP_* flags
14971 */
14972 #define EP_Propagate (EP_Collate|EP_Subquery) /* Propagate these bits up tree */
@@ -15514,39 +15515,27 @@
15514 u8 mayAbort; /* True if statement may throw an ABORT exception */
15515 u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */
15516 u8 okConstFactor; /* OK to factor out constants */
15517 u8 disableLookaside; /* Number of times lookaside has been disabled */
15518 u8 nColCache; /* Number of entries in aColCache[] */
15519 int aTempReg[8]; /* Holding area for temporary registers */
15520 int nRangeReg; /* Size of the temporary register block */
15521 int iRangeReg; /* First register in temporary register block */
15522 int nErr; /* Number of errors seen */
15523 int nTab; /* Number of previously allocated VDBE cursors */
15524 int nMem; /* Number of memory cells used so far */
15525 int nSet; /* Number of sets used so far */
15526 int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */
15527 int szOpAlloc; /* Bytes of memory space allocated for Vdbe.aOp[] */
15528 int iFixedOp; /* Never back out opcodes iFixedOp-1 or earlier */
15529 int ckBase; /* Base register of data during check constraints */
15530 int iSelfTab; /* Table of an index whose exprs are being coded */
15531 int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
15532 int iCacheCnt; /* Counter used to generate aColCache[].lru values */
15533 int nLabel; /* Number of labels used */
15534 int *aLabel; /* Space to hold the labels */
15535 struct yColCache {
15536 int iTable; /* Table cursor number */
15537 i16 iColumn; /* Table column number */
15538 u8 tempReg; /* iReg is a temp register that needs to be freed */
15539 int iLevel; /* Nesting level */
15540 int iReg; /* Reg with value of this column. 0 means none. */
15541 int lru; /* Least recently used entry has the smallest value */
15542 } aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */
15543 ExprList *pConstExpr;/* Constant expressions */
15544 Token constraintName;/* Name of the constraint currently being parsed */
15545 yDbMask writeMask; /* Start a write transaction on these databases */
15546 yDbMask cookieMask; /* Bitmask of schema verified databases */
15547 int cookieValue[SQLITE_MAX_ATTACHED+2]; /* Values of cookies to verify */
15548 int regRowid; /* Register holding rowid of CREATE TABLE entry */
15549 int regRoot; /* Register holding root page number for new objects */
15550 int nMaxArg; /* Max args passed to user function by sub-program */
15551 #if SELECTTRACE_ENABLED
15552 int nSelect; /* Number of SELECT statements seen */
@@ -15555,21 +15544,38 @@
15555 #ifndef SQLITE_OMIT_SHARED_CACHE
15556 int nTableLock; /* Number of locks in aTableLock */
15557 TableLock *aTableLock; /* Required table locks for shared-cache mode */
15558 #endif
15559 AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */
15560
15561 /* Information used while coding trigger programs. */
15562 Parse *pToplevel; /* Parse structure for main program (or NULL) */
15563 Table *pTriggerTab; /* Table triggers are being coded for */
15564 int addrCrTab; /* Address of OP_CreateTable opcode on CREATE TABLE */
15565 u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
15566 u32 oldmask; /* Mask of old.* columns referenced */
15567 u32 newmask; /* Mask of new.* columns referenced */
15568 u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */
15569 u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */
15570 u8 disableTriggers; /* True to disable triggers */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15571
15572 /************************************************************************
15573 ** Above is constant between recursions. Below is reset before and after
15574 ** each recursion. The boundary between these two regions is determined
15575 ** using offsetof(Parse,nVar) so the nVar field must be the first field
@@ -15582,11 +15588,10 @@
15582 u8 explain; /* True if the EXPLAIN flag is found on the query */
15583 #ifndef SQLITE_OMIT_VIRTUALTABLE
15584 u8 declareVtab; /* True if inside sqlite3_declare_vtab() */
15585 int nVtabLock; /* Number of virtual tables to lock */
15586 #endif
15587 int nAlias; /* Number of aliased result set columns */
15588 int nHeight; /* Expression tree height of current sub-select */
15589 #ifndef SQLITE_OMIT_EXPLAIN
15590 int iSelectId; /* ID of current select for EXPLAIN output */
15591 int iNextSelectId; /* Next available select ID for EXPLAIN output */
15592 #endif
@@ -15594,12 +15599,10 @@
15594 Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
15595 const char *zTail; /* All SQL text past the last semicolon parsed */
15596 Table *pNewTable; /* A table being constructed by CREATE TABLE */
15597 Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */
15598 const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
15599 Token sNameToken; /* Token with unqualified schema object name */
15600 Token sLastToken; /* The last token parsed */
15601 #ifndef SQLITE_OMIT_VIRTUALTABLE
15602 Token sArg; /* Complete text of a module argument */
15603 Table **apVtabLock; /* Pointer to virtual tables needing locking */
15604 #endif
15605 Table *pZombieTab; /* List of Table objects to delete after code gen */
@@ -15606,10 +15609,18 @@
15606 TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */
15607 With *pWith; /* Current WITH clause, or NULL */
15608 With *pWithToFree; /* Free this WITH object at the end of the parse */
15609 };
15610
 
 
 
 
 
 
 
 
15611 /*
15612 ** Return true if currently inside an sqlite3_declare_vtab() call.
15613 */
15614 #ifdef SQLITE_OMIT_VIRTUALTABLE
15615 #define IN_DECLARE_VTAB 0
@@ -16169,11 +16180,11 @@
16169 SQLITE_PRIVATE void sqlite3ExprAttachSubtrees(sqlite3*,Expr*,Expr*,Expr*);
16170 SQLITE_PRIVATE Expr *sqlite3PExpr(Parse*, int, Expr*, Expr*, const Token*);
16171 SQLITE_PRIVATE void sqlite3PExprAddSelect(Parse*, Expr*, Select*);
16172 SQLITE_PRIVATE Expr *sqlite3ExprAnd(sqlite3*,Expr*, Expr*);
16173 SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*);
16174 SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*);
16175 SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*);
16176 SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
16177 SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
16178 SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList*,int);
16179 SQLITE_PRIVATE void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int);
@@ -16989,20 +17000,17 @@
16989 ** If x is a lower-case ASCII character, then its upper-case equivalent
16990 ** is (x - 0x20). Therefore toupper() can be implemented as:
16991 **
16992 ** (x & ~(map[x]&0x20))
16993 **
16994 ** Standard function tolower() is implemented using the sqlite3UpperToLower[]
16995 ** array. tolower() is used more often than toupper() by SQLite.
16996 **
16997 ** Bit 0x40 is set if the character non-alphanumeric and can be used in an
16998 ** SQLite identifier. Identifiers are alphanumerics, "_", "$", and any
16999 ** non-ASCII UTF character. Hence the test for whether or not a character is
17000 ** part of an identifier is 0x46.
17001 **
17002 ** SQLite's versions are identical to the standard versions assuming a
17003 ** locale of "C". They are implemented as macros in sqliteInt.h.
17004 */
17005 #ifdef SQLITE_ASCII
17006 SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = {
17007 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00..07 ........ */
17008 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, /* 08..0f ........ */
@@ -17071,11 +17079,11 @@
17071 #ifndef SQLITE_SORTER_PMASZ
17072 # define SQLITE_SORTER_PMASZ 250
17073 #endif
17074
17075 /* Statement journals spill to disk when their size exceeds the following
17076 ** threashold (in bytes). 0 means that statement journals are created and
17077 ** written to disk immediately (the default behavior for SQLite versions
17078 ** before 3.12.0). -1 means always keep the entire statement journal in
17079 ** memory. (The statement journal is also always held entirely in memory
17080 ** if journal_mode=MEMORY or if temp_store=MEMORY, regardless of this
17081 ** setting.)
@@ -17159,11 +17167,11 @@
17159
17160 /*
17161 ** The value of the "pending" byte must be 0x40000000 (1 byte past the
17162 ** 1-gibabyte boundary) in a compatible database. SQLite never uses
17163 ** the database page that contains the pending byte. It never attempts
17164 ** to read or write that page. The pending byte page is set assign
17165 ** for use by the VFS layers as space for managing file locks.
17166 **
17167 ** During testing, it is often desirable to move the pending byte to
17168 ** a different position in the file. This allows code that has to
17169 ** deal with the pending byte to run on files that are much smaller
@@ -17719,13 +17727,10 @@
17719 typedef unsigned Bool;
17720
17721 /* Opaque type used by code in vdbesort.c */
17722 typedef struct VdbeSorter VdbeSorter;
17723
17724 /* Opaque type used by the explainer */
17725 typedef struct Explain Explain;
17726
17727 /* Elements of the linked list at Vdbe.pAuxData */
17728 typedef struct AuxData AuxData;
17729
17730 /* Types of VDBE cursors */
17731 #define CURTYPE_BTREE 0
@@ -17796,10 +17801,16 @@
17796 /* 2*nField extra array elements allocated for aType[], beyond the one
17797 ** static element declared in the structure. nField total array slots for
17798 ** aType[] and nField+1 array slots for aOffset[] */
17799 };
17800
 
 
 
 
 
 
17801 /*
17802 ** When a sub-program is executed (OP_Program), a structure of this type
17803 ** is allocated to store the current value of the program counter, as
17804 ** well as the current memory cell array and various other frame specific
17805 ** values stored in the Vdbe struct. When the sub-program is finished,
@@ -17840,15 +17851,10 @@
17840 int nDbChange; /* Value of db->nChange */
17841 };
17842
17843 #define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))])
17844
17845 /*
17846 ** A value for VdbeCursor.cacheValid that means the cache is always invalid.
17847 */
17848 #define CACHE_STALE 0
17849
17850 /*
17851 ** Internally, the vdbe manipulates nearly all SQL values as Mem
17852 ** structures. Each Mem struct may cache multiple representations (string,
17853 ** integer etc.) of the same value.
17854 */
@@ -17985,22 +17991,10 @@
17985 u8 fErrorOrAux; /* isError!=0 or pVdbe->pAuxData modified */
17986 u8 argc; /* Number of arguments */
17987 sqlite3_value *argv[1]; /* Argument set */
17988 };
17989
17990 /*
17991 ** An Explain object accumulates indented output which is helpful
17992 ** in describing recursive data structures.
17993 */
17994 struct Explain {
17995 Vdbe *pVdbe; /* Attach the explanation to this Vdbe */
17996 StrAccum str; /* The string being accumulated */
17997 int nIndent; /* Number of elements in aIndent */
17998 u16 aIndent[100]; /* Levels of indentation */
17999 char zBase[100]; /* Initial space */
18000 };
18001
18002 /* A bitfield type for use inside of structures. Always follow with :N where
18003 ** N is the number of bits.
18004 */
18005 typedef unsigned bft; /* Bit Field Type */
18006
@@ -18021,57 +18015,61 @@
18021 ** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare()
18022 ** is really a pointer to an instance of this structure.
18023 */
18024 struct Vdbe {
18025 sqlite3 *db; /* The database connection that owns this statement */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18026 Op *aOp; /* Space to hold the virtual machine's program */
18027 Mem *aMem; /* The memory locations */
18028 Mem **apArg; /* Arguments to currently executing user function */
18029 Mem *aColName; /* Column names to return */
18030 Mem *pResultSet; /* Pointer to an array of results */
18031 Parse *pParse; /* Parsing context used to create this Vdbe */
18032 int nMem; /* Number of memory locations currently allocated */
18033 int nOp; /* Number of instructions in the program */
18034 int nCursor; /* Number of slots in apCsr[] */
18035 u32 magic; /* Magic number for sanity checking */
18036 char *zErrMsg; /* Error message written here */
18037 Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
18038 VdbeCursor **apCsr; /* One element of this array for each open cursor */
18039 Mem *aVar; /* Values for the OP_Variable opcode. */
18040 char **azVar; /* Name of variables */
18041 ynVar nVar; /* Number of entries in aVar[] */
18042 ynVar nzVar; /* Number of entries in azVar[] */
18043 u32 cacheCtr; /* VdbeCursor row cache generation counter */
18044 int pc; /* The program counter */
18045 int rc; /* Value to return */
18046 #ifdef SQLITE_DEBUG
18047 int rcApp; /* errcode set by sqlite3_result_error_code() */
18048 #endif
18049 u16 nResColumn; /* Number of columns in one row of the result set */
18050 u8 errorAction; /* Recovery action to do in case of an error */
 
18051 bft expired:1; /* True if the VM needs to be recompiled */
18052 bft doingRerun:1; /* True if rerunning after an auto-reprepare */
18053 u8 minWriteFileFormat; /* Minimum file format for writable database files */
18054 bft explain:2; /* True if EXPLAIN present on SQL command */
18055 bft changeCntOn:1; /* True to update the change-counter */
18056 bft runOnlyOnce:1; /* Automatically expire on reset */
18057 bft usesStmtJournal:1; /* True if uses a statement journal */
18058 bft readOnly:1; /* True for statements that do not write */
18059 bft bIsReader:1; /* True for statements that read */
18060 bft isPrepareV2:1; /* True if prepared with prepare_v2() */
18061 int nChange; /* Number of db changes made since last reset */
18062 yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */
18063 yDbMask lockMask; /* Subset of btreeMask that requires a lock */
18064 int iStatement; /* Statement number (or 0 if has not opened stmt) */
18065 u32 aCounter[5]; /* Counters used by sqlite3_stmt_status() */
18066 #ifndef SQLITE_OMIT_TRACE
18067 i64 startTime; /* Time when query started - used for profiling */
18068 #endif
18069 i64 iCurrentTime; /* Value of julianday('now') for this statement */
18070 i64 nFkConstraint; /* Number of imm. FK constraints this VM */
18071 i64 nStmtDefCons; /* Number of def. constraints when stmt started */
18072 i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
18073 char *zSql; /* Text of the SQL statement that generated this */
18074 void *pFree; /* Free this when deleting the vdbe */
18075 VdbeFrame *pFrame; /* Parent frame */
18076 VdbeFrame *pDelFrame; /* List of frame objects to free on VM reset */
18077 int nFrame; /* Number of frames in pFrame list */
@@ -18086,14 +18084,15 @@
18086 };
18087
18088 /*
18089 ** The following are allowed values for Vdbe.magic
18090 */
18091 #define VDBE_MAGIC_INIT 0x26bceaa5 /* Building a VDBE program */
18092 #define VDBE_MAGIC_RUN 0xbdf20da3 /* VDBE is ready to execute */
18093 #define VDBE_MAGIC_HALT 0x519c2973 /* VDBE has completed execution */
18094 #define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */
 
18095
18096 /*
18097 ** Structure used to store the context required by the
18098 ** sqlite3_preupdate_*() API functions.
18099 */
@@ -28775,11 +28774,15 @@
28775 */
28776 static unsigned int strHash(const char *z){
28777 unsigned int h = 0;
28778 unsigned char c;
28779 while( (c = (unsigned char)*z++)!=0 ){ /*OPTIMIZATION-IF-TRUE*/
28780 h = (h<<3) ^ h ^ sqlite3UpperToLower[c];
 
 
 
 
28781 }
28782 return h;
28783 }
28784
28785
@@ -29131,12 +29134,12 @@
29131 /* 127 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
29132 /* 128 */ "Seek" OpHelp("Move P3 to P1.rowid"),
29133 /* 129 */ "IdxRowid" OpHelp("r[P2]=rowid"),
29134 /* 130 */ "Destroy" OpHelp(""),
29135 /* 131 */ "Clear" OpHelp(""),
29136 /* 132 */ "ResetSorter" OpHelp(""),
29137 /* 133 */ "Real" OpHelp("r[P2]=P4"),
29138 /* 134 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"),
29139 /* 135 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"),
29140 /* 136 */ "ParseSchema" OpHelp(""),
29141 /* 137 */ "LoadAnalysis" OpHelp(""),
29142 /* 138 */ "DropTable" OpHelp(""),
@@ -44018,11 +44021,11 @@
44018 ){
44019 PgHdr *pPgHdr;
44020 assert( pPage!=0 );
44021 pPgHdr = (PgHdr*)pPage->pExtra;
44022 assert( pPgHdr->pPage==0 );
44023 memset(pPgHdr, 0, sizeof(PgHdr));
44024 pPgHdr->pPage = pPage;
44025 pPgHdr->pData = pPage->pBuf;
44026 pPgHdr->pExtra = (void *)&pPgHdr[1];
44027 memset(pPgHdr->pExtra, 0, pCache->szExtra);
44028 pPgHdr->pCache = pCache;
@@ -58984,11 +58987,11 @@
58984 int bias, /* Bias search to the high end */
58985 int *pRes /* Write search results here */
58986 ){
58987 int rc; /* Status code */
58988 UnpackedRecord *pIdxKey; /* Unpacked index key */
58989 char aSpace[200]; /* Temp space for pIdxKey - to avoid a malloc */
58990 char *pFree = 0;
58991
58992 if( pKey ){
58993 assert( nKey==(i64)(int)nKey );
58994 pIdxKey = sqlite3VdbeAllocUnpackedRecord(
@@ -64321,12 +64324,10 @@
64321 nSrc = pX->nData;
64322 assert( pPage->intKeyLeaf ); /* fillInCell() only called for leaves */
64323 nHeader += putVarint32(&pCell[nHeader], nPayload);
64324 nHeader += putVarint(&pCell[nHeader], *(u64*)&pX->nKey);
64325 }else{
64326 assert( pX->nData==0 );
64327 assert( pX->nZero==0 );
64328 assert( pX->nKey<=0x7fffffff && pX->pKey!=0 );
64329 nSrc = nPayload = (int)pX->nKey;
64330 pSrc = pX->pKey;
64331 nHeader += putVarint32(&pCell[nHeader], nPayload);
64332 }
@@ -68022,26 +68023,20 @@
68022 */
68023 static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
68024 int i = sqlite3FindDbName(pDb, zDb);
68025
68026 if( i==1 ){
68027 Parse *pParse;
68028 int rc = 0;
68029 pParse = sqlite3StackAllocZero(pErrorDb, sizeof(*pParse));
68030 if( pParse==0 ){
68031 sqlite3ErrorWithMsg(pErrorDb, SQLITE_NOMEM, "out of memory");
68032 rc = SQLITE_NOMEM_BKPT;
68033 }else{
68034 pParse->db = pDb;
68035 if( sqlite3OpenTempDatabase(pParse) ){
68036 sqlite3ErrorWithMsg(pErrorDb, pParse->rc, "%s", pParse->zErrMsg);
68037 rc = SQLITE_ERROR;
68038 }
68039 sqlite3DbFree(pErrorDb, pParse->zErrMsg);
68040 sqlite3ParserReset(pParse);
68041 sqlite3StackFree(pErrorDb, pParse);
68042 }
68043 if( rc ){
68044 return 0;
68045 }
68046 }
68047
@@ -69041,10 +69036,11 @@
69041 assert( (pMem->flags&MEM_RowSet)==0 );
69042 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
69043
69044
69045 if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
 
69046 return SQLITE_NOMEM_BKPT;
69047 }
69048
69049 /* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8
69050 ** string representation of the value. Then, if the required encoding
@@ -70017,14 +70013,11 @@
70017 sqlite3_value *pVal = 0;
70018 int negInt = 1;
70019 const char *zNeg = "";
70020 int rc = SQLITE_OK;
70021
70022 if( !pExpr ){
70023 *ppVal = 0;
70024 return SQLITE_OK;
70025 }
70026 while( (op = pExpr->op)==TK_UPLUS || op==TK_SPAN ) pExpr = pExpr->pLeft;
70027 if( NEVER(op==TK_REGISTER) ) op = pExpr->op2;
70028
70029 /* Compressed expressions only appear when parsing the DEFAULT clause
70030 ** on a table column definition, and hence only when pCtx==0. This
@@ -70144,11 +70137,11 @@
70144 Expr *pExpr, /* The expression to evaluate */
70145 u8 enc, /* Encoding to use */
70146 u8 affinity, /* Affinity to use */
70147 sqlite3_value **ppVal /* Write the new value here */
70148 ){
70149 return valueFromExpr(db, pExpr, enc, affinity, ppVal, 0);
70150 }
70151
70152 #ifdef SQLITE_ENABLE_STAT3_OR_STAT4
70153 /*
70154 ** The implementation of the sqlite_record() function. This function accepts
@@ -70487,12 +70480,13 @@
70487 ** Create a new virtual database engine.
70488 */
70489 SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse *pParse){
70490 sqlite3 *db = pParse->db;
70491 Vdbe *p;
70492 p = sqlite3DbMallocZero(db, sizeof(Vdbe) );
70493 if( p==0 ) return 0;
 
70494 p->db = db;
70495 if( db->pVdbe ){
70496 db->pVdbe->pPrev = p;
70497 }
70498 p->pNext = db->pVdbe;
@@ -70650,13 +70644,12 @@
70650 #endif
70651 #ifdef SQLITE_DEBUG
70652 if( p->db->flags & SQLITE_VdbeAddopTrace ){
70653 int jj, kk;
70654 Parse *pParse = p->pParse;
70655 for(jj=kk=0; jj<SQLITE_N_COLCACHE; jj++){
70656 struct yColCache *x = pParse->aColCache + jj;
70657 if( x->iLevel>pParse->iCacheLevel || x->iReg==0 ) continue;
70658 printf(" r[%d]={%d:%d}", x->iReg, x->iTable, x->iColumn);
70659 kk++;
70660 }
70661 if( kk ) printf("\n");
70662 sqlite3VdbePrintOp(0, i, &p->aOp[i]);
@@ -70840,11 +70833,10 @@
70840 assert( j<p->nLabel );
70841 assert( j>=0 );
70842 if( p->aLabel ){
70843 p->aLabel[j] = v->nOp;
70844 }
70845 p->iFixedOp = v->nOp - 1;
70846 }
70847
70848 /*
70849 ** Mark the VDBE as one that can only be run one time.
70850 */
@@ -71231,19 +71223,19 @@
71231 }
71232 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, u32 addr, int val){
71233 sqlite3VdbeGetOp(p,addr)->p3 = val;
71234 }
71235 SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe *p, u8 p5){
71236 if( !p->db->mallocFailed ) p->aOp[p->nOp-1].p5 = p5;
 
71237 }
71238
71239 /*
71240 ** Change the P2 operand of instruction addr so that it points to
71241 ** the address of the next instruction to be coded.
71242 */
71243 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
71244 p->pParse->iFixedOp = p->nOp - 1;
71245 sqlite3VdbeChangeP2(p, addr, p->nOp);
71246 }
71247
71248
71249 /*
@@ -71362,11 +71354,11 @@
71362 /*
71363 ** If the last opcode is "op" and it is not a jump destination,
71364 ** then remove it. Return true if and only if an opcode was removed.
71365 */
71366 SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){
71367 if( (p->nOp-1)>(p->pParse->iFixedOp) && p->aOp[p->nOp-1].opcode==op ){
71368 return sqlite3VdbeChangeToNoop(p, p->nOp-1);
71369 }else{
71370 return 0;
71371 }
71372 }
@@ -71924,10 +71916,25 @@
71924 zCom
71925 );
71926 fflush(pOut);
71927 }
71928 #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71929
71930 /*
71931 ** Release an array of N Mem elements
71932 */
71933 static void releaseMemArray(Mem *p, int N){
@@ -72136,10 +72143,11 @@
72136 return SQLITE_ERROR;
72137 }
72138 pMem->flags = MEM_Str|MEM_Term;
72139 zP4 = displayP4(pOp, pMem->z, pMem->szMalloc);
72140 if( zP4!=pMem->z ){
 
72141 sqlite3VdbeMemSetStr(pMem, zP4, -1, SQLITE_UTF8, 0);
72142 }else{
72143 assert( pMem->z!=0 );
72144 pMem->n = sqlite3Strlen30(pMem->z);
72145 pMem->enc = SQLITE_UTF8;
@@ -72278,11 +72286,11 @@
72278 SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *p){
72279 #if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
72280 int i;
72281 #endif
72282 assert( p!=0 );
72283 assert( p->magic==VDBE_MAGIC_INIT );
72284
72285 /* There should be at least one opcode.
72286 */
72287 assert( p->nOp>0 );
72288
@@ -72367,14 +72375,11 @@
72367 n = ROUND8(sizeof(Op)*p->nOp); /* Bytes of opcode memory used */
72368 x.pSpace = &((u8*)p->aOp)[n]; /* Unused opcode memory */
72369 assert( EIGHT_BYTE_ALIGNMENT(x.pSpace) );
72370 x.nFree = ROUNDDOWN8(pParse->szOpAlloc - n); /* Bytes of unused memory */
72371 assert( x.nFree>=0 );
72372 if( x.nFree>0 ){
72373 memset(x.pSpace, 0, x.nFree);
72374 assert( EIGHT_BYTE_ALIGNMENT(&x.pSpace[x.nFree]) );
72375 }
72376
72377 resolveP2Values(p, &nArg);
72378 p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort);
72379 if( pParse->explain && nMem<10 ){
72380 nMem = 10;
@@ -72399,34 +72404,34 @@
72399 p->apCsr = allocSpace(&x, p->apCsr, nCursor*sizeof(VdbeCursor*));
72400 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
72401 p->anExec = allocSpace(&x, p->anExec, p->nOp*sizeof(i64));
72402 #endif
72403 if( x.nNeeded==0 ) break;
72404 x.pSpace = p->pFree = sqlite3DbMallocZero(db, x.nNeeded);
72405 x.nFree = x.nNeeded;
72406 }while( !db->mallocFailed );
72407
72408 p->nCursor = nCursor;
72409 if( p->aVar ){
72410 p->nVar = (ynVar)nVar;
72411 for(n=0; n<nVar; n++){
72412 p->aVar[n].flags = MEM_Null;
72413 p->aVar[n].db = db;
72414 }
72415 }
72416 p->nzVar = pParse->nzVar;
72417 p->azVar = pParse->azVar;
72418 pParse->nzVar = 0;
72419 pParse->azVar = 0;
72420 if( p->aMem ){
72421 p->nMem = nMem;
72422 for(n=0; n<nMem; n++){
72423 p->aMem[n].flags = MEM_Undefined;
72424 p->aMem[n].db = db;
72425 }
72426 }
72427 p->explain = pParse->explain;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72428 sqlite3VdbeRewind(p);
72429 }
72430
72431 /*
72432 ** Close a VDBE cursor and release all the resources that cursor
@@ -72574,17 +72579,13 @@
72574
72575 releaseMemArray(p->aColName, p->nResColumn*COLNAME_N);
72576 sqlite3DbFree(db, p->aColName);
72577 n = nResColumn*COLNAME_N;
72578 p->nResColumn = (u16)nResColumn;
72579 p->aColName = pColName = (Mem*)sqlite3DbMallocZero(db, sizeof(Mem)*n );
72580 if( p->aColName==0 ) return;
72581 while( n-- > 0 ){
72582 pColName->flags = MEM_Null;
72583 pColName->db = p->db;
72584 pColName++;
72585 }
72586 }
72587
72588 /*
72589 ** Set the name of the idx'th column to be returned by the SQL statement.
72590 ** zName must be a pointer to a nul terminated string.
@@ -73342,11 +73343,11 @@
73342 fclose(out);
73343 }
73344 }
73345 #endif
73346 p->iCurrentTime = 0;
73347 p->magic = VDBE_MAGIC_INIT;
73348 return p->rc & db->errMask;
73349 }
73350
73351 /*
73352 ** Clean up and delete a VDBE after execution. Return an integer which is
@@ -73406,23 +73407,25 @@
73406 */
73407 SQLITE_PRIVATE void sqlite3VdbeClearObject(sqlite3 *db, Vdbe *p){
73408 SubProgram *pSub, *pNext;
73409 int i;
73410 assert( p->db==0 || p->db==db );
73411 releaseMemArray(p->aVar, p->nVar);
73412 releaseMemArray(p->aColName, p->nResColumn*COLNAME_N);
73413 for(pSub=p->pProgram; pSub; pSub=pNext){
73414 pNext = pSub->pNext;
73415 vdbeFreeOpArray(db, pSub->aOp, pSub->nOp);
73416 sqlite3DbFree(db, pSub);
73417 }
73418 for(i=p->nzVar-1; i>=0; i--) sqlite3DbFree(db, p->azVar[i]);
73419 sqlite3DbFree(db, p->azVar);
 
 
 
 
73420 vdbeFreeOpArray(db, p->aOp, p->nOp);
73421 sqlite3DbFree(db, p->aColName);
73422 sqlite3DbFree(db, p->zSql);
73423 sqlite3DbFree(db, p->pFree);
73424 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
73425 for(i=0; i<p->nScan; i++){
73426 sqlite3DbFree(db, p->aScan[i].zName);
73427 }
73428 sqlite3DbFree(db, p->aScan);
@@ -76047,18 +76050,17 @@
76047 static Mem *columnMem(sqlite3_stmt *pStmt, int i){
76048 Vdbe *pVm;
76049 Mem *pOut;
76050
76051 pVm = (Vdbe *)pStmt;
76052 if( pVm && pVm->pResultSet!=0 && i<pVm->nResColumn && i>=0 ){
76053 sqlite3_mutex_enter(pVm->db->mutex);
 
 
76054 pOut = &pVm->pResultSet[i];
76055 }else{
76056 if( pVm && ALWAYS(pVm->db) ){
76057 sqlite3_mutex_enter(pVm->db->mutex);
76058 sqlite3Error(pVm->db, SQLITE_RANGE);
76059 }
76060 pOut = (Mem*)columnNullValue();
76061 }
76062 return pOut;
76063 }
76064
@@ -76087,10 +76089,12 @@
76087 ** SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR
76088 ** and _finalize() will return NOMEM.
76089 */
76090 Vdbe *p = (Vdbe *)pStmt;
76091 if( p ){
 
 
76092 p->rc = sqlite3ApiExit(p->db, p->rc);
76093 sqlite3_mutex_leave(p->db->mutex);
76094 }
76095 }
76096
@@ -76663,11 +76667,11 @@
76663 /*
76664 ** Return true if the prepared statement is in need of being reset.
76665 */
76666 SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76667 Vdbe *v = (Vdbe*)pStmt;
76668 return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN;
76669 }
76670
76671 /*
76672 ** Return a pointer to the next prepared statement after pStmt associated
76673 ** with database connection pDb. If pStmt is NULL, return the first
@@ -78415,15 +78419,17 @@
78415 u16 nullFlag;
78416 pOut = out2Prerelease(p, pOp);
78417 cnt = pOp->p3-pOp->p2;
78418 assert( pOp->p3<=(p->nMem+1 - p->nCursor) );
78419 pOut->flags = nullFlag = pOp->p1 ? (MEM_Null|MEM_Cleared) : MEM_Null;
 
78420 while( cnt>0 ){
78421 pOut++;
78422 memAboutToChange(p, pOut);
78423 sqlite3VdbeMemSetNull(pOut);
78424 pOut->flags = nullFlag;
 
78425 cnt--;
78426 }
78427 break;
78428 }
78429
@@ -80487,14 +80493,13 @@
80487 p->nStmtDefCons = db->nDeferredCons;
80488 p->nStmtDefImmCons = db->nDeferredImmCons;
80489 }
80490
80491 /* Gather the schema version number for checking:
80492 ** IMPLEMENTATION-OF: R-32195-19465 The schema version is used by SQLite
80493 ** each time a query is executed to ensure that the internal cache of the
80494 ** schema used when compiling the SQL query matches the schema of the
80495 ** database against which the compiled query is actually executed.
80496 */
80497 sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&iMeta);
80498 iGen = db->aDb[pOp->p1].pSchema->iGeneration;
80499 }else{
80500 iGen = iMeta = 0;
@@ -81746,11 +81751,11 @@
81746 ** change count is incremented (otherwise not).
81747 **
81748 ** P1 must not be pseudo-table. It has to be a real table with
81749 ** multiple rows.
81750 **
81751 ** If P4 is not NULL then it points to a Table struture. In this case either
81752 ** the update or pre-update hook, or both, may be invoked. The P1 cursor must
81753 ** have been positioned using OP_NotFound prior to invoking this opcode in
81754 ** this case. Specifically, if one is configured, the pre-update hook is
81755 ** invoked if P4 is not NULL. The update-hook is invoked if one is configured,
81756 ** P4 is not NULL, and the OPFLAG_NCHANGE flag is set in P2.
@@ -82337,13 +82342,10 @@
82337 if( pOp->opcode==OP_SorterInsert ){
82338 rc = sqlite3VdbeSorterWrite(pC, pIn2);
82339 }else{
82340 x.nKey = pIn2->n;
82341 x.pKey = pIn2->z;
82342 x.nData = 0;
82343 x.nZero = 0;
82344 x.pData = 0;
82345 rc = sqlite3BtreeInsert(pC->uc.pCursor, &x, pOp->p3,
82346 ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0)
82347 );
82348 assert( pC->deferredMoveto==0 );
82349 pC->cacheStatus = CACHE_STALE;
@@ -88036,11 +88038,13 @@
88036 static SQLITE_NOINLINE int walkExpr(Walker *pWalker, Expr *pExpr){
88037 int rc;
88038 testcase( ExprHasProperty(pExpr, EP_TokenOnly) );
88039 testcase( ExprHasProperty(pExpr, EP_Reduced) );
88040 rc = pWalker->xExprCallback(pWalker, pExpr);
88041 if( rc || ExprHasProperty(pExpr,EP_TokenOnly) ) return rc & WRC_Abort;
 
 
88042 if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort;
88043 if( pExpr->pRight && walkExpr(pWalker, pExpr->pRight) ) return WRC_Abort;
88044 if( ExprHasProperty(pExpr, EP_xIsSelect) ){
88045 if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort;
88046 }else if( pExpr->x.pList ){
@@ -88780,11 +88784,10 @@
88780 const char *zDb;
88781 Expr *pRight;
88782
88783 /* if( pSrcList==0 ) break; */
88784 notValid(pParse, pNC, "the \".\" operator", NC_IdxExpr);
88785 /*notValid(pParse, pNC, "the \".\" operator", NC_PartIdx|NC_IsCheck, 1);*/
88786 pRight = pExpr->pRight;
88787 if( pRight->op==TK_ID ){
88788 zDb = 0;
88789 zTable = pExpr->pLeft->u.zToken;
88790 zColumn = pRight->u.zToken;
@@ -88809,11 +88812,11 @@
88809 const char *zId; /* The function name. */
88810 FuncDef *pDef; /* Information about the function */
88811 u8 enc = ENC(pParse->db); /* The database encoding */
88812
88813 assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
88814 notValid(pParse, pNC, "functions", NC_PartIdx);
88815 zId = pExpr->u.zToken;
88816 nId = sqlite3Strlen30(zId);
88817 pDef = sqlite3FindFunction(pParse->db, zId, n, enc, 0);
88818 if( pDef==0 ){
88819 pDef = sqlite3FindFunction(pParse->db, zId, -2, enc, 0);
@@ -88869,11 +88872,12 @@
88869 }
88870 if( (pDef->funcFlags & SQLITE_FUNC_CONSTANT)==0 ){
88871 /* Date/time functions that use 'now', and other functions like
88872 ** sqlite_version() that might change over time cannot be used
88873 ** in an index. */
88874 notValid(pParse, pNC, "non-deterministic functions", NC_IdxExpr);
 
88875 }
88876 }
88877 if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){
88878 sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
88879 pNC->nErr++;
@@ -90409,11 +90413,11 @@
90409 ** stored in u.zToken. Instead, the integer values is written
90410 ** into u.iValue and the EP_IntValue flag is set. No extra storage
90411 ** is allocated to hold the integer text and the dequote flag is ignored.
90412 */
90413 SQLITE_PRIVATE Expr *sqlite3ExprAlloc(
90414 sqlite3 *db, /* Handle for sqlite3DbMallocZero() (may be null) */
90415 int op, /* Expression opcode */
90416 const Token *pToken, /* Token argument. Might be NULL */
90417 int dequote /* True to dequote */
90418 ){
90419 Expr *pNew;
@@ -90627,40 +90631,40 @@
90627 ** Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number
90628 ** as the previous instance of the same wildcard. Or if this is the first
90629 ** instance of the wildcard, the next sequential variable number is
90630 ** assigned.
90631 */
90632 SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
90633 sqlite3 *db = pParse->db;
90634 const char *z;
90635
90636 if( pExpr==0 ) return;
90637 assert( !ExprHasProperty(pExpr, EP_IntValue|EP_Reduced|EP_TokenOnly) );
90638 z = pExpr->u.zToken;
90639 assert( z!=0 );
90640 assert( z[0]!=0 );
 
90641 if( z[1]==0 ){
90642 /* Wildcard of the form "?". Assign the next variable number */
90643 assert( z[0]=='?' );
90644 pExpr->iColumn = (ynVar)(++pParse->nVar);
90645 }else{
90646 ynVar x = 0;
90647 u32 n = sqlite3Strlen30(z);
90648 if( z[0]=='?' ){
90649 /* Wildcard of the form "?nnn". Convert "nnn" to an integer and
90650 ** use it as the variable number */
90651 i64 i;
90652 int bOk = 0==sqlite3Atoi64(&z[1], &i, n-1, SQLITE_UTF8);
90653 pExpr->iColumn = x = (ynVar)i;
90654 testcase( i==0 );
90655 testcase( i==1 );
90656 testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 );
90657 testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] );
90658 if( bOk==0 || i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
90659 sqlite3ErrorMsg(pParse, "variable number must be between ?1 and ?%d",
90660 db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]);
90661 x = 0;
90662 }
90663 if( i>pParse->nVar ){
90664 pParse->nVar = (int)i;
90665 }
90666 }else{
@@ -90667,37 +90671,35 @@
90667 /* Wildcards like ":aaa", "$aaa" or "@aaa". Reuse the same variable
90668 ** number as the prior appearance of the same name, or if the name
90669 ** has never appeared before, reuse the same variable number
90670 */
90671 ynVar i;
90672 for(i=0; i<pParse->nzVar; i++){
90673 if( pParse->azVar[i] && strcmp(pParse->azVar[i],z)==0 ){
90674 pExpr->iColumn = x = (ynVar)i+1;
90675 break;
90676 }
90677 }
90678 if( x==0 ) x = pExpr->iColumn = (ynVar)(++pParse->nVar);
90679 }
90680 if( x>0 ){
90681 if( x>pParse->nzVar ){
90682 char **a;
90683 a = sqlite3DbRealloc(db, pParse->azVar, x*sizeof(a[0]));
90684 if( a==0 ){
90685 assert( db->mallocFailed ); /* Error reported through mallocFailed */
90686 return;
90687 }
90688 pParse->azVar = a;
90689 memset(&a[pParse->nzVar], 0, (x-pParse->nzVar)*sizeof(a[0]));
90690 pParse->nzVar = x;
90691 }
90692 if( z[0]!='?' || pParse->azVar[x-1]==0 ){
90693 sqlite3DbFree(db, pParse->azVar[x-1]);
90694 pParse->azVar[x-1] = sqlite3DbStrNDup(db, z, n);
90695 }
90696 }
90697 }
90698 if( !pParse->nErr && pParse->nVar>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
90699 sqlite3ErrorMsg(pParse, "too many SQL variables");
90700 }
90701 }
90702
90703 /*
@@ -90705,22 +90707,29 @@
90705 */
90706 static SQLITE_NOINLINE void sqlite3ExprDeleteNN(sqlite3 *db, Expr *p){
90707 assert( p!=0 );
90708 /* Sanity check: Assert that the IntValue is non-negative if it exists */
90709 assert( !ExprHasProperty(p, EP_IntValue) || p->u.iValue>=0 );
90710 if( !ExprHasProperty(p, EP_TokenOnly) ){
 
 
 
 
 
 
 
90711 /* The Expr.x union is never used at the same time as Expr.pRight */
90712 assert( p->x.pList==0 || p->pRight==0 );
90713 if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft);
90714 sqlite3ExprDelete(db, p->pRight);
90715 if( ExprHasProperty(p, EP_MemToken) ) sqlite3DbFree(db, p->u.zToken);
90716 if( ExprHasProperty(p, EP_xIsSelect) ){
90717 sqlite3SelectDelete(db, p->x.pSelect);
90718 }else{
90719 sqlite3ExprListDelete(db, p->x.pList);
90720 }
90721 }
 
90722 if( !ExprHasProperty(p, EP_Static) ){
90723 sqlite3DbFree(db, p);
90724 }
90725 }
90726 SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){
@@ -90893,11 +90902,11 @@
90893 if( nToken ){
90894 char *zToken = pNew->u.zToken = (char*)&zAlloc[nNewSize];
90895 memcpy(zToken, p->u.zToken, nToken);
90896 }
90897
90898 if( 0==((p->flags|pNew->flags) & EP_TokenOnly) ){
90899 /* Fill in the pNew->x.pSelect or pNew->x.pList member. */
90900 if( ExprHasProperty(p, EP_xIsSelect) ){
90901 pNew->x.pSelect = sqlite3SelectDup(db, p->x.pSelect, dupFlags);
90902 }else{
90903 pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, dupFlags);
@@ -90905,21 +90914,21 @@
90905 }
90906
90907 /* Fill in pNew->pLeft and pNew->pRight. */
90908 if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly) ){
90909 zAlloc += dupedExprNodeSize(p, dupFlags);
90910 if( ExprHasProperty(pNew, EP_Reduced) ){
90911 pNew->pLeft = p->pLeft ?
90912 exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0;
90913 pNew->pRight = p->pRight ?
90914 exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0;
90915 }
90916 if( pzBuffer ){
90917 *pzBuffer = zAlloc;
90918 }
90919 }else{
90920 if( !ExprHasProperty(p, EP_TokenOnly) ){
90921 if( pNew->op==TK_SELECT_COLUMN ){
90922 pNew->pLeft = p->pLeft;
90923 }else{
90924 pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
90925 }
@@ -92276,12 +92285,12 @@
92276 dest.eDest = SRT_Exists;
92277 sqlite3VdbeAddOp2(v, OP_Integer, 0, dest.iSDParm);
92278 VdbeComment((v, "Init EXISTS result"));
92279 }
92280 sqlite3ExprDelete(pParse->db, pSel->pLimit);
92281 pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0,
92282 &sqlite3IntTokens[1]);
92283 pSel->iLimit = 0;
92284 pSel->selFlags &= ~SF_MultiValue;
92285 if( sqlite3Select(pParse, pSel, &dest) ){
92286 return 0;
92287 }
@@ -92646,36 +92655,23 @@
92646 #endif
92647 }
92648 }
92649 }
92650
92651 #if defined(SQLITE_DEBUG)
92652 /*
92653 ** Verify the consistency of the column cache
92654 */
92655 static int cacheIsValid(Parse *pParse){
92656 int i, n;
92657 for(i=n=0; i<SQLITE_N_COLCACHE; i++){
92658 if( pParse->aColCache[i].iReg>0 ) n++;
92659 }
92660 return n==pParse->nColCache;
92661 }
92662 #endif
92663
92664 /*
92665 ** Clear a cache entry.
92666 */
92667 static void cacheEntryClear(Parse *pParse, struct yColCache *p){
92668 if( p->tempReg ){
92669 if( pParse->nTempReg<ArraySize(pParse->aTempReg) ){
92670 pParse->aTempReg[pParse->nTempReg++] = p->iReg;
92671 }
92672 p->tempReg = 0;
92673 }
92674 p->iReg = 0;
92675 pParse->nColCache--;
92676 assert( pParse->db->mallocFailed || cacheIsValid(pParse) );
 
 
92677 }
92678
92679
92680 /*
92681 ** Record in the column cache that a particular column from a
@@ -92701,64 +92697,52 @@
92701 **
92702 ** Actually, the way the column cache is currently used, we are guaranteed
92703 ** that the object will never already be in cache. Verify this guarantee.
92704 */
92705 #ifndef NDEBUG
92706 for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92707 assert( p->iReg==0 || p->iTable!=iTab || p->iColumn!=iCol );
92708 }
92709 #endif
92710
92711 /* Find an empty slot and replace it */
92712 for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92713 if( p->iReg==0 ){
92714 p->iLevel = pParse->iCacheLevel;
92715 p->iTable = iTab;
92716 p->iColumn = iCol;
92717 p->iReg = iReg;
92718 p->tempReg = 0;
92719 p->lru = pParse->iCacheCnt++;
92720 pParse->nColCache++;
92721 assert( pParse->db->mallocFailed || cacheIsValid(pParse) );
92722 return;
92723 }
92724 }
92725
92726 /* Replace the last recently used */
92727 minLru = 0x7fffffff;
92728 idxLru = -1;
92729 for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92730 if( p->lru<minLru ){
92731 idxLru = i;
92732 minLru = p->lru;
92733 }
92734 }
92735 if( ALWAYS(idxLru>=0) ){
92736 p = &pParse->aColCache[idxLru];
92737 p->iLevel = pParse->iCacheLevel;
92738 p->iTable = iTab;
92739 p->iColumn = iCol;
92740 p->iReg = iReg;
92741 p->tempReg = 0;
92742 p->lru = pParse->iCacheCnt++;
92743 assert( cacheIsValid(pParse) );
92744 return;
92745 }
 
 
92746 }
92747
92748 /*
92749 ** Indicate that registers between iReg..iReg+nReg-1 are being overwritten.
92750 ** Purge the range of registers from the column cache.
92751 */
92752 SQLITE_PRIVATE void sqlite3ExprCacheRemove(Parse *pParse, int iReg, int nReg){
92753 struct yColCache *p;
92754 if( iReg<=0 || pParse->nColCache==0 ) return;
92755 p = &pParse->aColCache[SQLITE_N_COLCACHE-1];
92756 while(1){
92757 if( p->iReg >= iReg && p->iReg < iReg+nReg ) cacheEntryClear(pParse, p);
92758 if( p==pParse->aColCache ) break;
92759 p--;
 
92760 }
92761 }
92762
92763 /*
92764 ** Remember the current column cache context. Any new entries added
@@ -92778,22 +92762,23 @@
92778 ** Remove from the column cache any entries that were added since the
92779 ** the previous sqlite3ExprCachePush operation. In other words, restore
92780 ** the cache to the state it was in prior the most recent Push.
92781 */
92782 SQLITE_PRIVATE void sqlite3ExprCachePop(Parse *pParse){
92783 int i;
92784 struct yColCache *p;
92785 assert( pParse->iCacheLevel>=1 );
92786 pParse->iCacheLevel--;
92787 #ifdef SQLITE_DEBUG
92788 if( pParse->db->flags & SQLITE_VdbeAddopTrace ){
92789 printf("POP to %d\n", pParse->iCacheLevel);
92790 }
92791 #endif
92792 for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92793 if( p->iReg && p->iLevel>pParse->iCacheLevel ){
92794 cacheEntryClear(pParse, p);
 
 
92795 }
92796 }
92797 }
92798
92799 /*
@@ -92803,11 +92788,11 @@
92803 ** get them all.
92804 */
92805 static void sqlite3ExprCachePinRegister(Parse *pParse, int iReg){
92806 int i;
92807 struct yColCache *p;
92808 for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92809 if( p->iReg==iReg ){
92810 p->tempReg = 0;
92811 }
92812 }
92813 }
@@ -92881,12 +92866,12 @@
92881 ){
92882 Vdbe *v = pParse->pVdbe;
92883 int i;
92884 struct yColCache *p;
92885
92886 for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92887 if( p->iReg>0 && p->iTable==iTable && p->iColumn==iColumn ){
92888 p->lru = pParse->iCacheCnt++;
92889 sqlite3ExprCachePinRegister(pParse, p->iReg);
92890 return p->iReg;
92891 }
92892 }
@@ -92914,22 +92899,24 @@
92914 /*
92915 ** Clear all column cache entries.
92916 */
92917 SQLITE_PRIVATE void sqlite3ExprCacheClear(Parse *pParse){
92918 int i;
92919 struct yColCache *p;
92920
92921 #if SQLITE_DEBUG
92922 if( pParse->db->flags & SQLITE_VdbeAddopTrace ){
92923 printf("CLEAR\n");
92924 }
92925 #endif
92926 for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92927 if( p->iReg ){
92928 cacheEntryClear(pParse, p);
 
 
92929 }
92930 }
 
92931 }
92932
92933 /*
92934 ** Record the fact that an affinity change has occurred on iCount
92935 ** registers starting with iStart.
@@ -92957,11 +92944,11 @@
92957 ** and does not appear in a normal build.
92958 */
92959 static int usedAsColumnCache(Parse *pParse, int iFrom, int iTo){
92960 int i;
92961 struct yColCache *p;
92962 for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92963 int r = p->iReg;
92964 if( r>=iFrom && r<=iTo ) return 1; /*NO_TEST*/
92965 }
92966 return 0;
92967 }
@@ -94653,11 +94640,11 @@
94653 */
94654 SQLITE_PRIVATE void sqlite3ReleaseTempReg(Parse *pParse, int iReg){
94655 if( iReg && pParse->nTempReg<ArraySize(pParse->aTempReg) ){
94656 int i;
94657 struct yColCache *p;
94658 for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
94659 if( p->iReg==iReg ){
94660 p->tempReg = 1;
94661 return;
94662 }
94663 }
@@ -97959,11 +97946,11 @@
97959 }else{
97960 sqlite3ErrorMsg(pFix->pParse, "%s cannot use variables", pFix->zType);
97961 return 1;
97962 }
97963 }
97964 if( ExprHasProperty(pExpr, EP_TokenOnly) ) break;
97965 if( ExprHasProperty(pExpr, EP_xIsSelect) ){
97966 if( sqlite3FixSelect(pFix, pExpr->x.pSelect) ) return 1;
97967 }else{
97968 if( sqlite3FixExprList(pFix, pExpr->x.pList) ) return 1;
97969 }
@@ -98423,11 +98410,10 @@
98423 */
98424 v = sqlite3GetVdbe(pParse);
98425 assert( !pParse->isMultiWrite
98426 || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort));
98427 if( v ){
98428 while( sqlite3VdbeDeletePriorOpcode(v, OP_Close) ){}
98429 sqlite3VdbeAddOp0(v, OP_Halt);
98430
98431 #if SQLITE_USER_AUTHENTICATION
98432 if( pParse->nTableLock>0 && db->init.busy==0 ){
98433 sqlite3UserAuthInit(db);
@@ -98450,18 +98436,20 @@
98450 ){
98451 int iDb, i;
98452 assert( sqlite3VdbeGetOp(v, 0)->opcode==OP_Init );
98453 sqlite3VdbeJumpHere(v, 0);
98454 for(iDb=0; iDb<db->nDb; iDb++){
 
98455 if( DbMaskTest(pParse->cookieMask, iDb)==0 ) continue;
98456 sqlite3VdbeUsesBtree(v, iDb);
 
98457 sqlite3VdbeAddOp4Int(v,
98458 OP_Transaction, /* Opcode */
98459 iDb, /* P1 */
98460 DbMaskTest(pParse->writeMask,iDb), /* P2 */
98461 pParse->cookieValue[iDb], /* P3 */
98462 db->aDb[iDb].pSchema->iGeneration /* P4 */
98463 );
98464 if( db->init.busy==0 ) sqlite3VdbeChangeP5(v, 1);
98465 VdbeComment((v,
98466 "usesStmtJournal=%d", pParse->mayAbort && pParse->isMultiWrite));
98467 }
@@ -98508,20 +98496,10 @@
98508 sqlite3VdbeMakeReady(v, pParse);
98509 pParse->rc = SQLITE_DONE;
98510 }else{
98511 pParse->rc = SQLITE_ERROR;
98512 }
98513
98514 /* We are done with this Parse object. There is no need to de-initialize it */
98515 #if 0
98516 pParse->colNamesSet = 0;
98517 pParse->nTab = 0;
98518 pParse->nMem = 0;
98519 pParse->nSet = 0;
98520 pParse->nVar = 0;
98521 DbMaskZero(pParse->cookieMask);
98522 #endif
98523 }
98524
98525 /*
98526 ** Run the parser and code generator recursively in order to generate
98527 ** code for the SQL statement given onto the end of the pParse context
@@ -98537,12 +98515,11 @@
98537 SQLITE_PRIVATE void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){
98538 va_list ap;
98539 char *zSql;
98540 char *zErrMsg = 0;
98541 sqlite3 *db = pParse->db;
98542 # define SAVE_SZ (sizeof(Parse) - offsetof(Parse,nVar))
98543 char saveBuf[SAVE_SZ];
98544
98545 if( pParse->nErr ) return;
98546 assert( pParse->nested<10 ); /* Nesting should only be of limited depth */
98547 va_start(ap, zFormat);
98548 zSql = sqlite3VMPrintf(db, zFormat, ap);
@@ -98549,16 +98526,16 @@
98549 va_end(ap);
98550 if( zSql==0 ){
98551 return; /* A malloc must have failed */
98552 }
98553 pParse->nested++;
98554 memcpy(saveBuf, &pParse->nVar, SAVE_SZ);
98555 memset(&pParse->nVar, 0, SAVE_SZ);
98556 sqlite3RunParser(pParse, zSql, &zErrMsg);
98557 sqlite3DbFree(db, zErrMsg);
98558 sqlite3DbFree(db, zSql);
98559 memcpy(&pParse->nVar, saveBuf, SAVE_SZ);
98560 pParse->nested--;
98561 }
98562
98563 #if SQLITE_USER_AUTHENTICATION
98564 /*
@@ -99735,10 +99712,13 @@
99735 ** This plan is not completely bullet-proof. It is possible for
99736 ** the schema to change multiple times and for the cookie to be
99737 ** set back to prior value. But schema changes are infrequent
99738 ** and the probability of hitting the same cookie value is only
99739 ** 1 chance in 2^32. So we're safe enough.
 
 
 
99740 */
99741 SQLITE_PRIVATE void sqlite3ChangeCookie(Parse *pParse, int iDb){
99742 sqlite3 *db = pParse->db;
99743 Vdbe *v = pParse->pVdbe;
99744 assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
@@ -102318,19 +102298,17 @@
102318 ** will occur at the end of the top-level VDBE and will be generated
102319 ** later, by sqlite3FinishCoding().
102320 */
102321 SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
102322 Parse *pToplevel = sqlite3ParseToplevel(pParse);
102323 sqlite3 *db = pToplevel->db;
102324
102325 assert( iDb>=0 && iDb<db->nDb );
102326 assert( db->aDb[iDb].pBt!=0 || iDb==1 );
102327 assert( iDb<SQLITE_MAX_ATTACHED+2 );
102328 assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
102329 if( DbMaskTest(pToplevel->cookieMask, iDb)==0 ){
102330 DbMaskSet(pToplevel->cookieMask, iDb);
102331 pToplevel->cookieValue[iDb] = db->aDb[iDb].pSchema->schema_cookie;
102332 if( !OMIT_TEMPDB && iDb==1 ){
102333 sqlite3OpenTempDatabase(pToplevel);
102334 }
102335 }
102336 }
@@ -107192,14 +107170,14 @@
107192 }else if( action==OE_SetDflt ){
107193 Expr *pDflt = pFKey->pFrom->aCol[iFromCol].pDflt;
107194 if( pDflt ){
107195 pNew = sqlite3ExprDup(db, pDflt, 0);
107196 }else{
107197 pNew = sqlite3PExpr(pParse, TK_NULL, 0, 0, 0);
107198 }
107199 }else{
107200 pNew = sqlite3PExpr(pParse, TK_NULL, 0, 0, 0);
107201 }
107202 pList = sqlite3ExprListAppend(pParse, pList, pNew);
107203 sqlite3ExprListSetName(pParse, pList, &tFromCol, 0);
107204 }
107205 }
@@ -109538,10 +109516,11 @@
109538 }
109539 if( emptySrcTest ) sqlite3VdbeJumpHere(v, emptySrcTest);
109540 sqlite3ReleaseTempReg(pParse, regRowid);
109541 sqlite3ReleaseTempReg(pParse, regData);
109542 if( emptyDestTest ){
 
109543 sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_OK, 0);
109544 sqlite3VdbeJumpHere(v, emptyDestTest);
109545 sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
109546 return 0;
109547 }else{
@@ -114034,22 +114013,18 @@
114034 int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
114035 Vdbe *pReprepare, /* VM being reprepared */
114036 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
114037 const char **pzTail /* OUT: End of parsed string */
114038 ){
114039 Parse *pParse; /* Parsing context */
114040 char *zErrMsg = 0; /* Error message */
114041 int rc = SQLITE_OK; /* Result code */
114042 int i; /* Loop counter */
114043
114044 /* Allocate the parsing context */
114045 pParse = sqlite3StackAllocZero(db, sizeof(*pParse));
114046 if( pParse==0 ){
114047 rc = SQLITE_NOMEM_BKPT;
114048 goto end_prepare;
114049 }
114050 pParse->pReprepare = pReprepare;
114051 assert( ppStmt && *ppStmt==0 );
114052 /* assert( !db->mallocFailed ); // not true with SQLITE_USE_ALLOCA */
114053 assert( sqlite3_mutex_held(db->mutex) );
114054
114055 /* Check to verify that it is possible to get a read lock on all
@@ -114089,12 +114064,11 @@
114089 }
114090 }
114091
114092 sqlite3VtabUnlockList(db);
114093
114094 pParse->db = db;
114095 pParse->nQueryLoop = 0; /* Logarithmic, so 0 really means 1 */
114096 if( nBytes>=0 && (nBytes==0 || zSql[nBytes-1]!=0) ){
114097 char *zSqlCopy;
114098 int mxLen = db->aLimit[SQLITE_LIMIT_SQL_LENGTH];
114099 testcase( nBytes==mxLen );
114100 testcase( nBytes==mxLen+1 );
@@ -114103,65 +114077,65 @@
114103 rc = sqlite3ApiExit(db, SQLITE_TOOBIG);
114104 goto end_prepare;
114105 }
114106 zSqlCopy = sqlite3DbStrNDup(db, zSql, nBytes);
114107 if( zSqlCopy ){
114108 sqlite3RunParser(pParse, zSqlCopy, &zErrMsg);
114109 pParse->zTail = &zSql[pParse->zTail-zSqlCopy];
114110 sqlite3DbFree(db, zSqlCopy);
114111 }else{
114112 pParse->zTail = &zSql[nBytes];
114113 }
114114 }else{
114115 sqlite3RunParser(pParse, zSql, &zErrMsg);
114116 }
114117 assert( 0==pParse->nQueryLoop );
114118
114119 if( pParse->rc==SQLITE_DONE ) pParse->rc = SQLITE_OK;
114120 if( pParse->checkSchema ){
114121 schemaIsValid(pParse);
114122 }
114123 if( db->mallocFailed ){
114124 pParse->rc = SQLITE_NOMEM_BKPT;
114125 }
114126 if( pzTail ){
114127 *pzTail = pParse->zTail;
114128 }
114129 rc = pParse->rc;
114130
114131 #ifndef SQLITE_OMIT_EXPLAIN
114132 if( rc==SQLITE_OK && pParse->pVdbe && pParse->explain ){
114133 static const char * const azColName[] = {
114134 "addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment",
114135 "selectid", "order", "from", "detail"
114136 };
114137 int iFirst, mx;
114138 if( pParse->explain==2 ){
114139 sqlite3VdbeSetNumCols(pParse->pVdbe, 4);
114140 iFirst = 8;
114141 mx = 12;
114142 }else{
114143 sqlite3VdbeSetNumCols(pParse->pVdbe, 8);
114144 iFirst = 0;
114145 mx = 8;
114146 }
114147 for(i=iFirst; i<mx; i++){
114148 sqlite3VdbeSetColName(pParse->pVdbe, i-iFirst, COLNAME_NAME,
114149 azColName[i], SQLITE_STATIC);
114150 }
114151 }
114152 #endif
114153
114154 if( db->init.busy==0 ){
114155 Vdbe *pVdbe = pParse->pVdbe;
114156 sqlite3VdbeSetSql(pVdbe, zSql, (int)(pParse->zTail-zSql), saveSqlFlag);
114157 }
114158 if( pParse->pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){
114159 sqlite3VdbeFinalize(pParse->pVdbe);
114160 assert(!(*ppStmt));
114161 }else{
114162 *ppStmt = (sqlite3_stmt*)pParse->pVdbe;
114163 }
114164
114165 if( zErrMsg ){
114166 sqlite3ErrorWithMsg(db, rc, "%s", zErrMsg);
114167 sqlite3DbFree(db, zErrMsg);
@@ -114168,20 +114142,19 @@
114168 }else{
114169 sqlite3Error(db, rc);
114170 }
114171
114172 /* Delete any TriggerPrg structures allocated while parsing this statement. */
114173 while( pParse->pTriggerPrg ){
114174 TriggerPrg *pT = pParse->pTriggerPrg;
114175 pParse->pTriggerPrg = pT->pNext;
114176 sqlite3DbFree(db, pT);
114177 }
114178
114179 end_prepare:
114180
114181 sqlite3ParserReset(pParse);
114182 sqlite3StackFree(db, pParse);
114183 rc = sqlite3ApiExit(db, rc);
114184 assert( (rc&db->errMask)==rc );
114185 return rc;
114186 }
114187 static int sqlite3LockAndPrepare(
@@ -115382,11 +115355,11 @@
115382 ** Allocate a KeyInfo object sufficient for an index of N key columns and
115383 ** X extra columns.
115384 */
115385 SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3 *db, int N, int X){
115386 int nExtra = (N+X)*(sizeof(CollSeq*)+1);
115387 KeyInfo *p = sqlite3DbMallocRaw(db, sizeof(KeyInfo) + nExtra);
115388 if( p ){
115389 p->aSortOrder = (u8*)&p->aColl[N+X];
115390 p->nField = (u16)N;
115391 p->nXField = (u16)X;
115392 p->enc = ENC(db);
@@ -118072,16 +118045,17 @@
118072 pWhere = sqlite3ExprDup(db, pSub->pWhere, 0);
118073 if( subqueryIsAgg ){
118074 assert( pParent->pHaving==0 );
118075 pParent->pHaving = pParent->pWhere;
118076 pParent->pWhere = pWhere;
118077 pParent->pHaving = sqlite3ExprAnd(db, pParent->pHaving,
118078 sqlite3ExprDup(db, pSub->pHaving, 0));
 
118079 assert( pParent->pGroupBy==0 );
118080 pParent->pGroupBy = sqlite3ExprListDup(db, pSub->pGroupBy, 0);
118081 }else{
118082 pParent->pWhere = sqlite3ExprAnd(db, pParent->pWhere, pWhere);
118083 }
118084 substSelect(db, pParent, iParent, pSub->pEList, 0);
118085
118086 /* The flattened query is distinct if either the inner or the
118087 ** outer query is distinct.
@@ -124041,24 +124015,24 @@
124041 ** in prereqRight and prereqAll. The default is 64 bits, hence SQLite
124042 ** is only able to process joins with 64 or fewer tables.
124043 */
124044 struct WhereTerm {
124045 Expr *pExpr; /* Pointer to the subexpression that is this term */
 
 
 
 
 
 
124046 int iParent; /* Disable pWC->a[iParent] when this term disabled */
124047 int leftCursor; /* Cursor number of X in "X <op> <expr>" */
124048 int iField; /* Field in (?,?,?) IN (SELECT...) vector */
124049 union {
124050 int leftColumn; /* Column number of X in "X <op> <expr>" */
124051 WhereOrInfo *pOrInfo; /* Extra information if (eOperator & WO_OR)!=0 */
124052 WhereAndInfo *pAndInfo; /* Extra information if (eOperator& WO_AND)!=0 */
124053 } u;
124054 LogEst truthProb; /* Probability of truth for this expression */
124055 u16 eOperator; /* A WO_xx value describing <op> */
124056 u16 wtFlags; /* TERM_xxx bit flags. See below */
124057 u8 nChild; /* Number of children that must disable us */
124058 u8 eMatchOp; /* Op for vtab MATCH/LIKE/GLOB/REGEXP terms */
124059 WhereClause *pWC; /* The clause this term is part of */
124060 Bitmask prereqRight; /* Bitmask of tables used by pExpr->pRight */
124061 Bitmask prereqAll; /* Bitmask of tables referenced by pExpr */
124062 };
124063
124064 /*
@@ -124207,29 +124181,29 @@
124207 struct WhereInfo {
124208 Parse *pParse; /* Parsing and code generating context */
124209 SrcList *pTabList; /* List of tables in the join */
124210 ExprList *pOrderBy; /* The ORDER BY clause or NULL */
124211 ExprList *pDistinctSet; /* DISTINCT over all these values */
124212 WhereLoop *pLoops; /* List of all WhereLoop objects */
124213 Bitmask revMask; /* Mask of ORDER BY terms that need reversing */
124214 LogEst nRowOut; /* Estimated number of output rows */
124215 LogEst iLimit; /* LIMIT if wctrlFlags has WHERE_USE_LIMIT */
 
 
 
 
124216 u16 wctrlFlags; /* Flags originally passed to sqlite3WhereBegin() */
 
124217 i8 nOBSat; /* Number of ORDER BY terms satisfied by indices */
124218 u8 sorted; /* True if really sorted (not just grouped) */
124219 u8 eOnePass; /* ONEPASS_OFF, or _SINGLE, or _MULTI */
124220 u8 untestedTerms; /* Not all WHERE terms resolved by outer loop */
124221 u8 eDistinct; /* One of the WHERE_DISTINCT_* values */
124222 u8 nLevel; /* Number of nested loop */
124223 u8 bOrderedInnerLoop; /* True if only the inner-most loop is ordered */
124224 int iTop; /* The very beginning of the WHERE loop */
124225 int iContinue; /* Jump here to continue with next record */
124226 int iBreak; /* Jump here to break out of the loop */
124227 int savedNQueryLoop; /* pParse->nQueryLoop outside the WHERE loop */
124228 int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */
124229 WhereMaskSet sMaskSet; /* Map cursor numbers to bitmasks */
124230 WhereClause sWC; /* Decomposition of the WHERE clause */
 
124231 WhereLevel a[1]; /* Information about each nest loop in WHERE */
124232 };
124233
124234 /*
124235 ** Private interfaces - callable only by other where.c routines.
@@ -126315,11 +126289,11 @@
126315 ** and we are coding the t1 loop and the t2 loop has not yet coded,
126316 ** then we cannot use the "t1.a=t2.b" constraint, but we can code
126317 ** the implied "t1.a=123" constraint.
126318 */
126319 for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){
126320 Expr *pE, *pEAlt;
126321 WhereTerm *pAlt;
126322 if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
126323 if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) continue;
126324 if( (pTerm->eOperator & WO_EQUIV)==0 ) continue;
126325 if( pTerm->leftCursor!=iCur ) continue;
@@ -126333,17 +126307,13 @@
126333 if( pAlt->wtFlags & (TERM_CODED) ) continue;
126334 testcase( pAlt->eOperator & WO_EQ );
126335 testcase( pAlt->eOperator & WO_IS );
126336 testcase( pAlt->eOperator & WO_IN );
126337 VdbeModuleComment((v, "begin transitive constraint"));
126338 pEAlt = sqlite3StackAllocRaw(db, sizeof(*pEAlt));
126339 if( pEAlt ){
126340 *pEAlt = *pAlt->pExpr;
126341 pEAlt->pLeft = pE->pLeft;
126342 sqlite3ExprIfFalse(pParse, pEAlt, addrCont, SQLITE_JUMPIFNULL);
126343 sqlite3StackFree(db, pEAlt);
126344 }
126345 }
126346
126347 /* For a LEFT OUTER JOIN, generate code that will record the fact that
126348 ** at least one row of the right table has matched the left table.
126349 */
@@ -126448,11 +126418,10 @@
126448 memcpy(pWC->a, pOld, sizeof(pWC->a[0])*pWC->nTerm);
126449 if( pOld!=pWC->aStatic ){
126450 sqlite3DbFree(db, pOld);
126451 }
126452 pWC->nSlot = sqlite3DbMallocSize(db, pWC->a)/sizeof(pWC->a[0]);
126453 memset(&pWC->a[pWC->nTerm], 0, sizeof(pWC->a[0])*(pWC->nSlot-pWC->nTerm));
126454 }
126455 pTerm = &pWC->a[idx = pWC->nTerm++];
126456 if( p && ExprHasProperty(p, EP_Unlikely) ){
126457 pTerm->truthProb = sqlite3LogEst(p->iTable) - 270;
126458 }else{
@@ -126460,10 +126429,12 @@
126460 }
126461 pTerm->pExpr = sqlite3ExprSkipCollate(p);
126462 pTerm->wtFlags = wtFlags;
126463 pTerm->pWC = pWC;
126464 pTerm->iParent = -1;
 
 
126465 return idx;
126466 }
126467
126468 /*
126469 ** Return TRUE if the given operator is one of the operators that is
@@ -127618,11 +127589,11 @@
127618 int idxNew;
127619 WhereTerm *pNewTerm;
127620
127621 pNewExpr = sqlite3PExpr(pParse, TK_GT,
127622 sqlite3ExprDup(db, pLeft, 0),
127623 sqlite3PExpr(pParse, TK_NULL, 0, 0, 0), 0);
127624
127625 idxNew = whereClauseInsert(pWC, pNewExpr,
127626 TERM_VIRTUAL|TERM_DYNAMIC|TERM_VNULL);
127627 if( idxNew ){
127628 pNewTerm = &pWC->a[idxNew];
@@ -127796,11 +127767,11 @@
127796 if( k>=pTab->nCol ){
127797 sqlite3ErrorMsg(pParse, "too many arguments on %s() - max %d",
127798 pTab->zName, j);
127799 return;
127800 }
127801 pColRef = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
127802 if( pColRef==0 ) return;
127803 pColRef->iTable = pItem->iCursor;
127804 pColRef->iColumn = k++;
127805 pColRef->pTab = pTab;
127806 pTerm = sqlite3PExpr(pParse, TK_EQ, pColRef,
@@ -132218,26 +132189,29 @@
132218 ** and the WhereMaskSet structure. Since WhereClause contains an 8-byte
132219 ** field (type Bitmask) it must be aligned on an 8-byte boundary on
132220 ** some architectures. Hence the ROUND8() below.
132221 */
132222 nByteWInfo = ROUND8(sizeof(WhereInfo)+(nTabList-1)*sizeof(WhereLevel));
132223 pWInfo = sqlite3DbMallocZero(db, nByteWInfo + sizeof(WhereLoop));
132224 if( db->mallocFailed ){
132225 sqlite3DbFree(db, pWInfo);
132226 pWInfo = 0;
132227 goto whereBeginError;
132228 }
132229 pWInfo->aiCurOnePass[0] = pWInfo->aiCurOnePass[1] = -1;
132230 pWInfo->nLevel = nTabList;
132231 pWInfo->pParse = pParse;
132232 pWInfo->pTabList = pTabList;
132233 pWInfo->pOrderBy = pOrderBy;
132234 pWInfo->pDistinctSet = pDistinctSet;
 
 
132235 pWInfo->iBreak = pWInfo->iContinue = sqlite3VdbeMakeLabel(v);
132236 pWInfo->wctrlFlags = wctrlFlags;
132237 pWInfo->iLimit = iAuxArg;
132238 pWInfo->savedNQueryLoop = pParse->nQueryLoop;
 
 
 
132239 assert( pWInfo->eOnePass==ONEPASS_OFF ); /* ONEPASS defaults to OFF */
132240 pMaskSet = &pWInfo->sMaskSet;
132241 sWLB.pWInfo = pWInfo;
132242 sWLB.pWC = &pWInfo->sWC;
132243 sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo);
@@ -132844,19 +132818,10 @@
132844 struct LimitVal {
132845 Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */
132846 Expr *pOffset; /* The OFFSET expression. NULL if there is none */
132847 };
132848
132849 /*
132850 ** An instance of this structure is used to store the LIKE,
132851 ** GLOB, NOT LIKE, and NOT GLOB operators.
132852 */
132853 struct LikeOp {
132854 Token eOperator; /* "like" or "glob" or "regexp" */
132855 int bNot; /* True if the NOT keyword is present */
132856 };
132857
132858 /*
132859 ** An instance of the following structure describes the event of a
132860 ** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT,
132861 ** TK_DELETE, or TK_INSTEAD. If the event is of the form
132862 **
@@ -132864,15 +132829,10 @@
132864 **
132865 ** Then the "b" IdList records the list "a,b,c".
132866 */
132867 struct TrigEvent { int a; IdList * b; };
132868
132869 /*
132870 ** An instance of this structure holds the ATTACH key and the key type.
132871 */
132872 struct AttachKey { int type; Token key; };
132873
132874 /*
132875 ** Disable lookaside memory allocation for objects that might be
132876 ** shared across database connections.
132877 */
132878 static void disableLookaside(Parse *pParse){
@@ -132915,11 +132875,28 @@
132915 /* Construct a new Expr object from a single identifier. Use the
132916 ** new Expr to populate pOut. Set the span of pOut to be the identifier
132917 ** that created the expression.
132918 */
132919 static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token t){
132920 pOut->pExpr = sqlite3PExpr(pParse, op, 0, 0, &t);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132921 pOut->zStart = t.z;
132922 pOut->zEnd = &t.z[t.n];
132923 }
132924
132925 /* This routine constructs a binary expression node out of two ExprSpan
@@ -133078,11 +133055,10 @@
133078 Select* yy243;
133079 IdList* yy254;
133080 With* yy285;
133081 struct TrigEvent yy332;
133082 struct LimitVal yy354;
133083 struct LikeOp yy392;
133084 struct {int value; int mask;} yy497;
133085 } YYMINORTYPE;
133086 #ifndef YYSTACKDEPTH
133087 #define YYSTACKDEPTH 100
133088 #endif
@@ -133090,19 +133066,19 @@
133090 #define sqlite3ParserARG_PDECL ,Parse *pParse
133091 #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
133092 #define sqlite3ParserARG_STORE yypParser->pParse = pParse
133093 #define YYFALLBACK 1
133094 #define YYNSTATE 456
133095 #define YYNRULE 331
133096 #define YY_MAX_SHIFT 455
133097 #define YY_MIN_SHIFTREDUCE 667
133098 #define YY_MAX_SHIFTREDUCE 997
133099 #define YY_MIN_REDUCE 998
133100 #define YY_MAX_REDUCE 1328
133101 #define YY_ERROR_ACTION 1329
133102 #define YY_ACCEPT_ACTION 1330
133103 #define YY_NO_ACTION 1331
133104 /************* End control #defines *******************************************/
133105
133106 /* Define the yytestcase() macro to be a no-op if is not already defined
133107 ** otherwise.
133108 **
@@ -133170,170 +133146,169 @@
133170 ** yy_reduce_ofst[] For each state, the offset into yy_action for
133171 ** shifting non-terminals after a reduce.
133172 ** yy_default[] Default action for each state.
133173 **
133174 *********** Begin parsing tables **********************************************/
133175 #define YY_ACTTAB_COUNT (1571)
133176 static const YYACTIONTYPE yy_action[] = {
133177 /* 0 */ 325, 830, 351, 824, 5, 203, 203, 818, 99, 100,
133178 /* 10 */ 90, 840, 840, 852, 855, 844, 844, 97, 97, 98,
133179 /* 20 */ 98, 98, 98, 301, 96, 96, 96, 96, 95, 95,
133180 /* 30 */ 94, 94, 94, 93, 351, 325, 975, 975, 823, 823,
133181 /* 40 */ 823, 945, 354, 99, 100, 90, 840, 840, 852, 855,
133182 /* 50 */ 844, 844, 97, 97, 98, 98, 98, 98, 338, 96,
133183 /* 60 */ 96, 96, 96, 95, 95, 94, 94, 94, 93, 351,
133184 /* 70 */ 95, 95, 94, 94, 94, 93, 351, 790, 975, 975,
133185 /* 80 */ 325, 94, 94, 94, 93, 351, 791, 75, 99, 100,
133186 /* 90 */ 90, 840, 840, 852, 855, 844, 844, 97, 97, 98,
133187 /* 100 */ 98, 98, 98, 450, 96, 96, 96, 96, 95, 95,
133188 /* 110 */ 94, 94, 94, 93, 351, 1330, 155, 155, 2, 325,
133189 /* 120 */ 275, 146, 132, 52, 52, 93, 351, 99, 100, 90,
133190 /* 130 */ 840, 840, 852, 855, 844, 844, 97, 97, 98, 98,
133191 /* 140 */ 98, 98, 101, 96, 96, 96, 96, 95, 95, 94,
133192 /* 150 */ 94, 94, 93, 351, 956, 956, 325, 268, 428, 413,
133193 /* 160 */ 411, 61, 751, 751, 99, 100, 90, 840, 840, 852,
133194 /* 170 */ 855, 844, 844, 97, 97, 98, 98, 98, 98, 60,
133195 /* 180 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133196 /* 190 */ 351, 325, 270, 329, 273, 277, 957, 958, 250, 99,
133197 /* 200 */ 100, 90, 840, 840, 852, 855, 844, 844, 97, 97,
133198 /* 210 */ 98, 98, 98, 98, 301, 96, 96, 96, 96, 95,
133199 /* 220 */ 95, 94, 94, 94, 93, 351, 325, 936, 1323, 697,
133200 /* 230 */ 705, 1323, 242, 412, 99, 100, 90, 840, 840, 852,
133201 /* 240 */ 855, 844, 844, 97, 97, 98, 98, 98, 98, 347,
133202 /* 250 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133203 /* 260 */ 351, 325, 936, 1324, 384, 698, 1324, 381, 379, 99,
133204 /* 270 */ 100, 90, 840, 840, 852, 855, 844, 844, 97, 97,
133205 /* 280 */ 98, 98, 98, 98, 700, 96, 96, 96, 96, 95,
133206 /* 290 */ 95, 94, 94, 94, 93, 351, 325, 92, 89, 178,
133207 /* 300 */ 831, 934, 373, 699, 99, 100, 90, 840, 840, 852,
133208 /* 310 */ 855, 844, 844, 97, 97, 98, 98, 98, 98, 375,
133209 /* 320 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133210 /* 330 */ 351, 325, 1273, 945, 354, 817, 934, 738, 738, 99,
133211 /* 340 */ 100, 90, 840, 840, 852, 855, 844, 844, 97, 97,
133212 /* 350 */ 98, 98, 98, 98, 230, 96, 96, 96, 96, 95,
133213 /* 360 */ 95, 94, 94, 94, 93, 351, 325, 967, 227, 92,
133214 /* 370 */ 89, 178, 373, 300, 99, 100, 90, 840, 840, 852,
133215 /* 380 */ 855, 844, 844, 97, 97, 98, 98, 98, 98, 919,
133216 /* 390 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133217 /* 400 */ 351, 325, 449, 447, 447, 447, 147, 736, 736, 99,
133218 /* 410 */ 100, 90, 840, 840, 852, 855, 844, 844, 97, 97,
133219 /* 420 */ 98, 98, 98, 98, 296, 96, 96, 96, 96, 95,
133220 /* 430 */ 95, 94, 94, 94, 93, 351, 325, 419, 231, 956,
133221 /* 440 */ 956, 158, 25, 422, 99, 100, 90, 840, 840, 852,
133222 /* 450 */ 855, 844, 844, 97, 97, 98, 98, 98, 98, 450,
133223 /* 460 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133224 /* 470 */ 351, 443, 224, 224, 420, 956, 956, 960, 325, 52,
133225 /* 480 */ 52, 957, 958, 176, 415, 78, 99, 100, 90, 840,
133226 /* 490 */ 840, 852, 855, 844, 844, 97, 97, 98, 98, 98,
133227 /* 500 */ 98, 379, 96, 96, 96, 96, 95, 95, 94, 94,
133228 /* 510 */ 94, 93, 351, 325, 428, 418, 298, 957, 958, 960,
133229 /* 520 */ 81, 99, 88, 90, 840, 840, 852, 855, 844, 844,
133230 /* 530 */ 97, 97, 98, 98, 98, 98, 716, 96, 96, 96,
133231 /* 540 */ 96, 95, 95, 94, 94, 94, 93, 351, 325, 841,
133232 /* 550 */ 841, 853, 856, 994, 318, 343, 379, 100, 90, 840,
133233 /* 560 */ 840, 852, 855, 844, 844, 97, 97, 98, 98, 98,
133234 /* 570 */ 98, 450, 96, 96, 96, 96, 95, 95, 94, 94,
133235 /* 580 */ 94, 93, 351, 325, 350, 350, 350, 260, 377, 340,
133236 /* 590 */ 927, 52, 52, 90, 840, 840, 852, 855, 844, 844,
133237 /* 600 */ 97, 97, 98, 98, 98, 98, 361, 96, 96, 96,
133238 /* 610 */ 96, 95, 95, 94, 94, 94, 93, 351, 86, 445,
133239 /* 620 */ 845, 3, 1200, 361, 360, 378, 344, 812, 956, 956,
133240 /* 630 */ 1297, 86, 445, 728, 3, 212, 169, 287, 405, 282,
133241 /* 640 */ 404, 199, 232, 450, 300, 759, 83, 84, 280, 245,
133242 /* 650 */ 262, 365, 251, 85, 352, 352, 92, 89, 178, 83,
133243 /* 660 */ 84, 242, 412, 52, 52, 448, 85, 352, 352, 246,
133244 /* 670 */ 957, 958, 194, 455, 669, 402, 399, 398, 448, 243,
133245 /* 680 */ 221, 114, 434, 775, 361, 450, 397, 268, 746, 224,
133246 /* 690 */ 224, 132, 132, 198, 830, 434, 452, 451, 428, 427,
133247 /* 700 */ 818, 415, 733, 712, 132, 52, 52, 830, 268, 452,
133248 /* 710 */ 451, 733, 194, 818, 363, 402, 399, 398, 450, 1268,
133249 /* 720 */ 1268, 23, 956, 956, 86, 445, 397, 3, 228, 429,
133250 /* 730 */ 893, 823, 823, 823, 825, 19, 203, 719, 52, 52,
133251 /* 740 */ 428, 408, 439, 249, 823, 823, 823, 825, 19, 229,
133252 /* 750 */ 403, 153, 83, 84, 760, 177, 241, 450, 720, 85,
133253 /* 760 */ 352, 352, 120, 157, 957, 958, 58, 975, 409, 355,
133254 /* 770 */ 330, 448, 268, 428, 430, 320, 789, 32, 32, 86,
133255 /* 780 */ 445, 775, 3, 341, 98, 98, 98, 98, 434, 96,
133256 /* 790 */ 96, 96, 96, 95, 95, 94, 94, 94, 93, 351,
133257 /* 800 */ 830, 120, 452, 451, 812, 885, 818, 83, 84, 975,
133258 /* 810 */ 812, 132, 410, 918, 85, 352, 352, 132, 407, 788,
133259 /* 820 */ 956, 956, 92, 89, 178, 915, 448, 262, 370, 261,
133260 /* 830 */ 82, 912, 80, 262, 370, 261, 932, 823, 823, 823,
133261 /* 840 */ 825, 19, 257, 434, 96, 96, 96, 96, 95, 95,
133262 /* 850 */ 94, 94, 94, 93, 351, 830, 268, 452, 451, 956,
133263 /* 860 */ 956, 818, 957, 958, 120, 92, 89, 178, 943, 2,
133264 /* 870 */ 916, 963, 268, 1, 766, 76, 445, 761, 3, 707,
133265 /* 880 */ 899, 899, 387, 956, 956, 756, 917, 371, 739, 777,
133266 /* 890 */ 755, 907, 823, 823, 823, 825, 19, 883, 740, 450,
133267 /* 900 */ 24, 957, 958, 83, 84, 369, 956, 956, 708, 226,
133268 /* 910 */ 85, 352, 352, 745, 315, 314, 313, 215, 311, 10,
133269 /* 920 */ 10, 682, 448, 349, 348, 957, 958, 887, 776, 691,
133270 /* 930 */ 331, 956, 956, 337, 157, 450, 268, 103, 450, 434,
133271 /* 940 */ 450, 816, 310, 906, 887, 889, 321, 450, 957, 958,
133272 /* 950 */ 708, 830, 775, 452, 451, 10, 10, 818, 10, 10,
133273 /* 960 */ 52, 52, 171, 170, 180, 225, 248, 10, 10, 339,
133274 /* 970 */ 701, 701, 233, 957, 958, 247, 982, 741, 450, 956,
133275 /* 980 */ 956, 425, 157, 980, 685, 981, 182, 912, 823, 823,
133276 /* 990 */ 823, 825, 19, 183, 324, 423, 132, 181, 51, 51,
133277 /* 1000 */ 715, 349, 348, 394, 256, 887, 334, 915, 983, 983,
133278 /* 1010 */ 830, 417, 824, 234, 198, 234, 818, 268, 326, 382,
133279 /* 1020 */ 120, 957, 958, 264, 177, 98, 98, 98, 98, 91,
133280 /* 1030 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133281 /* 1040 */ 351, 816, 416, 371, 120, 359, 816, 823, 823, 823,
133282 /* 1050 */ 775, 299, 916, 450, 368, 197, 196, 195, 358, 200,
133283 /* 1060 */ 175, 380, 9, 9, 450, 1287, 875, 714, 917, 450,
133284 /* 1070 */ 433, 237, 450, 36, 36, 132, 253, 450, 255, 450,
133285 /* 1080 */ 117, 450, 809, 362, 37, 37, 983, 983, 450, 12,
133286 /* 1090 */ 12, 330, 27, 27, 446, 331, 280, 38, 38, 39,
133287 /* 1100 */ 39, 40, 40, 1207, 450, 816, 335, 356, 41, 41,
133288 /* 1110 */ 450, 336, 450, 695, 450, 120, 450, 332, 133, 450,
133289 /* 1120 */ 268, 450, 269, 450, 42, 42, 450, 816, 254, 450,
133290 /* 1130 */ 28, 28, 29, 29, 31, 31, 43, 43, 450, 44,
133291 /* 1140 */ 44, 45, 45, 11, 11, 450, 46, 46, 450, 105,
133292 /* 1150 */ 105, 450, 748, 713, 450, 695, 450, 910, 47, 47,
133293 /* 1160 */ 450, 267, 450, 415, 450, 48, 48, 450, 33, 33,
133294 /* 1170 */ 386, 49, 49, 450, 50, 50, 34, 34, 450, 172,
133295 /* 1180 */ 122, 122, 123, 123, 124, 124, 450, 56, 56, 450,
133296 /* 1190 */ 120, 450, 345, 35, 35, 450, 790, 450, 106, 106,
133297 /* 1200 */ 450, 74, 450, 974, 450, 791, 53, 53, 432, 107,
133298 /* 1210 */ 107, 108, 108, 450, 272, 104, 104, 121, 121, 450,
133299 /* 1220 */ 119, 119, 112, 112, 111, 111, 450, 317, 996, 450,
133300 /* 1230 */ 118, 450, 162, 109, 109, 317, 935, 450, 896, 110,
133301 /* 1240 */ 110, 450, 895, 744, 688, 436, 55, 55, 20, 57,
133302 /* 1250 */ 57, 54, 54, 440, 444, 756, 385, 26, 26, 274,
133303 /* 1260 */ 755, 30, 30, 21, 672, 673, 674, 223, 175, 931,
133304 /* 1270 */ 814, 372, 319, 202, 202, 882, 120, 120, 120, 374,
133305 /* 1280 */ 826, 710, 202, 72, 276, 263, 120, 120, 74, 395,
133306 /* 1290 */ 278, 286, 208, 74, 718, 717, 725, 726, 892, 892,
133307 /* 1300 */ 167, 997, 285, 753, 729, 784, 77, 878, 202, 997,
133308 /* 1310 */ 208, 693, 891, 891, 116, 281, 782, 882, 390, 815,
133309 /* 1320 */ 762, 773, 826, 431, 302, 303, 822, 218, 696, 289,
133310 /* 1330 */ 690, 291, 293, 679, 678, 680, 950, 159, 316, 7,
133311 /* 1340 */ 364, 252, 259, 804, 909, 376, 400, 295, 308, 173,
133312 /* 1350 */ 435, 953, 168, 991, 135, 205, 926, 924, 59, 988,
133313 /* 1360 */ 62, 284, 880, 333, 879, 712, 144, 156, 130, 72,
133314 /* 1370 */ 366, 367, 393, 185, 189, 160, 383, 67, 389, 266,
133315 /* 1380 */ 137, 894, 774, 219, 154, 139, 190, 140, 391, 271,
133316 /* 1390 */ 191, 141, 142, 801, 681, 148, 811, 342, 322, 192,
133317 /* 1400 */ 406, 732, 911, 874, 723, 731, 323, 710, 730, 71,
133318 /* 1410 */ 704, 204, 283, 703, 6, 79, 421, 702, 965, 770,
133319 /* 1420 */ 297, 346, 426, 102, 722, 288, 73, 424, 213, 951,
133320 /* 1430 */ 771, 438, 22, 290, 687, 769, 442, 453, 239, 217,
133321 /* 1440 */ 214, 668, 125, 353, 126, 216, 454, 166, 676, 115,
133322 /* 1450 */ 675, 235, 244, 179, 670, 357, 810, 113, 890, 888,
133323 /* 1460 */ 292, 136, 128, 752, 304, 768, 294, 305, 138, 742,
133324 /* 1470 */ 306, 307, 127, 184, 860, 258, 905, 145, 143, 238,
133325 /* 1480 */ 63, 64, 65, 66, 240, 129, 908, 186, 187, 904,
133326 /* 1490 */ 8, 13, 188, 265, 897, 149, 202, 985, 388, 684,
133327 /* 1500 */ 150, 161, 392, 285, 193, 279, 151, 396, 68, 14,
133328 /* 1510 */ 401, 15, 327, 721, 328, 134, 69, 70, 236, 131,
133329 /* 1520 */ 829, 828, 858, 750, 16, 201, 754, 4, 783, 220,
133330 /* 1530 */ 414, 174, 222, 152, 77, 778, 74, 17, 18, 873,
133331 /* 1540 */ 859, 857, 914, 862, 913, 207, 206, 940, 163, 437,
133332 /* 1550 */ 946, 941, 164, 209, 210, 441, 861, 165, 312, 827,
133333 /* 1560 */ 694, 87, 1000, 309, 211, 1000, 1000, 1000, 1000, 1289,
133334 /* 1570 */ 1288,
133335 };
133336 static const YYCODETYPE yy_lookahead[] = {
133337 /* 0 */ 19, 95, 53, 97, 22, 24, 24, 101, 27, 28,
133338 /* 10 */ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
133339 /* 20 */ 39, 40, 41, 152, 43, 44, 45, 46, 47, 48,
@@ -133415,87 +133390,86 @@
133415 /* 780 */ 20, 124, 22, 111, 38, 39, 40, 41, 83, 43,
133416 /* 790 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
133417 /* 800 */ 95, 196, 97, 98, 85, 152, 101, 47, 48, 97,
133418 /* 810 */ 85, 92, 207, 193, 54, 55, 56, 92, 49, 175,
133419 /* 820 */ 55, 56, 221, 222, 223, 12, 66, 108, 109, 110,
133420 /* 830 */ 137, 163, 139, 108, 109, 110, 152, 132, 133, 134,
133421 /* 840 */ 135, 136, 152, 83, 43, 44, 45, 46, 47, 48,
133422 /* 850 */ 49, 50, 51, 52, 53, 95, 152, 97, 98, 55,
133423 /* 860 */ 56, 101, 97, 98, 196, 221, 222, 223, 146, 147,
133424 /* 870 */ 57, 171, 152, 22, 213, 19, 20, 49, 22, 179,
133425 /* 880 */ 108, 109, 110, 55, 56, 116, 73, 219, 75, 124,
133426 /* 890 */ 121, 152, 132, 133, 134, 135, 136, 193, 85, 152,
133427 /* 900 */ 232, 97, 98, 47, 48, 237, 55, 56, 55, 5,
133428 /* 910 */ 54, 55, 56, 193, 10, 11, 12, 13, 14, 172,
133429 /* 920 */ 173, 17, 66, 47, 48, 97, 98, 152, 124, 166,
133430 /* 930 */ 167, 55, 56, 186, 152, 152, 152, 22, 152, 83,
133431 /* 940 */ 152, 152, 160, 152, 169, 170, 164, 152, 97, 98,
133432 /* 950 */ 97, 95, 26, 97, 98, 172, 173, 101, 172, 173,
133433 /* 960 */ 172, 173, 47, 48, 60, 22, 62, 172, 173, 186,
133434 /* 970 */ 55, 56, 186, 97, 98, 71, 100, 193, 152, 55,
133435 /* 980 */ 56, 186, 152, 107, 21, 109, 82, 163, 132, 133,
133436 /* 990 */ 134, 135, 136, 89, 164, 207, 92, 93, 172, 173,
133437 /* 1000 */ 181, 47, 48, 19, 16, 230, 217, 12, 132, 133,
133438 /* 1010 */ 95, 163, 97, 183, 30, 185, 101, 152, 114, 152,
133439 /* 1020 */ 196, 97, 98, 152, 98, 38, 39, 40, 41, 42,
133440 /* 1030 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
133441 /* 1040 */ 53, 152, 152, 219, 196, 141, 152, 132, 133, 134,
133442 /* 1050 */ 124, 225, 57, 152, 91, 108, 109, 110, 193, 211,
133443 /* 1060 */ 212, 237, 172, 173, 152, 122, 103, 181, 73, 152,
133444 /* 1070 */ 75, 210, 152, 172, 173, 92, 88, 152, 90, 152,
133445 /* 1080 */ 22, 152, 163, 100, 172, 173, 132, 133, 152, 172,
133446 /* 1090 */ 173, 107, 172, 173, 166, 167, 112, 172, 173, 172,
133447 /* 1100 */ 173, 172, 173, 140, 152, 152, 217, 242, 172, 173,
133448 /* 1110 */ 152, 217, 152, 55, 152, 196, 152, 245, 246, 152,
133449 /* 1120 */ 152, 152, 152, 152, 172, 173, 152, 152, 140, 152,
133450 /* 1130 */ 172, 173, 172, 173, 172, 173, 172, 173, 152, 172,
133451 /* 1140 */ 173, 172, 173, 172, 173, 152, 172, 173, 152, 172,
133452 /* 1150 */ 173, 152, 195, 152, 152, 97, 152, 163, 172, 173,
133453 /* 1160 */ 152, 193, 152, 206, 152, 172, 173, 152, 172, 173,
133454 /* 1170 */ 217, 172, 173, 152, 172, 173, 172, 173, 152, 26,
133455 /* 1180 */ 172, 173, 172, 173, 172, 173, 152, 172, 173, 152,
133456 /* 1190 */ 196, 152, 217, 172, 173, 152, 61, 152, 172, 173,
133457 /* 1200 */ 152, 26, 152, 26, 152, 70, 172, 173, 191, 172,
133458 /* 1210 */ 173, 172, 173, 152, 152, 172, 173, 172, 173, 152,
133459 /* 1220 */ 172, 173, 172, 173, 172, 173, 152, 22, 23, 152,
133460 /* 1230 */ 22, 152, 24, 172, 173, 22, 23, 152, 59, 172,
133461 /* 1240 */ 173, 152, 63, 163, 163, 163, 172, 173, 22, 172,
133462 /* 1250 */ 173, 172, 173, 163, 163, 116, 77, 172, 173, 152,
133463 /* 1260 */ 121, 172, 173, 37, 7, 8, 9, 211, 212, 23,
133464 /* 1270 */ 23, 23, 26, 26, 26, 55, 196, 196, 196, 23,
133465 /* 1280 */ 55, 106, 26, 130, 152, 23, 196, 196, 26, 23,
133466 /* 1290 */ 23, 101, 26, 26, 100, 101, 7, 8, 132, 133,
133467 /* 1300 */ 123, 96, 112, 23, 152, 23, 26, 23, 26, 96,
133468 /* 1310 */ 26, 23, 132, 133, 26, 152, 152, 97, 234, 152,
133469 /* 1320 */ 152, 152, 97, 152, 152, 152, 152, 233, 152, 210,
133470 /* 1330 */ 152, 210, 210, 152, 152, 152, 152, 197, 150, 198,
133471 /* 1340 */ 214, 214, 239, 201, 201, 239, 176, 214, 200, 184,
133472 /* 1350 */ 227, 155, 198, 67, 243, 122, 159, 159, 240, 69,
133473 /* 1360 */ 240, 175, 175, 159, 175, 180, 22, 220, 27, 130,
133474 /* 1370 */ 18, 159, 18, 158, 158, 220, 159, 137, 74, 235,
133475 /* 1380 */ 189, 236, 159, 159, 22, 192, 158, 192, 177, 159,
133476 /* 1390 */ 158, 192, 192, 201, 159, 189, 189, 76, 177, 158,
133477 /* 1400 */ 107, 174, 201, 201, 182, 174, 177, 106, 174, 107,
133478 /* 1410 */ 174, 159, 174, 176, 22, 137, 125, 174, 174, 216,
133479 /* 1420 */ 159, 53, 126, 129, 182, 215, 128, 127, 25, 13,
133480 /* 1430 */ 216, 177, 26, 215, 162, 216, 177, 161, 229, 6,
133481 /* 1440 */ 153, 4, 165, 3, 165, 153, 151, 22, 151, 178,
133482 /* 1450 */ 151, 178, 142, 15, 151, 94, 120, 16, 23, 23,
133483 /* 1460 */ 215, 131, 111, 205, 204, 216, 215, 203, 123, 20,
133484 /* 1470 */ 202, 201, 165, 125, 224, 16, 1, 131, 123, 226,
133485 /* 1480 */ 37, 37, 37, 37, 229, 111, 56, 64, 122, 1,
133486 /* 1490 */ 5, 22, 107, 140, 80, 80, 26, 87, 72, 20,
133487 /* 1500 */ 107, 24, 19, 112, 105, 23, 22, 79, 22, 22,
133488 /* 1510 */ 79, 22, 249, 58, 249, 246, 22, 26, 79, 68,
133489 /* 1520 */ 23, 23, 23, 116, 22, 64, 23, 22, 56, 23,
133490 /* 1530 */ 26, 122, 23, 22, 26, 124, 26, 64, 64, 23,
133491 /* 1540 */ 23, 23, 23, 11, 23, 22, 26, 23, 22, 24,
133492 /* 1550 */ 1, 23, 22, 26, 122, 24, 23, 22, 15, 23,
133493 /* 1560 */ 23, 22, 251, 23, 122, 251, 251, 251, 251, 122,
133494 /* 1570 */ 122,
133495 };
133496 #define YY_SHIFT_USE_DFLT (1571)
133497 #define YY_SHIFT_COUNT (455)
133498 #define YY_SHIFT_MIN (-94)
133499 #define YY_SHIFT_MAX (1549)
133500 static const short yy_shift_ofst[] = {
133501 /* 0 */ 40, 599, 904, 612, 760, 760, 760, 760, 725, -19,
@@ -133507,132 +133481,132 @@
133507 /* 60 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133508 /* 70 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133509 /* 80 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133510 /* 90 */ 856, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133511 /* 100 */ 760, 760, 760, 760, 987, 746, 746, 746, 746, 746,
133512 /* 110 */ 801, 23, 32, 924, 963, 984, 954, 954, 924, 73,
133513 /* 120 */ 113, -51, 1571, 1571, 1571, 536, 536, 536, 99, 99,
133514 /* 130 */ 813, 813, 667, 205, 240, 924, 924, 924, 924, 924,
133515 /* 140 */ 924, 924, 924, 924, 924, 924, 924, 924, 924, 924,
133516 /* 150 */ 924, 924, 924, 924, 924, 332, 983, 422, 422, 113,
133517 /* 160 */ 30, 30, 30, 30, 30, 30, 1571, 1571, 1571, 915,
133518 /* 170 */ -94, -94, 384, 613, 828, 420, 765, 804, 851, 924,
133519 /* 180 */ 924, 924, 924, 924, 924, 924, 924, 924, 924, 924,
133520 /* 190 */ 924, 924, 924, 924, 924, 672, 672, 672, 924, 924,
133521 /* 200 */ 657, 924, 924, 924, -18, 924, 924, 995, 924, 924,
133522 /* 210 */ 924, 924, 924, 924, 924, 924, 924, 924, 772, 1179,
133523 /* 220 */ 712, 712, 712, 926, 45, 769, 1257, 1153, 418, 418,
133524 /* 230 */ 569, 1153, 569, 1175, 607, 663, 1135, 418, 693, 1135,
133525 /* 240 */ 1135, 1177, 1139, 1208, 1286, 1233, 1233, 1290, 1290, 1233,
133526 /* 250 */ 1344, 1341, 1239, 1352, 1352, 1352, 1352, 1233, 1354, 1239,
133527 /* 260 */ 1344, 1341, 1341, 1239, 1233, 1354, 1240, 1304, 1233, 1233,
133528 /* 270 */ 1354, 1362, 1233, 1354, 1233, 1354, 1362, 1293, 1293, 1293,
133529 /* 280 */ 1321, 1362, 1293, 1301, 1293, 1321, 1293, 1293, 1291, 1302,
133530 /* 290 */ 1291, 1302, 1291, 1302, 1291, 1302, 1233, 1392, 1233, 1278,
133531 /* 300 */ 1362, 1368, 1368, 1362, 1294, 1296, 1298, 1300, 1239, 1403,
133532 /* 310 */ 1406, 1416, 1416, 1433, 1433, 1433, 1433, 1571, 1571, 1571,
133533 /* 320 */ 1571, 1571, 1571, 1571, 1571, 519, 988, 1205, 1213, 104,
133534 /* 330 */ 947, 1058, 1246, 1226, 1247, 1248, 1256, 1262, 1266, 1267,
133535 /* 340 */ 853, 1194, 1289, 1190, 1280, 1282, 1220, 1284, 1166, 1180,
133536 /* 350 */ 1288, 1225, 943, 1437, 1440, 1425, 1310, 1438, 1361, 1441,
133537 /* 360 */ 1435, 1436, 1336, 1330, 1351, 1345, 1449, 1348, 1459, 1475,
133538 /* 370 */ 1355, 1346, 1443, 1444, 1445, 1446, 1374, 1430, 1423, 1366,
133539 /* 380 */ 1488, 1485, 1469, 1385, 1353, 1414, 1470, 1415, 1410, 1426,
133540 /* 390 */ 1393, 1477, 1479, 1483, 1391, 1399, 1484, 1428, 1486, 1487,
133541 /* 400 */ 1482, 1489, 1431, 1455, 1494, 1439, 1451, 1497, 1498, 1499,
133542 /* 410 */ 1491, 1407, 1502, 1503, 1505, 1504, 1409, 1506, 1509, 1472,
133543 /* 420 */ 1461, 1511, 1411, 1508, 1473, 1510, 1474, 1516, 1508, 1517,
133544 /* 430 */ 1518, 1519, 1520, 1521, 1523, 1532, 1524, 1526, 1525, 1527,
133545 /* 440 */ 1528, 1530, 1531, 1527, 1533, 1535, 1536, 1537, 1539, 1432,
133546 /* 450 */ 1442, 1447, 1448, 1540, 1543, 1549,
133547 };
133548 #define YY_REDUCE_USE_DFLT (-130)
133549 #define YY_REDUCE_COUNT (324)
133550 #define YY_REDUCE_MIN (-129)
133551 #define YY_REDUCE_MAX (1307)
133552 static const short yy_reduce_ofst[] = {
133553 /* 0 */ -29, 566, 525, 605, -49, 307, 491, 533, 668, 435,
133554 /* 10 */ 601, 644, 148, 747, 783, 786, 419, 788, 795, 826,
133555 /* 20 */ 454, 775, 830, 495, 824, 848, 76, 76, 76, 76,
133556 /* 30 */ 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
133557 /* 40 */ 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
133558 /* 50 */ 76, 76, 76, 76, 76, 76, 76, 76, 890, 901,
133559 /* 60 */ 912, 917, 920, 925, 927, 929, 936, 952, 958, 960,
133560 /* 70 */ 962, 964, 967, 969, 971, 974, 977, 986, 993, 996,
133561 /* 80 */ 999, 1002, 1004, 1008, 1010, 1012, 1015, 1021, 1026, 1034,
133562 /* 90 */ 1037, 1039, 1043, 1045, 1048, 1050, 1052, 1061, 1067, 1074,
133563 /* 100 */ 1077, 1079, 1085, 1089, 76, 76, 76, 76, 76, 76,
133564 /* 110 */ 76, 76, 76, 865, 36, 523, 235, 416, 782, 76,
133565 /* 120 */ 278, 76, 76, 76, 76, 700, 700, 700, 150, 220,
133566 /* 130 */ 147, 217, 221, 306, 306, 611, 5, 535, 556, 620,
133567 /* 140 */ 704, 720, 784, 116, 789, 349, 889, 894, 404, 953,
133568 /* 150 */ 968, -129, 975, 492, 62, 722, 919, 763, 928, 957,
133569 /* 160 */ 994, 1080, 1081, 1082, 1090, 1091, 872, 1056, 557, 57,
133570 /* 170 */ 112, 131, 167, 182, 250, 272, 291, 331, 364, 438,
133571 /* 180 */ 497, 517, 591, 653, 684, 690, 739, 791, 867, 871,
133572 /* 190 */ 970, 1062, 1107, 1132, 1152, 355, 819, 886, 1001, 1163,
133573 /* 200 */ 661, 1164, 1167, 1168, 861, 1169, 1171, 1017, 1172, 1173,
133574 /* 210 */ 1174, 250, 1176, 1178, 1181, 1182, 1183, 1184, 1084, 1094,
133575 /* 220 */ 1119, 1121, 1122, 661, 1140, 1141, 1188, 1142, 1126, 1127,
133576 /* 230 */ 1103, 1143, 1106, 1170, 1165, 1185, 1186, 1133, 1123, 1187,
133577 /* 240 */ 1189, 1148, 1154, 1196, 1111, 1197, 1198, 1118, 1120, 1204,
133578 /* 250 */ 1147, 1191, 1192, 1193, 1195, 1199, 1200, 1212, 1215, 1201,
133579 /* 260 */ 1155, 1206, 1207, 1202, 1217, 1216, 1145, 1144, 1223, 1224,
133580 /* 270 */ 1228, 1211, 1230, 1232, 1235, 1241, 1221, 1227, 1231, 1234,
133581 /* 280 */ 1222, 1229, 1236, 1237, 1238, 1242, 1243, 1244, 1203, 1210,
133582 /* 290 */ 1214, 1218, 1219, 1245, 1249, 1251, 1252, 1250, 1261, 1253,
133583 /* 300 */ 1254, 1209, 1255, 1259, 1258, 1260, 1264, 1268, 1270, 1272,
133584 /* 310 */ 1276, 1287, 1292, 1295, 1297, 1299, 1303, 1263, 1265, 1269,
133585 /* 320 */ 1277, 1279, 1271, 1273, 1307,
133586 };
133587 static const YYACTIONTYPE yy_default[] = {
133588 /* 0 */ 1278, 1268, 1268, 1268, 1200, 1200, 1200, 1200, 1268, 1094,
133589 /* 10 */ 1123, 1123, 1252, 1329, 1329, 1329, 1329, 1329, 1329, 1199,
133590 /* 20 */ 1329, 1329, 1329, 1329, 1268, 1098, 1129, 1329, 1329, 1329,
133591 /* 30 */ 1329, 1201, 1202, 1329, 1329, 1329, 1251, 1253, 1139, 1138,
133592 /* 40 */ 1137, 1136, 1234, 1110, 1134, 1127, 1131, 1201, 1195, 1196,
133593 /* 50 */ 1194, 1198, 1202, 1329, 1130, 1164, 1179, 1163, 1329, 1329,
133594 /* 60 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133595 /* 70 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133596 /* 80 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133597 /* 90 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133598 /* 100 */ 1329, 1329, 1329, 1329, 1173, 1178, 1185, 1177, 1174, 1166,
133599 /* 110 */ 1165, 1167, 1168, 1329, 1017, 1065, 1329, 1329, 1329, 1169,
133600 /* 120 */ 1329, 1170, 1182, 1181, 1180, 1259, 1286, 1285, 1329, 1329,
133601 /* 130 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133602 /* 140 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133603 /* 150 */ 1329, 1329, 1329, 1329, 1329, 1278, 1268, 1023, 1023, 1329,
133604 /* 160 */ 1268, 1268, 1268, 1268, 1268, 1268, 1264, 1098, 1089, 1329,
133605 /* 170 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133606 /* 180 */ 1256, 1254, 1329, 1215, 1329, 1329, 1329, 1329, 1329, 1329,
133607 /* 190 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133608 /* 200 */ 1329, 1329, 1329, 1329, 1094, 1329, 1329, 1329, 1329, 1329,
133609 /* 210 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1280, 1329, 1229,
133610 /* 220 */ 1094, 1094, 1094, 1096, 1078, 1088, 1002, 1133, 1112, 1112,
133611 /* 230 */ 1318, 1133, 1318, 1040, 1300, 1037, 1123, 1112, 1197, 1123,
133612 /* 240 */ 1123, 1095, 1088, 1329, 1321, 1103, 1103, 1320, 1320, 1103,
133613 /* 250 */ 1144, 1068, 1133, 1074, 1074, 1074, 1074, 1103, 1014, 1133,
133614 /* 260 */ 1144, 1068, 1068, 1133, 1103, 1014, 1233, 1315, 1103, 1103,
133615 /* 270 */ 1014, 1208, 1103, 1014, 1103, 1014, 1208, 1066, 1066, 1066,
133616 /* 280 */ 1055, 1208, 1066, 1040, 1066, 1055, 1066, 1066, 1116, 1111,
133617 /* 290 */ 1116, 1111, 1116, 1111, 1116, 1111, 1103, 1203, 1103, 1329,
133618 /* 300 */ 1208, 1212, 1212, 1208, 1128, 1117, 1126, 1124, 1133, 1020,
133619 /* 310 */ 1058, 1283, 1283, 1279, 1279, 1279, 1279, 1326, 1326, 1264,
133620 /* 320 */ 1295, 1295, 1042, 1042, 1295, 1329, 1329, 1329, 1329, 1329,
133621 /* 330 */ 1329, 1290, 1329, 1217, 1329, 1329, 1329, 1329, 1329, 1329,
133622 /* 340 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133623 /* 350 */ 1329, 1329, 1150, 1329, 998, 1261, 1329, 1329, 1260, 1329,
133624 /* 360 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133625 /* 370 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1317,
133626 /* 380 */ 1329, 1329, 1329, 1329, 1329, 1329, 1232, 1231, 1329, 1329,
133627 /* 390 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133628 /* 400 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
133629 /* 410 */ 1329, 1080, 1329, 1329, 1329, 1304, 1329, 1329, 1329, 1329,
133630 /* 420 */ 1329, 1329, 1329, 1125, 1329, 1118, 1329, 1329, 1308, 1329,
133631 /* 430 */ 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1270,
133632 /* 440 */ 1329, 1329, 1329, 1269, 1329, 1329, 1329, 1329, 1329, 1152,
133633 /* 450 */ 1329, 1151, 1155, 1329, 1008, 1329,
133634 };
133635 /********** End of lemon-generated parsing tables *****************************/
133636
133637 /* The next table maps tokens (terminal symbols) into fallback tokens.
133638 ** If a construct like the following:
@@ -133862,11 +133836,11 @@
133862 "DEFERRABLE", "FOREIGN", "DROP", "UNION",
133863 "ALL", "EXCEPT", "INTERSECT", "SELECT",
133864 "VALUES", "DISTINCT", "DOT", "FROM",
133865 "JOIN", "USING", "ORDER", "GROUP",
133866 "HAVING", "LIMIT", "WHERE", "INTO",
133867 "INTEGER", "FLOAT", "BLOB", "VARIABLE",
133868 "CASE", "WHEN", "THEN", "ELSE",
133869 "INDEX", "ALTER", "ADD", "error",
133870 "input", "cmdlist", "ecmd", "explain",
133871 "cmdx", "cmd", "transtype", "trans_opt",
133872 "nm", "savepoint_opt", "create_table", "create_table_args",
@@ -134055,185 +134029,186 @@
134055 /* 151 */ "term ::= NULL",
134056 /* 152 */ "expr ::= ID|INDEXED",
134057 /* 153 */ "expr ::= JOIN_KW",
134058 /* 154 */ "expr ::= nm DOT nm",
134059 /* 155 */ "expr ::= nm DOT nm DOT nm",
134060 /* 156 */ "term ::= INTEGER|FLOAT|BLOB",
134061 /* 157 */ "term ::= STRING",
134062 /* 158 */ "expr ::= VARIABLE",
134063 /* 159 */ "expr ::= expr COLLATE ID|STRING",
134064 /* 160 */ "expr ::= CAST LP expr AS typetoken RP",
134065 /* 161 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
134066 /* 162 */ "expr ::= ID|INDEXED LP STAR RP",
134067 /* 163 */ "term ::= CTIME_KW",
134068 /* 164 */ "expr ::= LP nexprlist COMMA expr RP",
134069 /* 165 */ "expr ::= expr AND expr",
134070 /* 166 */ "expr ::= expr OR expr",
134071 /* 167 */ "expr ::= expr LT|GT|GE|LE expr",
134072 /* 168 */ "expr ::= expr EQ|NE expr",
134073 /* 169 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
134074 /* 170 */ "expr ::= expr PLUS|MINUS expr",
134075 /* 171 */ "expr ::= expr STAR|SLASH|REM expr",
134076 /* 172 */ "expr ::= expr CONCAT expr",
134077 /* 173 */ "likeop ::= LIKE_KW|MATCH",
134078 /* 174 */ "likeop ::= NOT LIKE_KW|MATCH",
134079 /* 175 */ "expr ::= expr likeop expr",
134080 /* 176 */ "expr ::= expr likeop expr ESCAPE expr",
134081 /* 177 */ "expr ::= expr ISNULL|NOTNULL",
134082 /* 178 */ "expr ::= expr NOT NULL",
134083 /* 179 */ "expr ::= expr IS expr",
134084 /* 180 */ "expr ::= expr IS NOT expr",
134085 /* 181 */ "expr ::= NOT expr",
134086 /* 182 */ "expr ::= BITNOT expr",
134087 /* 183 */ "expr ::= MINUS expr",
134088 /* 184 */ "expr ::= PLUS expr",
134089 /* 185 */ "between_op ::= BETWEEN",
134090 /* 186 */ "between_op ::= NOT BETWEEN",
134091 /* 187 */ "expr ::= expr between_op expr AND expr",
134092 /* 188 */ "in_op ::= IN",
134093 /* 189 */ "in_op ::= NOT IN",
134094 /* 190 */ "expr ::= expr in_op LP exprlist RP",
134095 /* 191 */ "expr ::= LP select RP",
134096 /* 192 */ "expr ::= expr in_op LP select RP",
134097 /* 193 */ "expr ::= expr in_op nm dbnm paren_exprlist",
134098 /* 194 */ "expr ::= EXISTS LP select RP",
134099 /* 195 */ "expr ::= CASE case_operand case_exprlist case_else END",
134100 /* 196 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
134101 /* 197 */ "case_exprlist ::= WHEN expr THEN expr",
134102 /* 198 */ "case_else ::= ELSE expr",
134103 /* 199 */ "case_else ::=",
134104 /* 200 */ "case_operand ::= expr",
134105 /* 201 */ "case_operand ::=",
134106 /* 202 */ "exprlist ::=",
134107 /* 203 */ "nexprlist ::= nexprlist COMMA expr",
134108 /* 204 */ "nexprlist ::= expr",
134109 /* 205 */ "paren_exprlist ::=",
134110 /* 206 */ "paren_exprlist ::= LP exprlist RP",
134111 /* 207 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
134112 /* 208 */ "uniqueflag ::= UNIQUE",
134113 /* 209 */ "uniqueflag ::=",
134114 /* 210 */ "eidlist_opt ::=",
134115 /* 211 */ "eidlist_opt ::= LP eidlist RP",
134116 /* 212 */ "eidlist ::= eidlist COMMA nm collate sortorder",
134117 /* 213 */ "eidlist ::= nm collate sortorder",
134118 /* 214 */ "collate ::=",
134119 /* 215 */ "collate ::= COLLATE ID|STRING",
134120 /* 216 */ "cmd ::= DROP INDEX ifexists fullname",
134121 /* 217 */ "cmd ::= VACUUM",
134122 /* 218 */ "cmd ::= VACUUM nm",
134123 /* 219 */ "cmd ::= PRAGMA nm dbnm",
134124 /* 220 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
134125 /* 221 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
134126 /* 222 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
134127 /* 223 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
134128 /* 224 */ "plus_num ::= PLUS INTEGER|FLOAT",
134129 /* 225 */ "minus_num ::= MINUS INTEGER|FLOAT",
134130 /* 226 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
134131 /* 227 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
134132 /* 228 */ "trigger_time ::= BEFORE",
134133 /* 229 */ "trigger_time ::= AFTER",
134134 /* 230 */ "trigger_time ::= INSTEAD OF",
134135 /* 231 */ "trigger_time ::=",
134136 /* 232 */ "trigger_event ::= DELETE|INSERT",
134137 /* 233 */ "trigger_event ::= UPDATE",
134138 /* 234 */ "trigger_event ::= UPDATE OF idlist",
134139 /* 235 */ "when_clause ::=",
134140 /* 236 */ "when_clause ::= WHEN expr",
134141 /* 237 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
134142 /* 238 */ "trigger_cmd_list ::= trigger_cmd SEMI",
134143 /* 239 */ "trnm ::= nm DOT nm",
134144 /* 240 */ "tridxby ::= INDEXED BY nm",
134145 /* 241 */ "tridxby ::= NOT INDEXED",
134146 /* 242 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt",
134147 /* 243 */ "trigger_cmd ::= insert_cmd INTO trnm idlist_opt select",
134148 /* 244 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt",
134149 /* 245 */ "trigger_cmd ::= select",
134150 /* 246 */ "expr ::= RAISE LP IGNORE RP",
134151 /* 247 */ "expr ::= RAISE LP raisetype COMMA nm RP",
134152 /* 248 */ "raisetype ::= ROLLBACK",
134153 /* 249 */ "raisetype ::= ABORT",
134154 /* 250 */ "raisetype ::= FAIL",
134155 /* 251 */ "cmd ::= DROP TRIGGER ifexists fullname",
134156 /* 252 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
134157 /* 253 */ "cmd ::= DETACH database_kw_opt expr",
134158 /* 254 */ "key_opt ::=",
134159 /* 255 */ "key_opt ::= KEY expr",
134160 /* 256 */ "cmd ::= REINDEX",
134161 /* 257 */ "cmd ::= REINDEX nm dbnm",
134162 /* 258 */ "cmd ::= ANALYZE",
134163 /* 259 */ "cmd ::= ANALYZE nm dbnm",
134164 /* 260 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
134165 /* 261 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
134166 /* 262 */ "add_column_fullname ::= fullname",
134167 /* 263 */ "cmd ::= create_vtab",
134168 /* 264 */ "cmd ::= create_vtab LP vtabarglist RP",
134169 /* 265 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
134170 /* 266 */ "vtabarg ::=",
134171 /* 267 */ "vtabargtoken ::= ANY",
134172 /* 268 */ "vtabargtoken ::= lp anylist RP",
134173 /* 269 */ "lp ::= LP",
134174 /* 270 */ "with ::=",
134175 /* 271 */ "with ::= WITH wqlist",
134176 /* 272 */ "with ::= WITH RECURSIVE wqlist",
134177 /* 273 */ "wqlist ::= nm eidlist_opt AS LP select RP",
134178 /* 274 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
134179 /* 275 */ "input ::= cmdlist",
134180 /* 276 */ "cmdlist ::= cmdlist ecmd",
134181 /* 277 */ "cmdlist ::= ecmd",
134182 /* 278 */ "ecmd ::= SEMI",
134183 /* 279 */ "ecmd ::= explain cmdx SEMI",
134184 /* 280 */ "explain ::=",
134185 /* 281 */ "trans_opt ::=",
134186 /* 282 */ "trans_opt ::= TRANSACTION",
134187 /* 283 */ "trans_opt ::= TRANSACTION nm",
134188 /* 284 */ "savepoint_opt ::= SAVEPOINT",
134189 /* 285 */ "savepoint_opt ::=",
134190 /* 286 */ "cmd ::= create_table create_table_args",
134191 /* 287 */ "columnlist ::= columnlist COMMA columnname carglist",
134192 /* 288 */ "columnlist ::= columnname carglist",
134193 /* 289 */ "nm ::= ID|INDEXED",
134194 /* 290 */ "nm ::= STRING",
134195 /* 291 */ "nm ::= JOIN_KW",
134196 /* 292 */ "typetoken ::= typename",
134197 /* 293 */ "typename ::= ID|STRING",
134198 /* 294 */ "signed ::= plus_num",
134199 /* 295 */ "signed ::= minus_num",
134200 /* 296 */ "carglist ::= carglist ccons",
134201 /* 297 */ "carglist ::=",
134202 /* 298 */ "ccons ::= NULL onconf",
134203 /* 299 */ "conslist_opt ::= COMMA conslist",
134204 /* 300 */ "conslist ::= conslist tconscomma tcons",
134205 /* 301 */ "conslist ::= tcons",
134206 /* 302 */ "tconscomma ::=",
134207 /* 303 */ "defer_subclause_opt ::= defer_subclause",
134208 /* 304 */ "resolvetype ::= raisetype",
134209 /* 305 */ "selectnowith ::= oneselect",
134210 /* 306 */ "oneselect ::= values",
134211 /* 307 */ "sclp ::= selcollist COMMA",
134212 /* 308 */ "as ::= ID|STRING",
134213 /* 309 */ "expr ::= term",
134214 /* 310 */ "exprlist ::= nexprlist",
134215 /* 311 */ "nmnum ::= plus_num",
134216 /* 312 */ "nmnum ::= nm",
134217 /* 313 */ "nmnum ::= ON",
134218 /* 314 */ "nmnum ::= DELETE",
134219 /* 315 */ "nmnum ::= DEFAULT",
134220 /* 316 */ "plus_num ::= INTEGER|FLOAT",
134221 /* 317 */ "foreach_clause ::=",
134222 /* 318 */ "foreach_clause ::= FOR EACH ROW",
134223 /* 319 */ "trnm ::= nm",
134224 /* 320 */ "tridxby ::=",
134225 /* 321 */ "database_kw_opt ::= DATABASE",
134226 /* 322 */ "database_kw_opt ::=",
134227 /* 323 */ "kwcolumn_opt ::=",
134228 /* 324 */ "kwcolumn_opt ::= COLUMNKW",
134229 /* 325 */ "vtabarglist ::= vtabarg",
134230 /* 326 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
134231 /* 327 */ "vtabarg ::= vtabarg vtabargtoken",
134232 /* 328 */ "anylist ::=",
134233 /* 329 */ "anylist ::= anylist LP anylist RP",
134234 /* 330 */ "anylist ::= anylist ANY",
 
134235 };
134236 #endif /* NDEBUG */
134237
134238
134239 #if YYSTACKDEPTH<=0
@@ -134811,10 +134786,11 @@
134811 { 173, 1 },
134812 { 173, 3 },
134813 { 173, 5 },
134814 { 172, 1 },
134815 { 172, 1 },
 
134816 { 173, 1 },
134817 { 173, 3 },
134818 { 173, 6 },
134819 { 173, 5 },
134820 { 173, 4 },
@@ -135105,11 +135081,11 @@
135105 case 42: /* autoinc ::= */ yytestcase(yyruleno==42);
135106 case 57: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==57);
135107 case 67: /* defer_subclause_opt ::= */ yytestcase(yyruleno==67);
135108 case 76: /* ifexists ::= */ yytestcase(yyruleno==76);
135109 case 90: /* distinct ::= */ yytestcase(yyruleno==90);
135110 case 214: /* collate ::= */ yytestcase(yyruleno==214);
135111 {yymsp[1].minor.yy194 = 0;}
135112 break;
135113 case 17: /* ifnotexists ::= IF NOT EXISTS */
135114 {yymsp[-2].minor.yy194 = 1;}
135115 break;
@@ -135249,13 +135225,13 @@
135249 case 144: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==144);
135250 {yymsp[-1].minor.yy194 = yymsp[0].minor.yy194;}
135251 break;
135252 case 58: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
135253 case 75: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==75);
135254 case 186: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==186);
135255 case 189: /* in_op ::= NOT IN */ yytestcase(yyruleno==189);
135256 case 215: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==215);
135257 {yymsp[-1].minor.yy194 = 1;}
135258 break;
135259 case 59: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
135260 {yymsp[-1].minor.yy194 = 0;}
135261 break;
@@ -135415,13 +135391,13 @@
135415 {yymsp[0].minor.yy194 = SF_All;}
135416 break;
135417 case 91: /* sclp ::= */
135418 case 119: /* orderby_opt ::= */ yytestcase(yyruleno==119);
135419 case 126: /* groupby_opt ::= */ yytestcase(yyruleno==126);
135420 case 202: /* exprlist ::= */ yytestcase(yyruleno==202);
135421 case 205: /* paren_exprlist ::= */ yytestcase(yyruleno==205);
135422 case 210: /* eidlist_opt ::= */ yytestcase(yyruleno==210);
135423 {yymsp[1].minor.yy148 = 0;}
135424 break;
135425 case 92: /* selcollist ::= sclp expr as */
135426 {
135427 yymsp[-2].minor.yy148 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy148, yymsp[-1].minor.yy190.pExpr);
@@ -135435,20 +135411,20 @@
135435 yymsp[-1].minor.yy148 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy148, p);
135436 }
135437 break;
135438 case 94: /* selcollist ::= sclp nm DOT STAR */
135439 {
135440 Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0, &yymsp[0].minor.yy0);
135441 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
135442 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
135443 yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy148, pDot);
135444 }
135445 break;
135446 case 95: /* as ::= AS nm */
135447 case 106: /* dbnm ::= DOT nm */ yytestcase(yyruleno==106);
135448 case 224: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==224);
135449 case 225: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==225);
135450 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
135451 break;
135452 case 97: /* from ::= */
135453 {yymsp[1].minor.yy185 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy185));}
135454 break;
@@ -135527,18 +135503,18 @@
135527 {yymsp[-3].minor.yy194 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
135528 break;
135529 case 112: /* on_opt ::= ON expr */
135530 case 129: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==129);
135531 case 136: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==136);
135532 case 198: /* case_else ::= ELSE expr */ yytestcase(yyruleno==198);
135533 {yymsp[-1].minor.yy72 = yymsp[0].minor.yy190.pExpr;}
135534 break;
135535 case 113: /* on_opt ::= */
135536 case 128: /* having_opt ::= */ yytestcase(yyruleno==128);
135537 case 135: /* where_opt ::= */ yytestcase(yyruleno==135);
135538 case 199: /* case_else ::= */ yytestcase(yyruleno==199);
135539 case 201: /* case_operand ::= */ yytestcase(yyruleno==201);
135540 {yymsp[1].minor.yy72 = 0;}
135541 break;
135542 case 115: /* indexed_opt ::= INDEXED BY nm */
135543 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
135544 break;
@@ -135650,41 +135626,51 @@
135650 break;
135651 case 150: /* expr ::= LP expr RP */
135652 {spanSet(&yymsp[-2].minor.yy190,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-B*/ yymsp[-2].minor.yy190.pExpr = yymsp[-1].minor.yy190.pExpr;}
135653 break;
135654 case 151: /* term ::= NULL */
135655 case 156: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==156);
135656 case 157: /* term ::= STRING */ yytestcase(yyruleno==157);
135657 {spanExpr(&yymsp[0].minor.yy190,pParse,yymsp[0].major,yymsp[0].minor.yy0);/*A-overwrites-X*/}
135658 break;
135659 case 152: /* expr ::= ID|INDEXED */
135660 case 153: /* expr ::= JOIN_KW */ yytestcase(yyruleno==153);
135661 {spanExpr(&yymsp[0].minor.yy190,pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
135662 break;
135663 case 154: /* expr ::= nm DOT nm */
135664 {
135665 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
135666 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
135667 spanSet(&yymsp[-2].minor.yy190,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
135668 yymsp[-2].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
135669 }
135670 break;
135671 case 155: /* expr ::= nm DOT nm DOT nm */
135672 {
135673 Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
135674 Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
135675 Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
135676 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
135677 spanSet(&yymsp[-4].minor.yy190,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
135678 yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
135679 }
135680 break;
135681 case 158: /* expr ::= VARIABLE */
 
 
 
 
 
 
 
 
 
135682 {
135683 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
 
135684 spanExpr(&yymsp[0].minor.yy190, pParse, TK_VARIABLE, yymsp[0].minor.yy0);
135685 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy190.pExpr);
135686 }else{
135687 /* When doing a nested parse, one can include terms in an expression
135688 ** that look like this: #1 #2 ... These terms refer to registers
135689 ** in the virtual machine. #N is the N-th register. */
135690 Token t = yymsp[0].minor.yy0; /*A-overwrites-X*/
@@ -135692,29 +135678,29 @@
135692 spanSet(&yymsp[0].minor.yy190, &t, &t);
135693 if( pParse->nested==0 ){
135694 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
135695 yymsp[0].minor.yy190.pExpr = 0;
135696 }else{
135697 yymsp[0].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &t);
135698 if( yymsp[0].minor.yy190.pExpr ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy190.pExpr->iTable);
135699 }
135700 }
135701 }
135702 break;
135703 case 159: /* expr ::= expr COLLATE ID|STRING */
135704 {
135705 yymsp[-2].minor.yy190.pExpr = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy190.pExpr, &yymsp[0].minor.yy0, 1);
135706 yymsp[-2].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
135707 }
135708 break;
135709 case 160: /* expr ::= CAST LP expr AS typetoken RP */
135710 {
135711 spanSet(&yymsp[-5].minor.yy190,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
135712 yymsp[-5].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy190.pExpr, 0, &yymsp[-1].minor.yy0);
135713 }
135714 break;
135715 case 161: /* expr ::= ID|INDEXED LP distinct exprlist RP */
135716 {
135717 if( yymsp[-1].minor.yy148 && yymsp[-1].minor.yy148->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
135718 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
135719 }
135720 yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy148, &yymsp[-4].minor.yy0);
@@ -135723,25 +135709,25 @@
135723 yylhsminor.yy190.pExpr->flags |= EP_Distinct;
135724 }
135725 }
135726 yymsp[-4].minor.yy190 = yylhsminor.yy190;
135727 break;
135728 case 162: /* expr ::= ID|INDEXED LP STAR RP */
135729 {
135730 yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
135731 spanSet(&yylhsminor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
135732 }
135733 yymsp[-3].minor.yy190 = yylhsminor.yy190;
135734 break;
135735 case 163: /* term ::= CTIME_KW */
135736 {
135737 yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
135738 spanSet(&yylhsminor.yy190, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
135739 }
135740 yymsp[0].minor.yy190 = yylhsminor.yy190;
135741 break;
135742 case 164: /* expr ::= LP nexprlist COMMA expr RP */
135743 {
135744 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy148, yymsp[-1].minor.yy190.pExpr);
135745 yylhsminor.yy190.pExpr = sqlite3PExpr(pParse, TK_VECTOR, 0, 0, 0);
135746 if( yylhsminor.yy190.pExpr ){
135747 yylhsminor.yy190.pExpr->x.pList = pList;
@@ -135750,82 +135736,86 @@
135750 sqlite3ExprListDelete(pParse->db, pList);
135751 }
135752 }
135753 yymsp[-4].minor.yy190 = yylhsminor.yy190;
135754 break;
135755 case 165: /* expr ::= expr AND expr */
135756 case 166: /* expr ::= expr OR expr */ yytestcase(yyruleno==166);
135757 case 167: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==167);
135758 case 168: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==168);
135759 case 169: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==169);
135760 case 170: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==170);
135761 case 171: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==171);
135762 case 172: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==172);
135763 {spanBinaryExpr(pParse,yymsp[-1].major,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy190);}
135764 break;
135765 case 173: /* likeop ::= LIKE_KW|MATCH */
135766 {yymsp[0].minor.yy392.eOperator = yymsp[0].minor.yy0; yymsp[0].minor.yy392.bNot = 0;/*A-overwrites-X*/}
135767 break;
135768 case 174: /* likeop ::= NOT LIKE_KW|MATCH */
135769 {yymsp[-1].minor.yy392.eOperator = yymsp[0].minor.yy0; yymsp[-1].minor.yy392.bNot = 1;}
135770 break;
135771 case 175: /* expr ::= expr likeop expr */
135772 {
135773 ExprList *pList;
 
 
135774 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy190.pExpr);
135775 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy190.pExpr);
135776 yymsp[-2].minor.yy190.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy392.eOperator);
135777 exprNot(pParse, yymsp[-1].minor.yy392.bNot, &yymsp[-2].minor.yy190);
135778 yymsp[-2].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
135779 if( yymsp[-2].minor.yy190.pExpr ) yymsp[-2].minor.yy190.pExpr->flags |= EP_InfixFunc;
135780 }
135781 break;
135782 case 176: /* expr ::= expr likeop expr ESCAPE expr */
135783 {
135784 ExprList *pList;
 
 
135785 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
135786 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy190.pExpr);
135787 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy190.pExpr);
135788 yymsp[-4].minor.yy190.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy392.eOperator);
135789 exprNot(pParse, yymsp[-3].minor.yy392.bNot, &yymsp[-4].minor.yy190);
135790 yymsp[-4].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
135791 if( yymsp[-4].minor.yy190.pExpr ) yymsp[-4].minor.yy190.pExpr->flags |= EP_InfixFunc;
135792 }
135793 break;
135794 case 177: /* expr ::= expr ISNULL|NOTNULL */
135795 {spanUnaryPostfix(pParse,yymsp[0].major,&yymsp[-1].minor.yy190,&yymsp[0].minor.yy0);}
135796 break;
135797 case 178: /* expr ::= expr NOT NULL */
135798 {spanUnaryPostfix(pParse,TK_NOTNULL,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy0);}
135799 break;
135800 case 179: /* expr ::= expr IS expr */
135801 {
135802 spanBinaryExpr(pParse,TK_IS,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy190);
135803 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy190.pExpr, yymsp[-2].minor.yy190.pExpr, TK_ISNULL);
135804 }
135805 break;
135806 case 180: /* expr ::= expr IS NOT expr */
135807 {
135808 spanBinaryExpr(pParse,TK_ISNOT,&yymsp[-3].minor.yy190,&yymsp[0].minor.yy190);
135809 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy190.pExpr, yymsp[-3].minor.yy190.pExpr, TK_NOTNULL);
135810 }
135811 break;
135812 case 181: /* expr ::= NOT expr */
135813 case 182: /* expr ::= BITNOT expr */ yytestcase(yyruleno==182);
135814 {spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,yymsp[-1].major,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
135815 break;
135816 case 183: /* expr ::= MINUS expr */
135817 {spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,TK_UMINUS,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
135818 break;
135819 case 184: /* expr ::= PLUS expr */
135820 {spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,TK_UPLUS,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
135821 break;
135822 case 185: /* between_op ::= BETWEEN */
135823 case 188: /* in_op ::= IN */ yytestcase(yyruleno==188);
135824 {yymsp[0].minor.yy194 = 0;}
135825 break;
135826 case 187: /* expr ::= expr between_op expr AND expr */
135827 {
135828 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
135829 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy190.pExpr);
135830 yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy190.pExpr, 0, 0);
135831 if( yymsp[-4].minor.yy190.pExpr ){
@@ -135835,11 +135825,11 @@
135835 }
135836 exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135837 yymsp[-4].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
135838 }
135839 break;
135840 case 190: /* expr ::= expr in_op LP exprlist RP */
135841 {
135842 if( yymsp[-1].minor.yy148==0 ){
135843 /* Expressions of the form
135844 **
135845 ** expr1 IN ()
@@ -135888,26 +135878,26 @@
135888 exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135889 }
135890 yymsp[-4].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
135891 }
135892 break;
135893 case 191: /* expr ::= LP select RP */
135894 {
135895 spanSet(&yymsp[-2].minor.yy190,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-B*/
135896 yymsp[-2].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
135897 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy190.pExpr, yymsp[-1].minor.yy243);
135898 }
135899 break;
135900 case 192: /* expr ::= expr in_op LP select RP */
135901 {
135902 yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy190.pExpr, 0, 0);
135903 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy190.pExpr, yymsp[-1].minor.yy243);
135904 exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135905 yymsp[-4].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
135906 }
135907 break;
135908 case 193: /* expr ::= expr in_op nm dbnm paren_exprlist */
135909 {
135910 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
135911 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
135912 if( yymsp[0].minor.yy148 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy148);
135913 yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy190.pExpr, 0, 0);
@@ -135914,19 +135904,19 @@
135914 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy190.pExpr, pSelect);
135915 exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135916 yymsp[-4].minor.yy190.zEnd = yymsp[-1].minor.yy0.z ? &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n] : &yymsp[-2].minor.yy0.z[yymsp[-2].minor.yy0.n];
135917 }
135918 break;
135919 case 194: /* expr ::= EXISTS LP select RP */
135920 {
135921 Expr *p;
135922 spanSet(&yymsp[-3].minor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-B*/
135923 p = yymsp[-3].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
135924 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy243);
135925 }
135926 break;
135927 case 195: /* expr ::= CASE case_operand case_exprlist case_else END */
135928 {
135929 spanSet(&yymsp[-4].minor.yy190,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-C*/
135930 yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy72, 0, 0);
135931 if( yymsp[-4].minor.yy190.pExpr ){
135932 yymsp[-4].minor.yy190.pExpr->x.pList = yymsp[-1].minor.yy72 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy148,yymsp[-1].minor.yy72) : yymsp[-2].minor.yy148;
@@ -135935,334 +135925,334 @@
135935 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy148);
135936 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy72);
135937 }
135938 }
135939 break;
135940 case 196: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
135941 {
135942 yymsp[-4].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy148, yymsp[-2].minor.yy190.pExpr);
135943 yymsp[-4].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy148, yymsp[0].minor.yy190.pExpr);
135944 }
135945 break;
135946 case 197: /* case_exprlist ::= WHEN expr THEN expr */
135947 {
135948 yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
135949 yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy148, yymsp[0].minor.yy190.pExpr);
135950 }
135951 break;
135952 case 200: /* case_operand ::= expr */
135953 {yymsp[0].minor.yy72 = yymsp[0].minor.yy190.pExpr; /*A-overwrites-X*/}
135954 break;
135955 case 203: /* nexprlist ::= nexprlist COMMA expr */
135956 {yymsp[-2].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy148,yymsp[0].minor.yy190.pExpr);}
135957 break;
135958 case 204: /* nexprlist ::= expr */
135959 {yymsp[0].minor.yy148 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy190.pExpr); /*A-overwrites-Y*/}
135960 break;
135961 case 206: /* paren_exprlist ::= LP exprlist RP */
135962 case 211: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==211);
135963 {yymsp[-2].minor.yy148 = yymsp[-1].minor.yy148;}
135964 break;
135965 case 207: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
135966 {
135967 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
135968 sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy148, yymsp[-10].minor.yy194,
135969 &yymsp[-11].minor.yy0, yymsp[0].minor.yy72, SQLITE_SO_ASC, yymsp[-8].minor.yy194, SQLITE_IDXTYPE_APPDEF);
135970 }
135971 break;
135972 case 208: /* uniqueflag ::= UNIQUE */
135973 case 249: /* raisetype ::= ABORT */ yytestcase(yyruleno==249);
135974 {yymsp[0].minor.yy194 = OE_Abort;}
135975 break;
135976 case 209: /* uniqueflag ::= */
135977 {yymsp[1].minor.yy194 = OE_None;}
135978 break;
135979 case 212: /* eidlist ::= eidlist COMMA nm collate sortorder */
135980 {
135981 yymsp[-4].minor.yy148 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy148, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy194, yymsp[0].minor.yy194);
135982 }
135983 break;
135984 case 213: /* eidlist ::= nm collate sortorder */
135985 {
135986 yymsp[-2].minor.yy148 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy194, yymsp[0].minor.yy194); /*A-overwrites-Y*/
135987 }
135988 break;
135989 case 216: /* cmd ::= DROP INDEX ifexists fullname */
135990 {sqlite3DropIndex(pParse, yymsp[0].minor.yy185, yymsp[-1].minor.yy194);}
135991 break;
135992 case 217: /* cmd ::= VACUUM */
135993 {sqlite3Vacuum(pParse,0);}
135994 break;
135995 case 218: /* cmd ::= VACUUM nm */
135996 {sqlite3Vacuum(pParse,&yymsp[0].minor.yy0);}
135997 break;
135998 case 219: /* cmd ::= PRAGMA nm dbnm */
135999 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
136000 break;
136001 case 220: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
136002 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
136003 break;
136004 case 221: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
136005 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
136006 break;
136007 case 222: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
136008 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
136009 break;
136010 case 223: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
136011 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
136012 break;
136013 case 226: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
136014 {
136015 Token all;
136016 all.z = yymsp[-3].minor.yy0.z;
136017 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
136018 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy145, &all);
136019 }
136020 break;
136021 case 227: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
136022 {
136023 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy194, yymsp[-4].minor.yy332.a, yymsp[-4].minor.yy332.b, yymsp[-2].minor.yy185, yymsp[0].minor.yy72, yymsp[-10].minor.yy194, yymsp[-8].minor.yy194);
136024 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
136025 }
136026 break;
136027 case 228: /* trigger_time ::= BEFORE */
136028 { yymsp[0].minor.yy194 = TK_BEFORE; }
136029 break;
136030 case 229: /* trigger_time ::= AFTER */
136031 { yymsp[0].minor.yy194 = TK_AFTER; }
136032 break;
136033 case 230: /* trigger_time ::= INSTEAD OF */
136034 { yymsp[-1].minor.yy194 = TK_INSTEAD;}
136035 break;
136036 case 231: /* trigger_time ::= */
136037 { yymsp[1].minor.yy194 = TK_BEFORE; }
136038 break;
136039 case 232: /* trigger_event ::= DELETE|INSERT */
136040 case 233: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==233);
136041 {yymsp[0].minor.yy332.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy332.b = 0;}
136042 break;
136043 case 234: /* trigger_event ::= UPDATE OF idlist */
136044 {yymsp[-2].minor.yy332.a = TK_UPDATE; yymsp[-2].minor.yy332.b = yymsp[0].minor.yy254;}
136045 break;
136046 case 235: /* when_clause ::= */
136047 case 254: /* key_opt ::= */ yytestcase(yyruleno==254);
136048 { yymsp[1].minor.yy72 = 0; }
136049 break;
136050 case 236: /* when_clause ::= WHEN expr */
136051 case 255: /* key_opt ::= KEY expr */ yytestcase(yyruleno==255);
136052 { yymsp[-1].minor.yy72 = yymsp[0].minor.yy190.pExpr; }
136053 break;
136054 case 237: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
136055 {
136056 assert( yymsp[-2].minor.yy145!=0 );
136057 yymsp[-2].minor.yy145->pLast->pNext = yymsp[-1].minor.yy145;
136058 yymsp[-2].minor.yy145->pLast = yymsp[-1].minor.yy145;
136059 }
136060 break;
136061 case 238: /* trigger_cmd_list ::= trigger_cmd SEMI */
136062 {
136063 assert( yymsp[-1].minor.yy145!=0 );
136064 yymsp[-1].minor.yy145->pLast = yymsp[-1].minor.yy145;
136065 }
136066 break;
136067 case 239: /* trnm ::= nm DOT nm */
136068 {
136069 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
136070 sqlite3ErrorMsg(pParse,
136071 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
136072 "statements within triggers");
136073 }
136074 break;
136075 case 240: /* tridxby ::= INDEXED BY nm */
136076 {
136077 sqlite3ErrorMsg(pParse,
136078 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
136079 "within triggers");
136080 }
136081 break;
136082 case 241: /* tridxby ::= NOT INDEXED */
136083 {
136084 sqlite3ErrorMsg(pParse,
136085 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
136086 "within triggers");
136087 }
136088 break;
136089 case 242: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
136090 {yymsp[-6].minor.yy145 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy148, yymsp[0].minor.yy72, yymsp[-5].minor.yy194);}
136091 break;
136092 case 243: /* trigger_cmd ::= insert_cmd INTO trnm idlist_opt select */
136093 {yymsp[-4].minor.yy145 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy254, yymsp[0].minor.yy243, yymsp[-4].minor.yy194);/*A-overwrites-R*/}
136094 break;
136095 case 244: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
136096 {yymsp[-4].minor.yy145 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy72);}
136097 break;
136098 case 245: /* trigger_cmd ::= select */
136099 {yymsp[0].minor.yy145 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy243); /*A-overwrites-X*/}
136100 break;
136101 case 246: /* expr ::= RAISE LP IGNORE RP */
136102 {
136103 spanSet(&yymsp[-3].minor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
136104 yymsp[-3].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
136105 if( yymsp[-3].minor.yy190.pExpr ){
136106 yymsp[-3].minor.yy190.pExpr->affinity = OE_Ignore;
136107 }
136108 }
136109 break;
136110 case 247: /* expr ::= RAISE LP raisetype COMMA nm RP */
136111 {
136112 spanSet(&yymsp[-5].minor.yy190,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
136113 yymsp[-5].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
136114 if( yymsp[-5].minor.yy190.pExpr ) {
136115 yymsp[-5].minor.yy190.pExpr->affinity = (char)yymsp[-3].minor.yy194;
136116 }
136117 }
136118 break;
136119 case 248: /* raisetype ::= ROLLBACK */
136120 {yymsp[0].minor.yy194 = OE_Rollback;}
136121 break;
136122 case 250: /* raisetype ::= FAIL */
136123 {yymsp[0].minor.yy194 = OE_Fail;}
136124 break;
136125 case 251: /* cmd ::= DROP TRIGGER ifexists fullname */
136126 {
136127 sqlite3DropTrigger(pParse,yymsp[0].minor.yy185,yymsp[-1].minor.yy194);
136128 }
136129 break;
136130 case 252: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
136131 {
136132 sqlite3Attach(pParse, yymsp[-3].minor.yy190.pExpr, yymsp[-1].minor.yy190.pExpr, yymsp[0].minor.yy72);
136133 }
136134 break;
136135 case 253: /* cmd ::= DETACH database_kw_opt expr */
136136 {
136137 sqlite3Detach(pParse, yymsp[0].minor.yy190.pExpr);
136138 }
136139 break;
136140 case 256: /* cmd ::= REINDEX */
136141 {sqlite3Reindex(pParse, 0, 0);}
136142 break;
136143 case 257: /* cmd ::= REINDEX nm dbnm */
136144 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
136145 break;
136146 case 258: /* cmd ::= ANALYZE */
136147 {sqlite3Analyze(pParse, 0, 0);}
136148 break;
136149 case 259: /* cmd ::= ANALYZE nm dbnm */
136150 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
136151 break;
136152 case 260: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
136153 {
136154 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy185,&yymsp[0].minor.yy0);
136155 }
136156 break;
136157 case 261: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
136158 {
136159 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
136160 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
136161 }
136162 break;
136163 case 262: /* add_column_fullname ::= fullname */
136164 {
136165 disableLookaside(pParse);
136166 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy185);
136167 }
136168 break;
136169 case 263: /* cmd ::= create_vtab */
136170 {sqlite3VtabFinishParse(pParse,0);}
136171 break;
136172 case 264: /* cmd ::= create_vtab LP vtabarglist RP */
136173 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
136174 break;
136175 case 265: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
136176 {
136177 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy194);
136178 }
136179 break;
136180 case 266: /* vtabarg ::= */
136181 {sqlite3VtabArgInit(pParse);}
136182 break;
136183 case 267: /* vtabargtoken ::= ANY */
136184 case 268: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==268);
136185 case 269: /* lp ::= LP */ yytestcase(yyruleno==269);
136186 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
136187 break;
136188 case 270: /* with ::= */
136189 {yymsp[1].minor.yy285 = 0;}
136190 break;
136191 case 271: /* with ::= WITH wqlist */
136192 { yymsp[-1].minor.yy285 = yymsp[0].minor.yy285; }
136193 break;
136194 case 272: /* with ::= WITH RECURSIVE wqlist */
136195 { yymsp[-2].minor.yy285 = yymsp[0].minor.yy285; }
136196 break;
136197 case 273: /* wqlist ::= nm eidlist_opt AS LP select RP */
136198 {
136199 yymsp[-5].minor.yy285 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy148, yymsp[-1].minor.yy243); /*A-overwrites-X*/
136200 }
136201 break;
136202 case 274: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
136203 {
136204 yymsp[-7].minor.yy285 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy285, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy148, yymsp[-1].minor.yy243);
136205 }
136206 break;
136207 default:
136208 /* (275) input ::= cmdlist */ yytestcase(yyruleno==275);
136209 /* (276) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==276);
136210 /* (277) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=277);
136211 /* (278) ecmd ::= SEMI */ yytestcase(yyruleno==278);
136212 /* (279) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==279);
136213 /* (280) explain ::= */ yytestcase(yyruleno==280);
136214 /* (281) trans_opt ::= */ yytestcase(yyruleno==281);
136215 /* (282) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==282);
136216 /* (283) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==283);
136217 /* (284) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==284);
136218 /* (285) savepoint_opt ::= */ yytestcase(yyruleno==285);
136219 /* (286) cmd ::= create_table create_table_args */ yytestcase(yyruleno==286);
136220 /* (287) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==287);
136221 /* (288) columnlist ::= columnname carglist */ yytestcase(yyruleno==288);
136222 /* (289) nm ::= ID|INDEXED */ yytestcase(yyruleno==289);
136223 /* (290) nm ::= STRING */ yytestcase(yyruleno==290);
136224 /* (291) nm ::= JOIN_KW */ yytestcase(yyruleno==291);
136225 /* (292) typetoken ::= typename */ yytestcase(yyruleno==292);
136226 /* (293) typename ::= ID|STRING */ yytestcase(yyruleno==293);
136227 /* (294) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=294);
136228 /* (295) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=295);
136229 /* (296) carglist ::= carglist ccons */ yytestcase(yyruleno==296);
136230 /* (297) carglist ::= */ yytestcase(yyruleno==297);
136231 /* (298) ccons ::= NULL onconf */ yytestcase(yyruleno==298);
136232 /* (299) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==299);
136233 /* (300) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==300);
136234 /* (301) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=301);
136235 /* (302) tconscomma ::= */ yytestcase(yyruleno==302);
136236 /* (303) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=303);
136237 /* (304) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=304);
136238 /* (305) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=305);
136239 /* (306) oneselect ::= values */ yytestcase(yyruleno==306);
136240 /* (307) sclp ::= selcollist COMMA */ yytestcase(yyruleno==307);
136241 /* (308) as ::= ID|STRING */ yytestcase(yyruleno==308);
136242 /* (309) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=309);
136243 /* (310) exprlist ::= nexprlist */ yytestcase(yyruleno==310);
136244 /* (311) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=311);
136245 /* (312) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=312);
136246 /* (313) nmnum ::= ON */ yytestcase(yyruleno==313);
136247 /* (314) nmnum ::= DELETE */ yytestcase(yyruleno==314);
136248 /* (315) nmnum ::= DEFAULT */ yytestcase(yyruleno==315);
136249 /* (316) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==316);
136250 /* (317) foreach_clause ::= */ yytestcase(yyruleno==317);
136251 /* (318) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==318);
136252 /* (319) trnm ::= nm */ yytestcase(yyruleno==319);
136253 /* (320) tridxby ::= */ yytestcase(yyruleno==320);
136254 /* (321) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==321);
136255 /* (322) database_kw_opt ::= */ yytestcase(yyruleno==322);
136256 /* (323) kwcolumn_opt ::= */ yytestcase(yyruleno==323);
136257 /* (324) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==324);
136258 /* (325) vtabarglist ::= vtabarg */ yytestcase(yyruleno==325);
136259 /* (326) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==326);
136260 /* (327) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==327);
136261 /* (328) anylist ::= */ yytestcase(yyruleno==328);
136262 /* (329) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==329);
136263 /* (330) anylist ::= anylist ANY */ yytestcase(yyruleno==330);
136264 break;
136265 /********** End reduce actions ************************************************/
136266 };
136267 assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
136268 yygoto = yyRuleInfo[yyruleno].lhs;
@@ -136449,11 +136439,11 @@
136449 }
136450 #endif
136451 yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
136452 yymajor = YYNOCODE;
136453 }else{
136454 while( yypParser->yytos >= &yypParser->yystack
136455 && yymx != YYERRORSYMBOL
136456 && (yyact = yy_find_reduce_action(
136457 yypParser->yytos->stateno,
136458 YYERRORSYMBOL)) >= YY_MIN_REDUCE
136459 ){
@@ -181140,11 +181130,11 @@
181140 }
181141 #endif
181142 fts5yy_destructor(fts5yypParser, (fts5YYCODETYPE)fts5yymajor, &fts5yyminorunion);
181143 fts5yymajor = fts5YYNOCODE;
181144 }else{
181145 while( fts5yypParser->fts5yytos >= &fts5yypParser->fts5yystack
181146 && fts5yymx != fts5YYERRORSYMBOL
181147 && (fts5yyact = fts5yy_find_reduce_action(
181148 fts5yypParser->fts5yytos->stateno,
181149 fts5YYERRORSYMBOL)) >= fts5YY_MIN_REDUCE
181150 ){
@@ -195597,11 +195587,11 @@
195597 int nArg, /* Number of args */
195598 sqlite3_value **apUnused /* Function arguments */
195599 ){
195600 assert( nArg==0 );
195601 UNUSED_PARAM2(nArg, apUnused);
195602 sqlite3_result_text(pCtx, "fts5: 2016-09-21 19:43:34 0741812d7fcd558479e4849fbb3ba8d03738d018", -1, SQLITE_TRANSIENT);
195603 }
195604
195605 static int fts5Init(sqlite3 *db){
195606 static const sqlite3_module fts5Mod = {
195607 /* iVersion */ 2,
195608
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -381,11 +381,11 @@
381 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
382 ** [sqlite_version()] and [sqlite_source_id()].
383 */
384 #define SQLITE_VERSION "3.15.0"
385 #define SQLITE_VERSION_NUMBER 3015000
386 #define SQLITE_SOURCE_ID "2016-10-04 12:20:12 3a9d802fda10585654332b314d317250dc5d894e"
387
388 /*
389 ** CAPI3REF: Run-Time Library Version Numbers
390 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
391 **
@@ -8915,11 +8915,11 @@
8915
8916 /*
8917 ** CAPI3REF: Set a table filter on a Session Object.
8918 **
8919 ** The second argument (xFilter) is the "filter callback". For changes to rows
8920 ** in tables that are not attached to the Session object, the filter is called
8921 ** to determine whether changes to the table's rows should be tracked or not.
8922 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8923 ** attached, xFilter will not be called again.
8924 */
8925 void sqlite3session_table_filter(
@@ -9181,11 +9181,11 @@
9181 ** Assuming the changeset blob was created by one of the
9182 ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or
9183 ** [sqlite3changeset_invert()] functions, all changes within the changeset
9184 ** that apply to a single table are grouped together. This means that when
9185 ** an application iterates through a changeset using an iterator created by
9186 ** this function, all changes that relate to a single table are visited
9187 ** consecutively. There is no chance that the iterator will visit a change
9188 ** the applies to table X, then one for table Y, and then later on visit
9189 ** another change for table X.
9190 */
9191 int sqlite3changeset_start(
@@ -9268,11 +9268,11 @@
9268 ** If successful, *pabPK is set to point to an array of nCol entries, where
9269 ** nCol is the number of columns in the table. Elements of *pabPK are set to
9270 ** 0x01 if the corresponding column is part of the tables primary key, or
9271 ** 0x00 if it is not.
9272 **
9273 ** If argument pnCol is not NULL, then *pnCol is set to the number of columns
9274 ** in the table.
9275 **
9276 ** If this function is called when the iterator does not point to a valid
9277 ** entry, SQLITE_MISUSE is returned and the output variables zeroed. Otherwise,
9278 ** SQLITE_OK is returned and the output variables populated as described
@@ -9543,11 +9543,11 @@
9543 ** Rows within the changeset and changegroup are identified by the values in
9544 ** their PRIMARY KEY columns. A change in the changeset is considered to
9545 ** apply to the same row as a change already present in the changegroup if
9546 ** the two rows have the same primary key.
9547 **
9548 ** Changes to rows that do not already appear in the changegroup are
9549 ** simply copied into it. Or, if both the new changeset and the changegroup
9550 ** contain changes that apply to a single row, the final contents of the
9551 ** changegroup depends on the type of each change, as follows:
9552 **
9553 ** <table border=1 style="margin-left:8ex;margin-right:8ex">
@@ -11411,13 +11411,13 @@
11411 #define TK_GROUP 127
11412 #define TK_HAVING 128
11413 #define TK_LIMIT 129
11414 #define TK_WHERE 130
11415 #define TK_INTO 131
11416 #define TK_FLOAT 132
11417 #define TK_BLOB 133
11418 #define TK_INTEGER 134
11419 #define TK_VARIABLE 135
11420 #define TK_CASE 136
11421 #define TK_WHEN 137
11422 #define TK_THEN 138
11423 #define TK_ELSE 139
@@ -12682,12 +12682,12 @@
12682 #define OP_IdxDelete 127 /* synopsis: key=r[P2@P3] */
12683 #define OP_Seek 128 /* synopsis: Move P3 to P1.rowid */
12684 #define OP_IdxRowid 129 /* synopsis: r[P2]=rowid */
12685 #define OP_Destroy 130
12686 #define OP_Clear 131
12687 #define OP_Real 132 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
12688 #define OP_ResetSorter 133
12689 #define OP_CreateIndex 134 /* synopsis: r[P2]=root iDb=P1 */
12690 #define OP_CreateTable 135 /* synopsis: r[P2]=root iDb=P1 */
12691 #define OP_ParseSchema 136
12692 #define OP_LoadAnalysis 137
12693 #define OP_DropTable 138
@@ -12741,11 +12741,11 @@
12741 /* 88 */ 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,\
12742 /* 96 */ 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\
12743 /* 104 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
12744 /* 112 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
12745 /* 120 */ 0x00, 0x00, 0x00, 0x10, 0x00, 0x04, 0x04, 0x00,\
12746 /* 128 */ 0x00, 0x10, 0x10, 0x00, 0x10, 0x00, 0x10, 0x10,\
12747 /* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10,\
12748 /* 144 */ 0x00, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,\
12749 /* 152 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\
12750 /* 160 */ 0x00, 0x00, 0x00,}
12751
@@ -14963,10 +14963,11 @@
14963 #define EP_Unlikely 0x040000 /* unlikely() or likelihood() function */
14964 #define EP_ConstFunc 0x080000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */
14965 #define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */
14966 #define EP_Subquery 0x200000 /* Tree contains a TK_SELECT operator */
14967 #define EP_Alias 0x400000 /* Is an alias for a result set column */
14968 #define EP_Leaf 0x800000 /* Expr.pLeft, .pRight, .u.pSelect all NULL */
14969
14970 /*
14971 ** Combinations of two or more EP_* flags
14972 */
14973 #define EP_Propagate (EP_Collate|EP_Subquery) /* Propagate these bits up tree */
@@ -15514,39 +15515,27 @@
15515 u8 mayAbort; /* True if statement may throw an ABORT exception */
15516 u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */
15517 u8 okConstFactor; /* OK to factor out constants */
15518 u8 disableLookaside; /* Number of times lookaside has been disabled */
15519 u8 nColCache; /* Number of entries in aColCache[] */
 
15520 int nRangeReg; /* Size of the temporary register block */
15521 int iRangeReg; /* First register in temporary register block */
15522 int nErr; /* Number of errors seen */
15523 int nTab; /* Number of previously allocated VDBE cursors */
15524 int nMem; /* Number of memory cells used so far */
 
15525 int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */
15526 int szOpAlloc; /* Bytes of memory space allocated for Vdbe.aOp[] */
 
15527 int ckBase; /* Base register of data during check constraints */
15528 int iSelfTab; /* Table of an index whose exprs are being coded */
15529 int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
15530 int iCacheCnt; /* Counter used to generate aColCache[].lru values */
15531 int nLabel; /* Number of labels used */
15532 int *aLabel; /* Space to hold the labels */
 
 
 
 
 
 
 
 
15533 ExprList *pConstExpr;/* Constant expressions */
15534 Token constraintName;/* Name of the constraint currently being parsed */
15535 yDbMask writeMask; /* Start a write transaction on these databases */
15536 yDbMask cookieMask; /* Bitmask of schema verified databases */
 
15537 int regRowid; /* Register holding rowid of CREATE TABLE entry */
15538 int regRoot; /* Register holding root page number for new objects */
15539 int nMaxArg; /* Max args passed to user function by sub-program */
15540 #if SELECTTRACE_ENABLED
15541 int nSelect; /* Number of SELECT statements seen */
@@ -15555,21 +15544,38 @@
15544 #ifndef SQLITE_OMIT_SHARED_CACHE
15545 int nTableLock; /* Number of locks in aTableLock */
15546 TableLock *aTableLock; /* Required table locks for shared-cache mode */
15547 #endif
15548 AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */
 
 
15549 Parse *pToplevel; /* Parse structure for main program (or NULL) */
15550 Table *pTriggerTab; /* Table triggers are being coded for */
15551 int addrCrTab; /* Address of OP_CreateTable opcode on CREATE TABLE */
15552 u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
15553 u32 oldmask; /* Mask of old.* columns referenced */
15554 u32 newmask; /* Mask of new.* columns referenced */
15555 u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */
15556 u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */
15557 u8 disableTriggers; /* True to disable triggers */
15558
15559 /**************************************************************************
15560 ** Fields above must be initialized to zero. The fields that follow,
15561 ** down to the beginning of the recursive section, do not need to be
15562 ** initialized as they will be set before being used. The boundary is
15563 ** determined by offsetof(Parse,aColCache).
15564 **************************************************************************/
15565
15566 struct yColCache {
15567 int iTable; /* Table cursor number */
15568 i16 iColumn; /* Table column number */
15569 u8 tempReg; /* iReg is a temp register that needs to be freed */
15570 int iLevel; /* Nesting level */
15571 int iReg; /* Reg with value of this column. 0 means none. */
15572 int lru; /* Least recently used entry has the smallest value */
15573 } aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */
15574 int aTempReg[8]; /* Holding area for temporary registers */
15575 Token sNameToken; /* Token with unqualified schema object name */
15576 Token sLastToken; /* The last token parsed */
15577
15578 /************************************************************************
15579 ** Above is constant between recursions. Below is reset before and after
15580 ** each recursion. The boundary between these two regions is determined
15581 ** using offsetof(Parse,nVar) so the nVar field must be the first field
@@ -15582,11 +15588,10 @@
15588 u8 explain; /* True if the EXPLAIN flag is found on the query */
15589 #ifndef SQLITE_OMIT_VIRTUALTABLE
15590 u8 declareVtab; /* True if inside sqlite3_declare_vtab() */
15591 int nVtabLock; /* Number of virtual tables to lock */
15592 #endif
 
15593 int nHeight; /* Expression tree height of current sub-select */
15594 #ifndef SQLITE_OMIT_EXPLAIN
15595 int iSelectId; /* ID of current select for EXPLAIN output */
15596 int iNextSelectId; /* Next available select ID for EXPLAIN output */
15597 #endif
@@ -15594,12 +15599,10 @@
15599 Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
15600 const char *zTail; /* All SQL text past the last semicolon parsed */
15601 Table *pNewTable; /* A table being constructed by CREATE TABLE */
15602 Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */
15603 const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
 
 
15604 #ifndef SQLITE_OMIT_VIRTUALTABLE
15605 Token sArg; /* Complete text of a module argument */
15606 Table **apVtabLock; /* Pointer to virtual tables needing locking */
15607 #endif
15608 Table *pZombieTab; /* List of Table objects to delete after code gen */
@@ -15606,10 +15609,18 @@
15609 TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */
15610 With *pWith; /* Current WITH clause, or NULL */
15611 With *pWithToFree; /* Free this WITH object at the end of the parse */
15612 };
15613
15614 /*
15615 ** Sizes and pointers of various parts of the Parse object.
15616 */
15617 #define PARSE_HDR_SZ offsetof(Parse,aColCache) /* Recursive part w/o aColCache*/
15618 #define PARSE_RECURSE_SZ offsetof(Parse,nVar) /* Recursive part */
15619 #define PARSE_TAIL_SZ (sizeof(Parse)-PARSE_RECURSE_SZ) /* Non-recursive part */
15620 #define PARSE_TAIL(X) (((char*)(X))+PARSE_RECURSE_SZ) /* Pointer to tail */
15621
15622 /*
15623 ** Return true if currently inside an sqlite3_declare_vtab() call.
15624 */
15625 #ifdef SQLITE_OMIT_VIRTUALTABLE
15626 #define IN_DECLARE_VTAB 0
@@ -16169,11 +16180,11 @@
16180 SQLITE_PRIVATE void sqlite3ExprAttachSubtrees(sqlite3*,Expr*,Expr*,Expr*);
16181 SQLITE_PRIVATE Expr *sqlite3PExpr(Parse*, int, Expr*, Expr*, const Token*);
16182 SQLITE_PRIVATE void sqlite3PExprAddSelect(Parse*, Expr*, Select*);
16183 SQLITE_PRIVATE Expr *sqlite3ExprAnd(sqlite3*,Expr*, Expr*);
16184 SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*);
16185 SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*, u32);
16186 SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*);
16187 SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
16188 SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
16189 SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList*,int);
16190 SQLITE_PRIVATE void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int);
@@ -16989,20 +17000,17 @@
17000 ** If x is a lower-case ASCII character, then its upper-case equivalent
17001 ** is (x - 0x20). Therefore toupper() can be implemented as:
17002 **
17003 ** (x & ~(map[x]&0x20))
17004 **
17005 ** The equivalent of tolower() is implemented using the sqlite3UpperToLower[]
17006 ** array. tolower() is used more often than toupper() by SQLite.
17007 **
17008 ** Bit 0x40 is set if the character is non-alphanumeric and can be used in an
17009 ** SQLite identifier. Identifiers are alphanumerics, "_", "$", and any
17010 ** non-ASCII UTF character. Hence the test for whether or not a character is
17011 ** part of an identifier is 0x46.
 
 
 
17012 */
17013 #ifdef SQLITE_ASCII
17014 SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = {
17015 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00..07 ........ */
17016 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, /* 08..0f ........ */
@@ -17071,11 +17079,11 @@
17079 #ifndef SQLITE_SORTER_PMASZ
17080 # define SQLITE_SORTER_PMASZ 250
17081 #endif
17082
17083 /* Statement journals spill to disk when their size exceeds the following
17084 ** threshold (in bytes). 0 means that statement journals are created and
17085 ** written to disk immediately (the default behavior for SQLite versions
17086 ** before 3.12.0). -1 means always keep the entire statement journal in
17087 ** memory. (The statement journal is also always held entirely in memory
17088 ** if journal_mode=MEMORY or if temp_store=MEMORY, regardless of this
17089 ** setting.)
@@ -17159,11 +17167,11 @@
17167
17168 /*
17169 ** The value of the "pending" byte must be 0x40000000 (1 byte past the
17170 ** 1-gibabyte boundary) in a compatible database. SQLite never uses
17171 ** the database page that contains the pending byte. It never attempts
17172 ** to read or write that page. The pending byte page is set aside
17173 ** for use by the VFS layers as space for managing file locks.
17174 **
17175 ** During testing, it is often desirable to move the pending byte to
17176 ** a different position in the file. This allows code that has to
17177 ** deal with the pending byte to run on files that are much smaller
@@ -17719,13 +17727,10 @@
17727 typedef unsigned Bool;
17728
17729 /* Opaque type used by code in vdbesort.c */
17730 typedef struct VdbeSorter VdbeSorter;
17731
 
 
 
17732 /* Elements of the linked list at Vdbe.pAuxData */
17733 typedef struct AuxData AuxData;
17734
17735 /* Types of VDBE cursors */
17736 #define CURTYPE_BTREE 0
@@ -17796,10 +17801,16 @@
17801 /* 2*nField extra array elements allocated for aType[], beyond the one
17802 ** static element declared in the structure. nField total array slots for
17803 ** aType[] and nField+1 array slots for aOffset[] */
17804 };
17805
17806
17807 /*
17808 ** A value for VdbeCursor.cacheStatus that means the cache is always invalid.
17809 */
17810 #define CACHE_STALE 0
17811
17812 /*
17813 ** When a sub-program is executed (OP_Program), a structure of this type
17814 ** is allocated to store the current value of the program counter, as
17815 ** well as the current memory cell array and various other frame specific
17816 ** values stored in the Vdbe struct. When the sub-program is finished,
@@ -17840,15 +17851,10 @@
17851 int nDbChange; /* Value of db->nChange */
17852 };
17853
17854 #define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))])
17855
 
 
 
 
 
17856 /*
17857 ** Internally, the vdbe manipulates nearly all SQL values as Mem
17858 ** structures. Each Mem struct may cache multiple representations (string,
17859 ** integer etc.) of the same value.
17860 */
@@ -17985,22 +17991,10 @@
17991 u8 fErrorOrAux; /* isError!=0 or pVdbe->pAuxData modified */
17992 u8 argc; /* Number of arguments */
17993 sqlite3_value *argv[1]; /* Argument set */
17994 };
17995
 
 
 
 
 
 
 
 
 
 
 
 
17996 /* A bitfield type for use inside of structures. Always follow with :N where
17997 ** N is the number of bits.
17998 */
17999 typedef unsigned bft; /* Bit Field Type */
18000
@@ -18021,57 +18015,61 @@
18015 ** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare()
18016 ** is really a pointer to an instance of this structure.
18017 */
18018 struct Vdbe {
18019 sqlite3 *db; /* The database connection that owns this statement */
18020 Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
18021 Parse *pParse; /* Parsing context used to create this Vdbe */
18022 ynVar nVar; /* Number of entries in aVar[] */
18023 ynVar nzVar; /* Number of entries in azVar[] */
18024 u32 magic; /* Magic number for sanity checking */
18025 int nMem; /* Number of memory locations currently allocated */
18026 int nCursor; /* Number of slots in apCsr[] */
18027 u32 cacheCtr; /* VdbeCursor row cache generation counter */
18028 int pc; /* The program counter */
18029 int rc; /* Value to return */
18030 int nChange; /* Number of db changes made since last reset */
18031 int iStatement; /* Statement number (or 0 if has not opened stmt) */
18032 i64 iCurrentTime; /* Value of julianday('now') for this statement */
18033 i64 nFkConstraint; /* Number of imm. FK constraints this VM */
18034 i64 nStmtDefCons; /* Number of def. constraints when stmt started */
18035 i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
18036
18037 /* When allocating a new Vdbe object, all of the fields below should be
18038 ** initialized to zero or NULL */
18039
18040 Op *aOp; /* Space to hold the virtual machine's program */
18041 Mem *aMem; /* The memory locations */
18042 Mem **apArg; /* Arguments to currently executing user function */
18043 Mem *aColName; /* Column names to return */
18044 Mem *pResultSet; /* Pointer to an array of results */
 
 
 
 
 
18045 char *zErrMsg; /* Error message written here */
 
18046 VdbeCursor **apCsr; /* One element of this array for each open cursor */
18047 Mem *aVar; /* Values for the OP_Variable opcode. */
18048 char **azVar; /* Name of variables */
18049 #ifndef SQLITE_OMIT_TRACE
18050 i64 startTime; /* Time when query started - used for profiling */
18051 #endif
18052 int nOp; /* Number of instructions in the program */
 
18053 #ifdef SQLITE_DEBUG
18054 int rcApp; /* errcode set by sqlite3_result_error_code() */
18055 #endif
18056 u16 nResColumn; /* Number of columns in one row of the result set */
18057 u8 errorAction; /* Recovery action to do in case of an error */
18058 u8 minWriteFileFormat; /* Minimum file format for writable database files */
18059 bft expired:1; /* True if the VM needs to be recompiled */
18060 bft doingRerun:1; /* True if rerunning after an auto-reprepare */
 
18061 bft explain:2; /* True if EXPLAIN present on SQL command */
18062 bft changeCntOn:1; /* True to update the change-counter */
18063 bft runOnlyOnce:1; /* Automatically expire on reset */
18064 bft usesStmtJournal:1; /* True if uses a statement journal */
18065 bft readOnly:1; /* True for statements that do not write */
18066 bft bIsReader:1; /* True for statements that read */
18067 bft isPrepareV2:1; /* True if prepared with prepare_v2() */
 
18068 yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */
18069 yDbMask lockMask; /* Subset of btreeMask that requires a lock */
 
18070 u32 aCounter[5]; /* Counters used by sqlite3_stmt_status() */
 
 
 
 
 
 
 
18071 char *zSql; /* Text of the SQL statement that generated this */
18072 void *pFree; /* Free this when deleting the vdbe */
18073 VdbeFrame *pFrame; /* Parent frame */
18074 VdbeFrame *pDelFrame; /* List of frame objects to free on VM reset */
18075 int nFrame; /* Number of frames in pFrame list */
@@ -18086,14 +18084,15 @@
18084 };
18085
18086 /*
18087 ** The following are allowed values for Vdbe.magic
18088 */
18089 #define VDBE_MAGIC_INIT 0x16bceaa5 /* Building a VDBE program */
18090 #define VDBE_MAGIC_RUN 0x2df20da3 /* VDBE is ready to execute */
18091 #define VDBE_MAGIC_HALT 0x319c2973 /* VDBE has completed execution */
18092 #define VDBE_MAGIC_RESET 0x48fa9f76 /* Reset and ready to run again */
18093 #define VDBE_MAGIC_DEAD 0x5606c3c8 /* The VDBE has been deallocated */
18094
18095 /*
18096 ** Structure used to store the context required by the
18097 ** sqlite3_preupdate_*() API functions.
18098 */
@@ -28775,11 +28774,15 @@
28774 */
28775 static unsigned int strHash(const char *z){
28776 unsigned int h = 0;
28777 unsigned char c;
28778 while( (c = (unsigned char)*z++)!=0 ){ /*OPTIMIZATION-IF-TRUE*/
28779 /* Knuth multiplicative hashing. (Sorting & Searching, p. 510).
28780 ** 0x9e3779b1 is 2654435761 which is the closest prime number to
28781 ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */
28782 h += sqlite3UpperToLower[c];
28783 h *= 0x9e3779b1;
28784 }
28785 return h;
28786 }
28787
28788
@@ -29131,12 +29134,12 @@
29134 /* 127 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
29135 /* 128 */ "Seek" OpHelp("Move P3 to P1.rowid"),
29136 /* 129 */ "IdxRowid" OpHelp("r[P2]=rowid"),
29137 /* 130 */ "Destroy" OpHelp(""),
29138 /* 131 */ "Clear" OpHelp(""),
29139 /* 132 */ "Real" OpHelp("r[P2]=P4"),
29140 /* 133 */ "ResetSorter" OpHelp(""),
29141 /* 134 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"),
29142 /* 135 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"),
29143 /* 136 */ "ParseSchema" OpHelp(""),
29144 /* 137 */ "LoadAnalysis" OpHelp(""),
29145 /* 138 */ "DropTable" OpHelp(""),
@@ -44018,11 +44021,11 @@
44021 ){
44022 PgHdr *pPgHdr;
44023 assert( pPage!=0 );
44024 pPgHdr = (PgHdr*)pPage->pExtra;
44025 assert( pPgHdr->pPage==0 );
44026 memset(&pPgHdr->pDirty, 0, sizeof(PgHdr) - offsetof(PgHdr,pDirty));
44027 pPgHdr->pPage = pPage;
44028 pPgHdr->pData = pPage->pBuf;
44029 pPgHdr->pExtra = (void *)&pPgHdr[1];
44030 memset(pPgHdr->pExtra, 0, pCache->szExtra);
44031 pPgHdr->pCache = pCache;
@@ -58984,11 +58987,11 @@
58987 int bias, /* Bias search to the high end */
58988 int *pRes /* Write search results here */
58989 ){
58990 int rc; /* Status code */
58991 UnpackedRecord *pIdxKey; /* Unpacked index key */
58992 char aSpace[384]; /* Temp space for pIdxKey - to avoid a malloc */
58993 char *pFree = 0;
58994
58995 if( pKey ){
58996 assert( nKey==(i64)(int)nKey );
58997 pIdxKey = sqlite3VdbeAllocUnpackedRecord(
@@ -64321,12 +64324,10 @@
64324 nSrc = pX->nData;
64325 assert( pPage->intKeyLeaf ); /* fillInCell() only called for leaves */
64326 nHeader += putVarint32(&pCell[nHeader], nPayload);
64327 nHeader += putVarint(&pCell[nHeader], *(u64*)&pX->nKey);
64328 }else{
 
 
64329 assert( pX->nKey<=0x7fffffff && pX->pKey!=0 );
64330 nSrc = nPayload = (int)pX->nKey;
64331 pSrc = pX->pKey;
64332 nHeader += putVarint32(&pCell[nHeader], nPayload);
64333 }
@@ -68022,26 +68023,20 @@
68023 */
68024 static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
68025 int i = sqlite3FindDbName(pDb, zDb);
68026
68027 if( i==1 ){
68028 Parse sParse;
68029 int rc = 0;
68030 memset(&sParse, 0, sizeof(sParse));
68031 sParse.db = pDb;
68032 if( sqlite3OpenTempDatabase(&sParse) ){
68033 sqlite3ErrorWithMsg(pErrorDb, sParse.rc, "%s", sParse.zErrMsg);
68034 rc = SQLITE_ERROR;
68035 }
68036 sqlite3DbFree(pErrorDb, sParse.zErrMsg);
68037 sqlite3ParserReset(&sParse);
 
 
 
 
 
 
68038 if( rc ){
68039 return 0;
68040 }
68041 }
68042
@@ -69041,10 +69036,11 @@
69036 assert( (pMem->flags&MEM_RowSet)==0 );
69037 assert( EIGHT_BYTE_ALIGNMENT(pMem) );
69038
69039
69040 if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
69041 pMem->enc = 0;
69042 return SQLITE_NOMEM_BKPT;
69043 }
69044
69045 /* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8
69046 ** string representation of the value. Then, if the required encoding
@@ -70017,14 +70013,11 @@
70013 sqlite3_value *pVal = 0;
70014 int negInt = 1;
70015 const char *zNeg = "";
70016 int rc = SQLITE_OK;
70017
70018 assert( pExpr!=0 );
 
 
 
70019 while( (op = pExpr->op)==TK_UPLUS || op==TK_SPAN ) pExpr = pExpr->pLeft;
70020 if( NEVER(op==TK_REGISTER) ) op = pExpr->op2;
70021
70022 /* Compressed expressions only appear when parsing the DEFAULT clause
70023 ** on a table column definition, and hence only when pCtx==0. This
@@ -70144,11 +70137,11 @@
70137 Expr *pExpr, /* The expression to evaluate */
70138 u8 enc, /* Encoding to use */
70139 u8 affinity, /* Affinity to use */
70140 sqlite3_value **ppVal /* Write the new value here */
70141 ){
70142 return pExpr ? valueFromExpr(db, pExpr, enc, affinity, ppVal, 0) : 0;
70143 }
70144
70145 #ifdef SQLITE_ENABLE_STAT3_OR_STAT4
70146 /*
70147 ** The implementation of the sqlite_record() function. This function accepts
@@ -70487,12 +70480,13 @@
70480 ** Create a new virtual database engine.
70481 */
70482 SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse *pParse){
70483 sqlite3 *db = pParse->db;
70484 Vdbe *p;
70485 p = sqlite3DbMallocRawNN(db, sizeof(Vdbe) );
70486 if( p==0 ) return 0;
70487 memset(&p->aOp, 0, sizeof(Vdbe)-offsetof(Vdbe,aOp));
70488 p->db = db;
70489 if( db->pVdbe ){
70490 db->pVdbe->pPrev = p;
70491 }
70492 p->pNext = db->pVdbe;
@@ -70650,13 +70644,12 @@
70644 #endif
70645 #ifdef SQLITE_DEBUG
70646 if( p->db->flags & SQLITE_VdbeAddopTrace ){
70647 int jj, kk;
70648 Parse *pParse = p->pParse;
70649 for(jj=kk=0; jj<pParse->nColCache; jj++){
70650 struct yColCache *x = pParse->aColCache + jj;
 
70651 printf(" r[%d]={%d:%d}", x->iReg, x->iTable, x->iColumn);
70652 kk++;
70653 }
70654 if( kk ) printf("\n");
70655 sqlite3VdbePrintOp(0, i, &p->aOp[i]);
@@ -70840,11 +70833,10 @@
70833 assert( j<p->nLabel );
70834 assert( j>=0 );
70835 if( p->aLabel ){
70836 p->aLabel[j] = v->nOp;
70837 }
 
70838 }
70839
70840 /*
70841 ** Mark the VDBE as one that can only be run one time.
70842 */
@@ -71231,19 +71223,19 @@
71223 }
71224 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, u32 addr, int val){
71225 sqlite3VdbeGetOp(p,addr)->p3 = val;
71226 }
71227 SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe *p, u8 p5){
71228 assert( p->nOp>0 || p->db->mallocFailed );
71229 if( p->nOp>0 ) p->aOp[p->nOp-1].p5 = p5;
71230 }
71231
71232 /*
71233 ** Change the P2 operand of instruction addr so that it points to
71234 ** the address of the next instruction to be coded.
71235 */
71236 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
 
71237 sqlite3VdbeChangeP2(p, addr, p->nOp);
71238 }
71239
71240
71241 /*
@@ -71362,11 +71354,11 @@
71354 /*
71355 ** If the last opcode is "op" and it is not a jump destination,
71356 ** then remove it. Return true if and only if an opcode was removed.
71357 */
71358 SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){
71359 if( p->nOp>0 && p->aOp[p->nOp-1].opcode==op ){
71360 return sqlite3VdbeChangeToNoop(p, p->nOp-1);
71361 }else{
71362 return 0;
71363 }
71364 }
@@ -71924,10 +71916,25 @@
71916 zCom
71917 );
71918 fflush(pOut);
71919 }
71920 #endif
71921
71922 /*
71923 ** Initialize an array of N Mem element.
71924 */
71925 static void initMemArray(Mem *p, int N, sqlite3 *db, u16 flags){
71926 while( (N--)>0 ){
71927 p->db = db;
71928 p->flags = flags;
71929 p->szMalloc = 0;
71930 #ifdef SQLITE_DEBUG
71931 p->pScopyFrom = 0;
71932 #endif
71933 p++;
71934 }
71935 }
71936
71937 /*
71938 ** Release an array of N Mem elements
71939 */
71940 static void releaseMemArray(Mem *p, int N){
@@ -72136,10 +72143,11 @@
72143 return SQLITE_ERROR;
72144 }
72145 pMem->flags = MEM_Str|MEM_Term;
72146 zP4 = displayP4(pOp, pMem->z, pMem->szMalloc);
72147 if( zP4!=pMem->z ){
72148 pMem->n = 0;
72149 sqlite3VdbeMemSetStr(pMem, zP4, -1, SQLITE_UTF8, 0);
72150 }else{
72151 assert( pMem->z!=0 );
72152 pMem->n = sqlite3Strlen30(pMem->z);
72153 pMem->enc = SQLITE_UTF8;
@@ -72278,11 +72286,11 @@
72286 SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *p){
72287 #if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
72288 int i;
72289 #endif
72290 assert( p!=0 );
72291 assert( p->magic==VDBE_MAGIC_INIT || p->magic==VDBE_MAGIC_RESET );
72292
72293 /* There should be at least one opcode.
72294 */
72295 assert( p->nOp>0 );
72296
@@ -72367,14 +72375,11 @@
72375 n = ROUND8(sizeof(Op)*p->nOp); /* Bytes of opcode memory used */
72376 x.pSpace = &((u8*)p->aOp)[n]; /* Unused opcode memory */
72377 assert( EIGHT_BYTE_ALIGNMENT(x.pSpace) );
72378 x.nFree = ROUNDDOWN8(pParse->szOpAlloc - n); /* Bytes of unused memory */
72379 assert( x.nFree>=0 );
72380 assert( EIGHT_BYTE_ALIGNMENT(&x.pSpace[x.nFree]) );
 
 
 
72381
72382 resolveP2Values(p, &nArg);
72383 p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort);
72384 if( pParse->explain && nMem<10 ){
72385 nMem = 10;
@@ -72399,34 +72404,34 @@
72404 p->apCsr = allocSpace(&x, p->apCsr, nCursor*sizeof(VdbeCursor*));
72405 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
72406 p->anExec = allocSpace(&x, p->anExec, p->nOp*sizeof(i64));
72407 #endif
72408 if( x.nNeeded==0 ) break;
72409 x.pSpace = p->pFree = sqlite3DbMallocRawNN(db, x.nNeeded);
72410 x.nFree = x.nNeeded;
72411 }while( !db->mallocFailed );
72412
 
 
 
 
 
 
 
 
72413 p->nzVar = pParse->nzVar;
72414 p->azVar = pParse->azVar;
72415 pParse->nzVar = 0;
72416 pParse->azVar = 0;
 
 
 
 
 
 
 
72417 p->explain = pParse->explain;
72418 if( db->mallocFailed ){
72419 p->nVar = 0;
72420 p->nCursor = 0;
72421 p->nMem = 0;
72422 }else{
72423 p->nCursor = nCursor;
72424 p->nVar = (ynVar)nVar;
72425 initMemArray(p->aVar, nVar, db, MEM_Null);
72426 p->nMem = nMem;
72427 initMemArray(p->aMem, nMem, db, MEM_Undefined);
72428 memset(p->apCsr, 0, nCursor*sizeof(VdbeCursor*));
72429 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
72430 memset(p->anExec, 0, p->nOp*sizeof(i64));
72431 #endif
72432 }
72433 sqlite3VdbeRewind(p);
72434 }
72435
72436 /*
72437 ** Close a VDBE cursor and release all the resources that cursor
@@ -72574,17 +72579,13 @@
72579
72580 releaseMemArray(p->aColName, p->nResColumn*COLNAME_N);
72581 sqlite3DbFree(db, p->aColName);
72582 n = nResColumn*COLNAME_N;
72583 p->nResColumn = (u16)nResColumn;
72584 p->aColName = pColName = (Mem*)sqlite3DbMallocRawNN(db, sizeof(Mem)*n );
72585 if( p->aColName==0 ) return;
72586 initMemArray(p->aColName, n, p->db, MEM_Null);
 
 
 
 
72587 }
72588
72589 /*
72590 ** Set the name of the idx'th column to be returned by the SQL statement.
72591 ** zName must be a pointer to a nul terminated string.
@@ -73342,11 +73343,11 @@
73343 fclose(out);
73344 }
73345 }
73346 #endif
73347 p->iCurrentTime = 0;
73348 p->magic = VDBE_MAGIC_RESET;
73349 return p->rc & db->errMask;
73350 }
73351
73352 /*
73353 ** Clean up and delete a VDBE after execution. Return an integer which is
@@ -73406,23 +73407,25 @@
73407 */
73408 SQLITE_PRIVATE void sqlite3VdbeClearObject(sqlite3 *db, Vdbe *p){
73409 SubProgram *pSub, *pNext;
73410 int i;
73411 assert( p->db==0 || p->db==db );
 
73412 releaseMemArray(p->aColName, p->nResColumn*COLNAME_N);
73413 for(pSub=p->pProgram; pSub; pSub=pNext){
73414 pNext = pSub->pNext;
73415 vdbeFreeOpArray(db, pSub->aOp, pSub->nOp);
73416 sqlite3DbFree(db, pSub);
73417 }
73418 if( p->magic!=VDBE_MAGIC_INIT ){
73419 releaseMemArray(p->aVar, p->nVar);
73420 for(i=p->nzVar-1; i>=0; i--) sqlite3DbFree(db, p->azVar[i]);
73421 sqlite3DbFree(db, p->azVar);
73422 sqlite3DbFree(db, p->pFree);
73423 }
73424 vdbeFreeOpArray(db, p->aOp, p->nOp);
73425 sqlite3DbFree(db, p->aColName);
73426 sqlite3DbFree(db, p->zSql);
 
73427 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
73428 for(i=0; i<p->nScan; i++){
73429 sqlite3DbFree(db, p->aScan[i].zName);
73430 }
73431 sqlite3DbFree(db, p->aScan);
@@ -76047,18 +76050,17 @@
76050 static Mem *columnMem(sqlite3_stmt *pStmt, int i){
76051 Vdbe *pVm;
76052 Mem *pOut;
76053
76054 pVm = (Vdbe *)pStmt;
76055 if( pVm==0 ) return (Mem*)columnNullValue();
76056 assert( pVm->db );
76057 sqlite3_mutex_enter(pVm->db->mutex);
76058 if( pVm->pResultSet!=0 && i<pVm->nResColumn && i>=0 ){
76059 pOut = &pVm->pResultSet[i];
76060 }else{
76061 sqlite3Error(pVm->db, SQLITE_RANGE);
 
 
 
76062 pOut = (Mem*)columnNullValue();
76063 }
76064 return pOut;
76065 }
76066
@@ -76087,10 +76089,12 @@
76089 ** SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR
76090 ** and _finalize() will return NOMEM.
76091 */
76092 Vdbe *p = (Vdbe *)pStmt;
76093 if( p ){
76094 assert( p->db!=0 );
76095 assert( sqlite3_mutex_held(p->db->mutex) );
76096 p->rc = sqlite3ApiExit(p->db, p->rc);
76097 sqlite3_mutex_leave(p->db->mutex);
76098 }
76099 }
76100
@@ -76663,11 +76667,11 @@
76667 /*
76668 ** Return true if the prepared statement is in need of being reset.
76669 */
76670 SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
76671 Vdbe *v = (Vdbe*)pStmt;
76672 return v!=0 && v->magic==VDBE_MAGIC_RUN && v->pc>=0;
76673 }
76674
76675 /*
76676 ** Return a pointer to the next prepared statement after pStmt associated
76677 ** with database connection pDb. If pStmt is NULL, return the first
@@ -78415,15 +78419,17 @@
78419 u16 nullFlag;
78420 pOut = out2Prerelease(p, pOp);
78421 cnt = pOp->p3-pOp->p2;
78422 assert( pOp->p3<=(p->nMem+1 - p->nCursor) );
78423 pOut->flags = nullFlag = pOp->p1 ? (MEM_Null|MEM_Cleared) : MEM_Null;
78424 pOut->n = 0;
78425 while( cnt>0 ){
78426 pOut++;
78427 memAboutToChange(p, pOut);
78428 sqlite3VdbeMemSetNull(pOut);
78429 pOut->flags = nullFlag;
78430 pOut->n = 0;
78431 cnt--;
78432 }
78433 break;
78434 }
78435
@@ -80487,14 +80493,13 @@
80493 p->nStmtDefCons = db->nDeferredCons;
80494 p->nStmtDefImmCons = db->nDeferredImmCons;
80495 }
80496
80497 /* Gather the schema version number for checking:
80498 ** IMPLEMENTATION-OF: R-03189-51135 As each SQL statement runs, the schema
80499 ** version is checked to ensure that the schema has not changed since the
80500 ** SQL statement was prepared.
 
80501 */
80502 sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&iMeta);
80503 iGen = db->aDb[pOp->p1].pSchema->iGeneration;
80504 }else{
80505 iGen = iMeta = 0;
@@ -81746,11 +81751,11 @@
81751 ** change count is incremented (otherwise not).
81752 **
81753 ** P1 must not be pseudo-table. It has to be a real table with
81754 ** multiple rows.
81755 **
81756 ** If P4 is not NULL then it points to a Table object. In this case either
81757 ** the update or pre-update hook, or both, may be invoked. The P1 cursor must
81758 ** have been positioned using OP_NotFound prior to invoking this opcode in
81759 ** this case. Specifically, if one is configured, the pre-update hook is
81760 ** invoked if P4 is not NULL. The update-hook is invoked if one is configured,
81761 ** P4 is not NULL, and the OPFLAG_NCHANGE flag is set in P2.
@@ -82337,13 +82342,10 @@
82342 if( pOp->opcode==OP_SorterInsert ){
82343 rc = sqlite3VdbeSorterWrite(pC, pIn2);
82344 }else{
82345 x.nKey = pIn2->n;
82346 x.pKey = pIn2->z;
 
 
 
82347 rc = sqlite3BtreeInsert(pC->uc.pCursor, &x, pOp->p3,
82348 ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0)
82349 );
82350 assert( pC->deferredMoveto==0 );
82351 pC->cacheStatus = CACHE_STALE;
@@ -88036,11 +88038,13 @@
88038 static SQLITE_NOINLINE int walkExpr(Walker *pWalker, Expr *pExpr){
88039 int rc;
88040 testcase( ExprHasProperty(pExpr, EP_TokenOnly) );
88041 testcase( ExprHasProperty(pExpr, EP_Reduced) );
88042 rc = pWalker->xExprCallback(pWalker, pExpr);
88043 if( rc || ExprHasProperty(pExpr,(EP_TokenOnly|EP_Leaf)) ){
88044 return rc & WRC_Abort;
88045 }
88046 if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort;
88047 if( pExpr->pRight && walkExpr(pWalker, pExpr->pRight) ) return WRC_Abort;
88048 if( ExprHasProperty(pExpr, EP_xIsSelect) ){
88049 if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort;
88050 }else if( pExpr->x.pList ){
@@ -88780,11 +88784,10 @@
88784 const char *zDb;
88785 Expr *pRight;
88786
88787 /* if( pSrcList==0 ) break; */
88788 notValid(pParse, pNC, "the \".\" operator", NC_IdxExpr);
 
88789 pRight = pExpr->pRight;
88790 if( pRight->op==TK_ID ){
88791 zDb = 0;
88792 zTable = pExpr->pLeft->u.zToken;
88793 zColumn = pRight->u.zToken;
@@ -88809,11 +88812,11 @@
88812 const char *zId; /* The function name. */
88813 FuncDef *pDef; /* Information about the function */
88814 u8 enc = ENC(pParse->db); /* The database encoding */
88815
88816 assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
88817 // notValid(pParse, pNC, "functions", NC_PartIdx);
88818 zId = pExpr->u.zToken;
88819 nId = sqlite3Strlen30(zId);
88820 pDef = sqlite3FindFunction(pParse->db, zId, n, enc, 0);
88821 if( pDef==0 ){
88822 pDef = sqlite3FindFunction(pParse->db, zId, -2, enc, 0);
@@ -88869,11 +88872,12 @@
88872 }
88873 if( (pDef->funcFlags & SQLITE_FUNC_CONSTANT)==0 ){
88874 /* Date/time functions that use 'now', and other functions like
88875 ** sqlite_version() that might change over time cannot be used
88876 ** in an index. */
88877 notValid(pParse, pNC, "non-deterministic functions",
88878 NC_IdxExpr|NC_PartIdx);
88879 }
88880 }
88881 if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){
88882 sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
88883 pNC->nErr++;
@@ -90409,11 +90413,11 @@
90413 ** stored in u.zToken. Instead, the integer values is written
90414 ** into u.iValue and the EP_IntValue flag is set. No extra storage
90415 ** is allocated to hold the integer text and the dequote flag is ignored.
90416 */
90417 SQLITE_PRIVATE Expr *sqlite3ExprAlloc(
90418 sqlite3 *db, /* Handle for sqlite3DbMallocRawNN() */
90419 int op, /* Expression opcode */
90420 const Token *pToken, /* Token argument. Might be NULL */
90421 int dequote /* True to dequote */
90422 ){
90423 Expr *pNew;
@@ -90627,40 +90631,40 @@
90631 ** Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number
90632 ** as the previous instance of the same wildcard. Or if this is the first
90633 ** instance of the wildcard, the next sequential variable number is
90634 ** assigned.
90635 */
90636 SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr, u32 n){
90637 sqlite3 *db = pParse->db;
90638 const char *z;
90639
90640 if( pExpr==0 ) return;
90641 assert( !ExprHasProperty(pExpr, EP_IntValue|EP_Reduced|EP_TokenOnly) );
90642 z = pExpr->u.zToken;
90643 assert( z!=0 );
90644 assert( z[0]!=0 );
90645 assert( n==sqlite3Strlen30(z) );
90646 if( z[1]==0 ){
90647 /* Wildcard of the form "?". Assign the next variable number */
90648 assert( z[0]=='?' );
90649 pExpr->iColumn = (ynVar)(++pParse->nVar);
90650 }else{
90651 ynVar x;
 
90652 if( z[0]=='?' ){
90653 /* Wildcard of the form "?nnn". Convert "nnn" to an integer and
90654 ** use it as the variable number */
90655 i64 i;
90656 int bOk = 0==sqlite3Atoi64(&z[1], &i, n-1, SQLITE_UTF8);
90657 x = (ynVar)i;
90658 testcase( i==0 );
90659 testcase( i==1 );
90660 testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 );
90661 testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] );
90662 if( bOk==0 || i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
90663 sqlite3ErrorMsg(pParse, "variable number must be between ?1 and ?%d",
90664 db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]);
90665 return;
90666 }
90667 if( i>pParse->nVar ){
90668 pParse->nVar = (int)i;
90669 }
90670 }else{
@@ -90667,37 +90671,35 @@
90671 /* Wildcards like ":aaa", "$aaa" or "@aaa". Reuse the same variable
90672 ** number as the prior appearance of the same name, or if the name
90673 ** has never appeared before, reuse the same variable number
90674 */
90675 ynVar i;
90676 for(i=x=0; i<pParse->nzVar; i++){
90677 if( pParse->azVar[i] && strcmp(pParse->azVar[i],z)==0 ){
90678 x = (ynVar)i+1;
90679 break;
90680 }
90681 }
90682 if( x==0 ) x = (ynVar)(++pParse->nVar);
90683 }
90684 pExpr->iColumn = x;
90685 if( x>pParse->nzVar ){
90686 char **a;
90687 a = sqlite3DbRealloc(db, pParse->azVar, x*sizeof(a[0]));
90688 if( a==0 ){
90689 assert( db->mallocFailed ); /* Error reported through mallocFailed */
90690 return;
90691 }
90692 pParse->azVar = a;
90693 memset(&a[pParse->nzVar], 0, (x-pParse->nzVar)*sizeof(a[0]));
90694 pParse->nzVar = x;
90695 }
90696 if( pParse->azVar[x-1]==0 ){
90697 pParse->azVar[x-1] = sqlite3DbStrNDup(db, z, n);
90698 }
90699 }
90700 if( pParse->nVar>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
 
 
90701 sqlite3ErrorMsg(pParse, "too many SQL variables");
90702 }
90703 }
90704
90705 /*
@@ -90705,22 +90707,29 @@
90707 */
90708 static SQLITE_NOINLINE void sqlite3ExprDeleteNN(sqlite3 *db, Expr *p){
90709 assert( p!=0 );
90710 /* Sanity check: Assert that the IntValue is non-negative if it exists */
90711 assert( !ExprHasProperty(p, EP_IntValue) || p->u.iValue>=0 );
90712 #ifdef SQLITE_DEBUG
90713 if( ExprHasProperty(p, EP_Leaf) && !ExprHasProperty(p, EP_TokenOnly) ){
90714 assert( p->pLeft==0 );
90715 assert( p->pRight==0 );
90716 assert( p->x.pSelect==0 );
90717 }
90718 #endif
90719 if( !ExprHasProperty(p, (EP_TokenOnly|EP_Leaf)) ){
90720 /* The Expr.x union is never used at the same time as Expr.pRight */
90721 assert( p->x.pList==0 || p->pRight==0 );
90722 if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft);
90723 sqlite3ExprDelete(db, p->pRight);
 
90724 if( ExprHasProperty(p, EP_xIsSelect) ){
90725 sqlite3SelectDelete(db, p->x.pSelect);
90726 }else{
90727 sqlite3ExprListDelete(db, p->x.pList);
90728 }
90729 }
90730 if( ExprHasProperty(p, EP_MemToken) ) sqlite3DbFree(db, p->u.zToken);
90731 if( !ExprHasProperty(p, EP_Static) ){
90732 sqlite3DbFree(db, p);
90733 }
90734 }
90735 SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){
@@ -90893,11 +90902,11 @@
90902 if( nToken ){
90903 char *zToken = pNew->u.zToken = (char*)&zAlloc[nNewSize];
90904 memcpy(zToken, p->u.zToken, nToken);
90905 }
90906
90907 if( 0==((p->flags|pNew->flags) & (EP_TokenOnly|EP_Leaf)) ){
90908 /* Fill in the pNew->x.pSelect or pNew->x.pList member. */
90909 if( ExprHasProperty(p, EP_xIsSelect) ){
90910 pNew->x.pSelect = sqlite3SelectDup(db, p->x.pSelect, dupFlags);
90911 }else{
90912 pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, dupFlags);
@@ -90905,21 +90914,21 @@
90914 }
90915
90916 /* Fill in pNew->pLeft and pNew->pRight. */
90917 if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly) ){
90918 zAlloc += dupedExprNodeSize(p, dupFlags);
90919 if( !ExprHasProperty(pNew, EP_TokenOnly|EP_Leaf) ){
90920 pNew->pLeft = p->pLeft ?
90921 exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0;
90922 pNew->pRight = p->pRight ?
90923 exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0;
90924 }
90925 if( pzBuffer ){
90926 *pzBuffer = zAlloc;
90927 }
90928 }else{
90929 if( !ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){
90930 if( pNew->op==TK_SELECT_COLUMN ){
90931 pNew->pLeft = p->pLeft;
90932 }else{
90933 pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
90934 }
@@ -92276,12 +92285,12 @@
92285 dest.eDest = SRT_Exists;
92286 sqlite3VdbeAddOp2(v, OP_Integer, 0, dest.iSDParm);
92287 VdbeComment((v, "Init EXISTS result"));
92288 }
92289 sqlite3ExprDelete(pParse->db, pSel->pLimit);
92290 pSel->pLimit = sqlite3ExprAlloc(pParse->db, TK_INTEGER,
92291 &sqlite3IntTokens[1], 0);
92292 pSel->iLimit = 0;
92293 pSel->selFlags &= ~SF_MultiValue;
92294 if( sqlite3Select(pParse, pSel, &dest) ){
92295 return 0;
92296 }
@@ -92646,36 +92655,23 @@
92655 #endif
92656 }
92657 }
92658 }
92659
92660 /*
92661 ** Erase column-cache entry number i
92662 */
92663 static void cacheEntryClear(Parse *pParse, int i){
92664 if( pParse->aColCache[i].tempReg ){
 
 
 
 
 
 
 
 
 
 
 
 
 
92665 if( pParse->nTempReg<ArraySize(pParse->aTempReg) ){
92666 pParse->aTempReg[pParse->nTempReg++] = pParse->aColCache[i].iReg;
92667 }
 
92668 }
 
92669 pParse->nColCache--;
92670 if( i<pParse->nColCache ){
92671 pParse->aColCache[i] = pParse->aColCache[pParse->nColCache];
92672 }
92673 }
92674
92675
92676 /*
92677 ** Record in the column cache that a particular column from a
@@ -92701,64 +92697,52 @@
92697 **
92698 ** Actually, the way the column cache is currently used, we are guaranteed
92699 ** that the object will never already be in cache. Verify this guarantee.
92700 */
92701 #ifndef NDEBUG
92702 for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
92703 assert( p->iTable!=iTab || p->iColumn!=iCol );
92704 }
92705 #endif
92706
92707 /* If the cache is already full, delete the least recently used entry */
92708 if( pParse->nColCache>=SQLITE_N_COLCACHE ){
92709 minLru = 0x7fffffff;
92710 idxLru = -1;
92711 for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
92712 if( p->lru<minLru ){
92713 idxLru = i;
92714 minLru = p->lru;
92715 }
92716 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92717 p = &pParse->aColCache[idxLru];
92718 }else{
92719 p = &pParse->aColCache[pParse->nColCache++];
92720 }
92721
92722 /* Add the new entry to the end of the cache */
92723 p->iLevel = pParse->iCacheLevel;
92724 p->iTable = iTab;
92725 p->iColumn = iCol;
92726 p->iReg = iReg;
92727 p->tempReg = 0;
92728 p->lru = pParse->iCacheCnt++;
92729 }
92730
92731 /*
92732 ** Indicate that registers between iReg..iReg+nReg-1 are being overwritten.
92733 ** Purge the range of registers from the column cache.
92734 */
92735 SQLITE_PRIVATE void sqlite3ExprCacheRemove(Parse *pParse, int iReg, int nReg){
92736 int i = 0;
92737 while( i<pParse->nColCache ){
92738 struct yColCache *p = &pParse->aColCache[i];
92739 if( p->iReg >= iReg && p->iReg < iReg+nReg ){
92740 cacheEntryClear(pParse, i);
92741 }else{
92742 i++;
92743 }
92744 }
92745 }
92746
92747 /*
92748 ** Remember the current column cache context. Any new entries added
@@ -92778,22 +92762,23 @@
92762 ** Remove from the column cache any entries that were added since the
92763 ** the previous sqlite3ExprCachePush operation. In other words, restore
92764 ** the cache to the state it was in prior the most recent Push.
92765 */
92766 SQLITE_PRIVATE void sqlite3ExprCachePop(Parse *pParse){
92767 int i = 0;
 
92768 assert( pParse->iCacheLevel>=1 );
92769 pParse->iCacheLevel--;
92770 #ifdef SQLITE_DEBUG
92771 if( pParse->db->flags & SQLITE_VdbeAddopTrace ){
92772 printf("POP to %d\n", pParse->iCacheLevel);
92773 }
92774 #endif
92775 while( i<pParse->nColCache ){
92776 if( pParse->aColCache[i].iLevel>pParse->iCacheLevel ){
92777 cacheEntryClear(pParse, i);
92778 }else{
92779 i++;
92780 }
92781 }
92782 }
92783
92784 /*
@@ -92803,11 +92788,11 @@
92788 ** get them all.
92789 */
92790 static void sqlite3ExprCachePinRegister(Parse *pParse, int iReg){
92791 int i;
92792 struct yColCache *p;
92793 for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
92794 if( p->iReg==iReg ){
92795 p->tempReg = 0;
92796 }
92797 }
92798 }
@@ -92881,12 +92866,12 @@
92866 ){
92867 Vdbe *v = pParse->pVdbe;
92868 int i;
92869 struct yColCache *p;
92870
92871 for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
92872 if( p->iTable==iTable && p->iColumn==iColumn ){
92873 p->lru = pParse->iCacheCnt++;
92874 sqlite3ExprCachePinRegister(pParse, p->iReg);
92875 return p->iReg;
92876 }
92877 }
@@ -92914,22 +92899,24 @@
92899 /*
92900 ** Clear all column cache entries.
92901 */
92902 SQLITE_PRIVATE void sqlite3ExprCacheClear(Parse *pParse){
92903 int i;
 
92904
92905 #if SQLITE_DEBUG
92906 if( pParse->db->flags & SQLITE_VdbeAddopTrace ){
92907 printf("CLEAR\n");
92908 }
92909 #endif
92910 for(i=0; i<pParse->nColCache; i++){
92911 if( pParse->aColCache[i].tempReg
92912 && pParse->nTempReg<ArraySize(pParse->aTempReg)
92913 ){
92914 pParse->aTempReg[pParse->nTempReg++] = pParse->aColCache[i].iReg;
92915 }
92916 }
92917 pParse->nColCache = 0;
92918 }
92919
92920 /*
92921 ** Record the fact that an affinity change has occurred on iCount
92922 ** registers starting with iStart.
@@ -92957,11 +92944,11 @@
92944 ** and does not appear in a normal build.
92945 */
92946 static int usedAsColumnCache(Parse *pParse, int iFrom, int iTo){
92947 int i;
92948 struct yColCache *p;
92949 for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
92950 int r = p->iReg;
92951 if( r>=iFrom && r<=iTo ) return 1; /*NO_TEST*/
92952 }
92953 return 0;
92954 }
@@ -94653,11 +94640,11 @@
94640 */
94641 SQLITE_PRIVATE void sqlite3ReleaseTempReg(Parse *pParse, int iReg){
94642 if( iReg && pParse->nTempReg<ArraySize(pParse->aTempReg) ){
94643 int i;
94644 struct yColCache *p;
94645 for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
94646 if( p->iReg==iReg ){
94647 p->tempReg = 1;
94648 return;
94649 }
94650 }
@@ -97959,11 +97946,11 @@
97946 }else{
97947 sqlite3ErrorMsg(pFix->pParse, "%s cannot use variables", pFix->zType);
97948 return 1;
97949 }
97950 }
97951 if( ExprHasProperty(pExpr, EP_TokenOnly|EP_Leaf) ) break;
97952 if( ExprHasProperty(pExpr, EP_xIsSelect) ){
97953 if( sqlite3FixSelect(pFix, pExpr->x.pSelect) ) return 1;
97954 }else{
97955 if( sqlite3FixExprList(pFix, pExpr->x.pList) ) return 1;
97956 }
@@ -98423,11 +98410,10 @@
98410 */
98411 v = sqlite3GetVdbe(pParse);
98412 assert( !pParse->isMultiWrite
98413 || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort));
98414 if( v ){
 
98415 sqlite3VdbeAddOp0(v, OP_Halt);
98416
98417 #if SQLITE_USER_AUTHENTICATION
98418 if( pParse->nTableLock>0 && db->init.busy==0 ){
98419 sqlite3UserAuthInit(db);
@@ -98450,18 +98436,20 @@
98436 ){
98437 int iDb, i;
98438 assert( sqlite3VdbeGetOp(v, 0)->opcode==OP_Init );
98439 sqlite3VdbeJumpHere(v, 0);
98440 for(iDb=0; iDb<db->nDb; iDb++){
98441 Schema *pSchema;
98442 if( DbMaskTest(pParse->cookieMask, iDb)==0 ) continue;
98443 sqlite3VdbeUsesBtree(v, iDb);
98444 pSchema = db->aDb[iDb].pSchema;
98445 sqlite3VdbeAddOp4Int(v,
98446 OP_Transaction, /* Opcode */
98447 iDb, /* P1 */
98448 DbMaskTest(pParse->writeMask,iDb), /* P2 */
98449 pSchema->schema_cookie, /* P3 */
98450 pSchema->iGeneration /* P4 */
98451 );
98452 if( db->init.busy==0 ) sqlite3VdbeChangeP5(v, 1);
98453 VdbeComment((v,
98454 "usesStmtJournal=%d", pParse->mayAbort && pParse->isMultiWrite));
98455 }
@@ -98508,20 +98496,10 @@
98496 sqlite3VdbeMakeReady(v, pParse);
98497 pParse->rc = SQLITE_DONE;
98498 }else{
98499 pParse->rc = SQLITE_ERROR;
98500 }
 
 
 
 
 
 
 
 
 
 
98501 }
98502
98503 /*
98504 ** Run the parser and code generator recursively in order to generate
98505 ** code for the SQL statement given onto the end of the pParse context
@@ -98537,12 +98515,11 @@
98515 SQLITE_PRIVATE void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){
98516 va_list ap;
98517 char *zSql;
98518 char *zErrMsg = 0;
98519 sqlite3 *db = pParse->db;
98520 char saveBuf[PARSE_TAIL_SZ];
 
98521
98522 if( pParse->nErr ) return;
98523 assert( pParse->nested<10 ); /* Nesting should only be of limited depth */
98524 va_start(ap, zFormat);
98525 zSql = sqlite3VMPrintf(db, zFormat, ap);
@@ -98549,16 +98526,16 @@
98526 va_end(ap);
98527 if( zSql==0 ){
98528 return; /* A malloc must have failed */
98529 }
98530 pParse->nested++;
98531 memcpy(saveBuf, PARSE_TAIL(pParse), PARSE_TAIL_SZ);
98532 memset(PARSE_TAIL(pParse), 0, PARSE_TAIL_SZ);
98533 sqlite3RunParser(pParse, zSql, &zErrMsg);
98534 sqlite3DbFree(db, zErrMsg);
98535 sqlite3DbFree(db, zSql);
98536 memcpy(PARSE_TAIL(pParse), saveBuf, PARSE_TAIL_SZ);
98537 pParse->nested--;
98538 }
98539
98540 #if SQLITE_USER_AUTHENTICATION
98541 /*
@@ -99735,10 +99712,13 @@
99712 ** This plan is not completely bullet-proof. It is possible for
99713 ** the schema to change multiple times and for the cookie to be
99714 ** set back to prior value. But schema changes are infrequent
99715 ** and the probability of hitting the same cookie value is only
99716 ** 1 chance in 2^32. So we're safe enough.
99717 **
99718 ** IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments
99719 ** the schema-version whenever the schema changes.
99720 */
99721 SQLITE_PRIVATE void sqlite3ChangeCookie(Parse *pParse, int iDb){
99722 sqlite3 *db = pParse->db;
99723 Vdbe *v = pParse->pVdbe;
99724 assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
@@ -102318,19 +102298,17 @@
102298 ** will occur at the end of the top-level VDBE and will be generated
102299 ** later, by sqlite3FinishCoding().
102300 */
102301 SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
102302 Parse *pToplevel = sqlite3ParseToplevel(pParse);
 
102303
102304 assert( iDb>=0 && iDb<pParse->db->nDb );
102305 assert( pParse->db->aDb[iDb].pBt!=0 || iDb==1 );
102306 assert( iDb<SQLITE_MAX_ATTACHED+2 );
102307 assert( sqlite3SchemaMutexHeld(pParse->db, iDb, 0) );
102308 if( DbMaskTest(pToplevel->cookieMask, iDb)==0 ){
102309 DbMaskSet(pToplevel->cookieMask, iDb);
 
102310 if( !OMIT_TEMPDB && iDb==1 ){
102311 sqlite3OpenTempDatabase(pToplevel);
102312 }
102313 }
102314 }
@@ -107192,14 +107170,14 @@
107170 }else if( action==OE_SetDflt ){
107171 Expr *pDflt = pFKey->pFrom->aCol[iFromCol].pDflt;
107172 if( pDflt ){
107173 pNew = sqlite3ExprDup(db, pDflt, 0);
107174 }else{
107175 pNew = sqlite3ExprAlloc(db, TK_NULL, 0, 0);
107176 }
107177 }else{
107178 pNew = sqlite3ExprAlloc(db, TK_NULL, 0, 0);
107179 }
107180 pList = sqlite3ExprListAppend(pParse, pList, pNew);
107181 sqlite3ExprListSetName(pParse, pList, &tFromCol, 0);
107182 }
107183 }
@@ -109538,10 +109516,11 @@
109516 }
109517 if( emptySrcTest ) sqlite3VdbeJumpHere(v, emptySrcTest);
109518 sqlite3ReleaseTempReg(pParse, regRowid);
109519 sqlite3ReleaseTempReg(pParse, regData);
109520 if( emptyDestTest ){
109521 sqlite3AutoincrementEnd(pParse);
109522 sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_OK, 0);
109523 sqlite3VdbeJumpHere(v, emptyDestTest);
109524 sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
109525 return 0;
109526 }else{
@@ -114034,22 +114013,18 @@
114013 int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
114014 Vdbe *pReprepare, /* VM being reprepared */
114015 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
114016 const char **pzTail /* OUT: End of parsed string */
114017 ){
 
114018 char *zErrMsg = 0; /* Error message */
114019 int rc = SQLITE_OK; /* Result code */
114020 int i; /* Loop counter */
114021 Parse sParse; /* Parsing context */
114022
114023 memset(&sParse, 0, PARSE_HDR_SZ);
114024 memset(PARSE_TAIL(&sParse), 0, PARSE_TAIL_SZ);
114025 sParse.pReprepare = pReprepare;
 
 
 
114026 assert( ppStmt && *ppStmt==0 );
114027 /* assert( !db->mallocFailed ); // not true with SQLITE_USE_ALLOCA */
114028 assert( sqlite3_mutex_held(db->mutex) );
114029
114030 /* Check to verify that it is possible to get a read lock on all
@@ -114089,12 +114064,11 @@
114064 }
114065 }
114066
114067 sqlite3VtabUnlockList(db);
114068
114069 sParse.db = db;
 
114070 if( nBytes>=0 && (nBytes==0 || zSql[nBytes-1]!=0) ){
114071 char *zSqlCopy;
114072 int mxLen = db->aLimit[SQLITE_LIMIT_SQL_LENGTH];
114073 testcase( nBytes==mxLen );
114074 testcase( nBytes==mxLen+1 );
@@ -114103,65 +114077,65 @@
114077 rc = sqlite3ApiExit(db, SQLITE_TOOBIG);
114078 goto end_prepare;
114079 }
114080 zSqlCopy = sqlite3DbStrNDup(db, zSql, nBytes);
114081 if( zSqlCopy ){
114082 sqlite3RunParser(&sParse, zSqlCopy, &zErrMsg);
114083 sParse.zTail = &zSql[sParse.zTail-zSqlCopy];
114084 sqlite3DbFree(db, zSqlCopy);
114085 }else{
114086 sParse.zTail = &zSql[nBytes];
114087 }
114088 }else{
114089 sqlite3RunParser(&sParse, zSql, &zErrMsg);
114090 }
114091 assert( 0==sParse.nQueryLoop );
114092
114093 if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK;
114094 if( sParse.checkSchema ){
114095 schemaIsValid(&sParse);
114096 }
114097 if( db->mallocFailed ){
114098 sParse.rc = SQLITE_NOMEM_BKPT;
114099 }
114100 if( pzTail ){
114101 *pzTail = sParse.zTail;
114102 }
114103 rc = sParse.rc;
114104
114105 #ifndef SQLITE_OMIT_EXPLAIN
114106 if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){
114107 static const char * const azColName[] = {
114108 "addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment",
114109 "selectid", "order", "from", "detail"
114110 };
114111 int iFirst, mx;
114112 if( sParse.explain==2 ){
114113 sqlite3VdbeSetNumCols(sParse.pVdbe, 4);
114114 iFirst = 8;
114115 mx = 12;
114116 }else{
114117 sqlite3VdbeSetNumCols(sParse.pVdbe, 8);
114118 iFirst = 0;
114119 mx = 8;
114120 }
114121 for(i=iFirst; i<mx; i++){
114122 sqlite3VdbeSetColName(sParse.pVdbe, i-iFirst, COLNAME_NAME,
114123 azColName[i], SQLITE_STATIC);
114124 }
114125 }
114126 #endif
114127
114128 if( db->init.busy==0 ){
114129 Vdbe *pVdbe = sParse.pVdbe;
114130 sqlite3VdbeSetSql(pVdbe, zSql, (int)(sParse.zTail-zSql), saveSqlFlag);
114131 }
114132 if( sParse.pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){
114133 sqlite3VdbeFinalize(sParse.pVdbe);
114134 assert(!(*ppStmt));
114135 }else{
114136 *ppStmt = (sqlite3_stmt*)sParse.pVdbe;
114137 }
114138
114139 if( zErrMsg ){
114140 sqlite3ErrorWithMsg(db, rc, "%s", zErrMsg);
114141 sqlite3DbFree(db, zErrMsg);
@@ -114168,20 +114142,19 @@
114142 }else{
114143 sqlite3Error(db, rc);
114144 }
114145
114146 /* Delete any TriggerPrg structures allocated while parsing this statement. */
114147 while( sParse.pTriggerPrg ){
114148 TriggerPrg *pT = sParse.pTriggerPrg;
114149 sParse.pTriggerPrg = pT->pNext;
114150 sqlite3DbFree(db, pT);
114151 }
114152
114153 end_prepare:
114154
114155 sqlite3ParserReset(&sParse);
 
114156 rc = sqlite3ApiExit(db, rc);
114157 assert( (rc&db->errMask)==rc );
114158 return rc;
114159 }
114160 static int sqlite3LockAndPrepare(
@@ -115382,11 +115355,11 @@
115355 ** Allocate a KeyInfo object sufficient for an index of N key columns and
115356 ** X extra columns.
115357 */
115358 SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3 *db, int N, int X){
115359 int nExtra = (N+X)*(sizeof(CollSeq*)+1);
115360 KeyInfo *p = sqlite3DbMallocRawNN(db, sizeof(KeyInfo) + nExtra);
115361 if( p ){
115362 p->aSortOrder = (u8*)&p->aColl[N+X];
115363 p->nField = (u16)N;
115364 p->nXField = (u16)X;
115365 p->enc = ENC(db);
@@ -118072,16 +118045,17 @@
118045 pWhere = sqlite3ExprDup(db, pSub->pWhere, 0);
118046 if( subqueryIsAgg ){
118047 assert( pParent->pHaving==0 );
118048 pParent->pHaving = pParent->pWhere;
118049 pParent->pWhere = pWhere;
118050 pParent->pHaving = sqlite3ExprAnd(db,
118051 sqlite3ExprDup(db, pSub->pHaving, 0), pParent->pHaving
118052 );
118053 assert( pParent->pGroupBy==0 );
118054 pParent->pGroupBy = sqlite3ExprListDup(db, pSub->pGroupBy, 0);
118055 }else{
118056 pParent->pWhere = sqlite3ExprAnd(db, pWhere, pParent->pWhere);
118057 }
118058 substSelect(db, pParent, iParent, pSub->pEList, 0);
118059
118060 /* The flattened query is distinct if either the inner or the
118061 ** outer query is distinct.
@@ -124041,24 +124015,24 @@
124015 ** in prereqRight and prereqAll. The default is 64 bits, hence SQLite
124016 ** is only able to process joins with 64 or fewer tables.
124017 */
124018 struct WhereTerm {
124019 Expr *pExpr; /* Pointer to the subexpression that is this term */
124020 WhereClause *pWC; /* The clause this term is part of */
124021 LogEst truthProb; /* Probability of truth for this expression */
124022 u16 wtFlags; /* TERM_xxx bit flags. See below */
124023 u16 eOperator; /* A WO_xx value describing <op> */
124024 u8 nChild; /* Number of children that must disable us */
124025 u8 eMatchOp; /* Op for vtab MATCH/LIKE/GLOB/REGEXP terms */
124026 int iParent; /* Disable pWC->a[iParent] when this term disabled */
124027 int leftCursor; /* Cursor number of X in "X <op> <expr>" */
124028 int iField; /* Field in (?,?,?) IN (SELECT...) vector */
124029 union {
124030 int leftColumn; /* Column number of X in "X <op> <expr>" */
124031 WhereOrInfo *pOrInfo; /* Extra information if (eOperator & WO_OR)!=0 */
124032 WhereAndInfo *pAndInfo; /* Extra information if (eOperator& WO_AND)!=0 */
124033 } u;
 
 
 
 
 
 
124034 Bitmask prereqRight; /* Bitmask of tables used by pExpr->pRight */
124035 Bitmask prereqAll; /* Bitmask of tables referenced by pExpr */
124036 };
124037
124038 /*
@@ -124207,29 +124181,29 @@
124181 struct WhereInfo {
124182 Parse *pParse; /* Parsing and code generating context */
124183 SrcList *pTabList; /* List of tables in the join */
124184 ExprList *pOrderBy; /* The ORDER BY clause or NULL */
124185 ExprList *pDistinctSet; /* DISTINCT over all these values */
 
 
 
124186 LogEst iLimit; /* LIMIT if wctrlFlags has WHERE_USE_LIMIT */
124187 int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */
124188 int iContinue; /* Jump here to continue with next record */
124189 int iBreak; /* Jump here to break out of the loop */
124190 int savedNQueryLoop; /* pParse->nQueryLoop outside the WHERE loop */
124191 u16 wctrlFlags; /* Flags originally passed to sqlite3WhereBegin() */
124192 u8 nLevel; /* Number of nested loop */
124193 i8 nOBSat; /* Number of ORDER BY terms satisfied by indices */
124194 u8 sorted; /* True if really sorted (not just grouped) */
124195 u8 eOnePass; /* ONEPASS_OFF, or _SINGLE, or _MULTI */
124196 u8 untestedTerms; /* Not all WHERE terms resolved by outer loop */
124197 u8 eDistinct; /* One of the WHERE_DISTINCT_* values */
 
124198 u8 bOrderedInnerLoop; /* True if only the inner-most loop is ordered */
124199 int iTop; /* The very beginning of the WHERE loop */
124200 WhereLoop *pLoops; /* List of all WhereLoop objects */
124201 Bitmask revMask; /* Mask of ORDER BY terms that need reversing */
124202 LogEst nRowOut; /* Estimated number of output rows */
 
 
124203 WhereClause sWC; /* Decomposition of the WHERE clause */
124204 WhereMaskSet sMaskSet; /* Map cursor numbers to bitmasks */
124205 WhereLevel a[1]; /* Information about each nest loop in WHERE */
124206 };
124207
124208 /*
124209 ** Private interfaces - callable only by other where.c routines.
@@ -126315,11 +126289,11 @@
126289 ** and we are coding the t1 loop and the t2 loop has not yet coded,
126290 ** then we cannot use the "t1.a=t2.b" constraint, but we can code
126291 ** the implied "t1.a=123" constraint.
126292 */
126293 for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){
126294 Expr *pE, sEAlt;
126295 WhereTerm *pAlt;
126296 if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
126297 if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) continue;
126298 if( (pTerm->eOperator & WO_EQUIV)==0 ) continue;
126299 if( pTerm->leftCursor!=iCur ) continue;
@@ -126333,17 +126307,13 @@
126307 if( pAlt->wtFlags & (TERM_CODED) ) continue;
126308 testcase( pAlt->eOperator & WO_EQ );
126309 testcase( pAlt->eOperator & WO_IS );
126310 testcase( pAlt->eOperator & WO_IN );
126311 VdbeModuleComment((v, "begin transitive constraint"));
126312 sEAlt = *pAlt->pExpr;
126313 sEAlt.pLeft = pE->pLeft;
126314 sqlite3ExprIfFalse(pParse, &sEAlt, addrCont, SQLITE_JUMPIFNULL);
 
 
 
 
126315 }
126316
126317 /* For a LEFT OUTER JOIN, generate code that will record the fact that
126318 ** at least one row of the right table has matched the left table.
126319 */
@@ -126448,11 +126418,10 @@
126418 memcpy(pWC->a, pOld, sizeof(pWC->a[0])*pWC->nTerm);
126419 if( pOld!=pWC->aStatic ){
126420 sqlite3DbFree(db, pOld);
126421 }
126422 pWC->nSlot = sqlite3DbMallocSize(db, pWC->a)/sizeof(pWC->a[0]);
 
126423 }
126424 pTerm = &pWC->a[idx = pWC->nTerm++];
126425 if( p && ExprHasProperty(p, EP_Unlikely) ){
126426 pTerm->truthProb = sqlite3LogEst(p->iTable) - 270;
126427 }else{
@@ -126460,10 +126429,12 @@
126429 }
126430 pTerm->pExpr = sqlite3ExprSkipCollate(p);
126431 pTerm->wtFlags = wtFlags;
126432 pTerm->pWC = pWC;
126433 pTerm->iParent = -1;
126434 memset(&pTerm->eOperator, 0,
126435 sizeof(WhereTerm) - offsetof(WhereTerm,eOperator));
126436 return idx;
126437 }
126438
126439 /*
126440 ** Return TRUE if the given operator is one of the operators that is
@@ -127618,11 +127589,11 @@
127589 int idxNew;
127590 WhereTerm *pNewTerm;
127591
127592 pNewExpr = sqlite3PExpr(pParse, TK_GT,
127593 sqlite3ExprDup(db, pLeft, 0),
127594 sqlite3ExprAlloc(db, TK_NULL, 0, 0), 0);
127595
127596 idxNew = whereClauseInsert(pWC, pNewExpr,
127597 TERM_VIRTUAL|TERM_DYNAMIC|TERM_VNULL);
127598 if( idxNew ){
127599 pNewTerm = &pWC->a[idxNew];
@@ -127796,11 +127767,11 @@
127767 if( k>=pTab->nCol ){
127768 sqlite3ErrorMsg(pParse, "too many arguments on %s() - max %d",
127769 pTab->zName, j);
127770 return;
127771 }
127772 pColRef = sqlite3ExprAlloc(pParse->db, TK_COLUMN, 0, 0);
127773 if( pColRef==0 ) return;
127774 pColRef->iTable = pItem->iCursor;
127775 pColRef->iColumn = k++;
127776 pColRef->pTab = pTab;
127777 pTerm = sqlite3PExpr(pParse, TK_EQ, pColRef,
@@ -132218,26 +132189,29 @@
132189 ** and the WhereMaskSet structure. Since WhereClause contains an 8-byte
132190 ** field (type Bitmask) it must be aligned on an 8-byte boundary on
132191 ** some architectures. Hence the ROUND8() below.
132192 */
132193 nByteWInfo = ROUND8(sizeof(WhereInfo)+(nTabList-1)*sizeof(WhereLevel));
132194 pWInfo = sqlite3DbMallocRawNN(db, nByteWInfo + sizeof(WhereLoop));
132195 if( db->mallocFailed ){
132196 sqlite3DbFree(db, pWInfo);
132197 pWInfo = 0;
132198 goto whereBeginError;
132199 }
 
 
132200 pWInfo->pParse = pParse;
132201 pWInfo->pTabList = pTabList;
132202 pWInfo->pOrderBy = pOrderBy;
132203 pWInfo->pDistinctSet = pDistinctSet;
132204 pWInfo->aiCurOnePass[0] = pWInfo->aiCurOnePass[1] = -1;
132205 pWInfo->nLevel = nTabList;
132206 pWInfo->iBreak = pWInfo->iContinue = sqlite3VdbeMakeLabel(v);
132207 pWInfo->wctrlFlags = wctrlFlags;
132208 pWInfo->iLimit = iAuxArg;
132209 pWInfo->savedNQueryLoop = pParse->nQueryLoop;
132210 memset(&pWInfo->nOBSat, 0,
132211 offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat));
132212 memset(&pWInfo->a[0], 0, sizeof(WhereLoop)+nTabList*sizeof(WhereLevel));
132213 assert( pWInfo->eOnePass==ONEPASS_OFF ); /* ONEPASS defaults to OFF */
132214 pMaskSet = &pWInfo->sMaskSet;
132215 sWLB.pWInfo = pWInfo;
132216 sWLB.pWC = &pWInfo->sWC;
132217 sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo);
@@ -132844,19 +132818,10 @@
132818 struct LimitVal {
132819 Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */
132820 Expr *pOffset; /* The OFFSET expression. NULL if there is none */
132821 };
132822
 
 
 
 
 
 
 
 
 
132823 /*
132824 ** An instance of the following structure describes the event of a
132825 ** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT,
132826 ** TK_DELETE, or TK_INSTEAD. If the event is of the form
132827 **
@@ -132864,15 +132829,10 @@
132829 **
132830 ** Then the "b" IdList records the list "a,b,c".
132831 */
132832 struct TrigEvent { int a; IdList * b; };
132833
 
 
 
 
 
132834 /*
132835 ** Disable lookaside memory allocation for objects that might be
132836 ** shared across database connections.
132837 */
132838 static void disableLookaside(Parse *pParse){
@@ -132915,11 +132875,28 @@
132875 /* Construct a new Expr object from a single identifier. Use the
132876 ** new Expr to populate pOut. Set the span of pOut to be the identifier
132877 ** that created the expression.
132878 */
132879 static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token t){
132880 Expr *p = sqlite3DbMallocRawNN(pParse->db, sizeof(Expr)+t.n+1);
132881 if( p ){
132882 memset(p, 0, sizeof(Expr));
132883 p->op = (u8)op;
132884 p->flags = EP_Leaf;
132885 p->iAgg = -1;
132886 p->u.zToken = (char*)&p[1];
132887 memcpy(p->u.zToken, t.z, t.n);
132888 p->u.zToken[t.n] = 0;
132889 if( sqlite3Isquote(p->u.zToken[0]) ){
132890 if( p->u.zToken[0]=='"' ) p->flags |= EP_DblQuoted;
132891 sqlite3Dequote(p->u.zToken);
132892 }
132893 #if SQLITE_MAX_EXPR_DEPTH>0
132894 p->nHeight = 1;
132895 #endif
132896 }
132897 pOut->pExpr = p;
132898 pOut->zStart = t.z;
132899 pOut->zEnd = &t.z[t.n];
132900 }
132901
132902 /* This routine constructs a binary expression node out of two ExprSpan
@@ -133078,11 +133055,10 @@
133055 Select* yy243;
133056 IdList* yy254;
133057 With* yy285;
133058 struct TrigEvent yy332;
133059 struct LimitVal yy354;
 
133060 struct {int value; int mask;} yy497;
133061 } YYMINORTYPE;
133062 #ifndef YYSTACKDEPTH
133063 #define YYSTACKDEPTH 100
133064 #endif
@@ -133090,19 +133066,19 @@
133066 #define sqlite3ParserARG_PDECL ,Parse *pParse
133067 #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
133068 #define sqlite3ParserARG_STORE yypParser->pParse = pParse
133069 #define YYFALLBACK 1
133070 #define YYNSTATE 456
133071 #define YYNRULE 332
133072 #define YY_MAX_SHIFT 455
133073 #define YY_MIN_SHIFTREDUCE 668
133074 #define YY_MAX_SHIFTREDUCE 999
133075 #define YY_MIN_REDUCE 1000
133076 #define YY_MAX_REDUCE 1331
133077 #define YY_ERROR_ACTION 1332
133078 #define YY_ACCEPT_ACTION 1333
133079 #define YY_NO_ACTION 1334
133080 /************* End control #defines *******************************************/
133081
133082 /* Define the yytestcase() macro to be a no-op if is not already defined
133083 ** otherwise.
133084 **
@@ -133170,170 +133146,169 @@
133146 ** yy_reduce_ofst[] For each state, the offset into yy_action for
133147 ** shifting non-terminals after a reduce.
133148 ** yy_default[] Default action for each state.
133149 **
133150 *********** Begin parsing tables **********************************************/
133151 #define YY_ACTTAB_COUNT (1567)
133152 static const YYACTIONTYPE yy_action[] = {
133153 /* 0 */ 325, 832, 351, 825, 5, 203, 203, 819, 99, 100,
133154 /* 10 */ 90, 842, 842, 854, 857, 846, 846, 97, 97, 98,
133155 /* 20 */ 98, 98, 98, 301, 96, 96, 96, 96, 95, 95,
133156 /* 30 */ 94, 94, 94, 93, 351, 325, 977, 977, 824, 824,
133157 /* 40 */ 826, 947, 354, 99, 100, 90, 842, 842, 854, 857,
133158 /* 50 */ 846, 846, 97, 97, 98, 98, 98, 98, 338, 96,
133159 /* 60 */ 96, 96, 96, 95, 95, 94, 94, 94, 93, 351,
133160 /* 70 */ 95, 95, 94, 94, 94, 93, 351, 791, 977, 977,
133161 /* 80 */ 325, 94, 94, 94, 93, 351, 792, 75, 99, 100,
133162 /* 90 */ 90, 842, 842, 854, 857, 846, 846, 97, 97, 98,
133163 /* 100 */ 98, 98, 98, 450, 96, 96, 96, 96, 95, 95,
133164 /* 110 */ 94, 94, 94, 93, 351, 1333, 155, 155, 2, 325,
133165 /* 120 */ 275, 146, 132, 52, 52, 93, 351, 99, 100, 90,
133166 /* 130 */ 842, 842, 854, 857, 846, 846, 97, 97, 98, 98,
133167 /* 140 */ 98, 98, 101, 96, 96, 96, 96, 95, 95, 94,
133168 /* 150 */ 94, 94, 93, 351, 958, 958, 325, 268, 428, 413,
133169 /* 160 */ 411, 61, 752, 752, 99, 100, 90, 842, 842, 854,
133170 /* 170 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 60,
133171 /* 180 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133172 /* 190 */ 351, 325, 270, 329, 273, 277, 959, 960, 250, 99,
133173 /* 200 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
133174 /* 210 */ 98, 98, 98, 98, 301, 96, 96, 96, 96, 95,
133175 /* 220 */ 95, 94, 94, 94, 93, 351, 325, 938, 1326, 698,
133176 /* 230 */ 706, 1326, 242, 412, 99, 100, 90, 842, 842, 854,
133177 /* 240 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 347,
133178 /* 250 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133179 /* 260 */ 351, 325, 938, 1327, 384, 699, 1327, 381, 379, 99,
133180 /* 270 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
133181 /* 280 */ 98, 98, 98, 98, 701, 96, 96, 96, 96, 95,
133182 /* 290 */ 95, 94, 94, 94, 93, 351, 325, 92, 89, 178,
133183 /* 300 */ 833, 936, 373, 700, 99, 100, 90, 842, 842, 854,
133184 /* 310 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 375,
133185 /* 320 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133186 /* 330 */ 351, 325, 1276, 947, 354, 818, 936, 739, 739, 99,
133187 /* 340 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
133188 /* 350 */ 98, 98, 98, 98, 230, 96, 96, 96, 96, 95,
133189 /* 360 */ 95, 94, 94, 94, 93, 351, 325, 969, 227, 92,
133190 /* 370 */ 89, 178, 373, 300, 99, 100, 90, 842, 842, 854,
133191 /* 380 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 921,
133192 /* 390 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133193 /* 400 */ 351, 325, 449, 447, 447, 447, 147, 737, 737, 99,
133194 /* 410 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
133195 /* 420 */ 98, 98, 98, 98, 296, 96, 96, 96, 96, 95,
133196 /* 430 */ 95, 94, 94, 94, 93, 351, 325, 419, 231, 958,
133197 /* 440 */ 958, 158, 25, 422, 99, 100, 90, 842, 842, 854,
133198 /* 450 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 450,
133199 /* 460 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133200 /* 470 */ 351, 443, 224, 224, 420, 958, 958, 962, 325, 52,
133201 /* 480 */ 52, 959, 960, 176, 415, 78, 99, 100, 90, 842,
133202 /* 490 */ 842, 854, 857, 846, 846, 97, 97, 98, 98, 98,
133203 /* 500 */ 98, 379, 96, 96, 96, 96, 95, 95, 94, 94,
133204 /* 510 */ 94, 93, 351, 325, 428, 418, 298, 959, 960, 962,
133205 /* 520 */ 81, 99, 88, 90, 842, 842, 854, 857, 846, 846,
133206 /* 530 */ 97, 97, 98, 98, 98, 98, 717, 96, 96, 96,
133207 /* 540 */ 96, 95, 95, 94, 94, 94, 93, 351, 325, 843,
133208 /* 550 */ 843, 855, 858, 996, 318, 343, 379, 100, 90, 842,
133209 /* 560 */ 842, 854, 857, 846, 846, 97, 97, 98, 98, 98,
133210 /* 570 */ 98, 450, 96, 96, 96, 96, 95, 95, 94, 94,
133211 /* 580 */ 94, 93, 351, 325, 350, 350, 350, 260, 377, 340,
133212 /* 590 */ 929, 52, 52, 90, 842, 842, 854, 857, 846, 846,
133213 /* 600 */ 97, 97, 98, 98, 98, 98, 361, 96, 96, 96,
133214 /* 610 */ 96, 95, 95, 94, 94, 94, 93, 351, 86, 445,
133215 /* 620 */ 847, 3, 1203, 361, 360, 378, 344, 813, 958, 958,
133216 /* 630 */ 1300, 86, 445, 729, 3, 212, 169, 287, 405, 282,
133217 /* 640 */ 404, 199, 232, 450, 300, 760, 83, 84, 280, 245,
133218 /* 650 */ 262, 365, 251, 85, 352, 352, 92, 89, 178, 83,
133219 /* 660 */ 84, 242, 412, 52, 52, 448, 85, 352, 352, 246,
133220 /* 670 */ 959, 960, 194, 455, 670, 402, 399, 398, 448, 243,
133221 /* 680 */ 221, 114, 434, 776, 361, 450, 397, 268, 747, 224,
133222 /* 690 */ 224, 132, 132, 198, 832, 434, 452, 451, 428, 427,
133223 /* 700 */ 819, 415, 734, 713, 132, 52, 52, 832, 268, 452,
133224 /* 710 */ 451, 734, 194, 819, 363, 402, 399, 398, 450, 1271,
133225 /* 720 */ 1271, 23, 958, 958, 86, 445, 397, 3, 228, 429,
133226 /* 730 */ 895, 824, 824, 826, 827, 19, 203, 720, 52, 52,
133227 /* 740 */ 428, 408, 439, 249, 824, 824, 826, 827, 19, 229,
133228 /* 750 */ 403, 153, 83, 84, 761, 177, 241, 450, 721, 85,
133229 /* 760 */ 352, 352, 120, 157, 959, 960, 58, 977, 409, 355,
133230 /* 770 */ 330, 448, 268, 428, 430, 320, 790, 32, 32, 86,
133231 /* 780 */ 445, 776, 3, 341, 98, 98, 98, 98, 434, 96,
133232 /* 790 */ 96, 96, 96, 95, 95, 94, 94, 94, 93, 351,
133233 /* 800 */ 832, 120, 452, 451, 813, 887, 819, 83, 84, 977,
133234 /* 810 */ 813, 132, 410, 920, 85, 352, 352, 132, 407, 789,
133235 /* 820 */ 958, 958, 92, 89, 178, 917, 448, 262, 370, 261,
133236 /* 830 */ 82, 914, 80, 262, 370, 261, 776, 824, 824, 826,
133237 /* 840 */ 827, 19, 934, 434, 96, 96, 96, 96, 95, 95,
133238 /* 850 */ 94, 94, 94, 93, 351, 832, 74, 452, 451, 958,
133239 /* 860 */ 958, 819, 959, 960, 120, 92, 89, 178, 945, 2,
133240 /* 870 */ 918, 965, 268, 1, 976, 76, 445, 762, 3, 708,
133241 /* 880 */ 901, 901, 387, 958, 958, 757, 919, 371, 740, 778,
133242 /* 890 */ 756, 257, 824, 824, 826, 827, 19, 417, 741, 450,
133243 /* 900 */ 24, 959, 960, 83, 84, 369, 958, 958, 177, 226,
133244 /* 910 */ 85, 352, 352, 885, 315, 314, 313, 215, 311, 10,
133245 /* 920 */ 10, 683, 448, 349, 348, 959, 960, 909, 777, 157,
133246 /* 930 */ 120, 958, 958, 337, 776, 416, 711, 310, 450, 434,
133247 /* 940 */ 450, 321, 450, 791, 103, 200, 175, 450, 959, 960,
133248 /* 950 */ 908, 832, 792, 452, 451, 9, 9, 819, 10, 10,
133249 /* 960 */ 52, 52, 51, 51, 180, 716, 248, 10, 10, 171,
133250 /* 970 */ 170, 167, 339, 959, 960, 247, 984, 702, 702, 450,
133251 /* 980 */ 715, 233, 686, 982, 889, 983, 182, 914, 824, 824,
133252 /* 990 */ 826, 827, 19, 183, 256, 423, 132, 181, 394, 10,
133253 /* 1000 */ 10, 889, 891, 749, 958, 958, 917, 268, 985, 198,
133254 /* 1010 */ 985, 349, 348, 425, 415, 299, 817, 832, 326, 825,
133255 /* 1020 */ 120, 332, 133, 819, 268, 98, 98, 98, 98, 91,
133256 /* 1030 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
133257 /* 1040 */ 351, 157, 810, 371, 382, 359, 959, 960, 358, 268,
133258 /* 1050 */ 450, 918, 368, 324, 824, 824, 826, 450, 709, 450,
133259 /* 1060 */ 264, 380, 889, 450, 877, 746, 253, 919, 255, 433,
133260 /* 1070 */ 36, 36, 234, 450, 234, 120, 269, 37, 37, 12,
133261 /* 1080 */ 12, 334, 272, 27, 27, 450, 330, 118, 450, 162,
133262 /* 1090 */ 742, 280, 450, 38, 38, 450, 985, 356, 985, 450,
133263 /* 1100 */ 709, 1210, 450, 132, 450, 39, 39, 450, 40, 40,
133264 /* 1110 */ 450, 362, 41, 41, 450, 42, 42, 450, 254, 28,
133265 /* 1120 */ 28, 450, 29, 29, 31, 31, 450, 43, 43, 450,
133266 /* 1130 */ 44, 44, 450, 714, 45, 45, 450, 11, 11, 767,
133267 /* 1140 */ 450, 46, 46, 450, 268, 450, 105, 105, 450, 47,
133268 /* 1150 */ 47, 450, 48, 48, 450, 237, 33, 33, 450, 172,
133269 /* 1160 */ 49, 49, 450, 50, 50, 34, 34, 274, 122, 122,
133270 /* 1170 */ 450, 123, 123, 450, 124, 124, 450, 898, 56, 56,
133271 /* 1180 */ 450, 897, 35, 35, 450, 267, 450, 817, 450, 817,
133272 /* 1190 */ 106, 106, 450, 53, 53, 385, 107, 107, 450, 817,
133273 /* 1200 */ 108, 108, 817, 450, 104, 104, 121, 121, 119, 119,
133274 /* 1210 */ 450, 117, 112, 112, 450, 276, 450, 225, 111, 111,
133275 /* 1220 */ 450, 730, 450, 109, 109, 450, 673, 674, 675, 912,
133276 /* 1230 */ 110, 110, 317, 998, 55, 55, 57, 57, 692, 331,
133277 /* 1240 */ 54, 54, 26, 26, 696, 30, 30, 317, 937, 197,
133278 /* 1250 */ 196, 195, 335, 281, 336, 446, 331, 745, 689, 436,
133279 /* 1260 */ 440, 444, 120, 72, 386, 223, 175, 345, 757, 933,
133280 /* 1270 */ 20, 286, 319, 756, 815, 372, 374, 202, 202, 202,
133281 /* 1280 */ 263, 395, 285, 74, 208, 21, 696, 719, 718, 884,
133282 /* 1290 */ 120, 120, 120, 120, 120, 754, 278, 828, 77, 74,
133283 /* 1300 */ 726, 727, 785, 783, 880, 202, 999, 208, 894, 893,
133284 /* 1310 */ 894, 893, 694, 816, 763, 116, 774, 1290, 431, 432,
133285 /* 1320 */ 302, 999, 390, 303, 823, 697, 691, 680, 159, 289,
133286 /* 1330 */ 679, 884, 681, 952, 291, 218, 293, 7, 316, 828,
133287 /* 1340 */ 173, 805, 259, 364, 252, 911, 376, 713, 295, 435,
133288 /* 1350 */ 308, 168, 955, 993, 135, 400, 990, 284, 882, 881,
133289 /* 1360 */ 205, 928, 926, 59, 333, 62, 144, 156, 130, 72,
133290 /* 1370 */ 802, 366, 367, 393, 137, 185, 189, 160, 139, 383,
133291 /* 1380 */ 67, 896, 140, 141, 142, 148, 389, 812, 775, 266,
133292 /* 1390 */ 219, 190, 154, 391, 913, 876, 271, 406, 191, 322,
133293 /* 1400 */ 682, 733, 192, 342, 732, 724, 731, 711, 723, 421,
133294 /* 1410 */ 705, 71, 323, 6, 204, 771, 288, 79, 297, 346,
133295 /* 1420 */ 772, 704, 290, 283, 703, 770, 292, 294, 967, 239,
133296 /* 1430 */ 769, 102, 862, 438, 426, 240, 424, 442, 73, 213,
133297 /* 1440 */ 688, 238, 22, 453, 953, 214, 217, 216, 454, 677,
133298 /* 1450 */ 676, 671, 753, 125, 115, 235, 126, 669, 353, 166,
133299 /* 1460 */ 127, 244, 179, 357, 306, 304, 305, 307, 113, 892,
133300 /* 1470 */ 327, 890, 811, 328, 134, 128, 136, 138, 743, 258,
133301 /* 1480 */ 907, 184, 143, 129, 910, 186, 63, 64, 145, 187,
133302 /* 1490 */ 906, 65, 8, 66, 13, 188, 202, 899, 265, 149,
133303 /* 1500 */ 987, 388, 150, 685, 161, 392, 285, 193, 279, 396,
133304 /* 1510 */ 151, 401, 68, 14, 15, 722, 69, 236, 831, 131,
133305 /* 1520 */ 830, 860, 70, 751, 16, 414, 755, 4, 174, 220,
133306 /* 1530 */ 222, 784, 201, 152, 779, 77, 74, 17, 18, 875,
133307 /* 1540 */ 861, 859, 916, 864, 915, 207, 206, 942, 163, 437,
133308 /* 1550 */ 948, 943, 164, 209, 1002, 441, 863, 165, 210, 829,
133309 /* 1560 */ 695, 87, 312, 211, 1292, 1291, 309,
 
133310 };
133311 static const YYCODETYPE yy_lookahead[] = {
133312 /* 0 */ 19, 95, 53, 97, 22, 24, 24, 101, 27, 28,
133313 /* 10 */ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
133314 /* 20 */ 39, 40, 41, 152, 43, 44, 45, 46, 47, 48,
@@ -133415,87 +133390,86 @@
133390 /* 780 */ 20, 124, 22, 111, 38, 39, 40, 41, 83, 43,
133391 /* 790 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
133392 /* 800 */ 95, 196, 97, 98, 85, 152, 101, 47, 48, 97,
133393 /* 810 */ 85, 92, 207, 193, 54, 55, 56, 92, 49, 175,
133394 /* 820 */ 55, 56, 221, 222, 223, 12, 66, 108, 109, 110,
133395 /* 830 */ 137, 163, 139, 108, 109, 110, 26, 132, 133, 134,
133396 /* 840 */ 135, 136, 152, 83, 43, 44, 45, 46, 47, 48,
133397 /* 850 */ 49, 50, 51, 52, 53, 95, 26, 97, 98, 55,
133398 /* 860 */ 56, 101, 97, 98, 196, 221, 222, 223, 146, 147,
133399 /* 870 */ 57, 171, 152, 22, 26, 19, 20, 49, 22, 179,
133400 /* 880 */ 108, 109, 110, 55, 56, 116, 73, 219, 75, 124,
133401 /* 890 */ 121, 152, 132, 133, 134, 135, 136, 163, 85, 152,
133402 /* 900 */ 232, 97, 98, 47, 48, 237, 55, 56, 98, 5,
133403 /* 910 */ 54, 55, 56, 193, 10, 11, 12, 13, 14, 172,
133404 /* 920 */ 173, 17, 66, 47, 48, 97, 98, 152, 124, 152,
133405 /* 930 */ 196, 55, 56, 186, 124, 152, 106, 160, 152, 83,
133406 /* 940 */ 152, 164, 152, 61, 22, 211, 212, 152, 97, 98,
133407 /* 950 */ 152, 95, 70, 97, 98, 172, 173, 101, 172, 173,
133408 /* 960 */ 172, 173, 172, 173, 60, 181, 62, 172, 173, 47,
133409 /* 970 */ 48, 123, 186, 97, 98, 71, 100, 55, 56, 152,
133410 /* 980 */ 181, 186, 21, 107, 152, 109, 82, 163, 132, 133,
133411 /* 990 */ 134, 135, 136, 89, 16, 207, 92, 93, 19, 172,
133412 /* 1000 */ 173, 169, 170, 195, 55, 56, 12, 152, 132, 30,
133413 /* 1010 */ 134, 47, 48, 186, 206, 225, 152, 95, 114, 97,
133414 /* 1020 */ 196, 245, 246, 101, 152, 38, 39, 40, 41, 42,
133415 /* 1030 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
133416 /* 1040 */ 53, 152, 163, 219, 152, 141, 97, 98, 193, 152,
133417 /* 1050 */ 152, 57, 91, 164, 132, 133, 134, 152, 55, 152,
133418 /* 1060 */ 152, 237, 230, 152, 103, 193, 88, 73, 90, 75,
133419 /* 1070 */ 172, 173, 183, 152, 185, 196, 152, 172, 173, 172,
133420 /* 1080 */ 173, 217, 152, 172, 173, 152, 107, 22, 152, 24,
133421 /* 1090 */ 193, 112, 152, 172, 173, 152, 132, 242, 134, 152,
133422 /* 1100 */ 97, 140, 152, 92, 152, 172, 173, 152, 172, 173,
133423 /* 1110 */ 152, 100, 172, 173, 152, 172, 173, 152, 140, 172,
133424 /* 1120 */ 173, 152, 172, 173, 172, 173, 152, 172, 173, 152,
133425 /* 1130 */ 172, 173, 152, 152, 172, 173, 152, 172, 173, 213,
133426 /* 1140 */ 152, 172, 173, 152, 152, 152, 172, 173, 152, 172,
133427 /* 1150 */ 173, 152, 172, 173, 152, 210, 172, 173, 152, 26,
133428 /* 1160 */ 172, 173, 152, 172, 173, 172, 173, 152, 172, 173,
133429 /* 1170 */ 152, 172, 173, 152, 172, 173, 152, 59, 172, 173,
133430 /* 1180 */ 152, 63, 172, 173, 152, 193, 152, 152, 152, 152,
133431 /* 1190 */ 172, 173, 152, 172, 173, 77, 172, 173, 152, 152,
133432 /* 1200 */ 172, 173, 152, 152, 172, 173, 172, 173, 172, 173,
133433 /* 1210 */ 152, 22, 172, 173, 152, 152, 152, 22, 172, 173,
133434 /* 1220 */ 152, 152, 152, 172, 173, 152, 7, 8, 9, 163,
133435 /* 1230 */ 172, 173, 22, 23, 172, 173, 172, 173, 166, 167,
133436 /* 1240 */ 172, 173, 172, 173, 55, 172, 173, 22, 23, 108,
133437 /* 1250 */ 109, 110, 217, 152, 217, 166, 167, 163, 163, 163,
133438 /* 1260 */ 163, 163, 196, 130, 217, 211, 212, 217, 116, 23,
133439 /* 1270 */ 22, 101, 26, 121, 23, 23, 23, 26, 26, 26,
133440 /* 1280 */ 23, 23, 112, 26, 26, 37, 97, 100, 101, 55,
133441 /* 1290 */ 196, 196, 196, 196, 196, 23, 23, 55, 26, 26,
133442 /* 1300 */ 7, 8, 23, 152, 23, 26, 96, 26, 132, 132,
133443 /* 1310 */ 134, 134, 23, 152, 152, 26, 152, 122, 152, 191,
133444 /* 1320 */ 152, 96, 234, 152, 152, 152, 152, 152, 197, 210,
133445 /* 1330 */ 152, 97, 152, 152, 210, 233, 210, 198, 150, 97,
133446 /* 1340 */ 184, 201, 239, 214, 214, 201, 239, 180, 214, 227,
133447 /* 1350 */ 200, 198, 155, 67, 243, 176, 69, 175, 175, 175,
133448 /* 1360 */ 122, 159, 159, 240, 159, 240, 22, 220, 27, 130,
133449 /* 1370 */ 201, 18, 159, 18, 189, 158, 158, 220, 192, 159,
133450 /* 1380 */ 137, 236, 192, 192, 192, 189, 74, 189, 159, 235,
133451 /* 1390 */ 159, 158, 22, 177, 201, 201, 159, 107, 158, 177,
133452 /* 1400 */ 159, 174, 158, 76, 174, 182, 174, 106, 182, 125,
133453 /* 1410 */ 174, 107, 177, 22, 159, 216, 215, 137, 159, 53,
133454 /* 1420 */ 216, 176, 215, 174, 174, 216, 215, 215, 174, 229,
133455 /* 1430 */ 216, 129, 224, 177, 126, 229, 127, 177, 128, 25,
133456 /* 1440 */ 162, 226, 26, 161, 13, 153, 6, 153, 151, 151,
133457 /* 1450 */ 151, 151, 205, 165, 178, 178, 165, 4, 3, 22,
133458 /* 1460 */ 165, 142, 15, 94, 202, 204, 203, 201, 16, 23,
133459 /* 1470 */ 249, 23, 120, 249, 246, 111, 131, 123, 20, 16,
133460 /* 1480 */ 1, 125, 123, 111, 56, 64, 37, 37, 131, 122,
133461 /* 1490 */ 1, 37, 5, 37, 22, 107, 26, 80, 140, 80,
133462 /* 1500 */ 87, 72, 107, 20, 24, 19, 112, 105, 23, 79,
133463 /* 1510 */ 22, 79, 22, 22, 22, 58, 22, 79, 23, 68,
133464 /* 1520 */ 23, 23, 26, 116, 22, 26, 23, 22, 122, 23,
133465 /* 1530 */ 23, 56, 64, 22, 124, 26, 26, 64, 64, 23,
133466 /* 1540 */ 23, 23, 23, 11, 23, 22, 26, 23, 22, 24,
133467 /* 1550 */ 1, 23, 22, 26, 251, 24, 23, 22, 122, 23,
133468 /* 1560 */ 23, 22, 15, 122, 122, 122, 23,
 
133469 };
133470 #define YY_SHIFT_USE_DFLT (1567)
133471 #define YY_SHIFT_COUNT (455)
133472 #define YY_SHIFT_MIN (-94)
133473 #define YY_SHIFT_MAX (1549)
133474 static const short yy_shift_ofst[] = {
133475 /* 0 */ 40, 599, 904, 612, 760, 760, 760, 760, 725, -19,
@@ -133507,132 +133481,132 @@
133481 /* 60 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133482 /* 70 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133483 /* 80 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133484 /* 90 */ 856, 760, 760, 760, 760, 760, 760, 760, 760, 760,
133485 /* 100 */ 760, 760, 760, 760, 987, 746, 746, 746, 746, 746,
133486 /* 110 */ 801, 23, 32, 949, 961, 979, 964, 964, 949, 73,
133487 /* 120 */ 113, -51, 1567, 1567, 1567, 536, 536, 536, 99, 99,
133488 /* 130 */ 813, 813, 667, 205, 240, 949, 949, 949, 949, 949,
133489 /* 140 */ 949, 949, 949, 949, 949, 949, 949, 949, 949, 949,
133490 /* 150 */ 949, 949, 949, 949, 949, 332, 1011, 422, 422, 113,
133491 /* 160 */ 30, 30, 30, 30, 30, 30, 1567, 1567, 1567, 922,
133492 /* 170 */ -94, -94, 384, 613, 828, 420, 765, 804, 851, 949,
133493 /* 180 */ 949, 949, 949, 949, 949, 949, 949, 949, 949, 949,
133494 /* 190 */ 949, 949, 949, 949, 949, 672, 672, 672, 949, 949,
133495 /* 200 */ 657, 949, 949, 949, -18, 949, 949, 994, 949, 949,
133496 /* 210 */ 949, 949, 949, 949, 949, 949, 949, 949, 772, 1118,
133497 /* 220 */ 712, 712, 712, 810, 45, 769, 1219, 1133, 418, 418,
133498 /* 230 */ 569, 1133, 569, 830, 607, 663, 882, 418, 693, 882,
133499 /* 240 */ 882, 848, 1152, 1065, 1286, 1238, 1238, 1287, 1287, 1238,
133500 /* 250 */ 1344, 1341, 1239, 1353, 1353, 1353, 1353, 1238, 1355, 1239,
133501 /* 260 */ 1344, 1341, 1341, 1239, 1238, 1355, 1243, 1312, 1238, 1238,
133502 /* 270 */ 1355, 1370, 1238, 1355, 1238, 1355, 1370, 1290, 1290, 1290,
133503 /* 280 */ 1327, 1370, 1290, 1301, 1290, 1327, 1290, 1290, 1284, 1304,
133504 /* 290 */ 1284, 1304, 1284, 1304, 1284, 1304, 1238, 1391, 1238, 1280,
133505 /* 300 */ 1370, 1366, 1366, 1370, 1302, 1308, 1310, 1309, 1239, 1414,
133506 /* 310 */ 1416, 1431, 1431, 1440, 1440, 1440, 1440, 1567, 1567, 1567,
133507 /* 320 */ 1567, 1567, 1567, 1567, 1567, 519, 978, 1210, 1225, 104,
133508 /* 330 */ 1141, 1189, 1246, 1248, 1251, 1252, 1253, 1257, 1258, 1273,
133509 /* 340 */ 1003, 1187, 1293, 1170, 1272, 1279, 1234, 1281, 1176, 1177,
133510 /* 350 */ 1289, 1242, 1195, 1453, 1455, 1437, 1319, 1447, 1369, 1452,
133511 /* 360 */ 1446, 1448, 1352, 1345, 1364, 1354, 1458, 1356, 1463, 1479,
133512 /* 370 */ 1359, 1357, 1449, 1450, 1454, 1456, 1372, 1428, 1421, 1367,
133513 /* 380 */ 1489, 1487, 1472, 1388, 1358, 1417, 1470, 1419, 1413, 1429,
133514 /* 390 */ 1395, 1480, 1483, 1486, 1394, 1402, 1488, 1430, 1490, 1491,
133515 /* 400 */ 1485, 1492, 1432, 1457, 1494, 1438, 1451, 1495, 1497, 1498,
133516 /* 410 */ 1496, 1407, 1502, 1503, 1505, 1499, 1406, 1506, 1507, 1475,
133517 /* 420 */ 1468, 1511, 1410, 1509, 1473, 1510, 1474, 1516, 1509, 1517,
133518 /* 430 */ 1518, 1519, 1520, 1521, 1523, 1532, 1524, 1526, 1525, 1527,
133519 /* 440 */ 1528, 1530, 1531, 1527, 1533, 1535, 1536, 1537, 1539, 1436,
133520 /* 450 */ 1441, 1442, 1443, 1543, 1547, 1549,
133521 };
133522 #define YY_REDUCE_USE_DFLT (-130)
133523 #define YY_REDUCE_COUNT (324)
133524 #define YY_REDUCE_MIN (-129)
133525 #define YY_REDUCE_MAX (1300)
133526 static const short yy_reduce_ofst[] = {
133527 /* 0 */ -29, 566, 525, 605, -49, 307, 491, 533, 668, 435,
133528 /* 10 */ 601, 644, 148, 747, 786, 795, 419, 788, 827, 790,
133529 /* 20 */ 454, 832, 889, 495, 824, 734, 76, 76, 76, 76,
133530 /* 30 */ 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
133531 /* 40 */ 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
133532 /* 50 */ 76, 76, 76, 76, 76, 76, 76, 76, 783, 898,
133533 /* 60 */ 905, 907, 911, 921, 933, 936, 940, 943, 947, 950,
133534 /* 70 */ 952, 955, 958, 962, 965, 969, 974, 977, 980, 984,
133535 /* 80 */ 988, 991, 993, 996, 999, 1002, 1006, 1010, 1018, 1021,
133536 /* 90 */ 1024, 1028, 1032, 1034, 1036, 1040, 1046, 1051, 1058, 1062,
133537 /* 100 */ 1064, 1068, 1070, 1073, 76, 76, 76, 76, 76, 76,
133538 /* 110 */ 76, 76, 76, 855, 36, 523, 235, 416, 777, 76,
133539 /* 120 */ 278, 76, 76, 76, 76, 700, 700, 700, 150, 220,
133540 /* 130 */ 147, 217, 221, 306, 306, 611, 5, 535, 556, 620,
133541 /* 140 */ 720, 872, 897, 116, 864, 349, 1035, 1037, 404, 1047,
133542 /* 150 */ 992, -129, 1050, 492, 62, 722, 879, 1072, 1089, 808,
133543 /* 160 */ 1066, 1094, 1095, 1096, 1097, 1098, 776, 1054, 557, 57,
133544 /* 170 */ 112, 131, 167, 182, 250, 272, 291, 331, 364, 438,
133545 /* 180 */ 497, 517, 591, 653, 690, 739, 775, 798, 892, 908,
133546 /* 190 */ 924, 930, 1015, 1063, 1069, 355, 784, 799, 981, 1101,
133547 /* 200 */ 926, 1151, 1161, 1162, 945, 1164, 1166, 1128, 1168, 1171,
133548 /* 210 */ 1172, 250, 1173, 1174, 1175, 1178, 1180, 1181, 1088, 1102,
133549 /* 220 */ 1119, 1124, 1126, 926, 1131, 1139, 1188, 1140, 1129, 1130,
133550 /* 230 */ 1103, 1144, 1107, 1179, 1156, 1167, 1182, 1134, 1122, 1183,
133551 /* 240 */ 1184, 1150, 1153, 1197, 1111, 1202, 1203, 1123, 1125, 1205,
133552 /* 250 */ 1147, 1185, 1169, 1186, 1190, 1191, 1192, 1213, 1217, 1193,
133553 /* 260 */ 1157, 1196, 1198, 1194, 1220, 1218, 1145, 1154, 1229, 1231,
133554 /* 270 */ 1233, 1216, 1237, 1240, 1241, 1244, 1222, 1227, 1230, 1232,
133555 /* 280 */ 1223, 1235, 1236, 1245, 1249, 1226, 1250, 1254, 1199, 1201,
133556 /* 290 */ 1204, 1207, 1209, 1211, 1214, 1212, 1255, 1208, 1259, 1215,
133557 /* 300 */ 1256, 1200, 1206, 1260, 1247, 1261, 1263, 1262, 1266, 1278,
133558 /* 310 */ 1282, 1292, 1294, 1297, 1298, 1299, 1300, 1221, 1224, 1228,
133559 /* 320 */ 1288, 1291, 1276, 1277, 1295,
133560 };
133561 static const YYACTIONTYPE yy_default[] = {
133562 /* 0 */ 1281, 1271, 1271, 1271, 1203, 1203, 1203, 1203, 1271, 1096,
133563 /* 10 */ 1125, 1125, 1255, 1332, 1332, 1332, 1332, 1332, 1332, 1202,
133564 /* 20 */ 1332, 1332, 1332, 1332, 1271, 1100, 1131, 1332, 1332, 1332,
133565 /* 30 */ 1332, 1204, 1205, 1332, 1332, 1332, 1254, 1256, 1141, 1140,
133566 /* 40 */ 1139, 1138, 1237, 1112, 1136, 1129, 1133, 1204, 1198, 1199,
133567 /* 50 */ 1197, 1201, 1205, 1332, 1132, 1167, 1182, 1166, 1332, 1332,
133568 /* 60 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133569 /* 70 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133570 /* 80 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133571 /* 90 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133572 /* 100 */ 1332, 1332, 1332, 1332, 1176, 1181, 1188, 1180, 1177, 1169,
133573 /* 110 */ 1168, 1170, 1171, 1332, 1019, 1067, 1332, 1332, 1332, 1172,
133574 /* 120 */ 1332, 1173, 1185, 1184, 1183, 1262, 1289, 1288, 1332, 1332,
133575 /* 130 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133576 /* 140 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133577 /* 150 */ 1332, 1332, 1332, 1332, 1332, 1281, 1271, 1025, 1025, 1332,
133578 /* 160 */ 1271, 1271, 1271, 1271, 1271, 1271, 1267, 1100, 1091, 1332,
133579 /* 170 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133580 /* 180 */ 1259, 1257, 1332, 1218, 1332, 1332, 1332, 1332, 1332, 1332,
133581 /* 190 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133582 /* 200 */ 1332, 1332, 1332, 1332, 1096, 1332, 1332, 1332, 1332, 1332,
133583 /* 210 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1283, 1332, 1232,
133584 /* 220 */ 1096, 1096, 1096, 1098, 1080, 1090, 1004, 1135, 1114, 1114,
133585 /* 230 */ 1321, 1135, 1321, 1042, 1303, 1039, 1125, 1114, 1200, 1125,
133586 /* 240 */ 1125, 1097, 1090, 1332, 1324, 1105, 1105, 1323, 1323, 1105,
133587 /* 250 */ 1146, 1070, 1135, 1076, 1076, 1076, 1076, 1105, 1016, 1135,
133588 /* 260 */ 1146, 1070, 1070, 1135, 1105, 1016, 1236, 1318, 1105, 1105,
133589 /* 270 */ 1016, 1211, 1105, 1016, 1105, 1016, 1211, 1068, 1068, 1068,
133590 /* 280 */ 1057, 1211, 1068, 1042, 1068, 1057, 1068, 1068, 1118, 1113,
133591 /* 290 */ 1118, 1113, 1118, 1113, 1118, 1113, 1105, 1206, 1105, 1332,
133592 /* 300 */ 1211, 1215, 1215, 1211, 1130, 1119, 1128, 1126, 1135, 1022,
133593 /* 310 */ 1060, 1286, 1286, 1282, 1282, 1282, 1282, 1329, 1329, 1267,
133594 /* 320 */ 1298, 1298, 1044, 1044, 1298, 1332, 1332, 1332, 1332, 1332,
133595 /* 330 */ 1332, 1293, 1332, 1220, 1332, 1332, 1332, 1332, 1332, 1332,
133596 /* 340 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133597 /* 350 */ 1332, 1332, 1152, 1332, 1000, 1264, 1332, 1332, 1263, 1332,
133598 /* 360 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133599 /* 370 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1320,
133600 /* 380 */ 1332, 1332, 1332, 1332, 1332, 1332, 1235, 1234, 1332, 1332,
133601 /* 390 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133602 /* 400 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
133603 /* 410 */ 1332, 1082, 1332, 1332, 1332, 1307, 1332, 1332, 1332, 1332,
133604 /* 420 */ 1332, 1332, 1332, 1127, 1332, 1120, 1332, 1332, 1311, 1332,
133605 /* 430 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1273,
133606 /* 440 */ 1332, 1332, 1332, 1272, 1332, 1332, 1332, 1332, 1332, 1154,
133607 /* 450 */ 1332, 1153, 1157, 1332, 1010, 1332,
133608 };
133609 /********** End of lemon-generated parsing tables *****************************/
133610
133611 /* The next table maps tokens (terminal symbols) into fallback tokens.
133612 ** If a construct like the following:
@@ -133862,11 +133836,11 @@
133836 "DEFERRABLE", "FOREIGN", "DROP", "UNION",
133837 "ALL", "EXCEPT", "INTERSECT", "SELECT",
133838 "VALUES", "DISTINCT", "DOT", "FROM",
133839 "JOIN", "USING", "ORDER", "GROUP",
133840 "HAVING", "LIMIT", "WHERE", "INTO",
133841 "FLOAT", "BLOB", "INTEGER", "VARIABLE",
133842 "CASE", "WHEN", "THEN", "ELSE",
133843 "INDEX", "ALTER", "ADD", "error",
133844 "input", "cmdlist", "ecmd", "explain",
133845 "cmdx", "cmd", "transtype", "trans_opt",
133846 "nm", "savepoint_opt", "create_table", "create_table_args",
@@ -134055,185 +134029,186 @@
134029 /* 151 */ "term ::= NULL",
134030 /* 152 */ "expr ::= ID|INDEXED",
134031 /* 153 */ "expr ::= JOIN_KW",
134032 /* 154 */ "expr ::= nm DOT nm",
134033 /* 155 */ "expr ::= nm DOT nm DOT nm",
134034 /* 156 */ "term ::= FLOAT|BLOB",
134035 /* 157 */ "term ::= STRING",
134036 /* 158 */ "term ::= INTEGER",
134037 /* 159 */ "expr ::= VARIABLE",
134038 /* 160 */ "expr ::= expr COLLATE ID|STRING",
134039 /* 161 */ "expr ::= CAST LP expr AS typetoken RP",
134040 /* 162 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
134041 /* 163 */ "expr ::= ID|INDEXED LP STAR RP",
134042 /* 164 */ "term ::= CTIME_KW",
134043 /* 165 */ "expr ::= LP nexprlist COMMA expr RP",
134044 /* 166 */ "expr ::= expr AND expr",
134045 /* 167 */ "expr ::= expr OR expr",
134046 /* 168 */ "expr ::= expr LT|GT|GE|LE expr",
134047 /* 169 */ "expr ::= expr EQ|NE expr",
134048 /* 170 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
134049 /* 171 */ "expr ::= expr PLUS|MINUS expr",
134050 /* 172 */ "expr ::= expr STAR|SLASH|REM expr",
134051 /* 173 */ "expr ::= expr CONCAT expr",
134052 /* 174 */ "likeop ::= LIKE_KW|MATCH",
134053 /* 175 */ "likeop ::= NOT LIKE_KW|MATCH",
134054 /* 176 */ "expr ::= expr likeop expr",
134055 /* 177 */ "expr ::= expr likeop expr ESCAPE expr",
134056 /* 178 */ "expr ::= expr ISNULL|NOTNULL",
134057 /* 179 */ "expr ::= expr NOT NULL",
134058 /* 180 */ "expr ::= expr IS expr",
134059 /* 181 */ "expr ::= expr IS NOT expr",
134060 /* 182 */ "expr ::= NOT expr",
134061 /* 183 */ "expr ::= BITNOT expr",
134062 /* 184 */ "expr ::= MINUS expr",
134063 /* 185 */ "expr ::= PLUS expr",
134064 /* 186 */ "between_op ::= BETWEEN",
134065 /* 187 */ "between_op ::= NOT BETWEEN",
134066 /* 188 */ "expr ::= expr between_op expr AND expr",
134067 /* 189 */ "in_op ::= IN",
134068 /* 190 */ "in_op ::= NOT IN",
134069 /* 191 */ "expr ::= expr in_op LP exprlist RP",
134070 /* 192 */ "expr ::= LP select RP",
134071 /* 193 */ "expr ::= expr in_op LP select RP",
134072 /* 194 */ "expr ::= expr in_op nm dbnm paren_exprlist",
134073 /* 195 */ "expr ::= EXISTS LP select RP",
134074 /* 196 */ "expr ::= CASE case_operand case_exprlist case_else END",
134075 /* 197 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
134076 /* 198 */ "case_exprlist ::= WHEN expr THEN expr",
134077 /* 199 */ "case_else ::= ELSE expr",
134078 /* 200 */ "case_else ::=",
134079 /* 201 */ "case_operand ::= expr",
134080 /* 202 */ "case_operand ::=",
134081 /* 203 */ "exprlist ::=",
134082 /* 204 */ "nexprlist ::= nexprlist COMMA expr",
134083 /* 205 */ "nexprlist ::= expr",
134084 /* 206 */ "paren_exprlist ::=",
134085 /* 207 */ "paren_exprlist ::= LP exprlist RP",
134086 /* 208 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
134087 /* 209 */ "uniqueflag ::= UNIQUE",
134088 /* 210 */ "uniqueflag ::=",
134089 /* 211 */ "eidlist_opt ::=",
134090 /* 212 */ "eidlist_opt ::= LP eidlist RP",
134091 /* 213 */ "eidlist ::= eidlist COMMA nm collate sortorder",
134092 /* 214 */ "eidlist ::= nm collate sortorder",
134093 /* 215 */ "collate ::=",
134094 /* 216 */ "collate ::= COLLATE ID|STRING",
134095 /* 217 */ "cmd ::= DROP INDEX ifexists fullname",
134096 /* 218 */ "cmd ::= VACUUM",
134097 /* 219 */ "cmd ::= VACUUM nm",
134098 /* 220 */ "cmd ::= PRAGMA nm dbnm",
134099 /* 221 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
134100 /* 222 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
134101 /* 223 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
134102 /* 224 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
134103 /* 225 */ "plus_num ::= PLUS INTEGER|FLOAT",
134104 /* 226 */ "minus_num ::= MINUS INTEGER|FLOAT",
134105 /* 227 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
134106 /* 228 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
134107 /* 229 */ "trigger_time ::= BEFORE",
134108 /* 230 */ "trigger_time ::= AFTER",
134109 /* 231 */ "trigger_time ::= INSTEAD OF",
134110 /* 232 */ "trigger_time ::=",
134111 /* 233 */ "trigger_event ::= DELETE|INSERT",
134112 /* 234 */ "trigger_event ::= UPDATE",
134113 /* 235 */ "trigger_event ::= UPDATE OF idlist",
134114 /* 236 */ "when_clause ::=",
134115 /* 237 */ "when_clause ::= WHEN expr",
134116 /* 238 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
134117 /* 239 */ "trigger_cmd_list ::= trigger_cmd SEMI",
134118 /* 240 */ "trnm ::= nm DOT nm",
134119 /* 241 */ "tridxby ::= INDEXED BY nm",
134120 /* 242 */ "tridxby ::= NOT INDEXED",
134121 /* 243 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt",
134122 /* 244 */ "trigger_cmd ::= insert_cmd INTO trnm idlist_opt select",
134123 /* 245 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt",
134124 /* 246 */ "trigger_cmd ::= select",
134125 /* 247 */ "expr ::= RAISE LP IGNORE RP",
134126 /* 248 */ "expr ::= RAISE LP raisetype COMMA nm RP",
134127 /* 249 */ "raisetype ::= ROLLBACK",
134128 /* 250 */ "raisetype ::= ABORT",
134129 /* 251 */ "raisetype ::= FAIL",
134130 /* 252 */ "cmd ::= DROP TRIGGER ifexists fullname",
134131 /* 253 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
134132 /* 254 */ "cmd ::= DETACH database_kw_opt expr",
134133 /* 255 */ "key_opt ::=",
134134 /* 256 */ "key_opt ::= KEY expr",
134135 /* 257 */ "cmd ::= REINDEX",
134136 /* 258 */ "cmd ::= REINDEX nm dbnm",
134137 /* 259 */ "cmd ::= ANALYZE",
134138 /* 260 */ "cmd ::= ANALYZE nm dbnm",
134139 /* 261 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
134140 /* 262 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
134141 /* 263 */ "add_column_fullname ::= fullname",
134142 /* 264 */ "cmd ::= create_vtab",
134143 /* 265 */ "cmd ::= create_vtab LP vtabarglist RP",
134144 /* 266 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
134145 /* 267 */ "vtabarg ::=",
134146 /* 268 */ "vtabargtoken ::= ANY",
134147 /* 269 */ "vtabargtoken ::= lp anylist RP",
134148 /* 270 */ "lp ::= LP",
134149 /* 271 */ "with ::=",
134150 /* 272 */ "with ::= WITH wqlist",
134151 /* 273 */ "with ::= WITH RECURSIVE wqlist",
134152 /* 274 */ "wqlist ::= nm eidlist_opt AS LP select RP",
134153 /* 275 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
134154 /* 276 */ "input ::= cmdlist",
134155 /* 277 */ "cmdlist ::= cmdlist ecmd",
134156 /* 278 */ "cmdlist ::= ecmd",
134157 /* 279 */ "ecmd ::= SEMI",
134158 /* 280 */ "ecmd ::= explain cmdx SEMI",
134159 /* 281 */ "explain ::=",
134160 /* 282 */ "trans_opt ::=",
134161 /* 283 */ "trans_opt ::= TRANSACTION",
134162 /* 284 */ "trans_opt ::= TRANSACTION nm",
134163 /* 285 */ "savepoint_opt ::= SAVEPOINT",
134164 /* 286 */ "savepoint_opt ::=",
134165 /* 287 */ "cmd ::= create_table create_table_args",
134166 /* 288 */ "columnlist ::= columnlist COMMA columnname carglist",
134167 /* 289 */ "columnlist ::= columnname carglist",
134168 /* 290 */ "nm ::= ID|INDEXED",
134169 /* 291 */ "nm ::= STRING",
134170 /* 292 */ "nm ::= JOIN_KW",
134171 /* 293 */ "typetoken ::= typename",
134172 /* 294 */ "typename ::= ID|STRING",
134173 /* 295 */ "signed ::= plus_num",
134174 /* 296 */ "signed ::= minus_num",
134175 /* 297 */ "carglist ::= carglist ccons",
134176 /* 298 */ "carglist ::=",
134177 /* 299 */ "ccons ::= NULL onconf",
134178 /* 300 */ "conslist_opt ::= COMMA conslist",
134179 /* 301 */ "conslist ::= conslist tconscomma tcons",
134180 /* 302 */ "conslist ::= tcons",
134181 /* 303 */ "tconscomma ::=",
134182 /* 304 */ "defer_subclause_opt ::= defer_subclause",
134183 /* 305 */ "resolvetype ::= raisetype",
134184 /* 306 */ "selectnowith ::= oneselect",
134185 /* 307 */ "oneselect ::= values",
134186 /* 308 */ "sclp ::= selcollist COMMA",
134187 /* 309 */ "as ::= ID|STRING",
134188 /* 310 */ "expr ::= term",
134189 /* 311 */ "exprlist ::= nexprlist",
134190 /* 312 */ "nmnum ::= plus_num",
134191 /* 313 */ "nmnum ::= nm",
134192 /* 314 */ "nmnum ::= ON",
134193 /* 315 */ "nmnum ::= DELETE",
134194 /* 316 */ "nmnum ::= DEFAULT",
134195 /* 317 */ "plus_num ::= INTEGER|FLOAT",
134196 /* 318 */ "foreach_clause ::=",
134197 /* 319 */ "foreach_clause ::= FOR EACH ROW",
134198 /* 320 */ "trnm ::= nm",
134199 /* 321 */ "tridxby ::=",
134200 /* 322 */ "database_kw_opt ::= DATABASE",
134201 /* 323 */ "database_kw_opt ::=",
134202 /* 324 */ "kwcolumn_opt ::=",
134203 /* 325 */ "kwcolumn_opt ::= COLUMNKW",
134204 /* 326 */ "vtabarglist ::= vtabarg",
134205 /* 327 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
134206 /* 328 */ "vtabarg ::= vtabarg vtabargtoken",
134207 /* 329 */ "anylist ::=",
134208 /* 330 */ "anylist ::= anylist LP anylist RP",
134209 /* 331 */ "anylist ::= anylist ANY",
134210 };
134211 #endif /* NDEBUG */
134212
134213
134214 #if YYSTACKDEPTH<=0
@@ -134811,10 +134786,11 @@
134786 { 173, 1 },
134787 { 173, 3 },
134788 { 173, 5 },
134789 { 172, 1 },
134790 { 172, 1 },
134791 { 172, 1 },
134792 { 173, 1 },
134793 { 173, 3 },
134794 { 173, 6 },
134795 { 173, 5 },
134796 { 173, 4 },
@@ -135105,11 +135081,11 @@
135081 case 42: /* autoinc ::= */ yytestcase(yyruleno==42);
135082 case 57: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==57);
135083 case 67: /* defer_subclause_opt ::= */ yytestcase(yyruleno==67);
135084 case 76: /* ifexists ::= */ yytestcase(yyruleno==76);
135085 case 90: /* distinct ::= */ yytestcase(yyruleno==90);
135086 case 215: /* collate ::= */ yytestcase(yyruleno==215);
135087 {yymsp[1].minor.yy194 = 0;}
135088 break;
135089 case 17: /* ifnotexists ::= IF NOT EXISTS */
135090 {yymsp[-2].minor.yy194 = 1;}
135091 break;
@@ -135249,13 +135225,13 @@
135225 case 144: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==144);
135226 {yymsp[-1].minor.yy194 = yymsp[0].minor.yy194;}
135227 break;
135228 case 58: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
135229 case 75: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==75);
135230 case 187: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==187);
135231 case 190: /* in_op ::= NOT IN */ yytestcase(yyruleno==190);
135232 case 216: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==216);
135233 {yymsp[-1].minor.yy194 = 1;}
135234 break;
135235 case 59: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
135236 {yymsp[-1].minor.yy194 = 0;}
135237 break;
@@ -135415,13 +135391,13 @@
135391 {yymsp[0].minor.yy194 = SF_All;}
135392 break;
135393 case 91: /* sclp ::= */
135394 case 119: /* orderby_opt ::= */ yytestcase(yyruleno==119);
135395 case 126: /* groupby_opt ::= */ yytestcase(yyruleno==126);
135396 case 203: /* exprlist ::= */ yytestcase(yyruleno==203);
135397 case 206: /* paren_exprlist ::= */ yytestcase(yyruleno==206);
135398 case 211: /* eidlist_opt ::= */ yytestcase(yyruleno==211);
135399 {yymsp[1].minor.yy148 = 0;}
135400 break;
135401 case 92: /* selcollist ::= sclp expr as */
135402 {
135403 yymsp[-2].minor.yy148 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy148, yymsp[-1].minor.yy190.pExpr);
@@ -135435,20 +135411,20 @@
135411 yymsp[-1].minor.yy148 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy148, p);
135412 }
135413 break;
135414 case 94: /* selcollist ::= sclp nm DOT STAR */
135415 {
135416 Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0, 0);
135417 Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
135418 Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
135419 yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy148, pDot);
135420 }
135421 break;
135422 case 95: /* as ::= AS nm */
135423 case 106: /* dbnm ::= DOT nm */ yytestcase(yyruleno==106);
135424 case 225: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==225);
135425 case 226: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==226);
135426 {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
135427 break;
135428 case 97: /* from ::= */
135429 {yymsp[1].minor.yy185 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy185));}
135430 break;
@@ -135527,18 +135503,18 @@
135503 {yymsp[-3].minor.yy194 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
135504 break;
135505 case 112: /* on_opt ::= ON expr */
135506 case 129: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==129);
135507 case 136: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==136);
135508 case 199: /* case_else ::= ELSE expr */ yytestcase(yyruleno==199);
135509 {yymsp[-1].minor.yy72 = yymsp[0].minor.yy190.pExpr;}
135510 break;
135511 case 113: /* on_opt ::= */
135512 case 128: /* having_opt ::= */ yytestcase(yyruleno==128);
135513 case 135: /* where_opt ::= */ yytestcase(yyruleno==135);
135514 case 200: /* case_else ::= */ yytestcase(yyruleno==200);
135515 case 202: /* case_operand ::= */ yytestcase(yyruleno==202);
135516 {yymsp[1].minor.yy72 = 0;}
135517 break;
135518 case 115: /* indexed_opt ::= INDEXED BY nm */
135519 {yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
135520 break;
@@ -135650,41 +135626,51 @@
135626 break;
135627 case 150: /* expr ::= LP expr RP */
135628 {spanSet(&yymsp[-2].minor.yy190,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-B*/ yymsp[-2].minor.yy190.pExpr = yymsp[-1].minor.yy190.pExpr;}
135629 break;
135630 case 151: /* term ::= NULL */
135631 case 156: /* term ::= FLOAT|BLOB */ yytestcase(yyruleno==156);
135632 case 157: /* term ::= STRING */ yytestcase(yyruleno==157);
135633 {spanExpr(&yymsp[0].minor.yy190,pParse,yymsp[0].major,yymsp[0].minor.yy0);/*A-overwrites-X*/}
135634 break;
135635 case 152: /* expr ::= ID|INDEXED */
135636 case 153: /* expr ::= JOIN_KW */ yytestcase(yyruleno==153);
135637 {spanExpr(&yymsp[0].minor.yy190,pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
135638 break;
135639 case 154: /* expr ::= nm DOT nm */
135640 {
135641 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
135642 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
135643 spanSet(&yymsp[-2].minor.yy190,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
135644 yymsp[-2].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
135645 }
135646 break;
135647 case 155: /* expr ::= nm DOT nm DOT nm */
135648 {
135649 Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
135650 Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
135651 Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
135652 Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
135653 spanSet(&yymsp[-4].minor.yy190,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
135654 yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
135655 }
135656 break;
135657 case 158: /* term ::= INTEGER */
135658 {
135659 yylhsminor.yy190.pExpr = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
135660 yylhsminor.yy190.zStart = yymsp[0].minor.yy0.z;
135661 yylhsminor.yy190.zEnd = yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n;
135662 if( yylhsminor.yy190.pExpr ) yylhsminor.yy190.pExpr->flags |= EP_Leaf;
135663 }
135664 yymsp[0].minor.yy190 = yylhsminor.yy190;
135665 break;
135666 case 159: /* expr ::= VARIABLE */
135667 {
135668 if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
135669 u32 n = yymsp[0].minor.yy0.n;
135670 spanExpr(&yymsp[0].minor.yy190, pParse, TK_VARIABLE, yymsp[0].minor.yy0);
135671 sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy190.pExpr, n);
135672 }else{
135673 /* When doing a nested parse, one can include terms in an expression
135674 ** that look like this: #1 #2 ... These terms refer to registers
135675 ** in the virtual machine. #N is the N-th register. */
135676 Token t = yymsp[0].minor.yy0; /*A-overwrites-X*/
@@ -135692,29 +135678,29 @@
135678 spanSet(&yymsp[0].minor.yy190, &t, &t);
135679 if( pParse->nested==0 ){
135680 sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
135681 yymsp[0].minor.yy190.pExpr = 0;
135682 }else{
135683 yymsp[0].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, 0);
135684 if( yymsp[0].minor.yy190.pExpr ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy190.pExpr->iTable);
135685 }
135686 }
135687 }
135688 break;
135689 case 160: /* expr ::= expr COLLATE ID|STRING */
135690 {
135691 yymsp[-2].minor.yy190.pExpr = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy190.pExpr, &yymsp[0].minor.yy0, 1);
135692 yymsp[-2].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
135693 }
135694 break;
135695 case 161: /* expr ::= CAST LP expr AS typetoken RP */
135696 {
135697 spanSet(&yymsp[-5].minor.yy190,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
135698 yymsp[-5].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy190.pExpr, 0, &yymsp[-1].minor.yy0);
135699 }
135700 break;
135701 case 162: /* expr ::= ID|INDEXED LP distinct exprlist RP */
135702 {
135703 if( yymsp[-1].minor.yy148 && yymsp[-1].minor.yy148->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
135704 sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
135705 }
135706 yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy148, &yymsp[-4].minor.yy0);
@@ -135723,25 +135709,25 @@
135709 yylhsminor.yy190.pExpr->flags |= EP_Distinct;
135710 }
135711 }
135712 yymsp[-4].minor.yy190 = yylhsminor.yy190;
135713 break;
135714 case 163: /* expr ::= ID|INDEXED LP STAR RP */
135715 {
135716 yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
135717 spanSet(&yylhsminor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
135718 }
135719 yymsp[-3].minor.yy190 = yylhsminor.yy190;
135720 break;
135721 case 164: /* term ::= CTIME_KW */
135722 {
135723 yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
135724 spanSet(&yylhsminor.yy190, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
135725 }
135726 yymsp[0].minor.yy190 = yylhsminor.yy190;
135727 break;
135728 case 165: /* expr ::= LP nexprlist COMMA expr RP */
135729 {
135730 ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy148, yymsp[-1].minor.yy190.pExpr);
135731 yylhsminor.yy190.pExpr = sqlite3PExpr(pParse, TK_VECTOR, 0, 0, 0);
135732 if( yylhsminor.yy190.pExpr ){
135733 yylhsminor.yy190.pExpr->x.pList = pList;
@@ -135750,82 +135736,86 @@
135736 sqlite3ExprListDelete(pParse->db, pList);
135737 }
135738 }
135739 yymsp[-4].minor.yy190 = yylhsminor.yy190;
135740 break;
135741 case 166: /* expr ::= expr AND expr */
135742 case 167: /* expr ::= expr OR expr */ yytestcase(yyruleno==167);
135743 case 168: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==168);
135744 case 169: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==169);
135745 case 170: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==170);
135746 case 171: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==171);
135747 case 172: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==172);
135748 case 173: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==173);
135749 {spanBinaryExpr(pParse,yymsp[-1].major,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy190);}
135750 break;
135751 case 174: /* likeop ::= LIKE_KW|MATCH */
135752 {yymsp[0].minor.yy0=yymsp[0].minor.yy0;/*A-overwrites-X*/}
135753 break;
135754 case 175: /* likeop ::= NOT LIKE_KW|MATCH */
135755 {yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
135756 break;
135757 case 176: /* expr ::= expr likeop expr */
135758 {
135759 ExprList *pList;
135760 int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
135761 yymsp[-1].minor.yy0.n &= 0x7fffffff;
135762 pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy190.pExpr);
135763 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy190.pExpr);
135764 yymsp[-2].minor.yy190.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0);
135765 exprNot(pParse, bNot, &yymsp[-2].minor.yy190);
135766 yymsp[-2].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
135767 if( yymsp[-2].minor.yy190.pExpr ) yymsp[-2].minor.yy190.pExpr->flags |= EP_InfixFunc;
135768 }
135769 break;
135770 case 177: /* expr ::= expr likeop expr ESCAPE expr */
135771 {
135772 ExprList *pList;
135773 int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
135774 yymsp[-3].minor.yy0.n &= 0x7fffffff;
135775 pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
135776 pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy190.pExpr);
135777 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy190.pExpr);
135778 yymsp[-4].minor.yy190.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0);
135779 exprNot(pParse, bNot, &yymsp[-4].minor.yy190);
135780 yymsp[-4].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
135781 if( yymsp[-4].minor.yy190.pExpr ) yymsp[-4].minor.yy190.pExpr->flags |= EP_InfixFunc;
135782 }
135783 break;
135784 case 178: /* expr ::= expr ISNULL|NOTNULL */
135785 {spanUnaryPostfix(pParse,yymsp[0].major,&yymsp[-1].minor.yy190,&yymsp[0].minor.yy0);}
135786 break;
135787 case 179: /* expr ::= expr NOT NULL */
135788 {spanUnaryPostfix(pParse,TK_NOTNULL,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy0);}
135789 break;
135790 case 180: /* expr ::= expr IS expr */
135791 {
135792 spanBinaryExpr(pParse,TK_IS,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy190);
135793 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy190.pExpr, yymsp[-2].minor.yy190.pExpr, TK_ISNULL);
135794 }
135795 break;
135796 case 181: /* expr ::= expr IS NOT expr */
135797 {
135798 spanBinaryExpr(pParse,TK_ISNOT,&yymsp[-3].minor.yy190,&yymsp[0].minor.yy190);
135799 binaryToUnaryIfNull(pParse, yymsp[0].minor.yy190.pExpr, yymsp[-3].minor.yy190.pExpr, TK_NOTNULL);
135800 }
135801 break;
135802 case 182: /* expr ::= NOT expr */
135803 case 183: /* expr ::= BITNOT expr */ yytestcase(yyruleno==183);
135804 {spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,yymsp[-1].major,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
135805 break;
135806 case 184: /* expr ::= MINUS expr */
135807 {spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,TK_UMINUS,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
135808 break;
135809 case 185: /* expr ::= PLUS expr */
135810 {spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,TK_UPLUS,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
135811 break;
135812 case 186: /* between_op ::= BETWEEN */
135813 case 189: /* in_op ::= IN */ yytestcase(yyruleno==189);
135814 {yymsp[0].minor.yy194 = 0;}
135815 break;
135816 case 188: /* expr ::= expr between_op expr AND expr */
135817 {
135818 ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
135819 pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy190.pExpr);
135820 yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy190.pExpr, 0, 0);
135821 if( yymsp[-4].minor.yy190.pExpr ){
@@ -135835,11 +135825,11 @@
135825 }
135826 exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135827 yymsp[-4].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
135828 }
135829 break;
135830 case 191: /* expr ::= expr in_op LP exprlist RP */
135831 {
135832 if( yymsp[-1].minor.yy148==0 ){
135833 /* Expressions of the form
135834 **
135835 ** expr1 IN ()
@@ -135888,26 +135878,26 @@
135878 exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135879 }
135880 yymsp[-4].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
135881 }
135882 break;
135883 case 192: /* expr ::= LP select RP */
135884 {
135885 spanSet(&yymsp[-2].minor.yy190,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-B*/
135886 yymsp[-2].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
135887 sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy190.pExpr, yymsp[-1].minor.yy243);
135888 }
135889 break;
135890 case 193: /* expr ::= expr in_op LP select RP */
135891 {
135892 yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy190.pExpr, 0, 0);
135893 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy190.pExpr, yymsp[-1].minor.yy243);
135894 exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135895 yymsp[-4].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
135896 }
135897 break;
135898 case 194: /* expr ::= expr in_op nm dbnm paren_exprlist */
135899 {
135900 SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
135901 Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
135902 if( yymsp[0].minor.yy148 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy148);
135903 yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy190.pExpr, 0, 0);
@@ -135914,19 +135904,19 @@
135904 sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy190.pExpr, pSelect);
135905 exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
135906 yymsp[-4].minor.yy190.zEnd = yymsp[-1].minor.yy0.z ? &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n] : &yymsp[-2].minor.yy0.z[yymsp[-2].minor.yy0.n];
135907 }
135908 break;
135909 case 195: /* expr ::= EXISTS LP select RP */
135910 {
135911 Expr *p;
135912 spanSet(&yymsp[-3].minor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-B*/
135913 p = yymsp[-3].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
135914 sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy243);
135915 }
135916 break;
135917 case 196: /* expr ::= CASE case_operand case_exprlist case_else END */
135918 {
135919 spanSet(&yymsp[-4].minor.yy190,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-C*/
135920 yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy72, 0, 0);
135921 if( yymsp[-4].minor.yy190.pExpr ){
135922 yymsp[-4].minor.yy190.pExpr->x.pList = yymsp[-1].minor.yy72 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy148,yymsp[-1].minor.yy72) : yymsp[-2].minor.yy148;
@@ -135935,334 +135925,334 @@
135925 sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy148);
135926 sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy72);
135927 }
135928 }
135929 break;
135930 case 197: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
135931 {
135932 yymsp[-4].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy148, yymsp[-2].minor.yy190.pExpr);
135933 yymsp[-4].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy148, yymsp[0].minor.yy190.pExpr);
135934 }
135935 break;
135936 case 198: /* case_exprlist ::= WHEN expr THEN expr */
135937 {
135938 yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
135939 yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy148, yymsp[0].minor.yy190.pExpr);
135940 }
135941 break;
135942 case 201: /* case_operand ::= expr */
135943 {yymsp[0].minor.yy72 = yymsp[0].minor.yy190.pExpr; /*A-overwrites-X*/}
135944 break;
135945 case 204: /* nexprlist ::= nexprlist COMMA expr */
135946 {yymsp[-2].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy148,yymsp[0].minor.yy190.pExpr);}
135947 break;
135948 case 205: /* nexprlist ::= expr */
135949 {yymsp[0].minor.yy148 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy190.pExpr); /*A-overwrites-Y*/}
135950 break;
135951 case 207: /* paren_exprlist ::= LP exprlist RP */
135952 case 212: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==212);
135953 {yymsp[-2].minor.yy148 = yymsp[-1].minor.yy148;}
135954 break;
135955 case 208: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
135956 {
135957 sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
135958 sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy148, yymsp[-10].minor.yy194,
135959 &yymsp[-11].minor.yy0, yymsp[0].minor.yy72, SQLITE_SO_ASC, yymsp[-8].minor.yy194, SQLITE_IDXTYPE_APPDEF);
135960 }
135961 break;
135962 case 209: /* uniqueflag ::= UNIQUE */
135963 case 250: /* raisetype ::= ABORT */ yytestcase(yyruleno==250);
135964 {yymsp[0].minor.yy194 = OE_Abort;}
135965 break;
135966 case 210: /* uniqueflag ::= */
135967 {yymsp[1].minor.yy194 = OE_None;}
135968 break;
135969 case 213: /* eidlist ::= eidlist COMMA nm collate sortorder */
135970 {
135971 yymsp[-4].minor.yy148 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy148, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy194, yymsp[0].minor.yy194);
135972 }
135973 break;
135974 case 214: /* eidlist ::= nm collate sortorder */
135975 {
135976 yymsp[-2].minor.yy148 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy194, yymsp[0].minor.yy194); /*A-overwrites-Y*/
135977 }
135978 break;
135979 case 217: /* cmd ::= DROP INDEX ifexists fullname */
135980 {sqlite3DropIndex(pParse, yymsp[0].minor.yy185, yymsp[-1].minor.yy194);}
135981 break;
135982 case 218: /* cmd ::= VACUUM */
135983 {sqlite3Vacuum(pParse,0);}
135984 break;
135985 case 219: /* cmd ::= VACUUM nm */
135986 {sqlite3Vacuum(pParse,&yymsp[0].minor.yy0);}
135987 break;
135988 case 220: /* cmd ::= PRAGMA nm dbnm */
135989 {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
135990 break;
135991 case 221: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
135992 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
135993 break;
135994 case 222: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
135995 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
135996 break;
135997 case 223: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
135998 {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
135999 break;
136000 case 224: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
136001 {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
136002 break;
136003 case 227: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
136004 {
136005 Token all;
136006 all.z = yymsp[-3].minor.yy0.z;
136007 all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
136008 sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy145, &all);
136009 }
136010 break;
136011 case 228: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
136012 {
136013 sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy194, yymsp[-4].minor.yy332.a, yymsp[-4].minor.yy332.b, yymsp[-2].minor.yy185, yymsp[0].minor.yy72, yymsp[-10].minor.yy194, yymsp[-8].minor.yy194);
136014 yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
136015 }
136016 break;
136017 case 229: /* trigger_time ::= BEFORE */
136018 { yymsp[0].minor.yy194 = TK_BEFORE; }
136019 break;
136020 case 230: /* trigger_time ::= AFTER */
136021 { yymsp[0].minor.yy194 = TK_AFTER; }
136022 break;
136023 case 231: /* trigger_time ::= INSTEAD OF */
136024 { yymsp[-1].minor.yy194 = TK_INSTEAD;}
136025 break;
136026 case 232: /* trigger_time ::= */
136027 { yymsp[1].minor.yy194 = TK_BEFORE; }
136028 break;
136029 case 233: /* trigger_event ::= DELETE|INSERT */
136030 case 234: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==234);
136031 {yymsp[0].minor.yy332.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy332.b = 0;}
136032 break;
136033 case 235: /* trigger_event ::= UPDATE OF idlist */
136034 {yymsp[-2].minor.yy332.a = TK_UPDATE; yymsp[-2].minor.yy332.b = yymsp[0].minor.yy254;}
136035 break;
136036 case 236: /* when_clause ::= */
136037 case 255: /* key_opt ::= */ yytestcase(yyruleno==255);
136038 { yymsp[1].minor.yy72 = 0; }
136039 break;
136040 case 237: /* when_clause ::= WHEN expr */
136041 case 256: /* key_opt ::= KEY expr */ yytestcase(yyruleno==256);
136042 { yymsp[-1].minor.yy72 = yymsp[0].minor.yy190.pExpr; }
136043 break;
136044 case 238: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
136045 {
136046 assert( yymsp[-2].minor.yy145!=0 );
136047 yymsp[-2].minor.yy145->pLast->pNext = yymsp[-1].minor.yy145;
136048 yymsp[-2].minor.yy145->pLast = yymsp[-1].minor.yy145;
136049 }
136050 break;
136051 case 239: /* trigger_cmd_list ::= trigger_cmd SEMI */
136052 {
136053 assert( yymsp[-1].minor.yy145!=0 );
136054 yymsp[-1].minor.yy145->pLast = yymsp[-1].minor.yy145;
136055 }
136056 break;
136057 case 240: /* trnm ::= nm DOT nm */
136058 {
136059 yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
136060 sqlite3ErrorMsg(pParse,
136061 "qualified table names are not allowed on INSERT, UPDATE, and DELETE "
136062 "statements within triggers");
136063 }
136064 break;
136065 case 241: /* tridxby ::= INDEXED BY nm */
136066 {
136067 sqlite3ErrorMsg(pParse,
136068 "the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
136069 "within triggers");
136070 }
136071 break;
136072 case 242: /* tridxby ::= NOT INDEXED */
136073 {
136074 sqlite3ErrorMsg(pParse,
136075 "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
136076 "within triggers");
136077 }
136078 break;
136079 case 243: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
136080 {yymsp[-6].minor.yy145 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy148, yymsp[0].minor.yy72, yymsp[-5].minor.yy194);}
136081 break;
136082 case 244: /* trigger_cmd ::= insert_cmd INTO trnm idlist_opt select */
136083 {yymsp[-4].minor.yy145 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy254, yymsp[0].minor.yy243, yymsp[-4].minor.yy194);/*A-overwrites-R*/}
136084 break;
136085 case 245: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
136086 {yymsp[-4].minor.yy145 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy72);}
136087 break;
136088 case 246: /* trigger_cmd ::= select */
136089 {yymsp[0].minor.yy145 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy243); /*A-overwrites-X*/}
136090 break;
136091 case 247: /* expr ::= RAISE LP IGNORE RP */
136092 {
136093 spanSet(&yymsp[-3].minor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
136094 yymsp[-3].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
136095 if( yymsp[-3].minor.yy190.pExpr ){
136096 yymsp[-3].minor.yy190.pExpr->affinity = OE_Ignore;
136097 }
136098 }
136099 break;
136100 case 248: /* expr ::= RAISE LP raisetype COMMA nm RP */
136101 {
136102 spanSet(&yymsp[-5].minor.yy190,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
136103 yymsp[-5].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
136104 if( yymsp[-5].minor.yy190.pExpr ) {
136105 yymsp[-5].minor.yy190.pExpr->affinity = (char)yymsp[-3].minor.yy194;
136106 }
136107 }
136108 break;
136109 case 249: /* raisetype ::= ROLLBACK */
136110 {yymsp[0].minor.yy194 = OE_Rollback;}
136111 break;
136112 case 251: /* raisetype ::= FAIL */
136113 {yymsp[0].minor.yy194 = OE_Fail;}
136114 break;
136115 case 252: /* cmd ::= DROP TRIGGER ifexists fullname */
136116 {
136117 sqlite3DropTrigger(pParse,yymsp[0].minor.yy185,yymsp[-1].minor.yy194);
136118 }
136119 break;
136120 case 253: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
136121 {
136122 sqlite3Attach(pParse, yymsp[-3].minor.yy190.pExpr, yymsp[-1].minor.yy190.pExpr, yymsp[0].minor.yy72);
136123 }
136124 break;
136125 case 254: /* cmd ::= DETACH database_kw_opt expr */
136126 {
136127 sqlite3Detach(pParse, yymsp[0].minor.yy190.pExpr);
136128 }
136129 break;
136130 case 257: /* cmd ::= REINDEX */
136131 {sqlite3Reindex(pParse, 0, 0);}
136132 break;
136133 case 258: /* cmd ::= REINDEX nm dbnm */
136134 {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
136135 break;
136136 case 259: /* cmd ::= ANALYZE */
136137 {sqlite3Analyze(pParse, 0, 0);}
136138 break;
136139 case 260: /* cmd ::= ANALYZE nm dbnm */
136140 {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
136141 break;
136142 case 261: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
136143 {
136144 sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy185,&yymsp[0].minor.yy0);
136145 }
136146 break;
136147 case 262: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
136148 {
136149 yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
136150 sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
136151 }
136152 break;
136153 case 263: /* add_column_fullname ::= fullname */
136154 {
136155 disableLookaside(pParse);
136156 sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy185);
136157 }
136158 break;
136159 case 264: /* cmd ::= create_vtab */
136160 {sqlite3VtabFinishParse(pParse,0);}
136161 break;
136162 case 265: /* cmd ::= create_vtab LP vtabarglist RP */
136163 {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
136164 break;
136165 case 266: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
136166 {
136167 sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy194);
136168 }
136169 break;
136170 case 267: /* vtabarg ::= */
136171 {sqlite3VtabArgInit(pParse);}
136172 break;
136173 case 268: /* vtabargtoken ::= ANY */
136174 case 269: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==269);
136175 case 270: /* lp ::= LP */ yytestcase(yyruleno==270);
136176 {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
136177 break;
136178 case 271: /* with ::= */
136179 {yymsp[1].minor.yy285 = 0;}
136180 break;
136181 case 272: /* with ::= WITH wqlist */
136182 { yymsp[-1].minor.yy285 = yymsp[0].minor.yy285; }
136183 break;
136184 case 273: /* with ::= WITH RECURSIVE wqlist */
136185 { yymsp[-2].minor.yy285 = yymsp[0].minor.yy285; }
136186 break;
136187 case 274: /* wqlist ::= nm eidlist_opt AS LP select RP */
136188 {
136189 yymsp[-5].minor.yy285 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy148, yymsp[-1].minor.yy243); /*A-overwrites-X*/
136190 }
136191 break;
136192 case 275: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
136193 {
136194 yymsp[-7].minor.yy285 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy285, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy148, yymsp[-1].minor.yy243);
136195 }
136196 break;
136197 default:
136198 /* (276) input ::= cmdlist */ yytestcase(yyruleno==276);
136199 /* (277) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==277);
136200 /* (278) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=278);
136201 /* (279) ecmd ::= SEMI */ yytestcase(yyruleno==279);
136202 /* (280) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==280);
136203 /* (281) explain ::= */ yytestcase(yyruleno==281);
136204 /* (282) trans_opt ::= */ yytestcase(yyruleno==282);
136205 /* (283) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==283);
136206 /* (284) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==284);
136207 /* (285) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==285);
136208 /* (286) savepoint_opt ::= */ yytestcase(yyruleno==286);
136209 /* (287) cmd ::= create_table create_table_args */ yytestcase(yyruleno==287);
136210 /* (288) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==288);
136211 /* (289) columnlist ::= columnname carglist */ yytestcase(yyruleno==289);
136212 /* (290) nm ::= ID|INDEXED */ yytestcase(yyruleno==290);
136213 /* (291) nm ::= STRING */ yytestcase(yyruleno==291);
136214 /* (292) nm ::= JOIN_KW */ yytestcase(yyruleno==292);
136215 /* (293) typetoken ::= typename */ yytestcase(yyruleno==293);
136216 /* (294) typename ::= ID|STRING */ yytestcase(yyruleno==294);
136217 /* (295) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=295);
136218 /* (296) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=296);
136219 /* (297) carglist ::= carglist ccons */ yytestcase(yyruleno==297);
136220 /* (298) carglist ::= */ yytestcase(yyruleno==298);
136221 /* (299) ccons ::= NULL onconf */ yytestcase(yyruleno==299);
136222 /* (300) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==300);
136223 /* (301) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==301);
136224 /* (302) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=302);
136225 /* (303) tconscomma ::= */ yytestcase(yyruleno==303);
136226 /* (304) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=304);
136227 /* (305) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=305);
136228 /* (306) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=306);
136229 /* (307) oneselect ::= values */ yytestcase(yyruleno==307);
136230 /* (308) sclp ::= selcollist COMMA */ yytestcase(yyruleno==308);
136231 /* (309) as ::= ID|STRING */ yytestcase(yyruleno==309);
136232 /* (310) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=310);
136233 /* (311) exprlist ::= nexprlist */ yytestcase(yyruleno==311);
136234 /* (312) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=312);
136235 /* (313) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=313);
136236 /* (314) nmnum ::= ON */ yytestcase(yyruleno==314);
136237 /* (315) nmnum ::= DELETE */ yytestcase(yyruleno==315);
136238 /* (316) nmnum ::= DEFAULT */ yytestcase(yyruleno==316);
136239 /* (317) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==317);
136240 /* (318) foreach_clause ::= */ yytestcase(yyruleno==318);
136241 /* (319) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==319);
136242 /* (320) trnm ::= nm */ yytestcase(yyruleno==320);
136243 /* (321) tridxby ::= */ yytestcase(yyruleno==321);
136244 /* (322) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==322);
136245 /* (323) database_kw_opt ::= */ yytestcase(yyruleno==323);
136246 /* (324) kwcolumn_opt ::= */ yytestcase(yyruleno==324);
136247 /* (325) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==325);
136248 /* (326) vtabarglist ::= vtabarg */ yytestcase(yyruleno==326);
136249 /* (327) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==327);
136250 /* (328) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==328);
136251 /* (329) anylist ::= */ yytestcase(yyruleno==329);
136252 /* (330) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==330);
136253 /* (331) anylist ::= anylist ANY */ yytestcase(yyruleno==331);
136254 break;
136255 /********** End reduce actions ************************************************/
136256 };
136257 assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
136258 yygoto = yyRuleInfo[yyruleno].lhs;
@@ -136449,11 +136439,11 @@
136439 }
136440 #endif
136441 yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
136442 yymajor = YYNOCODE;
136443 }else{
136444 while( yypParser->yytos >= yypParser->yystack
136445 && yymx != YYERRORSYMBOL
136446 && (yyact = yy_find_reduce_action(
136447 yypParser->yytos->stateno,
136448 YYERRORSYMBOL)) >= YY_MIN_REDUCE
136449 ){
@@ -181140,11 +181130,11 @@
181130 }
181131 #endif
181132 fts5yy_destructor(fts5yypParser, (fts5YYCODETYPE)fts5yymajor, &fts5yyminorunion);
181133 fts5yymajor = fts5YYNOCODE;
181134 }else{
181135 while( fts5yypParser->fts5yytos >= fts5yypParser->fts5yystack
181136 && fts5yymx != fts5YYERRORSYMBOL
181137 && (fts5yyact = fts5yy_find_reduce_action(
181138 fts5yypParser->fts5yytos->stateno,
181139 fts5YYERRORSYMBOL)) >= fts5YY_MIN_REDUCE
181140 ){
@@ -195597,11 +195587,11 @@
195587 int nArg, /* Number of args */
195588 sqlite3_value **apUnused /* Function arguments */
195589 ){
195590 assert( nArg==0 );
195591 UNUSED_PARAM2(nArg, apUnused);
195592 sqlite3_result_text(pCtx, "fts5: 2016-10-04 00:47:26 b10d0f939c82c4de3faa90b86de9ec4a89992856", -1, SQLITE_TRANSIENT);
195593 }
195594
195595 static int fts5Init(sqlite3 *db){
195596 static const sqlite3_module fts5Mod = {
195597 /* iVersion */ 2,
195598
+5 -5
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,11 +121,11 @@
121121
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
122122
** [sqlite_version()] and [sqlite_source_id()].
123123
*/
124124
#define SQLITE_VERSION "3.15.0"
125125
#define SQLITE_VERSION_NUMBER 3015000
126
-#define SQLITE_SOURCE_ID "2016-09-22 18:53:13 c3774c6a5fe48af91fda28e9e18c6ed9053ea992"
126
+#define SQLITE_SOURCE_ID "2016-10-04 12:20:12 3a9d802fda10585654332b314d317250dc5d894e"
127127
128128
/*
129129
** CAPI3REF: Run-Time Library Version Numbers
130130
** KEYWORDS: sqlite3_version, sqlite3_sourceid
131131
**
@@ -8655,11 +8655,11 @@
86558655
86568656
/*
86578657
** CAPI3REF: Set a table filter on a Session Object.
86588658
**
86598659
** The second argument (xFilter) is the "filter callback". For changes to rows
8660
-** in tables that are not attached to the Session oject, the filter is called
8660
+** in tables that are not attached to the Session object, the filter is called
86618661
** to determine whether changes to the table's rows should be tracked or not.
86628662
** If xFilter returns 0, changes is not tracked. Note that once a table is
86638663
** attached, xFilter will not be called again.
86648664
*/
86658665
void sqlite3session_table_filter(
@@ -8921,11 +8921,11 @@
89218921
** Assuming the changeset blob was created by one of the
89228922
** [sqlite3session_changeset()], [sqlite3changeset_concat()] or
89238923
** [sqlite3changeset_invert()] functions, all changes within the changeset
89248924
** that apply to a single table are grouped together. This means that when
89258925
** an application iterates through a changeset using an iterator created by
8926
-** this function, all changes that relate to a single table are visted
8926
+** this function, all changes that relate to a single table are visited
89278927
** consecutively. There is no chance that the iterator will visit a change
89288928
** the applies to table X, then one for table Y, and then later on visit
89298929
** another change for table X.
89308930
*/
89318931
int sqlite3changeset_start(
@@ -9008,11 +9008,11 @@
90089008
** If successful, *pabPK is set to point to an array of nCol entries, where
90099009
** nCol is the number of columns in the table. Elements of *pabPK are set to
90109010
** 0x01 if the corresponding column is part of the tables primary key, or
90119011
** 0x00 if it is not.
90129012
**
9013
-** If argumet pnCol is not NULL, then *pnCol is set to the number of columns
9013
+** If argument pnCol is not NULL, then *pnCol is set to the number of columns
90149014
** in the table.
90159015
**
90169016
** If this function is called when the iterator does not point to a valid
90179017
** entry, SQLITE_MISUSE is returned and the output variables zeroed. Otherwise,
90189018
** SQLITE_OK is returned and the output variables populated as described
@@ -9283,11 +9283,11 @@
92839283
** Rows within the changeset and changegroup are identified by the values in
92849284
** their PRIMARY KEY columns. A change in the changeset is considered to
92859285
** apply to the same row as a change already present in the changegroup if
92869286
** the two rows have the same primary key.
92879287
**
9288
-** Changes to rows that that do not already appear in the changegroup are
9288
+** Changes to rows that do not already appear in the changegroup are
92899289
** simply copied into it. Or, if both the new changeset and the changegroup
92909290
** contain changes that apply to a single row, the final contents of the
92919291
** changegroup depends on the type of each change, as follows:
92929292
**
92939293
** <table border=1 style="margin-left:8ex;margin-right:8ex">
92949294
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,11 +121,11 @@
121 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
122 ** [sqlite_version()] and [sqlite_source_id()].
123 */
124 #define SQLITE_VERSION "3.15.0"
125 #define SQLITE_VERSION_NUMBER 3015000
126 #define SQLITE_SOURCE_ID "2016-09-22 18:53:13 c3774c6a5fe48af91fda28e9e18c6ed9053ea992"
127
128 /*
129 ** CAPI3REF: Run-Time Library Version Numbers
130 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
131 **
@@ -8655,11 +8655,11 @@
8655
8656 /*
8657 ** CAPI3REF: Set a table filter on a Session Object.
8658 **
8659 ** The second argument (xFilter) is the "filter callback". For changes to rows
8660 ** in tables that are not attached to the Session oject, the filter is called
8661 ** to determine whether changes to the table's rows should be tracked or not.
8662 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8663 ** attached, xFilter will not be called again.
8664 */
8665 void sqlite3session_table_filter(
@@ -8921,11 +8921,11 @@
8921 ** Assuming the changeset blob was created by one of the
8922 ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or
8923 ** [sqlite3changeset_invert()] functions, all changes within the changeset
8924 ** that apply to a single table are grouped together. This means that when
8925 ** an application iterates through a changeset using an iterator created by
8926 ** this function, all changes that relate to a single table are visted
8927 ** consecutively. There is no chance that the iterator will visit a change
8928 ** the applies to table X, then one for table Y, and then later on visit
8929 ** another change for table X.
8930 */
8931 int sqlite3changeset_start(
@@ -9008,11 +9008,11 @@
9008 ** If successful, *pabPK is set to point to an array of nCol entries, where
9009 ** nCol is the number of columns in the table. Elements of *pabPK are set to
9010 ** 0x01 if the corresponding column is part of the tables primary key, or
9011 ** 0x00 if it is not.
9012 **
9013 ** If argumet pnCol is not NULL, then *pnCol is set to the number of columns
9014 ** in the table.
9015 **
9016 ** If this function is called when the iterator does not point to a valid
9017 ** entry, SQLITE_MISUSE is returned and the output variables zeroed. Otherwise,
9018 ** SQLITE_OK is returned and the output variables populated as described
@@ -9283,11 +9283,11 @@
9283 ** Rows within the changeset and changegroup are identified by the values in
9284 ** their PRIMARY KEY columns. A change in the changeset is considered to
9285 ** apply to the same row as a change already present in the changegroup if
9286 ** the two rows have the same primary key.
9287 **
9288 ** Changes to rows that that do not already appear in the changegroup are
9289 ** simply copied into it. Or, if both the new changeset and the changegroup
9290 ** contain changes that apply to a single row, the final contents of the
9291 ** changegroup depends on the type of each change, as follows:
9292 **
9293 ** <table border=1 style="margin-left:8ex;margin-right:8ex">
9294
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,11 +121,11 @@
121 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
122 ** [sqlite_version()] and [sqlite_source_id()].
123 */
124 #define SQLITE_VERSION "3.15.0"
125 #define SQLITE_VERSION_NUMBER 3015000
126 #define SQLITE_SOURCE_ID "2016-10-04 12:20:12 3a9d802fda10585654332b314d317250dc5d894e"
127
128 /*
129 ** CAPI3REF: Run-Time Library Version Numbers
130 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
131 **
@@ -8655,11 +8655,11 @@
8655
8656 /*
8657 ** CAPI3REF: Set a table filter on a Session Object.
8658 **
8659 ** The second argument (xFilter) is the "filter callback". For changes to rows
8660 ** in tables that are not attached to the Session object, the filter is called
8661 ** to determine whether changes to the table's rows should be tracked or not.
8662 ** If xFilter returns 0, changes is not tracked. Note that once a table is
8663 ** attached, xFilter will not be called again.
8664 */
8665 void sqlite3session_table_filter(
@@ -8921,11 +8921,11 @@
8921 ** Assuming the changeset blob was created by one of the
8922 ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or
8923 ** [sqlite3changeset_invert()] functions, all changes within the changeset
8924 ** that apply to a single table are grouped together. This means that when
8925 ** an application iterates through a changeset using an iterator created by
8926 ** this function, all changes that relate to a single table are visited
8927 ** consecutively. There is no chance that the iterator will visit a change
8928 ** the applies to table X, then one for table Y, and then later on visit
8929 ** another change for table X.
8930 */
8931 int sqlite3changeset_start(
@@ -9008,11 +9008,11 @@
9008 ** If successful, *pabPK is set to point to an array of nCol entries, where
9009 ** nCol is the number of columns in the table. Elements of *pabPK are set to
9010 ** 0x01 if the corresponding column is part of the tables primary key, or
9011 ** 0x00 if it is not.
9012 **
9013 ** If argument pnCol is not NULL, then *pnCol is set to the number of columns
9014 ** in the table.
9015 **
9016 ** If this function is called when the iterator does not point to a valid
9017 ** entry, SQLITE_MISUSE is returned and the output variables zeroed. Otherwise,
9018 ** SQLITE_OK is returned and the output variables populated as described
@@ -9283,11 +9283,11 @@
9283 ** Rows within the changeset and changegroup are identified by the values in
9284 ** their PRIMARY KEY columns. A change in the changeset is considered to
9285 ** apply to the same row as a change already present in the changegroup if
9286 ** the two rows have the same primary key.
9287 **
9288 ** Changes to rows that do not already appear in the changegroup are
9289 ** simply copied into it. Or, if both the new changeset and the changegroup
9290 ** contain changes that apply to a single row, the final contents of the
9291 ** changegroup depends on the type of each change, as follows:
9292 **
9293 ** <table border=1 style="margin-left:8ex;margin-right:8ex">
9294
+4 -7
--- src/stat.c
+++ src/stat.c
@@ -422,19 +422,18 @@
422422
style_submenu_element("Stat", "Repository Stats", "stat");
423423
if( g.perm.Admin ){
424424
style_submenu_element("Schema", "Repository Schema", "repo_schema");
425425
}
426426
db_multi_exec(
427
- "CREATE VIRTUAL TABLE temp.dbx USING dbstat(repository);"
428427
"CREATE TEMP TABLE trans(name TEXT PRIMARY KEY,tabname TEXT)WITHOUT ROWID;"
429428
"INSERT INTO trans(name,tabname)"
430429
" SELECT name, tbl_name FROM repository.sqlite_master;"
431430
"CREATE TEMP TABLE piechart(amt REAL, label TEXT);"
432431
"INSERT INTO piechart(amt,label)"
433432
" SELECT count(*), "
434
- " coalesce((SELECT tabname FROM trans WHERE trans.name=dbx.name),name)"
435
- " FROM dbx"
433
+ " coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)"
434
+ " FROM dbstat('repository')"
436435
" GROUP BY 2 ORDER BY 2;"
437436
);
438437
nPageFree = db_int(0, "PRAGMA repository.freelist_count");
439438
if( nPageFree>0 ){
440439
db_multi_exec(
@@ -449,20 +448,18 @@
449448
piechart_render(800,500,PIE_OTHER|PIE_PERCENT);
450449
@ </svg></center>
451450
452451
if( g.localOpen ){
453452
db_multi_exec(
454
- "DROP TABLE temp.dbx;"
455
- "CREATE VIRTUAL TABLE temp.dbx USING dbstat(localdb);"
456453
"DELETE FROM trans;"
457454
"INSERT INTO trans(name,tabname)"
458455
" SELECT name, tbl_name FROM localdb.sqlite_master;"
459456
"DELETE FROM piechart;"
460457
"INSERT INTO piechart(amt,label)"
461458
" SELECT count(*), "
462
- " coalesce((SELECT tabname FROM trans WHERE trans.name=dbx.name),name)"
463
- " FROM dbx"
459
+ " coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)"
460
+ " FROM dbstat('localdb')"
464461
" GROUP BY 2 ORDER BY 2;"
465462
);
466463
nPageFree = db_int(0, "PRAGMA localdb.freelist_count");
467464
if( nPageFree>0 ){
468465
db_multi_exec(
469466
--- src/stat.c
+++ src/stat.c
@@ -422,19 +422,18 @@
422 style_submenu_element("Stat", "Repository Stats", "stat");
423 if( g.perm.Admin ){
424 style_submenu_element("Schema", "Repository Schema", "repo_schema");
425 }
426 db_multi_exec(
427 "CREATE VIRTUAL TABLE temp.dbx USING dbstat(repository);"
428 "CREATE TEMP TABLE trans(name TEXT PRIMARY KEY,tabname TEXT)WITHOUT ROWID;"
429 "INSERT INTO trans(name,tabname)"
430 " SELECT name, tbl_name FROM repository.sqlite_master;"
431 "CREATE TEMP TABLE piechart(amt REAL, label TEXT);"
432 "INSERT INTO piechart(amt,label)"
433 " SELECT count(*), "
434 " coalesce((SELECT tabname FROM trans WHERE trans.name=dbx.name),name)"
435 " FROM dbx"
436 " GROUP BY 2 ORDER BY 2;"
437 );
438 nPageFree = db_int(0, "PRAGMA repository.freelist_count");
439 if( nPageFree>0 ){
440 db_multi_exec(
@@ -449,20 +448,18 @@
449 piechart_render(800,500,PIE_OTHER|PIE_PERCENT);
450 @ </svg></center>
451
452 if( g.localOpen ){
453 db_multi_exec(
454 "DROP TABLE temp.dbx;"
455 "CREATE VIRTUAL TABLE temp.dbx USING dbstat(localdb);"
456 "DELETE FROM trans;"
457 "INSERT INTO trans(name,tabname)"
458 " SELECT name, tbl_name FROM localdb.sqlite_master;"
459 "DELETE FROM piechart;"
460 "INSERT INTO piechart(amt,label)"
461 " SELECT count(*), "
462 " coalesce((SELECT tabname FROM trans WHERE trans.name=dbx.name),name)"
463 " FROM dbx"
464 " GROUP BY 2 ORDER BY 2;"
465 );
466 nPageFree = db_int(0, "PRAGMA localdb.freelist_count");
467 if( nPageFree>0 ){
468 db_multi_exec(
469
--- src/stat.c
+++ src/stat.c
@@ -422,19 +422,18 @@
422 style_submenu_element("Stat", "Repository Stats", "stat");
423 if( g.perm.Admin ){
424 style_submenu_element("Schema", "Repository Schema", "repo_schema");
425 }
426 db_multi_exec(
 
427 "CREATE TEMP TABLE trans(name TEXT PRIMARY KEY,tabname TEXT)WITHOUT ROWID;"
428 "INSERT INTO trans(name,tabname)"
429 " SELECT name, tbl_name FROM repository.sqlite_master;"
430 "CREATE TEMP TABLE piechart(amt REAL, label TEXT);"
431 "INSERT INTO piechart(amt,label)"
432 " SELECT count(*), "
433 " coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)"
434 " FROM dbstat('repository')"
435 " GROUP BY 2 ORDER BY 2;"
436 );
437 nPageFree = db_int(0, "PRAGMA repository.freelist_count");
438 if( nPageFree>0 ){
439 db_multi_exec(
@@ -449,20 +448,18 @@
448 piechart_render(800,500,PIE_OTHER|PIE_PERCENT);
449 @ </svg></center>
450
451 if( g.localOpen ){
452 db_multi_exec(
 
 
453 "DELETE FROM trans;"
454 "INSERT INTO trans(name,tabname)"
455 " SELECT name, tbl_name FROM localdb.sqlite_master;"
456 "DELETE FROM piechart;"
457 "INSERT INTO piechart(amt,label)"
458 " SELECT count(*), "
459 " coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)"
460 " FROM dbstat('localdb')"
461 " GROUP BY 2 ORDER BY 2;"
462 );
463 nPageFree = db_int(0, "PRAGMA localdb.freelist_count");
464 if( nPageFree>0 ){
465 db_multi_exec(
466
+1
--- src/tag.c
+++ src/tag.c
@@ -359,10 +359,11 @@
359359
}else{
360360
nrid = content_put(&ctrl);
361361
manifest_crosslink(nrid, &ctrl, MC_PERMIT_HOOKS);
362362
}
363363
assert( blob_is_reset(&ctrl) );
364
+ manifest_to_disk(rid);
364365
}
365366
366367
/*
367368
** COMMAND: tag
368369
**
369370
--- src/tag.c
+++ src/tag.c
@@ -359,10 +359,11 @@
359 }else{
360 nrid = content_put(&ctrl);
361 manifest_crosslink(nrid, &ctrl, MC_PERMIT_HOOKS);
362 }
363 assert( blob_is_reset(&ctrl) );
 
364 }
365
366 /*
367 ** COMMAND: tag
368 **
369
--- src/tag.c
+++ src/tag.c
@@ -359,10 +359,11 @@
359 }else{
360 nrid = content_put(&ctrl);
361 manifest_crosslink(nrid, &ctrl, MC_PERMIT_HOOKS);
362 }
363 assert( blob_is_reset(&ctrl) );
364 manifest_to_disk(rid);
365 }
366
367 /*
368 ** COMMAND: tag
369 **
370
+52 -16
--- src/tar.c
+++ src/tar.c
@@ -475,11 +475,11 @@
475475
Blob mfile, hash, file;
476476
Manifest *pManifest;
477477
ManifestFile *pFile;
478478
Blob filename;
479479
int nPrefix;
480
- char *zName;
480
+ char *zName = 0;
481481
unsigned int mTime;
482482
483483
content_get(rid, &mfile);
484484
if( blob_size(&mfile)==0 ){
485485
blob_zero(pTar);
@@ -493,28 +493,64 @@
493493
}
494494
nPrefix = blob_size(&filename);
495495
496496
pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
497497
if( pManifest ){
498
+ int flg, eflg = 0;
498499
mTime = (pManifest->rDate - 2440587.5)*86400.0;
499500
tar_begin(mTime);
500
- if( (pInclude==0 || glob_match(pInclude, "manifest"))
501
- && !glob_match(pExclude, "manifest")
502
- && db_get_boolean("manifest", 0)
503
- ){
504
- blob_append(&filename, "manifest", -1);
505
- zName = blob_str(&filename);
506
- sha1sum_blob(&mfile, &hash);
507
- sterilize_manifest(&mfile);
508
- tar_add_file(zName, &mfile, 0, mTime);
501
+ flg = db_get_manifest_setting();
502
+ if( flg ){
503
+ /* eflg is the effective flags, taking include/exclude into account */
504
+ if( (pInclude==0 || glob_match(pInclude, "manifest"))
505
+ && !glob_match(pExclude, "manifest")
506
+ && (flg & MFESTFLG_RAW) ){
507
+ eflg |= MFESTFLG_RAW;
508
+ }
509
+ if( (pInclude==0 || glob_match(pInclude, "manifest.uuid"))
510
+ && !glob_match(pExclude, "manifest.uuid")
511
+ && (flg & MFESTFLG_UUID) ){
512
+ eflg |= MFESTFLG_UUID;
513
+ }
514
+ if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
515
+ && !glob_match(pExclude, "manifest.tags")
516
+ && (flg & MFESTFLG_TAGS) ){
517
+ eflg |= MFESTFLG_TAGS;
518
+ }
519
+
520
+ if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
521
+ if( eflg & MFESTFLG_RAW ){
522
+ blob_append(&filename, "manifest", -1);
523
+ zName = blob_str(&filename);
524
+ }
525
+ if( eflg & MFESTFLG_UUID ){
526
+ sha1sum_blob(&mfile, &hash);
527
+ }
528
+ if( eflg & MFESTFLG_RAW ) {
529
+ sterilize_manifest(&mfile);
530
+ tar_add_file(zName, &mfile, 0, mTime);
531
+ }
532
+ }
509533
blob_reset(&mfile);
510
- blob_append(&hash, "\n", 1);
511
- blob_resize(&filename, nPrefix);
512
- blob_append(&filename, "manifest.uuid", -1);
513
- zName = blob_str(&filename);
514
- tar_add_file(zName, &hash, 0, mTime);
515
- blob_reset(&hash);
534
+ if( eflg & MFESTFLG_UUID ){
535
+ blob_append(&hash, "\n", 1);
536
+ blob_resize(&filename, nPrefix);
537
+ blob_append(&filename, "manifest.uuid", -1);
538
+ zName = blob_str(&filename);
539
+ tar_add_file(zName, &hash, 0, mTime);
540
+ blob_reset(&hash);
541
+ }
542
+ if( eflg & MFESTFLG_TAGS ){
543
+ Blob tagslist;
544
+ blob_zero(&tagslist);
545
+ get_checkin_taglist(rid, &tagslist);
546
+ blob_resize(&filename, nPrefix);
547
+ blob_append(&filename, "manifest.tags", -1);
548
+ zName = blob_str(&filename);
549
+ tar_add_file(zName, &tagslist, 0, mTime);
550
+ blob_reset(&tagslist);
551
+ }
516552
}
517553
manifest_file_rewind(pManifest);
518554
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
519555
int fid;
520556
if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
521557
--- src/tar.c
+++ src/tar.c
@@ -475,11 +475,11 @@
475 Blob mfile, hash, file;
476 Manifest *pManifest;
477 ManifestFile *pFile;
478 Blob filename;
479 int nPrefix;
480 char *zName;
481 unsigned int mTime;
482
483 content_get(rid, &mfile);
484 if( blob_size(&mfile)==0 ){
485 blob_zero(pTar);
@@ -493,28 +493,64 @@
493 }
494 nPrefix = blob_size(&filename);
495
496 pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
497 if( pManifest ){
 
498 mTime = (pManifest->rDate - 2440587.5)*86400.0;
499 tar_begin(mTime);
500 if( (pInclude==0 || glob_match(pInclude, "manifest"))
501 && !glob_match(pExclude, "manifest")
502 && db_get_boolean("manifest", 0)
503 ){
504 blob_append(&filename, "manifest", -1);
505 zName = blob_str(&filename);
506 sha1sum_blob(&mfile, &hash);
507 sterilize_manifest(&mfile);
508 tar_add_file(zName, &mfile, 0, mTime);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509 blob_reset(&mfile);
510 blob_append(&hash, "\n", 1);
511 blob_resize(&filename, nPrefix);
512 blob_append(&filename, "manifest.uuid", -1);
513 zName = blob_str(&filename);
514 tar_add_file(zName, &hash, 0, mTime);
515 blob_reset(&hash);
 
 
 
 
 
 
 
 
 
 
 
 
516 }
517 manifest_file_rewind(pManifest);
518 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
519 int fid;
520 if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
521
--- src/tar.c
+++ src/tar.c
@@ -475,11 +475,11 @@
475 Blob mfile, hash, file;
476 Manifest *pManifest;
477 ManifestFile *pFile;
478 Blob filename;
479 int nPrefix;
480 char *zName = 0;
481 unsigned int mTime;
482
483 content_get(rid, &mfile);
484 if( blob_size(&mfile)==0 ){
485 blob_zero(pTar);
@@ -493,28 +493,64 @@
493 }
494 nPrefix = blob_size(&filename);
495
496 pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
497 if( pManifest ){
498 int flg, eflg = 0;
499 mTime = (pManifest->rDate - 2440587.5)*86400.0;
500 tar_begin(mTime);
501 flg = db_get_manifest_setting();
502 if( flg ){
503 /* eflg is the effective flags, taking include/exclude into account */
504 if( (pInclude==0 || glob_match(pInclude, "manifest"))
505 && !glob_match(pExclude, "manifest")
506 && (flg & MFESTFLG_RAW) ){
507 eflg |= MFESTFLG_RAW;
508 }
509 if( (pInclude==0 || glob_match(pInclude, "manifest.uuid"))
510 && !glob_match(pExclude, "manifest.uuid")
511 && (flg & MFESTFLG_UUID) ){
512 eflg |= MFESTFLG_UUID;
513 }
514 if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
515 && !glob_match(pExclude, "manifest.tags")
516 && (flg & MFESTFLG_TAGS) ){
517 eflg |= MFESTFLG_TAGS;
518 }
519
520 if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
521 if( eflg & MFESTFLG_RAW ){
522 blob_append(&filename, "manifest", -1);
523 zName = blob_str(&filename);
524 }
525 if( eflg & MFESTFLG_UUID ){
526 sha1sum_blob(&mfile, &hash);
527 }
528 if( eflg & MFESTFLG_RAW ) {
529 sterilize_manifest(&mfile);
530 tar_add_file(zName, &mfile, 0, mTime);
531 }
532 }
533 blob_reset(&mfile);
534 if( eflg & MFESTFLG_UUID ){
535 blob_append(&hash, "\n", 1);
536 blob_resize(&filename, nPrefix);
537 blob_append(&filename, "manifest.uuid", -1);
538 zName = blob_str(&filename);
539 tar_add_file(zName, &hash, 0, mTime);
540 blob_reset(&hash);
541 }
542 if( eflg & MFESTFLG_TAGS ){
543 Blob tagslist;
544 blob_zero(&tagslist);
545 get_checkin_taglist(rid, &tagslist);
546 blob_resize(&filename, nPrefix);
547 blob_append(&filename, "manifest.tags", -1);
548 zName = blob_str(&filename);
549 tar_add_file(zName, &tagslist, 0, mTime);
550 blob_reset(&tagslist);
551 }
552 }
553 manifest_file_rewind(pManifest);
554 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
555 int fid;
556 if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
557
+34 -16
--- src/timeline.c
+++ src/timeline.c
@@ -26,10 +26,19 @@
2626
/*
2727
** The value of one second in julianday notation
2828
*/
2929
#define ONE_SECOND (1.0/86400.0)
3030
31
+/*
32
+** timeline mode options
33
+*/
34
+#define TIMELINE_MODE_NONE 0
35
+#define TIMELINE_MODE_BEFORE 1
36
+#define TIMELINE_MODE_AFTER 2
37
+#define TIMELINE_MODE_CHILDREN 3
38
+#define TIMELINE_MODE_PARENTS 4
39
+
3140
/*
3241
** Add an appropriate tag to the output if "rid" is unpublished (private)
3342
*/
3443
#define UNPUB_TAG "<em>(unpublished)</em>"
3544
void tag_private_status(int rid){
@@ -2029,10 +2038,17 @@
20292038
&& z[4]=='-'
20302039
&& z[7]=='-'
20312040
&& fossil_isdigit(z[0])
20322041
&& fossil_isdigit(z[5]);
20332042
}
2043
+
2044
+/*
2045
+** Return true if the input string can be converted to a julianday.
2046
+*/
2047
+static int fossil_is_julianday(const char *zDate){
2048
+ return db_int(0, "SELECT EXISTS (SELECT julianday(%Q) AS jd WHERE jd IS NOT NULL)", zDate);
2049
+}
20342050
20352051
/*
20362052
** COMMAND: timeline
20372053
**
20382054
** Usage: %fossil timeline ?WHEN? ?CHECKIN|DATETIME? ?OPTIONS?
@@ -2087,11 +2103,11 @@
20872103
char *zOrigin;
20882104
char *zDate;
20892105
Blob sql;
20902106
int objid = 0;
20912107
Blob uuid;
2092
- int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
2108
+ int mode = TIMELINE_MODE_NONE;
20932109
int verboseFlag = 0 ;
20942110
int iOffset;
20952111
const char *zFilePattern = 0;
20962112
Blob treeName;
20972113
@@ -2128,21 +2144,21 @@
21282144
verify_all_options();
21292145
21302146
if( g.argc>=4 ){
21312147
k = strlen(g.argv[2]);
21322148
if( strncmp(g.argv[2],"before",k)==0 ){
2133
- mode = 1;
2149
+ mode = TIMELINE_MODE_BEFORE;
21342150
}else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){
2135
- mode = 2;
2151
+ mode = TIMELINE_MODE_AFTER;
21362152
}else if( strncmp(g.argv[2],"descendants",k)==0 ){
2137
- mode = 3;
2153
+ mode = TIMELINE_MODE_CHILDREN;
21382154
}else if( strncmp(g.argv[2],"children",k)==0 ){
2139
- mode = 3;
2155
+ mode = TIMELINE_MODE_CHILDREN;
21402156
}else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){
2141
- mode = 4;
2157
+ mode = TIMELINE_MODE_PARENTS;
21422158
}else if( strncmp(g.argv[2],"parents",k)==0 ){
2143
- mode = 4;
2159
+ mode = TIMELINE_MODE_PARENTS;
21442160
}else if(!zType && !zLimit){
21452161
usage("?WHEN? ?CHECKIN|DATETIME? ?-n|--limit #? ?-t|--type TYPE? "
21462162
"?-W|--width WIDTH? ?-p|--path PATH");
21472163
}
21482164
if( '-' != *g.argv[3] ){
@@ -2157,11 +2173,11 @@
21572173
}
21582174
k = strlen(zOrigin);
21592175
blob_zero(&uuid);
21602176
blob_append(&uuid, zOrigin, -1);
21612177
if( fossil_strcmp(zOrigin, "now")==0 ){
2162
- if( mode==3 || mode==4 ){
2178
+ if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
21632179
fossil_fatal("cannot compute descendants or ancestors of a date");
21642180
}
21652181
zDate = mprintf("(SELECT datetime('now'))");
21662182
}else if( strncmp(zOrigin, "current", k)==0 ){
21672183
if( !g.localOpen ){
@@ -2170,19 +2186,21 @@
21702186
objid = db_lget_int("checkout",0);
21712187
zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid);
21722188
}else if( name_to_uuid(&uuid, 0, "*")==0 ){
21732189
objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid);
21742190
zDate = mprintf("(SELECT mtime FROM event WHERE objid=%d)", objid);
2175
- }else{
2191
+ }else if( fossil_is_julianday(zOrigin) ){
21762192
const char *zShift = "";
2177
- if( mode==3 || mode==4 ){
2193
+ if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
21782194
fossil_fatal("cannot compute descendants or ancestors of a date");
21792195
}
2180
- if( mode==0 ){
2196
+ if( mode==TIMELINE_MODE_NONE ){
21812197
if( isIsoDate(zOrigin) ) zShift = ",'+1 day'";
21822198
}
21832199
zDate = mprintf("(SELECT julianday(%Q%s, fromLocal()))", zOrigin, zShift);
2200
+ }else{
2201
+ fossil_fatal("unknown check-in or invalid date: %s", zOrigin);
21842202
}
21852203
21862204
if( zFilePattern ){
21872205
if( zType==0 ){
21882206
/* When zFilePattern is specified and type is not specified, only show
@@ -2195,21 +2213,21 @@
21952213
* zFilePattern. */
21962214
zFilePattern = 0;
21972215
}
21982216
}
21992217
2200
- if( mode==0 ) mode = 1;
2218
+ if( mode==TIMELINE_MODE_NONE ) mode = TIMELINE_MODE_BEFORE;
22012219
blob_zero(&sql);
22022220
blob_append(&sql, timeline_query_for_tty(), -1);
22032221
blob_append_sql(&sql, "\n AND event.mtime %s %s",
2204
- (mode==1 || mode==4) ? "<=" : ">=",
2205
- zDate /*safe-for-%s*/
2222
+ ( mode==TIMELINE_MODE_BEFORE ||
2223
+ mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
22062224
);
22072225
2208
- if( mode==3 || mode==4 ){
2226
+ if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
22092227
db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
2210
- if( mode==3 ){
2228
+ if( mode==TIMELINE_MODE_CHILDREN ){
22112229
compute_descendants(objid, n);
22122230
}else{
22132231
compute_ancestors(objid, n, 0);
22142232
}
22152233
blob_append_sql(&sql, "\n AND blob.rid IN ok");
22162234
--- src/timeline.c
+++ src/timeline.c
@@ -26,10 +26,19 @@
26 /*
27 ** The value of one second in julianday notation
28 */
29 #define ONE_SECOND (1.0/86400.0)
30
 
 
 
 
 
 
 
 
 
31 /*
32 ** Add an appropriate tag to the output if "rid" is unpublished (private)
33 */
34 #define UNPUB_TAG "<em>(unpublished)</em>"
35 void tag_private_status(int rid){
@@ -2029,10 +2038,17 @@
2029 && z[4]=='-'
2030 && z[7]=='-'
2031 && fossil_isdigit(z[0])
2032 && fossil_isdigit(z[5]);
2033 }
 
 
 
 
 
 
 
2034
2035 /*
2036 ** COMMAND: timeline
2037 **
2038 ** Usage: %fossil timeline ?WHEN? ?CHECKIN|DATETIME? ?OPTIONS?
@@ -2087,11 +2103,11 @@
2087 char *zOrigin;
2088 char *zDate;
2089 Blob sql;
2090 int objid = 0;
2091 Blob uuid;
2092 int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
2093 int verboseFlag = 0 ;
2094 int iOffset;
2095 const char *zFilePattern = 0;
2096 Blob treeName;
2097
@@ -2128,21 +2144,21 @@
2128 verify_all_options();
2129
2130 if( g.argc>=4 ){
2131 k = strlen(g.argv[2]);
2132 if( strncmp(g.argv[2],"before",k)==0 ){
2133 mode = 1;
2134 }else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){
2135 mode = 2;
2136 }else if( strncmp(g.argv[2],"descendants",k)==0 ){
2137 mode = 3;
2138 }else if( strncmp(g.argv[2],"children",k)==0 ){
2139 mode = 3;
2140 }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){
2141 mode = 4;
2142 }else if( strncmp(g.argv[2],"parents",k)==0 ){
2143 mode = 4;
2144 }else if(!zType && !zLimit){
2145 usage("?WHEN? ?CHECKIN|DATETIME? ?-n|--limit #? ?-t|--type TYPE? "
2146 "?-W|--width WIDTH? ?-p|--path PATH");
2147 }
2148 if( '-' != *g.argv[3] ){
@@ -2157,11 +2173,11 @@
2157 }
2158 k = strlen(zOrigin);
2159 blob_zero(&uuid);
2160 blob_append(&uuid, zOrigin, -1);
2161 if( fossil_strcmp(zOrigin, "now")==0 ){
2162 if( mode==3 || mode==4 ){
2163 fossil_fatal("cannot compute descendants or ancestors of a date");
2164 }
2165 zDate = mprintf("(SELECT datetime('now'))");
2166 }else if( strncmp(zOrigin, "current", k)==0 ){
2167 if( !g.localOpen ){
@@ -2170,19 +2186,21 @@
2170 objid = db_lget_int("checkout",0);
2171 zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid);
2172 }else if( name_to_uuid(&uuid, 0, "*")==0 ){
2173 objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid);
2174 zDate = mprintf("(SELECT mtime FROM event WHERE objid=%d)", objid);
2175 }else{
2176 const char *zShift = "";
2177 if( mode==3 || mode==4 ){
2178 fossil_fatal("cannot compute descendants or ancestors of a date");
2179 }
2180 if( mode==0 ){
2181 if( isIsoDate(zOrigin) ) zShift = ",'+1 day'";
2182 }
2183 zDate = mprintf("(SELECT julianday(%Q%s, fromLocal()))", zOrigin, zShift);
 
 
2184 }
2185
2186 if( zFilePattern ){
2187 if( zType==0 ){
2188 /* When zFilePattern is specified and type is not specified, only show
@@ -2195,21 +2213,21 @@
2195 * zFilePattern. */
2196 zFilePattern = 0;
2197 }
2198 }
2199
2200 if( mode==0 ) mode = 1;
2201 blob_zero(&sql);
2202 blob_append(&sql, timeline_query_for_tty(), -1);
2203 blob_append_sql(&sql, "\n AND event.mtime %s %s",
2204 (mode==1 || mode==4) ? "<=" : ">=",
2205 zDate /*safe-for-%s*/
2206 );
2207
2208 if( mode==3 || mode==4 ){
2209 db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
2210 if( mode==3 ){
2211 compute_descendants(objid, n);
2212 }else{
2213 compute_ancestors(objid, n, 0);
2214 }
2215 blob_append_sql(&sql, "\n AND blob.rid IN ok");
2216
--- src/timeline.c
+++ src/timeline.c
@@ -26,10 +26,19 @@
26 /*
27 ** The value of one second in julianday notation
28 */
29 #define ONE_SECOND (1.0/86400.0)
30
31 /*
32 ** timeline mode options
33 */
34 #define TIMELINE_MODE_NONE 0
35 #define TIMELINE_MODE_BEFORE 1
36 #define TIMELINE_MODE_AFTER 2
37 #define TIMELINE_MODE_CHILDREN 3
38 #define TIMELINE_MODE_PARENTS 4
39
40 /*
41 ** Add an appropriate tag to the output if "rid" is unpublished (private)
42 */
43 #define UNPUB_TAG "<em>(unpublished)</em>"
44 void tag_private_status(int rid){
@@ -2029,10 +2038,17 @@
2038 && z[4]=='-'
2039 && z[7]=='-'
2040 && fossil_isdigit(z[0])
2041 && fossil_isdigit(z[5]);
2042 }
2043
2044 /*
2045 ** Return true if the input string can be converted to a julianday.
2046 */
2047 static int fossil_is_julianday(const char *zDate){
2048 return db_int(0, "SELECT EXISTS (SELECT julianday(%Q) AS jd WHERE jd IS NOT NULL)", zDate);
2049 }
2050
2051 /*
2052 ** COMMAND: timeline
2053 **
2054 ** Usage: %fossil timeline ?WHEN? ?CHECKIN|DATETIME? ?OPTIONS?
@@ -2087,11 +2103,11 @@
2103 char *zOrigin;
2104 char *zDate;
2105 Blob sql;
2106 int objid = 0;
2107 Blob uuid;
2108 int mode = TIMELINE_MODE_NONE;
2109 int verboseFlag = 0 ;
2110 int iOffset;
2111 const char *zFilePattern = 0;
2112 Blob treeName;
2113
@@ -2128,21 +2144,21 @@
2144 verify_all_options();
2145
2146 if( g.argc>=4 ){
2147 k = strlen(g.argv[2]);
2148 if( strncmp(g.argv[2],"before",k)==0 ){
2149 mode = TIMELINE_MODE_BEFORE;
2150 }else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){
2151 mode = TIMELINE_MODE_AFTER;
2152 }else if( strncmp(g.argv[2],"descendants",k)==0 ){
2153 mode = TIMELINE_MODE_CHILDREN;
2154 }else if( strncmp(g.argv[2],"children",k)==0 ){
2155 mode = TIMELINE_MODE_CHILDREN;
2156 }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){
2157 mode = TIMELINE_MODE_PARENTS;
2158 }else if( strncmp(g.argv[2],"parents",k)==0 ){
2159 mode = TIMELINE_MODE_PARENTS;
2160 }else if(!zType && !zLimit){
2161 usage("?WHEN? ?CHECKIN|DATETIME? ?-n|--limit #? ?-t|--type TYPE? "
2162 "?-W|--width WIDTH? ?-p|--path PATH");
2163 }
2164 if( '-' != *g.argv[3] ){
@@ -2157,11 +2173,11 @@
2173 }
2174 k = strlen(zOrigin);
2175 blob_zero(&uuid);
2176 blob_append(&uuid, zOrigin, -1);
2177 if( fossil_strcmp(zOrigin, "now")==0 ){
2178 if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
2179 fossil_fatal("cannot compute descendants or ancestors of a date");
2180 }
2181 zDate = mprintf("(SELECT datetime('now'))");
2182 }else if( strncmp(zOrigin, "current", k)==0 ){
2183 if( !g.localOpen ){
@@ -2170,19 +2186,21 @@
2186 objid = db_lget_int("checkout",0);
2187 zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid);
2188 }else if( name_to_uuid(&uuid, 0, "*")==0 ){
2189 objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid);
2190 zDate = mprintf("(SELECT mtime FROM event WHERE objid=%d)", objid);
2191 }else if( fossil_is_julianday(zOrigin) ){
2192 const char *zShift = "";
2193 if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
2194 fossil_fatal("cannot compute descendants or ancestors of a date");
2195 }
2196 if( mode==TIMELINE_MODE_NONE ){
2197 if( isIsoDate(zOrigin) ) zShift = ",'+1 day'";
2198 }
2199 zDate = mprintf("(SELECT julianday(%Q%s, fromLocal()))", zOrigin, zShift);
2200 }else{
2201 fossil_fatal("unknown check-in or invalid date: %s", zOrigin);
2202 }
2203
2204 if( zFilePattern ){
2205 if( zType==0 ){
2206 /* When zFilePattern is specified and type is not specified, only show
@@ -2195,21 +2213,21 @@
2213 * zFilePattern. */
2214 zFilePattern = 0;
2215 }
2216 }
2217
2218 if( mode==TIMELINE_MODE_NONE ) mode = TIMELINE_MODE_BEFORE;
2219 blob_zero(&sql);
2220 blob_append(&sql, timeline_query_for_tty(), -1);
2221 blob_append_sql(&sql, "\n AND event.mtime %s %s",
2222 ( mode==TIMELINE_MODE_BEFORE ||
2223 mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
2224 );
2225
2226 if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
2227 db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
2228 if( mode==TIMELINE_MODE_CHILDREN ){
2229 compute_descendants(objid, n);
2230 }else{
2231 compute_ancestors(objid, n, 0);
2232 }
2233 blob_append_sql(&sql, "\n AND blob.rid IN ok");
2234
+3 -2
--- src/undo.c
+++ src/undo.c
@@ -477,14 +477,15 @@
477477
if( undo_available==0 ){
478478
fossil_print("No undo or redo is available\n");
479479
}else{
480480
Stmt q;
481481
int nChng = 0;
482
+ const char *zArticle = undo_available==1 ? "An" : "A";
482483
zCmd = undo_available==1 ? "undo" : "redo";
483
- fossil_print("A %s is available for the following command:\n\n"
484
+ fossil_print("%s %s is available for the following command:\n\n"
484485
" %s %s\n\n",
485
- zCmd, g.argv[0], db_lget("undo_cmdline", "???"));
486
+ zArticle, zCmd, g.argv[0], db_lget("undo_cmdline", "???"));
486487
db_prepare(&q,
487488
"SELECT existsflag, pathname FROM undo ORDER BY pathname"
488489
);
489490
while( db_step(&q)==SQLITE_ROW ){
490491
if( nChng==0 ){
491492
--- src/undo.c
+++ src/undo.c
@@ -477,14 +477,15 @@
477 if( undo_available==0 ){
478 fossil_print("No undo or redo is available\n");
479 }else{
480 Stmt q;
481 int nChng = 0;
 
482 zCmd = undo_available==1 ? "undo" : "redo";
483 fossil_print("A %s is available for the following command:\n\n"
484 " %s %s\n\n",
485 zCmd, g.argv[0], db_lget("undo_cmdline", "???"));
486 db_prepare(&q,
487 "SELECT existsflag, pathname FROM undo ORDER BY pathname"
488 );
489 while( db_step(&q)==SQLITE_ROW ){
490 if( nChng==0 ){
491
--- src/undo.c
+++ src/undo.c
@@ -477,14 +477,15 @@
477 if( undo_available==0 ){
478 fossil_print("No undo or redo is available\n");
479 }else{
480 Stmt q;
481 int nChng = 0;
482 const char *zArticle = undo_available==1 ? "An" : "A";
483 zCmd = undo_available==1 ? "undo" : "redo";
484 fossil_print("%s %s is available for the following command:\n\n"
485 " %s %s\n\n",
486 zArticle, zCmd, g.argv[0], db_lget("undo_cmdline", "???"));
487 db_prepare(&q,
488 "SELECT existsflag, pathname FROM undo ORDER BY pathname"
489 );
490 while( db_step(&q)==SQLITE_ROW ){
491 if( nChng==0 ){
492
+32 -11
--- src/unversioned.c
+++ src/unversioned.c
@@ -190,13 +190,26 @@
190190
}
191191
return syncFlags;
192192
}
193193
194194
/*
195
+** Return true if the zName contains any whitespace
196
+*/
197
+static int contains_whitespace(const char *zName){
198
+ while( zName[0] ){
199
+ if( fossil_isspace(zName[0]) ) return 1;
200
+ zName++;
201
+ }
202
+ return 0;
203
+}
204
+
205
+/*
206
+** COMMAND: uv*
195207
** COMMAND: unversioned
196208
**
197209
** Usage: %fossil unversioned SUBCOMMAND ARGS...
210
+** or: %fossil uv SUBCOMMAND ARGS..
198211
**
199212
** Unversioned files (UV-files) are artifacts that are synced and are available
200213
** for download but which do not preserve history. Only the most recent version
201214
** of each UV-file is retained. Changes to an UV-file are permanent and cannot
202215
** be undone, so use appropriate caution with this command.
@@ -214,35 +227,40 @@
214227
**
215228
** edit FILE Bring up FILE in a text editor for modification.
216229
**
217230
** export FILE OUTPUT Write the content of FILE into OUTPUT on disk
218231
**
219
-** list | ls Show all unversioned files held in the local repository.
232
+** list | ls Show all unversioned files held in the local
233
+** repository.
220234
**
221
-** revert ?URL? Restore the state of all unversioned files in the local
222
-** repository to match the remote repository URL.
235
+** revert ?URL? Restore the state of all unversioned files in the
236
+** local repository to match the remote repository
237
+** URL.
238
+**
223239
** Options:
224240
** -v|--verbose Extra diagnostic output
225241
** -n|--dryrun Show what would have happened
226242
**
227
-** rm FILE ... Remove an unversioned files from the local repository.
243
+** remove | rm FILE ... Remove unversioned files from the local repository.
228244
** Changes are not pushed to other repositories until
229
-** the next sync.
245
+** the next sync.
230246
**
231247
** sync ?URL? Synchronize the state of all unversioned files with
232
-** the remote repository URL. The most recent version of
233
-** each file is propagate to all repositories and all
234
-** prior versions are permanently forgotten.
248
+** the remote repository URL. The most recent version
249
+** of each file is propagate to all repositories and
250
+** all prior versions are permanently forgotten.
251
+**
235252
** Options:
236253
** -v|--verbose Extra diagnostic output
237254
** -n|--dryrun Show what would have happened
238255
**
239256
** touch FILE ... Update the TIMESTAMP on all of the listed files
240257
**
241258
** Options:
242259
**
243
-** --mtime TIMESTAMP Use TIMESTAMP instead of "now" for "add" and "rm".
260
+** --mtime TIMESTAMP Use TIMESTAMP instead of "now" for the "add",
261
+** "edit", "remove", and "touch" subcommands.
244262
*/
245263
void unversioned_cmd(void){
246264
const char *zCmd;
247265
int nCmd;
248266
const char *zMtime = find_option("mtime", 0, 1);
@@ -271,10 +289,13 @@
271289
for(i=3; i<g.argc; i++){
272290
zIn = zAs ? zAs : g.argv[i];
273291
if( zIn[0]==0 || zIn[0]=='/' || !file_is_simple_pathname(zIn,1) ){
274292
fossil_fatal("'%Q' is not an acceptable filename", zIn);
275293
}
294
+ if( contains_whitespace(zIn) ){
295
+ fossil_fatal("names of unversioned files may not contain whitespace");
296
+ }
276297
blob_init(&file,0,0);
277298
blob_read_from_file(&file, g.argv[i]);
278299
unversioned_write(zIn, &file, mtime);
279300
blob_reset(&file);
280301
}
@@ -389,11 +410,11 @@
389410
}else if( memcmp(zCmd, "revert", nCmd)==0 ){
390411
unsigned syncFlags = unversioned_sync_flags(SYNC_UNVERSIONED|SYNC_UV_REVERT);
391412
g.argv[1] = "sync";
392413
g.argv[2] = "--uv-noop";
393414
sync_unversioned(syncFlags);
394
- }else if( memcmp(zCmd, "rm", nCmd)==0 ){
415
+ }else if( memcmp(zCmd, "remove", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){
395416
int i;
396417
verify_all_options();
397418
db_begin_transaction();
398419
for(i=3; i<g.argc; i++){
399420
db_multi_exec(
@@ -420,11 +441,11 @@
420441
);
421442
}
422443
db_unset("uv-hash", 0);
423444
db_end_transaction(0);
424445
}else{
425
- usage("add|cat|edit|export|ls|revert|rm|sync|touch");
446
+ usage("add|cat|edit|export|list|revert|remove|sync|touch");
426447
}
427448
}
428449
429450
/*
430451
** WEBPAGE: uvlist
431452
--- src/unversioned.c
+++ src/unversioned.c
@@ -190,13 +190,26 @@
190 }
191 return syncFlags;
192 }
193
194 /*
 
 
 
 
 
 
 
 
 
 
 
 
195 ** COMMAND: unversioned
196 **
197 ** Usage: %fossil unversioned SUBCOMMAND ARGS...
 
198 **
199 ** Unversioned files (UV-files) are artifacts that are synced and are available
200 ** for download but which do not preserve history. Only the most recent version
201 ** of each UV-file is retained. Changes to an UV-file are permanent and cannot
202 ** be undone, so use appropriate caution with this command.
@@ -214,35 +227,40 @@
214 **
215 ** edit FILE Bring up FILE in a text editor for modification.
216 **
217 ** export FILE OUTPUT Write the content of FILE into OUTPUT on disk
218 **
219 ** list | ls Show all unversioned files held in the local repository.
 
220 **
221 ** revert ?URL? Restore the state of all unversioned files in the local
222 ** repository to match the remote repository URL.
 
 
223 ** Options:
224 ** -v|--verbose Extra diagnostic output
225 ** -n|--dryrun Show what would have happened
226 **
227 ** rm FILE ... Remove an unversioned files from the local repository.
228 ** Changes are not pushed to other repositories until
229 ** the next sync.
230 **
231 ** sync ?URL? Synchronize the state of all unversioned files with
232 ** the remote repository URL. The most recent version of
233 ** each file is propagate to all repositories and all
234 ** prior versions are permanently forgotten.
 
235 ** Options:
236 ** -v|--verbose Extra diagnostic output
237 ** -n|--dryrun Show what would have happened
238 **
239 ** touch FILE ... Update the TIMESTAMP on all of the listed files
240 **
241 ** Options:
242 **
243 ** --mtime TIMESTAMP Use TIMESTAMP instead of "now" for "add" and "rm".
 
244 */
245 void unversioned_cmd(void){
246 const char *zCmd;
247 int nCmd;
248 const char *zMtime = find_option("mtime", 0, 1);
@@ -271,10 +289,13 @@
271 for(i=3; i<g.argc; i++){
272 zIn = zAs ? zAs : g.argv[i];
273 if( zIn[0]==0 || zIn[0]=='/' || !file_is_simple_pathname(zIn,1) ){
274 fossil_fatal("'%Q' is not an acceptable filename", zIn);
275 }
 
 
 
276 blob_init(&file,0,0);
277 blob_read_from_file(&file, g.argv[i]);
278 unversioned_write(zIn, &file, mtime);
279 blob_reset(&file);
280 }
@@ -389,11 +410,11 @@
389 }else if( memcmp(zCmd, "revert", nCmd)==0 ){
390 unsigned syncFlags = unversioned_sync_flags(SYNC_UNVERSIONED|SYNC_UV_REVERT);
391 g.argv[1] = "sync";
392 g.argv[2] = "--uv-noop";
393 sync_unversioned(syncFlags);
394 }else if( memcmp(zCmd, "rm", nCmd)==0 ){
395 int i;
396 verify_all_options();
397 db_begin_transaction();
398 for(i=3; i<g.argc; i++){
399 db_multi_exec(
@@ -420,11 +441,11 @@
420 );
421 }
422 db_unset("uv-hash", 0);
423 db_end_transaction(0);
424 }else{
425 usage("add|cat|edit|export|ls|revert|rm|sync|touch");
426 }
427 }
428
429 /*
430 ** WEBPAGE: uvlist
431
--- src/unversioned.c
+++ src/unversioned.c
@@ -190,13 +190,26 @@
190 }
191 return syncFlags;
192 }
193
194 /*
195 ** Return true if the zName contains any whitespace
196 */
197 static int contains_whitespace(const char *zName){
198 while( zName[0] ){
199 if( fossil_isspace(zName[0]) ) return 1;
200 zName++;
201 }
202 return 0;
203 }
204
205 /*
206 ** COMMAND: uv*
207 ** COMMAND: unversioned
208 **
209 ** Usage: %fossil unversioned SUBCOMMAND ARGS...
210 ** or: %fossil uv SUBCOMMAND ARGS..
211 **
212 ** Unversioned files (UV-files) are artifacts that are synced and are available
213 ** for download but which do not preserve history. Only the most recent version
214 ** of each UV-file is retained. Changes to an UV-file are permanent and cannot
215 ** be undone, so use appropriate caution with this command.
@@ -214,35 +227,40 @@
227 **
228 ** edit FILE Bring up FILE in a text editor for modification.
229 **
230 ** export FILE OUTPUT Write the content of FILE into OUTPUT on disk
231 **
232 ** list | ls Show all unversioned files held in the local
233 ** repository.
234 **
235 ** revert ?URL? Restore the state of all unversioned files in the
236 ** local repository to match the remote repository
237 ** URL.
238 **
239 ** Options:
240 ** -v|--verbose Extra diagnostic output
241 ** -n|--dryrun Show what would have happened
242 **
243 ** remove | rm FILE ... Remove unversioned files from the local repository.
244 ** Changes are not pushed to other repositories until
245 ** the next sync.
246 **
247 ** sync ?URL? Synchronize the state of all unversioned files with
248 ** the remote repository URL. The most recent version
249 ** of each file is propagate to all repositories and
250 ** all prior versions are permanently forgotten.
251 **
252 ** Options:
253 ** -v|--verbose Extra diagnostic output
254 ** -n|--dryrun Show what would have happened
255 **
256 ** touch FILE ... Update the TIMESTAMP on all of the listed files
257 **
258 ** Options:
259 **
260 ** --mtime TIMESTAMP Use TIMESTAMP instead of "now" for the "add",
261 ** "edit", "remove", and "touch" subcommands.
262 */
263 void unversioned_cmd(void){
264 const char *zCmd;
265 int nCmd;
266 const char *zMtime = find_option("mtime", 0, 1);
@@ -271,10 +289,13 @@
289 for(i=3; i<g.argc; i++){
290 zIn = zAs ? zAs : g.argv[i];
291 if( zIn[0]==0 || zIn[0]=='/' || !file_is_simple_pathname(zIn,1) ){
292 fossil_fatal("'%Q' is not an acceptable filename", zIn);
293 }
294 if( contains_whitespace(zIn) ){
295 fossil_fatal("names of unversioned files may not contain whitespace");
296 }
297 blob_init(&file,0,0);
298 blob_read_from_file(&file, g.argv[i]);
299 unversioned_write(zIn, &file, mtime);
300 blob_reset(&file);
301 }
@@ -389,11 +410,11 @@
410 }else if( memcmp(zCmd, "revert", nCmd)==0 ){
411 unsigned syncFlags = unversioned_sync_flags(SYNC_UNVERSIONED|SYNC_UV_REVERT);
412 g.argv[1] = "sync";
413 g.argv[2] = "--uv-noop";
414 sync_unversioned(syncFlags);
415 }else if( memcmp(zCmd, "remove", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){
416 int i;
417 verify_all_options();
418 db_begin_transaction();
419 for(i=3; i<g.argc; i++){
420 db_multi_exec(
@@ -420,11 +441,11 @@
441 );
442 }
443 db_unset("uv-hash", 0);
444 db_end_transaction(0);
445 }else{
446 usage("add|cat|edit|export|list|revert|remove|sync|touch");
447 }
448 }
449
450 /*
451 ** WEBPAGE: uvlist
452
+1 -1
--- src/utf8.c
+++ src/utf8.c
@@ -317,11 +317,11 @@
317317
wchar_t *zUnicode; /* Unicode version of zUtf8 */
318318
DWORD dummy;
319319
Blob blob;
320320
321321
static int istty[2] = { -1, -1 };
322
- if( istty[toStdErr] == -1 ){
322
+ if( istty[toStdErr]==-1 ){
323323
istty[toStdErr] = _isatty(toStdErr + 1) != 0;
324324
}
325325
if( !istty[toStdErr] ){
326326
/* stdout/stderr is not a console. */
327327
return -1;
328328
--- src/utf8.c
+++ src/utf8.c
@@ -317,11 +317,11 @@
317 wchar_t *zUnicode; /* Unicode version of zUtf8 */
318 DWORD dummy;
319 Blob blob;
320
321 static int istty[2] = { -1, -1 };
322 if( istty[toStdErr] == -1 ){
323 istty[toStdErr] = _isatty(toStdErr + 1) != 0;
324 }
325 if( !istty[toStdErr] ){
326 /* stdout/stderr is not a console. */
327 return -1;
328
--- src/utf8.c
+++ src/utf8.c
@@ -317,11 +317,11 @@
317 wchar_t *zUnicode; /* Unicode version of zUtf8 */
318 DWORD dummy;
319 Blob blob;
320
321 static int istty[2] = { -1, -1 };
322 if( istty[toStdErr]==-1 ){
323 istty[toStdErr] = _isatty(toStdErr + 1) != 0;
324 }
325 if( !istty[toStdErr] ){
326 /* stdout/stderr is not a console. */
327 return -1;
328
+6 -6
--- src/vfile.c
+++ src/vfile.c
@@ -264,19 +264,19 @@
264264
}
265265
}
266266
}
267267
#ifndef _WIN32
268268
if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){
269
- if( origPerm == currentPerm ){
269
+ if( origPerm==currentPerm ){
270270
chnged = 0;
271
- }else if( currentPerm == PERM_EXE ){
271
+ }else if( currentPerm==PERM_EXE ){
272272
chnged = 6;
273
- }else if( currentPerm == PERM_LNK ){
273
+ }else if( currentPerm==PERM_LNK ){
274274
chnged = 7;
275
- }else if( origPerm == PERM_EXE ){
275
+ }else if( origPerm==PERM_EXE ){
276276
chnged = 8;
277
- }else if( origPerm == PERM_LNK ){
277
+ }else if( origPerm==PERM_LNK ){
278278
chnged = 9;
279279
}
280280
}
281281
#endif
282282
if( currentMtime!=oldMtime || chnged!=oldChnged ){
@@ -348,11 +348,11 @@
348348
blob_reset(&content);
349349
continue;
350350
}
351351
}
352352
if( verbose ) fossil_print("%s\n", &zName[nRepos]);
353
- if( file_wd_isdir(zName) == 1 ){
353
+ if( file_wd_isdir(zName)==1 ){
354354
/*TODO(dchest): remove directories? */
355355
fossil_fatal("%s is directory, cannot overwrite\n", zName);
356356
}
357357
if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(0)) ){
358358
file_delete(zName);
359359
--- src/vfile.c
+++ src/vfile.c
@@ -264,19 +264,19 @@
264 }
265 }
266 }
267 #ifndef _WIN32
268 if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){
269 if( origPerm == currentPerm ){
270 chnged = 0;
271 }else if( currentPerm == PERM_EXE ){
272 chnged = 6;
273 }else if( currentPerm == PERM_LNK ){
274 chnged = 7;
275 }else if( origPerm == PERM_EXE ){
276 chnged = 8;
277 }else if( origPerm == PERM_LNK ){
278 chnged = 9;
279 }
280 }
281 #endif
282 if( currentMtime!=oldMtime || chnged!=oldChnged ){
@@ -348,11 +348,11 @@
348 blob_reset(&content);
349 continue;
350 }
351 }
352 if( verbose ) fossil_print("%s\n", &zName[nRepos]);
353 if( file_wd_isdir(zName) == 1 ){
354 /*TODO(dchest): remove directories? */
355 fossil_fatal("%s is directory, cannot overwrite\n", zName);
356 }
357 if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(0)) ){
358 file_delete(zName);
359
--- src/vfile.c
+++ src/vfile.c
@@ -264,19 +264,19 @@
264 }
265 }
266 }
267 #ifndef _WIN32
268 if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){
269 if( origPerm==currentPerm ){
270 chnged = 0;
271 }else if( currentPerm==PERM_EXE ){
272 chnged = 6;
273 }else if( currentPerm==PERM_LNK ){
274 chnged = 7;
275 }else if( origPerm==PERM_EXE ){
276 chnged = 8;
277 }else if( origPerm==PERM_LNK ){
278 chnged = 9;
279 }
280 }
281 #endif
282 if( currentMtime!=oldMtime || chnged!=oldChnged ){
@@ -348,11 +348,11 @@
348 blob_reset(&content);
349 continue;
350 }
351 }
352 if( verbose ) fossil_print("%s\n", &zName[nRepos]);
353 if( file_wd_isdir(zName)==1 ){
354 /*TODO(dchest): remove directories? */
355 fossil_fatal("%s is directory, cannot overwrite\n", zName);
356 }
357 if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(0)) ){
358 file_delete(zName);
359
+55 -17
--- src/zip.c
+++ src/zip.c
@@ -350,29 +350,67 @@
350350
}
351351
nPrefix = blob_size(&filename);
352352
353353
pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
354354
if( pManifest ){
355
- char *zName;
355
+ int flg, eflg = 0;
356
+ char *zName = 0;
356357
zip_set_timedate(pManifest->rDate);
357
- if( (pInclude==0 || glob_match(pInclude, "manifest"))
358
- && !glob_match(pExclude, "manifest")
359
- && db_get_boolean("manifest", 0)
360
- ){
361
- blob_append(&filename, "manifest", -1);
362
- zName = blob_str(&filename);
363
- zip_add_folders(zName);
364
- sha1sum_blob(&mfile, &hash);
365
- sterilize_manifest(&mfile);
366
- zip_add_file(zName, &mfile, 0);
358
+ flg = db_get_manifest_setting();
359
+ if( flg ){
360
+ /* eflg is the effective flags, taking include/exclude into account */
361
+ if( (pInclude==0 || glob_match(pInclude, "manifest"))
362
+ && !glob_match(pExclude, "manifest")
363
+ && (flg & MFESTFLG_RAW) ){
364
+ eflg |= MFESTFLG_RAW;
365
+ }
366
+ if( (pInclude==0 || glob_match(pInclude, "manifest.uuid"))
367
+ && !glob_match(pExclude, "manifest.uuid")
368
+ && (flg & MFESTFLG_UUID) ){
369
+ eflg |= MFESTFLG_UUID;
370
+ }
371
+ if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
372
+ && !glob_match(pExclude, "manifest.tags")
373
+ && (flg & MFESTFLG_TAGS) ){
374
+ eflg |= MFESTFLG_TAGS;
375
+ }
376
+
377
+ if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
378
+ if( eflg & MFESTFLG_RAW ){
379
+ blob_append(&filename, "manifest", -1);
380
+ zName = blob_str(&filename);
381
+ zip_add_folders(zName);
382
+ }
383
+ if( eflg & MFESTFLG_UUID ){
384
+ sha1sum_blob(&mfile, &hash);
385
+ }
386
+ if( eflg & MFESTFLG_RAW ){
387
+ sterilize_manifest(&mfile);
388
+ zip_add_file(zName, &mfile, 0);
389
+ }
390
+ }
367391
blob_reset(&mfile);
368
- blob_append(&hash, "\n", 1);
369
- blob_resize(&filename, nPrefix);
370
- blob_append(&filename, "manifest.uuid", -1);
371
- zName = blob_str(&filename);
372
- zip_add_file(zName, &hash, 0);
373
- blob_reset(&hash);
392
+ if( eflg & MFESTFLG_UUID ){
393
+ blob_append(&hash, "\n", 1);
394
+ blob_resize(&filename, nPrefix);
395
+ blob_append(&filename, "manifest.uuid", -1);
396
+ zName = blob_str(&filename);
397
+ zip_add_folders(zName);
398
+ zip_add_file(zName, &hash, 0);
399
+ blob_reset(&hash);
400
+ }
401
+ if( eflg & MFESTFLG_TAGS ){
402
+ Blob tagslist;
403
+ blob_zero(&tagslist);
404
+ get_checkin_taglist(rid, &tagslist);
405
+ blob_resize(&filename, nPrefix);
406
+ blob_append(&filename, "manifest.tags", -1);
407
+ zName = blob_str(&filename);
408
+ zip_add_folders(zName);
409
+ zip_add_file(zName, &tagslist, 0);
410
+ blob_reset(&tagslist);
411
+ }
374412
}
375413
manifest_file_rewind(pManifest);
376414
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
377415
int fid;
378416
if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
379417
--- src/zip.c
+++ src/zip.c
@@ -350,29 +350,67 @@
350 }
351 nPrefix = blob_size(&filename);
352
353 pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
354 if( pManifest ){
355 char *zName;
 
356 zip_set_timedate(pManifest->rDate);
357 if( (pInclude==0 || glob_match(pInclude, "manifest"))
358 && !glob_match(pExclude, "manifest")
359 && db_get_boolean("manifest", 0)
360 ){
361 blob_append(&filename, "manifest", -1);
362 zName = blob_str(&filename);
363 zip_add_folders(zName);
364 sha1sum_blob(&mfile, &hash);
365 sterilize_manifest(&mfile);
366 zip_add_file(zName, &mfile, 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
367 blob_reset(&mfile);
368 blob_append(&hash, "\n", 1);
369 blob_resize(&filename, nPrefix);
370 blob_append(&filename, "manifest.uuid", -1);
371 zName = blob_str(&filename);
372 zip_add_file(zName, &hash, 0);
373 blob_reset(&hash);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374 }
375 manifest_file_rewind(pManifest);
376 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
377 int fid;
378 if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
379
--- src/zip.c
+++ src/zip.c
@@ -350,29 +350,67 @@
350 }
351 nPrefix = blob_size(&filename);
352
353 pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
354 if( pManifest ){
355 int flg, eflg = 0;
356 char *zName = 0;
357 zip_set_timedate(pManifest->rDate);
358 flg = db_get_manifest_setting();
359 if( flg ){
360 /* eflg is the effective flags, taking include/exclude into account */
361 if( (pInclude==0 || glob_match(pInclude, "manifest"))
362 && !glob_match(pExclude, "manifest")
363 && (flg & MFESTFLG_RAW) ){
364 eflg |= MFESTFLG_RAW;
365 }
366 if( (pInclude==0 || glob_match(pInclude, "manifest.uuid"))
367 && !glob_match(pExclude, "manifest.uuid")
368 && (flg & MFESTFLG_UUID) ){
369 eflg |= MFESTFLG_UUID;
370 }
371 if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
372 && !glob_match(pExclude, "manifest.tags")
373 && (flg & MFESTFLG_TAGS) ){
374 eflg |= MFESTFLG_TAGS;
375 }
376
377 if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
378 if( eflg & MFESTFLG_RAW ){
379 blob_append(&filename, "manifest", -1);
380 zName = blob_str(&filename);
381 zip_add_folders(zName);
382 }
383 if( eflg & MFESTFLG_UUID ){
384 sha1sum_blob(&mfile, &hash);
385 }
386 if( eflg & MFESTFLG_RAW ){
387 sterilize_manifest(&mfile);
388 zip_add_file(zName, &mfile, 0);
389 }
390 }
391 blob_reset(&mfile);
392 if( eflg & MFESTFLG_UUID ){
393 blob_append(&hash, "\n", 1);
394 blob_resize(&filename, nPrefix);
395 blob_append(&filename, "manifest.uuid", -1);
396 zName = blob_str(&filename);
397 zip_add_folders(zName);
398 zip_add_file(zName, &hash, 0);
399 blob_reset(&hash);
400 }
401 if( eflg & MFESTFLG_TAGS ){
402 Blob tagslist;
403 blob_zero(&tagslist);
404 get_checkin_taglist(rid, &tagslist);
405 blob_resize(&filename, nPrefix);
406 blob_append(&filename, "manifest.tags", -1);
407 zName = blob_str(&filename);
408 zip_add_folders(zName);
409 zip_add_file(zName, &tagslist, 0);
410 blob_reset(&tagslist);
411 }
412 }
413 manifest_file_rewind(pManifest);
414 while( (pFile = manifest_file_next(pManifest,0))!=0 ){
415 int fid;
416 if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
417
+1 -1
--- test/amend.test
+++ test/amend.test
@@ -259,11 +259,11 @@
259259
[string match "*comment:*Create*new*branch*named*\"cllf\"*" $RESULT]
260260
}
261261
fossil tag ls --raw $UUIDC
262262
test amend-close-1.2 {[string first "closed" $RESULT] != -1}
263263
fossil timeline -n 1
264
-test amend-close-1.3 {[string match {*Marked*"Closed".*} $RESULT]}
264
+test amend-close-1.3 {[string match {*Mark*"Closed".*} $RESULT]}
265265
write_file datafile "cllf"
266266
fossil commit -m "should fail" -expectError
267267
test amend-close-2 {[string first "closed leaf" $RESULT] != -1}
268268
269269
set UUID3 UUID3
270270
--- test/amend.test
+++ test/amend.test
@@ -259,11 +259,11 @@
259 [string match "*comment:*Create*new*branch*named*\"cllf\"*" $RESULT]
260 }
261 fossil tag ls --raw $UUIDC
262 test amend-close-1.2 {[string first "closed" $RESULT] != -1}
263 fossil timeline -n 1
264 test amend-close-1.3 {[string match {*Marked*"Closed".*} $RESULT]}
265 write_file datafile "cllf"
266 fossil commit -m "should fail" -expectError
267 test amend-close-2 {[string first "closed leaf" $RESULT] != -1}
268
269 set UUID3 UUID3
270
--- test/amend.test
+++ test/amend.test
@@ -259,11 +259,11 @@
259 [string match "*comment:*Create*new*branch*named*\"cllf\"*" $RESULT]
260 }
261 fossil tag ls --raw $UUIDC
262 test amend-close-1.2 {[string first "closed" $RESULT] != -1}
263 fossil timeline -n 1
264 test amend-close-1.3 {[string match {*Mark*"Closed".*} $RESULT]}
265 write_file datafile "cllf"
266 fossil commit -m "should fail" -expectError
267 test amend-close-2 {[string first "closed leaf" $RESULT] != -1}
268
269 set UUID3 UUID3
270
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -1,7 +1,7 @@
11
#
2
-# Copyright (c) 2015 D. Richard Hipp
2
+# Copyright (c) 2016 D. Richard Hipp
33
#
44
# This program is free software; you can redistribute it and/or
55
# modify it under the terms of the Simplified BSD License (also
66
# known as the "2-Clause License" or "FreeBSD License".)
77
#
88
99
ADDED test/fake-editor.tcl
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -1,7 +1,7 @@
1 #
2 # Copyright (c) 2015 D. Richard Hipp
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the Simplified BSD License (also
6 # known as the "2-Clause License" or "FreeBSD License".)
7 #
8
9 DDED test/fake-editor.tcl
--- test/commit-warning.test
+++ test/commit-warning.test
@@ -1,7 +1,7 @@
1 #
2 # Copyright (c) 2016 D. Richard Hipp
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the Simplified BSD License (also
6 # known as the "2-Clause License" or "FreeBSD License".)
7 #
8
9 DDED test/fake-editor.tcl
--- a/test/fake-editor.tcl
+++ b/test/fake-editor.tcl
@@ -0,0 +1,2 @@
1
+#
2
+# Copyright (
--- a/test/fake-editor.tcl
+++ b/test/fake-editor.tcl
@@ -0,0 +1,2 @@
 
 
--- a/test/fake-editor.tcl
+++ b/test/fake-editor.tcl
@@ -0,0 +1,2 @@
1 #
2 # Copyright (
--- test/merge2.test
+++ test/merge2.test
@@ -35,10 +35,11 @@
3535
expr {srand($i*2+1)}
3636
write_file t23 [random_changes $f2 2 4 2 0.1]
3737
expr {srand($i*2)}
3838
write_file t32 [random_changes $f3 2 4 0 0.1]
3939
fossil 3-way-merge t1 t2 t3 a23
40
+ if {[regexp {<<<<< BEGIN MERGE CONFLICT:} [read_file a23]]} continue
4041
test merge-$base-$i-23 {[same_file a23 t23]}
4142
fossil 3-way-merge t1 t3 t2 a32
4243
test merge-$base-$i-32 {[same_file a32 t32]}
4344
}
4445
}
4546
--- test/merge2.test
+++ test/merge2.test
@@ -35,10 +35,11 @@
35 expr {srand($i*2+1)}
36 write_file t23 [random_changes $f2 2 4 2 0.1]
37 expr {srand($i*2)}
38 write_file t32 [random_changes $f3 2 4 0 0.1]
39 fossil 3-way-merge t1 t2 t3 a23
 
40 test merge-$base-$i-23 {[same_file a23 t23]}
41 fossil 3-way-merge t1 t3 t2 a32
42 test merge-$base-$i-32 {[same_file a32 t32]}
43 }
44 }
45
--- test/merge2.test
+++ test/merge2.test
@@ -35,10 +35,11 @@
35 expr {srand($i*2+1)}
36 write_file t23 [random_changes $f2 2 4 2 0.1]
37 expr {srand($i*2)}
38 write_file t32 [random_changes $f3 2 4 0 0.1]
39 fossil 3-way-merge t1 t2 t3 a23
40 if {[regexp {<<<<< BEGIN MERGE CONFLICT:} [read_file a23]]} continue
41 test merge-$base-$i-23 {[same_file a23 t23]}
42 fossil 3-way-merge t1 t3 t2 a32
43 test merge-$base-$i-32 {[same_file a32 t32]}
44 }
45 }
46
--- test/mv-rm.test
+++ test/mv-rm.test
@@ -15,10 +15,12 @@
1515
#
1616
############################################################################
1717
#
1818
# MV / RM Commands
1919
#
20
+
21
+set path [file dirname [info script]]
2022
2123
require_no_open_checkout
2224
2325
########################################
2426
# Setup: Add Files and Commit #
2527
2628
ADDED test/set-manifest.test
--- test/mv-rm.test
+++ test/mv-rm.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # MV / RM Commands
19 #
 
 
20
21 require_no_open_checkout
22
23 ########################################
24 # Setup: Add Files and Commit #
25
26 DDED test/set-manifest.test
--- test/mv-rm.test
+++ test/mv-rm.test
@@ -15,10 +15,12 @@
15 #
16 ############################################################################
17 #
18 # MV / RM Commands
19 #
20
21 set path [file dirname [info script]]
22
23 require_no_open_checkout
24
25 ########################################
26 # Setup: Add Files and Commit #
27
28 DDED test/set-manifest.test
--- a/test/set-manifest.test
+++ b/test/set-manifest.test
@@ -0,0 +1,113 @@
1
+#
2
+# Copyright (c) 2016 D. Richard Hipp
3
+#
4
+# This program is free software; you can redistribute it and/or
5
+# modify it under the terms of the Simplified BSD License (also
6
+# known as the "2-Clause License" or "FreeBSD License".)
7
+#
8
+# This program is distributed in the hope that it will be useful,
9
+# but without any warranty; without even the implied warranty of
10
+# merchantability or fitness for a particular purpose.
11
+#
12
+# Author contact information:
13
+# [email protected]
14
+# http://www.hwaci.com/drh/
15
+#
16
+############################################################################
17
+#
18
+# Test manifest setting
19
+#
20
+
21
+t (c) 2016 D. Richard Hipp
22
+#
23
+# This program is free software; you can redistribute it and/or
24
+# modify it under the terms of the Simplified BSD License (also
25
+# known as the "2-Clause License" or "FreeBSD License".)
26
+#
27
+# T#
28
+# Copyright (c) 20
29
+
30
+proc file_contains {fname match} {
31
+ set fp [open $fname r]
32
+ set contents [read $fp]
33
+ close $fp
34
+ set lines [split $contents "\n"]
35
+ foreach line $lines {
36
+ if {[regexp $match $line]} {
37
+ return 1
38
+ }
39
+ }
40
+ return 0
41
+}
42
+
43
+# We need SHA1 to effectively test the manifest files produced by
44
+# fossil. It looks like the one from tcllib is exactly what we need.
45
+# On ActiveTcl, add it with teacup. On other platforms, YMMV.
46
+# teacup install sha1
47
+if {[catch {package require sha1}] != 0} then {
48
+ puts "The \"sha1\" package is not available."
49
+ test_cleanup_then_return
50
+}
51
+
52
+# We need a respository, so let it have one.
53
+test_setup
54
+
55
+#### Verify classic behavior of the manifest setting
56
+
57
+# Setting is off by default, and there are no extra files.
58
+fossil settings manifest
59
+test "set-manifest-1" {[regexp {^manifest *$} $RESULT]}
60
+set filelist [$v" {$RESULT eq ""}
61
+ fossi D. Richard Hipp
62
+#
63
+# This program is free software; you can redistribute it and/or
64
+# modify it under the terms of the Simplified BSD License (also
65
+# known as the "2-Clause License" or "FreeBSD License".)
66
+#
67
+# This program is distributed in the hope that it will be useful,
68
+# buithout any warranty; without even the implied warranty of
69
+# mer#
70
+# Copyright manifes$ckid eq $uuid} foreach f $filelist {
71
+ test "set-manifest-2-$v-f-$f" {[file isfile $f]}
72
+ }
73
+}
74
+
75
+# ... and manifest.uuid is the checkout's hash
76
+fossil info
77
+regexp {(?m)^checkout:\s+([0-9a-f]{40,64})\s.*$} $RESULT ckoutline ckid
78
+set uuid [string trim [read_file "manifest.uuid"]]
79
+test "set-manifest-2-uuid" {[same_uuid $ckid $uuid]}
80
+
81
+
82
+# ... which is also the SHA1 of the file "manifest" before it was
83
+#License" or "FreeBSD License0
84
+
85
+proc file_contains {fname match}e "manifest"] "" ma2-manifest" {$muuid eq $uuidequire sha1}] != 0} then close $fp
86
+ set lines [split $contents "\n"]
87
+ foreach line $lines {
88
+ if {[regexp $match $line]} {
89
+ return 1
90
+ }
91
+ }
92
+ return 0
93
+}
94
+
95
+# We need SHA1 to effectively test the manifest files produced by
96
+# fossil. It looks like the one from tcllib is exactly what we need.
97
+# On ActiveTcl, add it with teacup. On other platforms, YMMV.
98
+# teacup install sha1
99
+if {[catch {package require sha1}] != 0} then {
100
+ puts "The \"sha1\" package is not available."
101
+ test_cleanup_then_return
102
+}
103
+
104
+# We need a respository, so let it have one.
105
+test_setup
106
+
107
+#### Verify classic behavior of the manifest setting
108
+
109
+# Setting is off by default, and there are no extra files.
110
+fossil settings manifest
111
+test "set-manifest-1" {[regexp {^manifest *$} $RESULT]}
112
+set filelist [$v" {$RESULT eq ""}
113
+ fossi D. R
--- a/test/set-manifest.test
+++ b/test/set-manifest.test
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/test/set-manifest.test
+++ b/test/set-manifest.test
@@ -0,0 +1,113 @@
1 #
2 # Copyright (c) 2016 D. Richard Hipp
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the Simplified BSD License (also
6 # known as the "2-Clause License" or "FreeBSD License".)
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but without any warranty; without even the implied warranty of
10 # merchantability or fitness for a particular purpose.
11 #
12 # Author contact information:
13 # [email protected]
14 # http://www.hwaci.com/drh/
15 #
16 ############################################################################
17 #
18 # Test manifest setting
19 #
20
21 t (c) 2016 D. Richard Hipp
22 #
23 # This program is free software; you can redistribute it and/or
24 # modify it under the terms of the Simplified BSD License (also
25 # known as the "2-Clause License" or "FreeBSD License".)
26 #
27 # T#
28 # Copyright (c) 20
29
30 proc file_contains {fname match} {
31 set fp [open $fname r]
32 set contents [read $fp]
33 close $fp
34 set lines [split $contents "\n"]
35 foreach line $lines {
36 if {[regexp $match $line]} {
37 return 1
38 }
39 }
40 return 0
41 }
42
43 # We need SHA1 to effectively test the manifest files produced by
44 # fossil. It looks like the one from tcllib is exactly what we need.
45 # On ActiveTcl, add it with teacup. On other platforms, YMMV.
46 # teacup install sha1
47 if {[catch {package require sha1}] != 0} then {
48 puts "The \"sha1\" package is not available."
49 test_cleanup_then_return
50 }
51
52 # We need a respository, so let it have one.
53 test_setup
54
55 #### Verify classic behavior of the manifest setting
56
57 # Setting is off by default, and there are no extra files.
58 fossil settings manifest
59 test "set-manifest-1" {[regexp {^manifest *$} $RESULT]}
60 set filelist [$v" {$RESULT eq ""}
61 fossi D. Richard Hipp
62 #
63 # This program is free software; you can redistribute it and/or
64 # modify it under the terms of the Simplified BSD License (also
65 # known as the "2-Clause License" or "FreeBSD License".)
66 #
67 # This program is distributed in the hope that it will be useful,
68 # buithout any warranty; without even the implied warranty of
69 # mer#
70 # Copyright manifes$ckid eq $uuid} foreach f $filelist {
71 test "set-manifest-2-$v-f-$f" {[file isfile $f]}
72 }
73 }
74
75 # ... and manifest.uuid is the checkout's hash
76 fossil info
77 regexp {(?m)^checkout:\s+([0-9a-f]{40,64})\s.*$} $RESULT ckoutline ckid
78 set uuid [string trim [read_file "manifest.uuid"]]
79 test "set-manifest-2-uuid" {[same_uuid $ckid $uuid]}
80
81
82 # ... which is also the SHA1 of the file "manifest" before it was
83 #License" or "FreeBSD License0
84
85 proc file_contains {fname match}e "manifest"] "" ma2-manifest" {$muuid eq $uuidequire sha1}] != 0} then close $fp
86 set lines [split $contents "\n"]
87 foreach line $lines {
88 if {[regexp $match $line]} {
89 return 1
90 }
91 }
92 return 0
93 }
94
95 # We need SHA1 to effectively test the manifest files produced by
96 # fossil. It looks like the one from tcllib is exactly what we need.
97 # On ActiveTcl, add it with teacup. On other platforms, YMMV.
98 # teacup install sha1
99 if {[catch {package require sha1}] != 0} then {
100 puts "The \"sha1\" package is not available."
101 test_cleanup_then_return
102 }
103
104 # We need a respository, so let it have one.
105 test_setup
106
107 #### Verify classic behavior of the manifest setting
108
109 # Setting is off by default, and there are no extra files.
110 fossil settings manifest
111 test "set-manifest-1" {[regexp {^manifest *$} $RESULT]}
112 set filelist [$v" {$RESULT eq ""}
113 fossi D. R
--- test/settings-repo.test
+++ test/settings-repo.test
@@ -16,12 +16,15 @@
1616
############################################################################
1717
#
1818
# The "settings" and "unset" commands that may modify the repository.
1919
#
2020
21
+set path [file dirname [info script]]
22
+
2123
require_no_open_checkout
22
-set dir [file dirname [info script]]; test_setup
24
+
25
+test_setup
2326
2427
###############################################################################
2528
#
2629
# Complete syntax as tested:
2730
#
2831
--- test/settings-repo.test
+++ test/settings-repo.test
@@ -16,12 +16,15 @@
16 ############################################################################
17 #
18 # The "settings" and "unset" commands that may modify the repository.
19 #
20
 
 
21 require_no_open_checkout
22 set dir [file dirname [info script]]; test_setup
 
23
24 ###############################################################################
25 #
26 # Complete syntax as tested:
27 #
28
--- test/settings-repo.test
+++ test/settings-repo.test
@@ -16,12 +16,15 @@
16 ############################################################################
17 #
18 # The "settings" and "unset" commands that may modify the repository.
19 #
20
21 set path [file dirname [info script]]
22
23 require_no_open_checkout
24
25 test_setup
26
27 ###############################################################################
28 #
29 # Complete syntax as tested:
30 #
31
--- test/settings.test
+++ test/settings.test
@@ -16,11 +16,11 @@
1616
############################################################################
1717
#
1818
# The "settings" and "unset" commands.
1919
#
2020
21
-set dir [file dirname [info script]]; test_setup
21
+set path [file dirname [info script]]; test_setup
2222
2323
###############################################################################
2424
#
2525
# Complete syntax as tested:
2626
#
2727
2828
ADDED test/symlinks.test
--- test/settings.test
+++ test/settings.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # The "settings" and "unset" commands.
19 #
20
21 set dir [file dirname [info script]]; test_setup
22
23 ###############################################################################
24 #
25 # Complete syntax as tested:
26 #
27
28 DDED test/symlinks.test
--- test/settings.test
+++ test/settings.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # The "settings" and "unset" commands.
19 #
20
21 set path [file dirname [info script]]; test_setup
22
23 ###############################################################################
24 #
25 # Complete syntax as tested:
26 #
27
28 DDED test/symlinks.test
--- a/test/symlinks.test
+++ b/test/symlinks.test
@@ -0,0 +1,68 @@
1
+#
2
+# Copyright (c) 2016 D. Richard Hipp
3
+#
4
+# This program is free software; you can redistribute it and/or
5
+# modify it under the terms of the Simplified BSD License (also
6
+# known as the "2-Clause License" or "FreeBSD License".)
7
+#
8
+# This program is distributed in the hope that it will be useful,
9
+# but without any warranty; without even the implied warranty of
10
+# merchantability or fitness for a particular purpose.
11
+#
12
+# Author contact information:
13
+# [email protected]
14
+# http://www.hwaci.com/drh/
15
+#
16
+############################################################################
17
+#
18
+# Symbolic link tests.
19
+#
20
+
21
+set path [file dirname [info script]]
22
+
23
+if {$tcl_platform(platform) eq "windows"allow
24
+puts $RESULTmlinks are not supported on Windows."
25
+ test_cleanup_then_returnon
26
+
27
+fossil test-th-eval --open-con"setting allow-symlinks"
28
+
29
+itory [normalize_result]
30
+
31
+if {[string length $repository] == 0} {
32
+ puts "Detection of the open repository file failed."
33
+ test_cleanup_then_return
34
+}
35
+
36
+#######################################
37
+# Use symbolic link to a directory... #
38
+##############fossil commit -m "c1"_then_returnon
39
+
40
+fossil test-th-eval --open-con"setting allow-symlinks"
41
+
42
+itory [normalize_rght (c) 2016 D. Rich#
43
+# Copyright up_then_returnon
44
+
45
+fossil test-th-eval --open-con"setting allow-symlinks"
46
+
47
+itory [normalize_result]
48
+
49
+if {[string length $repository] == 0} {
50
+ puts "Detection of the open repository file failed."
51
+ test_cleanup_then_return
52
+}
53
+
54
+#######################################
55
+# Use symbolic link to a directory... #
56
+#######################################
57
+
58
+file mkdir [file join $rootDir subdirA]
59
+exec ln -s [file join $rootDir subdirA] symdirA
60
+
61
+###############################################################################
62
+
63
+write_file [file join $rootDir subdirA f1.txt] "f1"
64
+write_file [file join $rootDir subdirA f2.txt] "f2"
65
+
66
+test symlinks-dir-1 {[file exists [file join $rootDir subdirA f1.txt]] eq 1}
67
+test symlinks-dir-2 {[file exists [file join $rootDir symdirA f1.txt]] eq 1}
68
+test symlinks-di
--- a/test/symlinks.test
+++ b/test/symlinks.test
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/test/symlinks.test
+++ b/test/symlinks.test
@@ -0,0 +1,68 @@
1 #
2 # Copyright (c) 2016 D. Richard Hipp
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the Simplified BSD License (also
6 # known as the "2-Clause License" or "FreeBSD License".)
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but without any warranty; without even the implied warranty of
10 # merchantability or fitness for a particular purpose.
11 #
12 # Author contact information:
13 # [email protected]
14 # http://www.hwaci.com/drh/
15 #
16 ############################################################################
17 #
18 # Symbolic link tests.
19 #
20
21 set path [file dirname [info script]]
22
23 if {$tcl_platform(platform) eq "windows"allow
24 puts $RESULTmlinks are not supported on Windows."
25 test_cleanup_then_returnon
26
27 fossil test-th-eval --open-con"setting allow-symlinks"
28
29 itory [normalize_result]
30
31 if {[string length $repository] == 0} {
32 puts "Detection of the open repository file failed."
33 test_cleanup_then_return
34 }
35
36 #######################################
37 # Use symbolic link to a directory... #
38 ##############fossil commit -m "c1"_then_returnon
39
40 fossil test-th-eval --open-con"setting allow-symlinks"
41
42 itory [normalize_rght (c) 2016 D. Rich#
43 # Copyright up_then_returnon
44
45 fossil test-th-eval --open-con"setting allow-symlinks"
46
47 itory [normalize_result]
48
49 if {[string length $repository] == 0} {
50 puts "Detection of the open repository file failed."
51 test_cleanup_then_return
52 }
53
54 #######################################
55 # Use symbolic link to a directory... #
56 #######################################
57
58 file mkdir [file join $rootDir subdirA]
59 exec ln -s [file join $rootDir subdirA] symdirA
60
61 ###############################################################################
62
63 write_file [file join $rootDir subdirA f1.txt] "f1"
64 write_file [file join $rootDir subdirA f2.txt] "f2"
65
66 test symlinks-dir-1 {[file exists [file join $rootDir subdirA f1.txt]] eq 1}
67 test symlinks-dir-2 {[file exists [file join $rootDir symdirA f1.txt]] eq 1}
68 test symlinks-di
+3 -2
--- test/tester.tcl
+++ test/tester.tcl
@@ -150,14 +150,14 @@
150150
flush stdout
151151
if {[string length $answer] > 0} {
152152
protOut $answer
153153
set prompt_file [file join $::tempPath fossil_prompt_answer]
154154
write_file $prompt_file $answer\n
155
- set rc [catch {eval exec $cmd <$prompt_file} result]
155
+ set rc [catch {eval exec -keepnewline $cmd <$prompt_file} result]
156156
file delete $prompt_file
157157
} else {
158
- set rc [catch {eval exec $cmd} result]
158
+ set rc [catch {eval exec -keepnewline $cmd} result]
159159
}
160160
global RESULT CODE
161161
set CODE $rc
162162
if {($rc && !$expectError) || (!$rc && $expectError)} {
163163
protOut "ERROR: $result" 1
@@ -270,10 +270,11 @@
270270
ssh-command \
271271
ssl-ca-location \
272272
ssl-identity \
273273
th1-setup \
274274
th1-uri-regexp \
275
+ uv-sync \
275276
web-browser]
276277
277278
fossil test-th-eval "hasfeature legacyMvRm"
278279
279280
if {$::RESULT eq "1"} {
280281
--- test/tester.tcl
+++ test/tester.tcl
@@ -150,14 +150,14 @@
150 flush stdout
151 if {[string length $answer] > 0} {
152 protOut $answer
153 set prompt_file [file join $::tempPath fossil_prompt_answer]
154 write_file $prompt_file $answer\n
155 set rc [catch {eval exec $cmd <$prompt_file} result]
156 file delete $prompt_file
157 } else {
158 set rc [catch {eval exec $cmd} result]
159 }
160 global RESULT CODE
161 set CODE $rc
162 if {($rc && !$expectError) || (!$rc && $expectError)} {
163 protOut "ERROR: $result" 1
@@ -270,10 +270,11 @@
270 ssh-command \
271 ssl-ca-location \
272 ssl-identity \
273 th1-setup \
274 th1-uri-regexp \
 
275 web-browser]
276
277 fossil test-th-eval "hasfeature legacyMvRm"
278
279 if {$::RESULT eq "1"} {
280
--- test/tester.tcl
+++ test/tester.tcl
@@ -150,14 +150,14 @@
150 flush stdout
151 if {[string length $answer] > 0} {
152 protOut $answer
153 set prompt_file [file join $::tempPath fossil_prompt_answer]
154 write_file $prompt_file $answer\n
155 set rc [catch {eval exec -keepnewline $cmd <$prompt_file} result]
156 file delete $prompt_file
157 } else {
158 set rc [catch {eval exec -keepnewline $cmd} result]
159 }
160 global RESULT CODE
161 set CODE $rc
162 if {($rc && !$expectError) || (!$rc && $expectError)} {
163 protOut "ERROR: $result" 1
@@ -270,10 +270,11 @@
270 ssh-command \
271 ssl-ca-location \
272 ssl-identity \
273 th1-setup \
274 th1-uri-regexp \
275 uv-sync \
276 web-browser]
277
278 fossil test-th-eval "hasfeature legacyMvRm"
279
280 if {$::RESULT eq "1"} {
281
--- test/th1-repo.test
+++ test/th1-repo.test
@@ -19,10 +19,12 @@
1919
############################################################################
2020
#
2121
# TH1 tests that may modify the repository
2222
#
2323
24
+set path [file dirname [info script]]
25
+
2426
require_no_open_checkout
2527
2628
########################################
2729
# Setup: Add Files and Commit #
2830
########################################
@@ -51,12 +53,10 @@
5153
set files_md [list subdirB/f5.md subdirB/f6.md subdirB/f8.md subdirC/f10.md]
5254
5355
fossil add $rootDir
5456
fossil commit -m "c1"
5557
56
-set dir [file dirname [info script]]
57
-
5858
###############################################################################
5959
6060
fossil test-th-eval --open-config "dir trunk subdir*/*.md"
6161
test th1-dir-1 {[llength $RESULT] eq [llength $files_md]}
6262
6363
--- test/th1-repo.test
+++ test/th1-repo.test
@@ -19,10 +19,12 @@
19 ############################################################################
20 #
21 # TH1 tests that may modify the repository
22 #
23
 
 
24 require_no_open_checkout
25
26 ########################################
27 # Setup: Add Files and Commit #
28 ########################################
@@ -51,12 +53,10 @@
51 set files_md [list subdirB/f5.md subdirB/f6.md subdirB/f8.md subdirC/f10.md]
52
53 fossil add $rootDir
54 fossil commit -m "c1"
55
56 set dir [file dirname [info script]]
57
58 ###############################################################################
59
60 fossil test-th-eval --open-config "dir trunk subdir*/*.md"
61 test th1-dir-1 {[llength $RESULT] eq [llength $files_md]}
62
63
--- test/th1-repo.test
+++ test/th1-repo.test
@@ -19,10 +19,12 @@
19 ############################################################################
20 #
21 # TH1 tests that may modify the repository
22 #
23
24 set path [file dirname [info script]]
25
26 require_no_open_checkout
27
28 ########################################
29 # Setup: Add Files and Commit #
30 ########################################
@@ -51,12 +53,10 @@
53 set files_md [list subdirB/f5.md subdirB/f6.md subdirB/f8.md subdirC/f10.md]
54
55 fossil add $rootDir
56 fossil commit -m "c1"
57
 
 
58 ###############################################################################
59
60 fossil test-th-eval --open-config "dir trunk subdir*/*.md"
61 test th1-dir-1 {[llength $RESULT] eq [llength $files_md]}
62
63
+11 -11
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -16,11 +16,11 @@
1616
############################################################################
1717
#
1818
# TH1/Tcl integration
1919
#
2020
21
-set dir [file dirname [info script]]
21
+set path [file dirname [info script]]
2222
2323
###############################################################################
2424
2525
fossil test-th-eval "hasfeature tcl"
2626
@@ -38,11 +38,11 @@
3838
set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
3939
4040
###############################################################################
4141
4242
fossil test-th-render --open-config \
43
- [file nativename [file join $dir th1-tcl1.txt]]
43
+ [file nativename [file join $path th1-tcl1.txt]]
4444
4545
test th1-tcl-1 {[regexp -- {^tclReady\(before\) = 0
4646
tclReady\(after\) = 1
4747
\d+
4848
\d+
@@ -65,62 +65,62 @@
6565
6666
###############################################################################
6767
6868
if {[catch {package require sqlite3}] == 0} {
6969
fossil test-th-render --open-config \
70
- [file nativename [file join $dir th1-tcl2.txt]]
70
+ [file nativename [file join $path th1-tcl2.txt]]
7171
7272
test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]}
7373
} else {
7474
puts stderr "Skipping 'th1-tcl-2', SQLite package for Tcl not available"
7575
}
7676
7777
###############################################################################
7878
7979
fossil test-th-render --open-config \
80
- [file nativename [file join $dir th1-tcl3.txt]]
80
+ [file nativename [file join $path th1-tcl3.txt]]
8181
8282
test th1-tcl-3 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
8383
invalid command name &quot;bad_command&quot;</p>}}
8484
8585
###############################################################################
8686
8787
fossil test-th-render --open-config \
88
- [file nativename [file join $dir th1-tcl4.txt]]
88
+ [file nativename [file join $path th1-tcl4.txt]]
8989
9090
test th1-tcl-4 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
9191
divide by zero</p>}}
9292
9393
###############################################################################
9494
9595
fossil test-th-render --open-config \
96
- [file nativename [file join $dir th1-tcl5.txt]]
96
+ [file nativename [file join $path th1-tcl5.txt]]
9797
9898
test th1-tcl-5 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
9999
Tcl command not found: bad_command</p>} || $RESULT eq {<hr /><p\
100100
class="thmainError">ERROR: invalid command name &quot;bad_command&quot;</p>}}
101101
102102
###############################################################################
103103
104104
fossil test-th-render --open-config \
105
- [file nativename [file join $dir th1-tcl6.txt]]
105
+ [file nativename [file join $path th1-tcl6.txt]]
106106
107107
test th1-tcl-6 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
108108
no such command: bad_command</p>}}
109109
110110
###############################################################################
111111
112112
fossil test-th-render --open-config \
113
- [file nativename [file join $dir th1-tcl7.txt]]
113
+ [file nativename [file join $path th1-tcl7.txt]]
114114
115115
test th1-tcl-7 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
116116
syntax error in expression: &quot;2**0&quot;</p>}}
117117
118118
###############################################################################
119119
120120
fossil test-th-render --open-config \
121
- [file nativename [file join $dir th1-tcl8.txt]]
121
+ [file nativename [file join $path th1-tcl8.txt]]
122122
123123
test th1-tcl-8 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
124124
cannot invoke Tcl command: tailcall</p>} || $RESULT eq {<hr /><p\
125125
class="thmainError">ERROR: tailcall can only be called from a proc or\
126126
lambda</p>} || $RESULT eq {<hr /><p class="thmainError">ERROR: This test\
@@ -127,14 +127,14 @@
127127
requires Tcl 8.6 or higher.</p>}}
128128
129129
###############################################################################
130130
131131
fossil test-th-render --open-config \
132
- [file nativename [file join $dir th1-tcl9.txt]]
132
+ [file nativename [file join $path th1-tcl9.txt]]
133133
134134
test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexe] 3 \
135
-[list test-th-render --open-config [file nativename [file join $dir \
135
+[list test-th-render --open-config [file nativename [file join $path \
136136
th1-tcl9.txt]]]]}
137137
138138
###############################################################################
139139
140140
fossil test-th-eval "tclMakeSafe a"
141141
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # TH1/Tcl integration
19 #
20
21 set dir [file dirname [info script]]
22
23 ###############################################################################
24
25 fossil test-th-eval "hasfeature tcl"
26
@@ -38,11 +38,11 @@
38 set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
39
40 ###############################################################################
41
42 fossil test-th-render --open-config \
43 [file nativename [file join $dir th1-tcl1.txt]]
44
45 test th1-tcl-1 {[regexp -- {^tclReady\(before\) = 0
46 tclReady\(after\) = 1
47 \d+
48 \d+
@@ -65,62 +65,62 @@
65
66 ###############################################################################
67
68 if {[catch {package require sqlite3}] == 0} {
69 fossil test-th-render --open-config \
70 [file nativename [file join $dir th1-tcl2.txt]]
71
72 test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]}
73 } else {
74 puts stderr "Skipping 'th1-tcl-2', SQLite package for Tcl not available"
75 }
76
77 ###############################################################################
78
79 fossil test-th-render --open-config \
80 [file nativename [file join $dir th1-tcl3.txt]]
81
82 test th1-tcl-3 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
83 invalid command name &quot;bad_command&quot;</p>}}
84
85 ###############################################################################
86
87 fossil test-th-render --open-config \
88 [file nativename [file join $dir th1-tcl4.txt]]
89
90 test th1-tcl-4 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
91 divide by zero</p>}}
92
93 ###############################################################################
94
95 fossil test-th-render --open-config \
96 [file nativename [file join $dir th1-tcl5.txt]]
97
98 test th1-tcl-5 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
99 Tcl command not found: bad_command</p>} || $RESULT eq {<hr /><p\
100 class="thmainError">ERROR: invalid command name &quot;bad_command&quot;</p>}}
101
102 ###############################################################################
103
104 fossil test-th-render --open-config \
105 [file nativename [file join $dir th1-tcl6.txt]]
106
107 test th1-tcl-6 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
108 no such command: bad_command</p>}}
109
110 ###############################################################################
111
112 fossil test-th-render --open-config \
113 [file nativename [file join $dir th1-tcl7.txt]]
114
115 test th1-tcl-7 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
116 syntax error in expression: &quot;2**0&quot;</p>}}
117
118 ###############################################################################
119
120 fossil test-th-render --open-config \
121 [file nativename [file join $dir th1-tcl8.txt]]
122
123 test th1-tcl-8 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
124 cannot invoke Tcl command: tailcall</p>} || $RESULT eq {<hr /><p\
125 class="thmainError">ERROR: tailcall can only be called from a proc or\
126 lambda</p>} || $RESULT eq {<hr /><p class="thmainError">ERROR: This test\
@@ -127,14 +127,14 @@
127 requires Tcl 8.6 or higher.</p>}}
128
129 ###############################################################################
130
131 fossil test-th-render --open-config \
132 [file nativename [file join $dir th1-tcl9.txt]]
133
134 test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexe] 3 \
135 [list test-th-render --open-config [file nativename [file join $dir \
136 th1-tcl9.txt]]]]}
137
138 ###############################################################################
139
140 fossil test-th-eval "tclMakeSafe a"
141
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # TH1/Tcl integration
19 #
20
21 set path [file dirname [info script]]
22
23 ###############################################################################
24
25 fossil test-th-eval "hasfeature tcl"
26
@@ -38,11 +38,11 @@
38 set env(TH1_ENABLE_TCL) 1; # Tcl integration must be enabled for this test.
39
40 ###############################################################################
41
42 fossil test-th-render --open-config \
43 [file nativename [file join $path th1-tcl1.txt]]
44
45 test th1-tcl-1 {[regexp -- {^tclReady\(before\) = 0
46 tclReady\(after\) = 1
47 \d+
48 \d+
@@ -65,62 +65,62 @@
65
66 ###############################################################################
67
68 if {[catch {package require sqlite3}] == 0} {
69 fossil test-th-render --open-config \
70 [file nativename [file join $path th1-tcl2.txt]]
71
72 test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]}
73 } else {
74 puts stderr "Skipping 'th1-tcl-2', SQLite package for Tcl not available"
75 }
76
77 ###############################################################################
78
79 fossil test-th-render --open-config \
80 [file nativename [file join $path th1-tcl3.txt]]
81
82 test th1-tcl-3 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
83 invalid command name &quot;bad_command&quot;</p>}}
84
85 ###############################################################################
86
87 fossil test-th-render --open-config \
88 [file nativename [file join $path th1-tcl4.txt]]
89
90 test th1-tcl-4 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
91 divide by zero</p>}}
92
93 ###############################################################################
94
95 fossil test-th-render --open-config \
96 [file nativename [file join $path th1-tcl5.txt]]
97
98 test th1-tcl-5 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
99 Tcl command not found: bad_command</p>} || $RESULT eq {<hr /><p\
100 class="thmainError">ERROR: invalid command name &quot;bad_command&quot;</p>}}
101
102 ###############################################################################
103
104 fossil test-th-render --open-config \
105 [file nativename [file join $path th1-tcl6.txt]]
106
107 test th1-tcl-6 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
108 no such command: bad_command</p>}}
109
110 ###############################################################################
111
112 fossil test-th-render --open-config \
113 [file nativename [file join $path th1-tcl7.txt]]
114
115 test th1-tcl-7 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
116 syntax error in expression: &quot;2**0&quot;</p>}}
117
118 ###############################################################################
119
120 fossil test-th-render --open-config \
121 [file nativename [file join $path th1-tcl8.txt]]
122
123 test th1-tcl-8 {$RESULT eq {<hr /><p class="thmainError">ERROR:\
124 cannot invoke Tcl command: tailcall</p>} || $RESULT eq {<hr /><p\
125 class="thmainError">ERROR: tailcall can only be called from a proc or\
126 lambda</p>} || $RESULT eq {<hr /><p class="thmainError">ERROR: This test\
@@ -127,14 +127,14 @@
127 requires Tcl 8.6 or higher.</p>}}
128
129 ###############################################################################
130
131 fossil test-th-render --open-config \
132 [file nativename [file join $path th1-tcl9.txt]]
133
134 test th1-tcl-9 {[string trim $RESULT] eq [list [file tail $fossilexe] 3 \
135 [list test-th-render --open-config [file nativename [file join $path \
136 th1-tcl9.txt]]]]}
137
138 ###############################################################################
139
140 fossil test-th-eval "tclMakeSafe a"
141
+2 -2
--- test/th1.test
+++ test/th1.test
@@ -16,11 +16,11 @@
1616
############################################################################
1717
#
1818
# TH1 Commands
1919
#
2020
21
-set dir [file dirname [info script]]; test_setup
21
+set path [file dirname [info script]]; test_setup
2222
2323
###############################################################################
2424
2525
set th1Tcl [is_tcl_usable_by_fossil]
2626
set th1Hooks [are_th1_hooks_usable_by_fossil]
@@ -1468,11 +1468,11 @@
14681468
</div>
14691469
}}}
14701470
14711471
###############################################################################
14721472
1473
-set markdown [read_file [file join $dir markdown-test1.md]]
1473
+set markdown [read_file [file join $path markdown-test1.md]]
14741474
fossil test-th-eval [string map \
14751475
[list %markdown% $markdown] {markdown {%markdown%}}]
14761476
test th1-markdown-5 {[normalize_result] eq \
14771477
{{Markdown Formatter Test Document} {<div class="markdown">
14781478
14791479
14801480
ADDED test/unversioned.test
--- test/th1.test
+++ test/th1.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # TH1 Commands
19 #
20
21 set dir [file dirname [info script]]; test_setup
22
23 ###############################################################################
24
25 set th1Tcl [is_tcl_usable_by_fossil]
26 set th1Hooks [are_th1_hooks_usable_by_fossil]
@@ -1468,11 +1468,11 @@
1468 </div>
1469 }}}
1470
1471 ###############################################################################
1472
1473 set markdown [read_file [file join $dir markdown-test1.md]]
1474 fossil test-th-eval [string map \
1475 [list %markdown% $markdown] {markdown {%markdown%}}]
1476 test th1-markdown-5 {[normalize_result] eq \
1477 {{Markdown Formatter Test Document} {<div class="markdown">
1478
1479
1480 DDED test/unversioned.test
--- test/th1.test
+++ test/th1.test
@@ -16,11 +16,11 @@
16 ############################################################################
17 #
18 # TH1 Commands
19 #
20
21 set path [file dirname [info script]]; test_setup
22
23 ###############################################################################
24
25 set th1Tcl [is_tcl_usable_by_fossil]
26 set th1Hooks [are_th1_hooks_usable_by_fossil]
@@ -1468,11 +1468,11 @@
1468 </div>
1469 }}}
1470
1471 ###############################################################################
1472
1473 set markdown [read_file [file join $path markdown-test1.md]]
1474 fossil test-th-eval [string map \
1475 [list %markdown% $markdown] {markdown {%markdown%}}]
1476 test th1-markdown-5 {[normalize_result] eq \
1477 {{Markdown Formatter Test Document} {<div class="markdown">
1478
1479
1480 DDED test/unversioned.test
--- a/test/unversioned.test
+++ b/test/unversioned.test
@@ -0,0 +1,8 @@
1
+nam]
2
+8080/set pid
3
+nam]
4
+8080/set pid
5
+n#
6
+# TODO: Add tests for the unversioned "revert" and "sync" sub-commands.
7
+#
8
+# revert --verbtest_cleanup
--- a/test/unversioned.test
+++ b/test/unversioned.test
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
--- a/test/unversioned.test
+++ b/test/unversioned.test
@@ -0,0 +1,8 @@
1 nam]
2 8080/set pid
3 nam]
4 8080/set pid
5 n#
6 # TODO: Add tests for the unversioned "revert" and "sync" sub-commands.
7 #
8 # revert --verbtest_cleanup
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -83,11 +83,11 @@
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_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -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_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_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_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))
9494
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -83,11 +83,11 @@
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_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -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_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
--- win/Makefile.PellesCGMake
+++ win/Makefile.PellesCGMake
@@ -83,11 +83,11 @@
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_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_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
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -24,11 +24,11 @@
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_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -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
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_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
3030
3131
SHELL_OPTIONS = -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 db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c foci_.c fshell_.c fusefs_.c glob_.c graph_.c gzip_.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 setup_.c sha1_.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
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -24,11 +24,11 @@
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_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -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
30
31 SHELL_OPTIONS = -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 db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c foci_.c fshell_.c fusefs_.c glob_.c graph_.c gzip_.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 setup_.c sha1_.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
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -24,11 +24,11 @@
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_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
30
31 SHELL_OPTIONS = -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 db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c foci_.c fshell_.c fusefs_.c glob_.c graph_.c gzip_.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 setup_.c sha1_.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
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -2174,10 +2174,12 @@
21742174
-DSQLITE_OMIT_DECLTYPE \
21752175
-DSQLITE_OMIT_DEPRECATED \
21762176
-DSQLITE_OMIT_PROGRESS_CALLBACK \
21772177
-DSQLITE_OMIT_SHARED_CACHE \
21782178
-DSQLITE_OMIT_LOAD_EXTENSION \
2179
+ -DSQLITE_MAX_EXPR_DEPTH=0 \
2180
+ -DSQLITE_USE_ALLOCA \
21792181
-DSQLITE_ENABLE_LOCKING_STYLE=0 \
21802182
-DSQLITE_DEFAULT_FILE_FORMAT=4 \
21812183
-DSQLITE_ENABLE_EXPLAIN_COMMENTS \
21822184
-DSQLITE_ENABLE_FTS4 \
21832185
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
21842186
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -2174,10 +2174,12 @@
2174 -DSQLITE_OMIT_DECLTYPE \
2175 -DSQLITE_OMIT_DEPRECATED \
2176 -DSQLITE_OMIT_PROGRESS_CALLBACK \
2177 -DSQLITE_OMIT_SHARED_CACHE \
2178 -DSQLITE_OMIT_LOAD_EXTENSION \
 
 
2179 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
2180 -DSQLITE_DEFAULT_FILE_FORMAT=4 \
2181 -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
2182 -DSQLITE_ENABLE_FTS4 \
2183 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2184
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -2174,10 +2174,12 @@
2174 -DSQLITE_OMIT_DECLTYPE \
2175 -DSQLITE_OMIT_DEPRECATED \
2176 -DSQLITE_OMIT_PROGRESS_CALLBACK \
2177 -DSQLITE_OMIT_SHARED_CACHE \
2178 -DSQLITE_OMIT_LOAD_EXTENSION \
2179 -DSQLITE_MAX_EXPR_DEPTH=0 \
2180 -DSQLITE_USE_ALLOCA \
2181 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
2182 -DSQLITE_DEFAULT_FILE_FORMAT=4 \
2183 -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
2184 -DSQLITE_ENABLE_FTS4 \
2185 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2186
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -2174,10 +2174,12 @@
21742174
-DSQLITE_OMIT_DECLTYPE \
21752175
-DSQLITE_OMIT_DEPRECATED \
21762176
-DSQLITE_OMIT_PROGRESS_CALLBACK \
21772177
-DSQLITE_OMIT_SHARED_CACHE \
21782178
-DSQLITE_OMIT_LOAD_EXTENSION \
2179
+ -DSQLITE_MAX_EXPR_DEPTH=0 \
2180
+ -DSQLITE_USE_ALLOCA \
21792181
-DSQLITE_ENABLE_LOCKING_STYLE=0 \
21802182
-DSQLITE_DEFAULT_FILE_FORMAT=4 \
21812183
-DSQLITE_ENABLE_EXPLAIN_COMMENTS \
21822184
-DSQLITE_ENABLE_FTS4 \
21832185
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
21842186
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -2174,10 +2174,12 @@
2174 -DSQLITE_OMIT_DECLTYPE \
2175 -DSQLITE_OMIT_DEPRECATED \
2176 -DSQLITE_OMIT_PROGRESS_CALLBACK \
2177 -DSQLITE_OMIT_SHARED_CACHE \
2178 -DSQLITE_OMIT_LOAD_EXTENSION \
 
 
2179 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
2180 -DSQLITE_DEFAULT_FILE_FORMAT=4 \
2181 -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
2182 -DSQLITE_ENABLE_FTS4 \
2183 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2184
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -2174,10 +2174,12 @@
2174 -DSQLITE_OMIT_DECLTYPE \
2175 -DSQLITE_OMIT_DEPRECATED \
2176 -DSQLITE_OMIT_PROGRESS_CALLBACK \
2177 -DSQLITE_OMIT_SHARED_CACHE \
2178 -DSQLITE_OMIT_LOAD_EXTENSION \
2179 -DSQLITE_MAX_EXPR_DEPTH=0 \
2180 -DSQLITE_USE_ALLOCA \
2181 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
2182 -DSQLITE_DEFAULT_FILE_FORMAT=4 \
2183 -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
2184 -DSQLITE_ENABLE_FTS4 \
2185 -DSQLITE_ENABLE_FTS3_PARENTHESIS \
2186
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -321,10 +321,12 @@
321321
/DSQLITE_OMIT_DECLTYPE \
322322
/DSQLITE_OMIT_DEPRECATED \
323323
/DSQLITE_OMIT_PROGRESS_CALLBACK \
324324
/DSQLITE_OMIT_SHARED_CACHE \
325325
/DSQLITE_OMIT_LOAD_EXTENSION \
326
+ /DSQLITE_MAX_EXPR_DEPTH=0 \
327
+ /DSQLITE_USE_ALLOCA \
326328
/DSQLITE_ENABLE_LOCKING_STYLE=0 \
327329
/DSQLITE_DEFAULT_FILE_FORMAT=4 \
328330
/DSQLITE_ENABLE_EXPLAIN_COMMENTS \
329331
/DSQLITE_ENABLE_FTS4 \
330332
/DSQLITE_ENABLE_FTS3_PARENTHESIS \
331333
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -321,10 +321,12 @@
321 /DSQLITE_OMIT_DECLTYPE \
322 /DSQLITE_OMIT_DEPRECATED \
323 /DSQLITE_OMIT_PROGRESS_CALLBACK \
324 /DSQLITE_OMIT_SHARED_CACHE \
325 /DSQLITE_OMIT_LOAD_EXTENSION \
 
 
326 /DSQLITE_ENABLE_LOCKING_STYLE=0 \
327 /DSQLITE_DEFAULT_FILE_FORMAT=4 \
328 /DSQLITE_ENABLE_EXPLAIN_COMMENTS \
329 /DSQLITE_ENABLE_FTS4 \
330 /DSQLITE_ENABLE_FTS3_PARENTHESIS \
331
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -321,10 +321,12 @@
321 /DSQLITE_OMIT_DECLTYPE \
322 /DSQLITE_OMIT_DEPRECATED \
323 /DSQLITE_OMIT_PROGRESS_CALLBACK \
324 /DSQLITE_OMIT_SHARED_CACHE \
325 /DSQLITE_OMIT_LOAD_EXTENSION \
326 /DSQLITE_MAX_EXPR_DEPTH=0 \
327 /DSQLITE_USE_ALLOCA \
328 /DSQLITE_ENABLE_LOCKING_STYLE=0 \
329 /DSQLITE_DEFAULT_FILE_FORMAT=4 \
330 /DSQLITE_ENABLE_EXPLAIN_COMMENTS \
331 /DSQLITE_ENABLE_FTS4 \
332 /DSQLITE_ENABLE_FTS3_PARENTHESIS \
333
--- www/aboutcgi.wiki
+++ www/aboutcgi.wiki
@@ -131,11 +131,11 @@
131131
<li> [https://www.fossil-scm.org/fossil/info/c14ecc43]
132132
<li> [https://www.fossil-scm.org/fossil/info?name=c14ecc43]
133133
</ol>
134134
In both cases, the CGI script is called "/fossil". For case (A),
135135
the PATH_INFO variable will be "info/c14ecc43" and so the
136
-"[/help?cmd=/info]" webpage will be generated and the suffix of
136
+"[/help?cmd=/info|/info]" webpage will be generated and the suffix of
137137
PATH_INFO will be converted into the "name" query parameter, which
138138
identifies the artifact about which information is requested.
139139
In case (B), the PATH_INFO is just "info", but the same "name"
140140
query parameter is set explicitly by the URL itself.
141141
</blockquote>
142142
--- www/aboutcgi.wiki
+++ www/aboutcgi.wiki
@@ -131,11 +131,11 @@
131 <li> [https://www.fossil-scm.org/fossil/info/c14ecc43]
132 <li> [https://www.fossil-scm.org/fossil/info?name=c14ecc43]
133 </ol>
134 In both cases, the CGI script is called "/fossil". For case (A),
135 the PATH_INFO variable will be "info/c14ecc43" and so the
136 "[/help?cmd=/info]" webpage will be generated and the suffix of
137 PATH_INFO will be converted into the "name" query parameter, which
138 identifies the artifact about which information is requested.
139 In case (B), the PATH_INFO is just "info", but the same "name"
140 query parameter is set explicitly by the URL itself.
141 </blockquote>
142
--- www/aboutcgi.wiki
+++ www/aboutcgi.wiki
@@ -131,11 +131,11 @@
131 <li> [https://www.fossil-scm.org/fossil/info/c14ecc43]
132 <li> [https://www.fossil-scm.org/fossil/info?name=c14ecc43]
133 </ol>
134 In both cases, the CGI script is called "/fossil". For case (A),
135 the PATH_INFO variable will be "info/c14ecc43" and so the
136 "[/help?cmd=/info|/info]" webpage will be generated and the suffix of
137 PATH_INFO will be converted into the "name" query parameter, which
138 identifies the artifact about which information is requested.
139 In case (B), the PATH_INFO is just "info", but the same "name"
140 query parameter is set explicitly by the URL itself.
141 </blockquote>
142
--- www/changes.wiki
+++ www/changes.wiki
@@ -8,10 +8,13 @@
88
* The [/uv/download.html|download page] is moved into
99
[./unvers.wiki|unversioned content] so that the self-hosting Fossil
1010
websites no longer uses any external content.
1111
* Added the "Search" button to the graphical diff generated by
1212
the --tk option on the [/help?cmd=diff|diff] command.
13
+ * Added the "--checkin VERSION" option to the
14
+ [/help?cmd=diff|diff] command.
15
+ * Various performance enhancements to the [/help?cmd=diff|diff] command.
1316
* Update internal Unicode character tables, used in regular expression
1417
handling, from version 8.0 to 9.0.
1518
* Update the built-in SQLite to version 3.15 (beta). Fossil now requires
1619
the SQLITE_DBCONFIG_MAINDBNAME interface of SQLite which is only available
1720
in SQLite version 3.15 and later and so Fossil will not work with
1821
--- www/changes.wiki
+++ www/changes.wiki
@@ -8,10 +8,13 @@
8 * The [/uv/download.html|download page] is moved into
9 [./unvers.wiki|unversioned content] so that the self-hosting Fossil
10 websites no longer uses any external content.
11 * Added the "Search" button to the graphical diff generated by
12 the --tk option on the [/help?cmd=diff|diff] command.
 
 
 
13 * Update internal Unicode character tables, used in regular expression
14 handling, from version 8.0 to 9.0.
15 * Update the built-in SQLite to version 3.15 (beta). Fossil now requires
16 the SQLITE_DBCONFIG_MAINDBNAME interface of SQLite which is only available
17 in SQLite version 3.15 and later and so Fossil will not work with
18
--- www/changes.wiki
+++ www/changes.wiki
@@ -8,10 +8,13 @@
8 * The [/uv/download.html|download page] is moved into
9 [./unvers.wiki|unversioned content] so that the self-hosting Fossil
10 websites no longer uses any external content.
11 * Added the "Search" button to the graphical diff generated by
12 the --tk option on the [/help?cmd=diff|diff] command.
13 * Added the "--checkin VERSION" option to the
14 [/help?cmd=diff|diff] command.
15 * Various performance enhancements to the [/help?cmd=diff|diff] command.
16 * Update internal Unicode character tables, used in regular expression
17 handling, from version 8.0 to 9.0.
18 * Update the built-in SQLite to version 3.15 (beta). Fossil now requires
19 the SQLITE_DBCONFIG_MAINDBNAME interface of SQLite which is only available
20 in SQLite version 3.15 and later and so Fossil will not work with
21
--- www/concepts.wiki
+++ www/concepts.wiki
@@ -13,10 +13,15 @@
1313
to setup and operate.
1414
1515
This document is intended as a quick introduction to the concepts
1616
behind Fossil.
1717
18
+See also:
19
+
20
+ * [./whyusefossil.wiki#definitions|Definitions]
21
+ * [./quickstart.wiki|Quick start guide]
22
+
1823
<h2>2.0 Composition Of A Project</h2>
1924
<img src="concept1.gif" align="right" hspace="10">
2025
2126
A software project normally consists of a "source tree".
2227
A source tree is a hierarchy of files that are used to generate
2328
--- www/concepts.wiki
+++ www/concepts.wiki
@@ -13,10 +13,15 @@
13 to setup and operate.
14
15 This document is intended as a quick introduction to the concepts
16 behind Fossil.
17
 
 
 
 
 
18 <h2>2.0 Composition Of A Project</h2>
19 <img src="concept1.gif" align="right" hspace="10">
20
21 A software project normally consists of a "source tree".
22 A source tree is a hierarchy of files that are used to generate
23
--- www/concepts.wiki
+++ www/concepts.wiki
@@ -13,10 +13,15 @@
13 to setup and operate.
14
15 This document is intended as a quick introduction to the concepts
16 behind Fossil.
17
18 See also:
19
20 * [./whyusefossil.wiki#definitions|Definitions]
21 * [./quickstart.wiki|Quick start guide]
22
23 <h2>2.0 Composition Of A Project</h2>
24 <img src="concept1.gif" align="right" hspace="10">
25
26 A software project normally consists of a "source tree".
27 A source tree is a hierarchy of files that are used to generate
28
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -166,15 +166,15 @@
166166
text in the comment of the C-card. If the N-card is omitted, a default mimetype
167167
is used.
168168
169169
A manifest has zero or one P-cards. Most manifests have one P-card.
170170
The P-card has a varying number of arguments that
171
-defines other manifests from which the current manifest
172
-is derived. Each argument is an 40-character lowercase
173
-hexadecimal SHA1 of the predecessor manifest. All arguments
174
-to the P-card must be unique to that line.
175
-The first predecessor is the direct ancestor of the manifest.
171
+define other manifests from which the current manifest
172
+is derived. Each argument is a 40-character lowercase
173
+hexadecimal SHA1 of a predecessor manifest. All arguments
174
+to the P-card must be unique within that card.
175
+The first argument is the SHA1 of the direct ancestor of the manifest.
176176
Other arguments define manifests with which the first was
177177
merged to yield the current manifest. Most manifests have
178178
a P-card with a single argument. The first manifest in the
179179
project has no ancestors and thus has no P-card or (depending
180180
on the Fossil version) an empty P-card (no arguments).
@@ -199,11 +199,11 @@
199199
Older versions of Fossil will reject manifests that contain Q-cards.
200200
201201
A manifest may optionally have a single R-card. The R-card has
202202
a single argument which is the MD5 checksum of all files in
203203
the check-in except the manifest itself. The checksum is expressed
204
-as 32-characters of lowercase hexadecimal. The checksum is
204
+as 32 characters of lowercase hexadecimal. The checksum is
205205
computed as follows: For each file in the check-in (except for
206206
the manifest itself) in strict sorted lexicographical order,
207207
take the pathname of the file relative to the root of the
208208
repository, append a single space (ASCII 0x20), the
209209
size of the file in ASCII decimal, a single newline
@@ -246,11 +246,11 @@
246246
reduce network traffic. As such, clusters are an optimization and
247247
may be removed from a repository without loss or damage to the
248248
underlying project code.
249249
250250
Clusters follow a syntax that is very similar to manifests.
251
-A Cluster is a line-oriented text file. Newline characters
251
+A cluster is a line-oriented text file. Newline characters
252252
(ASCII 0x0a) separate the artifact into cards. Each card begins with a single
253253
character "card type". Zero or more arguments may follow
254254
the card type. All arguments are separated from each other
255255
and from the card-type character by a single space
256256
character. There is no surplus white space between arguments
@@ -268,12 +268,12 @@
268268
<b>M</b> <i>artifact-id</i><br />
269269
<b>Z</b> <i>checksum</i>
270270
</blockquote>
271271
272272
A cluster contains one or more "M" cards followed by a single "Z"
273
-line. Each M card has a single argument which is the artifact ID of
274
-another artifact in the repository. The Z card work exactly like
273
+card. Each M card has a single argument which is the artifact ID of
274
+another artifact in the repository. The Z card works exactly like
275275
the Z card of a manifest. The argument to the Z card is the
276276
lower-case hexadecimal representation of the MD5 checksum of all
277277
prior cards in the cluster. The Z-card is required.
278278
279279
An example cluster from Fossil can be seen
280280
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -166,15 +166,15 @@
166 text in the comment of the C-card. If the N-card is omitted, a default mimetype
167 is used.
168
169 A manifest has zero or one P-cards. Most manifests have one P-card.
170 The P-card has a varying number of arguments that
171 defines other manifests from which the current manifest
172 is derived. Each argument is an 40-character lowercase
173 hexadecimal SHA1 of the predecessor manifest. All arguments
174 to the P-card must be unique to that line.
175 The first predecessor is the direct ancestor of the manifest.
176 Other arguments define manifests with which the first was
177 merged to yield the current manifest. Most manifests have
178 a P-card with a single argument. The first manifest in the
179 project has no ancestors and thus has no P-card or (depending
180 on the Fossil version) an empty P-card (no arguments).
@@ -199,11 +199,11 @@
199 Older versions of Fossil will reject manifests that contain Q-cards.
200
201 A manifest may optionally have a single R-card. The R-card has
202 a single argument which is the MD5 checksum of all files in
203 the check-in except the manifest itself. The checksum is expressed
204 as 32-characters of lowercase hexadecimal. The checksum is
205 computed as follows: For each file in the check-in (except for
206 the manifest itself) in strict sorted lexicographical order,
207 take the pathname of the file relative to the root of the
208 repository, append a single space (ASCII 0x20), the
209 size of the file in ASCII decimal, a single newline
@@ -246,11 +246,11 @@
246 reduce network traffic. As such, clusters are an optimization and
247 may be removed from a repository without loss or damage to the
248 underlying project code.
249
250 Clusters follow a syntax that is very similar to manifests.
251 A Cluster is a line-oriented text file. Newline characters
252 (ASCII 0x0a) separate the artifact into cards. Each card begins with a single
253 character "card type". Zero or more arguments may follow
254 the card type. All arguments are separated from each other
255 and from the card-type character by a single space
256 character. There is no surplus white space between arguments
@@ -268,12 +268,12 @@
268 <b>M</b> <i>artifact-id</i><br />
269 <b>Z</b> <i>checksum</i>
270 </blockquote>
271
272 A cluster contains one or more "M" cards followed by a single "Z"
273 line. Each M card has a single argument which is the artifact ID of
274 another artifact in the repository. The Z card work exactly like
275 the Z card of a manifest. The argument to the Z card is the
276 lower-case hexadecimal representation of the MD5 checksum of all
277 prior cards in the cluster. The Z-card is required.
278
279 An example cluster from Fossil can be seen
280
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -166,15 +166,15 @@
166 text in the comment of the C-card. If the N-card is omitted, a default mimetype
167 is used.
168
169 A manifest has zero or one P-cards. Most manifests have one P-card.
170 The P-card has a varying number of arguments that
171 define other manifests from which the current manifest
172 is derived. Each argument is a 40-character lowercase
173 hexadecimal SHA1 of a predecessor manifest. All arguments
174 to the P-card must be unique within that card.
175 The first argument is the SHA1 of the direct ancestor of the manifest.
176 Other arguments define manifests with which the first was
177 merged to yield the current manifest. Most manifests have
178 a P-card with a single argument. The first manifest in the
179 project has no ancestors and thus has no P-card or (depending
180 on the Fossil version) an empty P-card (no arguments).
@@ -199,11 +199,11 @@
199 Older versions of Fossil will reject manifests that contain Q-cards.
200
201 A manifest may optionally have a single R-card. The R-card has
202 a single argument which is the MD5 checksum of all files in
203 the check-in except the manifest itself. The checksum is expressed
204 as 32 characters of lowercase hexadecimal. The checksum is
205 computed as follows: For each file in the check-in (except for
206 the manifest itself) in strict sorted lexicographical order,
207 take the pathname of the file relative to the root of the
208 repository, append a single space (ASCII 0x20), the
209 size of the file in ASCII decimal, a single newline
@@ -246,11 +246,11 @@
246 reduce network traffic. As such, clusters are an optimization and
247 may be removed from a repository without loss or damage to the
248 underlying project code.
249
250 Clusters follow a syntax that is very similar to manifests.
251 A cluster is a line-oriented text file. Newline characters
252 (ASCII 0x0a) separate the artifact into cards. Each card begins with a single
253 character "card type". Zero or more arguments may follow
254 the card type. All arguments are separated from each other
255 and from the card-type character by a single space
256 character. There is no surplus white space between arguments
@@ -268,12 +268,12 @@
268 <b>M</b> <i>artifact-id</i><br />
269 <b>Z</b> <i>checksum</i>
270 </blockquote>
271
272 A cluster contains one or more "M" cards followed by a single "Z"
273 card. Each M card has a single argument which is the artifact ID of
274 another artifact in the repository. The Z card works exactly like
275 the Z card of a manifest. The argument to the Z card is the
276 lower-case hexadecimal representation of the MD5 checksum of all
277 prior cards in the cluster. The Z-card is required.
278
279 An example cluster from Fossil can be seen
280
+1 -1
--- www/server.wiki
+++ www/server.wiki
@@ -39,11 +39,11 @@
3939
access these using URLs of the form <b>http://localhost:8080/</b>, or if
4040
<i>REPOSITORY</i> is a directory, URLs of the form
4141
<b>http://localhost:8080/</b><i>repo</i><b>/</b> where <i>repo</i> is the base
4242
name of the repository file without the ".fossil" suffix.
4343
The difference between "ui" and "server" is that "ui" will
44
-also start a web browser and points it
44
+also start a web browser and point it
4545
to the URL mentioned above, and the "ui" command binds to
4646
the loopback IP address (127.0.0.1) only so that the "ui" command cannot be
4747
used to serve content to a different machine.
4848
</p>
4949
<p>
5050
--- www/server.wiki
+++ www/server.wiki
@@ -39,11 +39,11 @@
39 access these using URLs of the form <b>http://localhost:8080/</b>, or if
40 <i>REPOSITORY</i> is a directory, URLs of the form
41 <b>http://localhost:8080/</b><i>repo</i><b>/</b> where <i>repo</i> is the base
42 name of the repository file without the ".fossil" suffix.
43 The difference between "ui" and "server" is that "ui" will
44 also start a web browser and points it
45 to the URL mentioned above, and the "ui" command binds to
46 the loopback IP address (127.0.0.1) only so that the "ui" command cannot be
47 used to serve content to a different machine.
48 </p>
49 <p>
50
--- www/server.wiki
+++ www/server.wiki
@@ -39,11 +39,11 @@
39 access these using URLs of the form <b>http://localhost:8080/</b>, or if
40 <i>REPOSITORY</i> is a directory, URLs of the form
41 <b>http://localhost:8080/</b><i>repo</i><b>/</b> where <i>repo</i> is the base
42 name of the repository file without the ".fossil" suffix.
43 The difference between "ui" and "server" is that "ui" will
44 also start a web browser and point it
45 to the URL mentioned above, and the "ui" command binds to
46 the loopback IP address (127.0.0.1) only so that the "ui" command cannot be
47 used to serve content to a different machine.
48 </p>
49 <p>
50
+3 -3
--- www/sync.wiki
+++ www/sync.wiki
@@ -220,11 +220,11 @@
220220
introduced to improve the speed of the transfer of content by sending the
221221
compressed artifact directly from the server database to the client.</p>
222222
223223
<p>Compressed File cards are similar to File cards, sharing the same
224224
in-line "payload" data characteristics and also the same treatment of
225
-direct content or delta content. It comes in two different formats
225
+direct content or delta content. Cfile cards come in two different formats
226226
depending on whether the artifact is sent directly or as a delta from
227227
some other artifact.</p>
228228
229229
<blockquote>
230230
<b>cfile</b> <i>artifact-id usize csize</i> <b>\n</b> <i>content</i><br>
@@ -277,11 +277,11 @@
277277
for the unversioned file, or "<b>-</b>" for deleted content.
278278
The <i>size</i> field is the (uncompressed) size of the content
279279
in bytes. The <i>flags</i> field is an integer which is interpreted
280280
as an array of bits. The 0x0004 bit of <i>flags</i> indicates that
281281
the <i>content</i> is to be omitted. The content might be omitted if
282
-it is too large to transmit, or if the send merely wants to update the
282
+it is too large to transmit, or if the sender merely wants to update the
283283
modification time of the file without changing the files content.
284284
The <i>content</i> is the (uncompressed) content of the file.
285285
286286
<p>The receiver should only accept the uvfile card if the hash and
287287
size match the content and if the mtime is newer than any existing
@@ -398,11 +398,11 @@
398398
identified by the first argument is private on the sender and should
399399
be ignored unless a "--private" [/help?cmd=sync|sync] is occurring.
400400
401401
<h4>3.6.1 Unversioned Igot Cards</h4>
402402
403
-<p>Zero or more "uvigot" cards are sent from client to server when
403
+<p>Zero or more "uvigot" cards are sent from server to client when
404404
synchronizing unversioned content. The format of a uvigot card is
405405
as follows:
406406
407407
<blockquote>
408408
<b>uvigot</b> <i>name mtime hash size</i>
409409
--- www/sync.wiki
+++ www/sync.wiki
@@ -220,11 +220,11 @@
220 introduced to improve the speed of the transfer of content by sending the
221 compressed artifact directly from the server database to the client.</p>
222
223 <p>Compressed File cards are similar to File cards, sharing the same
224 in-line "payload" data characteristics and also the same treatment of
225 direct content or delta content. It comes in two different formats
226 depending on whether the artifact is sent directly or as a delta from
227 some other artifact.</p>
228
229 <blockquote>
230 <b>cfile</b> <i>artifact-id usize csize</i> <b>\n</b> <i>content</i><br>
@@ -277,11 +277,11 @@
277 for the unversioned file, or "<b>-</b>" for deleted content.
278 The <i>size</i> field is the (uncompressed) size of the content
279 in bytes. The <i>flags</i> field is an integer which is interpreted
280 as an array of bits. The 0x0004 bit of <i>flags</i> indicates that
281 the <i>content</i> is to be omitted. The content might be omitted if
282 it is too large to transmit, or if the send merely wants to update the
283 modification time of the file without changing the files content.
284 The <i>content</i> is the (uncompressed) content of the file.
285
286 <p>The receiver should only accept the uvfile card if the hash and
287 size match the content and if the mtime is newer than any existing
@@ -398,11 +398,11 @@
398 identified by the first argument is private on the sender and should
399 be ignored unless a "--private" [/help?cmd=sync|sync] is occurring.
400
401 <h4>3.6.1 Unversioned Igot Cards</h4>
402
403 <p>Zero or more "uvigot" cards are sent from client to server when
404 synchronizing unversioned content. The format of a uvigot card is
405 as follows:
406
407 <blockquote>
408 <b>uvigot</b> <i>name mtime hash size</i>
409
--- www/sync.wiki
+++ www/sync.wiki
@@ -220,11 +220,11 @@
220 introduced to improve the speed of the transfer of content by sending the
221 compressed artifact directly from the server database to the client.</p>
222
223 <p>Compressed File cards are similar to File cards, sharing the same
224 in-line "payload" data characteristics and also the same treatment of
225 direct content or delta content. Cfile cards come in two different formats
226 depending on whether the artifact is sent directly or as a delta from
227 some other artifact.</p>
228
229 <blockquote>
230 <b>cfile</b> <i>artifact-id usize csize</i> <b>\n</b> <i>content</i><br>
@@ -277,11 +277,11 @@
277 for the unversioned file, or "<b>-</b>" for deleted content.
278 The <i>size</i> field is the (uncompressed) size of the content
279 in bytes. The <i>flags</i> field is an integer which is interpreted
280 as an array of bits. The 0x0004 bit of <i>flags</i> indicates that
281 the <i>content</i> is to be omitted. The content might be omitted if
282 it is too large to transmit, or if the sender merely wants to update the
283 modification time of the file without changing the files content.
284 The <i>content</i> is the (uncompressed) content of the file.
285
286 <p>The receiver should only accept the uvfile card if the hash and
287 size match the content and if the mtime is newer than any existing
@@ -398,11 +398,11 @@
398 identified by the first argument is private on the sender and should
399 be ignored unless a "--private" [/help?cmd=sync|sync] is occurring.
400
401 <h4>3.6.1 Unversioned Igot Cards</h4>
402
403 <p>Zero or more "uvigot" cards are sent from server to client when
404 synchronizing unversioned content. The format of a uvigot card is
405 as follows:
406
407 <blockquote>
408 <b>uvigot</b> <i>name mtime hash size</i>
409
--- www/whyusefossil.wiki
+++ www/whyusefossil.wiki
@@ -37,10 +37,11 @@
3737
<li>Failed disk-drives cause no loss of work
3838
<li>Avoid wasting time doing manual file copying
3939
<li>Avoid human errors during manual backups
4040
</ol>
4141
</ol>
42
+<a name='definitions'></a>
4243
<li><p><b>Definitions</b></p>
4344
<ul>
4445
<li><p><b>Project</b> &rarr;
4546
a collection of computer files that serve some common
4647
purpose. Often the project is a software application and the
@@ -59,12 +60,12 @@
5960
project that has files scattered hither and yon all over
6061
the disk. In other words, Fossil only works for projects
6162
where the files are laid out such that they can be archived
6263
into a ZIP file or tarball.
6364
</ul>
64
- <li><p><b>Repository</b>
65
- (also called "repo") &rarr; a single file that contains
65
+ <li><p><b>Repository</b> &rarr;
66
+ (also called "repo") a single file that contains
6667
all historical versions of all files in a project. A repo is similar
6768
to a ZIP archive in that it is a single file that stores compressed
6869
versions of many other files. Files can be extracted from the
6970
repo and new files can be added to the repo, just as with a ZIP
7071
archive. But a repo has other capabilities above and beyond
7172
--- www/whyusefossil.wiki
+++ www/whyusefossil.wiki
@@ -37,10 +37,11 @@
37 <li>Failed disk-drives cause no loss of work
38 <li>Avoid wasting time doing manual file copying
39 <li>Avoid human errors during manual backups
40 </ol>
41 </ol>
 
42 <li><p><b>Definitions</b></p>
43 <ul>
44 <li><p><b>Project</b> &rarr;
45 a collection of computer files that serve some common
46 purpose. Often the project is a software application and the
@@ -59,12 +60,12 @@
59 project that has files scattered hither and yon all over
60 the disk. In other words, Fossil only works for projects
61 where the files are laid out such that they can be archived
62 into a ZIP file or tarball.
63 </ul>
64 <li><p><b>Repository</b>
65 (also called "repo") &rarr; a single file that contains
66 all historical versions of all files in a project. A repo is similar
67 to a ZIP archive in that it is a single file that stores compressed
68 versions of many other files. Files can be extracted from the
69 repo and new files can be added to the repo, just as with a ZIP
70 archive. But a repo has other capabilities above and beyond
71
--- www/whyusefossil.wiki
+++ www/whyusefossil.wiki
@@ -37,10 +37,11 @@
37 <li>Failed disk-drives cause no loss of work
38 <li>Avoid wasting time doing manual file copying
39 <li>Avoid human errors during manual backups
40 </ol>
41 </ol>
42 <a name='definitions'></a>
43 <li><p><b>Definitions</b></p>
44 <ul>
45 <li><p><b>Project</b> &rarr;
46 a collection of computer files that serve some common
47 purpose. Often the project is a software application and the
@@ -59,12 +60,12 @@
60 project that has files scattered hither and yon all over
61 the disk. In other words, Fossil only works for projects
62 where the files are laid out such that they can be archived
63 into a ZIP file or tarball.
64 </ul>
65 <li><p><b>Repository</b> &rarr;
66 (also called "repo") a single file that contains
67 all historical versions of all files in a project. A repo is similar
68 to a ZIP archive in that it is a single file that stores compressed
69 versions of many other files. Files can be extracted from the
70 repo and new files can be added to the repo, just as with a ZIP
71 archive. But a repo has other capabilities above and beyond
72

Keyboard Shortcuts

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