Fossil SCM

Update the built-in SQLite to the 3.16.0 beta for testing.

drh 2016-12-30 00:15 trunk
Commit 53430370a5ab295040309216ff763bb9f2defcfd
3 files changed +2 -2 +17 -7 +1 -1
+2 -2
--- src/shell.c
+++ src/shell.c
@@ -3290,11 +3290,11 @@
32903290
const char *zParent;
32913291
const char *zParentCol;
32923292
const char *zParentSeq;
32933293
const char *zChild;
32943294
const char *zChildCol;
3295
- const char *zChildSeq;
3295
+ const char *zChildSeq = 0; /* Initialize to avoid false-positive warning */
32963296
int rc;
32973297
32983298
assert( nVal==4 );
32993299
zParent = (const char*)sqlite3_value_text(apVal[0]);
33003300
zParentCol = (const char*)sqlite3_value_text(apVal[1]);
@@ -3498,11 +3498,11 @@
34983498
ShellState *pState, /* Current shell tool state */
34993499
char **azArg, /* Array of arguments passed to dot command */
35003500
int nArg /* Number of entries in azArg[] */
35013501
){
35023502
int n;
3503
- n = (nArg>=2 ? strlen(azArg[1]) : 0);
3503
+ n = (nArg>=2 ? (int)strlen(azArg[1]) : 0);
35043504
if( n<1 || sqlite3_strnicmp(azArg[1], "fkey-indexes", n) ) goto usage;
35053505
return lintFkeyIndexes(pState, azArg, nArg);
35063506
35073507
usage:
35083508
raw_printf(stderr, "Usage %s sub-command ?switches...?\n", azArg[0]);
35093509
--- src/shell.c
+++ src/shell.c
@@ -3290,11 +3290,11 @@
3290 const char *zParent;
3291 const char *zParentCol;
3292 const char *zParentSeq;
3293 const char *zChild;
3294 const char *zChildCol;
3295 const char *zChildSeq;
3296 int rc;
3297
3298 assert( nVal==4 );
3299 zParent = (const char*)sqlite3_value_text(apVal[0]);
3300 zParentCol = (const char*)sqlite3_value_text(apVal[1]);
@@ -3498,11 +3498,11 @@
3498 ShellState *pState, /* Current shell tool state */
3499 char **azArg, /* Array of arguments passed to dot command */
3500 int nArg /* Number of entries in azArg[] */
3501 ){
3502 int n;
3503 n = (nArg>=2 ? strlen(azArg[1]) : 0);
3504 if( n<1 || sqlite3_strnicmp(azArg[1], "fkey-indexes", n) ) goto usage;
3505 return lintFkeyIndexes(pState, azArg, nArg);
3506
3507 usage:
3508 raw_printf(stderr, "Usage %s sub-command ?switches...?\n", azArg[0]);
3509
--- src/shell.c
+++ src/shell.c
@@ -3290,11 +3290,11 @@
3290 const char *zParent;
3291 const char *zParentCol;
3292 const char *zParentSeq;
3293 const char *zChild;
3294 const char *zChildCol;
3295 const char *zChildSeq = 0; /* Initialize to avoid false-positive warning */
3296 int rc;
3297
3298 assert( nVal==4 );
3299 zParent = (const char*)sqlite3_value_text(apVal[0]);
3300 zParentCol = (const char*)sqlite3_value_text(apVal[1]);
@@ -3498,11 +3498,11 @@
3498 ShellState *pState, /* Current shell tool state */
3499 char **azArg, /* Array of arguments passed to dot command */
3500 int nArg /* Number of entries in azArg[] */
3501 ){
3502 int n;
3503 n = (nArg>=2 ? (int)strlen(azArg[1]) : 0);
3504 if( n<1 || sqlite3_strnicmp(azArg[1], "fkey-indexes", n) ) goto usage;
3505 return lintFkeyIndexes(pState, azArg, nArg);
3506
3507 usage:
3508 raw_printf(stderr, "Usage %s sub-command ?switches...?\n", azArg[0]);
3509
+17 -7
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -381,11 +381,11 @@
381381
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
382382
** [sqlite_version()] and [sqlite_source_id()].
383383
*/
384384
#define SQLITE_VERSION "3.16.0"
385385
#define SQLITE_VERSION_NUMBER 3016000
386
-#define SQLITE_SOURCE_ID "2016-12-26 12:25:19 edc9db41f3ee200ba44579a46ed8331bbbbf539e"
386
+#define SQLITE_SOURCE_ID "2016-12-30 00:09:14 f57952bac652901e1bd48b68301941efbcf29dc4"
387387
388388
/*
389389
** CAPI3REF: Run-Time Library Version Numbers
390390
** KEYWORDS: sqlite3_version sqlite3_sourceid
391391
**
@@ -19064,17 +19064,26 @@
1906419064
return 0;
1906519065
}
1906619066
return 1;
1906719067
}
1906819068
19069
+/* The julian day number for 9999-12-31 23:59:59.999 is 5373484.4999999.
19070
+** Multiplying this by 86400000 gives 464269060799999 as the maximum value
19071
+** for DateTime.iJD.
19072
+**
19073
+** But some older compilers (ex: gcc 4.2.1 on older Macs) cannot deal with
19074
+** such a large integer literal, so we have to encode it.
19075
+*/
19076
+#define INT_464269060799999 ((((i64)0x1a640)<<32)|0x1072fdff)
19077
+
1906919078
/*
1907019079
** Return TRUE if the given julian day number is within range.
1907119080
**
1907219081
** The input is the JulianDay times 86400000.
1907319082
*/
1907419083
static int validJulianDay(sqlite3_int64 iJD){
19075
- return iJD>=0 && iJD<=464269060799999;
19084
+ return iJD>=0 && iJD<=INT_464269060799999;
1907619085
}
1907719086
1907819087
/*
1907919088
** Compute the Year, Month, and Day from the julian day number.
1908019089
*/
@@ -24570,11 +24579,11 @@
2457024579
pNew = pOld;
2457124580
}else if( sqlite3GlobalConfig.bMemstat ){
2457224581
sqlite3_mutex_enter(mem0.mutex);
2457324582
sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes);
2457424583
nDiff = nNew - nOld;
24575
- if( sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >=
24584
+ if( nDiff>0 && sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >=
2457624585
mem0.alarmThreshold-nDiff ){
2457724586
sqlite3MallocAlarm(nDiff);
2457824587
}
2457924588
pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
2458024589
if( pNew==0 && mem0.alarmThreshold>0 ){
@@ -78764,11 +78773,11 @@
7876478773
break;
7876578774
}
7876678775
p->rc = pOp->p1;
7876778776
p->errorAction = (u8)pOp->p2;
7876878777
p->pc = pcx;
78769
- assert( pOp->p5>=0 && pOp->p5<=4 );
78778
+ assert( pOp->p5<=4 );
7877078779
if( p->rc ){
7877178780
if( pOp->p5 ){
7877278781
static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK",
7877378782
"FOREIGN KEY" };
7877478783
testcase( pOp->p5==1 );
@@ -81570,11 +81579,12 @@
8157081579
pC->seekOp = pOp->opcode;
8157181580
#endif
8157281581
8157381582
if( pC->isTable ){
8157481583
/* The BTREE_SEEK_EQ flag is only set on index cursors */
81575
- assert( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ)==0 );
81584
+ assert( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ)==0
81585
+ || CORRUPT_DB );
8157681586
8157781587
/* The input value in P3 might be of any type: integer, real, string,
8157881588
** blob, or NULL. But it needs to be an integer before we can do
8157981589
** the seek, so convert it. */
8158081590
pIn3 = &aMem[pOp->p3];
@@ -140448,11 +140458,11 @@
140448140458
/*
140449140459
** Cause any pending operation to stop at its earliest opportunity.
140450140460
*/
140451140461
SQLITE_API void sqlite3_interrupt(sqlite3 *db){
140452140462
#ifdef SQLITE_ENABLE_API_ARMOR
140453
- if( !sqlite3SafetyCheckOk(db) ){
140463
+ if( !sqlite3SafetyCheckOk(db) && (db==0 || db->magic!=SQLITE_MAGIC_ZOMBIE) ){
140454140464
(void)SQLITE_MISUSE_BKPT;
140455140465
return;
140456140466
}
140457140467
#endif
140458140468
db->u1.isInterrupted = 1;
@@ -196750,11 +196760,11 @@
196750196760
int nArg, /* Number of args */
196751196761
sqlite3_value **apUnused /* Function arguments */
196752196762
){
196753196763
assert( nArg==0 );
196754196764
UNUSED_PARAM2(nArg, apUnused);
196755
- sqlite3_result_text(pCtx, "fts5: 2016-12-23 16:05:22 2940661b8c014b94973e05c44f1b1f4f443dbdd3", -1, SQLITE_TRANSIENT);
196765
+ sqlite3_result_text(pCtx, "fts5: 2016-12-29 19:48:46 afcdc4a60e357d171156e0de705bf7ad1b37daab", -1, SQLITE_TRANSIENT);
196756196766
}
196757196767
196758196768
static int fts5Init(sqlite3 *db){
196759196769
static const sqlite3_module fts5Mod = {
196760196770
/* iVersion */ 2,
196761196771
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -381,11 +381,11 @@
381 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
382 ** [sqlite_version()] and [sqlite_source_id()].
383 */
384 #define SQLITE_VERSION "3.16.0"
385 #define SQLITE_VERSION_NUMBER 3016000
386 #define SQLITE_SOURCE_ID "2016-12-26 12:25:19 edc9db41f3ee200ba44579a46ed8331bbbbf539e"
387
388 /*
389 ** CAPI3REF: Run-Time Library Version Numbers
390 ** KEYWORDS: sqlite3_version sqlite3_sourceid
391 **
@@ -19064,17 +19064,26 @@
19064 return 0;
19065 }
19066 return 1;
19067 }
19068
 
 
 
 
 
 
 
 
 
19069 /*
19070 ** Return TRUE if the given julian day number is within range.
19071 **
19072 ** The input is the JulianDay times 86400000.
19073 */
19074 static int validJulianDay(sqlite3_int64 iJD){
19075 return iJD>=0 && iJD<=464269060799999;
19076 }
19077
19078 /*
19079 ** Compute the Year, Month, and Day from the julian day number.
19080 */
@@ -24570,11 +24579,11 @@
24570 pNew = pOld;
24571 }else if( sqlite3GlobalConfig.bMemstat ){
24572 sqlite3_mutex_enter(mem0.mutex);
24573 sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes);
24574 nDiff = nNew - nOld;
24575 if( sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >=
24576 mem0.alarmThreshold-nDiff ){
24577 sqlite3MallocAlarm(nDiff);
24578 }
24579 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
24580 if( pNew==0 && mem0.alarmThreshold>0 ){
@@ -78764,11 +78773,11 @@
78764 break;
78765 }
78766 p->rc = pOp->p1;
78767 p->errorAction = (u8)pOp->p2;
78768 p->pc = pcx;
78769 assert( pOp->p5>=0 && pOp->p5<=4 );
78770 if( p->rc ){
78771 if( pOp->p5 ){
78772 static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK",
78773 "FOREIGN KEY" };
78774 testcase( pOp->p5==1 );
@@ -81570,11 +81579,12 @@
81570 pC->seekOp = pOp->opcode;
81571 #endif
81572
81573 if( pC->isTable ){
81574 /* The BTREE_SEEK_EQ flag is only set on index cursors */
81575 assert( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ)==0 );
 
81576
81577 /* The input value in P3 might be of any type: integer, real, string,
81578 ** blob, or NULL. But it needs to be an integer before we can do
81579 ** the seek, so convert it. */
81580 pIn3 = &aMem[pOp->p3];
@@ -140448,11 +140458,11 @@
140448 /*
140449 ** Cause any pending operation to stop at its earliest opportunity.
140450 */
140451 SQLITE_API void sqlite3_interrupt(sqlite3 *db){
140452 #ifdef SQLITE_ENABLE_API_ARMOR
140453 if( !sqlite3SafetyCheckOk(db) ){
140454 (void)SQLITE_MISUSE_BKPT;
140455 return;
140456 }
140457 #endif
140458 db->u1.isInterrupted = 1;
@@ -196750,11 +196760,11 @@
196750 int nArg, /* Number of args */
196751 sqlite3_value **apUnused /* Function arguments */
196752 ){
196753 assert( nArg==0 );
196754 UNUSED_PARAM2(nArg, apUnused);
196755 sqlite3_result_text(pCtx, "fts5: 2016-12-23 16:05:22 2940661b8c014b94973e05c44f1b1f4f443dbdd3", -1, SQLITE_TRANSIENT);
196756 }
196757
196758 static int fts5Init(sqlite3 *db){
196759 static const sqlite3_module fts5Mod = {
196760 /* iVersion */ 2,
196761
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -381,11 +381,11 @@
381 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
382 ** [sqlite_version()] and [sqlite_source_id()].
383 */
384 #define SQLITE_VERSION "3.16.0"
385 #define SQLITE_VERSION_NUMBER 3016000
386 #define SQLITE_SOURCE_ID "2016-12-30 00:09:14 f57952bac652901e1bd48b68301941efbcf29dc4"
387
388 /*
389 ** CAPI3REF: Run-Time Library Version Numbers
390 ** KEYWORDS: sqlite3_version sqlite3_sourceid
391 **
@@ -19064,17 +19064,26 @@
19064 return 0;
19065 }
19066 return 1;
19067 }
19068
19069 /* The julian day number for 9999-12-31 23:59:59.999 is 5373484.4999999.
19070 ** Multiplying this by 86400000 gives 464269060799999 as the maximum value
19071 ** for DateTime.iJD.
19072 **
19073 ** But some older compilers (ex: gcc 4.2.1 on older Macs) cannot deal with
19074 ** such a large integer literal, so we have to encode it.
19075 */
19076 #define INT_464269060799999 ((((i64)0x1a640)<<32)|0x1072fdff)
19077
19078 /*
19079 ** Return TRUE if the given julian day number is within range.
19080 **
19081 ** The input is the JulianDay times 86400000.
19082 */
19083 static int validJulianDay(sqlite3_int64 iJD){
19084 return iJD>=0 && iJD<=INT_464269060799999;
19085 }
19086
19087 /*
19088 ** Compute the Year, Month, and Day from the julian day number.
19089 */
@@ -24570,11 +24579,11 @@
24579 pNew = pOld;
24580 }else if( sqlite3GlobalConfig.bMemstat ){
24581 sqlite3_mutex_enter(mem0.mutex);
24582 sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes);
24583 nDiff = nNew - nOld;
24584 if( nDiff>0 && sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >=
24585 mem0.alarmThreshold-nDiff ){
24586 sqlite3MallocAlarm(nDiff);
24587 }
24588 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
24589 if( pNew==0 && mem0.alarmThreshold>0 ){
@@ -78764,11 +78773,11 @@
78773 break;
78774 }
78775 p->rc = pOp->p1;
78776 p->errorAction = (u8)pOp->p2;
78777 p->pc = pcx;
78778 assert( pOp->p5<=4 );
78779 if( p->rc ){
78780 if( pOp->p5 ){
78781 static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK",
78782 "FOREIGN KEY" };
78783 testcase( pOp->p5==1 );
@@ -81570,11 +81579,12 @@
81579 pC->seekOp = pOp->opcode;
81580 #endif
81581
81582 if( pC->isTable ){
81583 /* The BTREE_SEEK_EQ flag is only set on index cursors */
81584 assert( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ)==0
81585 || CORRUPT_DB );
81586
81587 /* The input value in P3 might be of any type: integer, real, string,
81588 ** blob, or NULL. But it needs to be an integer before we can do
81589 ** the seek, so convert it. */
81590 pIn3 = &aMem[pOp->p3];
@@ -140448,11 +140458,11 @@
140458 /*
140459 ** Cause any pending operation to stop at its earliest opportunity.
140460 */
140461 SQLITE_API void sqlite3_interrupt(sqlite3 *db){
140462 #ifdef SQLITE_ENABLE_API_ARMOR
140463 if( !sqlite3SafetyCheckOk(db) && (db==0 || db->magic!=SQLITE_MAGIC_ZOMBIE) ){
140464 (void)SQLITE_MISUSE_BKPT;
140465 return;
140466 }
140467 #endif
140468 db->u1.isInterrupted = 1;
@@ -196750,11 +196760,11 @@
196760 int nArg, /* Number of args */
196761 sqlite3_value **apUnused /* Function arguments */
196762 ){
196763 assert( nArg==0 );
196764 UNUSED_PARAM2(nArg, apUnused);
196765 sqlite3_result_text(pCtx, "fts5: 2016-12-29 19:48:46 afcdc4a60e357d171156e0de705bf7ad1b37daab", -1, SQLITE_TRANSIENT);
196766 }
196767
196768 static int fts5Init(sqlite3 *db){
196769 static const sqlite3_module fts5Mod = {
196770 /* iVersion */ 2,
196771
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,11 +121,11 @@
121121
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
122122
** [sqlite_version()] and [sqlite_source_id()].
123123
*/
124124
#define SQLITE_VERSION "3.16.0"
125125
#define SQLITE_VERSION_NUMBER 3016000
126
-#define SQLITE_SOURCE_ID "2016-12-26 12:25:19 edc9db41f3ee200ba44579a46ed8331bbbbf539e"
126
+#define SQLITE_SOURCE_ID "2016-12-30 00:09:14 f57952bac652901e1bd48b68301941efbcf29dc4"
127127
128128
/*
129129
** CAPI3REF: Run-Time Library Version Numbers
130130
** KEYWORDS: sqlite3_version sqlite3_sourceid
131131
**
132132
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,11 +121,11 @@
121 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
122 ** [sqlite_version()] and [sqlite_source_id()].
123 */
124 #define SQLITE_VERSION "3.16.0"
125 #define SQLITE_VERSION_NUMBER 3016000
126 #define SQLITE_SOURCE_ID "2016-12-26 12:25:19 edc9db41f3ee200ba44579a46ed8331bbbbf539e"
127
128 /*
129 ** CAPI3REF: Run-Time Library Version Numbers
130 ** KEYWORDS: sqlite3_version sqlite3_sourceid
131 **
132
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -121,11 +121,11 @@
121 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
122 ** [sqlite_version()] and [sqlite_source_id()].
123 */
124 #define SQLITE_VERSION "3.16.0"
125 #define SQLITE_VERSION_NUMBER 3016000
126 #define SQLITE_SOURCE_ID "2016-12-30 00:09:14 f57952bac652901e1bd48b68301941efbcf29dc4"
127
128 /*
129 ** CAPI3REF: Run-Time Library Version Numbers
130 ** KEYWORDS: sqlite3_version sqlite3_sourceid
131 **
132

Keyboard Shortcuts

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