1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +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

@@ -2337,7 +2337,7 @@ static int multiSelectOrderBy(
pColl = sqlite3ExprCollSeq(pParse, pTerm);
}else{
pColl = multiSelectCollSeq(pParse, p, aPermute[i]);
pTerm->flags |= EP_Collate;
// pTerm->flags |= EP_Collate;
}
pKeyMerge->aColl[i] = pColl;
pKeyMerge->aSortOrder[i] = pOrderBy->a[i].sortOrder;
@@ -2540,6 +2540,7 @@ static int multiSelectOrderBy(
sqlite3VdbeAddOp4(v, OP_Permutation, 0, 0, 0, (char*)aPermute, P4_INTARRAY);
sqlite3VdbeAddOp4(v, OP_Compare, destA.iSdst, destB.iSdst, nOrderBy,
(char*)pKeyMerge, P4_KEYINFO_HANDOFF);
sqlite3VdbeChangeP5(v, OPFLAG_PERMUTE);
sqlite3VdbeAddOp3(v, OP_Jump, addrAltB, addrAeqB, addrAgtB);
/* Release temporary registers