Fossil SCM

Update the built-in SQLite to the first 3.33.0 beta.

drh 2020-08-07 20:28 trunk
Commit e83d5bad7ada36277d1846b16995f080b5adb8be304527857a3f78a084ecedb9
3 files changed +28 -13 +65 -13 +1 -1
+28 -13
--- src/shell.c
+++ src/shell.c
@@ -12634,29 +12634,42 @@
1263412634
*/
1263512635
static void exec_prepared_stmt_columnar(
1263612636
ShellState *p, /* Pointer to ShellState */
1263712637
sqlite3_stmt *pStmt /* Statment to run */
1263812638
){
12639
- int nRow = 0;
12639
+ sqlite3_int64 nRow = 0;
1264012640
int nColumn = 0;
1264112641
char **azData = 0;
12642
- char *zMsg = 0;
12642
+ sqlite3_int64 nAlloc = 0;
1264312643
const char *z;
1264412644
int rc;
12645
- int i, j, nTotal, w, n;
12645
+ sqlite3_int64 i, nData;
12646
+ int j, nTotal, w, n;
1264612647
const char *colSep = 0;
1264712648
const char *rowSep = 0;
1264812649
12649
- rc = sqlite3_get_table(p->db, sqlite3_sql(pStmt),
12650
- &azData, &nRow, &nColumn, &zMsg);
12651
- if( rc ){
12652
- utf8_printf(p->out, "ERROR: %s\n", zMsg);
12653
- sqlite3_free(zMsg);
12654
- sqlite3_free_table(azData);
12655
- return;
12656
- }
12657
- if( nRow==0 || nColumn==0 ) goto columnar_end;
12650
+ rc = sqlite3_step(pStmt);
12651
+ if( rc!=SQLITE_ROW ) return;
12652
+ nColumn = sqlite3_column_count(pStmt);
12653
+ nAlloc = nColumn*4;
12654
+ azData = sqlite3_malloc64( nAlloc*sizeof(char*) );
12655
+ if( azData==0 ) shell_out_of_memory();
12656
+ for(i=0; i<nColumn; i++){
12657
+ azData[i] = strdup(sqlite3_column_name(pStmt,i));
12658
+ }
12659
+ do{
12660
+ if( (nRow+2)*nColumn >= nAlloc ){
12661
+ nAlloc *= 2;
12662
+ azData = sqlite3_realloc64(azData, nAlloc*sizeof(char*));
12663
+ if( azData==0 ) shell_out_of_memory();
12664
+ }
12665
+ nRow++;
12666
+ for(i=0; i<nColumn; i++){
12667
+ z = (const char*)sqlite3_column_text(pStmt,i);
12668
+ azData[nRow*nColumn + i] = z ? strdup(z) : 0;
12669
+ }
12670
+ }while( (rc = sqlite3_step(pStmt))==SQLITE_ROW );
1265812671
if( nColumn>p->nWidth ){
1265912672
p->colWidth = realloc(p->colWidth, nColumn*2*sizeof(int));
1266012673
if( p->colWidth==0 ) shell_out_of_memory();
1266112674
for(i=p->nWidth; i<nColumn; i++) p->colWidth[i] = 0;
1266212675
p->nWidth = nColumn;
@@ -12762,11 +12775,13 @@
1276212775
}
1276312776
columnar_end:
1276412777
if( seenInterrupt ){
1276512778
utf8_printf(p->out, "Interrupt\n");
1276612779
}
12767
- sqlite3_free_table(azData);
12780
+ nData = (nRow+1)*nColumn;
12781
+ for(i=0; i<nData; i++) free(azData[i]);
12782
+ sqlite3_free(azData);
1276812783
}
1276912784
1277012785
/*
1277112786
** Run a prepared statement
1277212787
*/
1277312788
--- src/shell.c
+++ src/shell.c
@@ -12634,29 +12634,42 @@
12634 */
12635 static void exec_prepared_stmt_columnar(
12636 ShellState *p, /* Pointer to ShellState */
12637 sqlite3_stmt *pStmt /* Statment to run */
12638 ){
12639 int nRow = 0;
12640 int nColumn = 0;
12641 char **azData = 0;
12642 char *zMsg = 0;
12643 const char *z;
12644 int rc;
12645 int i, j, nTotal, w, n;
 
12646 const char *colSep = 0;
12647 const char *rowSep = 0;
12648
12649 rc = sqlite3_get_table(p->db, sqlite3_sql(pStmt),
12650 &azData, &nRow, &nColumn, &zMsg);
12651 if( rc ){
12652 utf8_printf(p->out, "ERROR: %s\n", zMsg);
12653 sqlite3_free(zMsg);
12654 sqlite3_free_table(azData);
12655 return;
12656 }
12657 if( nRow==0 || nColumn==0 ) goto columnar_end;
 
 
 
 
 
 
 
 
 
 
 
 
12658 if( nColumn>p->nWidth ){
12659 p->colWidth = realloc(p->colWidth, nColumn*2*sizeof(int));
12660 if( p->colWidth==0 ) shell_out_of_memory();
12661 for(i=p->nWidth; i<nColumn; i++) p->colWidth[i] = 0;
12662 p->nWidth = nColumn;
@@ -12762,11 +12775,13 @@
12762 }
12763 columnar_end:
12764 if( seenInterrupt ){
12765 utf8_printf(p->out, "Interrupt\n");
12766 }
12767 sqlite3_free_table(azData);
 
 
12768 }
12769
12770 /*
12771 ** Run a prepared statement
12772 */
12773
--- src/shell.c
+++ src/shell.c
@@ -12634,29 +12634,42 @@
12634 */
12635 static void exec_prepared_stmt_columnar(
12636 ShellState *p, /* Pointer to ShellState */
12637 sqlite3_stmt *pStmt /* Statment to run */
12638 ){
12639 sqlite3_int64 nRow = 0;
12640 int nColumn = 0;
12641 char **azData = 0;
12642 sqlite3_int64 nAlloc = 0;
12643 const char *z;
12644 int rc;
12645 sqlite3_int64 i, nData;
12646 int j, nTotal, w, n;
12647 const char *colSep = 0;
12648 const char *rowSep = 0;
12649
12650 rc = sqlite3_step(pStmt);
12651 if( rc!=SQLITE_ROW ) return;
12652 nColumn = sqlite3_column_count(pStmt);
12653 nAlloc = nColumn*4;
12654 azData = sqlite3_malloc64( nAlloc*sizeof(char*) );
12655 if( azData==0 ) shell_out_of_memory();
12656 for(i=0; i<nColumn; i++){
12657 azData[i] = strdup(sqlite3_column_name(pStmt,i));
12658 }
12659 do{
12660 if( (nRow+2)*nColumn >= nAlloc ){
12661 nAlloc *= 2;
12662 azData = sqlite3_realloc64(azData, nAlloc*sizeof(char*));
12663 if( azData==0 ) shell_out_of_memory();
12664 }
12665 nRow++;
12666 for(i=0; i<nColumn; i++){
12667 z = (const char*)sqlite3_column_text(pStmt,i);
12668 azData[nRow*nColumn + i] = z ? strdup(z) : 0;
12669 }
12670 }while( (rc = sqlite3_step(pStmt))==SQLITE_ROW );
12671 if( nColumn>p->nWidth ){
12672 p->colWidth = realloc(p->colWidth, nColumn*2*sizeof(int));
12673 if( p->colWidth==0 ) shell_out_of_memory();
12674 for(i=p->nWidth; i<nColumn; i++) p->colWidth[i] = 0;
12675 p->nWidth = nColumn;
@@ -12762,11 +12775,13 @@
12775 }
12776 columnar_end:
12777 if( seenInterrupt ){
12778 utf8_printf(p->out, "Interrupt\n");
12779 }
12780 nData = (nRow+1)*nColumn;
12781 for(i=0; i<nData; i++) free(azData[i]);
12782 sqlite3_free(azData);
12783 }
12784
12785 /*
12786 ** Run a prepared statement
12787 */
12788
+65 -13
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
11621162
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11631163
** [sqlite_version()] and [sqlite_source_id()].
11641164
*/
11651165
#define SQLITE_VERSION "3.33.0"
11661166
#define SQLITE_VERSION_NUMBER 3033000
1167
-#define SQLITE_SOURCE_ID "2020-07-30 17:37:49 96e3dba2ed3ab0c5b2ecf65a3408633e0767c884d48c270e9ef10ab9fa3ec051"
1167
+#define SQLITE_SOURCE_ID "2020-08-07 19:52:01 fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcc214"
11681168
11691169
/*
11701170
** CAPI3REF: Run-Time Library Version Numbers
11711171
** KEYWORDS: sqlite3_version sqlite3_sourceid
11721172
**
@@ -60677,11 +60677,38 @@
6067760677
}
6067860678
}
6067960679
pWal->apWiData[iPg] = aShare;
6068060680
nHdr = (iPg==0 ? WALINDEX_HDR_SIZE : 0);
6068160681
nHdr32 = nHdr / sizeof(u32);
60682
+#ifndef SQLITE_SAFER_WALINDEX_RECOVERY
60683
+ /* Memcpy() should work fine here, on all reasonable implementations.
60684
+ ** Technically, memcpy() might change the destination to some
60685
+ ** intermediate value before setting to the final value, and that might
60686
+ ** cause a concurrent reader to malfunction. Memcpy() is allowed to
60687
+ ** do that, according to the spec, but no memcpy() implementation that
60688
+ ** we know of actually does that, which is why we say that memcpy()
60689
+ ** is safe for this. Memcpy() is certainly a lot faster.
60690
+ */
6068260691
memcpy(&aShare[nHdr32], &aPrivate[nHdr32], WALINDEX_PGSZ-nHdr);
60692
+#else
60693
+ /* In the event that some platform is found for which memcpy()
60694
+ ** changes the destination to some intermediate value before
60695
+ ** setting the final value, this alternative copy routine is
60696
+ ** provided.
60697
+ */
60698
+ {
60699
+ int i;
60700
+ for(i=nHdr32; i<WALINDEX_PGSZ/sizeof(u32); i++){
60701
+ if( aShare[i]!=aPrivate[i] ){
60702
+ /* Atomic memory operations are not required here because if
60703
+ ** the value needs to be changed, that means it is not being
60704
+ ** accessed concurrently. */
60705
+ aShare[i] = aPrivate[i];
60706
+ }
60707
+ }
60708
+ }
60709
+#endif
6068360710
if( iFrame<=iLast ) break;
6068460711
}
6068560712
6068660713
sqlite3_free(aFrame);
6068760714
}
@@ -61377,14 +61404,21 @@
6137761404
i64 nReq = ((i64)mxPage * szPage);
6137861405
i64 nSize; /* Current size of database file */
6137961406
sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_START, 0);
6138061407
rc = sqlite3OsFileSize(pWal->pDbFd, &nSize);
6138161408
if( rc==SQLITE_OK && nSize<nReq ){
61382
- sqlite3OsFileControlHint(pWal->pDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq);
61409
+ if( (nSize+(i64)pWal->hdr.mxFrame*szPage)<nReq ){
61410
+ /* If the size of the final database is larger than the current
61411
+ ** database plus the amount of data in the wal file, then there
61412
+ ** must be corruption somewhere. */
61413
+ rc = SQLITE_CORRUPT_BKPT;
61414
+ }else{
61415
+ sqlite3OsFileControlHint(pWal->pDbFd, SQLITE_FCNTL_SIZE_HINT,&nReq);
61416
+ }
6138361417
}
61418
+
6138461419
}
61385
-
6138661420
6138761421
/* Iterate through the contents of the WAL, copying data to the db file */
6138861422
while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){
6138961423
i64 iOffset;
6139061424
assert( walFramePgno(pWal, iFrame)==iDbpage );
@@ -70387,11 +70421,11 @@
7038770421
** shows that the page 'nearby' is somewhere on the free-list, then
7038870422
** the entire-list will be searched for that page.
7038970423
*/
7039070424
#ifndef SQLITE_OMIT_AUTOVACUUM
7039170425
if( eMode==BTALLOC_EXACT ){
70392
- if( ALWAYS(nearby<=mxPage) ){
70426
+ if( nearby<=mxPage ){
7039370427
u8 eType;
7039470428
assert( nearby>0 );
7039570429
assert( pBt->autoVacuum );
7039670430
rc = ptrmapGet(pBt, nearby, &eType, 0);
7039770431
if( rc ) return rc;
@@ -70683,11 +70717,11 @@
7068370717
7068470718
assert( sqlite3_mutex_held(pBt->mutex) );
7068570719
assert( CORRUPT_DB || iPage>1 );
7068670720
assert( !pMemPage || pMemPage->pgno==iPage );
7068770721
70688
- if( iPage<2 || NEVER(iPage>pBt->nPage) ){
70722
+ if( iPage<2 || iPage>pBt->nPage ){
7068970723
return SQLITE_CORRUPT_BKPT;
7069070724
}
7069170725
if( pMemPage ){
7069270726
pPage = pMemPage;
7069370727
sqlite3PagerRef(pPage->pDbPage);
@@ -87556,11 +87590,11 @@
8755687590
p1 = pOp->p1;
8755787591
p2 = pOp->p2;
8755887592
#ifdef SQLITE_DEBUG
8755987593
if( aPermute ){
8756087594
int k, mx = 0;
87561
- for(k=0; k<n; k++) if( aPermute[k]>mx ) mx = aPermute[k];
87595
+ for(k=0; k<n; k++) if( aPermute[k]>(u32)mx ) mx = aPermute[k];
8756287596
assert( p1>0 && p1+mx<=(p->nMem+1 - p->nCursor)+1 );
8756387597
assert( p2>0 && p2+mx<=(p->nMem+1 - p->nCursor)+1 );
8756487598
}else{
8756587599
assert( p1>0 && p1+n<=(p->nMem+1 - p->nCursor)+1 );
8756687600
assert( p2>0 && p2+n<=(p->nMem+1 - p->nCursor)+1 );
@@ -87906,11 +87940,11 @@
8790687940
8790787941
assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) );
8790887942
pDest = &aMem[pOp->p3];
8790987943
memAboutToChange(p, pDest);
8791087944
assert( pC!=0 );
87911
- assert( p2<pC->nField );
87945
+ assert( p2<(u32)pC->nField );
8791287946
aOffset = pC->aOffset;
8791387947
assert( pC->eCurType!=CURTYPE_VTAB );
8791487948
assert( pC->eCurType!=CURTYPE_PSEUDO || pC->nullRow );
8791587949
assert( pC->eCurType!=CURTYPE_SORTER );
8791687950
@@ -89095,11 +89129,11 @@
8909589129
}else{
8909689130
wrFlag = 0;
8909789131
}
8909889132
if( pOp->p5 & OPFLAG_P2ISREG ){
8909989133
assert( p2>0 );
89100
- assert( p2<=(p->nMem+1 - p->nCursor) );
89134
+ assert( p2<=(u32)(p->nMem+1 - p->nCursor) );
8910189135
assert( pOp->opcode==OP_OpenWrite );
8910289136
pIn2 = &aMem[p2];
8910389137
assert( memIsValid(pIn2) );
8910489138
assert( (pIn2->flags & MEM_Int)!=0 );
8910589139
sqlite3VdbeMemIntegerify(pIn2);
@@ -91528,11 +91562,11 @@
9152891562
9152991563
assert( p->bIsReader );
9153091564
nRoot = pOp->p2;
9153191565
aRoot = pOp->p4.ai;
9153291566
assert( nRoot>0 );
91533
- assert( aRoot[0]==nRoot );
91567
+ assert( aRoot[0]==(Pgno)nRoot );
9153491568
assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) );
9153591569
pnErr = &aMem[pOp->p3];
9153691570
assert( (pnErr->flags & MEM_Int)!=0 );
9153791571
assert( (pnErr->flags & (MEM_Str|MEM_Blob))==0 );
9153891572
pIn1 = &aMem[pOp->p1];
@@ -113187,11 +113221,11 @@
113187113221
** erasing iTable (this can happen with an auto-vacuum database).
113188113222
*/
113189113223
static void destroyRootPage(Parse *pParse, int iTable, int iDb){
113190113224
Vdbe *v = sqlite3GetVdbe(pParse);
113191113225
int r1 = sqlite3GetTempReg(pParse);
113192
- if( NEVER(iTable<2) ) return;
113226
+ if( iTable<2 ) sqlite3ErrorMsg(pParse, "corrupt schema");
113193113227
sqlite3VdbeAddOp3(v, OP_Destroy, iTable, r1, iDb);
113194113228
sqlite3MayAbort(pParse);
113195113229
#ifndef SQLITE_OMIT_AUTOVACUUM
113196113230
/* OP_Destroy stores an in integer r1. If this integer
113197113231
** is non-zero, then it is the root page number of a table moved to
@@ -188079,10 +188113,11 @@
188079188113
#endif
188080188114
188081188115
/* #include <string.h> */
188082188116
/* #include <stdio.h> */
188083188117
/* #include <assert.h> */
188118
+/* #include <stdlib.h> */
188084188119
188085188120
/* The following macro is used to suppress compiler warnings.
188086188121
*/
188087188122
#ifndef UNUSED_PARAMETER
188088188123
# define UNUSED_PARAMETER(x) (void)(x)
@@ -188416,10 +188451,27 @@
188416188451
*/
188417188452
#ifndef SQLITE_AMALGAMATION
188418188453
# define testcase(X)
188419188454
#endif
188420188455
188456
+/*
188457
+** Make sure that the compiler intrinsics we desire are enabled when
188458
+** compiling with an appropriate version of MSVC unless prevented by
188459
+** the SQLITE_DISABLE_INTRINSIC define.
188460
+*/
188461
+#if !defined(SQLITE_DISABLE_INTRINSIC)
188462
+# if defined(_MSC_VER) && _MSC_VER>=1400
188463
+# if !defined(_WIN32_WCE)
188464
+/* # include <intrin.h> */
188465
+# pragma intrinsic(_byteswap_ulong)
188466
+# pragma intrinsic(_byteswap_uint64)
188467
+# else
188468
+/* # include <cmnintrin.h> */
188469
+# endif
188470
+# endif
188471
+#endif
188472
+
188421188473
/*
188422188474
** Macros to determine whether the machine is big or little endian,
188423188475
** and whether or not that determination is run-time or compile-time.
188424188476
**
188425188477
** For best performance, an attempt is made to guess at the byte-order
@@ -225640,11 +225692,11 @@
225640225692
int nArg, /* Number of args */
225641225693
sqlite3_value **apUnused /* Function arguments */
225642225694
){
225643225695
assert( nArg==0 );
225644225696
UNUSED_PARAM2(nArg, apUnused);
225645
- sqlite3_result_text(pCtx, "fts5: 2020-07-30 17:37:49 96e3dba2ed3ab0c5b2ecf65a3408633e0767c884d48c270e9ef10ab9fa3ec051", -1, SQLITE_TRANSIENT);
225697
+ sqlite3_result_text(pCtx, "fts5: 2020-08-07 19:52:01 fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcc214", -1, SQLITE_TRANSIENT);
225646225698
}
225647225699
225648225700
/*
225649225701
** Return true if zName is the extension on one of the shadow tables used
225650225702
** by this module.
@@ -230423,12 +230475,12 @@
230423230475
}
230424230476
#endif /* SQLITE_CORE */
230425230477
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
230426230478
230427230479
/************** End of stmt.c ************************************************/
230428
-#if __LINE__!=230428
230480
+#if __LINE__!=230480
230429230481
#undef SQLITE_SOURCE_ID
230430
-#define SQLITE_SOURCE_ID "2020-07-30 17:37:49 96e3dba2ed3ab0c5b2ecf65a3408633e0767c884d48c270e9ef10ab9fa3ealt2"
230482
+#define SQLITE_SOURCE_ID "2020-08-07 19:52:01 fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcalt2"
230431230483
#endif
230432230484
/* Return the source-id for this library */
230433230485
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
230434230486
/************************** End of sqlite3.c ******************************/
230435230487
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.33.0"
1166 #define SQLITE_VERSION_NUMBER 3033000
1167 #define SQLITE_SOURCE_ID "2020-07-30 17:37:49 96e3dba2ed3ab0c5b2ecf65a3408633e0767c884d48c270e9ef10ab9fa3ec051"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -60677,11 +60677,38 @@
60677 }
60678 }
60679 pWal->apWiData[iPg] = aShare;
60680 nHdr = (iPg==0 ? WALINDEX_HDR_SIZE : 0);
60681 nHdr32 = nHdr / sizeof(u32);
 
 
 
 
 
 
 
 
 
60682 memcpy(&aShare[nHdr32], &aPrivate[nHdr32], WALINDEX_PGSZ-nHdr);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60683 if( iFrame<=iLast ) break;
60684 }
60685
60686 sqlite3_free(aFrame);
60687 }
@@ -61377,14 +61404,21 @@
61377 i64 nReq = ((i64)mxPage * szPage);
61378 i64 nSize; /* Current size of database file */
61379 sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_START, 0);
61380 rc = sqlite3OsFileSize(pWal->pDbFd, &nSize);
61381 if( rc==SQLITE_OK && nSize<nReq ){
61382 sqlite3OsFileControlHint(pWal->pDbFd, SQLITE_FCNTL_SIZE_HINT, &nReq);
 
 
 
 
 
 
 
61383 }
 
61384 }
61385
61386
61387 /* Iterate through the contents of the WAL, copying data to the db file */
61388 while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){
61389 i64 iOffset;
61390 assert( walFramePgno(pWal, iFrame)==iDbpage );
@@ -70387,11 +70421,11 @@
70387 ** shows that the page 'nearby' is somewhere on the free-list, then
70388 ** the entire-list will be searched for that page.
70389 */
70390 #ifndef SQLITE_OMIT_AUTOVACUUM
70391 if( eMode==BTALLOC_EXACT ){
70392 if( ALWAYS(nearby<=mxPage) ){
70393 u8 eType;
70394 assert( nearby>0 );
70395 assert( pBt->autoVacuum );
70396 rc = ptrmapGet(pBt, nearby, &eType, 0);
70397 if( rc ) return rc;
@@ -70683,11 +70717,11 @@
70683
70684 assert( sqlite3_mutex_held(pBt->mutex) );
70685 assert( CORRUPT_DB || iPage>1 );
70686 assert( !pMemPage || pMemPage->pgno==iPage );
70687
70688 if( iPage<2 || NEVER(iPage>pBt->nPage) ){
70689 return SQLITE_CORRUPT_BKPT;
70690 }
70691 if( pMemPage ){
70692 pPage = pMemPage;
70693 sqlite3PagerRef(pPage->pDbPage);
@@ -87556,11 +87590,11 @@
87556 p1 = pOp->p1;
87557 p2 = pOp->p2;
87558 #ifdef SQLITE_DEBUG
87559 if( aPermute ){
87560 int k, mx = 0;
87561 for(k=0; k<n; k++) if( aPermute[k]>mx ) mx = aPermute[k];
87562 assert( p1>0 && p1+mx<=(p->nMem+1 - p->nCursor)+1 );
87563 assert( p2>0 && p2+mx<=(p->nMem+1 - p->nCursor)+1 );
87564 }else{
87565 assert( p1>0 && p1+n<=(p->nMem+1 - p->nCursor)+1 );
87566 assert( p2>0 && p2+n<=(p->nMem+1 - p->nCursor)+1 );
@@ -87906,11 +87940,11 @@
87906
87907 assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) );
87908 pDest = &aMem[pOp->p3];
87909 memAboutToChange(p, pDest);
87910 assert( pC!=0 );
87911 assert( p2<pC->nField );
87912 aOffset = pC->aOffset;
87913 assert( pC->eCurType!=CURTYPE_VTAB );
87914 assert( pC->eCurType!=CURTYPE_PSEUDO || pC->nullRow );
87915 assert( pC->eCurType!=CURTYPE_SORTER );
87916
@@ -89095,11 +89129,11 @@
89095 }else{
89096 wrFlag = 0;
89097 }
89098 if( pOp->p5 & OPFLAG_P2ISREG ){
89099 assert( p2>0 );
89100 assert( p2<=(p->nMem+1 - p->nCursor) );
89101 assert( pOp->opcode==OP_OpenWrite );
89102 pIn2 = &aMem[p2];
89103 assert( memIsValid(pIn2) );
89104 assert( (pIn2->flags & MEM_Int)!=0 );
89105 sqlite3VdbeMemIntegerify(pIn2);
@@ -91528,11 +91562,11 @@
91528
91529 assert( p->bIsReader );
91530 nRoot = pOp->p2;
91531 aRoot = pOp->p4.ai;
91532 assert( nRoot>0 );
91533 assert( aRoot[0]==nRoot );
91534 assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) );
91535 pnErr = &aMem[pOp->p3];
91536 assert( (pnErr->flags & MEM_Int)!=0 );
91537 assert( (pnErr->flags & (MEM_Str|MEM_Blob))==0 );
91538 pIn1 = &aMem[pOp->p1];
@@ -113187,11 +113221,11 @@
113187 ** erasing iTable (this can happen with an auto-vacuum database).
113188 */
113189 static void destroyRootPage(Parse *pParse, int iTable, int iDb){
113190 Vdbe *v = sqlite3GetVdbe(pParse);
113191 int r1 = sqlite3GetTempReg(pParse);
113192 if( NEVER(iTable<2) ) return;
113193 sqlite3VdbeAddOp3(v, OP_Destroy, iTable, r1, iDb);
113194 sqlite3MayAbort(pParse);
113195 #ifndef SQLITE_OMIT_AUTOVACUUM
113196 /* OP_Destroy stores an in integer r1. If this integer
113197 ** is non-zero, then it is the root page number of a table moved to
@@ -188079,10 +188113,11 @@
188079 #endif
188080
188081 /* #include <string.h> */
188082 /* #include <stdio.h> */
188083 /* #include <assert.h> */
 
188084
188085 /* The following macro is used to suppress compiler warnings.
188086 */
188087 #ifndef UNUSED_PARAMETER
188088 # define UNUSED_PARAMETER(x) (void)(x)
@@ -188416,10 +188451,27 @@
188416 */
188417 #ifndef SQLITE_AMALGAMATION
188418 # define testcase(X)
188419 #endif
188420
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188421 /*
188422 ** Macros to determine whether the machine is big or little endian,
188423 ** and whether or not that determination is run-time or compile-time.
188424 **
188425 ** For best performance, an attempt is made to guess at the byte-order
@@ -225640,11 +225692,11 @@
225640 int nArg, /* Number of args */
225641 sqlite3_value **apUnused /* Function arguments */
225642 ){
225643 assert( nArg==0 );
225644 UNUSED_PARAM2(nArg, apUnused);
225645 sqlite3_result_text(pCtx, "fts5: 2020-07-30 17:37:49 96e3dba2ed3ab0c5b2ecf65a3408633e0767c884d48c270e9ef10ab9fa3ec051", -1, SQLITE_TRANSIENT);
225646 }
225647
225648 /*
225649 ** Return true if zName is the extension on one of the shadow tables used
225650 ** by this module.
@@ -230423,12 +230475,12 @@
230423 }
230424 #endif /* SQLITE_CORE */
230425 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
230426
230427 /************** End of stmt.c ************************************************/
230428 #if __LINE__!=230428
230429 #undef SQLITE_SOURCE_ID
230430 #define SQLITE_SOURCE_ID "2020-07-30 17:37:49 96e3dba2ed3ab0c5b2ecf65a3408633e0767c884d48c270e9ef10ab9fa3ealt2"
230431 #endif
230432 /* Return the source-id for this library */
230433 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
230434 /************************** End of sqlite3.c ******************************/
230435
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1162,11 +1162,11 @@
1162 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1163 ** [sqlite_version()] and [sqlite_source_id()].
1164 */
1165 #define SQLITE_VERSION "3.33.0"
1166 #define SQLITE_VERSION_NUMBER 3033000
1167 #define SQLITE_SOURCE_ID "2020-08-07 19:52:01 fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcc214"
1168
1169 /*
1170 ** CAPI3REF: Run-Time Library Version Numbers
1171 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1172 **
@@ -60677,11 +60677,38 @@
60677 }
60678 }
60679 pWal->apWiData[iPg] = aShare;
60680 nHdr = (iPg==0 ? WALINDEX_HDR_SIZE : 0);
60681 nHdr32 = nHdr / sizeof(u32);
60682 #ifndef SQLITE_SAFER_WALINDEX_RECOVERY
60683 /* Memcpy() should work fine here, on all reasonable implementations.
60684 ** Technically, memcpy() might change the destination to some
60685 ** intermediate value before setting to the final value, and that might
60686 ** cause a concurrent reader to malfunction. Memcpy() is allowed to
60687 ** do that, according to the spec, but no memcpy() implementation that
60688 ** we know of actually does that, which is why we say that memcpy()
60689 ** is safe for this. Memcpy() is certainly a lot faster.
60690 */
60691 memcpy(&aShare[nHdr32], &aPrivate[nHdr32], WALINDEX_PGSZ-nHdr);
60692 #else
60693 /* In the event that some platform is found for which memcpy()
60694 ** changes the destination to some intermediate value before
60695 ** setting the final value, this alternative copy routine is
60696 ** provided.
60697 */
60698 {
60699 int i;
60700 for(i=nHdr32; i<WALINDEX_PGSZ/sizeof(u32); i++){
60701 if( aShare[i]!=aPrivate[i] ){
60702 /* Atomic memory operations are not required here because if
60703 ** the value needs to be changed, that means it is not being
60704 ** accessed concurrently. */
60705 aShare[i] = aPrivate[i];
60706 }
60707 }
60708 }
60709 #endif
60710 if( iFrame<=iLast ) break;
60711 }
60712
60713 sqlite3_free(aFrame);
60714 }
@@ -61377,14 +61404,21 @@
61404 i64 nReq = ((i64)mxPage * szPage);
61405 i64 nSize; /* Current size of database file */
61406 sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_START, 0);
61407 rc = sqlite3OsFileSize(pWal->pDbFd, &nSize);
61408 if( rc==SQLITE_OK && nSize<nReq ){
61409 if( (nSize+(i64)pWal->hdr.mxFrame*szPage)<nReq ){
61410 /* If the size of the final database is larger than the current
61411 ** database plus the amount of data in the wal file, then there
61412 ** must be corruption somewhere. */
61413 rc = SQLITE_CORRUPT_BKPT;
61414 }else{
61415 sqlite3OsFileControlHint(pWal->pDbFd, SQLITE_FCNTL_SIZE_HINT,&nReq);
61416 }
61417 }
61418
61419 }
 
61420
61421 /* Iterate through the contents of the WAL, copying data to the db file */
61422 while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){
61423 i64 iOffset;
61424 assert( walFramePgno(pWal, iFrame)==iDbpage );
@@ -70387,11 +70421,11 @@
70421 ** shows that the page 'nearby' is somewhere on the free-list, then
70422 ** the entire-list will be searched for that page.
70423 */
70424 #ifndef SQLITE_OMIT_AUTOVACUUM
70425 if( eMode==BTALLOC_EXACT ){
70426 if( nearby<=mxPage ){
70427 u8 eType;
70428 assert( nearby>0 );
70429 assert( pBt->autoVacuum );
70430 rc = ptrmapGet(pBt, nearby, &eType, 0);
70431 if( rc ) return rc;
@@ -70683,11 +70717,11 @@
70717
70718 assert( sqlite3_mutex_held(pBt->mutex) );
70719 assert( CORRUPT_DB || iPage>1 );
70720 assert( !pMemPage || pMemPage->pgno==iPage );
70721
70722 if( iPage<2 || iPage>pBt->nPage ){
70723 return SQLITE_CORRUPT_BKPT;
70724 }
70725 if( pMemPage ){
70726 pPage = pMemPage;
70727 sqlite3PagerRef(pPage->pDbPage);
@@ -87556,11 +87590,11 @@
87590 p1 = pOp->p1;
87591 p2 = pOp->p2;
87592 #ifdef SQLITE_DEBUG
87593 if( aPermute ){
87594 int k, mx = 0;
87595 for(k=0; k<n; k++) if( aPermute[k]>(u32)mx ) mx = aPermute[k];
87596 assert( p1>0 && p1+mx<=(p->nMem+1 - p->nCursor)+1 );
87597 assert( p2>0 && p2+mx<=(p->nMem+1 - p->nCursor)+1 );
87598 }else{
87599 assert( p1>0 && p1+n<=(p->nMem+1 - p->nCursor)+1 );
87600 assert( p2>0 && p2+n<=(p->nMem+1 - p->nCursor)+1 );
@@ -87906,11 +87940,11 @@
87940
87941 assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) );
87942 pDest = &aMem[pOp->p3];
87943 memAboutToChange(p, pDest);
87944 assert( pC!=0 );
87945 assert( p2<(u32)pC->nField );
87946 aOffset = pC->aOffset;
87947 assert( pC->eCurType!=CURTYPE_VTAB );
87948 assert( pC->eCurType!=CURTYPE_PSEUDO || pC->nullRow );
87949 assert( pC->eCurType!=CURTYPE_SORTER );
87950
@@ -89095,11 +89129,11 @@
89129 }else{
89130 wrFlag = 0;
89131 }
89132 if( pOp->p5 & OPFLAG_P2ISREG ){
89133 assert( p2>0 );
89134 assert( p2<=(u32)(p->nMem+1 - p->nCursor) );
89135 assert( pOp->opcode==OP_OpenWrite );
89136 pIn2 = &aMem[p2];
89137 assert( memIsValid(pIn2) );
89138 assert( (pIn2->flags & MEM_Int)!=0 );
89139 sqlite3VdbeMemIntegerify(pIn2);
@@ -91528,11 +91562,11 @@
91562
91563 assert( p->bIsReader );
91564 nRoot = pOp->p2;
91565 aRoot = pOp->p4.ai;
91566 assert( nRoot>0 );
91567 assert( aRoot[0]==(Pgno)nRoot );
91568 assert( pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor) );
91569 pnErr = &aMem[pOp->p3];
91570 assert( (pnErr->flags & MEM_Int)!=0 );
91571 assert( (pnErr->flags & (MEM_Str|MEM_Blob))==0 );
91572 pIn1 = &aMem[pOp->p1];
@@ -113187,11 +113221,11 @@
113221 ** erasing iTable (this can happen with an auto-vacuum database).
113222 */
113223 static void destroyRootPage(Parse *pParse, int iTable, int iDb){
113224 Vdbe *v = sqlite3GetVdbe(pParse);
113225 int r1 = sqlite3GetTempReg(pParse);
113226 if( iTable<2 ) sqlite3ErrorMsg(pParse, "corrupt schema");
113227 sqlite3VdbeAddOp3(v, OP_Destroy, iTable, r1, iDb);
113228 sqlite3MayAbort(pParse);
113229 #ifndef SQLITE_OMIT_AUTOVACUUM
113230 /* OP_Destroy stores an in integer r1. If this integer
113231 ** is non-zero, then it is the root page number of a table moved to
@@ -188079,10 +188113,11 @@
188113 #endif
188114
188115 /* #include <string.h> */
188116 /* #include <stdio.h> */
188117 /* #include <assert.h> */
188118 /* #include <stdlib.h> */
188119
188120 /* The following macro is used to suppress compiler warnings.
188121 */
188122 #ifndef UNUSED_PARAMETER
188123 # define UNUSED_PARAMETER(x) (void)(x)
@@ -188416,10 +188451,27 @@
188451 */
188452 #ifndef SQLITE_AMALGAMATION
188453 # define testcase(X)
188454 #endif
188455
188456 /*
188457 ** Make sure that the compiler intrinsics we desire are enabled when
188458 ** compiling with an appropriate version of MSVC unless prevented by
188459 ** the SQLITE_DISABLE_INTRINSIC define.
188460 */
188461 #if !defined(SQLITE_DISABLE_INTRINSIC)
188462 # if defined(_MSC_VER) && _MSC_VER>=1400
188463 # if !defined(_WIN32_WCE)
188464 /* # include <intrin.h> */
188465 # pragma intrinsic(_byteswap_ulong)
188466 # pragma intrinsic(_byteswap_uint64)
188467 # else
188468 /* # include <cmnintrin.h> */
188469 # endif
188470 # endif
188471 #endif
188472
188473 /*
188474 ** Macros to determine whether the machine is big or little endian,
188475 ** and whether or not that determination is run-time or compile-time.
188476 **
188477 ** For best performance, an attempt is made to guess at the byte-order
@@ -225640,11 +225692,11 @@
225692 int nArg, /* Number of args */
225693 sqlite3_value **apUnused /* Function arguments */
225694 ){
225695 assert( nArg==0 );
225696 UNUSED_PARAM2(nArg, apUnused);
225697 sqlite3_result_text(pCtx, "fts5: 2020-08-07 19:52:01 fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcc214", -1, SQLITE_TRANSIENT);
225698 }
225699
225700 /*
225701 ** Return true if zName is the extension on one of the shadow tables used
225702 ** by this module.
@@ -230423,12 +230475,12 @@
230475 }
230476 #endif /* SQLITE_CORE */
230477 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
230478
230479 /************** End of stmt.c ************************************************/
230480 #if __LINE__!=230480
230481 #undef SQLITE_SOURCE_ID
230482 #define SQLITE_SOURCE_ID "2020-08-07 19:52:01 fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcalt2"
230483 #endif
230484 /* Return the source-id for this library */
230485 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
230486 /************************** End of sqlite3.c ******************************/
230487
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126126
#define SQLITE_VERSION "3.33.0"
127127
#define SQLITE_VERSION_NUMBER 3033000
128
-#define SQLITE_SOURCE_ID "2020-07-30 17:37:49 96e3dba2ed3ab0c5b2ecf65a3408633e0767c884d48c270e9ef10ab9fa3ec051"
128
+#define SQLITE_SOURCE_ID "2020-08-07 19:52:01 fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcc214"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
134134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.33.0"
127 #define SQLITE_VERSION_NUMBER 3033000
128 #define SQLITE_SOURCE_ID "2020-07-30 17:37:49 96e3dba2ed3ab0c5b2ecf65a3408633e0767c884d48c270e9ef10ab9fa3ec051"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.33.0"
127 #define SQLITE_VERSION_NUMBER 3033000
128 #define SQLITE_SOURCE_ID "2020-08-07 19:52:01 fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcc214"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
134

Keyboard Shortcuts

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