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

Do not allow recursive CTEs that use aggregate queries in the recursive part.

FossilOrigin-Name: 6d2999afbc25b9c238e4028f637c10eaaf0ec75e
This commit is contained in:
drh
2015-07-05 22:15:10 +00:00
parent 30ae503167
commit b63ce02f57
4 changed files with 24 additions and 13 deletions

View File

@@ -2070,10 +2070,14 @@ static void generateWithRecursiveQuery(
/* Execute the recursive SELECT taking the single row in Current as
** the value for the recursive-table. Store the results in the Queue.
*/
p->pPrior = 0;
sqlite3Select(pParse, p, &destQueue);
assert( p->pPrior==0 );
p->pPrior = pSetup;
if( p->selFlags & SF_Aggregate ){
sqlite3ErrorMsg(pParse, "recursive aggregate queries not supported");
}else{
p->pPrior = 0;
sqlite3Select(pParse, p, &destQueue);
assert( p->pPrior==0 );
p->pPrior = pSetup;
}
/* Keep running the loop until the Queue is empty */
sqlite3VdbeAddOp2(v, OP_Goto, 0, addrTop);