diff options
Diffstat (limited to 'tests/fixtures/optimizer/optimizer.sql')
-rw-r--r-- | tests/fixtures/optimizer/optimizer.sql | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/fixtures/optimizer/optimizer.sql b/tests/fixtures/optimizer/optimizer.sql index f71ddde..38e64d7 100644 --- a/tests/fixtures/optimizer/optimizer.sql +++ b/tests/fixtures/optimizer/optimizer.sql @@ -693,3 +693,11 @@ GROUP BY "x"."a" + 1 + 1 HAVING "x"."a" + 1 + 1 + 1 + 1 > 1; + +# title: replace alias with mult expression without wrapping it +WITH cte AS (SELECT a * b AS c, a AS d, b as e FROM x) SELECT c + d - (c - e) AS f FROM cte; +SELECT + "x"."a" * "x"."b" + "x"."a" - ( + "x"."a" * "x"."b" - "x"."b" + ) AS "f" +FROM "x" AS "x"; |