From 3d48060515ba25b4c49d975a520ee0682327d1b7 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Fri, 16 Feb 2024 06:45:52 +0100
Subject: Merging upstream version 21.1.1.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
---
 tests/fixtures/optimizer/canonicalize.sql | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'tests/fixtures/optimizer/canonicalize.sql')

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));
-- 
cgit v1.2.3

