forked from cory/tildefriends
sqlite-amalgamation-3370200.zip
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3803 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
d3875cf738
commit
d062db2ba8
89
deps/sqlite/sqlite3.c
vendored
89
deps/sqlite/sqlite3.c
vendored
@ -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.37.1. By combining all the individual C code files into this
|
** version 3.37.2. 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.37.1"
|
#define SQLITE_VERSION "3.37.2"
|
||||||
#define SQLITE_VERSION_NUMBER 3037001
|
#define SQLITE_VERSION_NUMBER 3037002
|
||||||
#define SQLITE_SOURCE_ID "2021-12-30 15:30:28 378629bf2ea546f73eee84063c5358439a12f7300e433f18c9e1bddd948dea62"
|
#define SQLITE_SOURCE_ID "2022-01-06 13:25:41 872ba256cbf61d9290b571c0e6d82a20c224ca3ad82971edc46b29818d5d17a0"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** CAPI3REF: Run-Time Library Version Numbers
|
** CAPI3REF: Run-Time Library Version Numbers
|
||||||
@ -18503,6 +18503,8 @@ struct Parse {
|
|||||||
AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */
|
AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */
|
||||||
Parse *pToplevel; /* Parse structure for main program (or NULL) */
|
Parse *pToplevel; /* Parse structure for main program (or NULL) */
|
||||||
Table *pTriggerTab; /* Table triggers are being coded for */
|
Table *pTriggerTab; /* Table triggers are being coded for */
|
||||||
|
TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */
|
||||||
|
ParseCleanup *pCleanup; /* List of cleanup operations to run after parse */
|
||||||
union {
|
union {
|
||||||
int addrCrTab; /* Address of OP_CreateBtree on CREATE TABLE */
|
int addrCrTab; /* Address of OP_CreateBtree on CREATE TABLE */
|
||||||
Returning *pReturning; /* The RETURNING clause */
|
Returning *pReturning; /* The RETURNING clause */
|
||||||
@ -18557,9 +18559,7 @@ struct Parse {
|
|||||||
Token sArg; /* Complete text of a module argument */
|
Token sArg; /* Complete text of a module argument */
|
||||||
Table **apVtabLock; /* Pointer to virtual tables needing locking */
|
Table **apVtabLock; /* Pointer to virtual tables needing locking */
|
||||||
#endif
|
#endif
|
||||||
TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */
|
|
||||||
With *pWith; /* Current WITH clause, or NULL */
|
With *pWith; /* Current WITH clause, or NULL */
|
||||||
ParseCleanup *pCleanup; /* List of cleanup operations to run after parse */
|
|
||||||
#ifndef SQLITE_OMIT_ALTERTABLE
|
#ifndef SQLITE_OMIT_ALTERTABLE
|
||||||
RenameToken *pRename; /* Tokens subject to renaming by ALTER TABLE */
|
RenameToken *pRename; /* Tokens subject to renaming by ALTER TABLE */
|
||||||
#endif
|
#endif
|
||||||
@ -20093,6 +20093,7 @@ SQLITE_PRIVATE void sqlite3FkActions(Parse*, Table*, ExprList*, int, int*, int
|
|||||||
SQLITE_PRIVATE int sqlite3FkRequired(Parse*, Table*, int*, int);
|
SQLITE_PRIVATE int sqlite3FkRequired(Parse*, Table*, int*, int);
|
||||||
SQLITE_PRIVATE u32 sqlite3FkOldmask(Parse*, Table*);
|
SQLITE_PRIVATE u32 sqlite3FkOldmask(Parse*, Table*);
|
||||||
SQLITE_PRIVATE FKey *sqlite3FkReferences(Table *);
|
SQLITE_PRIVATE FKey *sqlite3FkReferences(Table *);
|
||||||
|
SQLITE_PRIVATE void sqlite3FkClearTriggerCache(sqlite3*,int);
|
||||||
#else
|
#else
|
||||||
#define sqlite3FkActions(a,b,c,d,e,f)
|
#define sqlite3FkActions(a,b,c,d,e,f)
|
||||||
#define sqlite3FkCheck(a,b,c,d,e,f)
|
#define sqlite3FkCheck(a,b,c,d,e,f)
|
||||||
@ -20100,6 +20101,7 @@ SQLITE_PRIVATE FKey *sqlite3FkReferences(Table *);
|
|||||||
#define sqlite3FkOldmask(a,b) 0
|
#define sqlite3FkOldmask(a,b) 0
|
||||||
#define sqlite3FkRequired(a,b,c,d) 0
|
#define sqlite3FkRequired(a,b,c,d) 0
|
||||||
#define sqlite3FkReferences(a) 0
|
#define sqlite3FkReferences(a) 0
|
||||||
|
#define sqlite3FkClearTriggerCache(a,b)
|
||||||
#endif
|
#endif
|
||||||
#ifndef SQLITE_OMIT_FOREIGN_KEY
|
#ifndef SQLITE_OMIT_FOREIGN_KEY
|
||||||
SQLITE_PRIVATE void sqlite3FkDelete(sqlite3 *, Table*);
|
SQLITE_PRIVATE void sqlite3FkDelete(sqlite3 *, Table*);
|
||||||
@ -56574,7 +56576,7 @@ static int pager_wait_on_lock(Pager *pPager, int locktype){
|
|||||||
#if defined(SQLITE_DEBUG)
|
#if defined(SQLITE_DEBUG)
|
||||||
static void assertTruncateConstraintCb(PgHdr *pPg){
|
static void assertTruncateConstraintCb(PgHdr *pPg){
|
||||||
assert( pPg->flags&PGHDR_DIRTY );
|
assert( pPg->flags&PGHDR_DIRTY );
|
||||||
assert( !subjRequiresPage(pPg) || pPg->pgno<=pPg->pPager->dbSize );
|
assert( pPg->pgno<=pPg->pPager->dbSize || !subjRequiresPage(pPg) );
|
||||||
}
|
}
|
||||||
static void assertTruncateConstraint(Pager *pPager){
|
static void assertTruncateConstraint(Pager *pPager){
|
||||||
sqlite3PcacheIterateDirty(pPager->pPCache, assertTruncateConstraintCb);
|
sqlite3PcacheIterateDirty(pPager->pPCache, assertTruncateConstraintCb);
|
||||||
@ -57915,7 +57917,7 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){
|
|||||||
** may mean that the pager was in the error-state when this
|
** may mean that the pager was in the error-state when this
|
||||||
** function was called and the journal file does not exist.
|
** function was called and the journal file does not exist.
|
||||||
*/
|
*/
|
||||||
if( !isOpen(pPager->jfd) ){
|
if( !isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){
|
||||||
sqlite3_vfs * const pVfs = pPager->pVfs;
|
sqlite3_vfs * const pVfs = pPager->pVfs;
|
||||||
int bExists; /* True if journal file exists */
|
int bExists; /* True if journal file exists */
|
||||||
rc = sqlite3OsAccess(
|
rc = sqlite3OsAccess(
|
||||||
@ -66818,7 +66820,7 @@ static void btreeParseCellPtr(
|
|||||||
pInfo->nPayload = nPayload;
|
pInfo->nPayload = nPayload;
|
||||||
pInfo->pPayload = pIter;
|
pInfo->pPayload = pIter;
|
||||||
testcase( nPayload==pPage->maxLocal );
|
testcase( nPayload==pPage->maxLocal );
|
||||||
testcase( nPayload==pPage->maxLocal+1 );
|
testcase( nPayload==(u32)pPage->maxLocal+1 );
|
||||||
if( nPayload<=pPage->maxLocal ){
|
if( nPayload<=pPage->maxLocal ){
|
||||||
/* This is the (easy) common case where the entire payload fits
|
/* This is the (easy) common case where the entire payload fits
|
||||||
** on the local page. No overflow is required.
|
** on the local page. No overflow is required.
|
||||||
@ -66855,7 +66857,7 @@ static void btreeParseCellPtrIndex(
|
|||||||
pInfo->nPayload = nPayload;
|
pInfo->nPayload = nPayload;
|
||||||
pInfo->pPayload = pIter;
|
pInfo->pPayload = pIter;
|
||||||
testcase( nPayload==pPage->maxLocal );
|
testcase( nPayload==pPage->maxLocal );
|
||||||
testcase( nPayload==pPage->maxLocal+1 );
|
testcase( nPayload==(u32)pPage->maxLocal+1 );
|
||||||
if( nPayload<=pPage->maxLocal ){
|
if( nPayload<=pPage->maxLocal ){
|
||||||
/* This is the (easy) common case where the entire payload fits
|
/* This is the (easy) common case where the entire payload fits
|
||||||
** on the local page. No overflow is required.
|
** on the local page. No overflow is required.
|
||||||
@ -66918,7 +66920,7 @@ static u16 cellSizePtr(MemPage *pPage, u8 *pCell){
|
|||||||
while( (*pIter++)&0x80 && pIter<pEnd );
|
while( (*pIter++)&0x80 && pIter<pEnd );
|
||||||
}
|
}
|
||||||
testcase( nSize==pPage->maxLocal );
|
testcase( nSize==pPage->maxLocal );
|
||||||
testcase( nSize==pPage->maxLocal+1 );
|
testcase( nSize==(u32)pPage->maxLocal+1 );
|
||||||
if( nSize<=pPage->maxLocal ){
|
if( nSize<=pPage->maxLocal ){
|
||||||
nSize += (u32)(pIter - pCell);
|
nSize += (u32)(pIter - pCell);
|
||||||
if( nSize<4 ) nSize = 4;
|
if( nSize<4 ) nSize = 4;
|
||||||
@ -66926,7 +66928,7 @@ static u16 cellSizePtr(MemPage *pPage, u8 *pCell){
|
|||||||
int minLocal = pPage->minLocal;
|
int minLocal = pPage->minLocal;
|
||||||
nSize = minLocal + (nSize - minLocal) % (pPage->pBt->usableSize - 4);
|
nSize = minLocal + (nSize - minLocal) % (pPage->pBt->usableSize - 4);
|
||||||
testcase( nSize==pPage->maxLocal );
|
testcase( nSize==pPage->maxLocal );
|
||||||
testcase( nSize==pPage->maxLocal+1 );
|
testcase( nSize==(u32)pPage->maxLocal+1 );
|
||||||
if( nSize>pPage->maxLocal ){
|
if( nSize>pPage->maxLocal ){
|
||||||
nSize = minLocal;
|
nSize = minLocal;
|
||||||
}
|
}
|
||||||
@ -69817,7 +69819,7 @@ static void btreeSetNPage(BtShared *pBt, MemPage *pPage1){
|
|||||||
int nPage = get4byte(&pPage1->aData[28]);
|
int nPage = get4byte(&pPage1->aData[28]);
|
||||||
testcase( nPage==0 );
|
testcase( nPage==0 );
|
||||||
if( nPage==0 ) sqlite3PagerPagecount(pBt->pPager, &nPage);
|
if( nPage==0 ) sqlite3PagerPagecount(pBt->pPager, &nPage);
|
||||||
testcase( pBt->nPage!=nPage );
|
testcase( pBt->nPage!=(u32)nPage );
|
||||||
pBt->nPage = nPage;
|
pBt->nPage = nPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72382,16 +72384,18 @@ static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){
|
|||||||
int hdr; /* Beginning of the header. 0 most pages. 100 page 1 */
|
int hdr; /* Beginning of the header. 0 most pages. 100 page 1 */
|
||||||
|
|
||||||
if( *pRC ) return;
|
if( *pRC ) return;
|
||||||
assert( idx>=0 && idx<pPage->nCell );
|
assert( idx>=0 );
|
||||||
|
assert( idx<pPage->nCell );
|
||||||
assert( CORRUPT_DB || sz==cellSize(pPage, idx) );
|
assert( CORRUPT_DB || sz==cellSize(pPage, idx) );
|
||||||
assert( sqlite3PagerIswriteable(pPage->pDbPage) );
|
assert( sqlite3PagerIswriteable(pPage->pDbPage) );
|
||||||
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
|
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
|
||||||
assert( pPage->nFree>=0 );
|
assert( pPage->nFree>=0 );
|
||||||
data = pPage->aData;
|
data = pPage->aData;
|
||||||
ptr = &pPage->aCellIdx[2*idx];
|
ptr = &pPage->aCellIdx[2*idx];
|
||||||
|
assert( pPage->pBt->usableSize > (int)(ptr-data) );
|
||||||
pc = get2byte(ptr);
|
pc = get2byte(ptr);
|
||||||
hdr = pPage->hdrOffset;
|
hdr = pPage->hdrOffset;
|
||||||
testcase( pc==get2byte(&data[hdr+5]) );
|
testcase( pc==(u32)get2byte(&data[hdr+5]) );
|
||||||
testcase( pc+sz==pPage->pBt->usableSize );
|
testcase( pc+sz==pPage->pBt->usableSize );
|
||||||
if( pc+sz > pPage->pBt->usableSize ){
|
if( pc+sz > pPage->pBt->usableSize ){
|
||||||
*pRC = SQLITE_CORRUPT_BKPT;
|
*pRC = SQLITE_CORRUPT_BKPT;
|
||||||
@ -72683,7 +72687,7 @@ static int rebuildPage(
|
|||||||
|
|
||||||
assert( i<iEnd );
|
assert( i<iEnd );
|
||||||
j = get2byte(&aData[hdr+5]);
|
j = get2byte(&aData[hdr+5]);
|
||||||
if( NEVER(j>(u32)usableSize) ){ j = 0; }
|
if( j>(u32)usableSize ){ j = 0; }
|
||||||
memcpy(&pTmp[j], &aData[j], usableSize - j);
|
memcpy(&pTmp[j], &aData[j], usableSize - j);
|
||||||
|
|
||||||
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
|
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
|
||||||
@ -72914,7 +72918,7 @@ static int editPage(
|
|||||||
|
|
||||||
pData = &aData[get2byteNotZero(&aData[hdr+5])];
|
pData = &aData[get2byteNotZero(&aData[hdr+5])];
|
||||||
if( pData<pBegin ) goto editpage_fail;
|
if( pData<pBegin ) goto editpage_fail;
|
||||||
if( NEVER(pData>pPg->aDataEnd) ) goto editpage_fail;
|
if( pData>pPg->aDataEnd ) goto editpage_fail;
|
||||||
|
|
||||||
/* Add cells to the start of the page */
|
/* Add cells to the start of the page */
|
||||||
if( iNew<iOld ){
|
if( iNew<iOld ){
|
||||||
@ -74817,7 +74821,12 @@ SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){
|
|||||||
iCellIdx = pCur->ix;
|
iCellIdx = pCur->ix;
|
||||||
pPage = pCur->pPage;
|
pPage = pCur->pPage;
|
||||||
pCell = findCell(pPage, iCellIdx);
|
pCell = findCell(pPage, iCellIdx);
|
||||||
if( pPage->nFree<0 && btreeComputeFreeSpace(pPage) ) return SQLITE_CORRUPT;
|
if( pPage->nFree<0 && btreeComputeFreeSpace(pPage) ){
|
||||||
|
return SQLITE_CORRUPT_BKPT;
|
||||||
|
}
|
||||||
|
if( pPage->nCell<=iCellIdx ){
|
||||||
|
return SQLITE_CORRUPT_BKPT;
|
||||||
|
}
|
||||||
|
|
||||||
/* If the bPreserve flag is set to true, then the cursor position must
|
/* If the bPreserve flag is set to true, then the cursor position must
|
||||||
** be preserved following this delete operation. If the current delete
|
** be preserved following this delete operation. If the current delete
|
||||||
@ -84101,7 +84110,7 @@ SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){
|
|||||||
/* The index entry must begin with a header size */
|
/* The index entry must begin with a header size */
|
||||||
getVarint32NR((u8*)m.z, szHdr);
|
getVarint32NR((u8*)m.z, szHdr);
|
||||||
testcase( szHdr==3 );
|
testcase( szHdr==3 );
|
||||||
testcase( szHdr==m.n );
|
testcase( szHdr==(u32)m.n );
|
||||||
testcase( szHdr>0x7fffffff );
|
testcase( szHdr>0x7fffffff );
|
||||||
assert( m.n>=0 );
|
assert( m.n>=0 );
|
||||||
if( unlikely(szHdr<3 || szHdr>(unsigned)m.n) ){
|
if( unlikely(szHdr<3 || szHdr>(unsigned)m.n) ){
|
||||||
@ -90511,6 +90520,7 @@ case OP_SetCookie: {
|
|||||||
/* When the schema cookie changes, record the new cookie internally */
|
/* When the schema cookie changes, record the new cookie internally */
|
||||||
pDb->pSchema->schema_cookie = pOp->p3 - pOp->p5;
|
pDb->pSchema->schema_cookie = pOp->p3 - pOp->p5;
|
||||||
db->mDbFlags |= DBFLAG_SchemaChange;
|
db->mDbFlags |= DBFLAG_SchemaChange;
|
||||||
|
sqlite3FkClearTriggerCache(db, pOp->p1);
|
||||||
}else if( pOp->p2==BTREE_FILE_FORMAT ){
|
}else if( pOp->p2==BTREE_FILE_FORMAT ){
|
||||||
/* Record changes in the file format */
|
/* Record changes in the file format */
|
||||||
pDb->pSchema->file_format = pOp->p3;
|
pDb->pSchema->file_format = pOp->p3;
|
||||||
@ -99143,7 +99153,7 @@ static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
|
|||||||
p->pFirst = 0;
|
p->pFirst = 0;
|
||||||
}else{
|
}else{
|
||||||
i64 iOff = p->nChunkSize;
|
i64 iOff = p->nChunkSize;
|
||||||
for(pIter=p->pFirst; ALWAYS(pIter) && iOff<=size; pIter=pIter->pNext){
|
for(pIter=p->pFirst; ALWAYS(pIter) && iOff<size; pIter=pIter->pNext){
|
||||||
iOff += p->nChunkSize;
|
iOff += p->nChunkSize;
|
||||||
}
|
}
|
||||||
if( ALWAYS(pIter) ){
|
if( ALWAYS(pIter) ){
|
||||||
@ -123234,6 +123244,25 @@ static void fkTriggerDelete(sqlite3 *dbMem, Trigger *p){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Clear the apTrigger[] cache of CASCADE triggers for all foreign keys
|
||||||
|
** in a particular database. This needs to happen when the schema
|
||||||
|
** changes.
|
||||||
|
*/
|
||||||
|
SQLITE_PRIVATE void sqlite3FkClearTriggerCache(sqlite3 *db, int iDb){
|
||||||
|
HashElem *k;
|
||||||
|
Hash *pHash = &db->aDb[iDb].pSchema->tblHash;
|
||||||
|
for(k=sqliteHashFirst(pHash); k; k=sqliteHashNext(k)){
|
||||||
|
Table *pTab = sqliteHashData(k);
|
||||||
|
FKey *pFKey;
|
||||||
|
if( !IsOrdinaryTable(pTab) ) continue;
|
||||||
|
for(pFKey=pTab->u.tab.pFKey; pFKey; pFKey=pFKey->pNextFrom){
|
||||||
|
fkTriggerDelete(db, pFKey->apTrigger[0]); pFKey->apTrigger[0] = 0;
|
||||||
|
fkTriggerDelete(db, pFKey->apTrigger[1]); pFKey->apTrigger[1] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** This function is called to generate code that runs when table pTab is
|
** This function is called to generate code that runs when table pTab is
|
||||||
** being dropped from the database. The SrcList passed as the second argument
|
** being dropped from the database. The SrcList passed as the second argument
|
||||||
@ -124034,7 +124063,7 @@ SQLITE_PRIVATE void sqlite3OpenTable(
|
|||||||
}else{
|
}else{
|
||||||
Index *pPk = sqlite3PrimaryKeyIndex(pTab);
|
Index *pPk = sqlite3PrimaryKeyIndex(pTab);
|
||||||
assert( pPk!=0 );
|
assert( pPk!=0 );
|
||||||
assert( pPk->tnum==pTab->tnum );
|
assert( pPk->tnum==pTab->tnum || CORRUPT_DB );
|
||||||
sqlite3VdbeAddOp3(v, opcode, iCur, pPk->tnum, iDb);
|
sqlite3VdbeAddOp3(v, opcode, iCur, pPk->tnum, iDb);
|
||||||
sqlite3VdbeSetP4KeyInfo(pParse, pPk);
|
sqlite3VdbeSetP4KeyInfo(pParse, pPk);
|
||||||
VdbeComment((v, "%s", pTab->zName));
|
VdbeComment((v, "%s", pTab->zName));
|
||||||
@ -126540,7 +126569,6 @@ SQLITE_PRIVATE void sqlite3CompleteInsertion(
|
|||||||
}
|
}
|
||||||
pik_flags = (useSeekResult ? OPFLAG_USESEEKRESULT : 0);
|
pik_flags = (useSeekResult ? OPFLAG_USESEEKRESULT : 0);
|
||||||
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
|
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
|
||||||
assert( pParse->nested==0 );
|
|
||||||
pik_flags |= OPFLAG_NCHANGE;
|
pik_flags |= OPFLAG_NCHANGE;
|
||||||
pik_flags |= (update_flags & OPFLAG_SAVEPOSITION);
|
pik_flags |= (update_flags & OPFLAG_SAVEPOSITION);
|
||||||
if( update_flags==0 ){
|
if( update_flags==0 ){
|
||||||
@ -132946,7 +132974,7 @@ static int sqlite3Prepare(
|
|||||||
sParse.checkSchema = 0;
|
sParse.checkSchema = 0;
|
||||||
}
|
}
|
||||||
if( sParse.rc!=SQLITE_OK && sParse.rc!=SQLITE_DONE ){
|
if( sParse.rc!=SQLITE_OK && sParse.rc!=SQLITE_DONE ){
|
||||||
if( sParse.checkSchema ){
|
if( sParse.checkSchema && db->init.busy==0 ){
|
||||||
schemaIsValid(&sParse);
|
schemaIsValid(&sParse);
|
||||||
}
|
}
|
||||||
if( sParse.pVdbe ){
|
if( sParse.pVdbe ){
|
||||||
@ -141889,7 +141917,7 @@ static void codeReturningTrigger(
|
|||||||
}
|
}
|
||||||
sqlite3ExprListDelete(db, sSelect.pEList);
|
sqlite3ExprListDelete(db, sSelect.pEList);
|
||||||
pNew = sqlite3ExpandReturning(pParse, pReturning->pReturnEL, pTab);
|
pNew = sqlite3ExpandReturning(pParse, pReturning->pReturnEL, pTab);
|
||||||
if( pNew ){
|
if( !db->mallocFailed ){
|
||||||
NameContext sNC;
|
NameContext sNC;
|
||||||
memset(&sNC, 0, sizeof(sNC));
|
memset(&sNC, 0, sizeof(sNC));
|
||||||
if( pReturning->nRetCol==0 ){
|
if( pReturning->nRetCol==0 ){
|
||||||
@ -141901,7 +141929,9 @@ static void codeReturningTrigger(
|
|||||||
sNC.ncFlags = NC_UBaseReg;
|
sNC.ncFlags = NC_UBaseReg;
|
||||||
pParse->eTriggerOp = pTrigger->op;
|
pParse->eTriggerOp = pTrigger->op;
|
||||||
pParse->pTriggerTab = pTab;
|
pParse->pTriggerTab = pTab;
|
||||||
if( sqlite3ResolveExprListNames(&sNC, pNew)==SQLITE_OK ){
|
if( sqlite3ResolveExprListNames(&sNC, pNew)==SQLITE_OK
|
||||||
|
&& !db->mallocFailed
|
||||||
|
){
|
||||||
int i;
|
int i;
|
||||||
int nCol = pNew->nExpr;
|
int nCol = pNew->nExpr;
|
||||||
int reg = pParse->nMem+1;
|
int reg = pParse->nMem+1;
|
||||||
@ -141909,16 +141939,17 @@ static void codeReturningTrigger(
|
|||||||
pReturning->iRetReg = reg;
|
pReturning->iRetReg = reg;
|
||||||
for(i=0; i<nCol; i++){
|
for(i=0; i<nCol; i++){
|
||||||
Expr *pCol = pNew->a[i].pExpr;
|
Expr *pCol = pNew->a[i].pExpr;
|
||||||
|
assert( pCol!=0 ); /* Due to !db->mallocFailed ~9 lines above */
|
||||||
sqlite3ExprCodeFactorable(pParse, pCol, reg+i);
|
sqlite3ExprCodeFactorable(pParse, pCol, reg+i);
|
||||||
}
|
}
|
||||||
sqlite3VdbeAddOp3(v, OP_MakeRecord, reg, i, reg+i);
|
sqlite3VdbeAddOp3(v, OP_MakeRecord, reg, i, reg+i);
|
||||||
sqlite3VdbeAddOp2(v, OP_NewRowid, pReturning->iRetCur, reg+i+1);
|
sqlite3VdbeAddOp2(v, OP_NewRowid, pReturning->iRetCur, reg+i+1);
|
||||||
sqlite3VdbeAddOp3(v, OP_Insert, pReturning->iRetCur, reg+i, reg+i+1);
|
sqlite3VdbeAddOp3(v, OP_Insert, pReturning->iRetCur, reg+i, reg+i+1);
|
||||||
}
|
}
|
||||||
sqlite3ExprListDelete(db, pNew);
|
|
||||||
pParse->eTriggerOp = 0;
|
|
||||||
pParse->pTriggerTab = 0;
|
|
||||||
}
|
}
|
||||||
|
sqlite3ExprListDelete(db, pNew);
|
||||||
|
pParse->eTriggerOp = 0;
|
||||||
|
pParse->pTriggerTab = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -232502,7 +232533,7 @@ static void fts5SourceIdFunc(
|
|||||||
){
|
){
|
||||||
assert( nArg==0 );
|
assert( nArg==0 );
|
||||||
UNUSED_PARAM2(nArg, apUnused);
|
UNUSED_PARAM2(nArg, apUnused);
|
||||||
sqlite3_result_text(pCtx, "fts5: 2021-12-30 15:30:28 378629bf2ea546f73eee84063c5358439a12f7300e433f18c9e1bddd948dea62", -1, SQLITE_TRANSIENT);
|
sqlite3_result_text(pCtx, "fts5: 2022-01-06 13:25:41 872ba256cbf61d9290b571c0e6d82a20c224ca3ad82971edc46b29818d5d17a0", -1, SQLITE_TRANSIENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
6
deps/sqlite/sqlite3.h
vendored
6
deps/sqlite/sqlite3.h
vendored
@ -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.37.1"
|
#define SQLITE_VERSION "3.37.2"
|
||||||
#define SQLITE_VERSION_NUMBER 3037001
|
#define SQLITE_VERSION_NUMBER 3037002
|
||||||
#define SQLITE_SOURCE_ID "2021-12-30 15:30:28 378629bf2ea546f73eee84063c5358439a12f7300e433f18c9e1bddd948dea62"
|
#define SQLITE_SOURCE_ID "2022-01-06 13:25:41 872ba256cbf61d9290b571c0e6d82a20c224ca3ad82971edc46b29818d5d17a0"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** CAPI3REF: Run-Time Library Version Numbers
|
** CAPI3REF: Run-Time Library Version Numbers
|
||||||
|
Loading…
Reference in New Issue
Block a user