Skip to content

Commit 7b69f52

Browse files
committed
Snapshot of upstream SQLite 3.45.3
1 parent 0eb6029 commit 7b69f52

43 files changed

Lines changed: 514 additions & 148 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.45.2
1+
3.45.3

autoconf/tea/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
1919
# so that we create the export library with the dll.
2020
#-----------------------------------------------------------------------
2121

22-
AC_INIT([sqlite],[3.45.2])
22+
AC_INIT([sqlite],[3.45.3])
2323

2424
#--------------------------------------------------------------------
2525
# Call TEA_INIT as the first TEA_ macro to set up initial vars.

configure

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for sqlite 3.45.2.
3+
# Generated by GNU Autoconf 2.69 for sqlite 3.45.3.
44
#
55
#
66
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@ MAKEFLAGS=
726726
# Identity of this package.
727727
PACKAGE_NAME='sqlite'
728728
PACKAGE_TARNAME='sqlite'
729-
PACKAGE_VERSION='3.45.2'
730-
PACKAGE_STRING='sqlite 3.45.2'
729+
PACKAGE_VERSION='3.45.3'
730+
PACKAGE_STRING='sqlite 3.45.3'
731731
PACKAGE_BUGREPORT=''
732732
PACKAGE_URL=''
733733

@@ -1472,7 +1472,7 @@ if test "$ac_init_help" = "long"; then
14721472
# Omit some internal or obsolete options to make the list less imposing.
14731473
# This message is too long to be a string in the A/UX 3.1 sh.
14741474
cat <<_ACEOF
1475-
\`configure' configures sqlite 3.45.2 to adapt to many kinds of systems.
1475+
\`configure' configures sqlite 3.45.3 to adapt to many kinds of systems.
14761476
14771477
Usage: $0 [OPTION]... [VAR=VALUE]...
14781478
@@ -1537,7 +1537,7 @@ fi
15371537

15381538
if test -n "$ac_init_help"; then
15391539
case $ac_init_help in
1540-
short | recursive ) echo "Configuration of sqlite 3.45.2:";;
1540+
short | recursive ) echo "Configuration of sqlite 3.45.3:";;
15411541
esac
15421542
cat <<\_ACEOF
15431543
@@ -1668,7 +1668,7 @@ fi
16681668
test -n "$ac_init_help" && exit $ac_status
16691669
if $ac_init_version; then
16701670
cat <<\_ACEOF
1671-
sqlite configure 3.45.2
1671+
sqlite configure 3.45.3
16721672
generated by GNU Autoconf 2.69
16731673
16741674
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2087,7 +2087,7 @@ cat >config.log <<_ACEOF
20872087
This file contains any messages produced by compilers while
20882088
running configure, to aid debugging if configure makes a mistake.
20892089
2090-
It was created by sqlite $as_me 3.45.2, which was
2090+
It was created by sqlite $as_me 3.45.3, which was
20912091
generated by GNU Autoconf 2.69. Invocation command line was
20922092
20932093
$ $0 $@
@@ -12481,7 +12481,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1248112481
# report actual input values of CONFIG_FILES etc. instead of their
1248212482
# values after options handling.
1248312483
ac_log="
12484-
This file was extended by sqlite $as_me 3.45.2, which was
12484+
This file was extended by sqlite $as_me 3.45.3, which was
1248512485
generated by GNU Autoconf 2.69. Invocation command line was
1248612486
1248712487
CONFIG_FILES = $CONFIG_FILES
@@ -12547,7 +12547,7 @@ _ACEOF
1254712547
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1254812548
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1254912549
ac_cs_version="\\
12550-
sqlite config.status 3.45.2
12550+
sqlite config.status 3.45.3
1255112551
configured by $0, generated by GNU Autoconf 2.69,
1255212552
with options \\"\$ac_cs_config\\"
1255312553

ext/recover/dbdata.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,15 @@ static void dbdataValue(
494494
}
495495
}
496496

497+
/* This macro is a copy of the MX_CELL() macro in the SQLite core. Given
498+
** a page-size, it returns the maximum number of cells that may be present
499+
** on the page. */
500+
#define DBDATA_MX_CELL(pgsz) ((pgsz-8)/6)
501+
502+
/* Maximum number of fields that may appear in a single record. This is
503+
** the "hard-limit", according to comments in sqliteLimit.h. */
504+
#define DBDATA_MX_FIELD 32676
505+
497506
/*
498507
** Move an sqlite_dbdata or sqlite_dbptr cursor to the next entry.
499508
*/
@@ -522,6 +531,9 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
522531
assert( iOff+3+2<=pCsr->nPage );
523532
pCsr->iCell = pTab->bPtr ? -2 : 0;
524533
pCsr->nCell = get_uint16(&pCsr->aPage[iOff+3]);
534+
if( pCsr->nCell>DBDATA_MX_CELL(pCsr->nPage) ){
535+
pCsr->nCell = DBDATA_MX_CELL(pCsr->nPage);
536+
}
525537
}
526538

527539
if( pTab->bPtr ){
@@ -566,19 +578,19 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
566578
if( pCsr->iCell>=pCsr->nCell ){
567579
bNextPage = 1;
568580
}else{
581+
int iCellPtr = iOff + 8 + nPointer + pCsr->iCell*2;
569582

570-
iOff += 8 + nPointer + pCsr->iCell*2;
571-
if( iOff>pCsr->nPage ){
583+
if( iCellPtr>pCsr->nPage ){
572584
bNextPage = 1;
573585
}else{
574-
iOff = get_uint16(&pCsr->aPage[iOff]);
586+
iOff = get_uint16(&pCsr->aPage[iCellPtr]);
575587
}
576588

577589
/* For an interior node cell, skip past the child-page number */
578590
iOff += nPointer;
579591

580592
/* Load the "byte of payload including overflow" field */
581-
if( bNextPage || iOff>pCsr->nPage ){
593+
if( bNextPage || iOff>pCsr->nPage || iOff<=iCellPtr ){
582594
bNextPage = 1;
583595
}else{
584596
iOff += dbdataGetVarintU32(&pCsr->aPage[iOff], &nPayload);
@@ -661,7 +673,9 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
661673
pCsr->iField++;
662674
if( pCsr->iField>0 ){
663675
sqlite3_int64 iType;
664-
if( pCsr->pHdrPtr>&pCsr->pRec[pCsr->nRec] ){
676+
if( pCsr->pHdrPtr>=&pCsr->pRec[pCsr->nRec]
677+
|| pCsr->iField>=DBDATA_MX_FIELD
678+
){
665679
bNextPage = 1;
666680
}else{
667681
int szField = 0;

ext/recover/recovercorrupt2.test

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,5 +524,33 @@ do_test 7.1 {
524524
list [catch { $R finish } msg] $msg
525525
} {1 {file is not a database}}
526526

527+
reset_db
528+
breakpoint
529+
do_test 8.0 {
530+
sqlite3 db {}
531+
db deserialize [decode_hexdb {
532+
| size 8192 pagesize 4096 filename db.sqlite
533+
| page 1 offset 0
534+
| 0: ac ae b3 76 74 65 20 66 6f 72 6d 61 74 20 33 00 ...vte format 3.
535+
| 16: 10 00 01 01 00 40 20 20 00 00 00 01 00 00 00 02 .....@ ........
536+
| 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................
537+
| 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................
538+
| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................
539+
| 96: 00 2e 76 8a 0d ff ff ff 1e 0f cb 00 0f cb 00 00 ..v.............
540+
| 4032: 00 00 00 00 00 00 00 00 00 00 00 33 01 06 17 19 ...........3....
541+
| 4048: 19 01 43 74 61 62 6c 65 54 61 62 6c 65 30 54 61 ..CtableTable0Ta
542+
| 4064: 62 6c 65 30 02 43 52 45 41 54 45 20 54 41 42 4c ble0.CREATE TABL
543+
| 4080: 45 20 54 61 62 6c 65 30 20 28 43 6f 6c 30 20 29 E Table0 (Col0 )
544+
| page 2 offset 4096
545+
| 0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 ................
546+
| end db.sqlite
547+
}]} {}
548+
549+
do_test 8.1 {
550+
set R [sqlite3_recover_init db main test.db2]
551+
catch { $R run }
552+
list [catch { $R finish } msg] $msg
553+
} {0 {}}
554+
527555
finish_test
528556

ext/recover/sqlite3recover.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ static int recoverWriteSchema1(sqlite3_recover *p){
11891189
if( bTable && !bVirtual ){
11901190
if( SQLITE_ROW==sqlite3_step(pTblname) ){
11911191
const char *zTbl = (const char*)sqlite3_column_text(pTblname, 0);
1192-
recoverAddTable(p, zTbl, iRoot);
1192+
if( zTbl ) recoverAddTable(p, zTbl, iRoot);
11931193
}
11941194
recoverReset(p, pTblname);
11951195
}

ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
12711271
return poolUtil;
12721272
}).catch(async (e)=>{
12731273
await thePool.removeVfs().catch(()=>{});
1274-
return e;
1274+
throw e;
12751275
});
12761276
}).catch((err)=>{
12771277
//error("rejecting promise:",err);

0 commit comments

Comments
 (0)