mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-04 08:54:20 +01:00
Skip traversing children of aggregate functions
Aggregate functions cannot be nested, and this is validated during the translation of aggregate function arguments. Therefore, traversing their child expressions is unnecessary.
This commit is contained in:
@@ -191,3 +191,11 @@ do_execsql_test_error select-scalar-func-star {
|
||||
do_execsql_test_error select-scalar-func-star-in-expression {
|
||||
SELECT CASE WHEN abs(*) > 0 THEN 1 ELSE 0 END FROM users;
|
||||
} {.*(Invalid aggregate function|wrong number of arguments to function).*}
|
||||
|
||||
do_execsql_test_error_content select-nested-agg-func {
|
||||
SELECT max(abs(sum(age))), sum(age) FROM users;
|
||||
} {"misuse of aggregate function"}
|
||||
|
||||
do_execsql_test_error_content select-nested-agg-func-in-expression {
|
||||
SELECT CASE WHEN max(abs(sum(age))) > 0 THEN 1 ELSE 0 END, sum(age) FROM users;
|
||||
} {"misuse of aggregate function"}
|
||||
|
||||
Reference in New Issue
Block a user