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

Fix a long-standing issue with the distinct-as-aggregate optimization that

only expressed when the new collating-sequence logic is turned on.

FossilOrigin-Name: 0aaf52a339808386984c30cca0c0c35ac2e70e7e
This commit is contained in:
drh
2012-12-07 22:18:54 +00:00
parent bd13d34b08
commit 953f7611da
6 changed files with 24 additions and 27 deletions

View File

@@ -111,20 +111,9 @@ static void resolveAlias(
}
pDup->iTable = pEList->a[iCol].iAlias;
}
#if 1 /* FIXME */
if( pExpr->flags & EP_Collate ){
CollSeq *pColl = sqlite3ExprCollSeq(pParse, pExpr);
if( pColl ){
pDup = sqlite3ExprAddCollateString(pParse, pDup, pColl->zName);
}
pDup->flags |= EP_Collate;
}
#else
/* Should be this: */
if( pExpr->op==TK_COLLATE ){
pDup = sqlite3ExprAddCollateString(pParse, pDup, pExpr->u.zToken);
}
#endif
/* Before calling sqlite3ExprDelete(), set the EP_Static flag. This
** prevents ExprDelete() from deleting the Expr structure itself,