Skip to content

Release/v3.45.3 #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions source/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## SQLite Release 3.45.3 On 2024-04-15

1. Fix a long-standing bug (going back to version 3.24.0) that might (rarely) cause the "old.*" values of an UPDATE trigger to be incorrect if that trigger fires in response to an UPSERT. Forum post 284955a3cd454a15.
2. Fix a bug in sum() that could cause it to return NULL when it should return Infinity. Forum post 23b8688ef4.
3. Other trifling corrections and compiler warning fixes that have come up since the previous patch release. See the timeline for details.

## SQLite Release 3.45.2 On 2024-03-12

1. Fix an error in UPSERT, introduced by enhancement 3a in version 3.35.0 (2021-03-12), that could cause an index to get out-of-sync with its table. Forum thread 919c6579c8.
Expand Down
16 changes: 8 additions & 8 deletions source/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Download: https://sqlite.org/2024/sqlite-amalgamation-3450200.zip
Download: https://sqlite.org/2024/sqlite-amalgamation-3450300.zip

```
Archive: sqlite-amalgamation-3450200.zip
Archive: sqlite-amalgamation-3450300.zip
Length Method Size Cmpr Date Time CRC-32 Name
-------- ------ ------- ---- ---------- ----- -------- ----
0 Stored 0 0% 2024-03-12 12:23 00000000 sqlite-amalgamation-3450200/
9022640 Defl:N 2322722 74% 2024-03-12 12:23 07a015d2 sqlite-amalgamation-3450200/sqlite3.c
911257 Defl:N 235796 74% 2024-03-12 12:23 fa2aca4a sqlite-amalgamation-3450200/shell.c
640806 Defl:N 165859 74% 2024-03-12 12:23 5f4fd722 sqlite-amalgamation-3450200/sqlite3.h
38149 Defl:N 6615 83% 2024-03-12 12:23 c5ea7fc8 sqlite-amalgamation-3450200/sqlite3ext.h
0 Stored 0 0% 2024-04-15 15:46 00000000 sqlite-amalgamation-3450300/
9027389 Defl:N 2324116 74% 2024-04-15 15:46 be0e77e7 sqlite-amalgamation-3450300/sqlite3.c
912165 Defl:N 236076 74% 2024-04-15 15:46 722a18fe sqlite-amalgamation-3450300/shell.c
641889 Defl:N 166136 74% 2024-04-15 15:46 0f3e31e0 sqlite-amalgamation-3450300/sqlite3.h
38149 Defl:N 6615 83% 2024-04-15 15:46 c5ea7fc8 sqlite-amalgamation-3450300/sqlite3ext.h
-------- ------- --- -------
10612852 2730992 74% 5 files
10619592 2732943 74% 5 files
```
33 changes: 27 additions & 6 deletions source/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -14753,6 +14753,15 @@ static void dbdataValue(
}
}

/* This macro is a copy of the MX_CELL() macro in the SQLite core. Given
** a page-size, it returns the maximum number of cells that may be present
** on the page. */
#define DBDATA_MX_CELL(pgsz) ((pgsz-8)/6)

/* Maximum number of fields that may appear in a single record. This is
** the "hard-limit", according to comments in sqliteLimit.h. */
#define DBDATA_MX_FIELD 32676

/*
** Move an sqlite_dbdata or sqlite_dbptr cursor to the next entry.
*/
Expand Down Expand Up @@ -14781,6 +14790,9 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
assert( iOff+3+2<=pCsr->nPage );
pCsr->iCell = pTab->bPtr ? -2 : 0;
pCsr->nCell = get_uint16(&pCsr->aPage[iOff+3]);
if( pCsr->nCell>DBDATA_MX_CELL(pCsr->nPage) ){
pCsr->nCell = DBDATA_MX_CELL(pCsr->nPage);
}
}

if( pTab->bPtr ){
Expand Down Expand Up @@ -14825,19 +14837,19 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
if( pCsr->iCell>=pCsr->nCell ){
bNextPage = 1;
}else{
int iCellPtr = iOff + 8 + nPointer + pCsr->iCell*2;

iOff += 8 + nPointer + pCsr->iCell*2;
if( iOff>pCsr->nPage ){
if( iCellPtr>pCsr->nPage ){
bNextPage = 1;
}else{
iOff = get_uint16(&pCsr->aPage[iOff]);
iOff = get_uint16(&pCsr->aPage[iCellPtr]);
}

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

/* Load the "byte of payload including overflow" field */
if( bNextPage || iOff>pCsr->nPage ){
if( bNextPage || iOff>pCsr->nPage || iOff<=iCellPtr ){
bNextPage = 1;
}else{
iOff += dbdataGetVarintU32(&pCsr->aPage[iOff], &nPayload);
Expand Down Expand Up @@ -14920,7 +14932,9 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
pCsr->iField++;
if( pCsr->iField>0 ){
sqlite3_int64 iType;
if( pCsr->pHdrPtr>&pCsr->pRec[pCsr->nRec] ){
if( pCsr->pHdrPtr>=&pCsr->pRec[pCsr->nRec]
|| pCsr->iField>=DBDATA_MX_FIELD
){
bNextPage = 1;
}else{
int szField = 0;
Expand Down Expand Up @@ -16408,7 +16422,7 @@ static int recoverWriteSchema1(sqlite3_recover *p){
if( bTable && !bVirtual ){
if( SQLITE_ROW==sqlite3_step(pTblname) ){
const char *zTbl = (const char*)sqlite3_column_text(pTblname, 0);
recoverAddTable(p, zTbl, iRoot);
if( zTbl ) recoverAddTable(p, zTbl, iRoot);
}
recoverReset(p, pTblname);
}
Expand Down Expand Up @@ -28771,6 +28785,7 @@ static const char zOptions[] =
" -newline SEP set output row separator. Default: '\\n'\n"
" -nofollow refuse to open symbolic links to database files\n"
" -nonce STRING set the safe-mode escape nonce\n"
" -no-rowid-in-view Disable rowid-in-view using sqlite3_config()\n"
" -nullvalue TEXT set text string for NULL values. Default ''\n"
" -pagecache SIZE N use N slots of SZ bytes each for page cache memory\n"
" -pcachetrace trace all page cache operations\n"
Expand Down Expand Up @@ -29061,6 +29076,10 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
stdin_is_interactive = 0;
}else if( cli_strcmp(z,"-utf8")==0 ){
}else if( cli_strcmp(z,"-no-utf8")==0 ){
}else if( cli_strcmp(z,"-no-rowid-in-view")==0 ){
int val = 0;
sqlite3_config(SQLITE_CONFIG_ROWID_IN_VIEW, &val);
assert( val==0 );
}else if( cli_strcmp(z,"-heap")==0 ){
#if defined(SQLITE_ENABLE_MEMSYS3) || defined(SQLITE_ENABLE_MEMSYS5)
const char *zSize;
Expand Down Expand Up @@ -29336,6 +29355,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
/* already handled */
}else if( cli_strcmp(z,"-no-utf8")==0 ){
/* already handled */
}else if( cli_strcmp(z,"-no-rowid-in-view")==0 ){
/* already handled */
}else if( cli_strcmp(z,"-heap")==0 ){
i++;
}else if( cli_strcmp(z,"-pagecache")==0 ){
Expand Down
Loading