diff options
author | dan <Dan Kennedy> | 2023-05-17 11:31:51 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2023-05-17 11:31:51 +0000 |
commit | 32a5feb53e69e75238bdd865b0539baf81f41f07 (patch) | |
tree | 0753f00fff253245be82415a2ee83b88e07bfb35 /src | |
parent | 010bd47b9879aa563d04827497c3a0cd91c19f7d (diff) | |
download | sqlite-32a5feb53e69e75238bdd865b0539baf81f41f07.tar.gz sqlite-32a5feb53e69e75238bdd865b0539baf81f41f07.zip |
Avoid an assert() failure that could occur in SQLITE_ENABLE_UPDATE_DELETE_LIMIT builds when a WITH clause attached to an UPDATE or DELETE statement created a CTE of the same name as the table being modified.
FossilOrigin-Name: 8edf56d1698c3db38250db3b25864f658488414efb3a6b3e1443283b6affd26d
Diffstat (limited to 'src')
-rw-r--r-- | src/delete.c | 1 | ||||
-rw-r--r-- | src/update.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/delete.c b/src/delete.c index 27a554916..f54bfdcc7 100644 --- a/src/delete.c +++ b/src/delete.c @@ -35,6 +35,7 @@ Table *sqlite3SrcListLookup(Parse *pParse, SrcList *pSrc){ pTab = sqlite3LocateTableItem(pParse, 0, pItem); sqlite3DeleteTable(pParse->db, pItem->pTab); pItem->pTab = pTab; + pItem->fg.notCte = 1; if( pTab ){ pTab->nTabRef++; if( pItem->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pItem) ){ diff --git a/src/update.c b/src/update.c index c1f136398..a01585c25 100644 --- a/src/update.c +++ b/src/update.c @@ -224,7 +224,7 @@ static void updateFromSelect( assert( pTabList->nSrc>1 ); if( pSrc ){ - pSrc->a[0].fg.notCte = 1; + assert( pSrc->a[0].fg.notCte ); pSrc->a[0].iCursor = -1; pSrc->a[0].pTab->nTabRef--; pSrc->a[0].pTab = 0; |