Fossil SCM

Merge trunk. Give "Branch Hiding" it's own section in the ci_edit page.

jan.nijtmans 2013-12-03 14:59 hidden-tag merge
Commit ec4fe5cb15943a07cc9b1f069538500cbe24458b
+11 -6
--- src/info.c
+++ src/info.c
@@ -2292,10 +2292,11 @@
22922292
);
22932293
while( db_step(&q)==SQLITE_ROW ){
22942294
int tagid = db_column_int(&q, 0);
22952295
const char *zTagName = db_column_text(&q, 1);
22962296
char zLabel[30];
2297
+ if (tagid == TAG_COMMENT) continue;
22972298
sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid);
22982299
@ <br /><label>
22992300
if( P(zLabel) ){
23002301
@ <input type="checkbox" name="c%d(tagid)" checked="checked" />
23012302
}else{
@@ -2315,24 +2316,28 @@
23152316
}
23162317
@ Cancel special tag <b>%h(zTagName)</b></label>
23172318
}
23182319
}
23192320
db_finalize(&q);
2320
- if( !fHasHidden && zBranchName ){
2321
- @ <br /><label><input type="checkbox" name="hidden"%s(zHiddenFlag) />
2322
- @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this
2323
- @ check-in and make sure it is closed</label>
2324
- }
23252321
@ </td></tr>
23262322
23272323
@ <tr><th align="right" valign="top">Branching:</th>
23282324
@ <td valign="top">
23292325
@ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) />
23302326
@ Make this check-in the start of a new branch named:</label>
23312327
@ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)"
23322328
@ onkeyup="gebi('newbr').checked=!!this.value" />
23332329
@ </td></tr>
2330
+
2331
+ if( !fHasHidden && zBranchName ){
2332
+ @ <tr><th align="right" valign="top">Branch Hiding:</th>
2333
+ @ <td valign="top">
2334
+ @ <label><input type="checkbox" name="hidden"%s(zHiddenFlag) />
2335
+ @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this
2336
+ @ check-in and make sure it is closed</label>
2337
+ @ </td></tr>
2338
+ }
23342339
23352340
if( is_a_leaf(rid)
23362341
&& !db_exists("SELECT 1 FROM tagxref "
23372342
" WHERE tagid=%d AND rid=%d AND tagtype>0",
23382343
TAG_CLOSED, rid)
@@ -2339,11 +2344,11 @@
23392344
){
23402345
@ <tr><th align="right" valign="top">Leaf Closure:</th>
23412346
@ <td valign="top">
23422347
@ <label><input type="checkbox" name="close"%s(zCloseFlag) />
23432348
@ Mark this leaf as "closed" so that it no longer appears on the
2344
- @ "leaves" page and is no longer labeled as a "<b>Leaf</b>".</label>
2349
+ @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label>
23452350
@ </td></tr>
23462351
}
23472352
23482353
23492354
@ <tr><td colspan="2">
23502355
--- src/info.c
+++ src/info.c
@@ -2292,10 +2292,11 @@
2292 );
2293 while( db_step(&q)==SQLITE_ROW ){
2294 int tagid = db_column_int(&q, 0);
2295 const char *zTagName = db_column_text(&q, 1);
2296 char zLabel[30];
 
2297 sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid);
2298 @ <br /><label>
2299 if( P(zLabel) ){
2300 @ <input type="checkbox" name="c%d(tagid)" checked="checked" />
2301 }else{
@@ -2315,24 +2316,28 @@
2315 }
2316 @ Cancel special tag <b>%h(zTagName)</b></label>
2317 }
2318 }
2319 db_finalize(&q);
2320 if( !fHasHidden && zBranchName ){
2321 @ <br /><label><input type="checkbox" name="hidden"%s(zHiddenFlag) />
2322 @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this
2323 @ check-in and make sure it is closed</label>
2324 }
2325 @ </td></tr>
2326
2327 @ <tr><th align="right" valign="top">Branching:</th>
2328 @ <td valign="top">
2329 @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) />
2330 @ Make this check-in the start of a new branch named:</label>
2331 @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)"
2332 @ onkeyup="gebi('newbr').checked=!!this.value" />
2333 @ </td></tr>
 
 
 
 
 
 
 
 
 
2334
2335 if( is_a_leaf(rid)
2336 && !db_exists("SELECT 1 FROM tagxref "
2337 " WHERE tagid=%d AND rid=%d AND tagtype>0",
2338 TAG_CLOSED, rid)
@@ -2339,11 +2344,11 @@
2339 ){
2340 @ <tr><th align="right" valign="top">Leaf Closure:</th>
2341 @ <td valign="top">
2342 @ <label><input type="checkbox" name="close"%s(zCloseFlag) />
2343 @ Mark this leaf as "closed" so that it no longer appears on the
2344 @ "leaves" page and is no longer labeled as a "<b>Leaf</b>".</label>
2345 @ </td></tr>
2346 }
2347
2348
2349 @ <tr><td colspan="2">
2350
--- src/info.c
+++ src/info.c
@@ -2292,10 +2292,11 @@
2292 );
2293 while( db_step(&q)==SQLITE_ROW ){
2294 int tagid = db_column_int(&q, 0);
2295 const char *zTagName = db_column_text(&q, 1);
2296 char zLabel[30];
2297 if (tagid == TAG_COMMENT) continue;
2298 sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid);
2299 @ <br /><label>
2300 if( P(zLabel) ){
2301 @ <input type="checkbox" name="c%d(tagid)" checked="checked" />
2302 }else{
@@ -2315,24 +2316,28 @@
2316 }
2317 @ Cancel special tag <b>%h(zTagName)</b></label>
2318 }
2319 }
2320 db_finalize(&q);
 
 
 
 
 
2321 @ </td></tr>
2322
2323 @ <tr><th align="right" valign="top">Branching:</th>
2324 @ <td valign="top">
2325 @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) />
2326 @ Make this check-in the start of a new branch named:</label>
2327 @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)"
2328 @ onkeyup="gebi('newbr').checked=!!this.value" />
2329 @ </td></tr>
2330
2331 if( !fHasHidden && zBranchName ){
2332 @ <tr><th align="right" valign="top">Branch Hiding:</th>
2333 @ <td valign="top">
2334 @ <label><input type="checkbox" name="hidden"%s(zHiddenFlag) />
2335 @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this
2336 @ check-in and make sure it is closed</label>
2337 @ </td></tr>
2338 }
2339
2340 if( is_a_leaf(rid)
2341 && !db_exists("SELECT 1 FROM tagxref "
2342 " WHERE tagid=%d AND rid=%d AND tagtype>0",
2343 TAG_CLOSED, rid)
@@ -2339,11 +2344,11 @@
2344 ){
2345 @ <tr><th align="right" valign="top">Leaf Closure:</th>
2346 @ <td valign="top">
2347 @ <label><input type="checkbox" name="close"%s(zCloseFlag) />
2348 @ Mark this leaf as "closed" so that it no longer appears on the
2349 @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label>
2350 @ </td></tr>
2351 }
2352
2353
2354 @ <tr><td colspan="2">
2355
+11 -6
--- src/info.c
+++ src/info.c
@@ -2292,10 +2292,11 @@
22922292
);
22932293
while( db_step(&q)==SQLITE_ROW ){
22942294
int tagid = db_column_int(&q, 0);
22952295
const char *zTagName = db_column_text(&q, 1);
22962296
char zLabel[30];
2297
+ if (tagid == TAG_COMMENT) continue;
22972298
sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid);
22982299
@ <br /><label>
22992300
if( P(zLabel) ){
23002301
@ <input type="checkbox" name="c%d(tagid)" checked="checked" />
23012302
}else{
@@ -2315,24 +2316,28 @@
23152316
}
23162317
@ Cancel special tag <b>%h(zTagName)</b></label>
23172318
}
23182319
}
23192320
db_finalize(&q);
2320
- if( !fHasHidden && zBranchName ){
2321
- @ <br /><label><input type="checkbox" name="hidden"%s(zHiddenFlag) />
2322
- @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this
2323
- @ check-in and make sure it is closed</label>
2324
- }
23252321
@ </td></tr>
23262322
23272323
@ <tr><th align="right" valign="top">Branching:</th>
23282324
@ <td valign="top">
23292325
@ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) />
23302326
@ Make this check-in the start of a new branch named:</label>
23312327
@ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)"
23322328
@ onkeyup="gebi('newbr').checked=!!this.value" />
23332329
@ </td></tr>
2330
+
2331
+ if( !fHasHidden && zBranchName ){
2332
+ @ <tr><th align="right" valign="top">Branch Hiding:</th>
2333
+ @ <td valign="top">
2334
+ @ <label><input type="checkbox" name="hidden"%s(zHiddenFlag) />
2335
+ @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this
2336
+ @ check-in and make sure it is closed</label>
2337
+ @ </td></tr>
2338
+ }
23342339
23352340
if( is_a_leaf(rid)
23362341
&& !db_exists("SELECT 1 FROM tagxref "
23372342
" WHERE tagid=%d AND rid=%d AND tagtype>0",
23382343
TAG_CLOSED, rid)
@@ -2339,11 +2344,11 @@
23392344
){
23402345
@ <tr><th align="right" valign="top">Leaf Closure:</th>
23412346
@ <td valign="top">
23422347
@ <label><input type="checkbox" name="close"%s(zCloseFlag) />
23432348
@ Mark this leaf as "closed" so that it no longer appears on the
2344
- @ "leaves" page and is no longer labeled as a "<b>Leaf</b>".</label>
2349
+ @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label>
23452350
@ </td></tr>
23462351
}
23472352
23482353
23492354
@ <tr><td colspan="2">
23502355
--- src/info.c
+++ src/info.c
@@ -2292,10 +2292,11 @@
2292 );
2293 while( db_step(&q)==SQLITE_ROW ){
2294 int tagid = db_column_int(&q, 0);
2295 const char *zTagName = db_column_text(&q, 1);
2296 char zLabel[30];
 
2297 sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid);
2298 @ <br /><label>
2299 if( P(zLabel) ){
2300 @ <input type="checkbox" name="c%d(tagid)" checked="checked" />
2301 }else{
@@ -2315,24 +2316,28 @@
2315 }
2316 @ Cancel special tag <b>%h(zTagName)</b></label>
2317 }
2318 }
2319 db_finalize(&q);
2320 if( !fHasHidden && zBranchName ){
2321 @ <br /><label><input type="checkbox" name="hidden"%s(zHiddenFlag) />
2322 @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this
2323 @ check-in and make sure it is closed</label>
2324 }
2325 @ </td></tr>
2326
2327 @ <tr><th align="right" valign="top">Branching:</th>
2328 @ <td valign="top">
2329 @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) />
2330 @ Make this check-in the start of a new branch named:</label>
2331 @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)"
2332 @ onkeyup="gebi('newbr').checked=!!this.value" />
2333 @ </td></tr>
 
 
 
 
 
 
 
 
 
2334
2335 if( is_a_leaf(rid)
2336 && !db_exists("SELECT 1 FROM tagxref "
2337 " WHERE tagid=%d AND rid=%d AND tagtype>0",
2338 TAG_CLOSED, rid)
@@ -2339,11 +2344,11 @@
2339 ){
2340 @ <tr><th align="right" valign="top">Leaf Closure:</th>
2341 @ <td valign="top">
2342 @ <label><input type="checkbox" name="close"%s(zCloseFlag) />
2343 @ Mark this leaf as "closed" so that it no longer appears on the
2344 @ "leaves" page and is no longer labeled as a "<b>Leaf</b>".</label>
2345 @ </td></tr>
2346 }
2347
2348
2349 @ <tr><td colspan="2">
2350
--- src/info.c
+++ src/info.c
@@ -2292,10 +2292,11 @@
2292 );
2293 while( db_step(&q)==SQLITE_ROW ){
2294 int tagid = db_column_int(&q, 0);
2295 const char *zTagName = db_column_text(&q, 1);
2296 char zLabel[30];
2297 if (tagid == TAG_COMMENT) continue;
2298 sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid);
2299 @ <br /><label>
2300 if( P(zLabel) ){
2301 @ <input type="checkbox" name="c%d(tagid)" checked="checked" />
2302 }else{
@@ -2315,24 +2316,28 @@
2316 }
2317 @ Cancel special tag <b>%h(zTagName)</b></label>
2318 }
2319 }
2320 db_finalize(&q);
 
 
 
 
 
2321 @ </td></tr>
2322
2323 @ <tr><th align="right" valign="top">Branching:</th>
2324 @ <td valign="top">
2325 @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) />
2326 @ Make this check-in the start of a new branch named:</label>
2327 @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)"
2328 @ onkeyup="gebi('newbr').checked=!!this.value" />
2329 @ </td></tr>
2330
2331 if( !fHasHidden && zBranchName ){
2332 @ <tr><th align="right" valign="top">Branch Hiding:</th>
2333 @ <td valign="top">
2334 @ <label><input type="checkbox" name="hidden"%s(zHiddenFlag) />
2335 @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this
2336 @ check-in and make sure it is closed</label>
2337 @ </td></tr>
2338 }
2339
2340 if( is_a_leaf(rid)
2341 && !db_exists("SELECT 1 FROM tagxref "
2342 " WHERE tagid=%d AND rid=%d AND tagtype>0",
2343 TAG_CLOSED, rid)
@@ -2339,11 +2344,11 @@
2344 ){
2345 @ <tr><th align="right" valign="top">Leaf Closure:</th>
2346 @ <td valign="top">
2347 @ <label><input type="checkbox" name="close"%s(zCloseFlag) />
2348 @ Mark this leaf as "closed" so that it no longer appears on the
2349 @ "leaves" page and is no longer labeled as a "<b>Leaf</b>"</label>
2350 @ </td></tr>
2351 }
2352
2353
2354 @ <tr><td colspan="2">
2355
+20 -2
--- src/login.c
+++ src/login.c
@@ -688,18 +688,27 @@
688688
sqlite3_stmt *pStmt; /* Query against the other repository */
689689
char *zSQL; /* SQL of the query against other repo */
690690
char *zOtherRepo; /* Filename of the other repository */
691691
int rc; /* Result code from SQLite library functions */
692692
int nXfer = 0; /* Number of credentials transferred */
693
+ const char *zVfs;
693694
694695
zOtherRepo = db_text(0,
695696
"SELECT value FROM config WHERE name='peer-repo-%q'",
696697
zCode
697698
);
698699
if( zOtherRepo==0 ) return 0; /* No such peer repository */
699700
700
- rc = sqlite3_open(zOtherRepo, &pOther);
701
+ zVfs = fossil_getenv("FOSSIL_VFS");
702
+#if defined(_WIN32) || defined(__CYGWIN__)
703
+ if( zVfs==0 && sqlite3_libversion_number()>=3008001 ){
704
+ zVfs = "win32-longpath";
705
+ }
706
+#endif
707
+ rc = sqlite3_open_v2(zOtherRepo, &pOther,
708
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
709
+ zVfs);
701710
if( rc==SQLITE_OK ){
702711
sqlite3_create_function(pOther,"now",0,SQLITE_ANY,0,db_now_function,0,0);
703712
sqlite3_create_function(pOther, "constant_time_cmp", 2, SQLITE_UTF8, 0,
704713
constant_time_cmp_function, 0, 0);
705714
sqlite3_busy_timeout(pOther, 5000);
@@ -1428,10 +1437,11 @@
14281437
char *zSelfRepo; /* Name of our repository */
14291438
char *zSelfLabel; /* Project-name for our repository */
14301439
char *zSelfProjCode; /* Our project-code */
14311440
char *zSql; /* SQL to run on all peers */
14321441
const char *zSelf; /* The ATTACH name of our repository */
1442
+ const char *zVfs;
14331443
14341444
*pzErrMsg = 0; /* Default to no errors */
14351445
zSelf = db_name("repository");
14361446
14371447
/* Get the full pathname of the other repository */
@@ -1459,11 +1469,19 @@
14591469
/* Make sure the other repository is a valid Fossil database */
14601470
if( file_size(zRepo)<0 ){
14611471
*pzErrMsg = mprintf("repository file \"%s\" does not exist", zRepo);
14621472
return;
14631473
}
1464
- rc = sqlite3_open(zRepo, &pOther);
1474
+ zVfs = fossil_getenv("FOSSIL_VFS");
1475
+#if defined(_WIN32) || defined(__CYGWIN__)
1476
+ if( zVfs==0 && sqlite3_libversion_number()>=3008001 ){
1477
+ zVfs = "win32-longpath";
1478
+ }
1479
+#endif
1480
+ rc = sqlite3_open_v2(zRepo, &pOther,
1481
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
1482
+ zVfs);
14651483
if( rc!=SQLITE_OK ){
14661484
*pzErrMsg = mprintf(sqlite3_errmsg(pOther));
14671485
}else{
14681486
rc = sqlite3_exec(pOther, "SELECT count(*) FROM user", 0, 0, pzErrMsg);
14691487
}
14701488
--- src/login.c
+++ src/login.c
@@ -688,18 +688,27 @@
688 sqlite3_stmt *pStmt; /* Query against the other repository */
689 char *zSQL; /* SQL of the query against other repo */
690 char *zOtherRepo; /* Filename of the other repository */
691 int rc; /* Result code from SQLite library functions */
692 int nXfer = 0; /* Number of credentials transferred */
 
693
694 zOtherRepo = db_text(0,
695 "SELECT value FROM config WHERE name='peer-repo-%q'",
696 zCode
697 );
698 if( zOtherRepo==0 ) return 0; /* No such peer repository */
699
700 rc = sqlite3_open(zOtherRepo, &pOther);
 
 
 
 
 
 
 
 
701 if( rc==SQLITE_OK ){
702 sqlite3_create_function(pOther,"now",0,SQLITE_ANY,0,db_now_function,0,0);
703 sqlite3_create_function(pOther, "constant_time_cmp", 2, SQLITE_UTF8, 0,
704 constant_time_cmp_function, 0, 0);
705 sqlite3_busy_timeout(pOther, 5000);
@@ -1428,10 +1437,11 @@
1428 char *zSelfRepo; /* Name of our repository */
1429 char *zSelfLabel; /* Project-name for our repository */
1430 char *zSelfProjCode; /* Our project-code */
1431 char *zSql; /* SQL to run on all peers */
1432 const char *zSelf; /* The ATTACH name of our repository */
 
1433
1434 *pzErrMsg = 0; /* Default to no errors */
1435 zSelf = db_name("repository");
1436
1437 /* Get the full pathname of the other repository */
@@ -1459,11 +1469,19 @@
1459 /* Make sure the other repository is a valid Fossil database */
1460 if( file_size(zRepo)<0 ){
1461 *pzErrMsg = mprintf("repository file \"%s\" does not exist", zRepo);
1462 return;
1463 }
1464 rc = sqlite3_open(zRepo, &pOther);
 
 
 
 
 
 
 
 
1465 if( rc!=SQLITE_OK ){
1466 *pzErrMsg = mprintf(sqlite3_errmsg(pOther));
1467 }else{
1468 rc = sqlite3_exec(pOther, "SELECT count(*) FROM user", 0, 0, pzErrMsg);
1469 }
1470
--- src/login.c
+++ src/login.c
@@ -688,18 +688,27 @@
688 sqlite3_stmt *pStmt; /* Query against the other repository */
689 char *zSQL; /* SQL of the query against other repo */
690 char *zOtherRepo; /* Filename of the other repository */
691 int rc; /* Result code from SQLite library functions */
692 int nXfer = 0; /* Number of credentials transferred */
693 const char *zVfs;
694
695 zOtherRepo = db_text(0,
696 "SELECT value FROM config WHERE name='peer-repo-%q'",
697 zCode
698 );
699 if( zOtherRepo==0 ) return 0; /* No such peer repository */
700
701 zVfs = fossil_getenv("FOSSIL_VFS");
702 #if defined(_WIN32) || defined(__CYGWIN__)
703 if( zVfs==0 && sqlite3_libversion_number()>=3008001 ){
704 zVfs = "win32-longpath";
705 }
706 #endif
707 rc = sqlite3_open_v2(zOtherRepo, &pOther,
708 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
709 zVfs);
710 if( rc==SQLITE_OK ){
711 sqlite3_create_function(pOther,"now",0,SQLITE_ANY,0,db_now_function,0,0);
712 sqlite3_create_function(pOther, "constant_time_cmp", 2, SQLITE_UTF8, 0,
713 constant_time_cmp_function, 0, 0);
714 sqlite3_busy_timeout(pOther, 5000);
@@ -1428,10 +1437,11 @@
1437 char *zSelfRepo; /* Name of our repository */
1438 char *zSelfLabel; /* Project-name for our repository */
1439 char *zSelfProjCode; /* Our project-code */
1440 char *zSql; /* SQL to run on all peers */
1441 const char *zSelf; /* The ATTACH name of our repository */
1442 const char *zVfs;
1443
1444 *pzErrMsg = 0; /* Default to no errors */
1445 zSelf = db_name("repository");
1446
1447 /* Get the full pathname of the other repository */
@@ -1459,11 +1469,19 @@
1469 /* Make sure the other repository is a valid Fossil database */
1470 if( file_size(zRepo)<0 ){
1471 *pzErrMsg = mprintf("repository file \"%s\" does not exist", zRepo);
1472 return;
1473 }
1474 zVfs = fossil_getenv("FOSSIL_VFS");
1475 #if defined(_WIN32) || defined(__CYGWIN__)
1476 if( zVfs==0 && sqlite3_libversion_number()>=3008001 ){
1477 zVfs = "win32-longpath";
1478 }
1479 #endif
1480 rc = sqlite3_open_v2(zRepo, &pOther,
1481 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
1482 zVfs);
1483 if( rc!=SQLITE_OK ){
1484 *pzErrMsg = mprintf(sqlite3_errmsg(pOther));
1485 }else{
1486 rc = sqlite3_exec(pOther, "SELECT count(*) FROM user", 0, 0, pzErrMsg);
1487 }
1488
+58 -31
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -135,11 +135,11 @@
135135
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
136136
** [sqlite_version()] and [sqlite_source_id()].
137137
*/
138138
#define SQLITE_VERSION "3.8.2"
139139
#define SQLITE_VERSION_NUMBER 3008002
140
-#define SQLITE_SOURCE_ID "2013-11-27 14:50:51 c75f561f337a56c14335366ed9990e44bc9fc594"
140
+#define SQLITE_SOURCE_ID "2013-12-03 02:52:11 7d99858bec699dface548c77649dfc50e7fb50d8"
141141
142142
/*
143143
** CAPI3REF: Run-Time Library Version Numbers
144144
** KEYWORDS: sqlite3_version, sqlite3_sourceid
145145
**
@@ -3806,23 +3806,23 @@
38063806
** <table border="1">
38073807
** <tr><th> Internal<br>Type <th> Requested<br>Type <th> Conversion
38083808
**
38093809
** <tr><td> NULL <td> INTEGER <td> Result is 0
38103810
** <tr><td> NULL <td> FLOAT <td> Result is 0.0
3811
-** <tr><td> NULL <td> TEXT <td> Result is NULL pointer
3812
-** <tr><td> NULL <td> BLOB <td> Result is NULL pointer
3811
+** <tr><td> NULL <td> TEXT <td> Result is a NULL pointer
3812
+** <tr><td> NULL <td> BLOB <td> Result is a NULL pointer
38133813
** <tr><td> INTEGER <td> FLOAT <td> Convert from integer to float
38143814
** <tr><td> INTEGER <td> TEXT <td> ASCII rendering of the integer
38153815
** <tr><td> INTEGER <td> BLOB <td> Same as INTEGER->TEXT
3816
-** <tr><td> FLOAT <td> INTEGER <td> Convert from float to integer
3816
+** <tr><td> FLOAT <td> INTEGER <td> [CAST] to INTEGER
38173817
** <tr><td> FLOAT <td> TEXT <td> ASCII rendering of the float
3818
-** <tr><td> FLOAT <td> BLOB <td> Same as FLOAT->TEXT
3819
-** <tr><td> TEXT <td> INTEGER <td> Use atoi()
3820
-** <tr><td> TEXT <td> FLOAT <td> Use atof()
3818
+** <tr><td> FLOAT <td> BLOB <td> [CAST] to BLOB
3819
+** <tr><td> TEXT <td> INTEGER <td> [CAST] to INTEGER
3820
+** <tr><td> TEXT <td> FLOAT <td> [CAST] to REAL
38213821
** <tr><td> TEXT <td> BLOB <td> No change
3822
-** <tr><td> BLOB <td> INTEGER <td> Convert to TEXT then use atoi()
3823
-** <tr><td> BLOB <td> FLOAT <td> Convert to TEXT then use atof()
3822
+** <tr><td> BLOB <td> INTEGER <td> [CAST] to INTEGER
3823
+** <tr><td> BLOB <td> FLOAT <td> [CAST] to REAL
38243824
** <tr><td> BLOB <td> TEXT <td> Add a zero terminator if needed
38253825
** </table>
38263826
** </blockquote>)^
38273827
**
38283828
** The table above makes reference to standard C library functions atoi()
@@ -6100,11 +6100,12 @@
61006100
#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
61016101
#define SQLITE_TESTCTRL_ISKEYWORD 16
61026102
#define SQLITE_TESTCTRL_SCRATCHMALLOC 17
61036103
#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
61046104
#define SQLITE_TESTCTRL_EXPLAIN_STMT 19
6105
-#define SQLITE_TESTCTRL_LAST 19
6105
+#define SQLITE_TESTCTRL_NEVER_CORRUPT 20
6106
+#define SQLITE_TESTCTRL_LAST 20
61066107
61076108
/*
61086109
** CAPI3REF: SQLite Runtime Status
61096110
**
61106111
** ^This interface is used to retrieve runtime status information
@@ -11807,10 +11808,11 @@
1180711808
int bCoreMutex; /* True to enable core mutexing */
1180811809
int bFullMutex; /* True to enable full mutexing */
1180911810
int bOpenUri; /* True to interpret filenames as URIs */
1181011811
int bUseCis; /* Use covering indices for full-scans */
1181111812
int mxStrlen; /* Maximum string length */
11813
+ int neverCorrupt; /* Database is always well-formed */
1181211814
int szLookaside; /* Default lookaside buffer size */
1181311815
int nLookaside; /* Default lookaside buffer count */
1181411816
sqlite3_mem_methods m; /* Low-level memory allocation interface */
1181511817
sqlite3_mutex_methods mutex; /* Low-level mutex interface */
1181611818
sqlite3_pcache_methods2 pcache2; /* Low-level page-cache interface */
@@ -11843,10 +11845,28 @@
1184311845
void(*xSqllog)(void*,sqlite3*,const char*, int);
1184411846
void *pSqllogArg;
1184511847
#endif
1184611848
};
1184711849
11850
+/*
11851
+** This macro is used inside of assert() statements to indicate that
11852
+** the assert is only valid on a well-formed database. Instead of:
11853
+**
11854
+** assert( X );
11855
+**
11856
+** One writes:
11857
+**
11858
+** assert( X || CORRUPT_DB );
11859
+**
11860
+** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate
11861
+** that the database is definitely corrupt, only that it might be corrupt.
11862
+** For most test cases, CORRUPT_DB is set to false using a special
11863
+** sqlite3_test_control(). This enables assert() statements to prove
11864
+** things that are always true for well-formed databases.
11865
+*/
11866
+#define CORRUPT_DB (sqlite3Config.neverCorrupt==0)
11867
+
1184811868
/*
1184911869
** Context pointer passed down through the tree-walk.
1185011870
*/
1185111871
struct Walker {
1185211872
int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */
@@ -12870,10 +12890,11 @@
1287012890
1, /* bCoreMutex */
1287112891
SQLITE_THREADSAFE==1, /* bFullMutex */
1287212892
SQLITE_USE_URI, /* bOpenUri */
1287312893
SQLITE_ALLOW_COVERING_INDEX_SCAN, /* bUseCis */
1287412894
0x7ffffffe, /* mxStrlen */
12895
+ 0, /* neverCorrupt */
1287512896
128, /* szLookaside */
1287612897
500, /* nLookaside */
1287712898
{0,0,0,0,0,0,0,0}, /* m */
1287812899
{0,0,0,0,0,0,0,0,0}, /* mutex */
1287912900
{0,0,0,0,0,0,0,0,0,0,0,0,0},/* pcache2 */
@@ -12904,11 +12925,10 @@
1290412925
#ifdef SQLITE_ENABLE_SQLLOG
1290512926
0, /* xSqllog */
1290612927
0 /* pSqllogArg */
1290712928
#endif
1290812929
};
12909
-
1291012930
1291112931
/*
1291212932
** Hash table for global functions - functions common to all
1291312933
** database connections. After initialization, this table is
1291412934
** read-only.
@@ -21793,16 +21813,16 @@
2179321813
** Convert zNum to a 64-bit signed integer.
2179421814
**
2179521815
** If the zNum value is representable as a 64-bit twos-complement
2179621816
** integer, then write that value into *pNum and return 0.
2179721817
**
21798
-** If zNum is exactly 9223372036854665808, return 2. This special
21799
-** case is broken out because while 9223372036854665808 cannot be a
21800
-** signed 64-bit integer, its negative -9223372036854665808 can be.
21818
+** If zNum is exactly 9223372036854775808, return 2. This special
21819
+** case is broken out because while 9223372036854775808 cannot be a
21820
+** signed 64-bit integer, its negative -9223372036854775808 can be.
2180121821
**
2180221822
** If zNum is too big for a 64-bit integer and is not
21803
-** 9223372036854665808 or if zNum contains any non-numeric text,
21823
+** 9223372036854775808 or if zNum contains any non-numeric text,
2180421824
** then return 1.
2180521825
**
2180621826
** length is the number of bytes in the string (bytes, not characters).
2180721827
** The string is not necessarily zero-terminated. The encoding is
2180821828
** given by enc.
@@ -51013,10 +51033,14 @@
5101351033
pIdxKey = sqlite3VdbeAllocUnpackedRecord(
5101451034
pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree
5101551035
);
5101651036
if( pIdxKey==0 ) return SQLITE_NOMEM;
5101751037
sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, pIdxKey);
51038
+ if( pIdxKey->nField==0 ){
51039
+ sqlite3DbFree(pCur->pKeyInfo->db, pFree);
51040
+ return SQLITE_CORRUPT_BKPT;
51041
+ }
5101851042
}else{
5101951043
pIdxKey = 0;
5102051044
}
5102151045
rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
5102251046
if( pFree ){
@@ -60677,20 +60701,11 @@
6067760701
if( !pExpr ){
6067860702
*ppVal = 0;
6067960703
return SQLITE_OK;
6068060704
}
6068160705
op = pExpr->op;
60682
-
60683
- /* op can only be TK_REGISTER if we have compiled with SQLITE_ENABLE_STAT4.
60684
- ** The ifdef here is to enable us to achieve 100% branch test coverage even
60685
- ** when SQLITE_ENABLE_STAT4 is omitted.
60686
- */
60687
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
60688
- if( op==TK_REGISTER ) op = pExpr->op2;
60689
-#else
6069060706
if( NEVER(op==TK_REGISTER) ) op = pExpr->op2;
60691
-#endif
6069260707
6069360708
/* Handle negative integers in a single step. This is needed in the
6069460709
** case when the value is -9223372036854775808.
6069560710
*/
6069660711
if( op==TK_UMINUS
@@ -60908,11 +60923,11 @@
6090860923
if( pVal ){
6090960924
sqlite3VdbeMemSetNull((Mem*)pVal);
6091060925
*pbOk = 1;
6091160926
}
6091260927
}else if( pExpr->op==TK_VARIABLE
60913
- || (pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE)
60928
+ || NEVER(pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE)
6091460929
){
6091560930
Vdbe *v;
6091660931
int iBindVar = pExpr->iColumn;
6091760932
sqlite3VdbeSetVarmask(pParse->pVdbe, iBindVar);
6091860933
if( (v = pParse->pReprepare)!=0 ){
@@ -64108,13 +64123,13 @@
6410864123
*/
6410964124
/* mem1.u.i = 0; // not needed, here to silence compiler warning */
6411064125
6411164126
idx1 = getVarint32(aKey1, szHdr1);
6411264127
d1 = szHdr1;
64113
- assert( pKeyInfo->nField+pKeyInfo->nXField>=pPKey2->nField );
64128
+ assert( pKeyInfo->nField+pKeyInfo->nXField>=pPKey2->nField || CORRUPT_DB );
6411464129
assert( pKeyInfo->aSortOrder!=0 );
64115
- assert( idx1<szHdr1 && i<pPKey2->nField );
64130
+ assert( (idx1<=szHdr1 && i<pPKey2->nField) || CORRUPT_DB );
6411664131
do{
6411764132
u32 serial_type1;
6411864133
6411964134
/* Read the serial types for the next element in each key. */
6412064135
idx1 += getVarint32( aKey1+idx1, serial_type1 );
@@ -70718,13 +70733,12 @@
7071870733
rc = sqlite3BtreeDelete(u.bj.pC->pCursor);
7071970734
u.bj.pC->cacheStatus = CACHE_STALE;
7072070735
7072170736
/* Invoke the update-hook if required. */
7072270737
if( rc==SQLITE_OK && db->xUpdateCallback && pOp->p4.z && u.bj.pC->isTable ){
70723
- const char *zDb = db->aDb[u.bj.pC->iDb].zName;
70724
- const char *zTbl = pOp->p4.z;
70725
- db->xUpdateCallback(db->pUpdateArg, SQLITE_DELETE, zDb, zTbl, u.bj.iKey);
70738
+ db->xUpdateCallback(db->pUpdateArg, SQLITE_DELETE,
70739
+ db->aDb[u.bj.pC->iDb].zName, pOp->p4.z, u.bj.iKey);
7072670740
assert( u.bj.pC->iDb>=0 );
7072770741
}
7072870742
if( pOp->p2 & OPFLAG_NCHANGE ) p->nChange++;
7072970743
break;
7073070744
}
@@ -87011,11 +87025,11 @@
8701187025
Token *pName = 0; /* Unqualified name of the index to create */
8701287026
struct ExprList_item *pListItem; /* For looping over pList */
8701387027
const Column *pTabCol; /* A column in the table */
8701487028
int nExtra = 0; /* Space allocated for zExtra[] */
8701587029
int nExtraCol; /* Number of extra columns needed */
87016
- char *zExtra; /* Extra space after the Index object */
87030
+ char *zExtra = 0; /* Extra space after the Index object */
8701787031
Index *pPk = 0; /* PRIMARY KEY index for WITHOUT ROWID tables */
8701887032
8701987033
assert( pParse->nErr==0 ); /* Never called with prior errors */
8702087034
if( db->mallocFailed || IN_DECLARE_VTAB ){
8702187035
goto exit_create_index;
@@ -122278,10 +122292,23 @@
122278122292
const char **pzRet = va_arg(ap, const char**);
122279122293
*pzRet = sqlite3VdbeExplanation((Vdbe*)pStmt);
122280122294
break;
122281122295
}
122282122296
#endif
122297
+
122298
+ /* sqlite3_test_control(SQLITE_TESTCTRL_NEVER_CORRUPT, int);
122299
+ **
122300
+ ** Set or clear a flag that indicates that the database file is always well-
122301
+ ** formed and never corrupt. This flag is clear by default, indicating that
122302
+ ** database files might have arbitrary corruption. Setting the flag during
122303
+ ** testing causes certain assert() statements in the code to be activated
122304
+ ** that demonstrat invariants on well-formed database files.
122305
+ */
122306
+ case SQLITE_TESTCTRL_NEVER_CORRUPT: {
122307
+ sqlite3Config.neverCorrupt = va_arg(ap, int);
122308
+ break;
122309
+ }
122283122310
122284122311
}
122285122312
va_end(ap);
122286122313
#endif /* SQLITE_OMIT_BUILTIN_TEST */
122287122314
return rc;
122288122315
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -135,11 +135,11 @@
135 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
136 ** [sqlite_version()] and [sqlite_source_id()].
137 */
138 #define SQLITE_VERSION "3.8.2"
139 #define SQLITE_VERSION_NUMBER 3008002
140 #define SQLITE_SOURCE_ID "2013-11-27 14:50:51 c75f561f337a56c14335366ed9990e44bc9fc594"
141
142 /*
143 ** CAPI3REF: Run-Time Library Version Numbers
144 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
145 **
@@ -3806,23 +3806,23 @@
3806 ** <table border="1">
3807 ** <tr><th> Internal<br>Type <th> Requested<br>Type <th> Conversion
3808 **
3809 ** <tr><td> NULL <td> INTEGER <td> Result is 0
3810 ** <tr><td> NULL <td> FLOAT <td> Result is 0.0
3811 ** <tr><td> NULL <td> TEXT <td> Result is NULL pointer
3812 ** <tr><td> NULL <td> BLOB <td> Result is NULL pointer
3813 ** <tr><td> INTEGER <td> FLOAT <td> Convert from integer to float
3814 ** <tr><td> INTEGER <td> TEXT <td> ASCII rendering of the integer
3815 ** <tr><td> INTEGER <td> BLOB <td> Same as INTEGER->TEXT
3816 ** <tr><td> FLOAT <td> INTEGER <td> Convert from float to integer
3817 ** <tr><td> FLOAT <td> TEXT <td> ASCII rendering of the float
3818 ** <tr><td> FLOAT <td> BLOB <td> Same as FLOAT->TEXT
3819 ** <tr><td> TEXT <td> INTEGER <td> Use atoi()
3820 ** <tr><td> TEXT <td> FLOAT <td> Use atof()
3821 ** <tr><td> TEXT <td> BLOB <td> No change
3822 ** <tr><td> BLOB <td> INTEGER <td> Convert to TEXT then use atoi()
3823 ** <tr><td> BLOB <td> FLOAT <td> Convert to TEXT then use atof()
3824 ** <tr><td> BLOB <td> TEXT <td> Add a zero terminator if needed
3825 ** </table>
3826 ** </blockquote>)^
3827 **
3828 ** The table above makes reference to standard C library functions atoi()
@@ -6100,11 +6100,12 @@
6100 #define SQLITE_TESTCTRL_OPTIMIZATIONS 15
6101 #define SQLITE_TESTCTRL_ISKEYWORD 16
6102 #define SQLITE_TESTCTRL_SCRATCHMALLOC 17
6103 #define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
6104 #define SQLITE_TESTCTRL_EXPLAIN_STMT 19
6105 #define SQLITE_TESTCTRL_LAST 19
 
6106
6107 /*
6108 ** CAPI3REF: SQLite Runtime Status
6109 **
6110 ** ^This interface is used to retrieve runtime status information
@@ -11807,10 +11808,11 @@
11807 int bCoreMutex; /* True to enable core mutexing */
11808 int bFullMutex; /* True to enable full mutexing */
11809 int bOpenUri; /* True to interpret filenames as URIs */
11810 int bUseCis; /* Use covering indices for full-scans */
11811 int mxStrlen; /* Maximum string length */
 
11812 int szLookaside; /* Default lookaside buffer size */
11813 int nLookaside; /* Default lookaside buffer count */
11814 sqlite3_mem_methods m; /* Low-level memory allocation interface */
11815 sqlite3_mutex_methods mutex; /* Low-level mutex interface */
11816 sqlite3_pcache_methods2 pcache2; /* Low-level page-cache interface */
@@ -11843,10 +11845,28 @@
11843 void(*xSqllog)(void*,sqlite3*,const char*, int);
11844 void *pSqllogArg;
11845 #endif
11846 };
11847
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11848 /*
11849 ** Context pointer passed down through the tree-walk.
11850 */
11851 struct Walker {
11852 int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */
@@ -12870,10 +12890,11 @@
12870 1, /* bCoreMutex */
12871 SQLITE_THREADSAFE==1, /* bFullMutex */
12872 SQLITE_USE_URI, /* bOpenUri */
12873 SQLITE_ALLOW_COVERING_INDEX_SCAN, /* bUseCis */
12874 0x7ffffffe, /* mxStrlen */
 
12875 128, /* szLookaside */
12876 500, /* nLookaside */
12877 {0,0,0,0,0,0,0,0}, /* m */
12878 {0,0,0,0,0,0,0,0,0}, /* mutex */
12879 {0,0,0,0,0,0,0,0,0,0,0,0,0},/* pcache2 */
@@ -12904,11 +12925,10 @@
12904 #ifdef SQLITE_ENABLE_SQLLOG
12905 0, /* xSqllog */
12906 0 /* pSqllogArg */
12907 #endif
12908 };
12909
12910
12911 /*
12912 ** Hash table for global functions - functions common to all
12913 ** database connections. After initialization, this table is
12914 ** read-only.
@@ -21793,16 +21813,16 @@
21793 ** Convert zNum to a 64-bit signed integer.
21794 **
21795 ** If the zNum value is representable as a 64-bit twos-complement
21796 ** integer, then write that value into *pNum and return 0.
21797 **
21798 ** If zNum is exactly 9223372036854665808, return 2. This special
21799 ** case is broken out because while 9223372036854665808 cannot be a
21800 ** signed 64-bit integer, its negative -9223372036854665808 can be.
21801 **
21802 ** If zNum is too big for a 64-bit integer and is not
21803 ** 9223372036854665808 or if zNum contains any non-numeric text,
21804 ** then return 1.
21805 **
21806 ** length is the number of bytes in the string (bytes, not characters).
21807 ** The string is not necessarily zero-terminated. The encoding is
21808 ** given by enc.
@@ -51013,10 +51033,14 @@
51013 pIdxKey = sqlite3VdbeAllocUnpackedRecord(
51014 pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree
51015 );
51016 if( pIdxKey==0 ) return SQLITE_NOMEM;
51017 sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, pIdxKey);
 
 
 
 
51018 }else{
51019 pIdxKey = 0;
51020 }
51021 rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
51022 if( pFree ){
@@ -60677,20 +60701,11 @@
60677 if( !pExpr ){
60678 *ppVal = 0;
60679 return SQLITE_OK;
60680 }
60681 op = pExpr->op;
60682
60683 /* op can only be TK_REGISTER if we have compiled with SQLITE_ENABLE_STAT4.
60684 ** The ifdef here is to enable us to achieve 100% branch test coverage even
60685 ** when SQLITE_ENABLE_STAT4 is omitted.
60686 */
60687 #ifdef SQLITE_ENABLE_STAT3_OR_STAT4
60688 if( op==TK_REGISTER ) op = pExpr->op2;
60689 #else
60690 if( NEVER(op==TK_REGISTER) ) op = pExpr->op2;
60691 #endif
60692
60693 /* Handle negative integers in a single step. This is needed in the
60694 ** case when the value is -9223372036854775808.
60695 */
60696 if( op==TK_UMINUS
@@ -60908,11 +60923,11 @@
60908 if( pVal ){
60909 sqlite3VdbeMemSetNull((Mem*)pVal);
60910 *pbOk = 1;
60911 }
60912 }else if( pExpr->op==TK_VARIABLE
60913 || (pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE)
60914 ){
60915 Vdbe *v;
60916 int iBindVar = pExpr->iColumn;
60917 sqlite3VdbeSetVarmask(pParse->pVdbe, iBindVar);
60918 if( (v = pParse->pReprepare)!=0 ){
@@ -64108,13 +64123,13 @@
64108 */
64109 /* mem1.u.i = 0; // not needed, here to silence compiler warning */
64110
64111 idx1 = getVarint32(aKey1, szHdr1);
64112 d1 = szHdr1;
64113 assert( pKeyInfo->nField+pKeyInfo->nXField>=pPKey2->nField );
64114 assert( pKeyInfo->aSortOrder!=0 );
64115 assert( idx1<szHdr1 && i<pPKey2->nField );
64116 do{
64117 u32 serial_type1;
64118
64119 /* Read the serial types for the next element in each key. */
64120 idx1 += getVarint32( aKey1+idx1, serial_type1 );
@@ -70718,13 +70733,12 @@
70718 rc = sqlite3BtreeDelete(u.bj.pC->pCursor);
70719 u.bj.pC->cacheStatus = CACHE_STALE;
70720
70721 /* Invoke the update-hook if required. */
70722 if( rc==SQLITE_OK && db->xUpdateCallback && pOp->p4.z && u.bj.pC->isTable ){
70723 const char *zDb = db->aDb[u.bj.pC->iDb].zName;
70724 const char *zTbl = pOp->p4.z;
70725 db->xUpdateCallback(db->pUpdateArg, SQLITE_DELETE, zDb, zTbl, u.bj.iKey);
70726 assert( u.bj.pC->iDb>=0 );
70727 }
70728 if( pOp->p2 & OPFLAG_NCHANGE ) p->nChange++;
70729 break;
70730 }
@@ -87011,11 +87025,11 @@
87011 Token *pName = 0; /* Unqualified name of the index to create */
87012 struct ExprList_item *pListItem; /* For looping over pList */
87013 const Column *pTabCol; /* A column in the table */
87014 int nExtra = 0; /* Space allocated for zExtra[] */
87015 int nExtraCol; /* Number of extra columns needed */
87016 char *zExtra; /* Extra space after the Index object */
87017 Index *pPk = 0; /* PRIMARY KEY index for WITHOUT ROWID tables */
87018
87019 assert( pParse->nErr==0 ); /* Never called with prior errors */
87020 if( db->mallocFailed || IN_DECLARE_VTAB ){
87021 goto exit_create_index;
@@ -122278,10 +122292,23 @@
122278 const char **pzRet = va_arg(ap, const char**);
122279 *pzRet = sqlite3VdbeExplanation((Vdbe*)pStmt);
122280 break;
122281 }
122282 #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
122283
122284 }
122285 va_end(ap);
122286 #endif /* SQLITE_OMIT_BUILTIN_TEST */
122287 return rc;
122288
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -135,11 +135,11 @@
135 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
136 ** [sqlite_version()] and [sqlite_source_id()].
137 */
138 #define SQLITE_VERSION "3.8.2"
139 #define SQLITE_VERSION_NUMBER 3008002
140 #define SQLITE_SOURCE_ID "2013-12-03 02:52:11 7d99858bec699dface548c77649dfc50e7fb50d8"
141
142 /*
143 ** CAPI3REF: Run-Time Library Version Numbers
144 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
145 **
@@ -3806,23 +3806,23 @@
3806 ** <table border="1">
3807 ** <tr><th> Internal<br>Type <th> Requested<br>Type <th> Conversion
3808 **
3809 ** <tr><td> NULL <td> INTEGER <td> Result is 0
3810 ** <tr><td> NULL <td> FLOAT <td> Result is 0.0
3811 ** <tr><td> NULL <td> TEXT <td> Result is a NULL pointer
3812 ** <tr><td> NULL <td> BLOB <td> Result is a NULL pointer
3813 ** <tr><td> INTEGER <td> FLOAT <td> Convert from integer to float
3814 ** <tr><td> INTEGER <td> TEXT <td> ASCII rendering of the integer
3815 ** <tr><td> INTEGER <td> BLOB <td> Same as INTEGER->TEXT
3816 ** <tr><td> FLOAT <td> INTEGER <td> [CAST] to INTEGER
3817 ** <tr><td> FLOAT <td> TEXT <td> ASCII rendering of the float
3818 ** <tr><td> FLOAT <td> BLOB <td> [CAST] to BLOB
3819 ** <tr><td> TEXT <td> INTEGER <td> [CAST] to INTEGER
3820 ** <tr><td> TEXT <td> FLOAT <td> [CAST] to REAL
3821 ** <tr><td> TEXT <td> BLOB <td> No change
3822 ** <tr><td> BLOB <td> INTEGER <td> [CAST] to INTEGER
3823 ** <tr><td> BLOB <td> FLOAT <td> [CAST] to REAL
3824 ** <tr><td> BLOB <td> TEXT <td> Add a zero terminator if needed
3825 ** </table>
3826 ** </blockquote>)^
3827 **
3828 ** The table above makes reference to standard C library functions atoi()
@@ -6100,11 +6100,12 @@
6100 #define SQLITE_TESTCTRL_OPTIMIZATIONS 15
6101 #define SQLITE_TESTCTRL_ISKEYWORD 16
6102 #define SQLITE_TESTCTRL_SCRATCHMALLOC 17
6103 #define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
6104 #define SQLITE_TESTCTRL_EXPLAIN_STMT 19
6105 #define SQLITE_TESTCTRL_NEVER_CORRUPT 20
6106 #define SQLITE_TESTCTRL_LAST 20
6107
6108 /*
6109 ** CAPI3REF: SQLite Runtime Status
6110 **
6111 ** ^This interface is used to retrieve runtime status information
@@ -11807,10 +11808,11 @@
11808 int bCoreMutex; /* True to enable core mutexing */
11809 int bFullMutex; /* True to enable full mutexing */
11810 int bOpenUri; /* True to interpret filenames as URIs */
11811 int bUseCis; /* Use covering indices for full-scans */
11812 int mxStrlen; /* Maximum string length */
11813 int neverCorrupt; /* Database is always well-formed */
11814 int szLookaside; /* Default lookaside buffer size */
11815 int nLookaside; /* Default lookaside buffer count */
11816 sqlite3_mem_methods m; /* Low-level memory allocation interface */
11817 sqlite3_mutex_methods mutex; /* Low-level mutex interface */
11818 sqlite3_pcache_methods2 pcache2; /* Low-level page-cache interface */
@@ -11843,10 +11845,28 @@
11845 void(*xSqllog)(void*,sqlite3*,const char*, int);
11846 void *pSqllogArg;
11847 #endif
11848 };
11849
11850 /*
11851 ** This macro is used inside of assert() statements to indicate that
11852 ** the assert is only valid on a well-formed database. Instead of:
11853 **
11854 ** assert( X );
11855 **
11856 ** One writes:
11857 **
11858 ** assert( X || CORRUPT_DB );
11859 **
11860 ** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate
11861 ** that the database is definitely corrupt, only that it might be corrupt.
11862 ** For most test cases, CORRUPT_DB is set to false using a special
11863 ** sqlite3_test_control(). This enables assert() statements to prove
11864 ** things that are always true for well-formed databases.
11865 */
11866 #define CORRUPT_DB (sqlite3Config.neverCorrupt==0)
11867
11868 /*
11869 ** Context pointer passed down through the tree-walk.
11870 */
11871 struct Walker {
11872 int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */
@@ -12870,10 +12890,11 @@
12890 1, /* bCoreMutex */
12891 SQLITE_THREADSAFE==1, /* bFullMutex */
12892 SQLITE_USE_URI, /* bOpenUri */
12893 SQLITE_ALLOW_COVERING_INDEX_SCAN, /* bUseCis */
12894 0x7ffffffe, /* mxStrlen */
12895 0, /* neverCorrupt */
12896 128, /* szLookaside */
12897 500, /* nLookaside */
12898 {0,0,0,0,0,0,0,0}, /* m */
12899 {0,0,0,0,0,0,0,0,0}, /* mutex */
12900 {0,0,0,0,0,0,0,0,0,0,0,0,0},/* pcache2 */
@@ -12904,11 +12925,10 @@
12925 #ifdef SQLITE_ENABLE_SQLLOG
12926 0, /* xSqllog */
12927 0 /* pSqllogArg */
12928 #endif
12929 };
 
12930
12931 /*
12932 ** Hash table for global functions - functions common to all
12933 ** database connections. After initialization, this table is
12934 ** read-only.
@@ -21793,16 +21813,16 @@
21813 ** Convert zNum to a 64-bit signed integer.
21814 **
21815 ** If the zNum value is representable as a 64-bit twos-complement
21816 ** integer, then write that value into *pNum and return 0.
21817 **
21818 ** If zNum is exactly 9223372036854775808, return 2. This special
21819 ** case is broken out because while 9223372036854775808 cannot be a
21820 ** signed 64-bit integer, its negative -9223372036854775808 can be.
21821 **
21822 ** If zNum is too big for a 64-bit integer and is not
21823 ** 9223372036854775808 or if zNum contains any non-numeric text,
21824 ** then return 1.
21825 **
21826 ** length is the number of bytes in the string (bytes, not characters).
21827 ** The string is not necessarily zero-terminated. The encoding is
21828 ** given by enc.
@@ -51013,10 +51033,14 @@
51033 pIdxKey = sqlite3VdbeAllocUnpackedRecord(
51034 pCur->pKeyInfo, aSpace, sizeof(aSpace), &pFree
51035 );
51036 if( pIdxKey==0 ) return SQLITE_NOMEM;
51037 sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, pIdxKey);
51038 if( pIdxKey->nField==0 ){
51039 sqlite3DbFree(pCur->pKeyInfo->db, pFree);
51040 return SQLITE_CORRUPT_BKPT;
51041 }
51042 }else{
51043 pIdxKey = 0;
51044 }
51045 rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
51046 if( pFree ){
@@ -60677,20 +60701,11 @@
60701 if( !pExpr ){
60702 *ppVal = 0;
60703 return SQLITE_OK;
60704 }
60705 op = pExpr->op;
 
 
 
 
 
 
 
 
60706 if( NEVER(op==TK_REGISTER) ) op = pExpr->op2;
 
60707
60708 /* Handle negative integers in a single step. This is needed in the
60709 ** case when the value is -9223372036854775808.
60710 */
60711 if( op==TK_UMINUS
@@ -60908,11 +60923,11 @@
60923 if( pVal ){
60924 sqlite3VdbeMemSetNull((Mem*)pVal);
60925 *pbOk = 1;
60926 }
60927 }else if( pExpr->op==TK_VARIABLE
60928 || NEVER(pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE)
60929 ){
60930 Vdbe *v;
60931 int iBindVar = pExpr->iColumn;
60932 sqlite3VdbeSetVarmask(pParse->pVdbe, iBindVar);
60933 if( (v = pParse->pReprepare)!=0 ){
@@ -64108,13 +64123,13 @@
64123 */
64124 /* mem1.u.i = 0; // not needed, here to silence compiler warning */
64125
64126 idx1 = getVarint32(aKey1, szHdr1);
64127 d1 = szHdr1;
64128 assert( pKeyInfo->nField+pKeyInfo->nXField>=pPKey2->nField || CORRUPT_DB );
64129 assert( pKeyInfo->aSortOrder!=0 );
64130 assert( (idx1<=szHdr1 && i<pPKey2->nField) || CORRUPT_DB );
64131 do{
64132 u32 serial_type1;
64133
64134 /* Read the serial types for the next element in each key. */
64135 idx1 += getVarint32( aKey1+idx1, serial_type1 );
@@ -70718,13 +70733,12 @@
70733 rc = sqlite3BtreeDelete(u.bj.pC->pCursor);
70734 u.bj.pC->cacheStatus = CACHE_STALE;
70735
70736 /* Invoke the update-hook if required. */
70737 if( rc==SQLITE_OK && db->xUpdateCallback && pOp->p4.z && u.bj.pC->isTable ){
70738 db->xUpdateCallback(db->pUpdateArg, SQLITE_DELETE,
70739 db->aDb[u.bj.pC->iDb].zName, pOp->p4.z, u.bj.iKey);
 
70740 assert( u.bj.pC->iDb>=0 );
70741 }
70742 if( pOp->p2 & OPFLAG_NCHANGE ) p->nChange++;
70743 break;
70744 }
@@ -87011,11 +87025,11 @@
87025 Token *pName = 0; /* Unqualified name of the index to create */
87026 struct ExprList_item *pListItem; /* For looping over pList */
87027 const Column *pTabCol; /* A column in the table */
87028 int nExtra = 0; /* Space allocated for zExtra[] */
87029 int nExtraCol; /* Number of extra columns needed */
87030 char *zExtra = 0; /* Extra space after the Index object */
87031 Index *pPk = 0; /* PRIMARY KEY index for WITHOUT ROWID tables */
87032
87033 assert( pParse->nErr==0 ); /* Never called with prior errors */
87034 if( db->mallocFailed || IN_DECLARE_VTAB ){
87035 goto exit_create_index;
@@ -122278,10 +122292,23 @@
122292 const char **pzRet = va_arg(ap, const char**);
122293 *pzRet = sqlite3VdbeExplanation((Vdbe*)pStmt);
122294 break;
122295 }
122296 #endif
122297
122298 /* sqlite3_test_control(SQLITE_TESTCTRL_NEVER_CORRUPT, int);
122299 **
122300 ** Set or clear a flag that indicates that the database file is always well-
122301 ** formed and never corrupt. This flag is clear by default, indicating that
122302 ** database files might have arbitrary corruption. Setting the flag during
122303 ** testing causes certain assert() statements in the code to be activated
122304 ** that demonstrat invariants on well-formed database files.
122305 */
122306 case SQLITE_TESTCTRL_NEVER_CORRUPT: {
122307 sqlite3Config.neverCorrupt = va_arg(ap, int);
122308 break;
122309 }
122310
122311 }
122312 va_end(ap);
122313 #endif /* SQLITE_OMIT_BUILTIN_TEST */
122314 return rc;
122315
+11 -10
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107107
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108108
** [sqlite_version()] and [sqlite_source_id()].
109109
*/
110110
#define SQLITE_VERSION "3.8.2"
111111
#define SQLITE_VERSION_NUMBER 3008002
112
-#define SQLITE_SOURCE_ID "2013-11-27 14:50:51 c75f561f337a56c14335366ed9990e44bc9fc594"
112
+#define SQLITE_SOURCE_ID "2013-12-03 02:52:11 7d99858bec699dface548c77649dfc50e7fb50d8"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
@@ -3778,23 +3778,23 @@
37783778
** <table border="1">
37793779
** <tr><th> Internal<br>Type <th> Requested<br>Type <th> Conversion
37803780
**
37813781
** <tr><td> NULL <td> INTEGER <td> Result is 0
37823782
** <tr><td> NULL <td> FLOAT <td> Result is 0.0
3783
-** <tr><td> NULL <td> TEXT <td> Result is NULL pointer
3784
-** <tr><td> NULL <td> BLOB <td> Result is NULL pointer
3783
+** <tr><td> NULL <td> TEXT <td> Result is a NULL pointer
3784
+** <tr><td> NULL <td> BLOB <td> Result is a NULL pointer
37853785
** <tr><td> INTEGER <td> FLOAT <td> Convert from integer to float
37863786
** <tr><td> INTEGER <td> TEXT <td> ASCII rendering of the integer
37873787
** <tr><td> INTEGER <td> BLOB <td> Same as INTEGER->TEXT
3788
-** <tr><td> FLOAT <td> INTEGER <td> Convert from float to integer
3788
+** <tr><td> FLOAT <td> INTEGER <td> [CAST] to INTEGER
37893789
** <tr><td> FLOAT <td> TEXT <td> ASCII rendering of the float
3790
-** <tr><td> FLOAT <td> BLOB <td> Same as FLOAT->TEXT
3791
-** <tr><td> TEXT <td> INTEGER <td> Use atoi()
3792
-** <tr><td> TEXT <td> FLOAT <td> Use atof()
3790
+** <tr><td> FLOAT <td> BLOB <td> [CAST] to BLOB
3791
+** <tr><td> TEXT <td> INTEGER <td> [CAST] to INTEGER
3792
+** <tr><td> TEXT <td> FLOAT <td> [CAST] to REAL
37933793
** <tr><td> TEXT <td> BLOB <td> No change
3794
-** <tr><td> BLOB <td> INTEGER <td> Convert to TEXT then use atoi()
3795
-** <tr><td> BLOB <td> FLOAT <td> Convert to TEXT then use atof()
3794
+** <tr><td> BLOB <td> INTEGER <td> [CAST] to INTEGER
3795
+** <tr><td> BLOB <td> FLOAT <td> [CAST] to REAL
37963796
** <tr><td> BLOB <td> TEXT <td> Add a zero terminator if needed
37973797
** </table>
37983798
** </blockquote>)^
37993799
**
38003800
** The table above makes reference to standard C library functions atoi()
@@ -6072,11 +6072,12 @@
60726072
#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
60736073
#define SQLITE_TESTCTRL_ISKEYWORD 16
60746074
#define SQLITE_TESTCTRL_SCRATCHMALLOC 17
60756075
#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
60766076
#define SQLITE_TESTCTRL_EXPLAIN_STMT 19
6077
-#define SQLITE_TESTCTRL_LAST 19
6077
+#define SQLITE_TESTCTRL_NEVER_CORRUPT 20
6078
+#define SQLITE_TESTCTRL_LAST 20
60786079
60796080
/*
60806081
** CAPI3REF: SQLite Runtime Status
60816082
**
60826083
** ^This interface is used to retrieve runtime status information
60836084
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.2"
111 #define SQLITE_VERSION_NUMBER 3008002
112 #define SQLITE_SOURCE_ID "2013-11-27 14:50:51 c75f561f337a56c14335366ed9990e44bc9fc594"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
@@ -3778,23 +3778,23 @@
3778 ** <table border="1">
3779 ** <tr><th> Internal<br>Type <th> Requested<br>Type <th> Conversion
3780 **
3781 ** <tr><td> NULL <td> INTEGER <td> Result is 0
3782 ** <tr><td> NULL <td> FLOAT <td> Result is 0.0
3783 ** <tr><td> NULL <td> TEXT <td> Result is NULL pointer
3784 ** <tr><td> NULL <td> BLOB <td> Result is NULL pointer
3785 ** <tr><td> INTEGER <td> FLOAT <td> Convert from integer to float
3786 ** <tr><td> INTEGER <td> TEXT <td> ASCII rendering of the integer
3787 ** <tr><td> INTEGER <td> BLOB <td> Same as INTEGER->TEXT
3788 ** <tr><td> FLOAT <td> INTEGER <td> Convert from float to integer
3789 ** <tr><td> FLOAT <td> TEXT <td> ASCII rendering of the float
3790 ** <tr><td> FLOAT <td> BLOB <td> Same as FLOAT->TEXT
3791 ** <tr><td> TEXT <td> INTEGER <td> Use atoi()
3792 ** <tr><td> TEXT <td> FLOAT <td> Use atof()
3793 ** <tr><td> TEXT <td> BLOB <td> No change
3794 ** <tr><td> BLOB <td> INTEGER <td> Convert to TEXT then use atoi()
3795 ** <tr><td> BLOB <td> FLOAT <td> Convert to TEXT then use atof()
3796 ** <tr><td> BLOB <td> TEXT <td> Add a zero terminator if needed
3797 ** </table>
3798 ** </blockquote>)^
3799 **
3800 ** The table above makes reference to standard C library functions atoi()
@@ -6072,11 +6072,12 @@
6072 #define SQLITE_TESTCTRL_OPTIMIZATIONS 15
6073 #define SQLITE_TESTCTRL_ISKEYWORD 16
6074 #define SQLITE_TESTCTRL_SCRATCHMALLOC 17
6075 #define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
6076 #define SQLITE_TESTCTRL_EXPLAIN_STMT 19
6077 #define SQLITE_TESTCTRL_LAST 19
 
6078
6079 /*
6080 ** CAPI3REF: SQLite Runtime Status
6081 **
6082 ** ^This interface is used to retrieve runtime status information
6083
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.2"
111 #define SQLITE_VERSION_NUMBER 3008002
112 #define SQLITE_SOURCE_ID "2013-12-03 02:52:11 7d99858bec699dface548c77649dfc50e7fb50d8"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
@@ -3778,23 +3778,23 @@
3778 ** <table border="1">
3779 ** <tr><th> Internal<br>Type <th> Requested<br>Type <th> Conversion
3780 **
3781 ** <tr><td> NULL <td> INTEGER <td> Result is 0
3782 ** <tr><td> NULL <td> FLOAT <td> Result is 0.0
3783 ** <tr><td> NULL <td> TEXT <td> Result is a NULL pointer
3784 ** <tr><td> NULL <td> BLOB <td> Result is a NULL pointer
3785 ** <tr><td> INTEGER <td> FLOAT <td> Convert from integer to float
3786 ** <tr><td> INTEGER <td> TEXT <td> ASCII rendering of the integer
3787 ** <tr><td> INTEGER <td> BLOB <td> Same as INTEGER->TEXT
3788 ** <tr><td> FLOAT <td> INTEGER <td> [CAST] to INTEGER
3789 ** <tr><td> FLOAT <td> TEXT <td> ASCII rendering of the float
3790 ** <tr><td> FLOAT <td> BLOB <td> [CAST] to BLOB
3791 ** <tr><td> TEXT <td> INTEGER <td> [CAST] to INTEGER
3792 ** <tr><td> TEXT <td> FLOAT <td> [CAST] to REAL
3793 ** <tr><td> TEXT <td> BLOB <td> No change
3794 ** <tr><td> BLOB <td> INTEGER <td> [CAST] to INTEGER
3795 ** <tr><td> BLOB <td> FLOAT <td> [CAST] to REAL
3796 ** <tr><td> BLOB <td> TEXT <td> Add a zero terminator if needed
3797 ** </table>
3798 ** </blockquote>)^
3799 **
3800 ** The table above makes reference to standard C library functions atoi()
@@ -6072,11 +6072,12 @@
6072 #define SQLITE_TESTCTRL_OPTIMIZATIONS 15
6073 #define SQLITE_TESTCTRL_ISKEYWORD 16
6074 #define SQLITE_TESTCTRL_SCRATCHMALLOC 17
6075 #define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
6076 #define SQLITE_TESTCTRL_EXPLAIN_STMT 19
6077 #define SQLITE_TESTCTRL_NEVER_CORRUPT 20
6078 #define SQLITE_TESTCTRL_LAST 20
6079
6080 /*
6081 ** CAPI3REF: SQLite Runtime Status
6082 **
6083 ** ^This interface is used to retrieve runtime status information
6084

Keyboard Shortcuts

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