1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Do not push a WITH clause onto the processing stack if prior errors have

occurred.  dbsqlfuzz 6b7a144674e215f06ddfeb9042c873d9ee956ac0.

FossilOrigin-Name: c2066dde53b9872dbb991e27419dd031791c942fe23826556f52efbd66c51662
This commit is contained in:
drh
2021-05-23 17:47:04 +00:00
parent 5e1a7ded4d
commit 7cc73b399e
4 changed files with 26 additions and 13 deletions

View File

@@ -5021,16 +5021,18 @@ static struct Cte *searchWith(
**
** This routine pushes the WITH clause passed as the second argument
** onto the top of the stack. If argument bFree is true, then this
** WITH clause will never be popped from the stack. In this case it
** should be freed along with the Parse object. In other cases, when
** WITH clause will never be popped from the stack but should instead
** be freed along with the Parse object. In other cases, when
** bFree==0, the With object will be freed along with the SELECT
** statement with which it is associated.
*/
void sqlite3WithPush(Parse *pParse, With *pWith, u8 bFree){
if( pWith ){
assert( pParse->pWith!=pWith );
pWith->pOuter = pParse->pWith;
pParse->pWith = pWith;
if( pParse->nErr==0 ){
assert( pParse->pWith!=pWith );
pWith->pOuter = pParse->pWith;
pParse->pWith = pWith;
}
if( bFree ){
sqlite3ParserAddCleanup(pParse,
(void(*)(sqlite3*,void*))sqlite3WithDelete,