Fossil SCM

Update the built-in SQLite to the 3.8.7.1 beta.

drh 2014-10-29 02:08 trunk
Commit 37cfe7ad9891d6dc72b29137c1e7d3bde39c6497
3 files changed +1 -12 +16 -12 +2 -2
+1 -12
--- src/shell.c
+++ src/shell.c
@@ -880,11 +880,11 @@
880880
for(i=0; i<nArg; i++){
881881
output_csv(p, azCol[i] ? azCol[i] : "", i<nArg-1);
882882
}
883883
fprintf(p->out,"%s",p->newline);
884884
}
885
- if( nArg>0 ){
885
+ if( azArg>0 ){
886886
for(i=0; i<nArg; i++){
887887
output_csv(p, azArg[i], i<nArg-1);
888888
}
889889
fprintf(p->out,"%s",p->newline);
890890
}
@@ -1351,21 +1351,10 @@
13511351
}
13521352
sqlite3_finalize(pExplain);
13531353
sqlite3_free(zEQP);
13541354
}
13551355
1356
-#if USE_SYSTEM_SQLITE+0==1
1357
- /* Output TESTCTRL_EXPLAIN text of requested */
1358
- if( pArg && pArg->mode==MODE_Explain && sqlite3_libversion_number()<3008007 ){
1359
- const char *zExplain = 0;
1360
- sqlite3_test_control(SQLITE_TESTCTRL_EXPLAIN_STMT, pStmt, &zExplain);
1361
- if( zExplain && zExplain[0] ){
1362
- fprintf(pArg->out, "%s", zExplain);
1363
- }
1364
- }
1365
-#endif
1366
-
13671356
/* If the shell is currently in ".explain" mode, gather the extra
13681357
** data required to add indents to the output.*/
13691358
if( pArg && pArg->mode==MODE_Explain ){
13701359
explain_data_prepare(pArg, pStmt);
13711360
}
13721361
--- src/shell.c
+++ src/shell.c
@@ -880,11 +880,11 @@
880 for(i=0; i<nArg; i++){
881 output_csv(p, azCol[i] ? azCol[i] : "", i<nArg-1);
882 }
883 fprintf(p->out,"%s",p->newline);
884 }
885 if( nArg>0 ){
886 for(i=0; i<nArg; i++){
887 output_csv(p, azArg[i], i<nArg-1);
888 }
889 fprintf(p->out,"%s",p->newline);
890 }
@@ -1351,21 +1351,10 @@
1351 }
1352 sqlite3_finalize(pExplain);
1353 sqlite3_free(zEQP);
1354 }
1355
1356 #if USE_SYSTEM_SQLITE+0==1
1357 /* Output TESTCTRL_EXPLAIN text of requested */
1358 if( pArg && pArg->mode==MODE_Explain && sqlite3_libversion_number()<3008007 ){
1359 const char *zExplain = 0;
1360 sqlite3_test_control(SQLITE_TESTCTRL_EXPLAIN_STMT, pStmt, &zExplain);
1361 if( zExplain && zExplain[0] ){
1362 fprintf(pArg->out, "%s", zExplain);
1363 }
1364 }
1365 #endif
1366
1367 /* If the shell is currently in ".explain" mode, gather the extra
1368 ** data required to add indents to the output.*/
1369 if( pArg && pArg->mode==MODE_Explain ){
1370 explain_data_prepare(pArg, pStmt);
1371 }
1372
--- src/shell.c
+++ src/shell.c
@@ -880,11 +880,11 @@
880 for(i=0; i<nArg; i++){
881 output_csv(p, azCol[i] ? azCol[i] : "", i<nArg-1);
882 }
883 fprintf(p->out,"%s",p->newline);
884 }
885 if( azArg>0 ){
886 for(i=0; i<nArg; i++){
887 output_csv(p, azArg[i], i<nArg-1);
888 }
889 fprintf(p->out,"%s",p->newline);
890 }
@@ -1351,21 +1351,10 @@
1351 }
1352 sqlite3_finalize(pExplain);
1353 sqlite3_free(zEQP);
1354 }
1355
 
 
 
 
 
 
 
 
 
 
 
1356 /* If the shell is currently in ".explain" mode, gather the extra
1357 ** data required to add indents to the output.*/
1358 if( pArg && pArg->mode==MODE_Explain ){
1359 explain_data_prepare(pArg, pStmt);
1360 }
1361
+16 -12
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** This file is an amalgamation of many separate C source files from SQLite
3
-** version 3.8.7. By combining all the individual C code files into this
3
+** version 3.8.7.1. By combining all the individual C code files into this
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% or more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -229,13 +229,13 @@
229229
**
230230
** See also: [sqlite3_libversion()],
231231
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
232232
** [sqlite_version()] and [sqlite_source_id()].
233233
*/
234
-#define SQLITE_VERSION "3.8.7"
234
+#define SQLITE_VERSION "3.8.7.1"
235235
#define SQLITE_VERSION_NUMBER 3008007
236
-#define SQLITE_SOURCE_ID "2014-10-17 11:24:17 e4ab094f8afce0817f4074e823fabe59fc29ebb4"
236
+#define SQLITE_SOURCE_ID "2014-10-29 01:27:43 83afe23e553e802c0947c80d0ffdd120423e7c52"
237237
238238
/*
239239
** CAPI3REF: Run-Time Library Version Numbers
240240
** KEYWORDS: sqlite3_version, sqlite3_sourceid
241241
**
@@ -20754,15 +20754,11 @@
2075420754
** HAVE_STRCHRNUL. If that routine is not available, this module
2075520755
** will supply its own. The built-in version is slower than
2075620756
** the glibc version so the glibc version is definitely preferred.
2075720757
*/
2075820758
#if !defined(HAVE_STRCHRNUL)
20759
-# if defined(linux)
20760
-# define HAVE_STRCHRNUL 1
20761
-# else
20762
-# define HAVE_STRCHRNUL 0
20763
-# endif
20759
+# define HAVE_STRCHRNUL 0
2076420760
#endif
2076520761
2076620762
2076720763
/*
2076820764
** Conversion types fall into various categories as defined by the
@@ -42804,10 +42800,18 @@
4280442800
}else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){
4280542801
if( pPager->journalOff==0 ){
4280642802
rc = SQLITE_OK;
4280742803
}else{
4280842804
rc = sqlite3OsTruncate(pPager->jfd, 0);
42805
+ if( rc==SQLITE_OK && pPager->fullSync ){
42806
+ /* Make sure the new file size is written into the inode right away.
42807
+ ** Otherwise the journal might resurrect following a power loss and
42808
+ ** cause the last transaction to roll back. See
42809
+ ** https://bugzilla.mozilla.org/show_bug.cgi?id=1072773
42810
+ */
42811
+ rc = sqlite3OsSync(pPager->jfd, pPager->syncFlags);
42812
+ }
4280942813
}
4281042814
pPager->journalOff = 0;
4281142815
}else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST
4281242816
|| (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL)
4281342817
){
@@ -71441,11 +71445,11 @@
7144171445
*/
7144271446
if( pC->nHdrParsed<=p2 ){
7144371447
if( pOp->p4type==P4_MEM ){
7144471448
sqlite3VdbeMemShallowCopy(pDest, pOp->p4.pMem, MEM_Static);
7144571449
}else{
71446
- MemSetTypeFlag(pDest, MEM_Null);
71450
+ sqlite3VdbeMemSetNull(pDest);
7144771451
}
7144871452
goto op_column_out;
7144971453
}
7145071454
}
7145171455
@@ -93755,11 +93759,11 @@
9375593759
if( okOnePass ){
9375693760
/* Just one row. Hence the top-of-loop is a no-op */
9375793761
assert( nKey==nPk ); /* OP_Found will use an unpacked key */
9375893762
assert( !IsVirtual(pTab) );
9375993763
if( aToOpen[iDataCur-iTabCur] ){
93760
- assert( pPk!=0 );
93764
+ assert( pPk!=0 || pTab->pSelect!=0 );
9376193765
sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, addrBypass, iKey, nKey);
9376293766
VdbeCoverage(v);
9376393767
}
9376493768
}else if( pPk ){
9376593769
addrLoop = sqlite3VdbeAddOp1(v, OP_Rewind, iEphCur); VdbeCoverage(v);
@@ -111279,12 +111283,12 @@
111279111283
0, 0);
111280111284
}
111281111285
111282111286
/* Top of the update loop */
111283111287
if( okOnePass ){
111284
- if( aToOpen[iDataCur-iBaseCur] ){
111285
- assert( pPk!=0 );
111288
+ if( aToOpen[iDataCur-iBaseCur] && !isView ){
111289
+ assert( pPk );
111286111290
sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, labelBreak, regKey, nKey);
111287111291
VdbeCoverageNeverTaken(v);
111288111292
}
111289111293
labelContinue = labelBreak;
111290111294
sqlite3VdbeAddOp2(v, OP_IsNull, pPk ? regKey : regOldRowid, labelBreak);
111291111295
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.8.7. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -229,13 +229,13 @@
229 **
230 ** See also: [sqlite3_libversion()],
231 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
232 ** [sqlite_version()] and [sqlite_source_id()].
233 */
234 #define SQLITE_VERSION "3.8.7"
235 #define SQLITE_VERSION_NUMBER 3008007
236 #define SQLITE_SOURCE_ID "2014-10-17 11:24:17 e4ab094f8afce0817f4074e823fabe59fc29ebb4"
237
238 /*
239 ** CAPI3REF: Run-Time Library Version Numbers
240 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
241 **
@@ -20754,15 +20754,11 @@
20754 ** HAVE_STRCHRNUL. If that routine is not available, this module
20755 ** will supply its own. The built-in version is slower than
20756 ** the glibc version so the glibc version is definitely preferred.
20757 */
20758 #if !defined(HAVE_STRCHRNUL)
20759 # if defined(linux)
20760 # define HAVE_STRCHRNUL 1
20761 # else
20762 # define HAVE_STRCHRNUL 0
20763 # endif
20764 #endif
20765
20766
20767 /*
20768 ** Conversion types fall into various categories as defined by the
@@ -42804,10 +42800,18 @@
42804 }else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){
42805 if( pPager->journalOff==0 ){
42806 rc = SQLITE_OK;
42807 }else{
42808 rc = sqlite3OsTruncate(pPager->jfd, 0);
 
 
 
 
 
 
 
 
42809 }
42810 pPager->journalOff = 0;
42811 }else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST
42812 || (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL)
42813 ){
@@ -71441,11 +71445,11 @@
71441 */
71442 if( pC->nHdrParsed<=p2 ){
71443 if( pOp->p4type==P4_MEM ){
71444 sqlite3VdbeMemShallowCopy(pDest, pOp->p4.pMem, MEM_Static);
71445 }else{
71446 MemSetTypeFlag(pDest, MEM_Null);
71447 }
71448 goto op_column_out;
71449 }
71450 }
71451
@@ -93755,11 +93759,11 @@
93755 if( okOnePass ){
93756 /* Just one row. Hence the top-of-loop is a no-op */
93757 assert( nKey==nPk ); /* OP_Found will use an unpacked key */
93758 assert( !IsVirtual(pTab) );
93759 if( aToOpen[iDataCur-iTabCur] ){
93760 assert( pPk!=0 );
93761 sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, addrBypass, iKey, nKey);
93762 VdbeCoverage(v);
93763 }
93764 }else if( pPk ){
93765 addrLoop = sqlite3VdbeAddOp1(v, OP_Rewind, iEphCur); VdbeCoverage(v);
@@ -111279,12 +111283,12 @@
111279 0, 0);
111280 }
111281
111282 /* Top of the update loop */
111283 if( okOnePass ){
111284 if( aToOpen[iDataCur-iBaseCur] ){
111285 assert( pPk!=0 );
111286 sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, labelBreak, regKey, nKey);
111287 VdbeCoverageNeverTaken(v);
111288 }
111289 labelContinue = labelBreak;
111290 sqlite3VdbeAddOp2(v, OP_IsNull, pPk ? regKey : regOldRowid, labelBreak);
111291
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
1 /******************************************************************************
2 ** This file is an amalgamation of many separate C source files from SQLite
3 ** version 3.8.7.1. By combining all the individual C code files into this
4 ** single large file, the entire code can be compiled as a single translation
5 ** unit. This allows many compilers to do optimizations that would not be
6 ** possible if the files were compiled separately. Performance improvements
7 ** of 5% or more are commonly seen when SQLite is compiled as a single
8 ** translation unit.
@@ -229,13 +229,13 @@
229 **
230 ** See also: [sqlite3_libversion()],
231 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
232 ** [sqlite_version()] and [sqlite_source_id()].
233 */
234 #define SQLITE_VERSION "3.8.7.1"
235 #define SQLITE_VERSION_NUMBER 3008007
236 #define SQLITE_SOURCE_ID "2014-10-29 01:27:43 83afe23e553e802c0947c80d0ffdd120423e7c52"
237
238 /*
239 ** CAPI3REF: Run-Time Library Version Numbers
240 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
241 **
@@ -20754,15 +20754,11 @@
20754 ** HAVE_STRCHRNUL. If that routine is not available, this module
20755 ** will supply its own. The built-in version is slower than
20756 ** the glibc version so the glibc version is definitely preferred.
20757 */
20758 #if !defined(HAVE_STRCHRNUL)
20759 # define HAVE_STRCHRNUL 0
 
 
 
 
20760 #endif
20761
20762
20763 /*
20764 ** Conversion types fall into various categories as defined by the
@@ -42804,10 +42800,18 @@
42800 }else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){
42801 if( pPager->journalOff==0 ){
42802 rc = SQLITE_OK;
42803 }else{
42804 rc = sqlite3OsTruncate(pPager->jfd, 0);
42805 if( rc==SQLITE_OK && pPager->fullSync ){
42806 /* Make sure the new file size is written into the inode right away.
42807 ** Otherwise the journal might resurrect following a power loss and
42808 ** cause the last transaction to roll back. See
42809 ** https://bugzilla.mozilla.org/show_bug.cgi?id=1072773
42810 */
42811 rc = sqlite3OsSync(pPager->jfd, pPager->syncFlags);
42812 }
42813 }
42814 pPager->journalOff = 0;
42815 }else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST
42816 || (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL)
42817 ){
@@ -71441,11 +71445,11 @@
71445 */
71446 if( pC->nHdrParsed<=p2 ){
71447 if( pOp->p4type==P4_MEM ){
71448 sqlite3VdbeMemShallowCopy(pDest, pOp->p4.pMem, MEM_Static);
71449 }else{
71450 sqlite3VdbeMemSetNull(pDest);
71451 }
71452 goto op_column_out;
71453 }
71454 }
71455
@@ -93755,11 +93759,11 @@
93759 if( okOnePass ){
93760 /* Just one row. Hence the top-of-loop is a no-op */
93761 assert( nKey==nPk ); /* OP_Found will use an unpacked key */
93762 assert( !IsVirtual(pTab) );
93763 if( aToOpen[iDataCur-iTabCur] ){
93764 assert( pPk!=0 || pTab->pSelect!=0 );
93765 sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, addrBypass, iKey, nKey);
93766 VdbeCoverage(v);
93767 }
93768 }else if( pPk ){
93769 addrLoop = sqlite3VdbeAddOp1(v, OP_Rewind, iEphCur); VdbeCoverage(v);
@@ -111279,12 +111283,12 @@
111283 0, 0);
111284 }
111285
111286 /* Top of the update loop */
111287 if( okOnePass ){
111288 if( aToOpen[iDataCur-iBaseCur] && !isView ){
111289 assert( pPk );
111290 sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, labelBreak, regKey, nKey);
111291 VdbeCoverageNeverTaken(v);
111292 }
111293 labelContinue = labelBreak;
111294 sqlite3VdbeAddOp2(v, OP_IsNull, pPk ? regKey : regOldRowid, labelBreak);
111295
+2 -2
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -105,13 +105,13 @@
105105
**
106106
** See also: [sqlite3_libversion()],
107107
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108108
** [sqlite_version()] and [sqlite_source_id()].
109109
*/
110
-#define SQLITE_VERSION "3.8.7"
110
+#define SQLITE_VERSION "3.8.7.1"
111111
#define SQLITE_VERSION_NUMBER 3008007
112
-#define SQLITE_SOURCE_ID "2014-10-17 11:24:17 e4ab094f8afce0817f4074e823fabe59fc29ebb4"
112
+#define SQLITE_SOURCE_ID "2014-10-29 01:27:43 83afe23e553e802c0947c80d0ffdd120423e7c52"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
118118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -105,13 +105,13 @@
105 **
106 ** See also: [sqlite3_libversion()],
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.7"
111 #define SQLITE_VERSION_NUMBER 3008007
112 #define SQLITE_SOURCE_ID "2014-10-17 11:24:17 e4ab094f8afce0817f4074e823fabe59fc29ebb4"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -105,13 +105,13 @@
105 **
106 ** See also: [sqlite3_libversion()],
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.7.1"
111 #define SQLITE_VERSION_NUMBER 3008007
112 #define SQLITE_SOURCE_ID "2014-10-29 01:27:43 83afe23e553e802c0947c80d0ffdd120423e7c52"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118

Keyboard Shortcuts

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