From 57c10393d7bfe86ab0a35e3fa6c8385993b81b93 Mon Sep 17 00:00:00 2001 From: 924060929 Date: Thu, 28 Nov 2024 15:07:57 +0800 Subject: [PATCH] fix --- .../datetime_functions/test_date_function.groovy | 13 +++++++++++++ .../datetime_functions/test_date_function.groovy | 15 --------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/regression-test/suites/nereids_p0/sql_functions/datetime_functions/test_date_function.groovy b/regression-test/suites/nereids_p0/sql_functions/datetime_functions/test_date_function.groovy index 5bde4423253744..b7a3b7a4da7e77 100644 --- a/regression-test/suites/nereids_p0/sql_functions/datetime_functions/test_date_function.groovy +++ b/regression-test/suites/nereids_p0/sql_functions/datetime_functions/test_date_function.groovy @@ -720,4 +720,17 @@ suite("test_date_function") { qt_sql_time_value """ select cast(4562632 as time), hour(cast(4562632 as time)) , minute(cast(4562632 as time)) , second(cast(4562632 as time)); """ + + def test_simplify = { + sql "drop table if exists test_int_date" + sql "create table test_int_date(dt int) distributed by hash(dt) properties('replication_num'='1');" + test { + sql "select months_add(dt, 1) = date '2024-02-29' from (select date '2024-01-31' as dt)a" + result([[true]]) + } + test { + sql "select years_add(dt, 1) = date '2025-02-28' from (select date '2024-02-29' as dt)a" + result([[true]]) + } + }() } diff --git a/regression-test/suites/query_p0/sql_functions/datetime_functions/test_date_function.groovy b/regression-test/suites/query_p0/sql_functions/datetime_functions/test_date_function.groovy index 5056c599f92866..511f2bc35a67a7 100644 --- a/regression-test/suites/query_p0/sql_functions/datetime_functions/test_date_function.groovy +++ b/regression-test/suites/query_p0/sql_functions/datetime_functions/test_date_function.groovy @@ -818,19 +818,4 @@ suite("test_date_function") { qt_sql_varchar1 """ select dt, fmt, unix_timestamp(dt, fmt) as k1 from date_varchar order by k1,dt,fmt; """ qt_sql_varchar1 """ select dt, unix_timestamp(dt, "%Y-%m-%d") as k1 from date_varchar order by k1,dt,fmt; """ qt_sql_varchar1 """ select fmt, unix_timestamp("1990-12-12", fmt) as k1 from date_varchar order by k1,dt,fmt; """ - - - - def test_simplify = { - sql "drop table if exists test_int_date" - sql "create table test_int_date(dt int) distributed by hash(dt) properties('replication_num'='1');" - test { - sql "select months_add(dt, 1) = date '2024-02-29' from (select date '2024-01-31' as dt)a" - result([[true]]) - } - test { - sql "select years_add(dt, 1) = date '2025-02-28' from (select date '2024-02-29' as dt)a" - result([[true]]) - } - }() }