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

For an ORDER BY on a compound SELECT, take the collating sequence from the

left-most term of the compound.

FossilOrigin-Name: 8e724b383da1314909c9a05e9d941a26a9f50b95
This commit is contained in:
drh
2012-12-07 23:10:40 +00:00
parent 62a66e7034
commit 8e049633aa
3 changed files with 10 additions and 7 deletions

View File

@@ -2337,6 +2337,9 @@ static int multiSelectOrderBy(
pColl = sqlite3ExprCollSeq(pParse, pTerm);
}else{
pColl = multiSelectCollSeq(pParse, p, aPermute[i]);
if( pColl==0 ) pColl = db->pDfltColl;
pOrderBy->a[i].pExpr =
sqlite3ExprAddCollateString(pParse, pTerm, pColl->zName);
}
pKeyMerge->aColl[i] = pColl;
pKeyMerge->aSortOrder[i] = pOrderBy->a[i].sortOrder;