Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Merge updates from trunk. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | seeEnhanced |
| Files: | files | file ages | folders |
| SHA1: |
04a8ee6ec25315c0c6a937d628ea9077 |
| User & Date: | mistachkin 2016-10-04 19:07:13.653 |
Context
|
2016-10-04
| ||
| 19:17 | Coding style tweaks. Closed-Leaf check-in: 34d988c244 user: mistachkin tags: seeEnhanced | |
| 19:07 | Merge updates from trunk. check-in: 04a8ee6ec2 user: mistachkin tags: seeEnhanced | |
| 19:06 | Fix harmless compiler warnings. check-in: 3f06618c96 user: mistachkin tags: trunk | |
| 19:05 | Add an assert(). check-in: e6a5634f24 user: mistachkin tags: seeEnhanced | |
Changes
Changes to skins/blitz/footer.txt.
1 2 3 4 5 |
</div> <!-- end div container -->
</div> <!-- end div middle max-full-width -->
<div class="footer">
<div class="container">
<div class="pull-right">
| | | 1 2 3 4 5 6 7 8 9 10 11 12 |
</div> <!-- end div container -->
</div> <!-- end div middle max-full-width -->
<div class="footer">
<div class="container">
<div class="pull-right">
<a href="https://www.fossil-scm.org/">Fossil $release_version $manifest_version $manifest_date</a>
</div>
This page was generated in about <th1>puts [expr {([utime]+[stime]+1000)/1000*0.001}]</th1>s
</div>
</div>
</body>
</html>
|
Changes to skins/blitz_no_logo/footer.txt.
1 2 3 4 5 |
</div> <!-- end div container -->
</div> <!-- end div middle max-full-width -->
<div class="footer">
<div class="container">
<div class="pull-right">
| | | 1 2 3 4 5 6 7 8 9 10 11 12 |
</div> <!-- end div container -->
</div> <!-- end div middle max-full-width -->
<div class="footer">
<div class="container">
<div class="pull-right">
<a href="https://www.fossil-scm.org/">Fossil $release_version $manifest_version $manifest_date</a>
</div>
This page was generated in about <th1>puts [expr {([utime]+[stime]+1000)/1000*0.001}]</th1>s
</div>
</div>
</body>
</html>
|
Changes to skins/eagle/footer.txt.
1 2 3 4 |
<div class="footer">
<th1>
proc getTclVersion {} {
if {[catch {tclEval info patchlevel} tclVersion] == 0} {
| | | 1 2 3 4 5 6 7 8 9 10 11 12 |
<div class="footer">
<th1>
proc getTclVersion {} {
if {[catch {tclEval info patchlevel} tclVersion] == 0} {
return "<a href=\"https://www.tcl.tk/\">Tcl</a> version $tclVersion"
}
return ""
}
proc getVersion { version } {
set length [string length $version]
return [string range $version 1 [expr {$length - 2}]]
}
|
| ︙ | ︙ |
Changes to skins/enhanced1/footer.txt.
1 2 3 4 |
<div class="footer">
<th1>
proc getTclVersion {} {
if {[catch {tclEval info patchlevel} tclVersion] == 0} {
| | | 1 2 3 4 5 6 7 8 9 10 11 12 |
<div class="footer">
<th1>
proc getTclVersion {} {
if {[catch {tclEval info patchlevel} tclVersion] == 0} {
return "<a href=\"https://www.tcl.tk/\">Tcl</a> version $tclVersion"
}
return ""
}
proc getVersion { version } {
set length [string length $version]
return [string range $version 1 [expr {$length - 2}]]
}
|
| ︙ | ︙ |
Changes to src/add.c.
| ︙ | ︙ | |||
69 70 71 72 73 74 75 |
** entries should be removed. 2012-02-04 */
".fos",
".fos-journal",
".fos-wal",
".fos-shm",
};
| | | | > > > | | > > > > | > > > > > > | | | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
** entries should be removed. 2012-02-04 */
".fos",
".fos-journal",
".fos-wal",
".fos-shm",
};
/* Possible names of auxiliary files generated when the "manifest" property
** is used
*/
static const struct {
const char *fname;
int flg;
}aManifestflags[] = {
{ "manifest", MFESTFLG_RAW },
{ "manifest.uuid", MFESTFLG_UUID },
{ "manifest.tags", MFESTFLG_TAGS }
};
static const char *azManifests[3];
/*
** Names of repository files, if they exist in the checkout.
*/
static const char *azRepo[4] = { 0, 0, 0, 0 };
/* Cached setting "manifest" */
static int cachedManifest = -1;
static int numManifests;
if( cachedManifest == -1 ){
int i;
Blob repo;
cachedManifest = db_get_manifest_setting();
numManifests = 0;
for(i=0; i<count(aManifestflags); i++){
if( cachedManifest&aManifestflags[i].flg ) {
azManifests[numManifests++] = aManifestflags[i].fname;
}
}
blob_zero(&repo);
if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
const char *zRepo = blob_str(&repo);
azRepo[0] = zRepo;
azRepo[1] = mprintf("%s-journal", zRepo);
azRepo[2] = mprintf("%s-wal", zRepo);
azRepo[3] = mprintf("%s-shm", zRepo);
}
}
if( N<0 ) return 0;
if( N<count(azName) ) return azName[N];
N -= count(azName);
if( cachedManifest ){
if( N<numManifests ) return azManifests[N];
N -= numManifests;
}
if( !omitRepo && N<count(azRepo) ) return azRepo[N];
return 0;
}
/*
** Return a list of all reserved filenames as an SQL list.
|
| ︙ | ︙ |
Changes to src/allrepo.c.
| ︙ | ︙ | |||
373 374 375 376 377 378 379 |
"INSERT INTO repolist "
"SELECT DISTINCT substr(name, 6), name COLLATE nocase"
" FROM global_config"
" WHERE substr(name, 1, 5)=='repo:'"
" ORDER BY 1"
);
}
| | | | 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
"INSERT INTO repolist "
"SELECT DISTINCT substr(name, 6), name COLLATE nocase"
" FROM global_config"
" WHERE substr(name, 1, 5)=='repo:'"
" ORDER BY 1"
);
}
db_multi_exec("CREATE TEMP TABLE toDel(x TEXT)");
db_prepare(&q, "SELECT name, tag FROM repolist ORDER BY 1");
while( db_step(&q)==SQLITE_ROW ){
const char *zFilename = db_column_text(&q, 0);
#if !USE_SEE
if( sqlite3_strglob("*.efossil", zFilename)==0 ) continue;
#endif
if( file_access(zFilename, F_OK)
|| !file_is_canonical(zFilename)
|| (useCheckouts && file_isdir(zFilename)!=1)
){
db_multi_exec("INSERT INTO toDel VALUES(%Q)", db_column_text(&q, 1));
nToDel++;
continue;
}
if( zCmd[0]=='l' ){
fossil_print("%s\n", zFilename);
continue;
}else if( showFile ){
|
| ︙ | ︙ |
Changes to src/checkin.c.
| ︙ | ︙ | |||
1464 1465 1466 1467 1468 1469 1470 | ** is seen in a text file. ** ** Return 1 if the user pressed 'c'. In that case, the file will have ** been converted to UTF-8 (if it was UTF-16) with NL line-endings, ** and the original file will have been renamed to "<filename>-original". */ static int commit_warning( | | | | | | | > | | | | | | 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 |
** is seen in a text file.
**
** Return 1 if the user pressed 'c'. In that case, the file will have
** been converted to UTF-8 (if it was UTF-16) with NL line-endings,
** and the original file will have been renamed to "<filename>-original".
*/
static int commit_warning(
Blob *pContent, /* The content of the file being committed. */
int crnlOk, /* Non-zero if CR/NL warnings should be disabled. */
int binOk, /* Non-zero if binary warnings should be disabled. */
int encodingOk, /* Non-zero if encoding warnings should be disabled. */
int noPrompt, /* 0 to always prompt, 1 for 'N', 2 for 'Y'. */
const char *zFilename, /* The full name of the file being committed. */
Blob *pReason /* Reason for warning, if any (non-fatal only). */
){
int bReverse; /* UTF-16 byte order is reversed? */
int fUnicode; /* return value of could_be_utf16() */
int fBinary; /* does the blob content appear to be binary? */
int lookFlags; /* output flags from looks_like_utf8/utf16() */
int fHasAnyCr; /* the blob contains one or more CR chars */
int fHasLoneCrOnly; /* all detected line endings are CR only */
int fHasCrLfOnly; /* all detected line endings are CR/LF pairs */
int fHasInvalidUtf8 = 0;/* contains invalid UTF-8 */
char *zMsg; /* Warning message */
Blob fname; /* Relative pathname of the file */
static int allOk = 0; /* Set to true to disable this routine */
if( allOk ) return 0;
fUnicode = could_be_utf16(pContent, &bReverse);
if( fUnicode ){
lookFlags = looks_like_utf16(pContent, bReverse, LOOK_NUL);
}else{
lookFlags = looks_like_utf8(pContent, LOOK_NUL);
if( !(lookFlags & LOOK_BINARY) && invalid_utf8(pContent) ){
fHasInvalidUtf8 = 1;
}
}
fHasAnyCr = (lookFlags & LOOK_CR);
fBinary = (lookFlags & LOOK_BINARY);
fHasLoneCrOnly = ((lookFlags & LOOK_EOL) == LOOK_LONE_CR);
fHasCrLfOnly = ((lookFlags & LOOK_EOL) == LOOK_CRLF);
if( fUnicode || fHasAnyCr || fBinary || fHasInvalidUtf8 ){
const char *zWarning;
const char *zDisable;
const char *zConvert = "c=convert/";
Blob ans;
char cReply;
if( fBinary ){
|
| ︙ | ︙ | |||
1561 1562 1563 1564 1565 1566 1567 |
}
file_relative_name(zFilename, &fname, 0);
zMsg = mprintf(
"%s contains %s. Use --no-warnings or the %s to"
" disable this warning.\n"
"Commit anyhow (a=all/%sy/N)? ",
blob_str(&fname), zWarning, zDisable, zConvert);
| | > > | | | | | > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 |
}
file_relative_name(zFilename, &fname, 0);
zMsg = mprintf(
"%s contains %s. Use --no-warnings or the %s to"
" disable this warning.\n"
"Commit anyhow (a=all/%sy/N)? ",
blob_str(&fname), zWarning, zDisable, zConvert);
if( noPrompt==0 ){
prompt_user(zMsg, &ans);
cReply = blob_str(&ans)[0];
blob_reset(&ans);
}else if( noPrompt==2 ){
cReply = 'Y';
}else{
cReply = 'N';
}
fossil_free(zMsg);
if( cReply=='a' || cReply=='A' ){
allOk = 1;
}else if( *zConvert && (cReply=='c' || cReply=='C') ){
char *zOrig = file_newname(zFilename, "original", 1);
FILE *f;
blob_write_to_file(pContent, zOrig);
fossil_free(zOrig);
f = fossil_fopen(zFilename, "wb");
if( f==0 ){
fossil_warning("cannot open %s for writing", zFilename);
}else{
if( fUnicode ){
int bomSize;
const unsigned char *bom = get_utf8_bom(&bomSize);
fwrite(bom, 1, bomSize, f);
blob_to_utf8_no_bom(pContent, 0);
}else if( fHasInvalidUtf8 ){
blob_cp1252_to_utf8(pContent);
}
if( fHasAnyCr ){
blob_to_lf_only(pContent);
}
fwrite(blob_buffer(pContent), 1, blob_size(pContent), f);
fclose(f);
}
return 1;
}else if( cReply!='y' && cReply!='Y' ){
fossil_fatal("Abandoning commit due to %s in %s",
zWarning, blob_str(&fname));
}else if( noPrompt==2 ){
if( pReason ){
blob_append(pReason, zWarning, -1);
}
return 1;
}
blob_reset(&fname);
}
return 0;
}
/*
** COMMAND: test-commit-warning
**
** Usage: %fossil test-commit-warning ?OPTIONS?
**
** Check each file in the checkout, including unmodified ones, using all
** the pre-commit checks.
**
** Options:
** --no-settings Do not consider any glob settings.
** -v|--verbose Show per-file results for all pre-commit checks.
**
** See also: commit, extras
*/
void test_commit_warning(void){
int rc = 0;
int noSettings;
int verboseFlag;
Stmt q;
noSettings = find_option("no-settings",0,0)!=0;
verboseFlag = find_option("verbose","v",0)!=0;
verify_all_options();
db_must_be_within_tree();
db_prepare(&q,
"SELECT %Q || pathname, pathname, %s, %s, %s FROM vfile"
" WHERE NOT deleted",
g.zLocalRoot,
glob_expr("pathname", noSettings ? 0 : db_get("crnl-glob","")),
glob_expr("pathname", noSettings ? 0 : db_get("binary-glob","")),
glob_expr("pathname", noSettings ? 0 : db_get("encoding-glob",""))
);
while( db_step(&q)==SQLITE_ROW ){
const char *zFullname;
const char *zName;
Blob content;
Blob reason;
int crnlOk, binOk, encodingOk;
int fileRc;
zFullname = db_column_text(&q, 0);
zName = db_column_text(&q, 1);
crnlOk = db_column_int(&q, 2);
binOk = db_column_int(&q, 3);
encodingOk = db_column_int(&q, 4);
blob_zero(&content);
if( file_wd_islink(zFullname) ){
blob_read_link(&content, zFullname);
}else{
blob_read_from_file(&content, zFullname);
}
blob_zero(&reason);
fileRc = commit_warning(&content, crnlOk, binOk, encodingOk, 2,
zFullname, &reason);
if( fileRc || verboseFlag ){
fossil_print("%d\t%s\t%s\n", fileRc, zName, blob_str(&reason));
}
blob_reset(&reason);
rc |= fileRc;
}
db_finalize(&q);
fossil_print("%d\n", rc);
}
/*
** qsort() comparison routine for an array of pointers to strings.
*/
static int tagCmp(const void *a, const void *b){
char **pA = (char**)a;
char **pB = (char**)b;
|
| ︙ | ︙ | |||
1796 1797 1798 1799 1800 1801 1802 |
}
sCiInfo.zDateOvrd = find_option("date-override",0,1);
sCiInfo.zUserOvrd = find_option("user-override",0,1);
db_must_be_within_tree();
noSign = db_get_boolean("omitsign", 0)|noSign;
if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
useCksum = db_get_boolean("repo-cksum", 1);
| | | 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 |
}
sCiInfo.zDateOvrd = find_option("date-override",0,1);
sCiInfo.zUserOvrd = find_option("user-override",0,1);
db_must_be_within_tree();
noSign = db_get_boolean("omitsign", 0)|noSign;
if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
useCksum = db_get_boolean("repo-cksum", 1);
outputManifest = db_get_manifest_setting();
verify_all_options();
/* Escape special characters in tags and put all tags in sorted order */
if( nTag ){
int i;
for(i=0; i<nTag; i++) sCiInfo.azTag[i] = mprintf("%F", sCiInfo.azTag[i]);
qsort((void*)sCiInfo.azTag, nTag, sizeof(sCiInfo.azTag[0]), tagCmp);
|
| ︙ | ︙ | |||
2054 2055 2056 2057 2058 2059 2060 |
}else{
blob_read_from_file(&content, zFullname);
}
/* Do not emit any warnings when they are disabled. */
if( !noWarningFlag ){
abortCommit |= commit_warning(&content, crnlOk, binOk,
encodingOk, noPrompt,
| | | 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 |
}else{
blob_read_from_file(&content, zFullname);
}
/* Do not emit any warnings when they are disabled. */
if( !noWarningFlag ){
abortCommit |= commit_warning(&content, crnlOk, binOk,
encodingOk, noPrompt,
zFullname, 0);
}
if( contains_merge_marker(&content) ){
Blob fname; /* Relative pathname of the file */
nConflict++;
file_relative_name(zFullname, &fname, 0);
fossil_print("possible unresolved merge conflict in %s\n",
|
| ︙ | ︙ | |||
2157 2158 2159 2160 2161 2162 2163 |
/* If the -n|--dry-run option is specified, output the manifest file
** and rollback the transaction.
*/
if( dryRunFlag ){
blob_write_to_file(&manifest, "");
}
| | | 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 |
/* If the -n|--dry-run option is specified, output the manifest file
** and rollback the transaction.
*/
if( dryRunFlag ){
blob_write_to_file(&manifest, "");
}
if( outputManifest & MFESTFLG_RAW ){
zManifestFile = mprintf("%smanifest", g.zLocalRoot);
blob_write_to_file(&manifest, zManifestFile);
blob_reset(&manifest);
blob_read_from_file(&manifest, zManifestFile);
free(zManifestFile);
}
|
| ︙ | ︙ | |||
2191 2192 2193 2194 2195 2196 2197 |
}else{
fossil_print("Not_Closed: %s (not a leaf any more)\n", zIntegrateUuid);
}
}
db_finalize(&q);
fossil_print("New_Version: %s\n", zUuid);
| | | 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 |
}else{
fossil_print("Not_Closed: %s (not a leaf any more)\n", zIntegrateUuid);
}
}
db_finalize(&q);
fossil_print("New_Version: %s\n", zUuid);
if( outputManifest & MFESTFLG_UUID ){
zManifestFile = mprintf("%smanifest.uuid", g.zLocalRoot);
blob_zero(&muuid);
blob_appendf(&muuid, "%s\n", zUuid);
blob_write_to_file(&muuid, zManifestFile);
free(zManifestFile);
blob_reset(&muuid);
}
|
| ︙ | ︙ | |||
2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 |
db_multi_exec("PRAGMA repository.application_id=252006673;");
db_multi_exec("PRAGMA localdb.application_id=252006674;");
if( dryRunFlag ){
db_end_transaction(1);
exit(1);
}
db_end_transaction(0);
if( !g.markPrivate ){
autosync_loop(SYNC_PUSH|SYNC_PULL, db_get_int("autosync-tries", 1), 0);
}
if( count_nonbranch_children(vid)>1 ){
fossil_print("**** warning: a fork has occurred *****\n");
}
}
| > > > > > > > > > > | 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 |
db_multi_exec("PRAGMA repository.application_id=252006673;");
db_multi_exec("PRAGMA localdb.application_id=252006674;");
if( dryRunFlag ){
db_end_transaction(1);
exit(1);
}
db_end_transaction(0);
if( outputManifest & MFESTFLG_TAGS ){
Blob tagslist;
zManifestFile = mprintf("%smanifest.tags", g.zLocalRoot);
blob_zero(&tagslist);
get_checkin_taglist(nvid, &tagslist);
blob_write_to_file(&tagslist, zManifestFile);
blob_reset(&tagslist);
free(zManifestFile);
}
if( !g.markPrivate ){
autosync_loop(SYNC_PUSH|SYNC_PULL, db_get_int("autosync-tries", 1), 0);
}
if( count_nonbranch_children(vid)>1 ){
fossil_print("**** warning: a fork has occurred *****\n");
}
}
|
Changes to src/checkout.c.
| ︙ | ︙ | |||
125 126 127 128 129 130 131 132 133 134 135 136 137 |
}
/*
** If the "manifest" setting is true, then automatically generate
** files named "manifest" and "manifest.uuid" containing, respectively,
** the text of the manifest and the artifact ID of the manifest.
*/
void manifest_to_disk(int vid){
char *zManFile;
Blob manifest;
Blob hash;
| > > > > > > | > < < > | | < | < > > > > > > > > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
}
/*
** If the "manifest" setting is true, then automatically generate
** files named "manifest" and "manifest.uuid" containing, respectively,
** the text of the manifest and the artifact ID of the manifest.
** If the manifest setting is set, but is not a boolean value, then treat
** each character as a flag to enable writing "manifest", "manifest.uuid" or
** "manifest.tags".
*/
void manifest_to_disk(int vid){
char *zManFile;
Blob manifest;
Blob hash;
Blob taglist;
int flg;
flg = db_get_manifest_setting();
if( flg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
blob_zero(&manifest);
content_get(vid, &manifest);
blob_zero(&hash);
sha1sum_blob(&manifest, &hash);
sterilize_manifest(&manifest);
}
if( flg & MFESTFLG_RAW ){
zManFile = mprintf("%smanifest", g.zLocalRoot);
blob_write_to_file(&manifest, zManFile);
free(zManFile);
}else{
if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest'") ){
zManFile = mprintf("%smanifest", g.zLocalRoot);
file_delete(zManFile);
free(zManFile);
}
}
if( flg & MFESTFLG_UUID ){
zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
blob_append(&hash, "\n", 1);
blob_write_to_file(&hash, zManFile);
free(zManFile);
blob_reset(&hash);
}else{
if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.uuid'") ){
zManFile = mprintf("%smanifest.uuid", g.zLocalRoot);
file_delete(zManFile);
free(zManFile);
}
}
if( flg & MFESTFLG_TAGS ){
blob_zero(&taglist);
zManFile = mprintf("%smanifest.tags", g.zLocalRoot);
get_checkin_taglist(vid, &taglist);
blob_write_to_file(&taglist, zManFile);
free(zManFile);
blob_reset(&taglist);
}else{
if( !db_exists("SELECT 1 FROM vfile WHERE pathname='manifest.tags'") ){
zManFile = mprintf("%smanifest.tags", g.zLocalRoot);
file_delete(zManFile);
free(zManFile);
}
}
}
/*
** Find the branch name and all symbolic tags for a particular check-in
** identified by "rid".
**
** The branch name is actually only extracted if this procedure is run
** from within a local check-out. And the branch name is not the branch
** name for "rid" but rather the branch name for the current check-out.
** It is unclear if the rid parameter is always the same as the current
** check-out.
*/
void get_checkin_taglist(int rid, Blob *pOut){
Stmt stmt;
char *zCurrent;
blob_reset(pOut);
zCurrent = db_text(0, "SELECT value FROM tagxref"
" WHERE rid=%d AND tagid=%d", rid, TAG_BRANCH);
blob_appendf(pOut, "branch %s\n", zCurrent);
db_prepare(&stmt, "SELECT substr(tagname, 5)"
" FROM tagxref, tag"
" WHERE tagxref.rid=%d"
" AND tagxref.tagtype>0"
" AND tag.tagid=tagxref.tagid"
" AND tag.tagname GLOB 'sym-*'", rid);
while( db_step(&stmt)==SQLITE_ROW ){
const char *zName;
zName = db_column_text(&stmt, 0);
blob_appendf(pOut, "tag %s\n", zName);
}
db_reset(&stmt);
db_finalize(&stmt);
}
/*
** COMMAND: checkout*
** COMMAND: co*
**
** Usage: %fossil checkout ?VERSION | --latest? ?OPTIONS?
** or: %fossil co ?VERSION | --latest? ?OPTIONS?
|
| ︙ | ︙ |
Changes to src/db.c.
| ︙ | ︙ | |||
2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 |
}
int db_lget_int(const char *zName, int dflt){
return db_int(dflt, "SELECT value FROM vvar WHERE name=%Q", zName);
}
void db_lset_int(const char *zName, int value){
db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value);
}
/*
** Record the name of a local repository in the global_config() database.
** The repository filename %s is recorded as an entry with a "name" field
** of the following form:
**
** repo:%s
| > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 |
}
int db_lget_int(const char *zName, int dflt){
return db_int(dflt, "SELECT value FROM vvar WHERE name=%Q", zName);
}
void db_lset_int(const char *zName, int value){
db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value);
}
#if INTERFACE
/* Manifest generation flags */
#define MFESTFLG_RAW 0x01
#define MFESTFLG_UUID 0x02
#define MFESTFLG_TAGS 0x04
#endif /* INTERFACE */
/*
** Get the manifest setting. For backwards compatibility first check if the
** value is a boolean. If it's not a boolean, treat each character as a flag
** to enable a manifest type. This system puts certain boundary conditions on
** which letters can be used to represent flags (any permutation of flags must
** not be able to fully form one of the boolean values).
*/
int db_get_manifest_setting(void){
int flg;
char *zNVVal = db_get("manifest", "off");
char *zVal = db_get_versioned("manifest", zNVVal);
if( is_false(zVal) ){
return 0;
}else if( is_truth(zVal) ) {
return MFESTFLG_RAW|MFESTFLG_UUID;
}
flg = 0;
while( *zVal ){
switch( *zVal ){
case 'r': flg |= MFESTFLG_RAW; break;
case 'u': flg |= MFESTFLG_UUID; break;
case 't': flg |= MFESTFLG_TAGS; break;
}
zVal++;
}
return flg;
}
/*
** Record the name of a local repository in the global_config() database.
** The repository filename %s is recorded as an entry with a "name" field
** of the following form:
**
** repo:%s
|
| ︙ | ︙ | |||
2657 2658 2659 2660 2661 2662 2663 |
{ "hash-digits", 0, 5, 0, 0, "10" },
{ "http-port", 0, 16, 0, 0, "8080" },
{ "https-login", 0, 0, 0, 0, "off" },
{ "ignore-glob", 0, 40, 1, 0, "" },
{ "keep-glob", 0, 40, 1, 0, "" },
{ "localauth", 0, 0, 0, 0, "off" },
{ "main-branch", 0, 40, 0, 0, "trunk" },
| | | 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 |
{ "hash-digits", 0, 5, 0, 0, "10" },
{ "http-port", 0, 16, 0, 0, "8080" },
{ "https-login", 0, 0, 0, 0, "off" },
{ "ignore-glob", 0, 40, 1, 0, "" },
{ "keep-glob", 0, 40, 1, 0, "" },
{ "localauth", 0, 0, 0, 0, "off" },
{ "main-branch", 0, 40, 0, 0, "trunk" },
{ "manifest", 0, 5, 0, 0, "off" },
{ "max-loadavg", 0, 25, 0, 0, "0.0" },
{ "max-upload", 0, 25, 0, 0, "250000" },
{ "mtime-changes", 0, 0, 0, 0, "on" },
#if FOSSIL_ENABLE_LEGACY_MV_RM
{ "mv-rm-files", 0, 0, 0, 0, "off" },
#endif
{ "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " },
|
| ︙ | ︙ | |||
2862 2863 2864 2865 2866 2867 2868 | ** localauth If enabled, require that HTTP connections from ** 127.0.0.1 be authenticated by password. If ** false, all HTTP requests from localhost have ** unrestricted access to the repository. ** ** main-branch The primary branch for the project. Default: trunk ** | | | > > > | | 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 | ** localauth If enabled, require that HTTP connections from ** 127.0.0.1 be authenticated by password. If ** false, all HTTP requests from localhost have ** unrestricted access to the repository. ** ** main-branch The primary branch for the project. Default: trunk ** ** manifest If set to a true boolean value, automatically create ** (versionable) files "manifest" and "manifest.uuid" in every checkout. ** Optionally use combinations of characters 'r' ** for "manifest", 'u' for "manifest.uuid" and 't' for ** "manifest.tags". The SQLite and Fossil repositories ** both require manifests. Default: off. ** ** max-loadavg Some CPU-intensive web pages (ex: /zip, /tarball, /blame) ** are disallowed if the system load average goes above this ** value. "0.0" means no limit. This only works on unix. ** Only local settings of this value make a difference since ** when running as a web-server, Fossil does not open the ** global configuration database. |
| ︙ | ︙ |
Changes to src/diff.c.
| ︙ | ︙ | |||
135 136 137 138 139 140 141 |
*/
static DLine *break_into_lines(
const char *z,
int n,
int *pnLine,
u64 diffFlags
){
| | > | | | < < < < | | < < > | < < < < | | | | | > > > > > > > > | < < < | | > | > | < > > > | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
*/
static DLine *break_into_lines(
const char *z,
int n,
int *pnLine,
u64 diffFlags
){
int nLine, i, k, nn, s, x;
unsigned int h, h2;
DLine *a;
const char *zNL, *z2;
/* Count the number of lines in the input file. Include the last line
** in the count even if it lacks the \n terminator
*/
for(nLine=0, z2=z; (zNL = strchr(z2,'\n'))!=0; z2=zNL+1, nLine++){}
if( z2[0]!=0 ){
nLine++;
do{ z2++; }while( z2[0] );
}
if( n!=(int)(z2-z) ) return 0;
a = fossil_malloc( sizeof(a[0])*nLine );
memset(a, 0, sizeof(a[0])*nLine);
if( nLine==0 ){
*pnLine = 0;
return a;
}
i = 0;
do{
zNL = strchr(z,'\n');
if( zNL==0 ) zNL = z+strlen(z);
nn = (int)(zNL - z);
if( nn>LENGTH_MASK ){
fossil_free(a);
return 0;
}
a[i].z = z;
k = nn;
if( diffFlags & DIFF_STRIP_EOLCR ){
if( k>0 && z[k-1]=='\r' ){ k--; }
}
a[i].n = k;
s = 0;
if( diffFlags & DIFF_IGNORE_EOLWS ){
while( k>0 && fossil_isspace(z[k-1]) ){ k--; }
}
if( (diffFlags & DIFF_IGNORE_ALLWS)==DIFF_IGNORE_ALLWS ){
int numws = 0;
while( s<k && fossil_isspace(z[s]) ){ s++; }
for(h=0, x=s; x<k; x++){
if( fossil_isspace(z[x]) ){
++numws;
}else{
h += z[x];
h *= 0x9e3779b1;
}
}
k -= numws;
}else{
for(h=0, x=s; x<k; x++){
h += z[x];
h *= 0x9e3779b1;
}
}
a[i].indent = s;
a[i].h = h = (h<<LENGTH_MASK_SZ) | (k-s);
h2 = h % nLine;
a[i].iNext = a[h2].iHash;
a[h2].iHash = i+1;
z += nn+1;
i++;
}while( zNL[0] && zNL[1] );
assert( i==nLine );
/* Return results */
*pnLine = nLine;
return a;
}
/*
|
| ︙ | ︙ | |||
961 962 963 964 965 966 967 |
while( nB>0 && fossil_isspace(zB[0]) ){ nB--; zB++; }
while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; }
if( nA>250 ) nA = 250;
if( nB>250 ) nB = 250;
avg = (nA+nB)/2;
if( avg==0 ) return 0;
if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0;
| | | | | 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 |
while( nB>0 && fossil_isspace(zB[0]) ){ nB--; zB++; }
while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; }
if( nA>250 ) nA = 250;
if( nB>250 ) nB = 250;
avg = (nA+nB)/2;
if( avg==0 ) return 0;
if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0;
memset(aFirst, 0xff, sizeof(aFirst));
zA--; zB--; /* Make both zA[] and zB[] 1-indexed */
for(i=nB; i>0; i--){
c = (unsigned char)zB[i];
aNext[i] = aFirst[c];
aFirst[c] = i;
}
best = 0;
for(i=1; i<=nA-best; i++){
c = (unsigned char)zA[i];
for(j=aFirst[c]; j<nB-best && memcmp(&zA[i],&zB[j],best)==0; j = aNext[j]){
int limit = minInt(nA-i, nB-j);
for(k=best; k<=limit && zA[k+i]==zB[k+j]; k++){}
if( k>best ) best = k;
}
}
score = (best>avg) ? 0 : (avg - best)*100/avg;
#if 0
fprintf(stderr, "A: [%.*s]\nB: [%.*s]\nbest=%d avg=%d score=%d\n",
|
| ︙ | ︙ |
Changes to src/diffcmd.c.
| ︙ | ︙ | |||
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 | ** the source check-in for the diff operation. If not specified, the ** source check-in is the base check-in for the current check-out. ** ** If the "--to VERSION" option appears, it specifies the check-in from ** which the second version of the file or files is taken. If there is ** no "--to" option then the (possibly edited) files in the current check-out ** are used. ** ** The "-i" command-line option forces the use of the internal diff logic ** rather than any external diff program that might be configured using ** the "setting" command. If no external diff program is configured, then ** the "-i" option is a no-op. The "-i" option converts "gdiff" into "diff". ** ** The "-N" or "--new-file" option causes the complete text of added or ** deleted files to be displayed. ** ** The "--diff-binary" option enables or disables the inclusion of binary files ** when using an external diff program. ** ** The "--binary" option causes files matching the glob PATTERN to be treated ** as binary when considering if they should be used with external diff program. ** This option overrides the "binary-glob" setting. ** ** Options: ** --binary PATTERN Treat files that match the glob PATTERN as binary ** --branch BRANCH Show diff of all changes on BRANCH ** --brief Show filenames only ** --context|-c N Use N lines of context ** --diff-binary BOOL Include binary files when using external commands ** --exec-abs-paths Force absolute path names with external commands. ** --exec-rel-paths Force relative path names with external commands. ** --from|-r VERSION Select VERSION as source for the diff ** --internal|-i Use internal diff logic ** --side-by-side|-y Side-by-side diff | > > > > | 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 | ** the source check-in for the diff operation. If not specified, the ** source check-in is the base check-in for the current check-out. ** ** If the "--to VERSION" option appears, it specifies the check-in from ** which the second version of the file or files is taken. If there is ** no "--to" option then the (possibly edited) files in the current check-out ** are used. ** ** The "--checkin VERSION" option shows the changes made by ** check-in VERSION relative to its primary parent. ** ** The "-i" command-line option forces the use of the internal diff logic ** rather than any external diff program that might be configured using ** the "setting" command. If no external diff program is configured, then ** the "-i" option is a no-op. The "-i" option converts "gdiff" into "diff". ** ** The "-N" or "--new-file" option causes the complete text of added or ** deleted files to be displayed. ** ** The "--diff-binary" option enables or disables the inclusion of binary files ** when using an external diff program. ** ** The "--binary" option causes files matching the glob PATTERN to be treated ** as binary when considering if they should be used with external diff program. ** This option overrides the "binary-glob" setting. ** ** Options: ** --binary PATTERN Treat files that match the glob PATTERN as binary ** --branch BRANCH Show diff of all changes on BRANCH ** --brief Show filenames only ** --checkin VERSION Show diff of all changes in VERSION ** --context|-c N Use N lines of context ** --diff-binary BOOL Include binary files when using external commands ** --exec-abs-paths Force absolute path names with external commands. ** --exec-rel-paths Force relative path names with external commands. ** --from|-r VERSION Select VERSION as source for the diff ** --internal|-i Use internal diff logic ** --side-by-side|-y Side-by-side diff |
| ︙ | ︙ | |||
814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 |
*/
void diff_cmd(void){
int isGDiff; /* True for gdiff. False for normal diff */
int isInternDiff; /* True for internal diff */
int verboseFlag; /* True if -v or --verbose flag is used */
const char *zFrom; /* Source version number */
const char *zTo; /* Target version number */
const char *zBranch; /* Branch to diff */
const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
const char *zBinGlob = 0; /* Treat file names matching this as binary */
int fIncludeBinary = 0; /* Include binary files for external diff */
int againstUndo = 0; /* Diff against files in the undo buffer */
u64 diffFlags = 0; /* Flags to control the DIFF */
FileDirList *pFileDir = 0; /* Restrict the diff to these files */
if( find_option("tk",0,0)!=0 ){
diff_tk("diff", 2);
return;
}
isGDiff = g.argv[1][0]=='g';
isInternDiff = find_option("internal","i",0)!=0;
zFrom = find_option("from", "r", 1);
zTo = find_option("to", 0, 1);
zBranch = find_option("branch", 0, 1);
againstUndo = find_option("undo",0,0)!=0;
diffFlags = diff_options();
verboseFlag = find_option("verbose","v",0)!=0;
if( !verboseFlag ){
verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */
}
if( verboseFlag ) diffFlags |= DIFF_VERBOSE;
| > > | | > | | > > > | 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 |
*/
void diff_cmd(void){
int isGDiff; /* True for gdiff. False for normal diff */
int isInternDiff; /* True for internal diff */
int verboseFlag; /* True if -v or --verbose flag is used */
const char *zFrom; /* Source version number */
const char *zTo; /* Target version number */
const char *zCheckin; /* Check-in version number */
const char *zBranch; /* Branch to diff */
const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
const char *zBinGlob = 0; /* Treat file names matching this as binary */
int fIncludeBinary = 0; /* Include binary files for external diff */
int againstUndo = 0; /* Diff against files in the undo buffer */
u64 diffFlags = 0; /* Flags to control the DIFF */
FileDirList *pFileDir = 0; /* Restrict the diff to these files */
if( find_option("tk",0,0)!=0 ){
diff_tk("diff", 2);
return;
}
isGDiff = g.argv[1][0]=='g';
isInternDiff = find_option("internal","i",0)!=0;
zFrom = find_option("from", "r", 1);
zTo = find_option("to", 0, 1);
zCheckin = find_option("checkin", 0, 1);
zBranch = find_option("branch", 0, 1);
againstUndo = find_option("undo",0,0)!=0;
diffFlags = diff_options();
verboseFlag = find_option("verbose","v",0)!=0;
if( !verboseFlag ){
verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */
}
if( verboseFlag ) diffFlags |= DIFF_VERBOSE;
if( againstUndo && ( zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){
fossil_fatal("cannot use --undo together with --from, --to, --checkin,"
" or --branch");
}
if( zBranch ){
if( zTo || zFrom || zCheckin ){
fossil_fatal("cannot use --from, --to, or --checkin with --branch");
}
zTo = zBranch;
zFrom = mprintf("root:%s", zBranch);
}
if( zCheckin!=0 && ( zFrom!=0 || zTo!=0 ) ){
fossil_fatal("cannot use --checkin together with --from or --to");
}
if( zTo==0 || againstUndo ){
db_must_be_within_tree();
}else if( zFrom==0 ){
fossil_fatal("must use --from if --to is present");
}else{
db_find_and_open_repository(0, 0);
}
|
| ︙ | ︙ | |||
879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 |
pFileDir[0].zName[1] = 0;
break;
}
pFileDir[i-2].nName = blob_size(&fname);
pFileDir[i-2].nUsed = 0;
blob_reset(&fname);
}
}
if( againstUndo ){
if( db_lget_int("undo_available",0)==0 ){
fossil_print("No undo or redo is available\n");
return;
}
diff_against_undo(zDiffCmd, zBinGlob, fIncludeBinary,
diffFlags, pFileDir);
}else if( zTo==0 ){
diff_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary,
diffFlags, pFileDir);
}else{
diff_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary,
diffFlags, pFileDir);
}
if( pFileDir ){
int i;
for(i=0; pFileDir[i].zName; i++){
if( pFileDir[i].nUsed==0
&& strcmp(pFileDir[0].zName,".")!=0
| > > > > > > > > > > > | | 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 |
pFileDir[0].zName[1] = 0;
break;
}
pFileDir[i-2].nName = blob_size(&fname);
pFileDir[i-2].nUsed = 0;
blob_reset(&fname);
}
}
if ( zCheckin!=0 ){
int ridTo = name_to_typed_rid(zCheckin, "ci");
zTo = zCheckin;
zFrom = db_text(0,
"SELECT uuid FROM blob, plink"
" WHERE plink.cid=%d AND plink.isprim AND plink.pid=blob.rid",
ridTo);
if( zFrom==0 ){
fossil_fatal("check-in %s has no parent", zTo);
}
}
if( againstUndo ){
if( db_lget_int("undo_available",0)==0 ){
fossil_print("No undo or redo is available\n");
return;
}
diff_against_undo(zDiffCmd, zBinGlob, fIncludeBinary,
diffFlags, pFileDir);
}else if( zTo==0 ){
diff_against_disk(zFrom, zDiffCmd, zBinGlob, fIncludeBinary,
diffFlags, pFileDir);
}else{
diff_two_versions(zFrom, zTo, zDiffCmd, zBinGlob, fIncludeBinary,
diffFlags, pFileDir);
}
if( pFileDir ){
int i;
for(i=0; pFileDir[i].zName; i++){
if( pFileDir[i].nUsed==0
&& strcmp(pFileDir[0].zName,".")!=0
&& !file_wd_isdir(g.argv[i+2])
){
fossil_fatal("not found: '%s'", g.argv[i+2]);
}
fossil_free(pFileDir[i].zName);
}
fossil_free(pFileDir);
}
|
| ︙ | ︙ |
Changes to src/dispatch.c.
| ︙ | ︙ | |||
57 58 59 60 61 62 63 | /* ** The page_index.h file contains the definition for aCommand[] - an array ** of CmdOrPage objects that defines all available commands and webpages ** known to Fossil. ** ** The entries in aCommand[] are in sorted order by name. Since webpage names ** always begin with "/", all webpage names occur first. The page_index.h file | | | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | /* ** The page_index.h file contains the definition for aCommand[] - an array ** of CmdOrPage objects that defines all available commands and webpages ** known to Fossil. ** ** The entries in aCommand[] are in sorted order by name. Since webpage names ** always begin with "/", all webpage names occur first. The page_index.h file ** also sets the FOSSIL_FIRST_CMD macro to be the *approximate* index ** in aCommand[] of the first command entry. FOSSIL_FIRST_CMD might be ** slightly too low, and so the range FOSSIL_FIRST_CMD...MX_COMMAND might ** contain a few webpage entries at the beginning. ** ** The page_index.h file is generated by the mkindex program which scans all ** source code files looking for header comments on the functions that ** implement command and webpages. |
| ︙ | ︙ | |||
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
for(i=FOSSIL_FIRST_CMD; i<MX_COMMAND; i++){
if( strncmp(zPrefix, aCommand[i].zName, nPrefix)==0 ){
blob_appendf(pList, " %s", aCommand[i].zName);
}
}
}
/*
** COMMAND: test-all-help
**
** Usage: %fossil test-all-help ?OPTIONS?
**
** Show help text for commands and pages. Useful for proof-reading.
** Defaults to just the CLI commands. Specify --www to see only the
** web pages, or --everything to see both commands and pages.
**
** Options:
** -e|--everything Show all commands and pages.
** -t|--test Include test- commands
** -w|--www Show WWW pages.
*/
void test_all_help_cmd(void){
int i;
int mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER;
if( find_option("www","w",0) ){
mask = CMDFLAG_WEBPAGE;
}
if( find_option("everything","e",0) ){
mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER | CMDFLAG_WEBPAGE;
}
if( find_option("test","t",0) ){
mask |= CMDFLAG_TEST;
}
fossil_print("Help text for:\n");
if( mask & CMDFLAG_1ST_TIER ) fossil_print(" * Commands\n");
if( mask & CMDFLAG_2ND_TIER ) fossil_print(" * Auxiliary commands\n");
if( mask & CMDFLAG_TEST ) fossil_print(" * Test commands\n");
if( mask & CMDFLAG_WEBPAGE ) fossil_print(" * Web pages\n");
| > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > | | > > > > | > < | < < < < < < < < < < | < > | < | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
for(i=FOSSIL_FIRST_CMD; i<MX_COMMAND; i++){
if( strncmp(zPrefix, aCommand[i].zName, nPrefix)==0 ){
blob_appendf(pList, " %s", aCommand[i].zName);
}
}
}
/*
** Attempt to reformat plain-text help into HTML for display on a webpage.
**
** The HTML output is appended to Blob pHtml, which should already be
** initialized.
*/
static void help_to_html(const char *zHelp, Blob *pHtml){
char *s;
char *d;
char *z;
/* Transform "%fossil" into just "fossil" */
z = s = d = mprintf("%s", zHelp);
while( *s ){
if( *s=='%' && strncmp(s, "%fossil", 7)==0 ){
s++;
}else{
*d++ = *s++;
}
}
*d = 0;
blob_appendf(pHtml, "<pre>\n%h\n</pre>\n", z);
fossil_free(z);
}
/*
** COMMAND: test-all-help
**
** Usage: %fossil test-all-help ?OPTIONS?
**
** Show help text for commands and pages. Useful for proof-reading.
** Defaults to just the CLI commands. Specify --www to see only the
** web pages, or --everything to see both commands and pages.
**
** Options:
** -e|--everything Show all commands and pages.
** -t|--test Include test- commands
** -w|--www Show WWW pages.
** -h|--html Transform output to HTML.
*/
void test_all_help_cmd(void){
int i;
int mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER;
int useHtml = find_option("html","h",0)!=0;
if( find_option("www","w",0) ){
mask = CMDFLAG_WEBPAGE;
}
if( find_option("everything","e",0) ){
mask = CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER | CMDFLAG_WEBPAGE;
}
if( find_option("test","t",0) ){
mask |= CMDFLAG_TEST;
}
if( useHtml ) fossil_print("<!--\n");
fossil_print("Help text for:\n");
if( mask & CMDFLAG_1ST_TIER ) fossil_print(" * Commands\n");
if( mask & CMDFLAG_2ND_TIER ) fossil_print(" * Auxiliary commands\n");
if( mask & CMDFLAG_TEST ) fossil_print(" * Test commands\n");
if( mask & CMDFLAG_WEBPAGE ) fossil_print(" * Web pages\n");
if( useHtml ){
fossil_print("-->\n");
fossil_print("<!-- start_all_help -->\n");
}else{
fossil_print("---\n");
}
for(i=0; i<MX_COMMAND; i++){
if( (aCommand[i].eCmdFlags & mask)==0 ) continue;
fossil_print("# %s\n", aCommand[i].zName);
if( useHtml ){
Blob html;
blob_zero(&html);
help_to_html(aCommand[i].zHelp, &html);
fossil_print("%s\n\n", blob_str(&html));
blob_reset(&html);
}else{
fossil_print("%s\n\n", aCommand[i].zHelp);
}
}
if( useHtml ){
fossil_print("<!-- end_all_help -->\n");
}else{
fossil_print("---\n");
}
version_cmd();
}
/*
** WEBPAGE: help
** URL: /help?name=CMD
**
** Show the built-in help text for CMD. CMD can be a command-line interface
** command or a page name from the web interface.
*/
void help_page(void){
const char *zCmd = P("cmd");
if( zCmd==0 ) zCmd = P("name");
style_header("Command-line Help");
if( zCmd ){
int rc;
const CmdOrPage *pCmd = 0;
style_submenu_element("Command-List", "Command-List", "%s/help", g.zTop);
if( *zCmd=='/' ){
/* Some of the webpages require query parameters in order to work.
** @ <h1>The "<a href='%R%s(zCmd)'>%s(zCmd)</a>" page:</h1> */
@ <h1>The "%s(zCmd)" page:</h1>
}else{
@ <h1>The "%s(zCmd)" command:</h1>
}
rc = dispatch_name_search(zCmd, CMDFLAG_ANY, &pCmd);
if( rc==1 ){
@ unknown command: %s(zCmd)
}else if( rc==2 ){
@ ambiguous command prefix: %s(zCmd)
}else{
if( pCmd->zHelp[0]==0 ){
@ no help available for the %s(pCmd->zName) command
}else{
@ <blockquote>
help_to_html(pCmd->zHelp, cgi_output_blob());
@ </blockquote>
}
}
}else{
int i, j, n;
@ <h1>Available commands:</h1>
@ <table border="0"><tr>
|
| ︙ | ︙ | |||
329 330 331 332 333 334 335 |
*/
void test_all_help_page(void){
int i;
style_header("Testpage: All Help Text");
for(i=0; i<MX_COMMAND; i++){
if( memcmp(aCommand[i].zName, "test", 4)==0 ) continue;
@ <h2>%s(aCommand[i].zName):</h2>
| | | | | 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
*/
void test_all_help_page(void){
int i;
style_header("Testpage: All Help Text");
for(i=0; i<MX_COMMAND; i++){
if( memcmp(aCommand[i].zName, "test", 4)==0 ) continue;
@ <h2>%s(aCommand[i].zName):</h2>
@ <blockquote>
help_to_html(aCommand[i].zHelp, cgi_output_blob());
@ </blockquote>
}
style_footer();
}
static void multi_column_list(const char **azWord, int nWord){
int i, j, len;
int mxLen = 0;
|
| ︙ | ︙ |
Changes to src/file.c.
| ︙ | ︙ | |||
291 292 293 294 295 296 297 |
}else{
rc = getStat(0, 0);
}
return rc ? 0 : (S_ISDIR(fileStat.st_mode) ? 1 : 2);
}
/*
| | > > > > < | | | > > > > > > | > > | > | | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
}else{
rc = getStat(0, 0);
}
return rc ? 0 : (S_ISDIR(fileStat.st_mode) ? 1 : 2);
}
/*
** Same as file_isdir(), but takes into account symlinks. Return 1 if
** zFilename is a directory -OR- a symlink that points to a directory.
** Return 0 if zFilename does not exist. Return 2 if zFilename exists
** but is something other than a directory.
*/
int file_wd_isdir(const char *zFilename){
int rc;
char *zFN;
zFN = mprintf("%s", zFilename);
file_simplify_name(zFN, -1, 0);
rc = getStat(zFN, 1);
if( rc ){
rc = 0; /* It does not exist at all. */
}else if( S_ISDIR(fileStat.st_mode) ){
rc = 1; /* It exists and is a real directory. */
}else if( S_ISLNK(fileStat.st_mode) ){
Blob content;
blob_read_link(&content, zFN); /* It exists and is a link. */
rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */
blob_reset(&content);
}else{
rc = 2; /* It exists and is something else. */
}
free(zFN);
return rc;
}
/*
** Wrapper around the access() system call.
*/
int file_access(const char *zFilename, int flags){
|
| ︙ | ︙ | |||
469 470 471 472 473 474 475 |
int file_wd_setexe(const char *zFilename, int onoff){
int rc = 0;
#if !defined(_WIN32)
struct stat buf;
if( fossil_stat(zFilename, &buf, 1)!=0 || S_ISLNK(buf.st_mode) ) return 0;
if( onoff ){
int targetMode = (buf.st_mode & 0444)>>2;
| | | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
int file_wd_setexe(const char *zFilename, int onoff){
int rc = 0;
#if !defined(_WIN32)
struct stat buf;
if( fossil_stat(zFilename, &buf, 1)!=0 || S_ISLNK(buf.st_mode) ) return 0;
if( onoff ){
int targetMode = (buf.st_mode & 0444)>>2;
if( (buf.st_mode & 0100)==0 ){
chmod(zFilename, buf.st_mode | targetMode);
rc = 1;
}
}else{
if( (buf.st_mode & 0100)!=0 ){
chmod(zFilename, buf.st_mode & ~0111);
rc = 1;
}
}
#endif /* _WIN32 */
return rc;
}
|
| ︙ | ︙ | |||
598 599 600 601 602 603 604 |
/*
** On Windows, local path looks like: C:/develop/project/file.txt
** The if stops us from trying to create a directory of a drive letter
** C: in this example.
*/
if( !(i==2 && zName[1]==':') ){
#endif
| | | 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 |
/*
** On Windows, local path looks like: C:/develop/project/file.txt
** The if stops us from trying to create a directory of a drive letter
** C: in this example.
*/
if( !(i==2 && zName[1]==':') ){
#endif
if( file_mkdir(zName, forceFlag) && file_wd_isdir(zName)!=1 ){
if (errorReturn <= 0) {
fossil_fatal_recursive("unable to create directory %s", zName);
}
rc = errorReturn;
break;
}
#if defined(_WIN32) || defined(__CYGWIN__)
|
| ︙ | ︙ |
Changes to src/finfo.c.
| ︙ | ︙ | |||
703 704 705 706 707 708 709 |
const char *zPrior = db_column_text(&q,4);
const char *zParent = db_column_text(&q,5);
int isExec = db_column_int(&q,6);
int isAux = db_column_int(&q,7);
@ <tr>
@ <td><a href='%R/finfo?name=%t(zName)'>%h(zName)</a></td>
if( zParent ){
| | | 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 |
const char *zPrior = db_column_text(&q,4);
const char *zParent = db_column_text(&q,5);
int isExec = db_column_int(&q,6);
int isAux = db_column_int(&q,7);
@ <tr>
@ <td><a href='%R/finfo?name=%t(zName)'>%h(zName)</a></td>
if( zParent ){
@ <td><a href='%R/info/%!S(zParent)'>%S(zParent)</a></td>
}else{
@ <td><i>(New)</i></td>
}
@ <td align='center'>%s(isAux?"✓":"")</td>
if( zFid ){
@ <td><a href='%R/info/%!S(zFid)'>%S(zFid)</a></td>
}else{
|
| ︙ | ︙ |
Changes to src/main.mk.
| ︙ | ︙ | |||
496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
-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 \
| > > | 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
-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 \
|
| ︙ | ︙ |
Changes to src/makemake.tcl.
| ︙ | ︙ | |||
162 163 164 165 166 167 168 169 170 171 172 173 174 175 | -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 | > > | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | -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 |
| ︙ | ︙ | |||
665 666 667 668 669 670 671 | endif #### The directories where the OpenSSL include and library files are located. # The recommended usage here is to use the Sysinternals junction tool # to create a hard link between an "openssl-1.x" sub-directory of the # Fossil source code directory and the target OpenSSL source directory. # | | | 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 | endif #### The directories where the OpenSSL include and library files are located. # The recommended usage here is to use the Sysinternals junction tool # to create a hard link between an "openssl-1.x" sub-directory of the # Fossil source code directory and the target OpenSSL source directory. # OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.0.2j OPENSSLINCDIR = $(OPENSSLDIR)/include OPENSSLLIBDIR = $(OPENSSLDIR) #### Either the directory where the Tcl library is installed or the Tcl # source code directory resides (depending on the value of the macro # FOSSIL_TCL_SOURCE). If this points to the Tcl install directory, # this directory must have "include" and "lib" sub-directories. If |
| ︙ | ︙ | |||
1495 1496 1497 1498 1499 1500 1501 | # Enable support for the SQLite Encryption Extension? !ifndef USE_SEE USE_SEE = 0 !endif !if $(FOSSIL_ENABLE_SSL)!=0 | | | 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 | # Enable support for the SQLite Encryption Extension? !ifndef USE_SEE USE_SEE = 0 !endif !if $(FOSSIL_ENABLE_SSL)!=0 SSLDIR = $(B)\compat\openssl-1.0.2j SSLINCDIR = $(SSLDIR)\inc32 !if $(FOSSIL_DYNAMIC_BUILD)!=0 SSLLIBDIR = $(SSLDIR)\out32dll !else SSLLIBDIR = $(SSLDIR)\out32 !endif SSLLFLAGS = /nologo /opt:ref /debug |
| ︙ | ︙ |
Changes to src/sqlite3.c.
| ︙ | ︙ | |||
379 380 381 382 383 384 385 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.15.0" #define SQLITE_VERSION_NUMBER 3015000 | | | 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.15.0" #define SQLITE_VERSION_NUMBER 3015000 #define SQLITE_SOURCE_ID "2016-10-04 12:20:12 3a9d802fda10585654332b314d317250dc5d894e" /* ** CAPI3REF: Run-Time Library Version Numbers ** KEYWORDS: sqlite3_version, sqlite3_sourceid ** ** These interfaces provide the same information as the [SQLITE_VERSION], ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros |
| ︙ | ︙ | |||
8913 8914 8915 8916 8917 8918 8919 | const char *zTab /* Table name */ ); /* ** CAPI3REF: Set a table filter on a Session Object. ** ** The second argument (xFilter) is the "filter callback". For changes to rows | | | 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 | const char *zTab /* Table name */ ); /* ** CAPI3REF: Set a table filter on a Session Object. ** ** The second argument (xFilter) is the "filter callback". For changes to rows ** in tables that are not attached to the Session object, the filter is called ** to determine whether changes to the table's rows should be tracked or not. ** If xFilter returns 0, changes is not tracked. Note that once a table is ** attached, xFilter will not be called again. */ void sqlite3session_table_filter( sqlite3_session *pSession, /* Session object */ int(*xFilter)( |
| ︙ | ︙ | |||
9179 9180 9181 9182 9183 9184 9185 | ** destroyed. ** ** Assuming the changeset blob was created by one of the ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or ** [sqlite3changeset_invert()] functions, all changes within the changeset ** that apply to a single table are grouped together. This means that when ** an application iterates through a changeset using an iterator created by | | | 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 | ** destroyed. ** ** Assuming the changeset blob was created by one of the ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or ** [sqlite3changeset_invert()] functions, all changes within the changeset ** that apply to a single table are grouped together. This means that when ** an application iterates through a changeset using an iterator created by ** this function, all changes that relate to a single table are visited ** consecutively. There is no chance that the iterator will visit a change ** the applies to table X, then one for table Y, and then later on visit ** another change for table X. */ int sqlite3changeset_start( sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */ int nChangeset, /* Size of changeset blob in bytes */ |
| ︙ | ︙ | |||
9266 9267 9268 9269 9270 9271 9272 | ** This function is used to find which columns comprise the PRIMARY KEY of ** the table modified by the change that iterator pIter currently points to. ** If successful, *pabPK is set to point to an array of nCol entries, where ** nCol is the number of columns in the table. Elements of *pabPK are set to ** 0x01 if the corresponding column is part of the tables primary key, or ** 0x00 if it is not. ** | | | 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 | ** This function is used to find which columns comprise the PRIMARY KEY of ** the table modified by the change that iterator pIter currently points to. ** If successful, *pabPK is set to point to an array of nCol entries, where ** nCol is the number of columns in the table. Elements of *pabPK are set to ** 0x01 if the corresponding column is part of the tables primary key, or ** 0x00 if it is not. ** ** If argument pnCol is not NULL, then *pnCol is set to the number of columns ** in the table. ** ** If this function is called when the iterator does not point to a valid ** entry, SQLITE_MISUSE is returned and the output variables zeroed. Otherwise, ** SQLITE_OK is returned and the output variables populated as described ** above. */ |
| ︙ | ︙ | |||
9541 9542 9543 9544 9545 9546 9547 | ** to the changegroup. ** ** Rows within the changeset and changegroup are identified by the values in ** their PRIMARY KEY columns. A change in the changeset is considered to ** apply to the same row as a change already present in the changegroup if ** the two rows have the same primary key. ** | | | 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 | ** to the changegroup. ** ** Rows within the changeset and changegroup are identified by the values in ** their PRIMARY KEY columns. A change in the changeset is considered to ** apply to the same row as a change already present in the changegroup if ** the two rows have the same primary key. ** ** Changes to rows that do not already appear in the changegroup are ** simply copied into it. Or, if both the new changeset and the changegroup ** contain changes that apply to a single row, the final contents of the ** changegroup depends on the type of each change, as follows: ** ** <table border=1 style="margin-left:8ex;margin-right:8ex"> ** <tr><th style="white-space:pre">Existing Change </th> ** <th style="white-space:pre">New Change </th> |
| ︙ | ︙ | |||
11409 11410 11411 11412 11413 11414 11415 | #define TK_USING 125 #define TK_ORDER 126 #define TK_GROUP 127 #define TK_HAVING 128 #define TK_LIMIT 129 #define TK_WHERE 130 #define TK_INTO 131 | < | | > | 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 | #define TK_USING 125 #define TK_ORDER 126 #define TK_GROUP 127 #define TK_HAVING 128 #define TK_LIMIT 129 #define TK_WHERE 130 #define TK_INTO 131 #define TK_FLOAT 132 #define TK_BLOB 133 #define TK_INTEGER 134 #define TK_VARIABLE 135 #define TK_CASE 136 #define TK_WHEN 137 #define TK_THEN 138 #define TK_ELSE 139 #define TK_INDEX 140 #define TK_ALTER 141 |
| ︙ | ︙ | |||
12680 12681 12682 12683 12684 12685 12686 | #define OP_SorterInsert 125 #define OP_IdxInsert 126 /* synopsis: key=r[P2] */ #define OP_IdxDelete 127 /* synopsis: key=r[P2@P3] */ #define OP_Seek 128 /* synopsis: Move P3 to P1.rowid */ #define OP_IdxRowid 129 /* synopsis: r[P2]=rowid */ #define OP_Destroy 130 #define OP_Clear 131 | > | < | 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 | #define OP_SorterInsert 125 #define OP_IdxInsert 126 /* synopsis: key=r[P2] */ #define OP_IdxDelete 127 /* synopsis: key=r[P2@P3] */ #define OP_Seek 128 /* synopsis: Move P3 to P1.rowid */ #define OP_IdxRowid 129 /* synopsis: r[P2]=rowid */ #define OP_Destroy 130 #define OP_Clear 131 #define OP_Real 132 /* same as TK_FLOAT, synopsis: r[P2]=P4 */ #define OP_ResetSorter 133 #define OP_CreateIndex 134 /* synopsis: r[P2]=root iDb=P1 */ #define OP_CreateTable 135 /* synopsis: r[P2]=root iDb=P1 */ #define OP_ParseSchema 136 #define OP_LoadAnalysis 137 #define OP_DropTable 138 #define OP_DropIndex 139 #define OP_DropTrigger 140 |
| ︙ | ︙ | |||
12739 12740 12741 12742 12743 12744 12745 | /* 72 */ 0x02, 0x02, 0x08, 0x00, 0x10, 0x10, 0x10, 0x10,\ /* 80 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00,\ /* 88 */ 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,\ /* 96 */ 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\ /* 104 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 112 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 120 */ 0x00, 0x00, 0x00, 0x10, 0x00, 0x04, 0x04, 0x00,\ | | | 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 | /* 72 */ 0x02, 0x02, 0x08, 0x00, 0x10, 0x10, 0x10, 0x10,\ /* 80 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00,\ /* 88 */ 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,\ /* 96 */ 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\ /* 104 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 112 */ 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 120 */ 0x00, 0x00, 0x00, 0x10, 0x00, 0x04, 0x04, 0x00,\ /* 128 */ 0x00, 0x10, 0x10, 0x00, 0x10, 0x00, 0x10, 0x10,\ /* 136 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10,\ /* 144 */ 0x00, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 152 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\ /* 160 */ 0x00, 0x00, 0x00,} /* The sqlite3P2Values() routine is able to run faster if it knows ** the value of the largest JUMP opcode. The smaller the maximum |
| ︙ | ︙ | |||
14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 | #define EP_MemToken 0x010000 /* Need to sqlite3DbFree() Expr.zToken */ #define EP_NoReduce 0x020000 /* Cannot EXPRDUP_REDUCE this Expr */ #define EP_Unlikely 0x040000 /* unlikely() or likelihood() function */ #define EP_ConstFunc 0x080000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */ #define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */ #define EP_Subquery 0x200000 /* Tree contains a TK_SELECT operator */ #define EP_Alias 0x400000 /* Is an alias for a result set column */ /* ** Combinations of two or more EP_* flags */ #define EP_Propagate (EP_Collate|EP_Subquery) /* Propagate these bits up tree */ /* | > | 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 | #define EP_MemToken 0x010000 /* Need to sqlite3DbFree() Expr.zToken */ #define EP_NoReduce 0x020000 /* Cannot EXPRDUP_REDUCE this Expr */ #define EP_Unlikely 0x040000 /* unlikely() or likelihood() function */ #define EP_ConstFunc 0x080000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */ #define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */ #define EP_Subquery 0x200000 /* Tree contains a TK_SELECT operator */ #define EP_Alias 0x400000 /* Is an alias for a result set column */ #define EP_Leaf 0x800000 /* Expr.pLeft, .pRight, .u.pSelect all NULL */ /* ** Combinations of two or more EP_* flags */ #define EP_Propagate (EP_Collate|EP_Subquery) /* Propagate these bits up tree */ /* |
| ︙ | ︙ | |||
15512 15513 15514 15515 15516 15517 15518 | u8 nTempReg; /* Number of temporary registers in aTempReg[] */ u8 isMultiWrite; /* True if statement may modify/insert multiple rows */ u8 mayAbort; /* True if statement may throw an ABORT exception */ u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */ u8 okConstFactor; /* OK to factor out constants */ u8 disableLookaside; /* Number of times lookaside has been disabled */ u8 nColCache; /* Number of entries in aColCache[] */ | < < < < < < < < < < < < < < > > > > > > > > > > > > > > > > > > > < < < > > > > > > > > | 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 |
u8 nTempReg; /* Number of temporary registers in aTempReg[] */
u8 isMultiWrite; /* True if statement may modify/insert multiple rows */
u8 mayAbort; /* True if statement may throw an ABORT exception */
u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */
u8 okConstFactor; /* OK to factor out constants */
u8 disableLookaside; /* Number of times lookaside has been disabled */
u8 nColCache; /* Number of entries in aColCache[] */
int nRangeReg; /* Size of the temporary register block */
int iRangeReg; /* First register in temporary register block */
int nErr; /* Number of errors seen */
int nTab; /* Number of previously allocated VDBE cursors */
int nMem; /* Number of memory cells used so far */
int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */
int szOpAlloc; /* Bytes of memory space allocated for Vdbe.aOp[] */
int ckBase; /* Base register of data during check constraints */
int iSelfTab; /* Table of an index whose exprs are being coded */
int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
int iCacheCnt; /* Counter used to generate aColCache[].lru values */
int nLabel; /* Number of labels used */
int *aLabel; /* Space to hold the labels */
ExprList *pConstExpr;/* Constant expressions */
Token constraintName;/* Name of the constraint currently being parsed */
yDbMask writeMask; /* Start a write transaction on these databases */
yDbMask cookieMask; /* Bitmask of schema verified databases */
int regRowid; /* Register holding rowid of CREATE TABLE entry */
int regRoot; /* Register holding root page number for new objects */
int nMaxArg; /* Max args passed to user function by sub-program */
#if SELECTTRACE_ENABLED
int nSelect; /* Number of SELECT statements seen */
int nSelectIndent; /* How far to indent SELECTTRACE() output */
#endif
#ifndef SQLITE_OMIT_SHARED_CACHE
int nTableLock; /* Number of locks in aTableLock */
TableLock *aTableLock; /* Required table locks for shared-cache mode */
#endif
AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */
Parse *pToplevel; /* Parse structure for main program (or NULL) */
Table *pTriggerTab; /* Table triggers are being coded for */
int addrCrTab; /* Address of OP_CreateTable opcode on CREATE TABLE */
u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
u32 oldmask; /* Mask of old.* columns referenced */
u32 newmask; /* Mask of new.* columns referenced */
u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */
u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */
u8 disableTriggers; /* True to disable triggers */
/**************************************************************************
** Fields above must be initialized to zero. The fields that follow,
** down to the beginning of the recursive section, do not need to be
** initialized as they will be set before being used. The boundary is
** determined by offsetof(Parse,aColCache).
**************************************************************************/
struct yColCache {
int iTable; /* Table cursor number */
i16 iColumn; /* Table column number */
u8 tempReg; /* iReg is a temp register that needs to be freed */
int iLevel; /* Nesting level */
int iReg; /* Reg with value of this column. 0 means none. */
int lru; /* Least recently used entry has the smallest value */
} aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */
int aTempReg[8]; /* Holding area for temporary registers */
Token sNameToken; /* Token with unqualified schema object name */
Token sLastToken; /* The last token parsed */
/************************************************************************
** Above is constant between recursions. Below is reset before and after
** each recursion. The boundary between these two regions is determined
** using offsetof(Parse,nVar) so the nVar field must be the first field
** in the recursive region.
************************************************************************/
ynVar nVar; /* Number of '?' variables seen in the SQL so far */
int nzVar; /* Number of available slots in azVar[] */
u8 iPkSortOrder; /* ASC or DESC for INTEGER PRIMARY KEY */
u8 explain; /* True if the EXPLAIN flag is found on the query */
#ifndef SQLITE_OMIT_VIRTUALTABLE
u8 declareVtab; /* True if inside sqlite3_declare_vtab() */
int nVtabLock; /* Number of virtual tables to lock */
#endif
int nHeight; /* Expression tree height of current sub-select */
#ifndef SQLITE_OMIT_EXPLAIN
int iSelectId; /* ID of current select for EXPLAIN output */
int iNextSelectId; /* Next available select ID for EXPLAIN output */
#endif
char **azVar; /* Pointers to names of parameters */
Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
const char *zTail; /* All SQL text past the last semicolon parsed */
Table *pNewTable; /* A table being constructed by CREATE TABLE */
Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */
const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
#ifndef SQLITE_OMIT_VIRTUALTABLE
Token sArg; /* Complete text of a module argument */
Table **apVtabLock; /* Pointer to virtual tables needing locking */
#endif
Table *pZombieTab; /* List of Table objects to delete after code gen */
TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */
With *pWith; /* Current WITH clause, or NULL */
With *pWithToFree; /* Free this WITH object at the end of the parse */
};
/*
** Sizes and pointers of various parts of the Parse object.
*/
#define PARSE_HDR_SZ offsetof(Parse,aColCache) /* Recursive part w/o aColCache*/
#define PARSE_RECURSE_SZ offsetof(Parse,nVar) /* Recursive part */
#define PARSE_TAIL_SZ (sizeof(Parse)-PARSE_RECURSE_SZ) /* Non-recursive part */
#define PARSE_TAIL(X) (((char*)(X))+PARSE_RECURSE_SZ) /* Pointer to tail */
/*
** Return true if currently inside an sqlite3_declare_vtab() call.
*/
#ifdef SQLITE_OMIT_VIRTUALTABLE
#define IN_DECLARE_VTAB 0
#else
#define IN_DECLARE_VTAB (pParse->declareVtab)
|
| ︙ | ︙ | |||
16167 16168 16169 16170 16171 16172 16173 | SQLITE_PRIVATE Expr *sqlite3ExprAlloc(sqlite3*,int,const Token*,int); SQLITE_PRIVATE Expr *sqlite3Expr(sqlite3*,int,const char*); SQLITE_PRIVATE void sqlite3ExprAttachSubtrees(sqlite3*,Expr*,Expr*,Expr*); SQLITE_PRIVATE Expr *sqlite3PExpr(Parse*, int, Expr*, Expr*, const Token*); SQLITE_PRIVATE void sqlite3PExprAddSelect(Parse*, Expr*, Select*); SQLITE_PRIVATE Expr *sqlite3ExprAnd(sqlite3*,Expr*, Expr*); SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*); | | | 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 | SQLITE_PRIVATE Expr *sqlite3ExprAlloc(sqlite3*,int,const Token*,int); SQLITE_PRIVATE Expr *sqlite3Expr(sqlite3*,int,const char*); SQLITE_PRIVATE void sqlite3ExprAttachSubtrees(sqlite3*,Expr*,Expr*,Expr*); SQLITE_PRIVATE Expr *sqlite3PExpr(Parse*, int, Expr*, Expr*, const Token*); SQLITE_PRIVATE void sqlite3PExprAddSelect(Parse*, Expr*, Select*); SQLITE_PRIVATE Expr *sqlite3ExprAnd(sqlite3*,Expr*, Expr*); SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*); SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse*, Expr*, u32); SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*); SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*); SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*); SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList*,int); SQLITE_PRIVATE void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int); SQLITE_PRIVATE void sqlite3ExprListSetSpan(Parse*,ExprList*,ExprSpan*); SQLITE_PRIVATE void sqlite3ExprListDelete(sqlite3*, ExprList*); |
| ︙ | ︙ | |||
16987 16988 16989 16990 16991 16992 16993 | ** Bit 0x20 is set if the mapped character requires translation to upper ** case. i.e. if the character is a lower-case ASCII character. ** If x is a lower-case ASCII character, then its upper-case equivalent ** is (x - 0x20). Therefore toupper() can be implemented as: ** ** (x & ~(map[x]&0x20)) ** | | | < < < | 16998 16999 17000 17001 17002 17003 17004 17005 17006 17007 17008 17009 17010 17011 17012 17013 17014 17015 17016 17017 17018 |
** Bit 0x20 is set if the mapped character requires translation to upper
** case. i.e. if the character is a lower-case ASCII character.
** If x is a lower-case ASCII character, then its upper-case equivalent
** is (x - 0x20). Therefore toupper() can be implemented as:
**
** (x & ~(map[x]&0x20))
**
** The equivalent of tolower() is implemented using the sqlite3UpperToLower[]
** array. tolower() is used more often than toupper() by SQLite.
**
** Bit 0x40 is set if the character is non-alphanumeric and can be used in an
** SQLite identifier. Identifiers are alphanumerics, "_", "$", and any
** non-ASCII UTF character. Hence the test for whether or not a character is
** part of an identifier is 0x46.
*/
#ifdef SQLITE_ASCII
SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00..07 ........ */
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, /* 08..0f ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 10..17 ........ */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 18..1f ........ */
|
| ︙ | ︙ | |||
17069 17070 17071 17072 17073 17074 17075 | ** page size in bytes. */ #ifndef SQLITE_SORTER_PMASZ # define SQLITE_SORTER_PMASZ 250 #endif /* Statement journals spill to disk when their size exceeds the following | | | 17077 17078 17079 17080 17081 17082 17083 17084 17085 17086 17087 17088 17089 17090 17091 | ** page size in bytes. */ #ifndef SQLITE_SORTER_PMASZ # define SQLITE_SORTER_PMASZ 250 #endif /* Statement journals spill to disk when their size exceeds the following ** threshold (in bytes). 0 means that statement journals are created and ** written to disk immediately (the default behavior for SQLite versions ** before 3.12.0). -1 means always keep the entire statement journal in ** memory. (The statement journal is also always held entirely in memory ** if journal_mode=MEMORY or if temp_store=MEMORY, regardless of this ** setting.) */ #ifndef SQLITE_STMTJRNL_SPILL |
| ︙ | ︙ | |||
17157 17158 17159 17160 17161 17162 17163 | }; /* ** The value of the "pending" byte must be 0x40000000 (1 byte past the ** 1-gibabyte boundary) in a compatible database. SQLite never uses ** the database page that contains the pending byte. It never attempts | | | 17165 17166 17167 17168 17169 17170 17171 17172 17173 17174 17175 17176 17177 17178 17179 | }; /* ** The value of the "pending" byte must be 0x40000000 (1 byte past the ** 1-gibabyte boundary) in a compatible database. SQLite never uses ** the database page that contains the pending byte. It never attempts ** to read or write that page. The pending byte page is set aside ** for use by the VFS layers as space for managing file locks. ** ** During testing, it is often desirable to move the pending byte to ** a different position in the file. This allows code that has to ** deal with the pending byte to run on files that are much smaller ** than 1 GiB. The sqlite3_test_control() interface can be used to ** move the pending byte. |
| ︙ | ︙ | |||
17717 17718 17719 17720 17721 17722 17723 | ** Boolean values */ typedef unsigned Bool; /* Opaque type used by code in vdbesort.c */ typedef struct VdbeSorter VdbeSorter; | < < < | 17725 17726 17727 17728 17729 17730 17731 17732 17733 17734 17735 17736 17737 17738 | ** Boolean values */ typedef unsigned Bool; /* Opaque type used by code in vdbesort.c */ typedef struct VdbeSorter VdbeSorter; /* Elements of the linked list at Vdbe.pAuxData */ typedef struct AuxData AuxData; /* Types of VDBE cursors */ #define CURTYPE_BTREE 0 #define CURTYPE_SORTER 1 #define CURTYPE_VTAB 2 |
| ︙ | ︙ | |||
17794 17795 17796 17797 17798 17799 17800 17801 17802 17803 17804 17805 17806 17807 | u32 *aOffset; /* Pointer to aType[nField] */ u32 aType[1]; /* Type values for all entries in the record */ /* 2*nField extra array elements allocated for aType[], beyond the one ** static element declared in the structure. nField total array slots for ** aType[] and nField+1 array slots for aOffset[] */ }; /* ** When a sub-program is executed (OP_Program), a structure of this type ** is allocated to store the current value of the program counter, as ** well as the current memory cell array and various other frame specific ** values stored in the Vdbe struct. When the sub-program is finished, ** these values are copied back to the Vdbe from the VdbeFrame structure, ** restoring the state of the VM to as it was before the sub-program | > > > > > > | 17799 17800 17801 17802 17803 17804 17805 17806 17807 17808 17809 17810 17811 17812 17813 17814 17815 17816 17817 17818 | u32 *aOffset; /* Pointer to aType[nField] */ u32 aType[1]; /* Type values for all entries in the record */ /* 2*nField extra array elements allocated for aType[], beyond the one ** static element declared in the structure. nField total array slots for ** aType[] and nField+1 array slots for aOffset[] */ }; /* ** A value for VdbeCursor.cacheStatus that means the cache is always invalid. */ #define CACHE_STALE 0 /* ** When a sub-program is executed (OP_Program), a structure of this type ** is allocated to store the current value of the program counter, as ** well as the current memory cell array and various other frame specific ** values stored in the Vdbe struct. When the sub-program is finished, ** these values are copied back to the Vdbe from the VdbeFrame structure, ** restoring the state of the VM to as it was before the sub-program |
| ︙ | ︙ | |||
17838 17839 17840 17841 17842 17843 17844 | int nChildCsr; /* Number of cursors for child frame */ int nChange; /* Statement changes (Vdbe.nChange) */ int nDbChange; /* Value of db->nChange */ }; #define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))]) | < < < < < | 17849 17850 17851 17852 17853 17854 17855 17856 17857 17858 17859 17860 17861 17862 |
int nChildCsr; /* Number of cursors for child frame */
int nChange; /* Statement changes (Vdbe.nChange) */
int nDbChange; /* Value of db->nChange */
};
#define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))])
/*
** Internally, the vdbe manipulates nearly all SQL values as Mem
** structures. Each Mem struct may cache multiple representations (string,
** integer etc.) of the same value.
*/
struct Mem {
union MemValue {
|
| ︙ | ︙ | |||
17983 17984 17985 17986 17987 17988 17989 | int isError; /* Error code returned by the function. */ u8 skipFlag; /* Skip accumulator loading if true */ u8 fErrorOrAux; /* isError!=0 or pVdbe->pAuxData modified */ u8 argc; /* Number of arguments */ sqlite3_value *argv[1]; /* Argument set */ }; | < < < < < < < < < < < < | 17989 17990 17991 17992 17993 17994 17995 17996 17997 17998 17999 18000 18001 18002 |
int isError; /* Error code returned by the function. */
u8 skipFlag; /* Skip accumulator loading if true */
u8 fErrorOrAux; /* isError!=0 or pVdbe->pAuxData modified */
u8 argc; /* Number of arguments */
sqlite3_value *argv[1]; /* Argument set */
};
/* A bitfield type for use inside of structures. Always follow with :N where
** N is the number of bits.
*/
typedef unsigned bft; /* Bit Field Type */
typedef struct ScanStatus ScanStatus;
struct ScanStatus {
|
| ︙ | ︙ | |||
18019 18020 18021 18022 18023 18024 18025 18026 18027 18028 18029 18030 |
** state of the virtual machine.
**
** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare()
** is really a pointer to an instance of this structure.
*/
struct Vdbe {
sqlite3 *db; /* The database connection that owns this statement */
Op *aOp; /* Space to hold the virtual machine's program */
Mem *aMem; /* The memory locations */
Mem **apArg; /* Arguments to currently executing user function */
Mem *aColName; /* Column names to return */
Mem *pResultSet; /* Pointer to an array of results */
| > > > > > > > > > > > > > > > > > > > > < < < < < < | | | < | > < < < < < < < < < < | | | > | | 18013 18014 18015 18016 18017 18018 18019 18020 18021 18022 18023 18024 18025 18026 18027 18028 18029 18030 18031 18032 18033 18034 18035 18036 18037 18038 18039 18040 18041 18042 18043 18044 18045 18046 18047 18048 18049 18050 18051 18052 18053 18054 18055 18056 18057 18058 18059 18060 18061 18062 18063 18064 18065 18066 18067 18068 18069 18070 18071 18072 18073 18074 18075 18076 18077 18078 18079 18080 18081 18082 18083 18084 18085 18086 18087 18088 18089 18090 18091 18092 18093 18094 18095 18096 18097 18098 18099 18100 |
** state of the virtual machine.
**
** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare()
** is really a pointer to an instance of this structure.
*/
struct Vdbe {
sqlite3 *db; /* The database connection that owns this statement */
Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
Parse *pParse; /* Parsing context used to create this Vdbe */
ynVar nVar; /* Number of entries in aVar[] */
ynVar nzVar; /* Number of entries in azVar[] */
u32 magic; /* Magic number for sanity checking */
int nMem; /* Number of memory locations currently allocated */
int nCursor; /* Number of slots in apCsr[] */
u32 cacheCtr; /* VdbeCursor row cache generation counter */
int pc; /* The program counter */
int rc; /* Value to return */
int nChange; /* Number of db changes made since last reset */
int iStatement; /* Statement number (or 0 if has not opened stmt) */
i64 iCurrentTime; /* Value of julianday('now') for this statement */
i64 nFkConstraint; /* Number of imm. FK constraints this VM */
i64 nStmtDefCons; /* Number of def. constraints when stmt started */
i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
/* When allocating a new Vdbe object, all of the fields below should be
** initialized to zero or NULL */
Op *aOp; /* Space to hold the virtual machine's program */
Mem *aMem; /* The memory locations */
Mem **apArg; /* Arguments to currently executing user function */
Mem *aColName; /* Column names to return */
Mem *pResultSet; /* Pointer to an array of results */
char *zErrMsg; /* Error message written here */
VdbeCursor **apCsr; /* One element of this array for each open cursor */
Mem *aVar; /* Values for the OP_Variable opcode. */
char **azVar; /* Name of variables */
#ifndef SQLITE_OMIT_TRACE
i64 startTime; /* Time when query started - used for profiling */
#endif
int nOp; /* Number of instructions in the program */
#ifdef SQLITE_DEBUG
int rcApp; /* errcode set by sqlite3_result_error_code() */
#endif
u16 nResColumn; /* Number of columns in one row of the result set */
u8 errorAction; /* Recovery action to do in case of an error */
u8 minWriteFileFormat; /* Minimum file format for writable database files */
bft expired:1; /* True if the VM needs to be recompiled */
bft doingRerun:1; /* True if rerunning after an auto-reprepare */
bft explain:2; /* True if EXPLAIN present on SQL command */
bft changeCntOn:1; /* True to update the change-counter */
bft runOnlyOnce:1; /* Automatically expire on reset */
bft usesStmtJournal:1; /* True if uses a statement journal */
bft readOnly:1; /* True for statements that do not write */
bft bIsReader:1; /* True for statements that read */
bft isPrepareV2:1; /* True if prepared with prepare_v2() */
yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */
yDbMask lockMask; /* Subset of btreeMask that requires a lock */
u32 aCounter[5]; /* Counters used by sqlite3_stmt_status() */
char *zSql; /* Text of the SQL statement that generated this */
void *pFree; /* Free this when deleting the vdbe */
VdbeFrame *pFrame; /* Parent frame */
VdbeFrame *pDelFrame; /* List of frame objects to free on VM reset */
int nFrame; /* Number of frames in pFrame list */
u32 expmask; /* Binding to these vars invalidates VM */
SubProgram *pProgram; /* Linked list of all sub-programs used by VM */
AuxData *pAuxData; /* Linked list of auxdata allocations */
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
i64 *anExec; /* Number of times each op has been executed */
int nScan; /* Entries in aScan[] */
ScanStatus *aScan; /* Scan definitions for sqlite3_stmt_scanstatus() */
#endif
};
/*
** The following are allowed values for Vdbe.magic
*/
#define VDBE_MAGIC_INIT 0x16bceaa5 /* Building a VDBE program */
#define VDBE_MAGIC_RUN 0x2df20da3 /* VDBE is ready to execute */
#define VDBE_MAGIC_HALT 0x319c2973 /* VDBE has completed execution */
#define VDBE_MAGIC_RESET 0x48fa9f76 /* Reset and ready to run again */
#define VDBE_MAGIC_DEAD 0x5606c3c8 /* The VDBE has been deallocated */
/*
** Structure used to store the context required by the
** sqlite3_preupdate_*() API functions.
*/
struct PreUpdate {
Vdbe *v;
|
| ︙ | ︙ | |||
28773 28774 28775 28776 28777 28778 28779 |
/*
** The hashing function.
*/
static unsigned int strHash(const char *z){
unsigned int h = 0;
unsigned char c;
while( (c = (unsigned char)*z++)!=0 ){ /*OPTIMIZATION-IF-TRUE*/
| > > > | > | 28772 28773 28774 28775 28776 28777 28778 28779 28780 28781 28782 28783 28784 28785 28786 28787 28788 28789 28790 |
/*
** The hashing function.
*/
static unsigned int strHash(const char *z){
unsigned int h = 0;
unsigned char c;
while( (c = (unsigned char)*z++)!=0 ){ /*OPTIMIZATION-IF-TRUE*/
/* Knuth multiplicative hashing. (Sorting & Searching, p. 510).
** 0x9e3779b1 is 2654435761 which is the closest prime number to
** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */
h += sqlite3UpperToLower[c];
h *= 0x9e3779b1;
}
return h;
}
/* Link pNew element into the hash table pH. If pEntry!=0 then also
** insert pNew into the pEntry hash bucket.
|
| ︙ | ︙ | |||
29129 29130 29131 29132 29133 29134 29135 |
/* 125 */ "SorterInsert" OpHelp(""),
/* 126 */ "IdxInsert" OpHelp("key=r[P2]"),
/* 127 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
/* 128 */ "Seek" OpHelp("Move P3 to P1.rowid"),
/* 129 */ "IdxRowid" OpHelp("r[P2]=rowid"),
/* 130 */ "Destroy" OpHelp(""),
/* 131 */ "Clear" OpHelp(""),
| < | > | 29132 29133 29134 29135 29136 29137 29138 29139 29140 29141 29142 29143 29144 29145 29146 29147 |
/* 125 */ "SorterInsert" OpHelp(""),
/* 126 */ "IdxInsert" OpHelp("key=r[P2]"),
/* 127 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
/* 128 */ "Seek" OpHelp("Move P3 to P1.rowid"),
/* 129 */ "IdxRowid" OpHelp("r[P2]=rowid"),
/* 130 */ "Destroy" OpHelp(""),
/* 131 */ "Clear" OpHelp(""),
/* 132 */ "Real" OpHelp("r[P2]=P4"),
/* 133 */ "ResetSorter" OpHelp(""),
/* 134 */ "CreateIndex" OpHelp("r[P2]=root iDb=P1"),
/* 135 */ "CreateTable" OpHelp("r[P2]=root iDb=P1"),
/* 136 */ "ParseSchema" OpHelp(""),
/* 137 */ "LoadAnalysis" OpHelp(""),
/* 138 */ "DropTable" OpHelp(""),
/* 139 */ "DropIndex" OpHelp(""),
/* 140 */ "DropTrigger" OpHelp(""),
|
| ︙ | ︙ | |||
44016 44017 44018 44019 44020 44021 44022 |
Pgno pgno, /* Page number obtained */
sqlite3_pcache_page *pPage /* Page obtained by prior PcacheFetch() call */
){
PgHdr *pPgHdr;
assert( pPage!=0 );
pPgHdr = (PgHdr*)pPage->pExtra;
assert( pPgHdr->pPage==0 );
| | | 44019 44020 44021 44022 44023 44024 44025 44026 44027 44028 44029 44030 44031 44032 44033 |
Pgno pgno, /* Page number obtained */
sqlite3_pcache_page *pPage /* Page obtained by prior PcacheFetch() call */
){
PgHdr *pPgHdr;
assert( pPage!=0 );
pPgHdr = (PgHdr*)pPage->pExtra;
assert( pPgHdr->pPage==0 );
memset(&pPgHdr->pDirty, 0, sizeof(PgHdr) - offsetof(PgHdr,pDirty));
pPgHdr->pPage = pPage;
pPgHdr->pData = pPage->pBuf;
pPgHdr->pExtra = (void *)&pPgHdr[1];
memset(pPgHdr->pExtra, 0, pCache->szExtra);
pPgHdr->pCache = pCache;
pPgHdr->pgno = pgno;
pPgHdr->flags = PGHDR_CLEAN;
|
| ︙ | ︙ | |||
58982 58983 58984 58985 58986 58987 58988 |
const void *pKey, /* Packed key if the btree is an index */
i64 nKey, /* Integer key for tables. Size of pKey for indices */
int bias, /* Bias search to the high end */
int *pRes /* Write search results here */
){
int rc; /* Status code */
UnpackedRecord *pIdxKey; /* Unpacked index key */
| | | 58985 58986 58987 58988 58989 58990 58991 58992 58993 58994 58995 58996 58997 58998 58999 |
const void *pKey, /* Packed key if the btree is an index */
i64 nKey, /* Integer key for tables. Size of pKey for indices */
int bias, /* Bias search to the high end */
int *pRes /* Write search results here */
){
int rc; /* Status code */
UnpackedRecord *pIdxKey; /* Unpacked index key */
char aSpace[384]; /* Temp space for pIdxKey - to avoid a malloc */
char *pFree = 0;
if( pKey ){
assert( nKey==(i64)(int)nKey );
pIdxKey = sqlite3VdbeAllocUnpackedRecord(
pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree
);
|
| ︙ | ︙ | |||
64319 64320 64321 64322 64323 64324 64325 |
nPayload = pX->nData + pX->nZero;
pSrc = pX->pData;
nSrc = pX->nData;
assert( pPage->intKeyLeaf ); /* fillInCell() only called for leaves */
nHeader += putVarint32(&pCell[nHeader], nPayload);
nHeader += putVarint(&pCell[nHeader], *(u64*)&pX->nKey);
}else{
| < < | 64322 64323 64324 64325 64326 64327 64328 64329 64330 64331 64332 64333 64334 64335 |
nPayload = pX->nData + pX->nZero;
pSrc = pX->pData;
nSrc = pX->nData;
assert( pPage->intKeyLeaf ); /* fillInCell() only called for leaves */
nHeader += putVarint32(&pCell[nHeader], nPayload);
nHeader += putVarint(&pCell[nHeader], *(u64*)&pX->nKey);
}else{
assert( pX->nKey<=0x7fffffff && pX->pKey!=0 );
nSrc = nPayload = (int)pX->nKey;
pSrc = pX->pKey;
nHeader += putVarint32(&pCell[nHeader], nPayload);
}
/* Fill in the payload */
|
| ︙ | ︙ | |||
68020 68021 68022 68023 68024 68025 68026 |
** function. If an error occurs while doing so, return 0 and write an
** error message to pErrorDb.
*/
static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
int i = sqlite3FindDbName(pDb, zDb);
if( i==1 ){
| | < | < < < | | | | | | | < < | 68021 68022 68023 68024 68025 68026 68027 68028 68029 68030 68031 68032 68033 68034 68035 68036 68037 68038 68039 68040 68041 68042 68043 68044 |
** function. If an error occurs while doing so, return 0 and write an
** error message to pErrorDb.
*/
static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
int i = sqlite3FindDbName(pDb, zDb);
if( i==1 ){
Parse sParse;
int rc = 0;
memset(&sParse, 0, sizeof(sParse));
sParse.db = pDb;
if( sqlite3OpenTempDatabase(&sParse) ){
sqlite3ErrorWithMsg(pErrorDb, sParse.rc, "%s", sParse.zErrMsg);
rc = SQLITE_ERROR;
}
sqlite3DbFree(pErrorDb, sParse.zErrMsg);
sqlite3ParserReset(&sParse);
if( rc ){
return 0;
}
}
if( i<0 ){
sqlite3ErrorWithMsg(pErrorDb, SQLITE_ERROR, "unknown database %s", zDb);
|
| ︙ | ︙ | |||
69039 69040 69041 69042 69043 69044 69045 69046 69047 69048 69049 69050 69051 69052 |
assert( !(fg&(MEM_Str|MEM_Blob)) );
assert( fg&(MEM_Int|MEM_Real) );
assert( (pMem->flags&MEM_RowSet)==0 );
assert( EIGHT_BYTE_ALIGNMENT(pMem) );
if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
return SQLITE_NOMEM_BKPT;
}
/* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8
** string representation of the value. Then, if the required encoding
** is UTF-16le or UTF-16be do a translation.
**
| > | 69034 69035 69036 69037 69038 69039 69040 69041 69042 69043 69044 69045 69046 69047 69048 |
assert( !(fg&(MEM_Str|MEM_Blob)) );
assert( fg&(MEM_Int|MEM_Real) );
assert( (pMem->flags&MEM_RowSet)==0 );
assert( EIGHT_BYTE_ALIGNMENT(pMem) );
if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
pMem->enc = 0;
return SQLITE_NOMEM_BKPT;
}
/* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8
** string representation of the value. Then, if the required encoding
** is UTF-16le or UTF-16be do a translation.
**
|
| ︙ | ︙ | |||
70015 70016 70017 70018 70019 70020 70021 | int op; char *zVal = 0; sqlite3_value *pVal = 0; int negInt = 1; const char *zNeg = ""; int rc = SQLITE_OK; | | < < < | 70011 70012 70013 70014 70015 70016 70017 70018 70019 70020 70021 70022 70023 70024 70025 | int op; char *zVal = 0; sqlite3_value *pVal = 0; int negInt = 1; const char *zNeg = ""; int rc = SQLITE_OK; assert( pExpr!=0 ); while( (op = pExpr->op)==TK_UPLUS || op==TK_SPAN ) pExpr = pExpr->pLeft; if( NEVER(op==TK_REGISTER) ) op = pExpr->op2; /* Compressed expressions only appear when parsing the DEFAULT clause ** on a table column definition, and hence only when pCtx==0. This ** check ensures that an EP_TokenOnly expression is never passed down ** into valueFromFunction(). */ |
| ︙ | ︙ | |||
70142 70143 70144 70145 70146 70147 70148 |
SQLITE_PRIVATE int sqlite3ValueFromExpr(
sqlite3 *db, /* The database connection */
Expr *pExpr, /* The expression to evaluate */
u8 enc, /* Encoding to use */
u8 affinity, /* Affinity to use */
sqlite3_value **ppVal /* Write the new value here */
){
| | | 70135 70136 70137 70138 70139 70140 70141 70142 70143 70144 70145 70146 70147 70148 70149 |
SQLITE_PRIVATE int sqlite3ValueFromExpr(
sqlite3 *db, /* The database connection */
Expr *pExpr, /* The expression to evaluate */
u8 enc, /* Encoding to use */
u8 affinity, /* Affinity to use */
sqlite3_value **ppVal /* Write the new value here */
){
return pExpr ? valueFromExpr(db, pExpr, enc, affinity, ppVal, 0) : 0;
}
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
/*
** The implementation of the sqlite_record() function. This function accepts
** a single argument of any type. The return value is a formatted database
** record (a blob) containing the argument value.
|
| ︙ | ︙ | |||
70485 70486 70487 70488 70489 70490 70491 |
/*
** Create a new virtual database engine.
*/
SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse *pParse){
sqlite3 *db = pParse->db;
Vdbe *p;
| | > | 70478 70479 70480 70481 70482 70483 70484 70485 70486 70487 70488 70489 70490 70491 70492 70493 70494 |
/*
** Create a new virtual database engine.
*/
SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse *pParse){
sqlite3 *db = pParse->db;
Vdbe *p;
p = sqlite3DbMallocRawNN(db, sizeof(Vdbe) );
if( p==0 ) return 0;
memset(&p->aOp, 0, sizeof(Vdbe)-offsetof(Vdbe,aOp));
p->db = db;
if( db->pVdbe ){
db->pVdbe->pPrev = p;
}
p->pNext = db->pVdbe;
p->pPrev = 0;
db->pVdbe = p;
|
| ︙ | ︙ | |||
70648 70649 70650 70651 70652 70653 70654 |
#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
pOp->zComment = 0;
#endif
#ifdef SQLITE_DEBUG
if( p->db->flags & SQLITE_VdbeAddopTrace ){
int jj, kk;
Parse *pParse = p->pParse;
| | < | 70642 70643 70644 70645 70646 70647 70648 70649 70650 70651 70652 70653 70654 70655 70656 70657 |
#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
pOp->zComment = 0;
#endif
#ifdef SQLITE_DEBUG
if( p->db->flags & SQLITE_VdbeAddopTrace ){
int jj, kk;
Parse *pParse = p->pParse;
for(jj=kk=0; jj<pParse->nColCache; jj++){
struct yColCache *x = pParse->aColCache + jj;
printf(" r[%d]={%d:%d}", x->iReg, x->iTable, x->iColumn);
kk++;
}
if( kk ) printf("\n");
sqlite3VdbePrintOp(0, i, &p->aOp[i]);
test_addop_breakpoint();
}
|
| ︙ | ︙ | |||
70838 70839 70840 70841 70842 70843 70844 |
int j = ADDR(x);
assert( v->magic==VDBE_MAGIC_INIT );
assert( j<p->nLabel );
assert( j>=0 );
if( p->aLabel ){
p->aLabel[j] = v->nOp;
}
| < | 70831 70832 70833 70834 70835 70836 70837 70838 70839 70840 70841 70842 70843 70844 |
int j = ADDR(x);
assert( v->magic==VDBE_MAGIC_INIT );
assert( j<p->nLabel );
assert( j>=0 );
if( p->aLabel ){
p->aLabel[j] = v->nOp;
}
}
/*
** Mark the VDBE as one that can only be run one time.
*/
SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe *p){
p->runOnlyOnce = 1;
|
| ︙ | ︙ | |||
71229 71230 71231 71232 71233 71234 71235 |
SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, u32 addr, int val){
sqlite3VdbeGetOp(p,addr)->p2 = val;
}
SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, u32 addr, int val){
sqlite3VdbeGetOp(p,addr)->p3 = val;
}
SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe *p, u8 p5){
| > | < | 71221 71222 71223 71224 71225 71226 71227 71228 71229 71230 71231 71232 71233 71234 71235 71236 71237 71238 71239 71240 71241 71242 71243 |
SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, u32 addr, int val){
sqlite3VdbeGetOp(p,addr)->p2 = val;
}
SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, u32 addr, int val){
sqlite3VdbeGetOp(p,addr)->p3 = val;
}
SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe *p, u8 p5){
assert( p->nOp>0 || p->db->mallocFailed );
if( p->nOp>0 ) p->aOp[p->nOp-1].p5 = p5;
}
/*
** Change the P2 operand of instruction addr so that it points to
** the address of the next instruction to be coded.
*/
SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
sqlite3VdbeChangeP2(p, addr, p->nOp);
}
/*
** If the input FuncDef structure is ephemeral, then free it. If
** the FuncDef is not ephermal, then do nothing.
|
| ︙ | ︙ | |||
71360 71361 71362 71363 71364 71365 71366 |
}
/*
** If the last opcode is "op" and it is not a jump destination,
** then remove it. Return true if and only if an opcode was removed.
*/
SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){
| | | 71352 71353 71354 71355 71356 71357 71358 71359 71360 71361 71362 71363 71364 71365 71366 |
}
/*
** If the last opcode is "op" and it is not a jump destination,
** then remove it. Return true if and only if an opcode was removed.
*/
SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){
if( p->nOp>0 && p->aOp[p->nOp-1].opcode==op ){
return sqlite3VdbeChangeToNoop(p, p->nOp-1);
}else{
return 0;
}
}
/*
|
| ︙ | ︙ | |||
71922 71923 71924 71925 71926 71927 71928 71929 71930 71931 71932 71933 71934 71935 |
fprintf(pOut, zFormat1, pc,
sqlite3OpcodeName(pOp->opcode), pOp->p1, pOp->p2, pOp->p3, zP4, pOp->p5,
zCom
);
fflush(pOut);
}
#endif
/*
** Release an array of N Mem elements
*/
static void releaseMemArray(Mem *p, int N){
if( p && N ){
Mem *pEnd = &p[N];
| > > > > > > > > > > > > > > > | 71914 71915 71916 71917 71918 71919 71920 71921 71922 71923 71924 71925 71926 71927 71928 71929 71930 71931 71932 71933 71934 71935 71936 71937 71938 71939 71940 71941 71942 |
fprintf(pOut, zFormat1, pc,
sqlite3OpcodeName(pOp->opcode), pOp->p1, pOp->p2, pOp->p3, zP4, pOp->p5,
zCom
);
fflush(pOut);
}
#endif
/*
** Initialize an array of N Mem element.
*/
static void initMemArray(Mem *p, int N, sqlite3 *db, u16 flags){
while( (N--)>0 ){
p->db = db;
p->flags = flags;
p->szMalloc = 0;
#ifdef SQLITE_DEBUG
p->pScopyFrom = 0;
#endif
p++;
}
}
/*
** Release an array of N Mem elements
*/
static void releaseMemArray(Mem *p, int N){
if( p && N ){
Mem *pEnd = &p[N];
|
| ︙ | ︙ | |||
72134 72135 72136 72137 72138 72139 72140 72141 72142 72143 72144 72145 72146 72147 |
if( sqlite3VdbeMemClearAndResize(pMem, 100) ){ /* P4 */
assert( p->db->mallocFailed );
return SQLITE_ERROR;
}
pMem->flags = MEM_Str|MEM_Term;
zP4 = displayP4(pOp, pMem->z, pMem->szMalloc);
if( zP4!=pMem->z ){
sqlite3VdbeMemSetStr(pMem, zP4, -1, SQLITE_UTF8, 0);
}else{
assert( pMem->z!=0 );
pMem->n = sqlite3Strlen30(pMem->z);
pMem->enc = SQLITE_UTF8;
}
pMem++;
| > | 72141 72142 72143 72144 72145 72146 72147 72148 72149 72150 72151 72152 72153 72154 72155 |
if( sqlite3VdbeMemClearAndResize(pMem, 100) ){ /* P4 */
assert( p->db->mallocFailed );
return SQLITE_ERROR;
}
pMem->flags = MEM_Str|MEM_Term;
zP4 = displayP4(pOp, pMem->z, pMem->szMalloc);
if( zP4!=pMem->z ){
pMem->n = 0;
sqlite3VdbeMemSetStr(pMem, zP4, -1, SQLITE_UTF8, 0);
}else{
assert( pMem->z!=0 );
pMem->n = sqlite3Strlen30(pMem->z);
pMem->enc = SQLITE_UTF8;
}
pMem++;
|
| ︙ | ︙ | |||
72276 72277 72278 72279 72280 72281 72282 |
** running it.
*/
SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *p){
#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
int i;
#endif
assert( p!=0 );
| | | 72284 72285 72286 72287 72288 72289 72290 72291 72292 72293 72294 72295 72296 72297 72298 |
** running it.
*/
SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *p){
#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
int i;
#endif
assert( p!=0 );
assert( p->magic==VDBE_MAGIC_INIT || p->magic==VDBE_MAGIC_RESET );
/* There should be at least one opcode.
*/
assert( p->nOp>0 );
/* Set the magic to VDBE_MAGIC_RUN sooner rather than later. */
p->magic = VDBE_MAGIC_RUN;
|
| ︙ | ︙ | |||
72365 72366 72367 72368 72369 72370 72371 | ** of the prepared statement. */ n = ROUND8(sizeof(Op)*p->nOp); /* Bytes of opcode memory used */ x.pSpace = &((u8*)p->aOp)[n]; /* Unused opcode memory */ assert( EIGHT_BYTE_ALIGNMENT(x.pSpace) ); x.nFree = ROUNDDOWN8(pParse->szOpAlloc - n); /* Bytes of unused memory */ assert( x.nFree>=0 ); | < < | < | 72373 72374 72375 72376 72377 72378 72379 72380 72381 72382 72383 72384 72385 72386 72387 |
** of the prepared statement.
*/
n = ROUND8(sizeof(Op)*p->nOp); /* Bytes of opcode memory used */
x.pSpace = &((u8*)p->aOp)[n]; /* Unused opcode memory */
assert( EIGHT_BYTE_ALIGNMENT(x.pSpace) );
x.nFree = ROUNDDOWN8(pParse->szOpAlloc - n); /* Bytes of unused memory */
assert( x.nFree>=0 );
assert( EIGHT_BYTE_ALIGNMENT(&x.pSpace[x.nFree]) );
resolveP2Values(p, &nArg);
p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort);
if( pParse->explain && nMem<10 ){
nMem = 10;
}
p->expired = 0;
|
| ︙ | ︙ | |||
72397 72398 72399 72400 72401 72402 72403 |
p->aVar = allocSpace(&x, p->aVar, nVar*sizeof(Mem));
p->apArg = allocSpace(&x, p->apArg, nArg*sizeof(Mem*));
p->apCsr = allocSpace(&x, p->apCsr, nCursor*sizeof(VdbeCursor*));
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
p->anExec = allocSpace(&x, p->anExec, p->nOp*sizeof(i64));
#endif
if( x.nNeeded==0 ) break;
| | < < < < < < < < > > > > | > > > > < | > > | > | < < | 72402 72403 72404 72405 72406 72407 72408 72409 72410 72411 72412 72413 72414 72415 72416 72417 72418 72419 72420 72421 72422 72423 72424 72425 72426 72427 72428 72429 72430 72431 72432 72433 72434 72435 72436 72437 72438 72439 |
p->aVar = allocSpace(&x, p->aVar, nVar*sizeof(Mem));
p->apArg = allocSpace(&x, p->apArg, nArg*sizeof(Mem*));
p->apCsr = allocSpace(&x, p->apCsr, nCursor*sizeof(VdbeCursor*));
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
p->anExec = allocSpace(&x, p->anExec, p->nOp*sizeof(i64));
#endif
if( x.nNeeded==0 ) break;
x.pSpace = p->pFree = sqlite3DbMallocRawNN(db, x.nNeeded);
x.nFree = x.nNeeded;
}while( !db->mallocFailed );
p->nzVar = pParse->nzVar;
p->azVar = pParse->azVar;
pParse->nzVar = 0;
pParse->azVar = 0;
p->explain = pParse->explain;
if( db->mallocFailed ){
p->nVar = 0;
p->nCursor = 0;
p->nMem = 0;
}else{
p->nCursor = nCursor;
p->nVar = (ynVar)nVar;
initMemArray(p->aVar, nVar, db, MEM_Null);
p->nMem = nMem;
initMemArray(p->aMem, nMem, db, MEM_Undefined);
memset(p->apCsr, 0, nCursor*sizeof(VdbeCursor*));
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
memset(p->anExec, 0, p->nOp*sizeof(i64));
#endif
}
sqlite3VdbeRewind(p);
}
/*
** Close a VDBE cursor and release all the resources that cursor
** happens to hold.
*/
|
| ︙ | ︙ | |||
72572 72573 72574 72575 72576 72577 72578 | int n; sqlite3 *db = p->db; releaseMemArray(p->aColName, p->nResColumn*COLNAME_N); sqlite3DbFree(db, p->aColName); n = nResColumn*COLNAME_N; p->nResColumn = (u16)nResColumn; | | < < < | < | 72577 72578 72579 72580 72581 72582 72583 72584 72585 72586 72587 72588 72589 72590 72591 72592 72593 | int n; sqlite3 *db = p->db; releaseMemArray(p->aColName, p->nResColumn*COLNAME_N); sqlite3DbFree(db, p->aColName); n = nResColumn*COLNAME_N; p->nResColumn = (u16)nResColumn; p->aColName = pColName = (Mem*)sqlite3DbMallocRawNN(db, sizeof(Mem)*n ); if( p->aColName==0 ) return; initMemArray(p->aColName, n, p->db, MEM_Null); } /* ** Set the name of the idx'th column to be returned by the SQL statement. ** zName must be a pointer to a nul terminated string. ** ** This call must be made after a call to sqlite3VdbeSetNumCols(). |
| ︙ | ︙ | |||
73340 73341 73342 73343 73344 73345 73346 |
sqlite3VdbePrintOp(out, i, &p->aOp[i]);
}
fclose(out);
}
}
#endif
p->iCurrentTime = 0;
| | | 73341 73342 73343 73344 73345 73346 73347 73348 73349 73350 73351 73352 73353 73354 73355 |
sqlite3VdbePrintOp(out, i, &p->aOp[i]);
}
fclose(out);
}
}
#endif
p->iCurrentTime = 0;
p->magic = VDBE_MAGIC_RESET;
return p->rc & db->errMask;
}
/*
** Clean up and delete a VDBE after execution. Return an integer which is
** the result code. Write any error message text into *pzErrMsg.
*/
|
| ︙ | ︙ | |||
73404 73405 73406 73407 73408 73409 73410 |
** VdbeDelete() also unlinks the Vdbe from the list of VMs associated with
** the database connection and frees the object itself.
*/
SQLITE_PRIVATE void sqlite3VdbeClearObject(sqlite3 *db, Vdbe *p){
SubProgram *pSub, *pNext;
int i;
assert( p->db==0 || p->db==db );
| < > > | | > > < | 73405 73406 73407 73408 73409 73410 73411 73412 73413 73414 73415 73416 73417 73418 73419 73420 73421 73422 73423 73424 73425 73426 73427 73428 73429 73430 73431 73432 73433 |
** VdbeDelete() also unlinks the Vdbe from the list of VMs associated with
** the database connection and frees the object itself.
*/
SQLITE_PRIVATE void sqlite3VdbeClearObject(sqlite3 *db, Vdbe *p){
SubProgram *pSub, *pNext;
int i;
assert( p->db==0 || p->db==db );
releaseMemArray(p->aColName, p->nResColumn*COLNAME_N);
for(pSub=p->pProgram; pSub; pSub=pNext){
pNext = pSub->pNext;
vdbeFreeOpArray(db, pSub->aOp, pSub->nOp);
sqlite3DbFree(db, pSub);
}
if( p->magic!=VDBE_MAGIC_INIT ){
releaseMemArray(p->aVar, p->nVar);
for(i=p->nzVar-1; i>=0; i--) sqlite3DbFree(db, p->azVar[i]);
sqlite3DbFree(db, p->azVar);
sqlite3DbFree(db, p->pFree);
}
vdbeFreeOpArray(db, p->aOp, p->nOp);
sqlite3DbFree(db, p->aColName);
sqlite3DbFree(db, p->zSql);
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
for(i=0; i<p->nScan; i++){
sqlite3DbFree(db, p->aScan[i].zName);
}
sqlite3DbFree(db, p->aScan);
#endif
}
|
| ︙ | ︙ | |||
76045 76046 76047 76048 76049 76050 76051 |
** of NULL.
*/
static Mem *columnMem(sqlite3_stmt *pStmt, int i){
Vdbe *pVm;
Mem *pOut;
pVm = (Vdbe *)pStmt;
| > | | > < < | < | 76048 76049 76050 76051 76052 76053 76054 76055 76056 76057 76058 76059 76060 76061 76062 76063 76064 76065 76066 76067 76068 |
** of NULL.
*/
static Mem *columnMem(sqlite3_stmt *pStmt, int i){
Vdbe *pVm;
Mem *pOut;
pVm = (Vdbe *)pStmt;
if( pVm==0 ) return (Mem*)columnNullValue();
assert( pVm->db );
sqlite3_mutex_enter(pVm->db->mutex);
if( pVm->pResultSet!=0 && i<pVm->nResColumn && i>=0 ){
pOut = &pVm->pResultSet[i];
}else{
sqlite3Error(pVm->db, SQLITE_RANGE);
pOut = (Mem*)columnNullValue();
}
return pOut;
}
/*
** This function is called after invoking an sqlite3_value_XXX function on a
|
| ︙ | ︙ | |||
76085 76086 76087 76088 76089 76090 76091 76092 76093 76094 76095 76096 76097 76098 |
/* If malloc() failed during an encoding conversion within an
** sqlite3_column_XXX API, then set the return code of the statement to
** SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR
** and _finalize() will return NOMEM.
*/
Vdbe *p = (Vdbe *)pStmt;
if( p ){
p->rc = sqlite3ApiExit(p->db, p->rc);
sqlite3_mutex_leave(p->db->mutex);
}
}
/**************************** sqlite3_column_ *******************************
** The following routines are used to access elements of the current row
| > > | 76087 76088 76089 76090 76091 76092 76093 76094 76095 76096 76097 76098 76099 76100 76101 76102 |
/* If malloc() failed during an encoding conversion within an
** sqlite3_column_XXX API, then set the return code of the statement to
** SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR
** and _finalize() will return NOMEM.
*/
Vdbe *p = (Vdbe *)pStmt;
if( p ){
assert( p->db!=0 );
assert( sqlite3_mutex_held(p->db->mutex) );
p->rc = sqlite3ApiExit(p->db, p->rc);
sqlite3_mutex_leave(p->db->mutex);
}
}
/**************************** sqlite3_column_ *******************************
** The following routines are used to access elements of the current row
|
| ︙ | ︙ | |||
76661 76662 76663 76664 76665 76666 76667 |
}
/*
** Return true if the prepared statement is in need of being reset.
*/
SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
Vdbe *v = (Vdbe*)pStmt;
| | | 76665 76666 76667 76668 76669 76670 76671 76672 76673 76674 76675 76676 76677 76678 76679 |
}
/*
** Return true if the prepared statement is in need of being reset.
*/
SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt *pStmt){
Vdbe *v = (Vdbe*)pStmt;
return v!=0 && v->magic==VDBE_MAGIC_RUN && v->pc>=0;
}
/*
** Return a pointer to the next prepared statement after pStmt associated
** with database connection pDb. If pStmt is NULL, return the first
** prepared statement for the database connection. Return NULL if there
** are no more.
|
| ︙ | ︙ | |||
78413 78414 78415 78416 78417 78418 78419 78420 78421 78422 78423 78424 78425 78426 78427 78428 78429 78430 78431 |
case OP_Null: { /* out2 */
int cnt;
u16 nullFlag;
pOut = out2Prerelease(p, pOp);
cnt = pOp->p3-pOp->p2;
assert( pOp->p3<=(p->nMem+1 - p->nCursor) );
pOut->flags = nullFlag = pOp->p1 ? (MEM_Null|MEM_Cleared) : MEM_Null;
while( cnt>0 ){
pOut++;
memAboutToChange(p, pOut);
sqlite3VdbeMemSetNull(pOut);
pOut->flags = nullFlag;
cnt--;
}
break;
}
/* Opcode: SoftNull P1 * * * *
** Synopsis: r[P1]=NULL
| > > | 78417 78418 78419 78420 78421 78422 78423 78424 78425 78426 78427 78428 78429 78430 78431 78432 78433 78434 78435 78436 78437 |
case OP_Null: { /* out2 */
int cnt;
u16 nullFlag;
pOut = out2Prerelease(p, pOp);
cnt = pOp->p3-pOp->p2;
assert( pOp->p3<=(p->nMem+1 - p->nCursor) );
pOut->flags = nullFlag = pOp->p1 ? (MEM_Null|MEM_Cleared) : MEM_Null;
pOut->n = 0;
while( cnt>0 ){
pOut++;
memAboutToChange(p, pOut);
sqlite3VdbeMemSetNull(pOut);
pOut->flags = nullFlag;
pOut->n = 0;
cnt--;
}
break;
}
/* Opcode: SoftNull P1 * * * *
** Synopsis: r[P1]=NULL
|
| ︙ | ︙ | |||
80485 80486 80487 80488 80489 80490 80491 |
** counter. If the statement transaction needs to be rolled back,
** the value of this counter needs to be restored too. */
p->nStmtDefCons = db->nDeferredCons;
p->nStmtDefImmCons = db->nDeferredImmCons;
}
/* Gather the schema version number for checking:
| | | | < | 80491 80492 80493 80494 80495 80496 80497 80498 80499 80500 80501 80502 80503 80504 80505 80506 80507 |
** counter. If the statement transaction needs to be rolled back,
** the value of this counter needs to be restored too. */
p->nStmtDefCons = db->nDeferredCons;
p->nStmtDefImmCons = db->nDeferredImmCons;
}
/* Gather the schema version number for checking:
** IMPLEMENTATION-OF: R-03189-51135 As each SQL statement runs, the schema
** version is checked to ensure that the schema has not changed since the
** SQL statement was prepared.
*/
sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&iMeta);
iGen = db->aDb[pOp->p1].pSchema->iGeneration;
}else{
iGen = iMeta = 0;
}
assert( pOp->p5==0 || pOp->p4type==P4_INT32 );
|
| ︙ | ︙ | |||
81744 81745 81746 81747 81748 81749 81750 | ** ** If the OPFLAG_NCHANGE flag of P2 (NB: P2 not P5) is set, then the row ** change count is incremented (otherwise not). ** ** P1 must not be pseudo-table. It has to be a real table with ** multiple rows. ** | | | 81749 81750 81751 81752 81753 81754 81755 81756 81757 81758 81759 81760 81761 81762 81763 | ** ** If the OPFLAG_NCHANGE flag of P2 (NB: P2 not P5) is set, then the row ** change count is incremented (otherwise not). ** ** P1 must not be pseudo-table. It has to be a real table with ** multiple rows. ** ** If P4 is not NULL then it points to a Table object. In this case either ** the update or pre-update hook, or both, may be invoked. The P1 cursor must ** have been positioned using OP_NotFound prior to invoking this opcode in ** this case. Specifically, if one is configured, the pre-update hook is ** invoked if P4 is not NULL. The update-hook is invoked if one is configured, ** P4 is not NULL, and the OPFLAG_NCHANGE flag is set in P2. ** ** If the OPFLAG_ISUPDATE flag is set in P2, then P3 contains the address |
| ︙ | ︙ | |||
82335 82336 82337 82338 82339 82340 82341 |
rc = ExpandBlob(pIn2);
if( rc ) goto abort_due_to_error;
if( pOp->opcode==OP_SorterInsert ){
rc = sqlite3VdbeSorterWrite(pC, pIn2);
}else{
x.nKey = pIn2->n;
x.pKey = pIn2->z;
| < < < | 82340 82341 82342 82343 82344 82345 82346 82347 82348 82349 82350 82351 82352 82353 |
rc = ExpandBlob(pIn2);
if( rc ) goto abort_due_to_error;
if( pOp->opcode==OP_SorterInsert ){
rc = sqlite3VdbeSorterWrite(pC, pIn2);
}else{
x.nKey = pIn2->n;
x.pKey = pIn2->z;
rc = sqlite3BtreeInsert(pC->uc.pCursor, &x, pOp->p3,
((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0)
);
assert( pC->deferredMoveto==0 );
pC->cacheStatus = CACHE_STALE;
}
if( rc) goto abort_due_to_error;
|
| ︙ | ︙ | |||
88034 88035 88036 88037 88038 88039 88040 |
** and WRC_Continue to continue.
*/
static SQLITE_NOINLINE int walkExpr(Walker *pWalker, Expr *pExpr){
int rc;
testcase( ExprHasProperty(pExpr, EP_TokenOnly) );
testcase( ExprHasProperty(pExpr, EP_Reduced) );
rc = pWalker->xExprCallback(pWalker, pExpr);
| | > > | 88036 88037 88038 88039 88040 88041 88042 88043 88044 88045 88046 88047 88048 88049 88050 88051 88052 |
** and WRC_Continue to continue.
*/
static SQLITE_NOINLINE int walkExpr(Walker *pWalker, Expr *pExpr){
int rc;
testcase( ExprHasProperty(pExpr, EP_TokenOnly) );
testcase( ExprHasProperty(pExpr, EP_Reduced) );
rc = pWalker->xExprCallback(pWalker, pExpr);
if( rc || ExprHasProperty(pExpr,(EP_TokenOnly|EP_Leaf)) ){
return rc & WRC_Abort;
}
if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort;
if( pExpr->pRight && walkExpr(pWalker, pExpr->pRight) ) return WRC_Abort;
if( ExprHasProperty(pExpr, EP_xIsSelect) ){
if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort;
}else if( pExpr->x.pList ){
if( sqlite3WalkExprList(pWalker, pExpr->x.pList) ) return WRC_Abort;
}
|
| ︙ | ︙ | |||
88778 88779 88780 88781 88782 88783 88784 |
const char *zColumn;
const char *zTable;
const char *zDb;
Expr *pRight;
/* if( pSrcList==0 ) break; */
notValid(pParse, pNC, "the \".\" operator", NC_IdxExpr);
| < | 88782 88783 88784 88785 88786 88787 88788 88789 88790 88791 88792 88793 88794 88795 |
const char *zColumn;
const char *zTable;
const char *zDb;
Expr *pRight;
/* if( pSrcList==0 ) break; */
notValid(pParse, pNC, "the \".\" operator", NC_IdxExpr);
pRight = pExpr->pRight;
if( pRight->op==TK_ID ){
zDb = 0;
zTable = pExpr->pLeft->u.zToken;
zColumn = pRight->u.zToken;
}else{
assert( pRight->op==TK_DOT );
|
| ︙ | ︙ | |||
88807 88808 88809 88810 88811 88812 88813 |
int is_agg = 0; /* True if is an aggregate function */
int nId; /* Number of characters in function name */
const char *zId; /* The function name. */
FuncDef *pDef; /* Information about the function */
u8 enc = ENC(pParse->db); /* The database encoding */
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
| | | 88810 88811 88812 88813 88814 88815 88816 88817 88818 88819 88820 88821 88822 88823 88824 |
int is_agg = 0; /* True if is an aggregate function */
int nId; /* Number of characters in function name */
const char *zId; /* The function name. */
FuncDef *pDef; /* Information about the function */
u8 enc = ENC(pParse->db); /* The database encoding */
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
// notValid(pParse, pNC, "functions", NC_PartIdx);
zId = pExpr->u.zToken;
nId = sqlite3Strlen30(zId);
pDef = sqlite3FindFunction(pParse->db, zId, n, enc, 0);
if( pDef==0 ){
pDef = sqlite3FindFunction(pParse->db, zId, -2, enc, 0);
if( pDef==0 ){
no_such_func = 1;
|
| ︙ | ︙ | |||
88867 88868 88869 88870 88871 88872 88873 |
** constant because they are constant for the duration of one query */
ExprSetProperty(pExpr,EP_ConstFunc);
}
if( (pDef->funcFlags & SQLITE_FUNC_CONSTANT)==0 ){
/* Date/time functions that use 'now', and other functions like
** sqlite_version() that might change over time cannot be used
** in an index. */
| | > | 88870 88871 88872 88873 88874 88875 88876 88877 88878 88879 88880 88881 88882 88883 88884 88885 |
** constant because they are constant for the duration of one query */
ExprSetProperty(pExpr,EP_ConstFunc);
}
if( (pDef->funcFlags & SQLITE_FUNC_CONSTANT)==0 ){
/* Date/time functions that use 'now', and other functions like
** sqlite_version() that might change over time cannot be used
** in an index. */
notValid(pParse, pNC, "non-deterministic functions",
NC_IdxExpr|NC_PartIdx);
}
}
if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){
sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
pNC->nErr++;
is_agg = 0;
}else if( no_such_func && pParse->db->init.busy==0
|
| ︙ | ︙ | |||
90407 90408 90409 90410 90411 90412 90413 | ** Special case: If op==TK_INTEGER and pToken points to a string that ** can be translated into a 32-bit integer, then the token is not ** stored in u.zToken. Instead, the integer values is written ** into u.iValue and the EP_IntValue flag is set. No extra storage ** is allocated to hold the integer text and the dequote flag is ignored. */ SQLITE_PRIVATE Expr *sqlite3ExprAlloc( | | | 90411 90412 90413 90414 90415 90416 90417 90418 90419 90420 90421 90422 90423 90424 90425 |
** Special case: If op==TK_INTEGER and pToken points to a string that
** can be translated into a 32-bit integer, then the token is not
** stored in u.zToken. Instead, the integer values is written
** into u.iValue and the EP_IntValue flag is set. No extra storage
** is allocated to hold the integer text and the dequote flag is ignored.
*/
SQLITE_PRIVATE Expr *sqlite3ExprAlloc(
sqlite3 *db, /* Handle for sqlite3DbMallocRawNN() */
int op, /* Expression opcode */
const Token *pToken, /* Token argument. Might be NULL */
int dequote /* True to dequote */
){
Expr *pNew;
int nExtra = 0;
int iValue = 0;
|
| ︙ | ︙ | |||
90625 90626 90627 90628 90629 90630 90631 | ** the SQL statement comes from an external source. ** ** Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number ** as the previous instance of the same wildcard. Or if this is the first ** instance of the wildcard, the next sequential variable number is ** assigned. */ | | > | < | < > | | | | | | | | | | | | | | | | < | | | < | > > > > > > > | < > | 90629 90630 90631 90632 90633 90634 90635 90636 90637 90638 90639 90640 90641 90642 90643 90644 90645 90646 90647 90648 90649 90650 90651 90652 90653 90654 90655 90656 90657 90658 90659 90660 90661 90662 90663 90664 90665 90666 90667 90668 90669 90670 90671 90672 90673 90674 90675 90676 90677 90678 90679 90680 90681 90682 90683 90684 90685 90686 90687 90688 90689 90690 90691 90692 90693 90694 90695 90696 90697 90698 90699 90700 90701 90702 90703 90704 90705 90706 90707 90708 90709 90710 90711 90712 90713 90714 90715 90716 90717 90718 90719 90720 90721 90722 90723 90724 90725 90726 90727 90728 90729 90730 90731 90732 90733 90734 90735 90736 90737 |
** the SQL statement comes from an external source.
**
** Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number
** as the previous instance of the same wildcard. Or if this is the first
** instance of the wildcard, the next sequential variable number is
** assigned.
*/
SQLITE_PRIVATE void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr, u32 n){
sqlite3 *db = pParse->db;
const char *z;
if( pExpr==0 ) return;
assert( !ExprHasProperty(pExpr, EP_IntValue|EP_Reduced|EP_TokenOnly) );
z = pExpr->u.zToken;
assert( z!=0 );
assert( z[0]!=0 );
assert( n==sqlite3Strlen30(z) );
if( z[1]==0 ){
/* Wildcard of the form "?". Assign the next variable number */
assert( z[0]=='?' );
pExpr->iColumn = (ynVar)(++pParse->nVar);
}else{
ynVar x;
if( z[0]=='?' ){
/* Wildcard of the form "?nnn". Convert "nnn" to an integer and
** use it as the variable number */
i64 i;
int bOk = 0==sqlite3Atoi64(&z[1], &i, n-1, SQLITE_UTF8);
x = (ynVar)i;
testcase( i==0 );
testcase( i==1 );
testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 );
testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] );
if( bOk==0 || i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
sqlite3ErrorMsg(pParse, "variable number must be between ?1 and ?%d",
db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]);
return;
}
if( i>pParse->nVar ){
pParse->nVar = (int)i;
}
}else{
/* Wildcards like ":aaa", "$aaa" or "@aaa". Reuse the same variable
** number as the prior appearance of the same name, or if the name
** has never appeared before, reuse the same variable number
*/
ynVar i;
for(i=x=0; i<pParse->nzVar; i++){
if( pParse->azVar[i] && strcmp(pParse->azVar[i],z)==0 ){
x = (ynVar)i+1;
break;
}
}
if( x==0 ) x = (ynVar)(++pParse->nVar);
}
pExpr->iColumn = x;
if( x>pParse->nzVar ){
char **a;
a = sqlite3DbRealloc(db, pParse->azVar, x*sizeof(a[0]));
if( a==0 ){
assert( db->mallocFailed ); /* Error reported through mallocFailed */
return;
}
pParse->azVar = a;
memset(&a[pParse->nzVar], 0, (x-pParse->nzVar)*sizeof(a[0]));
pParse->nzVar = x;
}
if( pParse->azVar[x-1]==0 ){
pParse->azVar[x-1] = sqlite3DbStrNDup(db, z, n);
}
}
if( pParse->nVar>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
sqlite3ErrorMsg(pParse, "too many SQL variables");
}
}
/*
** Recursively delete an expression tree.
*/
static SQLITE_NOINLINE void sqlite3ExprDeleteNN(sqlite3 *db, Expr *p){
assert( p!=0 );
/* Sanity check: Assert that the IntValue is non-negative if it exists */
assert( !ExprHasProperty(p, EP_IntValue) || p->u.iValue>=0 );
#ifdef SQLITE_DEBUG
if( ExprHasProperty(p, EP_Leaf) && !ExprHasProperty(p, EP_TokenOnly) ){
assert( p->pLeft==0 );
assert( p->pRight==0 );
assert( p->x.pSelect==0 );
}
#endif
if( !ExprHasProperty(p, (EP_TokenOnly|EP_Leaf)) ){
/* The Expr.x union is never used at the same time as Expr.pRight */
assert( p->x.pList==0 || p->pRight==0 );
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft);
sqlite3ExprDelete(db, p->pRight);
if( ExprHasProperty(p, EP_xIsSelect) ){
sqlite3SelectDelete(db, p->x.pSelect);
}else{
sqlite3ExprListDelete(db, p->x.pList);
}
}
if( ExprHasProperty(p, EP_MemToken) ) sqlite3DbFree(db, p->u.zToken);
if( !ExprHasProperty(p, EP_Static) ){
sqlite3DbFree(db, p);
}
}
SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){
if( p ) sqlite3ExprDeleteNN(db, p);
}
|
| ︙ | ︙ | |||
90891 90892 90893 90894 90895 90896 90897 |
/* Copy the p->u.zToken string, if any. */
if( nToken ){
char *zToken = pNew->u.zToken = (char*)&zAlloc[nNewSize];
memcpy(zToken, p->u.zToken, nToken);
}
| | | | | 90900 90901 90902 90903 90904 90905 90906 90907 90908 90909 90910 90911 90912 90913 90914 90915 90916 90917 90918 90919 90920 90921 90922 90923 90924 90925 90926 90927 90928 90929 90930 90931 90932 90933 90934 90935 90936 |
/* Copy the p->u.zToken string, if any. */
if( nToken ){
char *zToken = pNew->u.zToken = (char*)&zAlloc[nNewSize];
memcpy(zToken, p->u.zToken, nToken);
}
if( 0==((p->flags|pNew->flags) & (EP_TokenOnly|EP_Leaf)) ){
/* Fill in the pNew->x.pSelect or pNew->x.pList member. */
if( ExprHasProperty(p, EP_xIsSelect) ){
pNew->x.pSelect = sqlite3SelectDup(db, p->x.pSelect, dupFlags);
}else{
pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, dupFlags);
}
}
/* Fill in pNew->pLeft and pNew->pRight. */
if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly) ){
zAlloc += dupedExprNodeSize(p, dupFlags);
if( !ExprHasProperty(pNew, EP_TokenOnly|EP_Leaf) ){
pNew->pLeft = p->pLeft ?
exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0;
pNew->pRight = p->pRight ?
exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0;
}
if( pzBuffer ){
*pzBuffer = zAlloc;
}
}else{
if( !ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){
if( pNew->op==TK_SELECT_COLUMN ){
pNew->pLeft = p->pLeft;
}else{
pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
}
pNew->pRight = sqlite3ExprDup(db, p->pRight, 0);
}
|
| ︙ | ︙ | |||
92274 92275 92276 92277 92278 92279 92280 |
VdbeComment((v, "Init subquery result"));
}else{
dest.eDest = SRT_Exists;
sqlite3VdbeAddOp2(v, OP_Integer, 0, dest.iSDParm);
VdbeComment((v, "Init EXISTS result"));
}
sqlite3ExprDelete(pParse->db, pSel->pLimit);
| | | | 92283 92284 92285 92286 92287 92288 92289 92290 92291 92292 92293 92294 92295 92296 92297 92298 |
VdbeComment((v, "Init subquery result"));
}else{
dest.eDest = SRT_Exists;
sqlite3VdbeAddOp2(v, OP_Integer, 0, dest.iSDParm);
VdbeComment((v, "Init EXISTS result"));
}
sqlite3ExprDelete(pParse->db, pSel->pLimit);
pSel->pLimit = sqlite3ExprAlloc(pParse->db, TK_INTEGER,
&sqlite3IntTokens[1], 0);
pSel->iLimit = 0;
pSel->selFlags &= ~SF_MultiValue;
if( sqlite3Select(pParse, pSel, &dest) ){
return 0;
}
rReg = dest.iSDParm;
ExprSetVVAProperty(pExpr, EP_NoReduce);
|
| ︙ | ︙ | |||
92644 92645 92646 92647 92648 92649 92650 |
codeReal(v, z, negFlag, iMem);
}
#endif
}
}
}
| < < < < < < < < < < < | < < | | | < < | > > | 92653 92654 92655 92656 92657 92658 92659 92660 92661 92662 92663 92664 92665 92666 92667 92668 92669 92670 92671 92672 92673 92674 92675 92676 92677 92678 92679 |
codeReal(v, z, negFlag, iMem);
}
#endif
}
}
}
/*
** Erase column-cache entry number i
*/
static void cacheEntryClear(Parse *pParse, int i){
if( pParse->aColCache[i].tempReg ){
if( pParse->nTempReg<ArraySize(pParse->aTempReg) ){
pParse->aTempReg[pParse->nTempReg++] = pParse->aColCache[i].iReg;
}
}
pParse->nColCache--;
if( i<pParse->nColCache ){
pParse->aColCache[i] = pParse->aColCache[pParse->nColCache];
}
}
/*
** Record in the column cache that a particular column from a
** particular table is stored in a particular register.
*/
|
| ︙ | ︙ | |||
92699 92700 92701 92702 92703 92704 92705 | /* First replace any existing entry. ** ** Actually, the way the column cache is currently used, we are guaranteed ** that the object will never already be in cache. Verify this guarantee. */ #ifndef NDEBUG | | | | < < < < < < < < | < < < < < < | | | | | | | | | > | > > > | | | | | | < < < | | | < | | < > > > | 92695 92696 92697 92698 92699 92700 92701 92702 92703 92704 92705 92706 92707 92708 92709 92710 92711 92712 92713 92714 92715 92716 92717 92718 92719 92720 92721 92722 92723 92724 92725 92726 92727 92728 92729 92730 92731 92732 92733 92734 92735 92736 92737 92738 92739 92740 92741 92742 92743 92744 92745 92746 92747 92748 92749 92750 |
/* First replace any existing entry.
**
** Actually, the way the column cache is currently used, we are guaranteed
** that the object will never already be in cache. Verify this guarantee.
*/
#ifndef NDEBUG
for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
assert( p->iTable!=iTab || p->iColumn!=iCol );
}
#endif
/* If the cache is already full, delete the least recently used entry */
if( pParse->nColCache>=SQLITE_N_COLCACHE ){
minLru = 0x7fffffff;
idxLru = -1;
for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
if( p->lru<minLru ){
idxLru = i;
minLru = p->lru;
}
}
p = &pParse->aColCache[idxLru];
}else{
p = &pParse->aColCache[pParse->nColCache++];
}
/* Add the new entry to the end of the cache */
p->iLevel = pParse->iCacheLevel;
p->iTable = iTab;
p->iColumn = iCol;
p->iReg = iReg;
p->tempReg = 0;
p->lru = pParse->iCacheCnt++;
}
/*
** Indicate that registers between iReg..iReg+nReg-1 are being overwritten.
** Purge the range of registers from the column cache.
*/
SQLITE_PRIVATE void sqlite3ExprCacheRemove(Parse *pParse, int iReg, int nReg){
int i = 0;
while( i<pParse->nColCache ){
struct yColCache *p = &pParse->aColCache[i];
if( p->iReg >= iReg && p->iReg < iReg+nReg ){
cacheEntryClear(pParse, i);
}else{
i++;
}
}
}
/*
** Remember the current column cache context. Any new entries added
** added to the column cache after this call are removed when the
** corresponding pop occurs.
|
| ︙ | ︙ | |||
92776 92777 92778 92779 92780 92781 92782 |
/*
** Remove from the column cache any entries that were added since the
** the previous sqlite3ExprCachePush operation. In other words, restore
** the cache to the state it was in prior the most recent Push.
*/
SQLITE_PRIVATE void sqlite3ExprCachePop(Parse *pParse){
| | < | | | > > | | 92760 92761 92762 92763 92764 92765 92766 92767 92768 92769 92770 92771 92772 92773 92774 92775 92776 92777 92778 92779 92780 92781 92782 92783 92784 92785 92786 92787 92788 92789 92790 92791 92792 92793 92794 92795 92796 92797 92798 92799 92800 |
/*
** Remove from the column cache any entries that were added since the
** the previous sqlite3ExprCachePush operation. In other words, restore
** the cache to the state it was in prior the most recent Push.
*/
SQLITE_PRIVATE void sqlite3ExprCachePop(Parse *pParse){
int i = 0;
assert( pParse->iCacheLevel>=1 );
pParse->iCacheLevel--;
#ifdef SQLITE_DEBUG
if( pParse->db->flags & SQLITE_VdbeAddopTrace ){
printf("POP to %d\n", pParse->iCacheLevel);
}
#endif
while( i<pParse->nColCache ){
if( pParse->aColCache[i].iLevel>pParse->iCacheLevel ){
cacheEntryClear(pParse, i);
}else{
i++;
}
}
}
/*
** When a cached column is reused, make sure that its register is
** no longer available as a temp register. ticket #3879: that same
** register might be in the cache in multiple places, so be sure to
** get them all.
*/
static void sqlite3ExprCachePinRegister(Parse *pParse, int iReg){
int i;
struct yColCache *p;
for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
if( p->iReg==iReg ){
p->tempReg = 0;
}
}
}
/* Generate code that will load into register regOut a value that is
|
| ︙ | ︙ | |||
92879 92880 92881 92882 92883 92884 92885 |
int iReg, /* Store results here */
u8 p5 /* P5 value for OP_Column + FLAGS */
){
Vdbe *v = pParse->pVdbe;
int i;
struct yColCache *p;
| | | | 92864 92865 92866 92867 92868 92869 92870 92871 92872 92873 92874 92875 92876 92877 92878 92879 |
int iReg, /* Store results here */
u8 p5 /* P5 value for OP_Column + FLAGS */
){
Vdbe *v = pParse->pVdbe;
int i;
struct yColCache *p;
for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
if( p->iTable==iTable && p->iColumn==iColumn ){
p->lru = pParse->iCacheCnt++;
sqlite3ExprCachePinRegister(pParse, p->iReg);
return p->iReg;
}
}
assert( v!=0 );
sqlite3ExprCodeGetColumnOfTable(v, pTab, iTable, iColumn, iReg);
|
| ︙ | ︙ | |||
92912 92913 92914 92915 92916 92917 92918 |
/*
** Clear all column cache entries.
*/
SQLITE_PRIVATE void sqlite3ExprCacheClear(Parse *pParse){
int i;
| < > | > | | > | 92897 92898 92899 92900 92901 92902 92903 92904 92905 92906 92907 92908 92909 92910 92911 92912 92913 92914 92915 92916 92917 92918 92919 92920 92921 92922 92923 92924 |
/*
** Clear all column cache entries.
*/
SQLITE_PRIVATE void sqlite3ExprCacheClear(Parse *pParse){
int i;
#if SQLITE_DEBUG
if( pParse->db->flags & SQLITE_VdbeAddopTrace ){
printf("CLEAR\n");
}
#endif
for(i=0; i<pParse->nColCache; i++){
if( pParse->aColCache[i].tempReg
&& pParse->nTempReg<ArraySize(pParse->aTempReg)
){
pParse->aTempReg[pParse->nTempReg++] = pParse->aColCache[i].iReg;
}
}
pParse->nColCache = 0;
}
/*
** Record the fact that an affinity change has occurred on iCount
** registers starting with iStart.
*/
SQLITE_PRIVATE void sqlite3ExprCacheAffinityChange(Parse *pParse, int iStart, int iCount){
|
| ︙ | ︙ | |||
92955 92956 92957 92958 92959 92960 92961 |
**
** This routine is used within assert() and testcase() macros only
** and does not appear in a normal build.
*/
static int usedAsColumnCache(Parse *pParse, int iFrom, int iTo){
int i;
struct yColCache *p;
| | | 92942 92943 92944 92945 92946 92947 92948 92949 92950 92951 92952 92953 92954 92955 92956 |
**
** This routine is used within assert() and testcase() macros only
** and does not appear in a normal build.
*/
static int usedAsColumnCache(Parse *pParse, int iFrom, int iTo){
int i;
struct yColCache *p;
for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
int r = p->iReg;
if( r>=iFrom && r<=iTo ) return 1; /*NO_TEST*/
}
return 0;
}
#endif /* SQLITE_DEBUG || SQLITE_COVERAGE_TEST */
|
| ︙ | ︙ | |||
94651 94652 94653 94654 94655 94656 94657 |
** the deallocation is deferred until the column cache line that uses
** the register becomes stale.
*/
SQLITE_PRIVATE void sqlite3ReleaseTempReg(Parse *pParse, int iReg){
if( iReg && pParse->nTempReg<ArraySize(pParse->aTempReg) ){
int i;
struct yColCache *p;
| | | 94638 94639 94640 94641 94642 94643 94644 94645 94646 94647 94648 94649 94650 94651 94652 |
** the deallocation is deferred until the column cache line that uses
** the register becomes stale.
*/
SQLITE_PRIVATE void sqlite3ReleaseTempReg(Parse *pParse, int iReg){
if( iReg && pParse->nTempReg<ArraySize(pParse->aTempReg) ){
int i;
struct yColCache *p;
for(i=0, p=pParse->aColCache; i<pParse->nColCache; i++, p++){
if( p->iReg==iReg ){
p->tempReg = 1;
return;
}
}
pParse->aTempReg[pParse->nTempReg++] = iReg;
}
|
| ︙ | ︙ | |||
97957 97958 97959 97960 97961 97962 97963 |
if( pFix->pParse->db->init.busy ){
pExpr->op = TK_NULL;
}else{
sqlite3ErrorMsg(pFix->pParse, "%s cannot use variables", pFix->zType);
return 1;
}
}
| | | 97944 97945 97946 97947 97948 97949 97950 97951 97952 97953 97954 97955 97956 97957 97958 |
if( pFix->pParse->db->init.busy ){
pExpr->op = TK_NULL;
}else{
sqlite3ErrorMsg(pFix->pParse, "%s cannot use variables", pFix->zType);
return 1;
}
}
if( ExprHasProperty(pExpr, EP_TokenOnly|EP_Leaf) ) break;
if( ExprHasProperty(pExpr, EP_xIsSelect) ){
if( sqlite3FixSelect(pFix, pExpr->x.pSelect) ) return 1;
}else{
if( sqlite3FixExprList(pFix, pExpr->x.pList) ) return 1;
}
if( sqlite3FixExpr(pFix, pExpr->pRight) ){
return 1;
|
| ︙ | ︙ | |||
98421 98422 98423 98424 98425 98426 98427 |
/* Begin by generating some termination code at the end of the
** vdbe program
*/
v = sqlite3GetVdbe(pParse);
assert( !pParse->isMultiWrite
|| sqlite3VdbeAssertMayAbort(v, pParse->mayAbort));
if( v ){
| < | 98408 98409 98410 98411 98412 98413 98414 98415 98416 98417 98418 98419 98420 98421 |
/* Begin by generating some termination code at the end of the
** vdbe program
*/
v = sqlite3GetVdbe(pParse);
assert( !pParse->isMultiWrite
|| sqlite3VdbeAssertMayAbort(v, pParse->mayAbort));
if( v ){
sqlite3VdbeAddOp0(v, OP_Halt);
#if SQLITE_USER_AUTHENTICATION
if( pParse->nTableLock>0 && db->init.busy==0 ){
sqlite3UserAuthInit(db);
if( db->auth.authLevel<UAUTH_User ){
sqlite3ErrorMsg(pParse, "user not authenticated");
|
| ︙ | ︙ | |||
98448 98449 98450 98451 98452 98453 98454 98455 98456 98457 98458 98459 98460 |
if( db->mallocFailed==0
&& (DbMaskNonZero(pParse->cookieMask) || pParse->pConstExpr)
){
int iDb, i;
assert( sqlite3VdbeGetOp(v, 0)->opcode==OP_Init );
sqlite3VdbeJumpHere(v, 0);
for(iDb=0; iDb<db->nDb; iDb++){
if( DbMaskTest(pParse->cookieMask, iDb)==0 ) continue;
sqlite3VdbeUsesBtree(v, iDb);
sqlite3VdbeAddOp4Int(v,
OP_Transaction, /* Opcode */
iDb, /* P1 */
DbMaskTest(pParse->writeMask,iDb), /* P2 */
| > > | | | 98434 98435 98436 98437 98438 98439 98440 98441 98442 98443 98444 98445 98446 98447 98448 98449 98450 98451 98452 98453 98454 98455 98456 98457 |
if( db->mallocFailed==0
&& (DbMaskNonZero(pParse->cookieMask) || pParse->pConstExpr)
){
int iDb, i;
assert( sqlite3VdbeGetOp(v, 0)->opcode==OP_Init );
sqlite3VdbeJumpHere(v, 0);
for(iDb=0; iDb<db->nDb; iDb++){
Schema *pSchema;
if( DbMaskTest(pParse->cookieMask, iDb)==0 ) continue;
sqlite3VdbeUsesBtree(v, iDb);
pSchema = db->aDb[iDb].pSchema;
sqlite3VdbeAddOp4Int(v,
OP_Transaction, /* Opcode */
iDb, /* P1 */
DbMaskTest(pParse->writeMask,iDb), /* P2 */
pSchema->schema_cookie, /* P3 */
pSchema->iGeneration /* P4 */
);
if( db->init.busy==0 ) sqlite3VdbeChangeP5(v, 1);
VdbeComment((v,
"usesStmtJournal=%d", pParse->mayAbort && pParse->isMultiWrite));
}
#ifndef SQLITE_OMIT_VIRTUALTABLE
for(i=0; i<pParse->nVtabLock; i++){
|
| ︙ | ︙ | |||
98506 98507 98508 98509 98510 98511 98512 |
* See ticket [a696379c1f08866] */
if( pParse->pAinc!=0 && pParse->nTab==0 ) pParse->nTab = 1;
sqlite3VdbeMakeReady(v, pParse);
pParse->rc = SQLITE_DONE;
}else{
pParse->rc = SQLITE_ERROR;
}
| < < < < < < < < < < < | | | | | 98494 98495 98496 98497 98498 98499 98500 98501 98502 98503 98504 98505 98506 98507 98508 98509 98510 98511 98512 98513 98514 98515 98516 98517 98518 98519 98520 98521 98522 98523 98524 98525 98526 98527 98528 98529 98530 98531 98532 98533 98534 98535 98536 98537 98538 98539 98540 98541 98542 98543 |
* See ticket [a696379c1f08866] */
if( pParse->pAinc!=0 && pParse->nTab==0 ) pParse->nTab = 1;
sqlite3VdbeMakeReady(v, pParse);
pParse->rc = SQLITE_DONE;
}else{
pParse->rc = SQLITE_ERROR;
}
}
/*
** Run the parser and code generator recursively in order to generate
** code for the SQL statement given onto the end of the pParse context
** currently under construction. When the parser is run recursively
** this way, the final OP_Halt is not appended and other initialization
** and finalization steps are omitted because those are handling by the
** outermost parser.
**
** Not everything is nestable. This facility is designed to permit
** INSERT, UPDATE, and DELETE operations against SQLITE_MASTER. Use
** care if you decide to try to use this routine for some other purposes.
*/
SQLITE_PRIVATE void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){
va_list ap;
char *zSql;
char *zErrMsg = 0;
sqlite3 *db = pParse->db;
char saveBuf[PARSE_TAIL_SZ];
if( pParse->nErr ) return;
assert( pParse->nested<10 ); /* Nesting should only be of limited depth */
va_start(ap, zFormat);
zSql = sqlite3VMPrintf(db, zFormat, ap);
va_end(ap);
if( zSql==0 ){
return; /* A malloc must have failed */
}
pParse->nested++;
memcpy(saveBuf, PARSE_TAIL(pParse), PARSE_TAIL_SZ);
memset(PARSE_TAIL(pParse), 0, PARSE_TAIL_SZ);
sqlite3RunParser(pParse, zSql, &zErrMsg);
sqlite3DbFree(db, zErrMsg);
sqlite3DbFree(db, zSql);
memcpy(PARSE_TAIL(pParse), saveBuf, PARSE_TAIL_SZ);
pParse->nested--;
}
#if SQLITE_USER_AUTHENTICATION
/*
** Return TRUE if zTable is the name of the system table that stores the
** list of users and their access credentials.
|
| ︙ | ︙ | |||
99733 99734 99735 99736 99737 99738 99739 99740 99741 99742 99743 99744 99745 99746 |
** since it was last read.
**
** This plan is not completely bullet-proof. It is possible for
** the schema to change multiple times and for the cookie to be
** set back to prior value. But schema changes are infrequent
** and the probability of hitting the same cookie value is only
** 1 chance in 2^32. So we're safe enough.
*/
SQLITE_PRIVATE void sqlite3ChangeCookie(Parse *pParse, int iDb){
sqlite3 *db = pParse->db;
Vdbe *v = pParse->pVdbe;
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION,
db->aDb[iDb].pSchema->schema_cookie+1);
| > > > | 99710 99711 99712 99713 99714 99715 99716 99717 99718 99719 99720 99721 99722 99723 99724 99725 99726 |
** since it was last read.
**
** This plan is not completely bullet-proof. It is possible for
** the schema to change multiple times and for the cookie to be
** set back to prior value. But schema changes are infrequent
** and the probability of hitting the same cookie value is only
** 1 chance in 2^32. So we're safe enough.
**
** IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments
** the schema-version whenever the schema changes.
*/
SQLITE_PRIVATE void sqlite3ChangeCookie(Parse *pParse, int iDb){
sqlite3 *db = pParse->db;
Vdbe *v = pParse->pVdbe;
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION,
db->aDb[iDb].pSchema->schema_cookie+1);
|
| ︙ | ︙ | |||
102316 102317 102318 102319 102320 102321 102322 |
** Record the fact that the schema cookie will need to be verified
** for database iDb. The code to actually verify the schema cookie
** will occur at the end of the top-level VDBE and will be generated
** later, by sqlite3FinishCoding().
*/
SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
Parse *pToplevel = sqlite3ParseToplevel(pParse);
| < | | | < | 102296 102297 102298 102299 102300 102301 102302 102303 102304 102305 102306 102307 102308 102309 102310 102311 102312 102313 102314 102315 102316 |
** Record the fact that the schema cookie will need to be verified
** for database iDb. The code to actually verify the schema cookie
** will occur at the end of the top-level VDBE and will be generated
** later, by sqlite3FinishCoding().
*/
SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
Parse *pToplevel = sqlite3ParseToplevel(pParse);
assert( iDb>=0 && iDb<pParse->db->nDb );
assert( pParse->db->aDb[iDb].pBt!=0 || iDb==1 );
assert( iDb<SQLITE_MAX_ATTACHED+2 );
assert( sqlite3SchemaMutexHeld(pParse->db, iDb, 0) );
if( DbMaskTest(pToplevel->cookieMask, iDb)==0 ){
DbMaskSet(pToplevel->cookieMask, iDb);
if( !OMIT_TEMPDB && iDb==1 ){
sqlite3OpenTempDatabase(pToplevel);
}
}
}
/*
|
| ︙ | ︙ | |||
107190 107191 107192 107193 107194 107195 107196 |
sqlite3ExprAlloc(db, TK_ID, &tToCol, 0)
, 0);
}else if( action==OE_SetDflt ){
Expr *pDflt = pFKey->pFrom->aCol[iFromCol].pDflt;
if( pDflt ){
pNew = sqlite3ExprDup(db, pDflt, 0);
}else{
| | | | 107168 107169 107170 107171 107172 107173 107174 107175 107176 107177 107178 107179 107180 107181 107182 107183 107184 107185 |
sqlite3ExprAlloc(db, TK_ID, &tToCol, 0)
, 0);
}else if( action==OE_SetDflt ){
Expr *pDflt = pFKey->pFrom->aCol[iFromCol].pDflt;
if( pDflt ){
pNew = sqlite3ExprDup(db, pDflt, 0);
}else{
pNew = sqlite3ExprAlloc(db, TK_NULL, 0, 0);
}
}else{
pNew = sqlite3ExprAlloc(db, TK_NULL, 0, 0);
}
pList = sqlite3ExprListAppend(pParse, pList, pNew);
sqlite3ExprListSetName(pParse, pList, &tFromCol, 0);
}
}
sqlite3DbFree(db, aiCol);
|
| ︙ | ︙ | |||
109536 109537 109538 109539 109540 109541 109542 109543 109544 109545 109546 109547 109548 109549 |
sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
}
if( emptySrcTest ) sqlite3VdbeJumpHere(v, emptySrcTest);
sqlite3ReleaseTempReg(pParse, regRowid);
sqlite3ReleaseTempReg(pParse, regData);
if( emptyDestTest ){
sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_OK, 0);
sqlite3VdbeJumpHere(v, emptyDestTest);
sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
return 0;
}else{
return 1;
}
| > | 109514 109515 109516 109517 109518 109519 109520 109521 109522 109523 109524 109525 109526 109527 109528 |
sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
}
if( emptySrcTest ) sqlite3VdbeJumpHere(v, emptySrcTest);
sqlite3ReleaseTempReg(pParse, regRowid);
sqlite3ReleaseTempReg(pParse, regData);
if( emptyDestTest ){
sqlite3AutoincrementEnd(pParse);
sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_OK, 0);
sqlite3VdbeJumpHere(v, emptyDestTest);
sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
return 0;
}else{
return 1;
}
|
| ︙ | ︙ | |||
114032 114033 114034 114035 114036 114037 114038 |
const char *zSql, /* UTF-8 encoded SQL statement. */
int nBytes, /* Length of zSql in bytes. */
int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
Vdbe *pReprepare, /* VM being reprepared */
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
const char **pzTail /* OUT: End of parsed string */
){
| < < | < < < < | > > | | 114011 114012 114013 114014 114015 114016 114017 114018 114019 114020 114021 114022 114023 114024 114025 114026 114027 114028 114029 114030 114031 114032 |
const char *zSql, /* UTF-8 encoded SQL statement. */
int nBytes, /* Length of zSql in bytes. */
int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
Vdbe *pReprepare, /* VM being reprepared */
sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
const char **pzTail /* OUT: End of parsed string */
){
char *zErrMsg = 0; /* Error message */
int rc = SQLITE_OK; /* Result code */
int i; /* Loop counter */
Parse sParse; /* Parsing context */
memset(&sParse, 0, PARSE_HDR_SZ);
memset(PARSE_TAIL(&sParse), 0, PARSE_TAIL_SZ);
sParse.pReprepare = pReprepare;
assert( ppStmt && *ppStmt==0 );
/* assert( !db->mallocFailed ); // not true with SQLITE_USE_ALLOCA */
assert( sqlite3_mutex_held(db->mutex) );
/* Check to verify that it is possible to get a read lock on all
** database schemas. The inability to get a read lock indicates that
** some other database connection is holding a write-lock, which in
|
| ︙ | ︙ | |||
114087 114088 114089 114090 114091 114092 114093 |
goto end_prepare;
}
}
}
sqlite3VtabUnlockList(db);
| | < | | | | | | | | | | | | | | | | | | | | | | | | | < | 114062 114063 114064 114065 114066 114067 114068 114069 114070 114071 114072 114073 114074 114075 114076 114077 114078 114079 114080 114081 114082 114083 114084 114085 114086 114087 114088 114089 114090 114091 114092 114093 114094 114095 114096 114097 114098 114099 114100 114101 114102 114103 114104 114105 114106 114107 114108 114109 114110 114111 114112 114113 114114 114115 114116 114117 114118 114119 114120 114121 114122 114123 114124 114125 114126 114127 114128 114129 114130 114131 114132 114133 114134 114135 114136 114137 114138 114139 114140 114141 114142 114143 114144 114145 114146 114147 114148 114149 114150 114151 114152 114153 114154 114155 114156 114157 114158 114159 114160 114161 114162 |
goto end_prepare;
}
}
}
sqlite3VtabUnlockList(db);
sParse.db = db;
if( nBytes>=0 && (nBytes==0 || zSql[nBytes-1]!=0) ){
char *zSqlCopy;
int mxLen = db->aLimit[SQLITE_LIMIT_SQL_LENGTH];
testcase( nBytes==mxLen );
testcase( nBytes==mxLen+1 );
if( nBytes>mxLen ){
sqlite3ErrorWithMsg(db, SQLITE_TOOBIG, "statement too long");
rc = sqlite3ApiExit(db, SQLITE_TOOBIG);
goto end_prepare;
}
zSqlCopy = sqlite3DbStrNDup(db, zSql, nBytes);
if( zSqlCopy ){
sqlite3RunParser(&sParse, zSqlCopy, &zErrMsg);
sParse.zTail = &zSql[sParse.zTail-zSqlCopy];
sqlite3DbFree(db, zSqlCopy);
}else{
sParse.zTail = &zSql[nBytes];
}
}else{
sqlite3RunParser(&sParse, zSql, &zErrMsg);
}
assert( 0==sParse.nQueryLoop );
if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK;
if( sParse.checkSchema ){
schemaIsValid(&sParse);
}
if( db->mallocFailed ){
sParse.rc = SQLITE_NOMEM_BKPT;
}
if( pzTail ){
*pzTail = sParse.zTail;
}
rc = sParse.rc;
#ifndef SQLITE_OMIT_EXPLAIN
if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){
static const char * const azColName[] = {
"addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment",
"selectid", "order", "from", "detail"
};
int iFirst, mx;
if( sParse.explain==2 ){
sqlite3VdbeSetNumCols(sParse.pVdbe, 4);
iFirst = 8;
mx = 12;
}else{
sqlite3VdbeSetNumCols(sParse.pVdbe, 8);
iFirst = 0;
mx = 8;
}
for(i=iFirst; i<mx; i++){
sqlite3VdbeSetColName(sParse.pVdbe, i-iFirst, COLNAME_NAME,
azColName[i], SQLITE_STATIC);
}
}
#endif
if( db->init.busy==0 ){
Vdbe *pVdbe = sParse.pVdbe;
sqlite3VdbeSetSql(pVdbe, zSql, (int)(sParse.zTail-zSql), saveSqlFlag);
}
if( sParse.pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){
sqlite3VdbeFinalize(sParse.pVdbe);
assert(!(*ppStmt));
}else{
*ppStmt = (sqlite3_stmt*)sParse.pVdbe;
}
if( zErrMsg ){
sqlite3ErrorWithMsg(db, rc, "%s", zErrMsg);
sqlite3DbFree(db, zErrMsg);
}else{
sqlite3Error(db, rc);
}
/* Delete any TriggerPrg structures allocated while parsing this statement. */
while( sParse.pTriggerPrg ){
TriggerPrg *pT = sParse.pTriggerPrg;
sParse.pTriggerPrg = pT->pNext;
sqlite3DbFree(db, pT);
}
end_prepare:
sqlite3ParserReset(&sParse);
rc = sqlite3ApiExit(db, rc);
assert( (rc&db->errMask)==rc );
return rc;
}
static int sqlite3LockAndPrepare(
sqlite3 *db, /* Database handle. */
const char *zSql, /* UTF-8 encoded SQL statement. */
|
| ︙ | ︙ | |||
115380 115381 115382 115383 115384 115385 115386 |
/*
** Allocate a KeyInfo object sufficient for an index of N key columns and
** X extra columns.
*/
SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3 *db, int N, int X){
int nExtra = (N+X)*(sizeof(CollSeq*)+1);
| | | 115353 115354 115355 115356 115357 115358 115359 115360 115361 115362 115363 115364 115365 115366 115367 |
/*
** Allocate a KeyInfo object sufficient for an index of N key columns and
** X extra columns.
*/
SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3 *db, int N, int X){
int nExtra = (N+X)*(sizeof(CollSeq*)+1);
KeyInfo *p = sqlite3DbMallocRawNN(db, sizeof(KeyInfo) + nExtra);
if( p ){
p->aSortOrder = (u8*)&p->aColl[N+X];
p->nField = (u16)N;
p->nXField = (u16)X;
p->enc = ENC(db);
p->db = db;
p->nRef = 1;
|
| ︙ | ︙ | |||
118070 118071 118072 118073 118074 118075 118076 |
pSub->pOrderBy = 0;
}
pWhere = sqlite3ExprDup(db, pSub->pWhere, 0);
if( subqueryIsAgg ){
assert( pParent->pHaving==0 );
pParent->pHaving = pParent->pWhere;
pParent->pWhere = pWhere;
| | | > | | 118043 118044 118045 118046 118047 118048 118049 118050 118051 118052 118053 118054 118055 118056 118057 118058 118059 118060 118061 118062 118063 |
pSub->pOrderBy = 0;
}
pWhere = sqlite3ExprDup(db, pSub->pWhere, 0);
if( subqueryIsAgg ){
assert( pParent->pHaving==0 );
pParent->pHaving = pParent->pWhere;
pParent->pWhere = pWhere;
pParent->pHaving = sqlite3ExprAnd(db,
sqlite3ExprDup(db, pSub->pHaving, 0), pParent->pHaving
);
assert( pParent->pGroupBy==0 );
pParent->pGroupBy = sqlite3ExprListDup(db, pSub->pGroupBy, 0);
}else{
pParent->pWhere = sqlite3ExprAnd(db, pWhere, pParent->pWhere);
}
substSelect(db, pParent, iParent, pSub->pEList, 0);
/* The flattened query is distinct if either the inner or the
** outer query is distinct.
*/
pParent->selFlags |= pSub->selFlags & SF_Distinct;
|
| ︙ | ︙ | |||
124039 124040 124041 124042 124043 124044 124045 124046 124047 124048 124049 124050 124051 124052 124053 |
**
** The number of terms in a join is limited by the number of bits
** in prereqRight and prereqAll. The default is 64 bits, hence SQLite
** is only able to process joins with 64 or fewer tables.
*/
struct WhereTerm {
Expr *pExpr; /* Pointer to the subexpression that is this term */
int iParent; /* Disable pWC->a[iParent] when this term disabled */
int leftCursor; /* Cursor number of X in "X <op> <expr>" */
int iField; /* Field in (?,?,?) IN (SELECT...) vector */
union {
int leftColumn; /* Column number of X in "X <op> <expr>" */
WhereOrInfo *pOrInfo; /* Extra information if (eOperator & WO_OR)!=0 */
WhereAndInfo *pAndInfo; /* Extra information if (eOperator& WO_AND)!=0 */
} u;
| > > > > > > < < < < < < | 124013 124014 124015 124016 124017 124018 124019 124020 124021 124022 124023 124024 124025 124026 124027 124028 124029 124030 124031 124032 124033 124034 124035 124036 124037 124038 124039 124040 |
**
** The number of terms in a join is limited by the number of bits
** in prereqRight and prereqAll. The default is 64 bits, hence SQLite
** is only able to process joins with 64 or fewer tables.
*/
struct WhereTerm {
Expr *pExpr; /* Pointer to the subexpression that is this term */
WhereClause *pWC; /* The clause this term is part of */
LogEst truthProb; /* Probability of truth for this expression */
u16 wtFlags; /* TERM_xxx bit flags. See below */
u16 eOperator; /* A WO_xx value describing <op> */
u8 nChild; /* Number of children that must disable us */
u8 eMatchOp; /* Op for vtab MATCH/LIKE/GLOB/REGEXP terms */
int iParent; /* Disable pWC->a[iParent] when this term disabled */
int leftCursor; /* Cursor number of X in "X <op> <expr>" */
int iField; /* Field in (?,?,?) IN (SELECT...) vector */
union {
int leftColumn; /* Column number of X in "X <op> <expr>" */
WhereOrInfo *pOrInfo; /* Extra information if (eOperator & WO_OR)!=0 */
WhereAndInfo *pAndInfo; /* Extra information if (eOperator& WO_AND)!=0 */
} u;
Bitmask prereqRight; /* Bitmask of tables used by pExpr->pRight */
Bitmask prereqAll; /* Bitmask of tables referenced by pExpr */
};
/*
** Allowed values of WhereTerm.wtFlags
*/
|
| ︙ | ︙ | |||
124205 124206 124207 124208 124209 124210 124211 |
** planner.
*/
struct WhereInfo {
Parse *pParse; /* Parsing and code generating context */
SrcList *pTabList; /* List of tables in the join */
ExprList *pOrderBy; /* The ORDER BY clause or NULL */
ExprList *pDistinctSet; /* DISTINCT over all these values */
| < < < > > > > > < | | | | < | 124179 124180 124181 124182 124183 124184 124185 124186 124187 124188 124189 124190 124191 124192 124193 124194 124195 124196 124197 124198 124199 124200 124201 124202 124203 124204 124205 124206 124207 124208 124209 124210 124211 |
** planner.
*/
struct WhereInfo {
Parse *pParse; /* Parsing and code generating context */
SrcList *pTabList; /* List of tables in the join */
ExprList *pOrderBy; /* The ORDER BY clause or NULL */
ExprList *pDistinctSet; /* DISTINCT over all these values */
LogEst iLimit; /* LIMIT if wctrlFlags has WHERE_USE_LIMIT */
int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */
int iContinue; /* Jump here to continue with next record */
int iBreak; /* Jump here to break out of the loop */
int savedNQueryLoop; /* pParse->nQueryLoop outside the WHERE loop */
u16 wctrlFlags; /* Flags originally passed to sqlite3WhereBegin() */
u8 nLevel; /* Number of nested loop */
i8 nOBSat; /* Number of ORDER BY terms satisfied by indices */
u8 sorted; /* True if really sorted (not just grouped) */
u8 eOnePass; /* ONEPASS_OFF, or _SINGLE, or _MULTI */
u8 untestedTerms; /* Not all WHERE terms resolved by outer loop */
u8 eDistinct; /* One of the WHERE_DISTINCT_* values */
u8 bOrderedInnerLoop; /* True if only the inner-most loop is ordered */
int iTop; /* The very beginning of the WHERE loop */
WhereLoop *pLoops; /* List of all WhereLoop objects */
Bitmask revMask; /* Mask of ORDER BY terms that need reversing */
LogEst nRowOut; /* Estimated number of output rows */
WhereClause sWC; /* Decomposition of the WHERE clause */
WhereMaskSet sMaskSet; /* Map cursor numbers to bitmasks */
WhereLevel a[1]; /* Information about each nest loop in WHERE */
};
/*
** Private interfaces - callable only by other where.c routines.
**
** where.c:
|
| ︙ | ︙ | |||
126313 126314 126315 126316 126317 126318 126319 |
**
** Example: If the WHERE clause contains "t1.a=t2.b" and "t2.b=123"
** and we are coding the t1 loop and the t2 loop has not yet coded,
** then we cannot use the "t1.a=t2.b" constraint, but we can code
** the implied "t1.a=123" constraint.
*/
for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){
| | < < | | | < < | 126287 126288 126289 126290 126291 126292 126293 126294 126295 126296 126297 126298 126299 126300 126301 126302 126303 126304 126305 126306 126307 126308 126309 126310 126311 126312 126313 126314 126315 126316 126317 126318 126319 126320 126321 |
**
** Example: If the WHERE clause contains "t1.a=t2.b" and "t2.b=123"
** and we are coding the t1 loop and the t2 loop has not yet coded,
** then we cannot use the "t1.a=t2.b" constraint, but we can code
** the implied "t1.a=123" constraint.
*/
for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){
Expr *pE, sEAlt;
WhereTerm *pAlt;
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) continue;
if( (pTerm->eOperator & WO_EQUIV)==0 ) continue;
if( pTerm->leftCursor!=iCur ) continue;
if( pLevel->iLeftJoin ) continue;
pE = pTerm->pExpr;
assert( !ExprHasProperty(pE, EP_FromJoin) );
assert( (pTerm->prereqRight & pLevel->notReady)!=0 );
pAlt = sqlite3WhereFindTerm(pWC, iCur, pTerm->u.leftColumn, notReady,
WO_EQ|WO_IN|WO_IS, 0);
if( pAlt==0 ) continue;
if( pAlt->wtFlags & (TERM_CODED) ) continue;
testcase( pAlt->eOperator & WO_EQ );
testcase( pAlt->eOperator & WO_IS );
testcase( pAlt->eOperator & WO_IN );
VdbeModuleComment((v, "begin transitive constraint"));
sEAlt = *pAlt->pExpr;
sEAlt.pLeft = pE->pLeft;
sqlite3ExprIfFalse(pParse, &sEAlt, addrCont, SQLITE_JUMPIFNULL);
}
/* For a LEFT OUTER JOIN, generate code that will record the fact that
** at least one row of the right table has matched the left table.
*/
if( pLevel->iLeftJoin ){
pLevel->addrFirst = sqlite3VdbeCurrentAddr(v);
|
| ︙ | ︙ | |||
126446 126447 126448 126449 126450 126451 126452 |
return 0;
}
memcpy(pWC->a, pOld, sizeof(pWC->a[0])*pWC->nTerm);
if( pOld!=pWC->aStatic ){
sqlite3DbFree(db, pOld);
}
pWC->nSlot = sqlite3DbMallocSize(db, pWC->a)/sizeof(pWC->a[0]);
| < > > | 126416 126417 126418 126419 126420 126421 126422 126423 126424 126425 126426 126427 126428 126429 126430 126431 126432 126433 126434 126435 126436 126437 126438 126439 126440 126441 126442 |
return 0;
}
memcpy(pWC->a, pOld, sizeof(pWC->a[0])*pWC->nTerm);
if( pOld!=pWC->aStatic ){
sqlite3DbFree(db, pOld);
}
pWC->nSlot = sqlite3DbMallocSize(db, pWC->a)/sizeof(pWC->a[0]);
}
pTerm = &pWC->a[idx = pWC->nTerm++];
if( p && ExprHasProperty(p, EP_Unlikely) ){
pTerm->truthProb = sqlite3LogEst(p->iTable) - 270;
}else{
pTerm->truthProb = 1;
}
pTerm->pExpr = sqlite3ExprSkipCollate(p);
pTerm->wtFlags = wtFlags;
pTerm->pWC = pWC;
pTerm->iParent = -1;
memset(&pTerm->eOperator, 0,
sizeof(WhereTerm) - offsetof(WhereTerm,eOperator));
return idx;
}
/*
** Return TRUE if the given operator is one of the operators that is
** allowed for an indexable WHERE clause term. The allowed operators are
** "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL"
|
| ︙ | ︙ | |||
127616 127617 127618 127619 127620 127621 127622 |
Expr *pNewExpr;
Expr *pLeft = pExpr->pLeft;
int idxNew;
WhereTerm *pNewTerm;
pNewExpr = sqlite3PExpr(pParse, TK_GT,
sqlite3ExprDup(db, pLeft, 0),
| | | 127587 127588 127589 127590 127591 127592 127593 127594 127595 127596 127597 127598 127599 127600 127601 |
Expr *pNewExpr;
Expr *pLeft = pExpr->pLeft;
int idxNew;
WhereTerm *pNewTerm;
pNewExpr = sqlite3PExpr(pParse, TK_GT,
sqlite3ExprDup(db, pLeft, 0),
sqlite3ExprAlloc(db, TK_NULL, 0, 0), 0);
idxNew = whereClauseInsert(pWC, pNewExpr,
TERM_VIRTUAL|TERM_DYNAMIC|TERM_VNULL);
if( idxNew ){
pNewTerm = &pWC->a[idxNew];
pNewTerm->prereqRight = 0;
pNewTerm->leftCursor = pLeft->iTable;
|
| ︙ | ︙ | |||
127794 127795 127796 127797 127798 127799 127800 |
for(j=k=0; j<pArgs->nExpr; j++){
while( k<pTab->nCol && (pTab->aCol[k].colFlags & COLFLAG_HIDDEN)==0 ){k++;}
if( k>=pTab->nCol ){
sqlite3ErrorMsg(pParse, "too many arguments on %s() - max %d",
pTab->zName, j);
return;
}
| | | 127765 127766 127767 127768 127769 127770 127771 127772 127773 127774 127775 127776 127777 127778 127779 |
for(j=k=0; j<pArgs->nExpr; j++){
while( k<pTab->nCol && (pTab->aCol[k].colFlags & COLFLAG_HIDDEN)==0 ){k++;}
if( k>=pTab->nCol ){
sqlite3ErrorMsg(pParse, "too many arguments on %s() - max %d",
pTab->zName, j);
return;
}
pColRef = sqlite3ExprAlloc(pParse->db, TK_COLUMN, 0, 0);
if( pColRef==0 ) return;
pColRef->iTable = pItem->iCursor;
pColRef->iColumn = k++;
pColRef->pTab = pTab;
pTerm = sqlite3PExpr(pParse, TK_EQ, pColRef,
sqlite3ExprDup(pParse->db, pArgs->a[j].pExpr, 0), 0);
whereClauseInsert(pWC, pTerm, TERM_DYNAMIC);
|
| ︙ | ︙ | |||
132216 132217 132218 132219 132220 132221 132222 | ** return value. A single allocation is used to store the WhereInfo ** struct, the contents of WhereInfo.a[], the WhereClause structure ** and the WhereMaskSet structure. Since WhereClause contains an 8-byte ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ nByteWInfo = ROUND8(sizeof(WhereInfo)+(nTabList-1)*sizeof(WhereLevel)); | | < < > > > > > | 132187 132188 132189 132190 132191 132192 132193 132194 132195 132196 132197 132198 132199 132200 132201 132202 132203 132204 132205 132206 132207 132208 132209 132210 132211 132212 132213 132214 132215 132216 132217 132218 132219 |
** return value. A single allocation is used to store the WhereInfo
** struct, the contents of WhereInfo.a[], the WhereClause structure
** and the WhereMaskSet structure. Since WhereClause contains an 8-byte
** field (type Bitmask) it must be aligned on an 8-byte boundary on
** some architectures. Hence the ROUND8() below.
*/
nByteWInfo = ROUND8(sizeof(WhereInfo)+(nTabList-1)*sizeof(WhereLevel));
pWInfo = sqlite3DbMallocRawNN(db, nByteWInfo + sizeof(WhereLoop));
if( db->mallocFailed ){
sqlite3DbFree(db, pWInfo);
pWInfo = 0;
goto whereBeginError;
}
pWInfo->pParse = pParse;
pWInfo->pTabList = pTabList;
pWInfo->pOrderBy = pOrderBy;
pWInfo->pDistinctSet = pDistinctSet;
pWInfo->aiCurOnePass[0] = pWInfo->aiCurOnePass[1] = -1;
pWInfo->nLevel = nTabList;
pWInfo->iBreak = pWInfo->iContinue = sqlite3VdbeMakeLabel(v);
pWInfo->wctrlFlags = wctrlFlags;
pWInfo->iLimit = iAuxArg;
pWInfo->savedNQueryLoop = pParse->nQueryLoop;
memset(&pWInfo->nOBSat, 0,
offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat));
memset(&pWInfo->a[0], 0, sizeof(WhereLoop)+nTabList*sizeof(WhereLevel));
assert( pWInfo->eOnePass==ONEPASS_OFF ); /* ONEPASS defaults to OFF */
pMaskSet = &pWInfo->sMaskSet;
sWLB.pWInfo = pWInfo;
sWLB.pWC = &pWInfo->sWC;
sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo);
assert( EIGHT_BYTE_ALIGNMENT(sWLB.pNew) );
whereLoopInit(sWLB.pNew);
|
| ︙ | ︙ | |||
132842 132843 132844 132845 132846 132847 132848 |
** LIMIT clause of a SELECT statement.
*/
struct LimitVal {
Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */
Expr *pOffset; /* The OFFSET expression. NULL if there is none */
};
| < < < < < < < < < < < < < < | 132816 132817 132818 132819 132820 132821 132822 132823 132824 132825 132826 132827 132828 132829 132830 132831 132832 132833 132834 132835 132836 132837 132838 132839 132840 |
** LIMIT clause of a SELECT statement.
*/
struct LimitVal {
Expr *pLimit; /* The LIMIT expression. NULL if there is no limit */
Expr *pOffset; /* The OFFSET expression. NULL if there is none */
};
/*
** An instance of the following structure describes the event of a
** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT,
** TK_DELETE, or TK_INSTEAD. If the event is of the form
**
** UPDATE ON (a,b,c)
**
** Then the "b" IdList records the list "a,b,c".
*/
struct TrigEvent { int a; IdList * b; };
/*
** Disable lookaside memory allocation for objects that might be
** shared across database connections.
*/
static void disableLookaside(Parse *pParse){
pParse->disableLookaside++;
pParse->db->lookaside.bDisable++;
|
| ︙ | ︙ | |||
132913 132914 132915 132916 132917 132918 132919 |
}
/* Construct a new Expr object from a single identifier. Use the
** new Expr to populate pOut. Set the span of pOut to be the identifier
** that created the expression.
*/
static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token t){
| > > > > > > > > > > > > > > > > > | | 132873 132874 132875 132876 132877 132878 132879 132880 132881 132882 132883 132884 132885 132886 132887 132888 132889 132890 132891 132892 132893 132894 132895 132896 132897 132898 132899 132900 132901 132902 132903 132904 |
}
/* Construct a new Expr object from a single identifier. Use the
** new Expr to populate pOut. Set the span of pOut to be the identifier
** that created the expression.
*/
static void spanExpr(ExprSpan *pOut, Parse *pParse, int op, Token t){
Expr *p = sqlite3DbMallocRawNN(pParse->db, sizeof(Expr)+t.n+1);
if( p ){
memset(p, 0, sizeof(Expr));
p->op = (u8)op;
p->flags = EP_Leaf;
p->iAgg = -1;
p->u.zToken = (char*)&p[1];
memcpy(p->u.zToken, t.z, t.n);
p->u.zToken[t.n] = 0;
if( sqlite3Isquote(p->u.zToken[0]) ){
if( p->u.zToken[0]=='"' ) p->flags |= EP_DblQuoted;
sqlite3Dequote(p->u.zToken);
}
#if SQLITE_MAX_EXPR_DEPTH>0
p->nHeight = 1;
#endif
}
pOut->pExpr = p;
pOut->zStart = t.z;
pOut->zEnd = &t.z[t.n];
}
/* This routine constructs a binary expression node out of two ExprSpan
** objects and uses the result to populate a new ExprSpan object.
*/
|
| ︙ | ︙ | |||
133076 133077 133078 133079 133080 133081 133082 | ExprSpan yy190; int yy194; Select* yy243; IdList* yy254; With* yy285; struct TrigEvent yy332; struct LimitVal yy354; | < | | | | | | | | | 133053 133054 133055 133056 133057 133058 133059 133060 133061 133062 133063 133064 133065 133066 133067 133068 133069 133070 133071 133072 133073 133074 133075 133076 133077 133078 133079 133080 133081 133082 133083 133084 133085 133086 |
ExprSpan yy190;
int yy194;
Select* yy243;
IdList* yy254;
With* yy285;
struct TrigEvent yy332;
struct LimitVal yy354;
struct {int value; int mask;} yy497;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
#define sqlite3ParserARG_SDECL Parse *pParse;
#define sqlite3ParserARG_PDECL ,Parse *pParse
#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
#define sqlite3ParserARG_STORE yypParser->pParse = pParse
#define YYFALLBACK 1
#define YYNSTATE 456
#define YYNRULE 332
#define YY_MAX_SHIFT 455
#define YY_MIN_SHIFTREDUCE 668
#define YY_MAX_SHIFTREDUCE 999
#define YY_MIN_REDUCE 1000
#define YY_MAX_REDUCE 1331
#define YY_ERROR_ACTION 1332
#define YY_ACCEPT_ACTION 1333
#define YY_NO_ACTION 1334
/************* End control #defines *******************************************/
/* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise.
**
** Applications can choose to define yytestcase() in the %include section
** to a macro that can assist in verifying code coverage. For production
|
| ︙ | ︙ | |||
133168 133169 133170 133171 133172 133173 133174 | ** yy_shift_ofst[] For each state, the offset into yy_action for ** shifting terminals. ** yy_reduce_ofst[] For each state, the offset into yy_action for ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | 133144 133145 133146 133147 133148 133149 133150 133151 133152 133153 133154 133155 133156 133157 133158 133159 133160 133161 133162 133163 133164 133165 133166 133167 133168 133169 133170 133171 133172 133173 133174 133175 133176 133177 133178 133179 133180 133181 133182 133183 133184 133185 133186 133187 133188 133189 133190 133191 133192 133193 133194 133195 133196 133197 133198 133199 133200 133201 133202 133203 133204 133205 133206 133207 133208 133209 133210 133211 133212 133213 133214 133215 133216 133217 133218 133219 133220 133221 133222 133223 133224 133225 133226 133227 133228 133229 133230 133231 133232 133233 133234 133235 133236 133237 133238 133239 133240 133241 133242 133243 133244 133245 133246 133247 133248 133249 133250 133251 133252 133253 133254 133255 133256 133257 133258 133259 133260 133261 133262 133263 133264 133265 133266 133267 133268 133269 133270 133271 133272 133273 133274 133275 133276 133277 133278 133279 133280 133281 133282 133283 133284 133285 133286 133287 133288 133289 133290 133291 133292 133293 133294 133295 133296 133297 133298 133299 133300 133301 133302 133303 133304 133305 133306 133307 133308 133309 133310 133311 133312 133313 133314 133315 133316 |
** yy_shift_ofst[] For each state, the offset into yy_action for
** shifting terminals.
** yy_reduce_ofst[] For each state, the offset into yy_action for
** shifting non-terminals after a reduce.
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (1567)
static const YYACTIONTYPE yy_action[] = {
/* 0 */ 325, 832, 351, 825, 5, 203, 203, 819, 99, 100,
/* 10 */ 90, 842, 842, 854, 857, 846, 846, 97, 97, 98,
/* 20 */ 98, 98, 98, 301, 96, 96, 96, 96, 95, 95,
/* 30 */ 94, 94, 94, 93, 351, 325, 977, 977, 824, 824,
/* 40 */ 826, 947, 354, 99, 100, 90, 842, 842, 854, 857,
/* 50 */ 846, 846, 97, 97, 98, 98, 98, 98, 338, 96,
/* 60 */ 96, 96, 96, 95, 95, 94, 94, 94, 93, 351,
/* 70 */ 95, 95, 94, 94, 94, 93, 351, 791, 977, 977,
/* 80 */ 325, 94, 94, 94, 93, 351, 792, 75, 99, 100,
/* 90 */ 90, 842, 842, 854, 857, 846, 846, 97, 97, 98,
/* 100 */ 98, 98, 98, 450, 96, 96, 96, 96, 95, 95,
/* 110 */ 94, 94, 94, 93, 351, 1333, 155, 155, 2, 325,
/* 120 */ 275, 146, 132, 52, 52, 93, 351, 99, 100, 90,
/* 130 */ 842, 842, 854, 857, 846, 846, 97, 97, 98, 98,
/* 140 */ 98, 98, 101, 96, 96, 96, 96, 95, 95, 94,
/* 150 */ 94, 94, 93, 351, 958, 958, 325, 268, 428, 413,
/* 160 */ 411, 61, 752, 752, 99, 100, 90, 842, 842, 854,
/* 170 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 60,
/* 180 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
/* 190 */ 351, 325, 270, 329, 273, 277, 959, 960, 250, 99,
/* 200 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
/* 210 */ 98, 98, 98, 98, 301, 96, 96, 96, 96, 95,
/* 220 */ 95, 94, 94, 94, 93, 351, 325, 938, 1326, 698,
/* 230 */ 706, 1326, 242, 412, 99, 100, 90, 842, 842, 854,
/* 240 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 347,
/* 250 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
/* 260 */ 351, 325, 938, 1327, 384, 699, 1327, 381, 379, 99,
/* 270 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
/* 280 */ 98, 98, 98, 98, 701, 96, 96, 96, 96, 95,
/* 290 */ 95, 94, 94, 94, 93, 351, 325, 92, 89, 178,
/* 300 */ 833, 936, 373, 700, 99, 100, 90, 842, 842, 854,
/* 310 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 375,
/* 320 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
/* 330 */ 351, 325, 1276, 947, 354, 818, 936, 739, 739, 99,
/* 340 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
/* 350 */ 98, 98, 98, 98, 230, 96, 96, 96, 96, 95,
/* 360 */ 95, 94, 94, 94, 93, 351, 325, 969, 227, 92,
/* 370 */ 89, 178, 373, 300, 99, 100, 90, 842, 842, 854,
/* 380 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 921,
/* 390 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
/* 400 */ 351, 325, 449, 447, 447, 447, 147, 737, 737, 99,
/* 410 */ 100, 90, 842, 842, 854, 857, 846, 846, 97, 97,
/* 420 */ 98, 98, 98, 98, 296, 96, 96, 96, 96, 95,
/* 430 */ 95, 94, 94, 94, 93, 351, 325, 419, 231, 958,
/* 440 */ 958, 158, 25, 422, 99, 100, 90, 842, 842, 854,
/* 450 */ 857, 846, 846, 97, 97, 98, 98, 98, 98, 450,
/* 460 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
/* 470 */ 351, 443, 224, 224, 420, 958, 958, 962, 325, 52,
/* 480 */ 52, 959, 960, 176, 415, 78, 99, 100, 90, 842,
/* 490 */ 842, 854, 857, 846, 846, 97, 97, 98, 98, 98,
/* 500 */ 98, 379, 96, 96, 96, 96, 95, 95, 94, 94,
/* 510 */ 94, 93, 351, 325, 428, 418, 298, 959, 960, 962,
/* 520 */ 81, 99, 88, 90, 842, 842, 854, 857, 846, 846,
/* 530 */ 97, 97, 98, 98, 98, 98, 717, 96, 96, 96,
/* 540 */ 96, 95, 95, 94, 94, 94, 93, 351, 325, 843,
/* 550 */ 843, 855, 858, 996, 318, 343, 379, 100, 90, 842,
/* 560 */ 842, 854, 857, 846, 846, 97, 97, 98, 98, 98,
/* 570 */ 98, 450, 96, 96, 96, 96, 95, 95, 94, 94,
/* 580 */ 94, 93, 351, 325, 350, 350, 350, 260, 377, 340,
/* 590 */ 929, 52, 52, 90, 842, 842, 854, 857, 846, 846,
/* 600 */ 97, 97, 98, 98, 98, 98, 361, 96, 96, 96,
/* 610 */ 96, 95, 95, 94, 94, 94, 93, 351, 86, 445,
/* 620 */ 847, 3, 1203, 361, 360, 378, 344, 813, 958, 958,
/* 630 */ 1300, 86, 445, 729, 3, 212, 169, 287, 405, 282,
/* 640 */ 404, 199, 232, 450, 300, 760, 83, 84, 280, 245,
/* 650 */ 262, 365, 251, 85, 352, 352, 92, 89, 178, 83,
/* 660 */ 84, 242, 412, 52, 52, 448, 85, 352, 352, 246,
/* 670 */ 959, 960, 194, 455, 670, 402, 399, 398, 448, 243,
/* 680 */ 221, 114, 434, 776, 361, 450, 397, 268, 747, 224,
/* 690 */ 224, 132, 132, 198, 832, 434, 452, 451, 428, 427,
/* 700 */ 819, 415, 734, 713, 132, 52, 52, 832, 268, 452,
/* 710 */ 451, 734, 194, 819, 363, 402, 399, 398, 450, 1271,
/* 720 */ 1271, 23, 958, 958, 86, 445, 397, 3, 228, 429,
/* 730 */ 895, 824, 824, 826, 827, 19, 203, 720, 52, 52,
/* 740 */ 428, 408, 439, 249, 824, 824, 826, 827, 19, 229,
/* 750 */ 403, 153, 83, 84, 761, 177, 241, 450, 721, 85,
/* 760 */ 352, 352, 120, 157, 959, 960, 58, 977, 409, 355,
/* 770 */ 330, 448, 268, 428, 430, 320, 790, 32, 32, 86,
/* 780 */ 445, 776, 3, 341, 98, 98, 98, 98, 434, 96,
/* 790 */ 96, 96, 96, 95, 95, 94, 94, 94, 93, 351,
/* 800 */ 832, 120, 452, 451, 813, 887, 819, 83, 84, 977,
/* 810 */ 813, 132, 410, 920, 85, 352, 352, 132, 407, 789,
/* 820 */ 958, 958, 92, 89, 178, 917, 448, 262, 370, 261,
/* 830 */ 82, 914, 80, 262, 370, 261, 776, 824, 824, 826,
/* 840 */ 827, 19, 934, 434, 96, 96, 96, 96, 95, 95,
/* 850 */ 94, 94, 94, 93, 351, 832, 74, 452, 451, 958,
/* 860 */ 958, 819, 959, 960, 120, 92, 89, 178, 945, 2,
/* 870 */ 918, 965, 268, 1, 976, 76, 445, 762, 3, 708,
/* 880 */ 901, 901, 387, 958, 958, 757, 919, 371, 740, 778,
/* 890 */ 756, 257, 824, 824, 826, 827, 19, 417, 741, 450,
/* 900 */ 24, 959, 960, 83, 84, 369, 958, 958, 177, 226,
/* 910 */ 85, 352, 352, 885, 315, 314, 313, 215, 311, 10,
/* 920 */ 10, 683, 448, 349, 348, 959, 960, 909, 777, 157,
/* 930 */ 120, 958, 958, 337, 776, 416, 711, 310, 450, 434,
/* 940 */ 450, 321, 450, 791, 103, 200, 175, 450, 959, 960,
/* 950 */ 908, 832, 792, 452, 451, 9, 9, 819, 10, 10,
/* 960 */ 52, 52, 51, 51, 180, 716, 248, 10, 10, 171,
/* 970 */ 170, 167, 339, 959, 960, 247, 984, 702, 702, 450,
/* 980 */ 715, 233, 686, 982, 889, 983, 182, 914, 824, 824,
/* 990 */ 826, 827, 19, 183, 256, 423, 132, 181, 394, 10,
/* 1000 */ 10, 889, 891, 749, 958, 958, 917, 268, 985, 198,
/* 1010 */ 985, 349, 348, 425, 415, 299, 817, 832, 326, 825,
/* 1020 */ 120, 332, 133, 819, 268, 98, 98, 98, 98, 91,
/* 1030 */ 96, 96, 96, 96, 95, 95, 94, 94, 94, 93,
/* 1040 */ 351, 157, 810, 371, 382, 359, 959, 960, 358, 268,
/* 1050 */ 450, 918, 368, 324, 824, 824, 826, 450, 709, 450,
/* 1060 */ 264, 380, 889, 450, 877, 746, 253, 919, 255, 433,
/* 1070 */ 36, 36, 234, 450, 234, 120, 269, 37, 37, 12,
/* 1080 */ 12, 334, 272, 27, 27, 450, 330, 118, 450, 162,
/* 1090 */ 742, 280, 450, 38, 38, 450, 985, 356, 985, 450,
/* 1100 */ 709, 1210, 450, 132, 450, 39, 39, 450, 40, 40,
/* 1110 */ 450, 362, 41, 41, 450, 42, 42, 450, 254, 28,
/* 1120 */ 28, 450, 29, 29, 31, 31, 450, 43, 43, 450,
/* 1130 */ 44, 44, 450, 714, 45, 45, 450, 11, 11, 767,
/* 1140 */ 450, 46, 46, 450, 268, 450, 105, 105, 450, 47,
/* 1150 */ 47, 450, 48, 48, 450, 237, 33, 33, 450, 172,
/* 1160 */ 49, 49, 450, 50, 50, 34, 34, 274, 122, 122,
/* 1170 */ 450, 123, 123, 450, 124, 124, 450, 898, 56, 56,
/* 1180 */ 450, 897, 35, 35, 450, 267, 450, 817, 450, 817,
/* 1190 */ 106, 106, 450, 53, 53, 385, 107, 107, 450, 817,
/* 1200 */ 108, 108, 817, 450, 104, 104, 121, 121, 119, 119,
/* 1210 */ 450, 117, 112, 112, 450, 276, 450, 225, 111, 111,
/* 1220 */ 450, 730, 450, 109, 109, 450, 673, 674, 675, 912,
/* 1230 */ 110, 110, 317, 998, 55, 55, 57, 57, 692, 331,
/* 1240 */ 54, 54, 26, 26, 696, 30, 30, 317, 937, 197,
/* 1250 */ 196, 195, 335, 281, 336, 446, 331, 745, 689, 436,
/* 1260 */ 440, 444, 120, 72, 386, 223, 175, 345, 757, 933,
/* 1270 */ 20, 286, 319, 756, 815, 372, 374, 202, 202, 202,
/* 1280 */ 263, 395, 285, 74, 208, 21, 696, 719, 718, 884,
/* 1290 */ 120, 120, 120, 120, 120, 754, 278, 828, 77, 74,
/* 1300 */ 726, 727, 785, 783, 880, 202, 999, 208, 894, 893,
/* 1310 */ 894, 893, 694, 816, 763, 116, 774, 1290, 431, 432,
/* 1320 */ 302, 999, 390, 303, 823, 697, 691, 680, 159, 289,
/* 1330 */ 679, 884, 681, 952, 291, 218, 293, 7, 316, 828,
/* 1340 */ 173, 805, 259, 364, 252, 911, 376, 713, 295, 435,
/* 1350 */ 308, 168, 955, 993, 135, 400, 990, 284, 882, 881,
/* 1360 */ 205, 928, 926, 59, 333, 62, 144, 156, 130, 72,
/* 1370 */ 802, 366, 367, 393, 137, 185, 189, 160, 139, 383,
/* 1380 */ 67, 896, 140, 141, 142, 148, 389, 812, 775, 266,
/* 1390 */ 219, 190, 154, 391, 913, 876, 271, 406, 191, 322,
/* 1400 */ 682, 733, 192, 342, 732, 724, 731, 711, 723, 421,
/* 1410 */ 705, 71, 323, 6, 204, 771, 288, 79, 297, 346,
/* 1420 */ 772, 704, 290, 283, 703, 770, 292, 294, 967, 239,
/* 1430 */ 769, 102, 862, 438, 426, 240, 424, 442, 73, 213,
/* 1440 */ 688, 238, 22, 453, 953, 214, 217, 216, 454, 677,
/* 1450 */ 676, 671, 753, 125, 115, 235, 126, 669, 353, 166,
/* 1460 */ 127, 244, 179, 357, 306, 304, 305, 307, 113, 892,
/* 1470 */ 327, 890, 811, 328, 134, 128, 136, 138, 743, 258,
/* 1480 */ 907, 184, 143, 129, 910, 186, 63, 64, 145, 187,
/* 1490 */ 906, 65, 8, 66, 13, 188, 202, 899, 265, 149,
/* 1500 */ 987, 388, 150, 685, 161, 392, 285, 193, 279, 396,
/* 1510 */ 151, 401, 68, 14, 15, 722, 69, 236, 831, 131,
/* 1520 */ 830, 860, 70, 751, 16, 414, 755, 4, 174, 220,
/* 1530 */ 222, 784, 201, 152, 779, 77, 74, 17, 18, 875,
/* 1540 */ 861, 859, 916, 864, 915, 207, 206, 942, 163, 437,
/* 1550 */ 948, 943, 164, 209, 1002, 441, 863, 165, 210, 829,
/* 1560 */ 695, 87, 312, 211, 1292, 1291, 309,
};
static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 19, 95, 53, 97, 22, 24, 24, 101, 27, 28,
/* 10 */ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
/* 20 */ 39, 40, 41, 152, 43, 44, 45, 46, 47, 48,
/* 30 */ 49, 50, 51, 52, 53, 19, 55, 55, 132, 133,
/* 40 */ 134, 1, 2, 27, 28, 29, 30, 31, 32, 33,
|
| ︙ | ︙ | |||
133413 133414 133415 133416 133417 133418 133419 | /* 760 */ 55, 56, 196, 152, 97, 98, 209, 55, 163, 244, /* 770 */ 107, 66, 152, 207, 208, 164, 175, 172, 173, 19, /* 780 */ 20, 124, 22, 111, 38, 39, 40, 41, 83, 43, /* 790 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, /* 800 */ 95, 196, 97, 98, 85, 152, 101, 47, 48, 97, /* 810 */ 85, 92, 207, 193, 54, 55, 56, 92, 49, 175, /* 820 */ 55, 56, 221, 222, 223, 12, 66, 108, 109, 110, | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | | | > | | | | | > > | < < | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 133388 133389 133390 133391 133392 133393 133394 133395 133396 133397 133398 133399 133400 133401 133402 133403 133404 133405 133406 133407 133408 133409 133410 133411 133412 133413 133414 133415 133416 133417 133418 133419 133420 133421 133422 133423 133424 133425 133426 133427 133428 133429 133430 133431 133432 133433 133434 133435 133436 133437 133438 133439 133440 133441 133442 133443 133444 133445 133446 133447 133448 133449 133450 133451 133452 133453 133454 133455 133456 133457 133458 133459 133460 133461 133462 133463 133464 133465 133466 133467 133468 133469 133470 133471 133472 133473 133474 133475 133476 133477 133478 133479 133480 133481 133482 133483 133484 133485 133486 133487 133488 133489 133490 133491 133492 133493 133494 133495 133496 133497 133498 133499 133500 133501 133502 133503 133504 133505 133506 133507 133508 133509 133510 133511 133512 133513 133514 133515 133516 133517 133518 133519 133520 133521 133522 133523 133524 133525 133526 133527 133528 133529 133530 133531 133532 133533 133534 133535 133536 133537 133538 133539 133540 133541 133542 133543 133544 133545 133546 133547 133548 133549 133550 133551 133552 133553 133554 133555 133556 133557 133558 133559 133560 133561 133562 133563 133564 133565 133566 133567 133568 133569 133570 133571 133572 133573 133574 133575 133576 133577 133578 133579 133580 133581 133582 133583 133584 133585 133586 133587 133588 133589 133590 133591 133592 133593 133594 133595 133596 133597 133598 133599 133600 133601 133602 133603 133604 133605 133606 133607 133608 133609 133610 133611 133612 133613 133614 |
/* 760 */ 55, 56, 196, 152, 97, 98, 209, 55, 163, 244,
/* 770 */ 107, 66, 152, 207, 208, 164, 175, 172, 173, 19,
/* 780 */ 20, 124, 22, 111, 38, 39, 40, 41, 83, 43,
/* 790 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
/* 800 */ 95, 196, 97, 98, 85, 152, 101, 47, 48, 97,
/* 810 */ 85, 92, 207, 193, 54, 55, 56, 92, 49, 175,
/* 820 */ 55, 56, 221, 222, 223, 12, 66, 108, 109, 110,
/* 830 */ 137, 163, 139, 108, 109, 110, 26, 132, 133, 134,
/* 840 */ 135, 136, 152, 83, 43, 44, 45, 46, 47, 48,
/* 850 */ 49, 50, 51, 52, 53, 95, 26, 97, 98, 55,
/* 860 */ 56, 101, 97, 98, 196, 221, 222, 223, 146, 147,
/* 870 */ 57, 171, 152, 22, 26, 19, 20, 49, 22, 179,
/* 880 */ 108, 109, 110, 55, 56, 116, 73, 219, 75, 124,
/* 890 */ 121, 152, 132, 133, 134, 135, 136, 163, 85, 152,
/* 900 */ 232, 97, 98, 47, 48, 237, 55, 56, 98, 5,
/* 910 */ 54, 55, 56, 193, 10, 11, 12, 13, 14, 172,
/* 920 */ 173, 17, 66, 47, 48, 97, 98, 152, 124, 152,
/* 930 */ 196, 55, 56, 186, 124, 152, 106, 160, 152, 83,
/* 940 */ 152, 164, 152, 61, 22, 211, 212, 152, 97, 98,
/* 950 */ 152, 95, 70, 97, 98, 172, 173, 101, 172, 173,
/* 960 */ 172, 173, 172, 173, 60, 181, 62, 172, 173, 47,
/* 970 */ 48, 123, 186, 97, 98, 71, 100, 55, 56, 152,
/* 980 */ 181, 186, 21, 107, 152, 109, 82, 163, 132, 133,
/* 990 */ 134, 135, 136, 89, 16, 207, 92, 93, 19, 172,
/* 1000 */ 173, 169, 170, 195, 55, 56, 12, 152, 132, 30,
/* 1010 */ 134, 47, 48, 186, 206, 225, 152, 95, 114, 97,
/* 1020 */ 196, 245, 246, 101, 152, 38, 39, 40, 41, 42,
/* 1030 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
/* 1040 */ 53, 152, 163, 219, 152, 141, 97, 98, 193, 152,
/* 1050 */ 152, 57, 91, 164, 132, 133, 134, 152, 55, 152,
/* 1060 */ 152, 237, 230, 152, 103, 193, 88, 73, 90, 75,
/* 1070 */ 172, 173, 183, 152, 185, 196, 152, 172, 173, 172,
/* 1080 */ 173, 217, 152, 172, 173, 152, 107, 22, 152, 24,
/* 1090 */ 193, 112, 152, 172, 173, 152, 132, 242, 134, 152,
/* 1100 */ 97, 140, 152, 92, 152, 172, 173, 152, 172, 173,
/* 1110 */ 152, 100, 172, 173, 152, 172, 173, 152, 140, 172,
/* 1120 */ 173, 152, 172, 173, 172, 173, 152, 172, 173, 152,
/* 1130 */ 172, 173, 152, 152, 172, 173, 152, 172, 173, 213,
/* 1140 */ 152, 172, 173, 152, 152, 152, 172, 173, 152, 172,
/* 1150 */ 173, 152, 172, 173, 152, 210, 172, 173, 152, 26,
/* 1160 */ 172, 173, 152, 172, 173, 172, 173, 152, 172, 173,
/* 1170 */ 152, 172, 173, 152, 172, 173, 152, 59, 172, 173,
/* 1180 */ 152, 63, 172, 173, 152, 193, 152, 152, 152, 152,
/* 1190 */ 172, 173, 152, 172, 173, 77, 172, 173, 152, 152,
/* 1200 */ 172, 173, 152, 152, 172, 173, 172, 173, 172, 173,
/* 1210 */ 152, 22, 172, 173, 152, 152, 152, 22, 172, 173,
/* 1220 */ 152, 152, 152, 172, 173, 152, 7, 8, 9, 163,
/* 1230 */ 172, 173, 22, 23, 172, 173, 172, 173, 166, 167,
/* 1240 */ 172, 173, 172, 173, 55, 172, 173, 22, 23, 108,
/* 1250 */ 109, 110, 217, 152, 217, 166, 167, 163, 163, 163,
/* 1260 */ 163, 163, 196, 130, 217, 211, 212, 217, 116, 23,
/* 1270 */ 22, 101, 26, 121, 23, 23, 23, 26, 26, 26,
/* 1280 */ 23, 23, 112, 26, 26, 37, 97, 100, 101, 55,
/* 1290 */ 196, 196, 196, 196, 196, 23, 23, 55, 26, 26,
/* 1300 */ 7, 8, 23, 152, 23, 26, 96, 26, 132, 132,
/* 1310 */ 134, 134, 23, 152, 152, 26, 152, 122, 152, 191,
/* 1320 */ 152, 96, 234, 152, 152, 152, 152, 152, 197, 210,
/* 1330 */ 152, 97, 152, 152, 210, 233, 210, 198, 150, 97,
/* 1340 */ 184, 201, 239, 214, 214, 201, 239, 180, 214, 227,
/* 1350 */ 200, 198, 155, 67, 243, 176, 69, 175, 175, 175,
/* 1360 */ 122, 159, 159, 240, 159, 240, 22, 220, 27, 130,
/* 1370 */ 201, 18, 159, 18, 189, 158, 158, 220, 192, 159,
/* 1380 */ 137, 236, 192, 192, 192, 189, 74, 189, 159, 235,
/* 1390 */ 159, 158, 22, 177, 201, 201, 159, 107, 158, 177,
/* 1400 */ 159, 174, 158, 76, 174, 182, 174, 106, 182, 125,
/* 1410 */ 174, 107, 177, 22, 159, 216, 215, 137, 159, 53,
/* 1420 */ 216, 176, 215, 174, 174, 216, 215, 215, 174, 229,
/* 1430 */ 216, 129, 224, 177, 126, 229, 127, 177, 128, 25,
/* 1440 */ 162, 226, 26, 161, 13, 153, 6, 153, 151, 151,
/* 1450 */ 151, 151, 205, 165, 178, 178, 165, 4, 3, 22,
/* 1460 */ 165, 142, 15, 94, 202, 204, 203, 201, 16, 23,
/* 1470 */ 249, 23, 120, 249, 246, 111, 131, 123, 20, 16,
/* 1480 */ 1, 125, 123, 111, 56, 64, 37, 37, 131, 122,
/* 1490 */ 1, 37, 5, 37, 22, 107, 26, 80, 140, 80,
/* 1500 */ 87, 72, 107, 20, 24, 19, 112, 105, 23, 79,
/* 1510 */ 22, 79, 22, 22, 22, 58, 22, 79, 23, 68,
/* 1520 */ 23, 23, 26, 116, 22, 26, 23, 22, 122, 23,
/* 1530 */ 23, 56, 64, 22, 124, 26, 26, 64, 64, 23,
/* 1540 */ 23, 23, 23, 11, 23, 22, 26, 23, 22, 24,
/* 1550 */ 1, 23, 22, 26, 251, 24, 23, 22, 122, 23,
/* 1560 */ 23, 22, 15, 122, 122, 122, 23,
};
#define YY_SHIFT_USE_DFLT (1567)
#define YY_SHIFT_COUNT (455)
#define YY_SHIFT_MIN (-94)
#define YY_SHIFT_MAX (1549)
static const short yy_shift_ofst[] = {
/* 0 */ 40, 599, 904, 612, 760, 760, 760, 760, 725, -19,
/* 10 */ 16, 16, 100, 760, 760, 760, 760, 760, 760, 760,
/* 20 */ 876, 876, 573, 542, 719, 600, 61, 137, 172, 207,
/* 30 */ 242, 277, 312, 347, 382, 417, 459, 459, 459, 459,
/* 40 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459,
/* 50 */ 459, 459, 459, 494, 459, 529, 564, 564, 705, 760,
/* 60 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
/* 70 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
/* 80 */ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760,
/* 90 */ 856, 760, 760, 760, 760, 760, 760, 760, 760, 760,
/* 100 */ 760, 760, 760, 760, 987, 746, 746, 746, 746, 746,
/* 110 */ 801, 23, 32, 949, 961, 979, 964, 964, 949, 73,
/* 120 */ 113, -51, 1567, 1567, 1567, 536, 536, 536, 99, 99,
/* 130 */ 813, 813, 667, 205, 240, 949, 949, 949, 949, 949,
/* 140 */ 949, 949, 949, 949, 949, 949, 949, 949, 949, 949,
/* 150 */ 949, 949, 949, 949, 949, 332, 1011, 422, 422, 113,
/* 160 */ 30, 30, 30, 30, 30, 30, 1567, 1567, 1567, 922,
/* 170 */ -94, -94, 384, 613, 828, 420, 765, 804, 851, 949,
/* 180 */ 949, 949, 949, 949, 949, 949, 949, 949, 949, 949,
/* 190 */ 949, 949, 949, 949, 949, 672, 672, 672, 949, 949,
/* 200 */ 657, 949, 949, 949, -18, 949, 949, 994, 949, 949,
/* 210 */ 949, 949, 949, 949, 949, 949, 949, 949, 772, 1118,
/* 220 */ 712, 712, 712, 810, 45, 769, 1219, 1133, 418, 418,
/* 230 */ 569, 1133, 569, 830, 607, 663, 882, 418, 693, 882,
/* 240 */ 882, 848, 1152, 1065, 1286, 1238, 1238, 1287, 1287, 1238,
/* 250 */ 1344, 1341, 1239, 1353, 1353, 1353, 1353, 1238, 1355, 1239,
/* 260 */ 1344, 1341, 1341, 1239, 1238, 1355, 1243, 1312, 1238, 1238,
/* 270 */ 1355, 1370, 1238, 1355, 1238, 1355, 1370, 1290, 1290, 1290,
/* 280 */ 1327, 1370, 1290, 1301, 1290, 1327, 1290, 1290, 1284, 1304,
/* 290 */ 1284, 1304, 1284, 1304, 1284, 1304, 1238, 1391, 1238, 1280,
/* 300 */ 1370, 1366, 1366, 1370, 1302, 1308, 1310, 1309, 1239, 1414,
/* 310 */ 1416, 1431, 1431, 1440, 1440, 1440, 1440, 1567, 1567, 1567,
/* 320 */ 1567, 1567, 1567, 1567, 1567, 519, 978, 1210, 1225, 104,
/* 330 */ 1141, 1189, 1246, 1248, 1251, 1252, 1253, 1257, 1258, 1273,
/* 340 */ 1003, 1187, 1293, 1170, 1272, 1279, 1234, 1281, 1176, 1177,
/* 350 */ 1289, 1242, 1195, 1453, 1455, 1437, 1319, 1447, 1369, 1452,
/* 360 */ 1446, 1448, 1352, 1345, 1364, 1354, 1458, 1356, 1463, 1479,
/* 370 */ 1359, 1357, 1449, 1450, 1454, 1456, 1372, 1428, 1421, 1367,
/* 380 */ 1489, 1487, 1472, 1388, 1358, 1417, 1470, 1419, 1413, 1429,
/* 390 */ 1395, 1480, 1483, 1486, 1394, 1402, 1488, 1430, 1490, 1491,
/* 400 */ 1485, 1492, 1432, 1457, 1494, 1438, 1451, 1495, 1497, 1498,
/* 410 */ 1496, 1407, 1502, 1503, 1505, 1499, 1406, 1506, 1507, 1475,
/* 420 */ 1468, 1511, 1410, 1509, 1473, 1510, 1474, 1516, 1509, 1517,
/* 430 */ 1518, 1519, 1520, 1521, 1523, 1532, 1524, 1526, 1525, 1527,
/* 440 */ 1528, 1530, 1531, 1527, 1533, 1535, 1536, 1537, 1539, 1436,
/* 450 */ 1441, 1442, 1443, 1543, 1547, 1549,
};
#define YY_REDUCE_USE_DFLT (-130)
#define YY_REDUCE_COUNT (324)
#define YY_REDUCE_MIN (-129)
#define YY_REDUCE_MAX (1300)
static const short yy_reduce_ofst[] = {
/* 0 */ -29, 566, 525, 605, -49, 307, 491, 533, 668, 435,
/* 10 */ 601, 644, 148, 747, 786, 795, 419, 788, 827, 790,
/* 20 */ 454, 832, 889, 495, 824, 734, 76, 76, 76, 76,
/* 30 */ 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
/* 40 */ 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
/* 50 */ 76, 76, 76, 76, 76, 76, 76, 76, 783, 898,
/* 60 */ 905, 907, 911, 921, 933, 936, 940, 943, 947, 950,
/* 70 */ 952, 955, 958, 962, 965, 969, 974, 977, 980, 984,
/* 80 */ 988, 991, 993, 996, 999, 1002, 1006, 1010, 1018, 1021,
/* 90 */ 1024, 1028, 1032, 1034, 1036, 1040, 1046, 1051, 1058, 1062,
/* 100 */ 1064, 1068, 1070, 1073, 76, 76, 76, 76, 76, 76,
/* 110 */ 76, 76, 76, 855, 36, 523, 235, 416, 777, 76,
/* 120 */ 278, 76, 76, 76, 76, 700, 700, 700, 150, 220,
/* 130 */ 147, 217, 221, 306, 306, 611, 5, 535, 556, 620,
/* 140 */ 720, 872, 897, 116, 864, 349, 1035, 1037, 404, 1047,
/* 150 */ 992, -129, 1050, 492, 62, 722, 879, 1072, 1089, 808,
/* 160 */ 1066, 1094, 1095, 1096, 1097, 1098, 776, 1054, 557, 57,
/* 170 */ 112, 131, 167, 182, 250, 272, 291, 331, 364, 438,
/* 180 */ 497, 517, 591, 653, 690, 739, 775, 798, 892, 908,
/* 190 */ 924, 930, 1015, 1063, 1069, 355, 784, 799, 981, 1101,
/* 200 */ 926, 1151, 1161, 1162, 945, 1164, 1166, 1128, 1168, 1171,
/* 210 */ 1172, 250, 1173, 1174, 1175, 1178, 1180, 1181, 1088, 1102,
/* 220 */ 1119, 1124, 1126, 926, 1131, 1139, 1188, 1140, 1129, 1130,
/* 230 */ 1103, 1144, 1107, 1179, 1156, 1167, 1182, 1134, 1122, 1183,
/* 240 */ 1184, 1150, 1153, 1197, 1111, 1202, 1203, 1123, 1125, 1205,
/* 250 */ 1147, 1185, 1169, 1186, 1190, 1191, 1192, 1213, 1217, 1193,
/* 260 */ 1157, 1196, 1198, 1194, 1220, 1218, 1145, 1154, 1229, 1231,
/* 270 */ 1233, 1216, 1237, 1240, 1241, 1244, 1222, 1227, 1230, 1232,
/* 280 */ 1223, 1235, 1236, 1245, 1249, 1226, 1250, 1254, 1199, 1201,
/* 290 */ 1204, 1207, 1209, 1211, 1214, 1212, 1255, 1208, 1259, 1215,
/* 300 */ 1256, 1200, 1206, 1260, 1247, 1261, 1263, 1262, 1266, 1278,
/* 310 */ 1282, 1292, 1294, 1297, 1298, 1299, 1300, 1221, 1224, 1228,
/* 320 */ 1288, 1291, 1276, 1277, 1295,
};
static const YYACTIONTYPE yy_default[] = {
/* 0 */ 1281, 1271, 1271, 1271, 1203, 1203, 1203, 1203, 1271, 1096,
/* 10 */ 1125, 1125, 1255, 1332, 1332, 1332, 1332, 1332, 1332, 1202,
/* 20 */ 1332, 1332, 1332, 1332, 1271, 1100, 1131, 1332, 1332, 1332,
/* 30 */ 1332, 1204, 1205, 1332, 1332, 1332, 1254, 1256, 1141, 1140,
/* 40 */ 1139, 1138, 1237, 1112, 1136, 1129, 1133, 1204, 1198, 1199,
/* 50 */ 1197, 1201, 1205, 1332, 1132, 1167, 1182, 1166, 1332, 1332,
/* 60 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 70 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 80 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 90 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 100 */ 1332, 1332, 1332, 1332, 1176, 1181, 1188, 1180, 1177, 1169,
/* 110 */ 1168, 1170, 1171, 1332, 1019, 1067, 1332, 1332, 1332, 1172,
/* 120 */ 1332, 1173, 1185, 1184, 1183, 1262, 1289, 1288, 1332, 1332,
/* 130 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 140 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 150 */ 1332, 1332, 1332, 1332, 1332, 1281, 1271, 1025, 1025, 1332,
/* 160 */ 1271, 1271, 1271, 1271, 1271, 1271, 1267, 1100, 1091, 1332,
/* 170 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 180 */ 1259, 1257, 1332, 1218, 1332, 1332, 1332, 1332, 1332, 1332,
/* 190 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 200 */ 1332, 1332, 1332, 1332, 1096, 1332, 1332, 1332, 1332, 1332,
/* 210 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1283, 1332, 1232,
/* 220 */ 1096, 1096, 1096, 1098, 1080, 1090, 1004, 1135, 1114, 1114,
/* 230 */ 1321, 1135, 1321, 1042, 1303, 1039, 1125, 1114, 1200, 1125,
/* 240 */ 1125, 1097, 1090, 1332, 1324, 1105, 1105, 1323, 1323, 1105,
/* 250 */ 1146, 1070, 1135, 1076, 1076, 1076, 1076, 1105, 1016, 1135,
/* 260 */ 1146, 1070, 1070, 1135, 1105, 1016, 1236, 1318, 1105, 1105,
/* 270 */ 1016, 1211, 1105, 1016, 1105, 1016, 1211, 1068, 1068, 1068,
/* 280 */ 1057, 1211, 1068, 1042, 1068, 1057, 1068, 1068, 1118, 1113,
/* 290 */ 1118, 1113, 1118, 1113, 1118, 1113, 1105, 1206, 1105, 1332,
/* 300 */ 1211, 1215, 1215, 1211, 1130, 1119, 1128, 1126, 1135, 1022,
/* 310 */ 1060, 1286, 1286, 1282, 1282, 1282, 1282, 1329, 1329, 1267,
/* 320 */ 1298, 1298, 1044, 1044, 1298, 1332, 1332, 1332, 1332, 1332,
/* 330 */ 1332, 1293, 1332, 1220, 1332, 1332, 1332, 1332, 1332, 1332,
/* 340 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 350 */ 1332, 1332, 1152, 1332, 1000, 1264, 1332, 1332, 1263, 1332,
/* 360 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 370 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1320,
/* 380 */ 1332, 1332, 1332, 1332, 1332, 1332, 1235, 1234, 1332, 1332,
/* 390 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 400 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,
/* 410 */ 1332, 1082, 1332, 1332, 1332, 1307, 1332, 1332, 1332, 1332,
/* 420 */ 1332, 1332, 1332, 1127, 1332, 1120, 1332, 1332, 1311, 1332,
/* 430 */ 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1273,
/* 440 */ 1332, 1332, 1332, 1272, 1332, 1332, 1332, 1332, 1332, 1154,
/* 450 */ 1332, 1153, 1157, 1332, 1010, 1332,
};
/********** End of lemon-generated parsing tables *****************************/
/* The next table maps tokens (terminal symbols) into fallback tokens.
** If a construct like the following:
**
** %fallback ID X Y Z.
|
| ︙ | ︙ | |||
133860 133861 133862 133863 133864 133865 133866 | "CHECK", "REFERENCES", "AUTOINCR", "ON", "INSERT", "DELETE", "UPDATE", "SET", "DEFERRABLE", "FOREIGN", "DROP", "UNION", "ALL", "EXCEPT", "INTERSECT", "SELECT", "VALUES", "DISTINCT", "DOT", "FROM", "JOIN", "USING", "ORDER", "GROUP", "HAVING", "LIMIT", "WHERE", "INTO", | | | 133834 133835 133836 133837 133838 133839 133840 133841 133842 133843 133844 133845 133846 133847 133848 | "CHECK", "REFERENCES", "AUTOINCR", "ON", "INSERT", "DELETE", "UPDATE", "SET", "DEFERRABLE", "FOREIGN", "DROP", "UNION", "ALL", "EXCEPT", "INTERSECT", "SELECT", "VALUES", "DISTINCT", "DOT", "FROM", "JOIN", "USING", "ORDER", "GROUP", "HAVING", "LIMIT", "WHERE", "INTO", "FLOAT", "BLOB", "INTEGER", "VARIABLE", "CASE", "WHEN", "THEN", "ELSE", "INDEX", "ALTER", "ADD", "error", "input", "cmdlist", "ecmd", "explain", "cmdx", "cmd", "transtype", "trans_opt", "nm", "savepoint_opt", "create_table", "create_table_args", "createkw", "temp", "ifnotexists", "dbnm", "columnlist", "conslist_opt", "table_options", "select", |
| ︙ | ︙ | |||
134053 134054 134055 134056 134057 134058 134059 | /* 149 */ "idlist ::= nm", /* 150 */ "expr ::= LP expr RP", /* 151 */ "term ::= NULL", /* 152 */ "expr ::= ID|INDEXED", /* 153 */ "expr ::= JOIN_KW", /* 154 */ "expr ::= nm DOT nm", /* 155 */ "expr ::= nm DOT nm DOT nm", | | > | | | | | | | < | | | | | | | > | | < | | | | | | | | | > | | | | | | | | | | | | | < | | | > | | | | | | | | | | | | | | | < | | | | | | > | | | | < | | | | | | > | | | | | | | | | | | | | | | | | | | < | | | | | > | | | | | | < | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | | | | > | | | | | | | | | | | | | | | | 134027 134028 134029 134030 134031 134032 134033 134034 134035 134036 134037 134038 134039 134040 134041 134042 134043 134044 134045 134046 134047 134048 134049 134050 134051 134052 134053 134054 134055 134056 134057 134058 134059 134060 134061 134062 134063 134064 134065 134066 134067 134068 134069 134070 134071 134072 134073 134074 134075 134076 134077 134078 134079 134080 134081 134082 134083 134084 134085 134086 134087 134088 134089 134090 134091 134092 134093 134094 134095 134096 134097 134098 134099 134100 134101 134102 134103 134104 134105 134106 134107 134108 134109 134110 134111 134112 134113 134114 134115 134116 134117 134118 134119 134120 134121 134122 134123 134124 134125 134126 134127 134128 134129 134130 134131 134132 134133 134134 134135 134136 134137 134138 134139 134140 134141 134142 134143 134144 134145 134146 134147 134148 134149 134150 134151 134152 134153 134154 134155 134156 134157 134158 134159 134160 134161 134162 134163 134164 134165 134166 134167 134168 134169 134170 134171 134172 134173 134174 134175 134176 134177 134178 134179 134180 134181 134182 134183 134184 134185 134186 134187 134188 134189 134190 134191 134192 134193 134194 134195 134196 134197 134198 134199 134200 134201 134202 134203 134204 134205 134206 134207 134208 134209 134210 134211 134212 134213 134214 134215 134216 | /* 149 */ "idlist ::= nm", /* 150 */ "expr ::= LP expr RP", /* 151 */ "term ::= NULL", /* 152 */ "expr ::= ID|INDEXED", /* 153 */ "expr ::= JOIN_KW", /* 154 */ "expr ::= nm DOT nm", /* 155 */ "expr ::= nm DOT nm DOT nm", /* 156 */ "term ::= FLOAT|BLOB", /* 157 */ "term ::= STRING", /* 158 */ "term ::= INTEGER", /* 159 */ "expr ::= VARIABLE", /* 160 */ "expr ::= expr COLLATE ID|STRING", /* 161 */ "expr ::= CAST LP expr AS typetoken RP", /* 162 */ "expr ::= ID|INDEXED LP distinct exprlist RP", /* 163 */ "expr ::= ID|INDEXED LP STAR RP", /* 164 */ "term ::= CTIME_KW", /* 165 */ "expr ::= LP nexprlist COMMA expr RP", /* 166 */ "expr ::= expr AND expr", /* 167 */ "expr ::= expr OR expr", /* 168 */ "expr ::= expr LT|GT|GE|LE expr", /* 169 */ "expr ::= expr EQ|NE expr", /* 170 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", /* 171 */ "expr ::= expr PLUS|MINUS expr", /* 172 */ "expr ::= expr STAR|SLASH|REM expr", /* 173 */ "expr ::= expr CONCAT expr", /* 174 */ "likeop ::= LIKE_KW|MATCH", /* 175 */ "likeop ::= NOT LIKE_KW|MATCH", /* 176 */ "expr ::= expr likeop expr", /* 177 */ "expr ::= expr likeop expr ESCAPE expr", /* 178 */ "expr ::= expr ISNULL|NOTNULL", /* 179 */ "expr ::= expr NOT NULL", /* 180 */ "expr ::= expr IS expr", /* 181 */ "expr ::= expr IS NOT expr", /* 182 */ "expr ::= NOT expr", /* 183 */ "expr ::= BITNOT expr", /* 184 */ "expr ::= MINUS expr", /* 185 */ "expr ::= PLUS expr", /* 186 */ "between_op ::= BETWEEN", /* 187 */ "between_op ::= NOT BETWEEN", /* 188 */ "expr ::= expr between_op expr AND expr", /* 189 */ "in_op ::= IN", /* 190 */ "in_op ::= NOT IN", /* 191 */ "expr ::= expr in_op LP exprlist RP", /* 192 */ "expr ::= LP select RP", /* 193 */ "expr ::= expr in_op LP select RP", /* 194 */ "expr ::= expr in_op nm dbnm paren_exprlist", /* 195 */ "expr ::= EXISTS LP select RP", /* 196 */ "expr ::= CASE case_operand case_exprlist case_else END", /* 197 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", /* 198 */ "case_exprlist ::= WHEN expr THEN expr", /* 199 */ "case_else ::= ELSE expr", /* 200 */ "case_else ::=", /* 201 */ "case_operand ::= expr", /* 202 */ "case_operand ::=", /* 203 */ "exprlist ::=", /* 204 */ "nexprlist ::= nexprlist COMMA expr", /* 205 */ "nexprlist ::= expr", /* 206 */ "paren_exprlist ::=", /* 207 */ "paren_exprlist ::= LP exprlist RP", /* 208 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt", /* 209 */ "uniqueflag ::= UNIQUE", /* 210 */ "uniqueflag ::=", /* 211 */ "eidlist_opt ::=", /* 212 */ "eidlist_opt ::= LP eidlist RP", /* 213 */ "eidlist ::= eidlist COMMA nm collate sortorder", /* 214 */ "eidlist ::= nm collate sortorder", /* 215 */ "collate ::=", /* 216 */ "collate ::= COLLATE ID|STRING", /* 217 */ "cmd ::= DROP INDEX ifexists fullname", /* 218 */ "cmd ::= VACUUM", /* 219 */ "cmd ::= VACUUM nm", /* 220 */ "cmd ::= PRAGMA nm dbnm", /* 221 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", /* 222 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", /* 223 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", /* 224 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", /* 225 */ "plus_num ::= PLUS INTEGER|FLOAT", /* 226 */ "minus_num ::= MINUS INTEGER|FLOAT", /* 227 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", /* 228 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", /* 229 */ "trigger_time ::= BEFORE", /* 230 */ "trigger_time ::= AFTER", /* 231 */ "trigger_time ::= INSTEAD OF", /* 232 */ "trigger_time ::=", /* 233 */ "trigger_event ::= DELETE|INSERT", /* 234 */ "trigger_event ::= UPDATE", /* 235 */ "trigger_event ::= UPDATE OF idlist", /* 236 */ "when_clause ::=", /* 237 */ "when_clause ::= WHEN expr", /* 238 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", /* 239 */ "trigger_cmd_list ::= trigger_cmd SEMI", /* 240 */ "trnm ::= nm DOT nm", /* 241 */ "tridxby ::= INDEXED BY nm", /* 242 */ "tridxby ::= NOT INDEXED", /* 243 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt", /* 244 */ "trigger_cmd ::= insert_cmd INTO trnm idlist_opt select", /* 245 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt", /* 246 */ "trigger_cmd ::= select", /* 247 */ "expr ::= RAISE LP IGNORE RP", /* 248 */ "expr ::= RAISE LP raisetype COMMA nm RP", /* 249 */ "raisetype ::= ROLLBACK", /* 250 */ "raisetype ::= ABORT", /* 251 */ "raisetype ::= FAIL", /* 252 */ "cmd ::= DROP TRIGGER ifexists fullname", /* 253 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", /* 254 */ "cmd ::= DETACH database_kw_opt expr", /* 255 */ "key_opt ::=", /* 256 */ "key_opt ::= KEY expr", /* 257 */ "cmd ::= REINDEX", /* 258 */ "cmd ::= REINDEX nm dbnm", /* 259 */ "cmd ::= ANALYZE", /* 260 */ "cmd ::= ANALYZE nm dbnm", /* 261 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", /* 262 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist", /* 263 */ "add_column_fullname ::= fullname", /* 264 */ "cmd ::= create_vtab", /* 265 */ "cmd ::= create_vtab LP vtabarglist RP", /* 266 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm", /* 267 */ "vtabarg ::=", /* 268 */ "vtabargtoken ::= ANY", /* 269 */ "vtabargtoken ::= lp anylist RP", /* 270 */ "lp ::= LP", /* 271 */ "with ::=", /* 272 */ "with ::= WITH wqlist", /* 273 */ "with ::= WITH RECURSIVE wqlist", /* 274 */ "wqlist ::= nm eidlist_opt AS LP select RP", /* 275 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP", /* 276 */ "input ::= cmdlist", /* 277 */ "cmdlist ::= cmdlist ecmd", /* 278 */ "cmdlist ::= ecmd", /* 279 */ "ecmd ::= SEMI", /* 280 */ "ecmd ::= explain cmdx SEMI", /* 281 */ "explain ::=", /* 282 */ "trans_opt ::=", /* 283 */ "trans_opt ::= TRANSACTION", /* 284 */ "trans_opt ::= TRANSACTION nm", /* 285 */ "savepoint_opt ::= SAVEPOINT", /* 286 */ "savepoint_opt ::=", /* 287 */ "cmd ::= create_table create_table_args", /* 288 */ "columnlist ::= columnlist COMMA columnname carglist", /* 289 */ "columnlist ::= columnname carglist", /* 290 */ "nm ::= ID|INDEXED", /* 291 */ "nm ::= STRING", /* 292 */ "nm ::= JOIN_KW", /* 293 */ "typetoken ::= typename", /* 294 */ "typename ::= ID|STRING", /* 295 */ "signed ::= plus_num", /* 296 */ "signed ::= minus_num", /* 297 */ "carglist ::= carglist ccons", /* 298 */ "carglist ::=", /* 299 */ "ccons ::= NULL onconf", /* 300 */ "conslist_opt ::= COMMA conslist", /* 301 */ "conslist ::= conslist tconscomma tcons", /* 302 */ "conslist ::= tcons", /* 303 */ "tconscomma ::=", /* 304 */ "defer_subclause_opt ::= defer_subclause", /* 305 */ "resolvetype ::= raisetype", /* 306 */ "selectnowith ::= oneselect", /* 307 */ "oneselect ::= values", /* 308 */ "sclp ::= selcollist COMMA", /* 309 */ "as ::= ID|STRING", /* 310 */ "expr ::= term", /* 311 */ "exprlist ::= nexprlist", /* 312 */ "nmnum ::= plus_num", /* 313 */ "nmnum ::= nm", /* 314 */ "nmnum ::= ON", /* 315 */ "nmnum ::= DELETE", /* 316 */ "nmnum ::= DEFAULT", /* 317 */ "plus_num ::= INTEGER|FLOAT", /* 318 */ "foreach_clause ::=", /* 319 */ "foreach_clause ::= FOR EACH ROW", /* 320 */ "trnm ::= nm", /* 321 */ "tridxby ::=", /* 322 */ "database_kw_opt ::= DATABASE", /* 323 */ "database_kw_opt ::=", /* 324 */ "kwcolumn_opt ::=", /* 325 */ "kwcolumn_opt ::= COLUMNKW", /* 326 */ "vtabarglist ::= vtabarg", /* 327 */ "vtabarglist ::= vtabarglist COMMA vtabarg", /* 328 */ "vtabarg ::= vtabarg vtabargtoken", /* 329 */ "anylist ::=", /* 330 */ "anylist ::= anylist LP anylist RP", /* 331 */ "anylist ::= anylist ANY", }; #endif /* NDEBUG */ #if YYSTACKDEPTH<=0 /* ** Try to increase the size of the parser stack. Return the number |
| ︙ | ︙ | |||
134809 134810 134811 134812 134813 134814 134815 134816 134817 134818 134819 134820 134821 134822 |
{ 172, 1 },
{ 173, 1 },
{ 173, 1 },
{ 173, 3 },
{ 173, 5 },
{ 172, 1 },
{ 172, 1 },
{ 173, 1 },
{ 173, 3 },
{ 173, 6 },
{ 173, 5 },
{ 173, 4 },
{ 172, 1 },
{ 173, 5 },
| > | 134784 134785 134786 134787 134788 134789 134790 134791 134792 134793 134794 134795 134796 134797 134798 |
{ 172, 1 },
{ 173, 1 },
{ 173, 1 },
{ 173, 3 },
{ 173, 5 },
{ 172, 1 },
{ 172, 1 },
{ 172, 1 },
{ 173, 1 },
{ 173, 3 },
{ 173, 6 },
{ 173, 5 },
{ 173, 4 },
{ 172, 1 },
{ 173, 5 },
|
| ︙ | ︙ | |||
135103 135104 135105 135106 135107 135108 135109 |
case 19: /* temp ::= */ yytestcase(yyruleno==19);
case 22: /* table_options ::= */ yytestcase(yyruleno==22);
case 42: /* autoinc ::= */ yytestcase(yyruleno==42);
case 57: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==57);
case 67: /* defer_subclause_opt ::= */ yytestcase(yyruleno==67);
case 76: /* ifexists ::= */ yytestcase(yyruleno==76);
case 90: /* distinct ::= */ yytestcase(yyruleno==90);
| | | 135079 135080 135081 135082 135083 135084 135085 135086 135087 135088 135089 135090 135091 135092 135093 |
case 19: /* temp ::= */ yytestcase(yyruleno==19);
case 22: /* table_options ::= */ yytestcase(yyruleno==22);
case 42: /* autoinc ::= */ yytestcase(yyruleno==42);
case 57: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==57);
case 67: /* defer_subclause_opt ::= */ yytestcase(yyruleno==67);
case 76: /* ifexists ::= */ yytestcase(yyruleno==76);
case 90: /* distinct ::= */ yytestcase(yyruleno==90);
case 215: /* collate ::= */ yytestcase(yyruleno==215);
{yymsp[1].minor.yy194 = 0;}
break;
case 17: /* ifnotexists ::= IF NOT EXISTS */
{yymsp[-2].minor.yy194 = 1;}
break;
case 18: /* temp ::= TEMP */
case 43: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==43);
|
| ︙ | ︙ | |||
135247 135248 135249 135250 135251 135252 135253 |
case 56: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
case 71: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==71);
case 144: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==144);
{yymsp[-1].minor.yy194 = yymsp[0].minor.yy194;}
break;
case 58: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
case 75: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==75);
| | | | | 135223 135224 135225 135226 135227 135228 135229 135230 135231 135232 135233 135234 135235 135236 135237 135238 135239 |
case 56: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
case 71: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==71);
case 144: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==144);
{yymsp[-1].minor.yy194 = yymsp[0].minor.yy194;}
break;
case 58: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
case 75: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==75);
case 187: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==187);
case 190: /* in_op ::= NOT IN */ yytestcase(yyruleno==190);
case 216: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==216);
{yymsp[-1].minor.yy194 = 1;}
break;
case 59: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
{yymsp[-1].minor.yy194 = 0;}
break;
case 61: /* tconscomma ::= COMMA */
{pParse->constraintName.n = 0;}
|
| ︙ | ︙ | |||
135413 135414 135415 135416 135417 135418 135419 |
break;
case 89: /* distinct ::= ALL */
{yymsp[0].minor.yy194 = SF_All;}
break;
case 91: /* sclp ::= */
case 119: /* orderby_opt ::= */ yytestcase(yyruleno==119);
case 126: /* groupby_opt ::= */ yytestcase(yyruleno==126);
| | | | | | | | 135389 135390 135391 135392 135393 135394 135395 135396 135397 135398 135399 135400 135401 135402 135403 135404 135405 135406 135407 135408 135409 135410 135411 135412 135413 135414 135415 135416 135417 135418 135419 135420 135421 135422 135423 135424 135425 135426 135427 135428 135429 135430 135431 135432 |
break;
case 89: /* distinct ::= ALL */
{yymsp[0].minor.yy194 = SF_All;}
break;
case 91: /* sclp ::= */
case 119: /* orderby_opt ::= */ yytestcase(yyruleno==119);
case 126: /* groupby_opt ::= */ yytestcase(yyruleno==126);
case 203: /* exprlist ::= */ yytestcase(yyruleno==203);
case 206: /* paren_exprlist ::= */ yytestcase(yyruleno==206);
case 211: /* eidlist_opt ::= */ yytestcase(yyruleno==211);
{yymsp[1].minor.yy148 = 0;}
break;
case 92: /* selcollist ::= sclp expr as */
{
yymsp[-2].minor.yy148 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy148, yymsp[-1].minor.yy190.pExpr);
if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-2].minor.yy148, &yymsp[0].minor.yy0, 1);
sqlite3ExprListSetSpan(pParse,yymsp[-2].minor.yy148,&yymsp[-1].minor.yy190);
}
break;
case 93: /* selcollist ::= sclp STAR */
{
Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
yymsp[-1].minor.yy148 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy148, p);
}
break;
case 94: /* selcollist ::= sclp nm DOT STAR */
{
Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0, 0);
Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy148, pDot);
}
break;
case 95: /* as ::= AS nm */
case 106: /* dbnm ::= DOT nm */ yytestcase(yyruleno==106);
case 225: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==225);
case 226: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==226);
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
break;
case 97: /* from ::= */
{yymsp[1].minor.yy185 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy185));}
break;
case 98: /* from ::= FROM seltablist */
{
|
| ︙ | ︙ | |||
135525 135526 135527 135528 135529 135530 135531 |
break;
case 111: /* joinop ::= JOIN_KW nm nm JOIN */
{yymsp[-3].minor.yy194 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
break;
case 112: /* on_opt ::= ON expr */
case 129: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==129);
case 136: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==136);
| | | | | 135501 135502 135503 135504 135505 135506 135507 135508 135509 135510 135511 135512 135513 135514 135515 135516 135517 135518 135519 135520 135521 135522 |
break;
case 111: /* joinop ::= JOIN_KW nm nm JOIN */
{yymsp[-3].minor.yy194 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
break;
case 112: /* on_opt ::= ON expr */
case 129: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==129);
case 136: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==136);
case 199: /* case_else ::= ELSE expr */ yytestcase(yyruleno==199);
{yymsp[-1].minor.yy72 = yymsp[0].minor.yy190.pExpr;}
break;
case 113: /* on_opt ::= */
case 128: /* having_opt ::= */ yytestcase(yyruleno==128);
case 135: /* where_opt ::= */ yytestcase(yyruleno==135);
case 200: /* case_else ::= */ yytestcase(yyruleno==200);
case 202: /* case_operand ::= */ yytestcase(yyruleno==202);
{yymsp[1].minor.yy72 = 0;}
break;
case 115: /* indexed_opt ::= INDEXED BY nm */
{yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
break;
case 116: /* indexed_opt ::= NOT INDEXED */
{yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
|
| ︙ | ︙ | |||
135648 135649 135650 135651 135652 135653 135654 |
case 149: /* idlist ::= nm */
{yymsp[0].minor.yy254 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
break;
case 150: /* expr ::= LP expr RP */
{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;}
break;
case 151: /* term ::= NULL */
| | | | | | | > > > > > > > > > | > | | | | | | | | | | | | | | | | | | | | | > > | | | > > | | | | | | | | | | | | | | | 135624 135625 135626 135627 135628 135629 135630 135631 135632 135633 135634 135635 135636 135637 135638 135639 135640 135641 135642 135643 135644 135645 135646 135647 135648 135649 135650 135651 135652 135653 135654 135655 135656 135657 135658 135659 135660 135661 135662 135663 135664 135665 135666 135667 135668 135669 135670 135671 135672 135673 135674 135675 135676 135677 135678 135679 135680 135681 135682 135683 135684 135685 135686 135687 135688 135689 135690 135691 135692 135693 135694 135695 135696 135697 135698 135699 135700 135701 135702 135703 135704 135705 135706 135707 135708 135709 135710 135711 135712 135713 135714 135715 135716 135717 135718 135719 135720 135721 135722 135723 135724 135725 135726 135727 135728 135729 135730 135731 135732 135733 135734 135735 135736 135737 135738 135739 135740 135741 135742 135743 135744 135745 135746 135747 135748 135749 135750 135751 135752 135753 135754 135755 135756 135757 135758 135759 135760 135761 135762 135763 135764 135765 135766 135767 135768 135769 135770 135771 135772 135773 135774 135775 135776 135777 135778 135779 135780 135781 135782 135783 135784 135785 135786 135787 135788 135789 135790 135791 135792 135793 135794 135795 135796 135797 135798 135799 135800 135801 135802 135803 135804 135805 135806 135807 135808 135809 135810 135811 135812 135813 135814 135815 135816 135817 135818 135819 135820 135821 135822 135823 135824 135825 135826 135827 135828 135829 135830 135831 135832 135833 135834 135835 135836 135837 |
case 149: /* idlist ::= nm */
{yymsp[0].minor.yy254 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
break;
case 150: /* expr ::= LP expr RP */
{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;}
break;
case 151: /* term ::= NULL */
case 156: /* term ::= FLOAT|BLOB */ yytestcase(yyruleno==156);
case 157: /* term ::= STRING */ yytestcase(yyruleno==157);
{spanExpr(&yymsp[0].minor.yy190,pParse,yymsp[0].major,yymsp[0].minor.yy0);/*A-overwrites-X*/}
break;
case 152: /* expr ::= ID|INDEXED */
case 153: /* expr ::= JOIN_KW */ yytestcase(yyruleno==153);
{spanExpr(&yymsp[0].minor.yy190,pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
break;
case 154: /* expr ::= nm DOT nm */
{
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
spanSet(&yymsp[-2].minor.yy190,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
yymsp[-2].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
}
break;
case 155: /* expr ::= nm DOT nm DOT nm */
{
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
Expr *temp3 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
spanSet(&yymsp[-4].minor.yy190,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
}
break;
case 158: /* term ::= INTEGER */
{
yylhsminor.yy190.pExpr = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
yylhsminor.yy190.zStart = yymsp[0].minor.yy0.z;
yylhsminor.yy190.zEnd = yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n;
if( yylhsminor.yy190.pExpr ) yylhsminor.yy190.pExpr->flags |= EP_Leaf;
}
yymsp[0].minor.yy190 = yylhsminor.yy190;
break;
case 159: /* expr ::= VARIABLE */
{
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
u32 n = yymsp[0].minor.yy0.n;
spanExpr(&yymsp[0].minor.yy190, pParse, TK_VARIABLE, yymsp[0].minor.yy0);
sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy190.pExpr, n);
}else{
/* When doing a nested parse, one can include terms in an expression
** that look like this: #1 #2 ... These terms refer to registers
** in the virtual machine. #N is the N-th register. */
Token t = yymsp[0].minor.yy0; /*A-overwrites-X*/
assert( t.n>=2 );
spanSet(&yymsp[0].minor.yy190, &t, &t);
if( pParse->nested==0 ){
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
yymsp[0].minor.yy190.pExpr = 0;
}else{
yymsp[0].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, 0);
if( yymsp[0].minor.yy190.pExpr ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy190.pExpr->iTable);
}
}
}
break;
case 160: /* expr ::= expr COLLATE ID|STRING */
{
yymsp[-2].minor.yy190.pExpr = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy190.pExpr, &yymsp[0].minor.yy0, 1);
yymsp[-2].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
break;
case 161: /* expr ::= CAST LP expr AS typetoken RP */
{
spanSet(&yymsp[-5].minor.yy190,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
yymsp[-5].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy190.pExpr, 0, &yymsp[-1].minor.yy0);
}
break;
case 162: /* expr ::= ID|INDEXED LP distinct exprlist RP */
{
if( yymsp[-1].minor.yy148 && yymsp[-1].minor.yy148->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){
sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
}
yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy148, &yymsp[-4].minor.yy0);
spanSet(&yylhsminor.yy190,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
if( yymsp[-2].minor.yy194==SF_Distinct && yylhsminor.yy190.pExpr ){
yylhsminor.yy190.pExpr->flags |= EP_Distinct;
}
}
yymsp[-4].minor.yy190 = yylhsminor.yy190;
break;
case 163: /* expr ::= ID|INDEXED LP STAR RP */
{
yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
spanSet(&yylhsminor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
}
yymsp[-3].minor.yy190 = yylhsminor.yy190;
break;
case 164: /* term ::= CTIME_KW */
{
yylhsminor.yy190.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0);
spanSet(&yylhsminor.yy190, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0);
}
yymsp[0].minor.yy190 = yylhsminor.yy190;
break;
case 165: /* expr ::= LP nexprlist COMMA expr RP */
{
ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy148, yymsp[-1].minor.yy190.pExpr);
yylhsminor.yy190.pExpr = sqlite3PExpr(pParse, TK_VECTOR, 0, 0, 0);
if( yylhsminor.yy190.pExpr ){
yylhsminor.yy190.pExpr->x.pList = pList;
spanSet(&yylhsminor.yy190, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0);
}else{
sqlite3ExprListDelete(pParse->db, pList);
}
}
yymsp[-4].minor.yy190 = yylhsminor.yy190;
break;
case 166: /* expr ::= expr AND expr */
case 167: /* expr ::= expr OR expr */ yytestcase(yyruleno==167);
case 168: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==168);
case 169: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==169);
case 170: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==170);
case 171: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==171);
case 172: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==172);
case 173: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==173);
{spanBinaryExpr(pParse,yymsp[-1].major,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy190);}
break;
case 174: /* likeop ::= LIKE_KW|MATCH */
{yymsp[0].minor.yy0=yymsp[0].minor.yy0;/*A-overwrites-X*/}
break;
case 175: /* likeop ::= NOT LIKE_KW|MATCH */
{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
break;
case 176: /* expr ::= expr likeop expr */
{
ExprList *pList;
int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
yymsp[-1].minor.yy0.n &= 0x7fffffff;
pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy190.pExpr);
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy190.pExpr);
yymsp[-2].minor.yy190.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0);
exprNot(pParse, bNot, &yymsp[-2].minor.yy190);
yymsp[-2].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
if( yymsp[-2].minor.yy190.pExpr ) yymsp[-2].minor.yy190.pExpr->flags |= EP_InfixFunc;
}
break;
case 177: /* expr ::= expr likeop expr ESCAPE expr */
{
ExprList *pList;
int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
yymsp[-3].minor.yy0.n &= 0x7fffffff;
pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy190.pExpr);
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy190.pExpr);
yymsp[-4].minor.yy190.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0);
exprNot(pParse, bNot, &yymsp[-4].minor.yy190);
yymsp[-4].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
if( yymsp[-4].minor.yy190.pExpr ) yymsp[-4].minor.yy190.pExpr->flags |= EP_InfixFunc;
}
break;
case 178: /* expr ::= expr ISNULL|NOTNULL */
{spanUnaryPostfix(pParse,yymsp[0].major,&yymsp[-1].minor.yy190,&yymsp[0].minor.yy0);}
break;
case 179: /* expr ::= expr NOT NULL */
{spanUnaryPostfix(pParse,TK_NOTNULL,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy0);}
break;
case 180: /* expr ::= expr IS expr */
{
spanBinaryExpr(pParse,TK_IS,&yymsp[-2].minor.yy190,&yymsp[0].minor.yy190);
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy190.pExpr, yymsp[-2].minor.yy190.pExpr, TK_ISNULL);
}
break;
case 181: /* expr ::= expr IS NOT expr */
{
spanBinaryExpr(pParse,TK_ISNOT,&yymsp[-3].minor.yy190,&yymsp[0].minor.yy190);
binaryToUnaryIfNull(pParse, yymsp[0].minor.yy190.pExpr, yymsp[-3].minor.yy190.pExpr, TK_NOTNULL);
}
break;
case 182: /* expr ::= NOT expr */
case 183: /* expr ::= BITNOT expr */ yytestcase(yyruleno==183);
{spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,yymsp[-1].major,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
break;
case 184: /* expr ::= MINUS expr */
{spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,TK_UMINUS,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
break;
case 185: /* expr ::= PLUS expr */
{spanUnaryPrefix(&yymsp[-1].minor.yy190,pParse,TK_UPLUS,&yymsp[0].minor.yy190,&yymsp[-1].minor.yy0);/*A-overwrites-B*/}
break;
case 186: /* between_op ::= BETWEEN */
case 189: /* in_op ::= IN */ yytestcase(yyruleno==189);
{yymsp[0].minor.yy194 = 0;}
break;
case 188: /* expr ::= expr between_op expr AND expr */
{
ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy190.pExpr);
yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy190.pExpr, 0, 0);
if( yymsp[-4].minor.yy190.pExpr ){
yymsp[-4].minor.yy190.pExpr->x.pList = pList;
}else{
sqlite3ExprListDelete(pParse->db, pList);
}
exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
yymsp[-4].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd;
}
break;
case 191: /* expr ::= expr in_op LP exprlist RP */
{
if( yymsp[-1].minor.yy148==0 ){
/* Expressions of the form
**
** expr1 IN ()
** expr1 NOT IN ()
**
|
| ︙ | ︙ | |||
135886 135887 135888 135889 135890 135891 135892 |
sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy148);
}
exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
}
yymsp[-4].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
break;
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 135876 135877 135878 135879 135880 135881 135882 135883 135884 135885 135886 135887 135888 135889 135890 135891 135892 135893 135894 135895 135896 135897 135898 135899 135900 135901 135902 135903 135904 135905 135906 135907 135908 135909 135910 135911 135912 135913 135914 135915 135916 135917 135918 135919 135920 135921 135922 135923 135924 135925 135926 135927 135928 135929 135930 135931 135932 135933 135934 135935 135936 135937 135938 135939 135940 135941 135942 135943 135944 135945 135946 135947 135948 135949 135950 135951 135952 135953 135954 135955 135956 135957 135958 135959 135960 135961 135962 135963 135964 135965 135966 135967 135968 135969 135970 135971 135972 135973 135974 135975 135976 135977 135978 135979 135980 135981 135982 135983 135984 135985 135986 135987 135988 135989 135990 135991 135992 135993 135994 135995 135996 135997 135998 135999 136000 136001 136002 136003 136004 136005 136006 136007 136008 136009 136010 136011 136012 136013 136014 136015 136016 136017 136018 136019 136020 136021 136022 136023 136024 136025 136026 136027 136028 136029 136030 136031 136032 136033 136034 136035 136036 136037 136038 136039 136040 136041 136042 136043 136044 136045 136046 136047 136048 136049 136050 136051 136052 136053 136054 136055 136056 136057 136058 136059 136060 136061 136062 136063 136064 136065 136066 136067 136068 136069 136070 136071 136072 136073 136074 136075 136076 136077 136078 136079 136080 136081 136082 136083 136084 136085 136086 136087 136088 136089 136090 136091 136092 136093 136094 136095 136096 136097 136098 136099 136100 136101 136102 136103 136104 136105 136106 136107 136108 136109 136110 136111 136112 136113 136114 136115 136116 136117 136118 136119 136120 136121 136122 136123 136124 136125 136126 136127 136128 136129 136130 136131 136132 136133 136134 136135 136136 136137 136138 136139 136140 136141 136142 136143 136144 136145 136146 136147 136148 136149 136150 136151 136152 136153 136154 136155 136156 136157 136158 136159 136160 136161 136162 136163 136164 136165 136166 136167 136168 136169 136170 136171 136172 136173 136174 136175 136176 136177 136178 136179 136180 136181 136182 136183 136184 136185 136186 136187 136188 136189 136190 136191 136192 136193 136194 136195 136196 136197 136198 136199 136200 136201 136202 136203 136204 136205 136206 136207 136208 136209 136210 136211 136212 136213 136214 136215 136216 136217 136218 136219 136220 136221 136222 136223 136224 136225 136226 136227 136228 136229 136230 136231 136232 136233 136234 136235 136236 136237 136238 136239 136240 136241 136242 136243 136244 136245 136246 136247 136248 136249 136250 136251 136252 136253 136254 136255 136256 136257 136258 136259 136260 |
sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy148);
}
exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
}
yymsp[-4].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
break;
case 192: /* expr ::= LP select RP */
{
spanSet(&yymsp[-2].minor.yy190,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-B*/
yymsp[-2].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy190.pExpr, yymsp[-1].minor.yy243);
}
break;
case 193: /* expr ::= expr in_op LP select RP */
{
yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy190.pExpr, 0, 0);
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy190.pExpr, yymsp[-1].minor.yy243);
exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
yymsp[-4].minor.yy190.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n];
}
break;
case 194: /* expr ::= expr in_op nm dbnm paren_exprlist */
{
SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
if( yymsp[0].minor.yy148 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy148);
yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy190.pExpr, 0, 0);
sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy190.pExpr, pSelect);
exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190);
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];
}
break;
case 195: /* expr ::= EXISTS LP select RP */
{
Expr *p;
spanSet(&yymsp[-3].minor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-B*/
p = yymsp[-3].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy243);
}
break;
case 196: /* expr ::= CASE case_operand case_exprlist case_else END */
{
spanSet(&yymsp[-4].minor.yy190,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-C*/
yymsp[-4].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy72, 0, 0);
if( yymsp[-4].minor.yy190.pExpr ){
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;
sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy190.pExpr);
}else{
sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy148);
sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy72);
}
}
break;
case 197: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
{
yymsp[-4].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy148, yymsp[-2].minor.yy190.pExpr);
yymsp[-4].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy148, yymsp[0].minor.yy190.pExpr);
}
break;
case 198: /* case_exprlist ::= WHEN expr THEN expr */
{
yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy190.pExpr);
yymsp[-3].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy148, yymsp[0].minor.yy190.pExpr);
}
break;
case 201: /* case_operand ::= expr */
{yymsp[0].minor.yy72 = yymsp[0].minor.yy190.pExpr; /*A-overwrites-X*/}
break;
case 204: /* nexprlist ::= nexprlist COMMA expr */
{yymsp[-2].minor.yy148 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy148,yymsp[0].minor.yy190.pExpr);}
break;
case 205: /* nexprlist ::= expr */
{yymsp[0].minor.yy148 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy190.pExpr); /*A-overwrites-Y*/}
break;
case 207: /* paren_exprlist ::= LP exprlist RP */
case 212: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==212);
{yymsp[-2].minor.yy148 = yymsp[-1].minor.yy148;}
break;
case 208: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
{
sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy148, yymsp[-10].minor.yy194,
&yymsp[-11].minor.yy0, yymsp[0].minor.yy72, SQLITE_SO_ASC, yymsp[-8].minor.yy194, SQLITE_IDXTYPE_APPDEF);
}
break;
case 209: /* uniqueflag ::= UNIQUE */
case 250: /* raisetype ::= ABORT */ yytestcase(yyruleno==250);
{yymsp[0].minor.yy194 = OE_Abort;}
break;
case 210: /* uniqueflag ::= */
{yymsp[1].minor.yy194 = OE_None;}
break;
case 213: /* eidlist ::= eidlist COMMA nm collate sortorder */
{
yymsp[-4].minor.yy148 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy148, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy194, yymsp[0].minor.yy194);
}
break;
case 214: /* eidlist ::= nm collate sortorder */
{
yymsp[-2].minor.yy148 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy194, yymsp[0].minor.yy194); /*A-overwrites-Y*/
}
break;
case 217: /* cmd ::= DROP INDEX ifexists fullname */
{sqlite3DropIndex(pParse, yymsp[0].minor.yy185, yymsp[-1].minor.yy194);}
break;
case 218: /* cmd ::= VACUUM */
{sqlite3Vacuum(pParse,0);}
break;
case 219: /* cmd ::= VACUUM nm */
{sqlite3Vacuum(pParse,&yymsp[0].minor.yy0);}
break;
case 220: /* cmd ::= PRAGMA nm dbnm */
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
break;
case 221: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
break;
case 222: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
break;
case 223: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
break;
case 224: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
break;
case 227: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
{
Token all;
all.z = yymsp[-3].minor.yy0.z;
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy145, &all);
}
break;
case 228: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
{
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);
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
}
break;
case 229: /* trigger_time ::= BEFORE */
{ yymsp[0].minor.yy194 = TK_BEFORE; }
break;
case 230: /* trigger_time ::= AFTER */
{ yymsp[0].minor.yy194 = TK_AFTER; }
break;
case 231: /* trigger_time ::= INSTEAD OF */
{ yymsp[-1].minor.yy194 = TK_INSTEAD;}
break;
case 232: /* trigger_time ::= */
{ yymsp[1].minor.yy194 = TK_BEFORE; }
break;
case 233: /* trigger_event ::= DELETE|INSERT */
case 234: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==234);
{yymsp[0].minor.yy332.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy332.b = 0;}
break;
case 235: /* trigger_event ::= UPDATE OF idlist */
{yymsp[-2].minor.yy332.a = TK_UPDATE; yymsp[-2].minor.yy332.b = yymsp[0].minor.yy254;}
break;
case 236: /* when_clause ::= */
case 255: /* key_opt ::= */ yytestcase(yyruleno==255);
{ yymsp[1].minor.yy72 = 0; }
break;
case 237: /* when_clause ::= WHEN expr */
case 256: /* key_opt ::= KEY expr */ yytestcase(yyruleno==256);
{ yymsp[-1].minor.yy72 = yymsp[0].minor.yy190.pExpr; }
break;
case 238: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
{
assert( yymsp[-2].minor.yy145!=0 );
yymsp[-2].minor.yy145->pLast->pNext = yymsp[-1].minor.yy145;
yymsp[-2].minor.yy145->pLast = yymsp[-1].minor.yy145;
}
break;
case 239: /* trigger_cmd_list ::= trigger_cmd SEMI */
{
assert( yymsp[-1].minor.yy145!=0 );
yymsp[-1].minor.yy145->pLast = yymsp[-1].minor.yy145;
}
break;
case 240: /* trnm ::= nm DOT nm */
{
yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
sqlite3ErrorMsg(pParse,
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
"statements within triggers");
}
break;
case 241: /* tridxby ::= INDEXED BY nm */
{
sqlite3ErrorMsg(pParse,
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
"within triggers");
}
break;
case 242: /* tridxby ::= NOT INDEXED */
{
sqlite3ErrorMsg(pParse,
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
"within triggers");
}
break;
case 243: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */
{yymsp[-6].minor.yy145 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy148, yymsp[0].minor.yy72, yymsp[-5].minor.yy194);}
break;
case 244: /* trigger_cmd ::= insert_cmd INTO trnm idlist_opt select */
{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*/}
break;
case 245: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */
{yymsp[-4].minor.yy145 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy72);}
break;
case 246: /* trigger_cmd ::= select */
{yymsp[0].minor.yy145 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy243); /*A-overwrites-X*/}
break;
case 247: /* expr ::= RAISE LP IGNORE RP */
{
spanSet(&yymsp[-3].minor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
yymsp[-3].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0);
if( yymsp[-3].minor.yy190.pExpr ){
yymsp[-3].minor.yy190.pExpr->affinity = OE_Ignore;
}
}
break;
case 248: /* expr ::= RAISE LP raisetype COMMA nm RP */
{
spanSet(&yymsp[-5].minor.yy190,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/
yymsp[-5].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0);
if( yymsp[-5].minor.yy190.pExpr ) {
yymsp[-5].minor.yy190.pExpr->affinity = (char)yymsp[-3].minor.yy194;
}
}
break;
case 249: /* raisetype ::= ROLLBACK */
{yymsp[0].minor.yy194 = OE_Rollback;}
break;
case 251: /* raisetype ::= FAIL */
{yymsp[0].minor.yy194 = OE_Fail;}
break;
case 252: /* cmd ::= DROP TRIGGER ifexists fullname */
{
sqlite3DropTrigger(pParse,yymsp[0].minor.yy185,yymsp[-1].minor.yy194);
}
break;
case 253: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
{
sqlite3Attach(pParse, yymsp[-3].minor.yy190.pExpr, yymsp[-1].minor.yy190.pExpr, yymsp[0].minor.yy72);
}
break;
case 254: /* cmd ::= DETACH database_kw_opt expr */
{
sqlite3Detach(pParse, yymsp[0].minor.yy190.pExpr);
}
break;
case 257: /* cmd ::= REINDEX */
{sqlite3Reindex(pParse, 0, 0);}
break;
case 258: /* cmd ::= REINDEX nm dbnm */
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
break;
case 259: /* cmd ::= ANALYZE */
{sqlite3Analyze(pParse, 0, 0);}
break;
case 260: /* cmd ::= ANALYZE nm dbnm */
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
break;
case 261: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
{
sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy185,&yymsp[0].minor.yy0);
}
break;
case 262: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
{
yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
}
break;
case 263: /* add_column_fullname ::= fullname */
{
disableLookaside(pParse);
sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy185);
}
break;
case 264: /* cmd ::= create_vtab */
{sqlite3VtabFinishParse(pParse,0);}
break;
case 265: /* cmd ::= create_vtab LP vtabarglist RP */
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
break;
case 266: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
{
sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy194);
}
break;
case 267: /* vtabarg ::= */
{sqlite3VtabArgInit(pParse);}
break;
case 268: /* vtabargtoken ::= ANY */
case 269: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==269);
case 270: /* lp ::= LP */ yytestcase(yyruleno==270);
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
break;
case 271: /* with ::= */
{yymsp[1].minor.yy285 = 0;}
break;
case 272: /* with ::= WITH wqlist */
{ yymsp[-1].minor.yy285 = yymsp[0].minor.yy285; }
break;
case 273: /* with ::= WITH RECURSIVE wqlist */
{ yymsp[-2].minor.yy285 = yymsp[0].minor.yy285; }
break;
case 274: /* wqlist ::= nm eidlist_opt AS LP select RP */
{
yymsp[-5].minor.yy285 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy148, yymsp[-1].minor.yy243); /*A-overwrites-X*/
}
break;
case 275: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
{
yymsp[-7].minor.yy285 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy285, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy148, yymsp[-1].minor.yy243);
}
break;
default:
/* (276) input ::= cmdlist */ yytestcase(yyruleno==276);
/* (277) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==277);
/* (278) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=278);
/* (279) ecmd ::= SEMI */ yytestcase(yyruleno==279);
/* (280) ecmd ::= explain cmdx SEMI */ yytestcase(yyruleno==280);
/* (281) explain ::= */ yytestcase(yyruleno==281);
/* (282) trans_opt ::= */ yytestcase(yyruleno==282);
/* (283) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==283);
/* (284) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==284);
/* (285) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==285);
/* (286) savepoint_opt ::= */ yytestcase(yyruleno==286);
/* (287) cmd ::= create_table create_table_args */ yytestcase(yyruleno==287);
/* (288) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==288);
/* (289) columnlist ::= columnname carglist */ yytestcase(yyruleno==289);
/* (290) nm ::= ID|INDEXED */ yytestcase(yyruleno==290);
/* (291) nm ::= STRING */ yytestcase(yyruleno==291);
/* (292) nm ::= JOIN_KW */ yytestcase(yyruleno==292);
/* (293) typetoken ::= typename */ yytestcase(yyruleno==293);
/* (294) typename ::= ID|STRING */ yytestcase(yyruleno==294);
/* (295) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=295);
/* (296) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=296);
/* (297) carglist ::= carglist ccons */ yytestcase(yyruleno==297);
/* (298) carglist ::= */ yytestcase(yyruleno==298);
/* (299) ccons ::= NULL onconf */ yytestcase(yyruleno==299);
/* (300) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==300);
/* (301) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==301);
/* (302) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=302);
/* (303) tconscomma ::= */ yytestcase(yyruleno==303);
/* (304) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=304);
/* (305) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=305);
/* (306) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=306);
/* (307) oneselect ::= values */ yytestcase(yyruleno==307);
/* (308) sclp ::= selcollist COMMA */ yytestcase(yyruleno==308);
/* (309) as ::= ID|STRING */ yytestcase(yyruleno==309);
/* (310) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=310);
/* (311) exprlist ::= nexprlist */ yytestcase(yyruleno==311);
/* (312) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=312);
/* (313) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=313);
/* (314) nmnum ::= ON */ yytestcase(yyruleno==314);
/* (315) nmnum ::= DELETE */ yytestcase(yyruleno==315);
/* (316) nmnum ::= DEFAULT */ yytestcase(yyruleno==316);
/* (317) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==317);
/* (318) foreach_clause ::= */ yytestcase(yyruleno==318);
/* (319) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==319);
/* (320) trnm ::= nm */ yytestcase(yyruleno==320);
/* (321) tridxby ::= */ yytestcase(yyruleno==321);
/* (322) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==322);
/* (323) database_kw_opt ::= */ yytestcase(yyruleno==323);
/* (324) kwcolumn_opt ::= */ yytestcase(yyruleno==324);
/* (325) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==325);
/* (326) vtabarglist ::= vtabarg */ yytestcase(yyruleno==326);
/* (327) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==327);
/* (328) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==328);
/* (329) anylist ::= */ yytestcase(yyruleno==329);
/* (330) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==330);
/* (331) anylist ::= anylist ANY */ yytestcase(yyruleno==331);
break;
/********** End reduce actions ************************************************/
};
assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
yygoto = yyRuleInfo[yyruleno].lhs;
yysize = yyRuleInfo[yyruleno].nrhs;
yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto);
|
| ︙ | ︙ | |||
136447 136448 136449 136450 136451 136452 136453 |
fprintf(yyTraceFILE,"%sDiscard input token %s\n",
yyTracePrompt,yyTokenName[yymajor]);
}
#endif
yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
yymajor = YYNOCODE;
}else{
| | | 136437 136438 136439 136440 136441 136442 136443 136444 136445 136446 136447 136448 136449 136450 136451 |
fprintf(yyTraceFILE,"%sDiscard input token %s\n",
yyTracePrompt,yyTokenName[yymajor]);
}
#endif
yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
yymajor = YYNOCODE;
}else{
while( yypParser->yytos >= yypParser->yystack
&& yymx != YYERRORSYMBOL
&& (yyact = yy_find_reduce_action(
yypParser->yytos->stateno,
YYERRORSYMBOL)) >= YY_MIN_REDUCE
){
yy_pop_parser_stack(yypParser);
}
|
| ︙ | ︙ | |||
181138 181139 181140 181141 181142 181143 181144 |
fprintf(fts5yyTraceFILE,"%sDiscard input token %s\n",
fts5yyTracePrompt,fts5yyTokenName[fts5yymajor]);
}
#endif
fts5yy_destructor(fts5yypParser, (fts5YYCODETYPE)fts5yymajor, &fts5yyminorunion);
fts5yymajor = fts5YYNOCODE;
}else{
| | | 181128 181129 181130 181131 181132 181133 181134 181135 181136 181137 181138 181139 181140 181141 181142 |
fprintf(fts5yyTraceFILE,"%sDiscard input token %s\n",
fts5yyTracePrompt,fts5yyTokenName[fts5yymajor]);
}
#endif
fts5yy_destructor(fts5yypParser, (fts5YYCODETYPE)fts5yymajor, &fts5yyminorunion);
fts5yymajor = fts5YYNOCODE;
}else{
while( fts5yypParser->fts5yytos >= fts5yypParser->fts5yystack
&& fts5yymx != fts5YYERRORSYMBOL
&& (fts5yyact = fts5yy_find_reduce_action(
fts5yypParser->fts5yytos->stateno,
fts5YYERRORSYMBOL)) >= fts5YY_MIN_REDUCE
){
fts5yy_pop_parser_stack(fts5yypParser);
}
|
| ︙ | ︙ | |||
195595 195596 195597 195598 195599 195600 195601 |
static void fts5SourceIdFunc(
sqlite3_context *pCtx, /* Function call context */
int nArg, /* Number of args */
sqlite3_value **apUnused /* Function arguments */
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
| | | 195585 195586 195587 195588 195589 195590 195591 195592 195593 195594 195595 195596 195597 195598 195599 |
static void fts5SourceIdFunc(
sqlite3_context *pCtx, /* Function call context */
int nArg, /* Number of args */
sqlite3_value **apUnused /* Function arguments */
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
sqlite3_result_text(pCtx, "fts5: 2016-10-04 00:47:26 b10d0f939c82c4de3faa90b86de9ec4a89992856", -1, SQLITE_TRANSIENT);
}
static int fts5Init(sqlite3 *db){
static const sqlite3_module fts5Mod = {
/* iVersion */ 2,
/* xCreate */ fts5CreateMethod,
/* xConnect */ fts5ConnectMethod,
|
| ︙ | ︙ |
Changes to src/sqlite3.h.
| ︙ | ︙ | |||
119 120 121 122 123 124 125 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.15.0" #define SQLITE_VERSION_NUMBER 3015000 | | | 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ #define SQLITE_VERSION "3.15.0" #define SQLITE_VERSION_NUMBER 3015000 #define SQLITE_SOURCE_ID "2016-10-04 12:20:12 3a9d802fda10585654332b314d317250dc5d894e" /* ** CAPI3REF: Run-Time Library Version Numbers ** KEYWORDS: sqlite3_version, sqlite3_sourceid ** ** These interfaces provide the same information as the [SQLITE_VERSION], ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros |
| ︙ | ︙ | |||
8653 8654 8655 8656 8657 8658 8659 | const char *zTab /* Table name */ ); /* ** CAPI3REF: Set a table filter on a Session Object. ** ** The second argument (xFilter) is the "filter callback". For changes to rows | | | 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 | const char *zTab /* Table name */ ); /* ** CAPI3REF: Set a table filter on a Session Object. ** ** The second argument (xFilter) is the "filter callback". For changes to rows ** in tables that are not attached to the Session object, the filter is called ** to determine whether changes to the table's rows should be tracked or not. ** If xFilter returns 0, changes is not tracked. Note that once a table is ** attached, xFilter will not be called again. */ void sqlite3session_table_filter( sqlite3_session *pSession, /* Session object */ int(*xFilter)( |
| ︙ | ︙ | |||
8919 8920 8921 8922 8923 8924 8925 | ** destroyed. ** ** Assuming the changeset blob was created by one of the ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or ** [sqlite3changeset_invert()] functions, all changes within the changeset ** that apply to a single table are grouped together. This means that when ** an application iterates through a changeset using an iterator created by | | | 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 | ** destroyed. ** ** Assuming the changeset blob was created by one of the ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or ** [sqlite3changeset_invert()] functions, all changes within the changeset ** that apply to a single table are grouped together. This means that when ** an application iterates through a changeset using an iterator created by ** this function, all changes that relate to a single table are visited ** consecutively. There is no chance that the iterator will visit a change ** the applies to table X, then one for table Y, and then later on visit ** another change for table X. */ int sqlite3changeset_start( sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */ int nChangeset, /* Size of changeset blob in bytes */ |
| ︙ | ︙ | |||
9006 9007 9008 9009 9010 9011 9012 | ** This function is used to find which columns comprise the PRIMARY KEY of ** the table modified by the change that iterator pIter currently points to. ** If successful, *pabPK is set to point to an array of nCol entries, where ** nCol is the number of columns in the table. Elements of *pabPK are set to ** 0x01 if the corresponding column is part of the tables primary key, or ** 0x00 if it is not. ** | | | 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 | ** This function is used to find which columns comprise the PRIMARY KEY of ** the table modified by the change that iterator pIter currently points to. ** If successful, *pabPK is set to point to an array of nCol entries, where ** nCol is the number of columns in the table. Elements of *pabPK are set to ** 0x01 if the corresponding column is part of the tables primary key, or ** 0x00 if it is not. ** ** If argument pnCol is not NULL, then *pnCol is set to the number of columns ** in the table. ** ** If this function is called when the iterator does not point to a valid ** entry, SQLITE_MISUSE is returned and the output variables zeroed. Otherwise, ** SQLITE_OK is returned and the output variables populated as described ** above. */ |
| ︙ | ︙ | |||
9281 9282 9283 9284 9285 9286 9287 | ** to the changegroup. ** ** Rows within the changeset and changegroup are identified by the values in ** their PRIMARY KEY columns. A change in the changeset is considered to ** apply to the same row as a change already present in the changegroup if ** the two rows have the same primary key. ** | | | 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 | ** to the changegroup. ** ** Rows within the changeset and changegroup are identified by the values in ** their PRIMARY KEY columns. A change in the changeset is considered to ** apply to the same row as a change already present in the changegroup if ** the two rows have the same primary key. ** ** Changes to rows that do not already appear in the changegroup are ** simply copied into it. Or, if both the new changeset and the changegroup ** contain changes that apply to a single row, the final contents of the ** changegroup depends on the type of each change, as follows: ** ** <table border=1 style="margin-left:8ex;margin-right:8ex"> ** <tr><th style="white-space:pre">Existing Change </th> ** <th style="white-space:pre">New Change </th> |
| ︙ | ︙ |
Changes to src/stat.c.
| ︙ | ︙ | |||
420 421 422 423 424 425 426 |
style_header("Repository Table Sizes");
style_adunit_config(ADUNIT_RIGHT_OK);
style_submenu_element("Stat", "Repository Stats", "stat");
if( g.perm.Admin ){
style_submenu_element("Schema", "Repository Schema", "repo_schema");
}
db_multi_exec(
| < | | < < | | | 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 |
style_header("Repository Table Sizes");
style_adunit_config(ADUNIT_RIGHT_OK);
style_submenu_element("Stat", "Repository Stats", "stat");
if( g.perm.Admin ){
style_submenu_element("Schema", "Repository Schema", "repo_schema");
}
db_multi_exec(
"CREATE TEMP TABLE trans(name TEXT PRIMARY KEY,tabname TEXT)WITHOUT ROWID;"
"INSERT INTO trans(name,tabname)"
" SELECT name, tbl_name FROM repository.sqlite_master;"
"CREATE TEMP TABLE piechart(amt REAL, label TEXT);"
"INSERT INTO piechart(amt,label)"
" SELECT count(*), "
" coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)"
" FROM dbstat('repository')"
" GROUP BY 2 ORDER BY 2;"
);
nPageFree = db_int(0, "PRAGMA repository.freelist_count");
if( nPageFree>0 ){
db_multi_exec(
"INSERT INTO piechart(amt,label) VALUES(%d,'freelist')",
nPageFree
);
}
fsize = file_size(g.zRepositoryName);
approxSizeName(sizeof(zBuf), zBuf, fsize);
@ <h2>Repository Size: %s(zBuf)</h2>
@ <center><svg width='800' height='500'>
piechart_render(800,500,PIE_OTHER|PIE_PERCENT);
@ </svg></center>
if( g.localOpen ){
db_multi_exec(
"DELETE FROM trans;"
"INSERT INTO trans(name,tabname)"
" SELECT name, tbl_name FROM localdb.sqlite_master;"
"DELETE FROM piechart;"
"INSERT INTO piechart(amt,label)"
" SELECT count(*), "
" coalesce((SELECT tabname FROM trans WHERE trans.name=dbstat.name),name)"
" FROM dbstat('localdb')"
" GROUP BY 2 ORDER BY 2;"
);
nPageFree = db_int(0, "PRAGMA localdb.freelist_count");
if( nPageFree>0 ){
db_multi_exec(
"INSERT INTO piechart(amt,label) VALUES(%d,'freelist')",
nPageFree
|
| ︙ | ︙ |
Changes to src/tag.c.
| ︙ | ︙ | |||
357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
fossil_print("%s", blob_str(&ctrl));
blob_reset(&ctrl);
}else{
nrid = content_put(&ctrl);
manifest_crosslink(nrid, &ctrl, MC_PERMIT_HOOKS);
}
assert( blob_is_reset(&ctrl) );
}
/*
** COMMAND: tag
**
** Usage: %fossil tag SUBCOMMAND ...
**
| > | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
fossil_print("%s", blob_str(&ctrl));
blob_reset(&ctrl);
}else{
nrid = content_put(&ctrl);
manifest_crosslink(nrid, &ctrl, MC_PERMIT_HOOKS);
}
assert( blob_is_reset(&ctrl) );
manifest_to_disk(rid);
}
/*
** COMMAND: tag
**
** Usage: %fossil tag SUBCOMMAND ...
**
|
| ︙ | ︙ |
Changes to src/tar.c.
| ︙ | ︙ | |||
473 474 475 476 477 478 479 |
Glob *pExclude /* Exclude files matching this pattern */
){
Blob mfile, hash, file;
Manifest *pManifest;
ManifestFile *pFile;
Blob filename;
int nPrefix;
| | > > > > | | > > > > | > > > > > > > > | > > | | > > | > > | | > > > | | | | | | > > > > > > > > > > > | 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 |
Glob *pExclude /* Exclude files matching this pattern */
){
Blob mfile, hash, file;
Manifest *pManifest;
ManifestFile *pFile;
Blob filename;
int nPrefix;
char *zName = 0;
unsigned int mTime;
content_get(rid, &mfile);
if( blob_size(&mfile)==0 ){
blob_zero(pTar);
return;
}
blob_zero(&hash);
blob_zero(&filename);
if( zDir && zDir[0] ){
blob_appendf(&filename, "%s/", zDir);
}
nPrefix = blob_size(&filename);
pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
if( pManifest ){
int flg, eflg = 0;
mTime = (pManifest->rDate - 2440587.5)*86400.0;
tar_begin(mTime);
flg = db_get_manifest_setting();
if( flg ){
/* eflg is the effective flags, taking include/exclude into account */
if( (pInclude==0 || glob_match(pInclude, "manifest"))
&& !glob_match(pExclude, "manifest")
&& (flg & MFESTFLG_RAW) ){
eflg |= MFESTFLG_RAW;
}
if( (pInclude==0 || glob_match(pInclude, "manifest.uuid"))
&& !glob_match(pExclude, "manifest.uuid")
&& (flg & MFESTFLG_UUID) ){
eflg |= MFESTFLG_UUID;
}
if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
&& !glob_match(pExclude, "manifest.tags")
&& (flg & MFESTFLG_TAGS) ){
eflg |= MFESTFLG_TAGS;
}
if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
if( eflg & MFESTFLG_RAW ){
blob_append(&filename, "manifest", -1);
zName = blob_str(&filename);
}
if( eflg & MFESTFLG_UUID ){
sha1sum_blob(&mfile, &hash);
}
if( eflg & MFESTFLG_RAW ) {
sterilize_manifest(&mfile);
tar_add_file(zName, &mfile, 0, mTime);
}
}
blob_reset(&mfile);
if( eflg & MFESTFLG_UUID ){
blob_append(&hash, "\n", 1);
blob_resize(&filename, nPrefix);
blob_append(&filename, "manifest.uuid", -1);
zName = blob_str(&filename);
tar_add_file(zName, &hash, 0, mTime);
blob_reset(&hash);
}
if( eflg & MFESTFLG_TAGS ){
Blob tagslist;
blob_zero(&tagslist);
get_checkin_taglist(rid, &tagslist);
blob_resize(&filename, nPrefix);
blob_append(&filename, "manifest.tags", -1);
zName = blob_str(&filename);
tar_add_file(zName, &tagslist, 0, mTime);
blob_reset(&tagslist);
}
}
manifest_file_rewind(pManifest);
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
int fid;
if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
if( glob_match(pExclude, pFile->zName) ) continue;
fid = uuid_to_rid(pFile->zUuid, 0);
|
| ︙ | ︙ |
Changes to src/timeline.c.
| ︙ | ︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
#include "timeline.h"
/*
** The value of one second in julianday notation
*/
#define ONE_SECOND (1.0/86400.0)
/*
** Add an appropriate tag to the output if "rid" is unpublished (private)
*/
#define UNPUB_TAG "<em>(unpublished)</em>"
void tag_private_status(int rid){
if( content_is_private(rid) ){
cgi_printf("%s", UNPUB_TAG);
| > > > > > > > > > | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
#include "timeline.h"
/*
** The value of one second in julianday notation
*/
#define ONE_SECOND (1.0/86400.0)
/*
** timeline mode options
*/
#define TIMELINE_MODE_NONE 0
#define TIMELINE_MODE_BEFORE 1
#define TIMELINE_MODE_AFTER 2
#define TIMELINE_MODE_CHILDREN 3
#define TIMELINE_MODE_PARENTS 4
/*
** Add an appropriate tag to the output if "rid" is unpublished (private)
*/
#define UNPUB_TAG "<em>(unpublished)</em>"
void tag_private_status(int rid){
if( content_is_private(rid) ){
cgi_printf("%s", UNPUB_TAG);
|
| ︙ | ︙ | |||
2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 |
static int isIsoDate(const char *z){
return strlen(z)==10
&& z[4]=='-'
&& z[7]=='-'
&& fossil_isdigit(z[0])
&& fossil_isdigit(z[5]);
}
/*
** COMMAND: timeline
**
** Usage: %fossil timeline ?WHEN? ?CHECKIN|DATETIME? ?OPTIONS?
**
** Print a summary of activity going backwards in date and time
| > > > > > > > | 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 |
static int isIsoDate(const char *z){
return strlen(z)==10
&& z[4]=='-'
&& z[7]=='-'
&& fossil_isdigit(z[0])
&& fossil_isdigit(z[5]);
}
/*
** Return true if the input string can be converted to a julianday.
*/
static int fossil_is_julianday(const char *zDate){
return db_int(0, "SELECT EXISTS (SELECT julianday(%Q) AS jd WHERE jd IS NOT NULL)", zDate);
}
/*
** COMMAND: timeline
**
** Usage: %fossil timeline ?WHEN? ?CHECKIN|DATETIME? ?OPTIONS?
**
** Print a summary of activity going backwards in date and time
|
| ︙ | ︙ | |||
2085 2086 2087 2088 2089 2090 2091 | const char *zOffset; const char *zType; char *zOrigin; char *zDate; Blob sql; int objid = 0; Blob uuid; | | | 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 |
const char *zOffset;
const char *zType;
char *zOrigin;
char *zDate;
Blob sql;
int objid = 0;
Blob uuid;
int mode = TIMELINE_MODE_NONE;
int verboseFlag = 0 ;
int iOffset;
const char *zFilePattern = 0;
Blob treeName;
verboseFlag = find_option("verbose","v", 0)!=0;
if( !verboseFlag){
|
| ︙ | ︙ | |||
2126 2127 2128 2129 2130 2131 2132 |
/* We should be done with options.. */
verify_all_options();
if( g.argc>=4 ){
k = strlen(g.argv[2]);
if( strncmp(g.argv[2],"before",k)==0 ){
| | | | | | | | | | | > > | | | | | | 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 |
/* We should be done with options.. */
verify_all_options();
if( g.argc>=4 ){
k = strlen(g.argv[2]);
if( strncmp(g.argv[2],"before",k)==0 ){
mode = TIMELINE_MODE_BEFORE;
}else if( strncmp(g.argv[2],"after",k)==0 && k>1 ){
mode = TIMELINE_MODE_AFTER;
}else if( strncmp(g.argv[2],"descendants",k)==0 ){
mode = TIMELINE_MODE_CHILDREN;
}else if( strncmp(g.argv[2],"children",k)==0 ){
mode = TIMELINE_MODE_CHILDREN;
}else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){
mode = TIMELINE_MODE_PARENTS;
}else if( strncmp(g.argv[2],"parents",k)==0 ){
mode = TIMELINE_MODE_PARENTS;
}else if(!zType && !zLimit){
usage("?WHEN? ?CHECKIN|DATETIME? ?-n|--limit #? ?-t|--type TYPE? "
"?-W|--width WIDTH? ?-p|--path PATH");
}
if( '-' != *g.argv[3] ){
zOrigin = g.argv[3];
}else{
zOrigin = "now";
}
}else if( g.argc==3 ){
zOrigin = g.argv[2];
}else{
zOrigin = "now";
}
k = strlen(zOrigin);
blob_zero(&uuid);
blob_append(&uuid, zOrigin, -1);
if( fossil_strcmp(zOrigin, "now")==0 ){
if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
fossil_fatal("cannot compute descendants or ancestors of a date");
}
zDate = mprintf("(SELECT datetime('now'))");
}else if( strncmp(zOrigin, "current", k)==0 ){
if( !g.localOpen ){
fossil_fatal("must be within a local checkout to use 'current'");
}
objid = db_lget_int("checkout",0);
zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid);
}else if( name_to_uuid(&uuid, 0, "*")==0 ){
objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid);
zDate = mprintf("(SELECT mtime FROM event WHERE objid=%d)", objid);
}else if( fossil_is_julianday(zOrigin) ){
const char *zShift = "";
if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
fossil_fatal("cannot compute descendants or ancestors of a date");
}
if( mode==TIMELINE_MODE_NONE ){
if( isIsoDate(zOrigin) ) zShift = ",'+1 day'";
}
zDate = mprintf("(SELECT julianday(%Q%s, fromLocal()))", zOrigin, zShift);
}else{
fossil_fatal("unknown check-in or invalid date: %s", zOrigin);
}
if( zFilePattern ){
if( zType==0 ){
/* When zFilePattern is specified and type is not specified, only show
* file check-ins */
zType="ci";
}
file_tree_name(zFilePattern, &treeName, 0, 1);
if( fossil_strcmp(blob_str(&treeName), ".")==0 ){
/* When zTreeName refers to g.zLocalRoot, it's like not specifying
* zFilePattern. */
zFilePattern = 0;
}
}
if( mode==TIMELINE_MODE_NONE ) mode = TIMELINE_MODE_BEFORE;
blob_zero(&sql);
blob_append(&sql, timeline_query_for_tty(), -1);
blob_append_sql(&sql, "\n AND event.mtime %s %s",
( mode==TIMELINE_MODE_BEFORE ||
mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
);
if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
if( mode==TIMELINE_MODE_CHILDREN ){
compute_descendants(objid, n);
}else{
compute_ancestors(objid, n, 0);
}
blob_append_sql(&sql, "\n AND blob.rid IN ok");
}
if( zType && (zType[0]!='a') ){
|
| ︙ | ︙ |
Changes to src/undo.c.
| ︙ | ︙ | |||
475 476 477 478 479 480 481 482 |
undo_available = db_lget_int("undo_available", 0);
if( dryRunFlag ){
if( undo_available==0 ){
fossil_print("No undo or redo is available\n");
}else{
Stmt q;
int nChng = 0;
zCmd = undo_available==1 ? "undo" : "redo";
| > | | | 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 |
undo_available = db_lget_int("undo_available", 0);
if( dryRunFlag ){
if( undo_available==0 ){
fossil_print("No undo or redo is available\n");
}else{
Stmt q;
int nChng = 0;
const char *zArticle = undo_available==1 ? "An" : "A";
zCmd = undo_available==1 ? "undo" : "redo";
fossil_print("%s %s is available for the following command:\n\n"
" %s %s\n\n",
zArticle, zCmd, g.argv[0], db_lget("undo_cmdline", "???"));
db_prepare(&q,
"SELECT existsflag, pathname FROM undo ORDER BY pathname"
);
while( db_step(&q)==SQLITE_ROW ){
if( nChng==0 ){
fossil_print("The following file changes would occur if the "
"command above is %sne:\n\n", zCmd);
|
| ︙ | ︙ |
Changes to src/vfile.c.
| ︙ | ︙ | |||
262 263 264 265 266 267 268 |
file_set_mtime(zName, desiredMtime);
currentMtime = file_wd_mtime(zName);
}
}
}
#ifndef _WIN32
if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){
| | | | | | | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
file_set_mtime(zName, desiredMtime);
currentMtime = file_wd_mtime(zName);
}
}
}
#ifndef _WIN32
if( chnged==0 || chnged==6 || chnged==7 || chnged==8 || chnged==9 ){
if( origPerm==currentPerm ){
chnged = 0;
}else if( currentPerm==PERM_EXE ){
chnged = 6;
}else if( currentPerm==PERM_LNK ){
chnged = 7;
}else if( origPerm==PERM_EXE ){
chnged = 8;
}else if( origPerm==PERM_LNK ){
chnged = 9;
}
}
#endif
if( currentMtime!=oldMtime || chnged!=oldChnged ){
db_multi_exec("UPDATE vfile SET mtime=%lld, chnged=%d WHERE id=%d",
currentMtime, chnged, id);
|
| ︙ | ︙ | |||
346 347 348 349 350 351 352 |
promptFlag = 0;
} else if( cReply!='y' && cReply!='Y' ){
blob_reset(&content);
continue;
}
}
if( verbose ) fossil_print("%s\n", &zName[nRepos]);
| | | 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
promptFlag = 0;
} else if( cReply!='y' && cReply!='Y' ){
blob_reset(&content);
continue;
}
}
if( verbose ) fossil_print("%s\n", &zName[nRepos]);
if( file_wd_isdir(zName)==1 ){
/*TODO(dchest): remove directories? */
fossil_fatal("%s is directory, cannot overwrite\n", zName);
}
if( file_wd_size(zName)>=0 && (isLink || file_wd_islink(0)) ){
file_delete(zName);
}
if( isLink ){
|
| ︙ | ︙ |
Changes to src/zip.c.
| ︙ | ︙ | |||
348 349 350 351 352 353 354 |
if( zDir && zDir[0] ){
blob_appendf(&filename, "%s/", zDir);
}
nPrefix = blob_size(&filename);
pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
if( pManifest ){
| > | > > > | | > > > > | > > > > > > > > | > > | | | > > | > > | | > > > | | | | > | | > > > > > > > > > > > > | 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
if( zDir && zDir[0] ){
blob_appendf(&filename, "%s/", zDir);
}
nPrefix = blob_size(&filename);
pManifest = manifest_get(rid, CFTYPE_MANIFEST, 0);
if( pManifest ){
int flg, eflg = 0;
char *zName = 0;
zip_set_timedate(pManifest->rDate);
flg = db_get_manifest_setting();
if( flg ){
/* eflg is the effective flags, taking include/exclude into account */
if( (pInclude==0 || glob_match(pInclude, "manifest"))
&& !glob_match(pExclude, "manifest")
&& (flg & MFESTFLG_RAW) ){
eflg |= MFESTFLG_RAW;
}
if( (pInclude==0 || glob_match(pInclude, "manifest.uuid"))
&& !glob_match(pExclude, "manifest.uuid")
&& (flg & MFESTFLG_UUID) ){
eflg |= MFESTFLG_UUID;
}
if( (pInclude==0 || glob_match(pInclude, "manifest.tags"))
&& !glob_match(pExclude, "manifest.tags")
&& (flg & MFESTFLG_TAGS) ){
eflg |= MFESTFLG_TAGS;
}
if( eflg & (MFESTFLG_RAW|MFESTFLG_UUID) ){
if( eflg & MFESTFLG_RAW ){
blob_append(&filename, "manifest", -1);
zName = blob_str(&filename);
zip_add_folders(zName);
}
if( eflg & MFESTFLG_UUID ){
sha1sum_blob(&mfile, &hash);
}
if( eflg & MFESTFLG_RAW ){
sterilize_manifest(&mfile);
zip_add_file(zName, &mfile, 0);
}
}
blob_reset(&mfile);
if( eflg & MFESTFLG_UUID ){
blob_append(&hash, "\n", 1);
blob_resize(&filename, nPrefix);
blob_append(&filename, "manifest.uuid", -1);
zName = blob_str(&filename);
zip_add_folders(zName);
zip_add_file(zName, &hash, 0);
blob_reset(&hash);
}
if( eflg & MFESTFLG_TAGS ){
Blob tagslist;
blob_zero(&tagslist);
get_checkin_taglist(rid, &tagslist);
blob_resize(&filename, nPrefix);
blob_append(&filename, "manifest.tags", -1);
zName = blob_str(&filename);
zip_add_folders(zName);
zip_add_file(zName, &tagslist, 0);
blob_reset(&tagslist);
}
}
manifest_file_rewind(pManifest);
while( (pFile = manifest_file_next(pManifest,0))!=0 ){
int fid;
if( pInclude!=0 && !glob_match(pInclude, pFile->zName) ) continue;
if( glob_match(pExclude, pFile->zName) ) continue;
fid = uuid_to_rid(pFile->zUuid, 0);
|
| ︙ | ︙ |
Changes to test/amend.test.
| ︙ | ︙ | |||
257 258 259 260 261 262 263 |
test amend-close-1.1.a {[string match "*uuid:*$UUIDC*" $RESULT]}
test amend-close-1.1.b {
[string match "*comment:*Create*new*branch*named*\"cllf\"*" $RESULT]
}
fossil tag ls --raw $UUIDC
test amend-close-1.2 {[string first "closed" $RESULT] != -1}
fossil timeline -n 1
| | | 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
test amend-close-1.1.a {[string match "*uuid:*$UUIDC*" $RESULT]}
test amend-close-1.1.b {
[string match "*comment:*Create*new*branch*named*\"cllf\"*" $RESULT]
}
fossil tag ls --raw $UUIDC
test amend-close-1.2 {[string first "closed" $RESULT] != -1}
fossil timeline -n 1
test amend-close-1.3 {[string match {*Mark*"Closed".*} $RESULT]}
write_file datafile "cllf"
fossil commit -m "should fail" -expectError
test amend-close-2 {[string first "closed leaf" $RESULT] != -1}
set UUID3 UUID3
fossil revert
fossil update trunk
|
| ︙ | ︙ |
Added test/commit-warning.test.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
#
# Copyright (c) 2016 D. Richard Hipp
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Simplified BSD License (also
# known as the "2-Clause License" or "FreeBSD License".)
#
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose.
#
# Author contact information:
# drh@hwaci.com
# http://www.hwaci.com/drh/
#
############################################################################
#
# The focus of this file is to test pre-commit warnings.
#
test_setup ""
###############################################################################
run_in_checkout {
fossil test-commit-warning
}
test pre-commit-warnings-1 {[normalize_result] eq \
[subst -nocommands -novariables [string trim {
1\tart/branching.odp\tbinary data
1\tart/concept1.dia\tbinary data
1\tart/concept2.dia\tbinary data
1\tcompat/zlib/ChangeLog\tinvalid UTF-8
1\tcompat/zlib/contrib/README.contrib\tinvalid UTF-8
1\tcompat/zlib/contrib/blast/test.pk\tbinary data
1\tcompat/zlib/contrib/dotzlib/DotZLib.build\tCR/NL line endings
1\tcompat/zlib/contrib/dotzlib/DotZLib.chm\tbinary data
1\tcompat/zlib/contrib/dotzlib/DotZLib.sln\tCR/NL line endings
1\tcompat/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs\tCR/NL line endings
1\tcompat/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj\tCR/NL line endings
1\tcompat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs\tCR/NL line endings
1\tcompat/zlib/contrib/dotzlib/LICENSE_1_0.txt\tCR/NL line endings
1\tcompat/zlib/contrib/dotzlib/readme.txt\tCR/NL line endings
1\tcompat/zlib/contrib/gcc_gvmat64/gvmat64.S\tCR/NL line endings
1\tcompat/zlib/contrib/masmx64/bld_ml64.bat\tCR/NL line endings
1\tcompat/zlib/contrib/masmx64/gvmat64.asm\tCR/NL line endings
1\tcompat/zlib/contrib/masmx64/inffas8664.c\tCR/NL line endings
1\tcompat/zlib/contrib/masmx64/inffasx64.asm\tCR/NL line endings
1\tcompat/zlib/contrib/masmx64/readme.txt\tCR/NL line endings
1\tcompat/zlib/contrib/masmx86/bld_ml32.bat\tCR/NL line endings
1\tcompat/zlib/contrib/masmx86/inffas32.asm\tCR/NL line endings
1\tcompat/zlib/contrib/masmx86/match686.asm\tCR/NL line endings
1\tcompat/zlib/contrib/masmx86/readme.txt\tCR/NL line endings
1\tcompat/zlib/contrib/puff/zeros.raw\tbinary data
1\tcompat/zlib/contrib/testzlib/testzlib.c\tCR/NL line endings
1\tcompat/zlib/contrib/testzlib/testzlib.txt\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/readme.txt\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/miniunz.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/miniunz.vcxproj.user\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/minizip.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/minizip.vcxproj.user\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/testzlib.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/testzlib.vcxproj.user\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.user\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/zlib.rc\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/zlibstat.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.user\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/zlibvc.def\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/zlibvc.sln\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/zlibvc.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.user\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc11/miniunz.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc11/minizip.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc11/testzlib.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc11/testzlibdll.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc11/zlib.rc\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc11/zlibstat.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc11/zlibvc.def\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc11/zlibvc.sln\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc11/zlibvc.vcxproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc9/miniunz.vcproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc9/minizip.vcproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc9/testzlib.vcproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc9/testzlibdll.vcproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc9/zlib.rc\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc9/zlibstat.vcproj\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc9/zlibvc.def\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc9/zlibvc.sln\tCR/NL line endings
1\tcompat/zlib/contrib/vstudio/vc9/zlibvc.vcproj\tCR/NL line endings
1\tcompat/zlib/zlib.3.pdf\tbinary data
1\tsetup/fossil.iss\tCR/NL line endings
1\tskins/blitz/arrow_project.png\tbinary data
1\tskins/blitz/dir.png\tbinary data
1\tskins/blitz/file.png\tbinary data
1\tskins/blitz/fossil_100.png\tbinary data
1\tskins/blitz/fossil_80_reversed_darkcyan.png\tbinary data
1\tskins/blitz/fossil_80_reversed_darkcyan_text.png\tbinary data
1\tskins/blitz/rss_20.png\tbinary data
1\ttest/th1-docs-input.txt\tCR/NL line endings
1\ttest/th1-hooks-input.txt\tCR/NL line endings
1\ttest/utf16be.txt\tUnicode
1\ttest/utf16le.txt\tUnicode
1\twin/buildmsvc.bat\tCR/NL line endings
1\twin/fossil.ico\tbinary data
1\twww/CollRev1.gif\tbinary data
1\twww/CollRev2.gif\tbinary data
1\twww/CollRev3.gif\tbinary data
1\twww/CollRev4.gif\tbinary data
1\twww/apple-touch-icon.png\tbinary data
1\twww/background.jpg\tbinary data
1\twww/branch01.gif\tbinary data
1\twww/branch02.gif\tbinary data
1\twww/branch03.gif\tbinary data
1\twww/branch04.gif\tbinary data
1\twww/branch05.gif\tbinary data
1\twww/build-icons/linux.gif\tbinary data
1\twww/build-icons/linux64.gif\tbinary data
1\twww/build-icons/mac.gif\tbinary data
1\twww/build-icons/openbsd.gif\tbinary data
1\twww/build-icons/src.gif\tbinary data
1\twww/build-icons/win32.gif\tbinary data
1\twww/concept1.gif\tbinary data
1\twww/concept2.gif\tbinary data
1\twww/copyright-release.pdf\tbinary data
1\twww/delta1.gif\tbinary data
1\twww/delta2.gif\tbinary data
1\twww/delta3.gif\tbinary data
1\twww/delta4.gif\tbinary data
1\twww/delta5.gif\tbinary data
1\twww/delta6.gif\tbinary data
1\twww/encode1.gif\tbinary data
1\twww/encode10.gif\tbinary data
1\twww/encode2.gif\tbinary data
1\twww/encode3.gif\tbinary data
1\twww/encode4.gif\tbinary data
1\twww/encode5.gif\tbinary data
1\twww/encode6.gif\tbinary data
1\twww/encode7.gif\tbinary data
1\twww/encode8.gif\tbinary data
1\twww/encode9.gif\tbinary data
1\twww/fossil.gif\tbinary data
1\twww/fossil2.gif\tbinary data
1\twww/fossil3.gif\tbinary data
1\twww/fossil_logo_small.gif\tbinary data
1\twww/fossil_logo_small2.gif\tbinary data
1\twww/fossil_logo_small3.gif\tbinary data
1\twww/xkcd-git.gif\tbinary data
1}]]}
###############################################################################
test_cleanup
|
Changes to test/merge2.test.
| ︙ | ︙ | |||
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
expr {srand($i*2+1)}
write_file t3 [set f3 [random_changes $f1 2 4 2 0.1]]
expr {srand($i*2+1)}
write_file t23 [random_changes $f2 2 4 2 0.1]
expr {srand($i*2)}
write_file t32 [random_changes $f3 2 4 0 0.1]
fossil 3-way-merge t1 t2 t3 a23
test merge-$base-$i-23 {[same_file a23 t23]}
fossil 3-way-merge t1 t3 t2 a32
test merge-$base-$i-32 {[same_file a32 t32]}
}
}
###############################################################################
| > | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
expr {srand($i*2+1)}
write_file t3 [set f3 [random_changes $f1 2 4 2 0.1]]
expr {srand($i*2+1)}
write_file t23 [random_changes $f2 2 4 2 0.1]
expr {srand($i*2)}
write_file t32 [random_changes $f3 2 4 0 0.1]
fossil 3-way-merge t1 t2 t3 a23
if {[regexp {<<<<< BEGIN MERGE CONFLICT:} [read_file a23]]} continue
test merge-$base-$i-23 {[same_file a23 t23]}
fossil 3-way-merge t1 t3 t2 a32
test merge-$base-$i-32 {[same_file a32 t32]}
}
}
###############################################################################
|
| ︙ | ︙ |
Added test/set-manifest.test.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
#
# Copyright (c) 2016 D. Richard Hipp
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Simplified BSD License (also
# known as the "2-Clause License" or "FreeBSD License".)
#
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose.
#
# Author contact information:
# drh@hwaci.com
# http://www.hwaci.com/drh/
#
############################################################################
#
# Test manifest setting
#
# We need SHA1 to effectively test the manifest files produced by
# fossil. It looks like the one from tcllib is exactly what we need.
# On ActiveTcl, add it with teacup. On other platforms, YMMV.
# teacup install sha1
package require sha1
proc file_contains {fname match} {
set fp [open $fname r]
set contents [read $fp]
close $fp
set lines [split $contents "\n"]
foreach line $lines {
if {[regexp $match $line]} {
return 1
}
}
return 0
}
# We need a respository, so let it have one.
test_setup
#### Verify classic behavior of the manifest setting
# Setting is off by default, and there are no extra files.
fossil settings manifest
test "set-manifest-1" {[regexp {^manifest *$} $RESULT]}
set filelist [glob -nocomplain manifest*]
test "set-manifest-1-n" {[llength $filelist] == 0}
# Classic behavior: TRUE value creates manifest and manifest.uuid
set truths [list true on 1]
foreach v $truths {
fossil settings manifest $v
test "set-manifest-2-$v" {$RESULT eq ""}
fossil settings manifest
test "set-manifest-2-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]}
set filelist [glob manifest*]
test "set-manifest-2-$v-n" {[llength $filelist] == 2}
foreach f $filelist {
test "set-manifest-2-$v-f-$f" {[file isfile $f]}
}
}
# ... and manifest.uuid is the checkout's hash
fossil info
regexp {(?m)^checkout:\s+([0-9a-f]{40})\s.*$} $RESULT ckoutline ckid
set uuid [string trim [read_file "manifest.uuid"]]
test "set-manifest-2-uuid" {$ckid eq $uuid}
# ... which is also the SHA1 of the file "manifest" before it was
# sterilized by appending an extra line when writing the file. The
# extra text begins with # and is a full line, so we'll just strip
# it with a brute-force substitution. This probably has the right
# effect even if the checkin was PGP-signed, but we don't have that
# setting turned on for this manifest in any case.
regsub {(?m)^#.*\n} [read_file "manifest"] "" manifest
set muuid [::sha1::sha1 $manifest]
test "set-manifest-2-manifest" {$muuid eq $uuid}
# Classic behavior: FALSE value removes manifest and manifest.uuid
set falses [list false off 0]
foreach v $falses {
fossil settings manifest $v
test "set-manifest-3-$v" {$RESULT eq ""}
fossil settings manifest
test "set-manifest-3-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]}
set filelist [glob -nocomplain manifest*]
test "set-manifest-3-$v-n" {[llength $filelist] == 0}
}
# Classic behavior: unset removes manifest and manifest.uuid
fossil unset manifest
test "set-manifest-4" {$RESULT eq ""}
fossil settings manifest
test "set-manifest-4-a" {[regexp {^manifest *$} $RESULT]}
set filelist [glob -nocomplain manifest*]
test "set-manifest-4-n" {[llength $filelist] == 0}
##### Tags Manifest feature extends the manifest setting
# Manifest Tags: use letters r, u, and t to select each of manifest,
# manifest.uuid, and manifest.tags files.
set truths [list r u t ru ut rt rut]
foreach v $truths {
fossil settings manifest $v
test "set-manifest-5-$v" {$RESULT eq ""}
fossil settings manifest
test "set-manifest-5-$v-a" {[regexp "^manifest\\s+\\(local\\)\\s+$v\\s*$" $RESULT]}
set filelist [glob manifest*]
test "set-manifest-5-$v-n" {[llength $filelist] == [string length $v]}
foreach f $filelist {
test "set-manifest-5-$v-f-$f" {[file isfile $f]}
}
}
# Quick check for tags applied in trunk
test_file_contents "set-manifest-6" "manifest.tags" "branch trunk\ntag trunk\n"
##### Test manifest.tags file content updates after commits
# Explicitly set manifest.tags mode
fossil set manifest t
test "set-manifest-7-1" {[file isfile manifest.tags]}
# Add a tag and make sure it appears in manifest.tags
fossil tag add manifest-7-tag-1 tip
test "set-manifest-7-2" {[file_contains "manifest.tags" "^tag manifest-7-tag-1$"]}
# Add a file and make sure tag has disappeared from manifest.tags
write_file file1 "file1 contents"
fossil add file1
fossil commit -m "Added file1."
test "set-manifest-7-3" {![file_contains "manifest.tags" "^tag manifest-7-tag-1$"]}
# Add new tag and check that it is in manifest.tags
fossil tag add manifest-7-tag-2 tip
test "set-manifest-7-4" {[file_contains "manifest.tags" "^tag manifest-7-tag-2$"]}
##### Tags manifest branch= updates
# Add file, create new branch on commit and check that
# manifest.tags has been updated appropriately
write_file file3 "file3 contents"
fossil add file3
fossil commit -m "Added file3." --branch manifest-8-branch
test "set-manifest-8" {[file_contains "manifest.tags" "^branch manifest-8-branch$"]}
test_cleanup
|
Added test/symlinks.test.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
#
# Copyright (c) 2016 D. Richard Hipp
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Simplified BSD License (also
# known as the "2-Clause License" or "FreeBSD License".)
#
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose.
#
# Author contact information:
# drh@hwaci.com
# http://www.hwaci.com/drh/
#
############################################################################
#
# Symbolic link tests.
#
if {$tcl_platform(platform) eq "windows"} {
puts "Symlinks are not supported on Windows."
test_cleanup_then_return
}
fossil test-th-eval --open-config "setting allow-symlinks"
if {![string is true -strict [normalize_result]]} {
puts "Symlinks are not enabled."
test_cleanup_then_return
}
require_no_open_checkout
###############################################################################
test_setup; set rootDir [file normalize [pwd]]
fossil test-th-eval --open-config {repository}
set repository [normalize_result]
if {[string length $repository] == 0} {
puts "Detection of the open repository file failed."
test_cleanup_then_return
}
#######################################
# Use symbolic link to a directory... #
#######################################
file mkdir [file join $rootDir subdirA]
exec ln -s [file join $rootDir subdirA] symdirA
###############################################################################
write_file [file join $rootDir subdirA f1.txt] "f1"
write_file [file join $rootDir subdirA f2.txt] "f2"
test symlinks-dir-1 {[file exists [file join $rootDir subdirA f1.txt]] eq 1}
test symlinks-dir-2 {[file exists [file join $rootDir symdirA f1.txt]] eq 1}
test symlinks-dir-3 {[file exists [file join $rootDir subdirA f2.txt]] eq 1}
test symlinks-dir-4 {[file exists [file join $rootDir symdirA f2.txt]] eq 1}
fossil add [file join $rootDir symdirA f1.txt]
fossil commit -m "c1"
###############################################################################
fossil ls
test symlinks-dir-5 {[normalize_result] eq "symdirA/f1.txt"}
###############################################################################
fossil extras
test symlinks-dir-6 {[normalize_result] eq \
"subdirA/f1.txt\nsubdirA/f2.txt\nsymdirA/f2.txt"}
###############################################################################
fossil close
file delete [file join $rootDir subdirA f1.txt]
test symlinks-dir-7 {[file exists [file join $rootDir subdirA f1.txt]] eq 0}
test symlinks-dir-8 {[file exists [file join $rootDir symdirA f1.txt]] eq 0}
test symlinks-dir-9 {[file exists [file join $rootDir subdirA f2.txt]] eq 1}
test symlinks-dir-10 {[file exists [file join $rootDir symdirA f2.txt]] eq 1}
###############################################################################
fossil open $repository
set code [catch {file readlink [file join $rootDir symdirA]} result]
test symlinks-dir-11 {$code == 0}
test symlinks-dir-12 {$result eq [file join $rootDir subdirA]}
test symlinks-dir-13 {[file exists [file join $rootDir subdirA f1.txt]] eq 1}
test symlinks-dir-14 {[file exists [file join $rootDir symdirA f1.txt]] eq 1}
test symlinks-dir-15 {[file exists [file join $rootDir subdirA f2.txt]] eq 1}
test symlinks-dir-16 {[file exists [file join $rootDir symdirA f2.txt]] eq 1}
###############################################################################
#
# TODO: Add tests for symbolic links as files here, including tests with the
# "allow-symlinks" setting on and off.
#
###############################################################################
test_cleanup
|
Changes to test/tester.tcl.
| ︙ | ︙ | |||
268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
repo-cksum \
self-register \
ssh-command \
ssl-ca-location \
ssl-identity \
th1-setup \
th1-uri-regexp \
web-browser]
fossil test-th-eval "hasfeature legacyMvRm"
if {$::RESULT eq "1"} {
lappend result mv-rm-files
}
| > | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
repo-cksum \
self-register \
ssh-command \
ssl-ca-location \
ssl-identity \
th1-setup \
th1-uri-regexp \
uv-sync \
web-browser]
fossil test-th-eval "hasfeature legacyMvRm"
if {$::RESULT eq "1"} {
lappend result mv-rm-files
}
|
| ︙ | ︙ |
Changes to win/Makefile.PellesCGMake.
| ︙ | ︙ | |||
81 82 83 84 85 86 87 | UTILS_OBJ=$(UTILS:.exe=.obj) UTILS_SRC=$(foreach uf,$(UTILS),$(SRCDIR)$(uf:.exe=.c)) # define the SQLite files, which need special flags on compile SQLITESRC=sqlite3.c ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf)) SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj)) | | | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | UTILS_OBJ=$(UTILS:.exe=.obj) UTILS_SRC=$(foreach uf,$(UTILS),$(SRCDIR)$(uf:.exe=.c)) # define the SQLite files, which need special flags on compile SQLITESRC=sqlite3.c ORIGSQLITESRC=$(foreach sf,$(SQLITESRC),$(SRCDIR)$(sf)) SQLITEOBJ=$(foreach sf,$(SQLITESRC),$(sf:.c=.obj)) 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 # define the SQLite shell files, which need special flags on compile SQLITESHELLSRC=shell.c ORIGSQLITESHELLSRC=$(foreach sf,$(SQLITESHELLSRC),$(SRCDIR)$(sf)) SQLITESHELLOBJ=$(foreach sf,$(SQLITESHELLSRC),$(sf:.c=.obj)) SQLITESHELLDEFINES=-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 |
| ︙ | ︙ |
Changes to win/Makefile.dmc.
| ︙ | ︙ | |||
22 23 24 25 26 27 28 | SSL = CFLAGS = -o BCC = $(DMDIR)\bin\dmc $(CFLAGS) TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL) LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | SSL = CFLAGS = -o BCC = $(DMDIR)\bin\dmc $(CFLAGS) TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL) LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 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 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 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 OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O |
| ︙ | ︙ |
Changes to win/Makefile.mingw.
| ︙ | ︙ | |||
168 169 170 171 172 173 174 | endif #### The directories where the OpenSSL include and library files are located. # The recommended usage here is to use the Sysinternals junction tool # to create a hard link between an "openssl-1.x" sub-directory of the # Fossil source code directory and the target OpenSSL source directory. # | | | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | endif #### The directories where the OpenSSL include and library files are located. # The recommended usage here is to use the Sysinternals junction tool # to create a hard link between an "openssl-1.x" sub-directory of the # Fossil source code directory and the target OpenSSL source directory. # OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.0.2j OPENSSLINCDIR = $(OPENSSLDIR)/include OPENSSLLIBDIR = $(OPENSSLDIR) #### Either the directory where the Tcl library is installed or the Tcl # source code directory resides (depending on the value of the macro # FOSSIL_TCL_SOURCE). If this points to the Tcl install directory, # this directory must have "include" and "lib" sub-directories. If |
| ︙ | ︙ | |||
2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 |
-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 \
| > > | 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 |
-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 \
|
| ︙ | ︙ |
Changes to win/Makefile.mingw.mistachkin.
| ︙ | ︙ | |||
168 169 170 171 172 173 174 | endif #### The directories where the OpenSSL include and library files are located. # The recommended usage here is to use the Sysinternals junction tool # to create a hard link between an "openssl-1.x" sub-directory of the # Fossil source code directory and the target OpenSSL source directory. # | | | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | endif #### The directories where the OpenSSL include and library files are located. # The recommended usage here is to use the Sysinternals junction tool # to create a hard link between an "openssl-1.x" sub-directory of the # Fossil source code directory and the target OpenSSL source directory. # OPENSSLDIR = $(SRCDIR)/../compat/openssl-1.0.2j OPENSSLINCDIR = $(OPENSSLDIR)/include OPENSSLLIBDIR = $(OPENSSLDIR) #### Either the directory where the Tcl library is installed or the Tcl # source code directory resides (depending on the value of the macro # FOSSIL_TCL_SOURCE). If this points to the Tcl install directory, # this directory must have "include" and "lib" sub-directories. If |
| ︙ | ︙ | |||
2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 |
-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 \
| > > | 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 |
-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 \
|
| ︙ | ︙ |
Changes to win/Makefile.msc.
| ︙ | ︙ | |||
96 97 98 99 100 101 102 | # Enable support for the SQLite Encryption Extension? !ifndef USE_SEE USE_SEE = 0 !endif !if $(FOSSIL_ENABLE_SSL)!=0 | | | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | # Enable support for the SQLite Encryption Extension? !ifndef USE_SEE USE_SEE = 0 !endif !if $(FOSSIL_ENABLE_SSL)!=0 SSLDIR = $(B)\compat\openssl-1.0.2j SSLINCDIR = $(SSLDIR)\inc32 !if $(FOSSIL_DYNAMIC_BUILD)!=0 SSLLIBDIR = $(SSLDIR)\out32dll !else SSLLIBDIR = $(SSLDIR)\out32 !endif SSLLFLAGS = /nologo /opt:ref /debug |
| ︙ | ︙ | |||
319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
/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 \
| > > | 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
/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 \
|
| ︙ | ︙ |
Changes to www/build.wiki.
| ︙ | ︙ | |||
139 140 141 142 143 144 145 | file "<b>win\buildmsvc.bat</b>" may be used and it will attempt to detect and use the latest installed version of MSVC.<br><br>To enable the optional <a href="https://www.openssl.org/">OpenSSL</a> support, first <a href="https://www.openssl.org/source/">download the official source code for OpenSSL</a> and extract it to an appropriately named "<b>openssl-X.Y.ZA</b>" subdirectory within the local [/tree?ci=trunk&name=compat | compat] directory (e.g. | | | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | file "<b>win\buildmsvc.bat</b>" may be used and it will attempt to detect and use the latest installed version of MSVC.<br><br>To enable the optional <a href="https://www.openssl.org/">OpenSSL</a> support, first <a href="https://www.openssl.org/source/">download the official source code for OpenSSL</a> and extract it to an appropriately named "<b>openssl-X.Y.ZA</b>" subdirectory within the local [/tree?ci=trunk&name=compat | compat] directory (e.g. "<b>compat/openssl-1.0.2j</b>"), then make sure that some recent <a href="http://www.perl.org/">Perl</a> binaries are installed locally, and finally run one of the following commands: <blockquote><pre> nmake /f Makefile.msc FOSSIL_ENABLE_SSL=1 FOSSIL_BUILD_SSL=1 PERLDIR=C:\full\path\to\Perl\bin </pre></blockquote> <blockquote><pre> buildmsvc.bat FOSSIL_ENABLE_SSL=1 FOSSIL_BUILD_SSL=1 PERLDIR=C:\full\path\to\Perl\bin |
| ︙ | ︙ |
Changes to www/concepts.wiki.
| ︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | There are many such systems in use today. Fossil strives to distinguish itself from the others by being extremely simple to setup and operate. This document is intended as a quick introduction to the concepts behind Fossil. <h2>2.0 Composition Of A Project</h2> <img src="concept1.gif" align="right" hspace="10"> A software project normally consists of a "source tree". A source tree is a hierarchy of files that are used to generate the end product. The source tree changes over time as the software grows and expands and as features are added and bugs | > > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | There are many such systems in use today. Fossil strives to distinguish itself from the others by being extremely simple to setup and operate. This document is intended as a quick introduction to the concepts behind Fossil. See also: * [./whyusefossil.wiki#definitions|Definitions] * [./quickstart.wiki|Quick start guide] <h2>2.0 Composition Of A Project</h2> <img src="concept1.gif" align="right" hspace="10"> A software project normally consists of a "source tree". A source tree is a hierarchy of files that are used to generate the end product. The source tree changes over time as the software grows and expands and as features are added and bugs |
| ︙ | ︙ |
Changes to www/fileformat.wiki.
| ︙ | ︙ | |||
164 165 166 167 168 169 170 | A manifest has zero or one N-cards. The N-card specifies the mimetype for the text in the comment of the C-card. If the N-card is omitted, a default mimetype is used. A manifest has zero or one P-cards. Most manifests have one P-card. The P-card has a varying number of arguments that | | | | | | | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | A manifest has zero or one N-cards. The N-card specifies the mimetype for the text in the comment of the C-card. If the N-card is omitted, a default mimetype is used. A manifest has zero or one P-cards. Most manifests have one P-card. The P-card has a varying number of arguments that define other manifests from which the current manifest is derived. Each argument is a 40-character lowercase hexadecimal SHA1 of a predecessor manifest. All arguments to the P-card must be unique within that card. The first argument is the SHA1 of the direct ancestor of the manifest. Other arguments define manifests with which the first was merged to yield the current manifest. Most manifests have a P-card with a single argument. The first manifest in the project has no ancestors and thus has no P-card or (depending on the Fossil version) an empty P-card (no arguments). A manifest has zero or more Q-cards. A Q-card is similar to a P-card |
| ︙ | ︙ | |||
197 198 199 200 201 202 203 | The Q-card was added to the interface specification on 2011-02-26. Older versions of Fossil will reject manifests that contain Q-cards. A manifest may optionally have a single R-card. The R-card has a single argument which is the MD5 checksum of all files in the check-in except the manifest itself. The checksum is expressed | | | 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | The Q-card was added to the interface specification on 2011-02-26. Older versions of Fossil will reject manifests that contain Q-cards. A manifest may optionally have a single R-card. The R-card has a single argument which is the MD5 checksum of all files in the check-in except the manifest itself. The checksum is expressed as 32 characters of lowercase hexadecimal. The checksum is computed as follows: For each file in the check-in (except for the manifest itself) in strict sorted lexicographical order, take the pathname of the file relative to the root of the repository, append a single space (ASCII 0x20), the size of the file in ASCII decimal, a single newline character (ASCII 0x0A), and the complete text of the file. Compute the MD5 checksum of the result. |
| ︙ | ︙ | |||
244 245 246 247 248 249 250 | A cluster is an artifact that declares the existence of other artifacts. Clusters are used during repository synchronization to help reduce network traffic. As such, clusters are an optimization and may be removed from a repository without loss or damage to the underlying project code. Clusters follow a syntax that is very similar to manifests. | | | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | A cluster is an artifact that declares the existence of other artifacts. Clusters are used during repository synchronization to help reduce network traffic. As such, clusters are an optimization and may be removed from a repository without loss or damage to the underlying project code. Clusters follow a syntax that is very similar to manifests. A cluster is a line-oriented text file. Newline characters (ASCII 0x0a) separate the artifact into cards. Each card begins with a single character "card type". Zero or more arguments may follow the card type. All arguments are separated from each other and from the card-type character by a single space character. There is no surplus white space between arguments and no leading or trailing whitespace except for the newline character that acts as the card separator. |
| ︙ | ︙ | |||
266 267 268 269 270 271 272 | <blockquote> <b>M</b> <i>artifact-id</i><br /> <b>Z</b> <i>checksum</i> </blockquote> A cluster contains one or more "M" cards followed by a single "Z" | | | | 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | <blockquote> <b>M</b> <i>artifact-id</i><br /> <b>Z</b> <i>checksum</i> </blockquote> A cluster contains one or more "M" cards followed by a single "Z" card. Each M card has a single argument which is the artifact ID of another artifact in the repository. The Z card works exactly like the Z card of a manifest. The argument to the Z card is the lower-case hexadecimal representation of the MD5 checksum of all prior cards in the cluster. The Z-card is required. An example cluster from Fossil can be seen [/artifact/d03dbdd73a2a8 | here]. |
| ︙ | ︙ |
Changes to www/server.wiki.
| ︙ | ︙ | |||
37 38 39 40 41 42 43 | Both of these commands start a Fossil server, usually on TCP port 8080, though a higher numbered port might also be used if 8080 is already occupied. You can access these using URLs of the form <b>http://localhost:8080/</b>, or if <i>REPOSITORY</i> is a directory, URLs of the form <b>http://localhost:8080/</b><i>repo</i><b>/</b> where <i>repo</i> is the base name of the repository file without the ".fossil" suffix. The difference between "ui" and "server" is that "ui" will | | | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | Both of these commands start a Fossil server, usually on TCP port 8080, though a higher numbered port might also be used if 8080 is already occupied. You can access these using URLs of the form <b>http://localhost:8080/</b>, or if <i>REPOSITORY</i> is a directory, URLs of the form <b>http://localhost:8080/</b><i>repo</i><b>/</b> where <i>repo</i> is the base name of the repository file without the ".fossil" suffix. The difference between "ui" and "server" is that "ui" will also start a web browser and point it to the URL mentioned above, and the "ui" command binds to the loopback IP address (127.0.0.1) only so that the "ui" command cannot be used to serve content to a different machine. </p> <p> If one of the commands above is run from within an open checkout, then the <i>REPOSITORY</i> argument can be omitted and the checkout is used as |
| ︙ | ︙ |
Changes to www/whyusefossil.wiki.
| ︙ | ︙ | |||
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
<ol type='i'>
<li>Everyone always has the latest code
<li>Failed disk-drives cause no loss of work
<li>Avoid wasting time doing manual file copying
<li>Avoid human errors during manual backups
</ol>
</ol>
<li><p><b>Definitions</b></p>
<ul>
<li><p><b>Project</b> →
a collection of computer files that serve some common
purpose. Often the project is a software application and the
individual files are source code together with makefiles, scripts, and
"README.txt" files. Other examples of projects include books or
| > | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
<ol type='i'>
<li>Everyone always has the latest code
<li>Failed disk-drives cause no loss of work
<li>Avoid wasting time doing manual file copying
<li>Avoid human errors during manual backups
</ol>
</ol>
<a name='definitions'></a>
<li><p><b>Definitions</b></p>
<ul>
<li><p><b>Project</b> →
a collection of computer files that serve some common
purpose. Often the project is a software application and the
individual files are source code together with makefiles, scripts, and
"README.txt" files. Other examples of projects include books or
|
| ︙ | ︙ | |||
57 58 59 60 61 62 63 |
directory hierarchy - a single folder possibly with layers
of subfolders. Fossil is not a good choice for managing a
project that has files scattered hither and yon all over
the disk. In other words, Fossil only works for projects
where the files are laid out such that they can be archived
into a ZIP file or tarball.
</ul>
| | | | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
directory hierarchy - a single folder possibly with layers
of subfolders. Fossil is not a good choice for managing a
project that has files scattered hither and yon all over
the disk. In other words, Fossil only works for projects
where the files are laid out such that they can be archived
into a ZIP file or tarball.
</ul>
<li><p><b>Repository</b> →
(also called "repo") a single file that contains
all historical versions of all files in a project. A repo is similar
to a ZIP archive in that it is a single file that stores compressed
versions of many other files. Files can be extracted from the
repo and new files can be added to the repo, just as with a ZIP
archive. But a repo has other capabilities above and beyond
what a ZIP archive can do.
<ul>
|
| ︙ | ︙ |