mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Remove some code from resolve.c that was only required for recursive cte references in sub-queries. Also a stray "finish_test" command in pagerfault.test.
FossilOrigin-Name: f68c6c4d36481526a9348244adc571ea282dc9eb
This commit is contained in:
22
src/select.c
22
src/select.c
@@ -1791,16 +1791,6 @@ static int multiSelect(
|
||||
}
|
||||
|
||||
#ifndef SQLITE_OMIT_CTE
|
||||
/* If this is a recursive query, check that there is no ORDER BY or
|
||||
** LIMIT clause. Neither of these are supported. */
|
||||
assert( p->pOffset==0 || p->pLimit );
|
||||
if( (p->selFlags & SF_Recursive) && (p->pOrderBy || p->pLimit) ){
|
||||
sqlite3ErrorMsg(pParse, "%s in a recursive query is not allowed",
|
||||
p->pOrderBy ? "ORDER BY" : "LIMIT"
|
||||
);
|
||||
goto multi_select_end;
|
||||
}
|
||||
|
||||
if( p->selFlags & SF_Recursive ){
|
||||
SrcList *pSrc = p->pSrc;
|
||||
int nCol = p->pEList->nExpr;
|
||||
@@ -1814,6 +1804,16 @@ static int multiSelect(
|
||||
SelectDest tmp2dest;
|
||||
int i;
|
||||
|
||||
/* Check that there is no ORDER BY or LIMIT clause. Neither of these
|
||||
** are supported on recursive queries. */
|
||||
assert( p->pOffset==0 || p->pLimit );
|
||||
if( p->pOrderBy || p->pLimit ){
|
||||
sqlite3ErrorMsg(pParse, "%s in a recursive query is not allowed",
|
||||
p->pOrderBy ? "ORDER BY" : "LIMIT"
|
||||
);
|
||||
goto multi_select_end;
|
||||
}
|
||||
|
||||
if( sqlite3AuthCheck(pParse, SQLITE_RECURSIVE, 0, 0, 0) ){
|
||||
goto multi_select_end;
|
||||
}
|
||||
@@ -3581,7 +3581,7 @@ static int withExpand(
|
||||
pFrom->pTab = pTab = sqlite3DbMallocZero(db, sizeof(Table));
|
||||
if( pTab==0 ) return WRC_Abort;
|
||||
pTab->nRef = 1;
|
||||
pTab->zName = sqlite3MPrintf(db, "%s", pCte->zName);
|
||||
pTab->zName = sqlite3DbStrDup(db, pCte->zName);
|
||||
pTab->iPKey = -1;
|
||||
pTab->nRowEst = 1048576;
|
||||
pTab->tabFlags |= TF_Ephemeral;
|
||||
|
||||
Reference in New Issue
Block a user