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

Allow only a single recursive reference in a recursive CTE. Also require that this reference is not part of a sub-query.

FossilOrigin-Name: a296b73360d34c9364eceb2cc09a9a92adc4abb8
This commit is contained in:
dan
2014-01-16 18:34:33 +00:00
parent 8290c2ad5a
commit eae73fbfb9
7 changed files with 62 additions and 85 deletions

View File

@@ -5654,13 +5654,7 @@ WhereInfo *sqlite3WhereBegin(
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
pLoop = pLevel->pWLoop;
if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ){
#ifndef SQLITE_OMIT_CTE
if( pTab->tabFlags & TF_Recursive ){
int iCur = pTabItem->iCursor;
sqlite3VdbeAddOp2(v, OP_OpenEphreader, iCur, pTab->tnum);
}
#endif
/* Otherwise do nothing */
/* Do nothing */
}else
#ifndef SQLITE_OMIT_VIRTUALTABLE
if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)!=0 ){