Skip to content
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
58 changes: 45 additions & 13 deletions deps/sqlite/sqlite3.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
** version 3.51.0. By combining all the individual C code files into this
** version 3.51.1. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation
** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements
Expand All @@ -18,7 +18,7 @@
** separate file. This file contains only code for the core SQLite library.
**
** The content in this amalgamation comes from Fossil check-in
** fb2c931ae597f8d00a37574ff67aeed3eced with changes in files:
** 281fc0e9afc38674b9b0991943b9e9d1e64c with changes in files:
**
**
*/
Expand Down Expand Up @@ -467,12 +467,12 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.51.0"
#define SQLITE_VERSION_NUMBER 3051000
#define SQLITE_SOURCE_ID "2025-11-04 19:38:17 fb2c931ae597f8d00a37574ff67aeed3eced4e5547f9120744ae4bfa8e74527b"
#define SQLITE_SCM_BRANCH "trunk"
#define SQLITE_SCM_TAGS "release major-release version-3.51.0"
#define SQLITE_SCM_DATETIME "2025-11-04T19:38:17.314Z"
#define SQLITE_VERSION "3.51.1"
#define SQLITE_VERSION_NUMBER 3051001
#define SQLITE_SOURCE_ID "2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88"
#define SQLITE_SCM_BRANCH "branch-3.51"
#define SQLITE_SCM_TAGS "release version-3.51.1"
#define SQLITE_SCM_DATETIME "2025-11-28T17:28:25.933Z"

/*
** CAPI3REF: Run-Time Library Version Numbers
Expand Down Expand Up @@ -10747,7 +10747,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle);
**   ){
**   // do something with pVal
**   }
**   if( rc!=SQLITE_OK ){
**   if( rc!=SQLITE_DONE ){
**   // an error has occurred
**   }
** </pre></blockquote>)^
Expand Down Expand Up @@ -38004,6 +38004,7 @@ SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, void *data){
return 0;
}


/************** End of hash.c ************************************************/
/************** Begin file opcodes.c *****************************************/
/* Automatically generated. Do not edit */
Expand Down Expand Up @@ -130655,6 +130656,7 @@ SQLITE_PRIVATE void sqlite3SchemaClear(void *p){
for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){
sqlite3DeleteTrigger(&xdb, (Trigger*)sqliteHashData(pElem));
}

sqlite3HashClear(&temp2);
sqlite3HashInit(&pSchema->tblHash);
for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){
Expand Down Expand Up @@ -160976,9 +160978,12 @@ SQLITE_PRIVATE int sqlite3VtabEponymousTableInit(Parse *pParse, Module *pMod){
addModuleArgument(pParse, pTab, sqlite3DbStrDup(db, pTab->zName));
addModuleArgument(pParse, pTab, 0);
addModuleArgument(pParse, pTab, sqlite3DbStrDup(db, pTab->zName));
db->nSchemaLock++;
rc = vtabCallConstructor(db, pTab, pMod, pModule->xConnect, &zErr);
db->nSchemaLock--;
if( rc ){
sqlite3ErrorMsg(pParse, "%s", zErr);
pParse->rc = rc;
sqlite3DbFree(db, zErr);
sqlite3VtabEponymousTableClear(db, pMod);
}
Expand Down Expand Up @@ -174040,8 +174045,22 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
sqlite3VdbeAddOp2(v, OP_Goto, 1, pLevel->p2);
}
#endif /* SQLITE_DISABLE_SKIPAHEAD_DISTINCT */
if( pTabList->a[pLevel->iFrom].fg.fromExists ){
sqlite3VdbeAddOp2(v, OP_Goto, 0, sqlite3VdbeCurrentAddr(v)+2);
if( pTabList->a[pLevel->iFrom].fg.fromExists && i==pWInfo->nLevel-1 ){
/* If the EXISTS-to-JOIN optimization was applied, then the EXISTS
** loop(s) will be the inner-most loops of the join. There might be
** multiple EXISTS loops, but they will all be nested, and the join
** order will not have been changed by the query planner. If the
** inner-most EXISTS loop sees a single successful row, it should
** break out of *all* EXISTS loops. But only the inner-most of the
** nested EXISTS loops should do this breakout. */
int nOuter = 0; /* Nr of outer EXISTS that this one is nested within */
while( nOuter<i ){
if( !pTabList->a[pLevel[-nOuter-1].iFrom].fg.fromExists ) break;
nOuter++;
}
testcase( nOuter>0 );
sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel[-nOuter].addrBrk);
VdbeComment((v, "EXISTS break"));
}
/* The common case: Advance to the next row */
if( pLevel->addrCont ) sqlite3VdbeResolveLabel(v, pLevel->addrCont);
Expand Down Expand Up @@ -186225,6 +186244,7 @@ SQLITE_PRIVATE void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){
/* Clear the TEMP schema separately and last */
if( db->aDb[1].pSchema ){
sqlite3SchemaClear(db->aDb[1].pSchema);
assert( db->aDb[1].pSchema->trigHash.count==0 );
}
sqlite3VtabUnlockList(db);

Expand Down Expand Up @@ -187553,7 +187573,7 @@ SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
*/
SQLITE_API int sqlite3_set_errmsg(sqlite3 *db, int errcode, const char *zMsg){
int rc = SQLITE_OK;
if( !sqlite3SafetyCheckSickOrOk(db) ){
if( !sqlite3SafetyCheckOk(db) ){
return SQLITE_MISUSE_BKPT;
}
sqlite3_mutex_enter(db->mutex);
Expand Down Expand Up @@ -249220,6 +249240,7 @@ static void fts5SegIterReverseInitPage(Fts5Index *p, Fts5SegIter *pIter){
while( 1 ){
u64 iDelta = 0;

if( i>=n ) break;
if( eDetail==FTS5_DETAIL_NONE ){
/* todo */
if( i<n && a[i]==0 ){
Expand Down Expand Up @@ -260283,7 +260304,7 @@ static void fts5SourceIdFunc(
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
sqlite3_result_text(pCtx, "fts5: 2025-11-04 19:38:17 fb2c931ae597f8d00a37574ff67aeed3eced4e5547f9120744ae4bfa8e74527b", -1, SQLITE_TRANSIENT);
sqlite3_result_text(pCtx, "fts5: 2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88", -1, SQLITE_TRANSIENT);
}

/*
Expand Down Expand Up @@ -265104,7 +265125,12 @@ static int fts5VocabOpenMethod(
return rc;
}

/*
** Restore cursor pCsr to the state it was in immediately after being
** created by the xOpen() method.
*/
static void fts5VocabResetCursor(Fts5VocabCursor *pCsr){
int nCol = pCsr->pFts5->pConfig->nCol;
pCsr->rowid = 0;
sqlite3Fts5IterClose(pCsr->pIter);
sqlite3Fts5StructureRelease(pCsr->pStruct);
Expand All @@ -265114,6 +265140,12 @@ static void fts5VocabResetCursor(Fts5VocabCursor *pCsr){
pCsr->nLeTerm = -1;
pCsr->zLeTerm = 0;
pCsr->bEof = 0;
pCsr->iCol = 0;
pCsr->iInstPos = 0;
pCsr->iInstOff = 0;
pCsr->colUsed = 0;
memset(pCsr->aCnt, 0, sizeof(i64)*nCol);
memset(pCsr->aDoc, 0, sizeof(i64)*nCol);
}

/*
Expand Down
14 changes: 7 additions & 7 deletions deps/sqlite/sqlite3.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.51.0"
#define SQLITE_VERSION_NUMBER 3051000
#define SQLITE_SOURCE_ID "2025-11-04 19:38:17 fb2c931ae597f8d00a37574ff67aeed3eced4e5547f9120744ae4bfa8e74527b"
#define SQLITE_SCM_BRANCH "trunk"
#define SQLITE_SCM_TAGS "release major-release version-3.51.0"
#define SQLITE_SCM_DATETIME "2025-11-04T19:38:17.314Z"
#define SQLITE_VERSION "3.51.1"
#define SQLITE_VERSION_NUMBER 3051001
#define SQLITE_SOURCE_ID "2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88"
#define SQLITE_SCM_BRANCH "branch-3.51"
#define SQLITE_SCM_TAGS "release version-3.51.1"
#define SQLITE_SCM_DATETIME "2025-11-28T17:28:25.933Z"

/*
** CAPI3REF: Run-Time Library Version Numbers
Expand Down Expand Up @@ -10426,7 +10426,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle);
** &nbsp; ){
** &nbsp; // do something with pVal
** &nbsp; }
** &nbsp; if( rc!=SQLITE_OK ){
** &nbsp; if( rc!=SQLITE_DONE ){
** &nbsp; // an error has occurred
** &nbsp; }
** </pre></blockquote>)^
Expand Down
3 changes: 2 additions & 1 deletion deps/zlib/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ static_library("minizip") {
]
}

if (is_apple || is_android || is_nacl) {
if (is_apple || is_android) {
# Mac, Android and the BSDs don't have fopen64, ftello64, or fseeko64. We
# use fopen, ftell, and fseek instead on these systems.
defines = [ "USE_FILE32API" ]
Expand Down Expand Up @@ -551,6 +551,7 @@ if (build_with_chromium) {
"google:compression_utils",
"google:zip",
"//base/test:test_support",
"//crypto",
"//testing/gtest",
]

Expand Down
7 changes: 4 additions & 3 deletions deps/zlib/README.chromium
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Name: zlib
Short Name: zlib
URL: http://zlib.net/
URL: https://github.com/madler/zlib
Version: 1.3.1
Revision: 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf
Update Mechanism: Manual (https://crbug.com/422348588)
CPEPrefix: cpe:/a:zlib:zlib:1.3.1
Security Critical: yes
Shipped: yes
Expand All @@ -19,8 +20,8 @@ library. zlib implements the "deflate" compression algorithm described by RFC
also implements the zlib (RFC 1950) and gzip (RFC 1952) wrapper formats.

Local Modifications:
- Only source code from the zlib distribution used to build the zlib and
minizip libraries are present. Many other files have been omitted. Only *.c
- Only source code from the http://zlib.net distribution used to build the zlib
and minizip libraries are present. Many other files have been omitted. Only *.c
and *.h files from the upstream root directory, contrib/minizip and
examples/zpipe.c were imported.
- The files named '*simd*' are original x86/Arm/RISC-V specific optimizations.
Expand Down
3 changes: 3 additions & 0 deletions deps/zlib/adler32_simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@

#include <tmmintrin.h>

#if defined(__GNUC__)
__attribute__((__target__("ssse3")))
#endif
uint32_t ZLIB_INTERNAL adler32_simd_( /* SSSE3 */
uint32_t adler,
const unsigned char *buf,
Expand Down
1 change: 1 addition & 0 deletions deps/zlib/contrib/minizip/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Short Name: minizip
URL: https://github.com/madler/zlib/tree/master/contrib/minizip
Version: 1.3.1.1
Revision: ef24c4c7502169f016dcd2a26923dbaf3216748c
Update Mechanism: Manual
License: Zlib
License File: //third_party/zlib/LICENSE
Shipped: yes
Expand Down
83 changes: 55 additions & 28 deletions deps/zlib/contrib/minizip/unzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
*/


#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -837,6 +838,7 @@ local int unz64local_GetCurrentFileInfoInternal(unzFile file,
uLong uMagic;
long lSeek=0;
uLong uL;
uLong uFileNameCrc;

if (file==NULL)
return UNZ_PARAMERROR;
Expand Down Expand Up @@ -908,21 +910,34 @@ local int unz64local_GetCurrentFileInfoInternal(unzFile file,
file_info_internal.offset_curfile = uL;

lSeek+=file_info.size_filename;
if ((err==UNZ_OK) && (szFileName!=NULL))
if (err==UNZ_OK)
{
uLong uSizeRead ;
if (file_info.size_filename<fileNameBufferSize)
char szCurrentFileName[UINT16_MAX] = {0};

if (file_info.size_filename > 0)
{
*(szFileName+file_info.size_filename)='\0';
uSizeRead = file_info.size_filename;
if (ZREAD64(s->z_filefunc, s->filestream, szCurrentFileName, file_info.size_filename) != file_info.size_filename)
{
err=UNZ_ERRNO;
}
}
else
uSizeRead = fileNameBufferSize;

if ((file_info.size_filename>0) && (fileNameBufferSize>0))
if (ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead)
err=UNZ_ERRNO;
lSeek -= uSizeRead;
uFileNameCrc = crc32(0, (unsigned char*)szCurrentFileName, file_info.size_filename);

if (szFileName != NULL)
{
if (fileNameBufferSize <= file_info.size_filename)
{
memcpy(szFileName, szCurrentFileName, fileNameBufferSize);
}
else
{
memcpy(szFileName, szCurrentFileName, file_info.size_filename);
szFileName[file_info.size_filename] = '\0';
}
}

lSeek -= file_info.size_filename;
}

// Read extrafield
Expand Down Expand Up @@ -1012,7 +1027,15 @@ local int unz64local_GetCurrentFileInfoInternal(unzFile file,
{
int version = 0;

if (unz64local_getByte(&s->z_filefunc, s->filestream, &version) != UNZ_OK)
if (dataSize < 1 + 4)
{
/* dataSize includes version (1 byte), uCrc (4 bytes), and
* the filename data. If it's too small, fileNameSize below
* would overflow. */
err = UNZ_ERRNO;
break;
}
else if (unz64local_getByte(&s->z_filefunc, s->filestream, &version) != UNZ_OK)
{
err = UNZ_ERRNO;
}
Expand All @@ -1025,16 +1048,16 @@ local int unz64local_GetCurrentFileInfoInternal(unzFile file,
}
else
{
uLong uCrc, uHeaderCrc, fileNameSize;
uLong uCrc, fileNameSize;

if (unz64local_getLong(&s->z_filefunc, s->filestream, &uCrc) != UNZ_OK)
{
err = UNZ_ERRNO;
}
uHeaderCrc = crc32(0, (const unsigned char *)szFileName, file_info.size_filename);
fileNameSize = dataSize - (2 * sizeof (short) + 1);
fileNameSize = dataSize - (1 + 4); /* 1 for version, 4 for uCrc */

/* Check CRC against file name in the header. */
if (uHeaderCrc != uCrc)
if (uCrc != uFileNameCrc)
{
if (ZSEEK64(s->z_filefunc, s->filestream, fileNameSize, ZLIB_FILEFUNC_SEEK_CUR) != 0)
{
Expand All @@ -1043,24 +1066,28 @@ local int unz64local_GetCurrentFileInfoInternal(unzFile file,
}
else
{
uLong uSizeRead;

file_info.size_filename = fileNameSize;

if (fileNameSize < fileNameBufferSize)
{
*(szFileName + fileNameSize) = '\0';
uSizeRead = fileNameSize;
}
else
char szCurrentFileName[UINT16_MAX] = {0};

if (file_info.size_filename > 0)
{
uSizeRead = fileNameBufferSize;
if (ZREAD64(s->z_filefunc, s->filestream, szCurrentFileName, file_info.size_filename) != file_info.size_filename)
{
err = UNZ_ERRNO;
}
}
if ((fileNameSize > 0) && (fileNameBufferSize > 0))

if (szFileName != NULL)
{
if (ZREAD64(s->z_filefunc, s->filestream, szFileName, uSizeRead) != uSizeRead)
if (fileNameBufferSize <= file_info.size_filename)
{
err = UNZ_ERRNO;
memcpy(szFileName, szCurrentFileName, fileNameBufferSize);
}
else
{
memcpy(szFileName, szCurrentFileName, file_info.size_filename);
szFileName[file_info.size_filename] = '\0';
}
}
}
Expand Down
Loading
Loading