diff options
Diffstat (limited to 'tests/fixtures/optimizer/canonicalize.sql')
-rw-r--r-- | tests/fixtures/optimizer/canonicalize.sql | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/fixtures/optimizer/canonicalize.sql b/tests/fixtures/optimizer/canonicalize.sql index 4db3764..98b2f07 100644 --- a/tests/fixtures/optimizer/canonicalize.sql +++ b/tests/fixtures/optimizer/canonicalize.sql @@ -96,3 +96,15 @@ DATE_TRUNC('DAY', CAST('2023-01-01' AS DATE)); DATEDIFF('2023-01-01', '2023-01-02', DAY); DATEDIFF(CAST('2023-01-01' AS DATETIME), CAST('2023-01-02' AS DATETIME), DAY); + +-------------------------------------- +-- Remove redundant casts +-------------------------------------- +CAST(CAST('2023-01-01' AS DATE) AS DATE); +CAST('2023-01-01' AS DATE); + +CAST(DATE_TRUNC('YEAR', CAST('2023-01-01' AS DATE)) AS DATE); +DATE_TRUNC('YEAR', CAST('2023-01-01' AS DATE)); + +DATE(DATE_TRUNC('YEAR', CAST("x" AS DATE))); +DATE_TRUNC('YEAR', CAST("x" AS DATE)); |