Merge 'core/translate: Fix "misuse of aggregate function" error message' from Pekka Enberg

```
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.

Closes #2032
This commit is contained in:
Pekka Enberg
2025-07-10 16:35:30 +03:00

View File

@@ -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);