From f24e254ec6c77e166791461111c7747f33334f0a Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Thu, 10 Jul 2025 14:28:38 +0300 Subject: [PATCH] core/translate: Fix "misuse of aggregate function" error message ``` sqlite> CREATE TABLE test1(f1, f2); sqlite> SELECT SUM(min(f1)) FROM test1; Parse error: misuse of aggregate function min() SELECT SUM(min(f1)) FROM test1; ^--- error here ``` Spotted by SQLite TCL tests. --- core/translate/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/translate/expr.rs b/core/translate/expr.rs index a482d119b..ea36918b6 100644 --- a/core/translate/expr.rs +++ b/core/translate/expr.rs @@ -693,7 +693,7 @@ pub fn translate_expr( match &func_ctx.func { Func::Agg(_) => { - crate::bail_parse_error!("aggregation function in non-aggregation context") + crate::bail_parse_error!("misuse of aggregate function {}()", name.0) } Func::External(_) => { let regs = program.alloc_registers(args_count);