mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Detect any attempt to use an INDEXED BY clause on a CTE and report an
error. FossilOrigin-Name: 35a9de2c97b9a386070e7827a0842bb1caf3af69ea0d6f67ce2a50be3426fb63
This commit is contained in:
@@ -5253,7 +5253,10 @@ static int resolveFromTermToCte(
|
||||
if( db->mallocFailed ) return 2;
|
||||
pFrom->pSelect->selFlags |= SF_CopyCte;
|
||||
assert( pFrom->pSelect );
|
||||
assert( pFrom->fg.isIndexedBy==0 ); /* Prevent collision in union u2 */
|
||||
if( pFrom->fg.isIndexedBy ){
|
||||
sqlite3ErrorMsg(pParse, "no such index: \"%s\"", pFrom->u1.zIndexedBy);
|
||||
return 2;
|
||||
}
|
||||
pFrom->fg.isCte = 1;
|
||||
pFrom->u2.pCteUse = pCteUse;
|
||||
pCteUse->nUse++;
|
||||
|
||||
Reference in New Issue
Block a user