aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c
index dd543a98d..26f0b4c5c 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -6723,7 +6723,11 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){
pItem->pFunc = sqlite3FindFunction(pParse->db,
pExpr->u.zToken, nArg, enc, 0);
assert( pItem->bOBUnique==0 );
- if( pExpr->pLeft ){
+ if( pExpr->pLeft
+ && (pItem->pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL)==0
+ ){
+ /* The NEEDCOLL test above causes any ORDER BY clause on
+ ** aggregate min() or max() to be ignored. */
ExprList *pOBList;
assert( nArg>0 );
assert( pExpr->pLeft->op==TK_ORDER );