sqlite3: Vendor import of sqlite3 3.39.3

Changes at https://www.sqlite.org/releaselog/3_39_3.html.

Obtained from:  https://www.sqlite.org/2022/sqlite-autoconf-3390300.tar.gz
This commit is contained in:
Cy Schubert 2022-09-19 20:07:59 -07:00
parent 2c2ef670a7
commit 5195291452
7 changed files with 122 additions and 54 deletions

View file

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for sqlite 3.39.2. # Generated by GNU Autoconf 2.71 for sqlite 3.39.3.
# #
# Report bugs to <http://www.sqlite.org>. # Report bugs to <http://www.sqlite.org>.
# #
@ -621,8 +621,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='sqlite' PACKAGE_NAME='sqlite'
PACKAGE_TARNAME='sqlite' PACKAGE_TARNAME='sqlite'
PACKAGE_VERSION='3.39.2' PACKAGE_VERSION='3.39.3'
PACKAGE_STRING='sqlite 3.39.2' PACKAGE_STRING='sqlite 3.39.3'
PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_BUGREPORT='http://www.sqlite.org'
PACKAGE_URL='' PACKAGE_URL=''
@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures sqlite 3.39.2 to adapt to many kinds of systems. \`configure' configures sqlite 3.39.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1438,7 +1438,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of sqlite 3.39.2:";; short | recursive ) echo "Configuration of sqlite 3.39.3:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1563,7 +1563,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
sqlite configure 3.39.2 sqlite configure 3.39.3
generated by GNU Autoconf 2.71 generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc. Copyright (C) 2021 Free Software Foundation, Inc.
@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by sqlite $as_me 3.39.2, which was It was created by sqlite $as_me 3.39.3, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw $ $0$ac_configure_args_raw
@ -3106,7 +3106,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='sqlite' PACKAGE='sqlite'
VERSION='3.39.2' VERSION='3.39.3'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by sqlite $as_me 3.39.2, which was This file was extended by sqlite $as_me 3.39.3, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped' ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\ ac_cs_version="\\
sqlite config.status 3.39.2 sqlite config.status 3.39.3
configured by $0, generated by GNU Autoconf 2.71, configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View file

@ -10,7 +10,7 @@
# #
AC_PREREQ(2.61) AC_PREREQ(2.61)
AC_INIT(sqlite, 3.39.2, http://www.sqlite.org) AC_INIT(sqlite, 3.39.3, http://www.sqlite.org)
AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_SRCDIR([sqlite3.c])
AC_CONFIG_AUX_DIR([.]) AC_CONFIG_AUX_DIR([.])

View file

@ -1,6 +1,6 @@
/****************************************************************************** /******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite ** This file is an amalgamation of many separate C source files from SQLite
** version 3.39.2. By combining all the individual C code files into this ** version 3.39.3. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation ** 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 ** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements ** possible if the files were compiled separately. Performance improvements
@ -452,9 +452,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()]. ** [sqlite_version()] and [sqlite_source_id()].
*/ */
#define SQLITE_VERSION "3.39.2" #define SQLITE_VERSION "3.39.3"
#define SQLITE_VERSION_NUMBER 3039002 #define SQLITE_VERSION_NUMBER 3039003
#define SQLITE_SOURCE_ID "2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603" #define SQLITE_SOURCE_ID "2022-09-05 11:02:23 4635f4a69c8c2a8df242b384a992aea71224e39a2ccab42d8c0b0602f1e826e8"
/* /*
** CAPI3REF: Run-Time Library Version Numbers ** CAPI3REF: Run-Time Library Version Numbers
@ -13144,6 +13144,11 @@ struct fts5_api {
/************** End of sqlite3.h *********************************************/ /************** End of sqlite3.h *********************************************/
/************** Continuing where we left off in sqliteInt.h ******************/ /************** Continuing where we left off in sqliteInt.h ******************/
/*
** Reuse the STATIC_LRU for mutex access to sqlite3_temp_directory.
*/
#define SQLITE_MUTEX_STATIC_TEMPDIR SQLITE_MUTEX_STATIC_VFS1
/* /*
** Include the configuration header output by 'configure' if we're using the ** Include the configuration header output by 'configure' if we're using the
** autoconf-based build ** autoconf-based build
@ -29563,8 +29568,13 @@ SQLITE_PRIVATE void *sqlite3OomFault(sqlite3 *db){
} }
DisableLookaside; DisableLookaside;
if( db->pParse ){ if( db->pParse ){
Parse *pParse;
sqlite3ErrorMsg(db->pParse, "out of memory"); sqlite3ErrorMsg(db->pParse, "out of memory");
db->pParse->rc = SQLITE_NOMEM_BKPT; db->pParse->rc = SQLITE_NOMEM_BKPT;
for(pParse=db->pParse->pOuterParse; pParse; pParse = pParse->pOuterParse){
pParse->nErr++;
pParse->rc = SQLITE_NOMEM;
}
} }
} }
return 0; return 0;
@ -33459,7 +33469,7 @@ SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
va_list ap; va_list ap;
sqlite3 *db = pParse->db; sqlite3 *db = pParse->db;
assert( db!=0 ); assert( db!=0 );
assert( db->pParse==pParse ); assert( db->pParse==pParse || db->pParse->pToplevel==pParse );
db->errByteOffset = -2; db->errByteOffset = -2;
va_start(ap, zFormat); va_start(ap, zFormat);
zMsg = sqlite3VMPrintf(db, zFormat, ap); zMsg = sqlite3VMPrintf(db, zFormat, ap);
@ -41320,6 +41330,7 @@ static const char *unixTempFileDir(void){
static int unixGetTempname(int nBuf, char *zBuf){ static int unixGetTempname(int nBuf, char *zBuf){
const char *zDir; const char *zDir;
int iLimit = 0; int iLimit = 0;
int rc = SQLITE_OK;
/* It's odd to simulate an io-error here, but really this is just /* It's odd to simulate an io-error here, but really this is just
** using the io-error infrastructure to test that SQLite handles this ** using the io-error infrastructure to test that SQLite handles this
@ -41328,18 +41339,26 @@ static int unixGetTempname(int nBuf, char *zBuf){
zBuf[0] = 0; zBuf[0] = 0;
SimulateIOError( return SQLITE_IOERR ); SimulateIOError( return SQLITE_IOERR );
sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
zDir = unixTempFileDir(); zDir = unixTempFileDir();
if( zDir==0 ) return SQLITE_IOERR_GETTEMPPATH; if( zDir==0 ){
do{ rc = SQLITE_IOERR_GETTEMPPATH;
u64 r; }else{
sqlite3_randomness(sizeof(r), &r); do{
assert( nBuf>2 ); u64 r;
zBuf[nBuf-2] = 0; sqlite3_randomness(sizeof(r), &r);
sqlite3_snprintf(nBuf, zBuf, "%s/"SQLITE_TEMP_FILE_PREFIX"%llx%c", assert( nBuf>2 );
zDir, r, 0); zBuf[nBuf-2] = 0;
if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ) return SQLITE_ERROR; sqlite3_snprintf(nBuf, zBuf, "%s/"SQLITE_TEMP_FILE_PREFIX"%llx%c",
}while( osAccess(zBuf,0)==0 ); zDir, r, 0);
return SQLITE_OK; if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ){
rc = SQLITE_ERROR;
break;
}
}while( osAccess(zBuf,0)==0 );
}
sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
return rc;
} }
#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
@ -45482,6 +45501,7 @@ SQLITE_API int sqlite3_win32_set_directory8(
int rc = sqlite3_initialize(); int rc = sqlite3_initialize();
if( rc ) return rc; if( rc ) return rc;
#endif #endif
sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
if( type==SQLITE_WIN32_DATA_DIRECTORY_TYPE ){ if( type==SQLITE_WIN32_DATA_DIRECTORY_TYPE ){
ppDirectory = &sqlite3_data_directory; ppDirectory = &sqlite3_data_directory;
}else if( type==SQLITE_WIN32_TEMP_DIRECTORY_TYPE ){ }else if( type==SQLITE_WIN32_TEMP_DIRECTORY_TYPE ){
@ -45496,14 +45516,19 @@ SQLITE_API int sqlite3_win32_set_directory8(
if( zValue && zValue[0] ){ if( zValue && zValue[0] ){
zCopy = sqlite3_mprintf("%s", zValue); zCopy = sqlite3_mprintf("%s", zValue);
if ( zCopy==0 ){ if ( zCopy==0 ){
return SQLITE_NOMEM_BKPT; rc = SQLITE_NOMEM_BKPT;
goto set_directory8_done;
} }
} }
sqlite3_free(*ppDirectory); sqlite3_free(*ppDirectory);
*ppDirectory = zCopy; *ppDirectory = zCopy;
return SQLITE_OK; rc = SQLITE_OK;
}else{
rc = SQLITE_ERROR;
} }
return SQLITE_ERROR; set_directory8_done:
sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
return rc;
} }
/* /*
@ -48277,6 +48302,18 @@ static int winMakeEndInDirSep(int nBuf, char *zBuf){
return 0; return 0;
} }
/*
** If sqlite3_temp_directory is not, take the mutex and return true.
**
** If sqlite3_temp_directory is NULL, omit the mutex and return false.
*/
static int winTempDirDefined(void){
sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
if( sqlite3_temp_directory!=0 ) return 1;
sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
return 0;
}
/* /*
** Create a temporary file name and store the resulting pointer into pzBuf. ** Create a temporary file name and store the resulting pointer into pzBuf.
** The pointer returned in pzBuf must be freed via sqlite3_free(). ** The pointer returned in pzBuf must be freed via sqlite3_free().
@ -48313,20 +48350,23 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){
*/ */
nDir = nMax - (nPre + 15); nDir = nMax - (nPre + 15);
assert( nDir>0 ); assert( nDir>0 );
if( sqlite3_temp_directory ){ if( winTempDirDefined() ){
int nDirLen = sqlite3Strlen30(sqlite3_temp_directory); int nDirLen = sqlite3Strlen30(sqlite3_temp_directory);
if( nDirLen>0 ){ if( nDirLen>0 ){
if( !winIsDirSep(sqlite3_temp_directory[nDirLen-1]) ){ if( !winIsDirSep(sqlite3_temp_directory[nDirLen-1]) ){
nDirLen++; nDirLen++;
} }
if( nDirLen>nDir ){ if( nDirLen>nDir ){
sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
sqlite3_free(zBuf); sqlite3_free(zBuf);
OSTRACE(("TEMP-FILENAME rc=SQLITE_ERROR\n")); OSTRACE(("TEMP-FILENAME rc=SQLITE_ERROR\n"));
return winLogError(SQLITE_ERROR, 0, "winGetTempname1", 0); return winLogError(SQLITE_ERROR, 0, "winGetTempname1", 0);
} }
sqlite3_snprintf(nMax, zBuf, "%s", sqlite3_temp_directory); sqlite3_snprintf(nMax, zBuf, "%s", sqlite3_temp_directory);
} }
sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
} }
#if defined(__CYGWIN__) #if defined(__CYGWIN__)
else{ else{
static const char *azDirs[] = { static const char *azDirs[] = {
@ -49115,7 +49155,7 @@ static BOOL winIsVerbatimPathname(
** pathname into zOut[]. zOut[] will be at least pVfs->mxPathname ** pathname into zOut[]. zOut[] will be at least pVfs->mxPathname
** bytes in size. ** bytes in size.
*/ */
static int winFullPathname( static int winFullPathnameNoMutex(
sqlite3_vfs *pVfs, /* Pointer to vfs object */ sqlite3_vfs *pVfs, /* Pointer to vfs object */
const char *zRelative, /* Possibly relative input path */ const char *zRelative, /* Possibly relative input path */
int nFull, /* Size of output buffer in bytes */ int nFull, /* Size of output buffer in bytes */
@ -49294,6 +49334,19 @@ static int winFullPathname(
} }
#endif #endif
} }
static int winFullPathname(
sqlite3_vfs *pVfs, /* Pointer to vfs object */
const char *zRelative, /* Possibly relative input path */
int nFull, /* Size of output buffer in bytes */
char *zFull /* Output buffer */
){
int rc;
sqlite3_mutex *pMutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR);
sqlite3_mutex_enter(pMutex);
rc = winFullPathnameNoMutex(pVfs, zRelative, nFull, zFull);
sqlite3_mutex_leave(pMutex);
return rc;
}
#ifndef SQLITE_OMIT_LOAD_EXTENSION #ifndef SQLITE_OMIT_LOAD_EXTENSION
/* /*
@ -59676,6 +59729,7 @@ static int pager_open_journal(Pager *pPager){
if( rc!=SQLITE_OK ){ if( rc!=SQLITE_OK ){
sqlite3BitvecDestroy(pPager->pInJournal); sqlite3BitvecDestroy(pPager->pInJournal);
pPager->pInJournal = 0; pPager->pInJournal = 0;
pPager->journalOff = 0;
}else{ }else{
assert( pPager->eState==PAGER_WRITER_LOCKED ); assert( pPager->eState==PAGER_WRITER_LOCKED );
pPager->eState = PAGER_WRITER_CACHEMOD; pPager->eState = PAGER_WRITER_CACHEMOD;
@ -61231,7 +61285,7 @@ SQLITE_PRIVATE int sqlite3PagerGetJournalMode(Pager *pPager){
SQLITE_PRIVATE int sqlite3PagerOkToChangeJournalMode(Pager *pPager){ SQLITE_PRIVATE int sqlite3PagerOkToChangeJournalMode(Pager *pPager){
assert( assert_pager_state(pPager) ); assert( assert_pager_state(pPager) );
if( pPager->eState>=PAGER_WRITER_CACHEMOD ) return 0; if( pPager->eState>=PAGER_WRITER_CACHEMOD ) return 0;
if( NEVER(isOpen(pPager->jfd) && pPager->journalOff>0) ) return 0; if( isOpen(pPager->jfd) && pPager->journalOff>0 ) return 0;
return 1; return 1;
} }
@ -81035,6 +81089,7 @@ SQLITE_PRIVATE int sqlite3VdbeAddFunctionCall(
addr = sqlite3VdbeAddOp4(v, eCallCtx ? OP_PureFunc : OP_Function, addr = sqlite3VdbeAddOp4(v, eCallCtx ? OP_PureFunc : OP_Function,
p1, p2, p3, (char*)pCtx, P4_FUNCCTX); p1, p2, p3, (char*)pCtx, P4_FUNCCTX);
sqlite3VdbeChangeP5(v, eCallCtx & NC_SelfRef); sqlite3VdbeChangeP5(v, eCallCtx & NC_SelfRef);
sqlite3MayAbort(pParse);
return addr; return addr;
} }
@ -81370,6 +81425,7 @@ SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){
|| opcode==OP_VDestroy || opcode==OP_VDestroy
|| opcode==OP_VCreate || opcode==OP_VCreate
|| opcode==OP_ParseSchema || opcode==OP_ParseSchema
|| opcode==OP_Function || opcode==OP_PureFunc
|| ((opcode==OP_Halt || opcode==OP_HaltIfNull) || ((opcode==OP_Halt || opcode==OP_HaltIfNull)
&& ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort)) && ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort))
){ ){
@ -132704,6 +132760,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
** **
*/ */
case PragTyp_TEMP_STORE_DIRECTORY: { case PragTyp_TEMP_STORE_DIRECTORY: {
sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
if( !zRight ){ if( !zRight ){
returnSingleText(v, sqlite3_temp_directory); returnSingleText(v, sqlite3_temp_directory);
}else{ }else{
@ -132713,6 +132770,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res);
if( rc!=SQLITE_OK || res==0 ){ if( rc!=SQLITE_OK || res==0 ){
sqlite3ErrorMsg(pParse, "not a writable directory"); sqlite3ErrorMsg(pParse, "not a writable directory");
sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
goto pragma_out; goto pragma_out;
} }
} }
@ -132730,6 +132788,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
} }
#endif /* SQLITE_OMIT_WSD */ #endif /* SQLITE_OMIT_WSD */
} }
sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
break; break;
} }
@ -132748,6 +132807,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
** **
*/ */
case PragTyp_DATA_STORE_DIRECTORY: { case PragTyp_DATA_STORE_DIRECTORY: {
sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
if( !zRight ){ if( !zRight ){
returnSingleText(v, sqlite3_data_directory); returnSingleText(v, sqlite3_data_directory);
}else{ }else{
@ -132757,6 +132817,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res);
if( rc!=SQLITE_OK || res==0 ){ if( rc!=SQLITE_OK || res==0 ){
sqlite3ErrorMsg(pParse, "not a writable directory"); sqlite3ErrorMsg(pParse, "not a writable directory");
sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
goto pragma_out; goto pragma_out;
} }
} }
@ -132768,6 +132829,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
} }
#endif /* SQLITE_OMIT_WSD */ #endif /* SQLITE_OMIT_WSD */
} }
sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR));
break; break;
} }
#endif #endif
@ -137213,7 +137275,7 @@ static void generateSortTail(
if( addrOnce ) sqlite3VdbeJumpHere(v, addrOnce); if( addrOnce ) sqlite3VdbeJumpHere(v, addrOnce);
addr = 1 + sqlite3VdbeAddOp2(v, OP_SorterSort, iTab, addrBreak); addr = 1 + sqlite3VdbeAddOp2(v, OP_SorterSort, iTab, addrBreak);
VdbeCoverage(v); VdbeCoverage(v);
codeOffset(v, p->iOffset, addrContinue); assert( p->iLimit==0 && p->iOffset==0 );
sqlite3VdbeAddOp3(v, OP_SorterData, iTab, regSortOut, iSortTab); sqlite3VdbeAddOp3(v, OP_SorterData, iTab, regSortOut, iSortTab);
bSeq = 0; bSeq = 0;
}else{ }else{
@ -137221,6 +137283,9 @@ static void generateSortTail(
codeOffset(v, p->iOffset, addrContinue); codeOffset(v, p->iOffset, addrContinue);
iSortTab = iTab; iSortTab = iTab;
bSeq = 1; bSeq = 1;
if( p->iOffset>0 ){
sqlite3VdbeAddOp2(v, OP_AddImm, p->iLimit, -1);
}
} }
for(i=0, iCol=nKey+bSeq-1; i<nColumn; i++){ for(i=0, iCol=nKey+bSeq-1; i<nColumn; i++){
#ifdef SQLITE_ENABLE_SORTER_REFERENCES #ifdef SQLITE_ENABLE_SORTER_REFERENCES
@ -139213,10 +139278,11 @@ static int multiSelectOrderBy(
*/ */
sqlite3VdbeResolveLabel(v, labelEnd); sqlite3VdbeResolveLabel(v, labelEnd);
/* Reassembly the compound query so that it will be freed correctly /* Reassemble the compound query so that it will be freed correctly
** by the calling function */ ** by the calling function */
if( pSplit->pPrior ){ if( pSplit->pPrior ){
sqlite3SelectDelete(db, pSplit->pPrior); sqlite3ParserAddCleanup(pParse,
(void(*)(sqlite3*,void*))sqlite3SelectDelete, pSplit->pPrior);
} }
pSplit->pPrior = pPrior; pSplit->pPrior = pPrior;
pPrior->pNext = pSplit; pPrior->pNext = pSplit;
@ -140735,6 +140801,7 @@ static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){
|| p->pSrc->nSrc!=1 || p->pSrc->nSrc!=1
|| p->pSrc->a[0].pSelect || p->pSrc->a[0].pSelect
|| pAggInfo->nFunc!=1 || pAggInfo->nFunc!=1
|| p->pHaving
){ ){
return 0; return 0;
} }
@ -149783,7 +149850,8 @@ static int codeEqualityTerm(
} }
sqlite3ExprDelete(db, pX); sqlite3ExprDelete(db, pX);
}else{ }else{
aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq); int n = sqlite3ExprVectorSize(pX->pLeft);
aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*MAX(nEq,n));
eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab); eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab);
} }
pX = pExpr; pX = pExpr;
@ -181120,7 +181188,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){
nDistance = iPrev - nMaxUndeferred; nDistance = iPrev - nMaxUndeferred;
} }
aOut = (char *)sqlite3_malloc(nPoslist+8); aOut = (char *)sqlite3Fts3MallocZero(nPoslist+FTS3_BUFFER_PADDING);
if( !aOut ){ if( !aOut ){
sqlite3_free(aPoslist); sqlite3_free(aPoslist);
return SQLITE_NOMEM; return SQLITE_NOMEM;
@ -204146,7 +204214,7 @@ static int geopolyUpdate(
sqlite3_free(p); sqlite3_free(p);
nChange = 1; nChange = 1;
} }
for(jj=1; jj<pRtree->nAux; jj++){ for(jj=1; jj<nData-2; jj++){
nChange++; nChange++;
sqlite3_bind_value(pUp, jj+2, aData[jj+2]); sqlite3_bind_value(pUp, jj+2, aData[jj+2]);
} }
@ -236636,7 +236704,7 @@ static void fts5SourceIdFunc(
){ ){
assert( nArg==0 ); assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused); UNUSED_PARAM2(nArg, apUnused);
sqlite3_result_text(pCtx, "fts5: 2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603", -1, SQLITE_TRANSIENT); sqlite3_result_text(pCtx, "fts5: 2022-09-05 11:02:23 4635f4a69c8c2a8df242b384a992aea71224e39a2ccab42d8c0b0602f1e826e8", -1, SQLITE_TRANSIENT);
} }
/* /*

View file

@ -146,9 +146,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()]. ** [sqlite_version()] and [sqlite_source_id()].
*/ */
#define SQLITE_VERSION "3.39.2" #define SQLITE_VERSION "3.39.3"
#define SQLITE_VERSION_NUMBER 3039002 #define SQLITE_VERSION_NUMBER 3039003
#define SQLITE_SOURCE_ID "2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603" #define SQLITE_SOURCE_ID "2022-09-05 11:02:23 4635f4a69c8c2a8df242b384a992aea71224e39a2ccab42d8c0b0602f1e826e8"
/* /*
** CAPI3REF: Run-Time Library Version Numbers ** CAPI3REF: Run-Time Library Version Numbers

View file

@ -1,3 +1,3 @@
#ifndef SQLITE_RESOURCE_VERSION #ifndef SQLITE_RESOURCE_VERSION
#define SQLITE_RESOURCE_VERSION 3,39,2 #define SQLITE_RESOURCE_VERSION 3,39,3
#endif #endif

View file

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for sqlite 3.39.2. # Generated by GNU Autoconf 2.71 for sqlite 3.39.3.
# #
# #
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@ -608,8 +608,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='sqlite' PACKAGE_NAME='sqlite'
PACKAGE_TARNAME='sqlite' PACKAGE_TARNAME='sqlite'
PACKAGE_VERSION='3.39.2' PACKAGE_VERSION='3.39.3'
PACKAGE_STRING='sqlite 3.39.2' PACKAGE_STRING='sqlite 3.39.3'
PACKAGE_BUGREPORT='' PACKAGE_BUGREPORT=''
PACKAGE_URL='' PACKAGE_URL=''
@ -1328,7 +1328,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures sqlite 3.39.2 to adapt to many kinds of systems. \`configure' configures sqlite 3.39.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1390,7 +1390,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of sqlite 3.39.2:";; short | recursive ) echo "Configuration of sqlite 3.39.3:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1493,7 +1493,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
sqlite configure 3.39.2 sqlite configure 3.39.3
generated by GNU Autoconf 2.71 generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc. Copyright (C) 2021 Free Software Foundation, Inc.
@ -1844,7 +1844,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by sqlite $as_me 3.39.2, which was It was created by sqlite $as_me 3.39.3, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw $ $0$ac_configure_args_raw
@ -10181,7 +10181,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by sqlite $as_me 3.39.2, which was This file was extended by sqlite $as_me 3.39.3, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -10236,7 +10236,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped' ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\ ac_cs_version="\\
sqlite config.status 3.39.2 sqlite config.status 3.39.3
configured by $0, generated by GNU Autoconf 2.71, configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View file

@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
# so you can encode the package version directly into the source files. # so you can encode the package version directly into the source files.
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
AC_INIT([sqlite], [3.39.2]) AC_INIT([sqlite], [3.39.3])
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars. # Call TEA_INIT as the first TEA_ macro to set up initial vars.