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

Ensure the SF_Aggregate flag on a SELECT statement is set if a DISTINCT is transformed to a GROUP BY. Ticket [9c944882].

FossilOrigin-Name: 1409758f72c0206cc48f9f7e789382472949523b7056ea46f8dcb93fd3ea60c6
This commit is contained in:
dan
2020-01-06 17:06:12 +00:00
parent 628b1a3f9e
commit 9e10f9ab05
4 changed files with 35 additions and 9 deletions

View File

@@ -6104,6 +6104,7 @@ int sqlite3Select(
){
p->selFlags &= ~SF_Distinct;
pGroupBy = p->pGroupBy = sqlite3ExprListDup(db, pEList, 0);
p->selFlags |= SF_Aggregate;
/* Notice that even thought SF_Distinct has been cleared from p->selFlags,
** the sDistinct.isTnct is still set. Hence, isTnct represents the
** original setting of the SF_Distinct flag, not the current setting */