From 40c13bf6097f304db5f051dfe6c0ffb1bf450970 Mon Sep 17 00:00:00 2001 From: morrySnow Date: Fri, 24 May 2024 14:55:44 +0800 Subject: [PATCH] Revert "[fix](jdbc_catalog) fix error datetime literal caused be core (#34977)" This reverts commit cddf62b4c91ac4201b622e7ba672375f2e46e31f. It introduce a behavior change, below case will failed after this PR CREATE TABLE `roles` ( role_id INT, occupation VARCHAR(32), camp VARCHAR(32), register_time DATE ) UNIQUE KEY(role_id) PARTITION BY RANGE (role_id) ( PARTITION p1 VALUES LESS THAN ("10") ) DISTRIBUTED BY HASH(role_id) BUCKETS 1 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "binlog.enable" = "true" ); INSERT INTO `roles` VALUES (0, 'who am I', NULL, NULL), (1, 'mage', 'alliance', '2018-12-03 16:11:28'), (2, 'paladin', 'alliance', '2018-11-30 16:11:28'), (3, 'rogue', 'horde', '2018-12-01 16:11:28'), (4, 'priest', 'alliance', '2018-12-02 16:11:28'), (5, 'shaman', 'horde', NULL), (6, 'warrior', 'alliance', NULL), (7, 'warlock', 'horde', '2018-12-04 16:11:28'), (8, 'hunter', 'horde', NULL); the original plan is right. the bug should be fixed on BE --- .../apache/doris/analysis/StringLiteral.java | 5 +++- .../datetimev2/test_invalid_hour.out | 2 +- .../datatype_p0/datetimev2/test_timezone.out | 4 +++ .../datetime_functions/test_date_function.out | 2 +- ...est_inlineview_with_window_function.groovy | 8 +++--- .../datetimev2/test_invalid_hour.groovy | 4 +-- .../datetimev2/test_timezone.groovy | 28 +++++++++++-------- .../suites/mv_p0/test_o2/test_o2.groovy | 4 +-- .../join/test_runtimefilter_on_datev2.groovy | 10 +++---- .../test_date_function.groovy | 2 +- .../test_cast_datetime.groovy | 2 +- .../test_timestamp_arithmetic.groovy | 2 +- .../point_query_p0/test_point_query.groovy | 24 ++++++++-------- .../test_date_function.groovy | 4 +-- 14 files changed, 56 insertions(+), 45 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/StringLiteral.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/StringLiteral.java index 4aa7d8ff7a3b0e..57bc67fdc3ee7f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/StringLiteral.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/StringLiteral.java @@ -257,10 +257,13 @@ protected Expr uncheckedCastTo(Type targetType) throws AnalysisException { break; } } else if (targetType.isDateType()) { + // FE only support 'yyyy-MM-dd hh:mm:ss' && 'yyyy-MM-dd' format + // so if FE unchecked cast fail, we also build CastExpr for BE + // BE support other format such as 'yyyyMMdd'... try { return convertToDate(targetType); } catch (AnalysisException e) { - throw new AnalysisException(e.getMessage()); + // pass; } } else if (targetType.equals(type)) { return this; diff --git a/regression-test/data/datatype_p0/datetimev2/test_invalid_hour.out b/regression-test/data/datatype_p0/datetimev2/test_invalid_hour.out index c4964d22a76bef..6a036dfeef2b7f 100644 --- a/regression-test/data/datatype_p0/datetimev2/test_invalid_hour.out +++ b/regression-test/data/datatype_p0/datetimev2/test_invalid_hour.out @@ -6,7 +6,7 @@ \N -- !sql -- -1 2023-12-12 12:00:00 2023-12-12T11:00 2023-12-12T12:00 +1 2023-12-12 24:00:00 \N \N 2 2023-12-12 23:00:00 2023-12-12T23:00 2023-12-12T23:00 -- !sql -- diff --git a/regression-test/data/datatype_p0/datetimev2/test_timezone.out b/regression-test/data/datatype_p0/datetimev2/test_timezone.out index 152434df2d9513..5dd1b615b8479b 100644 --- a/regression-test/data/datatype_p0/datetimev2/test_timezone.out +++ b/regression-test/data/datatype_p0/datetimev2/test_timezone.out @@ -3,7 +3,9 @@ 2022-01-01T01:02:55 2022-01-01 2022-02-01T03:02:55 2022-02-01 2022-02-28T19:02:55 2022-03-01 +2022-04-01T09:02:55 2022-03-31 2022-05-01T00:32:55 2022-05-01 +2022-05-31T22:32:55 2022-06-01 2022-06-30T20:02:55 2022-07-01 2022-07-31T21:00 2022-08-01 @@ -11,7 +13,9 @@ 2022-01-01T01:02:55 2022-01-01 2022-02-01T03:02:55 2022-02-01 2022-02-28T19:02:55 2022-03-01 +2022-04-01T09:02:55 2022-03-31 2022-05-01T00:32:55 2022-05-01 +2022-05-31T22:32:55 2022-06-01 2022-06-30T20:02:55 2022-07-01 2022-07-31T21:00 2022-08-01 diff --git a/regression-test/data/query_p0/sql_functions/datetime_functions/test_date_function.out b/regression-test/data/query_p0/sql_functions/datetime_functions/test_date_function.out index 587eed35e9b1f6..ff0cde4324d777 100644 --- a/regression-test/data/query_p0/sql_functions/datetime_functions/test_date_function.out +++ b/regression-test/data/query_p0/sql_functions/datetime_functions/test_date_function.out @@ -183,7 +183,7 @@ 16 -- !sql -- --368879 +\N -- !sql -- 31 diff --git a/regression-test/suites/correctness_p0/test_inlineview_with_window_function.groovy b/regression-test/suites/correctness_p0/test_inlineview_with_window_function.groovy index 66ca87bc39bf3c..359874f52d03c3 100644 --- a/regression-test/suites/correctness_p0/test_inlineview_with_window_function.groovy +++ b/regression-test/suites/correctness_p0/test_inlineview_with_window_function.groovy @@ -111,10 +111,10 @@ suite("test_inlineview_with_window_function") { group by ordernum ORDER BY ordernum;""" - sql """insert into test_table_aaa values('cib2205045_1_1s','2023-06-10 03:55:33','{"DB1":168939,"DNT":"2023-06-10 03:55:33"}');""" - sql """insert into test_table_aaa values('cib2205045_1_1s','2023-06-10 03:56:33','{"DB1":168939,"DNT":"2023-06-10 03:56:33"}');""" - sql """insert into test_table_aaa values('cib2205045_1_1s','2023-06-10 03:57:33','{"DB1":168939,"DNT":"2023-06-10 03:57:33"}');""" - sql """insert into test_table_aaa values('cib2205045_1_1s','2023-06-10 03:58:33','{"DB1":168939,"DNT":"2023-06-10 03:58:33"}');""" + sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:55:33','{"DB1":168939,"DNT":"2023-06-10 03:55:33"}');""" + sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:56:33','{"DB1":168939,"DNT":"2023-06-10 03:56:33"}');""" + sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:57:33','{"DB1":168939,"DNT":"2023-06-10 03:57:33"}');""" + sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:58:33','{"DB1":168939,"DNT":"2023-06-10 03:58:33"}');""" qt_order """select '2023-06-10', diff --git a/regression-test/suites/datatype_p0/datetimev2/test_invalid_hour.groovy b/regression-test/suites/datatype_p0/datetimev2/test_invalid_hour.groovy index 2af5db415061bc..e72f0dc6cba41b 100644 --- a/regression-test/suites/datatype_p0/datetimev2/test_invalid_hour.groovy +++ b/regression-test/suites/datatype_p0/datetimev2/test_invalid_hour.groovy @@ -58,7 +58,7 @@ suite("test_invalid_hour") { sql """ insert into test_invalid_hour_null values - (1, "2023-12-12 12:00:00", "2023-12-12 11:00:00"), + (1, "2023-12-12 24:00:00", "2023-12-12 24:00:00"), (2, "2023-12-12 23:00:00", "2023-12-12 23:00:00") """ @@ -76,7 +76,7 @@ suite("test_invalid_hour") { """ } catch (Exception e) { logger.info("exception: " + e) - assertTrue(e.toString().contains("Invalid date value")) + assertTrue(e.toString().contains("Insert has filtered data in strict mode")) } qt_sql """ diff --git a/regression-test/suites/datatype_p0/datetimev2/test_timezone.groovy b/regression-test/suites/datatype_p0/datetimev2/test_timezone.groovy index a49f71683573c2..c15404bf0236d9 100644 --- a/regression-test/suites/datatype_p0/datetimev2/test_timezone.groovy +++ b/regression-test/suites/datatype_p0/datetimev2/test_timezone.groovy @@ -35,22 +35,26 @@ suite("test_timezone") { sql """ set time_zone = '+02:00' """ sql """ set enable_nereids_planner = false """ - sql """insert into ${table} values('2022-01-01 01:02:55', '2022-01-01')""" - sql """insert into ${table} values('2022-02-01 01:02:55Z', '2022-02-01')""" - sql """insert into ${table} values('2022-03-01 01:02:55UTC+8', '2022-03-01')""" - sql """insert into ${table} values('2022-05-01 01:02:55+02:30', '2022-05-01')""" - sql """insert into ${table} values('20220701010255+07:00', '20220701')""" - sql """insert into ${table} values('20220801GMT+5', '20220801')""" + sql """insert into ${table} values('2022-01-01 01:02:55', '2022-01-01 01:02:55.123')""" + sql """insert into ${table} values('2022-02-01 01:02:55Z', '2022-02-01 01:02:55.123Z')""" + sql """insert into ${table} values('2022-03-01 01:02:55UTC+8', '2022-03-01 01:02:55.123UTC')""" + sql """insert into ${table} values('2022-04-01T01:02:55UTC-6', '2022-04-01T01:02:55.123UTC+6')""" + sql """insert into ${table} values('2022-05-01 01:02:55+02:30', '2022-05-01 01:02:55.123-02:30')""" + sql """insert into ${table} values('2022-06-01T01:02:55+04:30', '2022-06-01 01:02:55.123-07:30')""" + sql """insert into ${table} values('20220701010255+07:00', '20220701010255-05:00')""" + sql """insert into ${table} values('20220801GMT+5', '20220801GMT-3')""" qt_analysis "select * from ${table} order by k1" sql """ truncate table ${table} """ sql """ set enable_nereids_planner = true """ - sql """insert into ${table} values('2022-01-01 01:02:55', '2022-01-01')""" - sql """insert into ${table} values('2022-02-01 01:02:55Z', '2022-02-01')""" - sql """insert into ${table} values('2022-03-01 01:02:55UTC+8', '2022-03-01')""" - sql """insert into ${table} values('2022-05-01 01:02:55+02:30', '2022-05-01')""" - sql """insert into ${table} values('20220701010255+07:00', '20220701')""" - sql """insert into ${table} values('20220801GMT+5', '20220801')""" + sql """insert into ${table} values('2022-01-01 01:02:55', '2022-01-01 01:02:55.123')""" + sql """insert into ${table} values('2022-02-01 01:02:55Z', '2022-02-01 01:02:55.123Z')""" + sql """insert into ${table} values('2022-03-01 01:02:55UTC+8', '2022-03-01 01:02:55.123UTC')""" + sql """insert into ${table} values('2022-04-01T01:02:55UTC-6', '2022-04-01T01:02:55.123UTC+6')""" + sql """insert into ${table} values('2022-05-01 01:02:55+02:30', '2022-05-01 01:02:55.123-02:30')""" + sql """insert into ${table} values('2022-06-01T01:02:55+04:30', '2022-06-01 01:02:55.123-07:30')""" + sql """insert into ${table} values('20220701010255+07:00', '20220701010255-05:00')""" + sql """insert into ${table} values('20220801GMT+5', '20220801GMT-3')""" qt_nereids "select * from ${table} order by k1" } diff --git a/regression-test/suites/mv_p0/test_o2/test_o2.groovy b/regression-test/suites/mv_p0/test_o2/test_o2.groovy index a2c6201c74bced..c999025358458d 100644 --- a/regression-test/suites/mv_p0/test_o2/test_o2.groovy +++ b/regression-test/suites/mv_p0/test_o2/test_o2.groovy @@ -45,12 +45,12 @@ suite ("test_o2") { ); """ - sql """insert into o2_order_events values ("2023-08-16 22:27:00","ax",1,"asd",2,1,1,1,1,1,1,1);""" + sql """insert into o2_order_events values ("2023-08-16 22:27:00 ","ax",1,"asd",2,1,1,1,1,1,1,1);""" createMV (""" create materialized view o2_order_events_mv as select ts,metric_name,platform,sum(count_value) from o2_order_events group by ts,metric_name,platform;;""") - sql """insert into o2_order_events values ("2023-08-16 22:27:00","ax",1,"asd",2,1,1,1,1,1,1,1);""" + sql """insert into o2_order_events values ("2023-08-16 22:27:00 ","ax",1,"asd",2,1,1,1,1,1,1,1);""" explain { sql("select ts,metric_name,platform,sum(count_value) from o2_order_events group by ts,metric_name,platform;") diff --git a/regression-test/suites/nereids_p0/join/test_runtimefilter_on_datev2.groovy b/regression-test/suites/nereids_p0/join/test_runtimefilter_on_datev2.groovy index 38710ff47b9324..768ef7da586583 100644 --- a/regression-test/suites/nereids_p0/join/test_runtimefilter_on_datev2.groovy +++ b/regression-test/suites/nereids_p0/join/test_runtimefilter_on_datev2.groovy @@ -251,12 +251,12 @@ suite("test_runtimefilter_on_datev2", "nereids_p0") { """ sql """ insert into dt_rftest_l values - ("2001-11-11"), - ("2011-11-11"), - ("9999-11-11"); + ("2001-11-11 11:11:11.123455"), + ("2011-11-11 11:11:11.123455"), + ("9999-11-11 11:11:11.123456"); """ sql """ - insert into dt_rftest_r values("2011-11-11"); + insert into dt_rftest_r values("2011-11-11 11:11:11.123456"); """ qt_datetime_rf_1_p1 """ select /*+SET_VAR(parallel_pipeline_task_num=1)*/ * from dt_rftest_l join dt_rftest_r on k1_date_l = k1_date_r order by 1, 2; @@ -325,7 +325,7 @@ suite("test_runtimefilter_on_datev2", "nereids_p0") { """ sql """ insert into dt_rftest_l values - ("9999-12-31"); + ("9999-12-31 23:59:59"); """ sql """ insert into dt_rftest_r values ("9999-12-31 23:59:59.999999"); 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 9a66b90aa358d4..a1650f95d39661 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 @@ -610,7 +610,7 @@ suite("test_date_function") { ('2022-01-01', '2022-01-01', '2022-01-01 00:00:00', '2022-01-01 00:00:00'), ('2000-02-01', '2000-02-01', '2000-02-01 00:00:00', '2000-02-01 00:00:00.123'), ('2022-02-27', '2022-02-27', '2022-02-27 00:00:00', '2022-02-27 00:00:00'), - ('2022-02-28', '2022-02-28', '2022-02-28 23:59:59', '2022-02-28 23:59:59');""" + ('2022-02-28', '2022-02-28', '2022-02-28T23:59:59', '2022-02-28T23:59:59');""" qt_sql """ select last_day(birth), last_day(birth1), last_day(birth2), last_day(birth3) diff --git a/regression-test/suites/nereids_syntax_p0/test_cast_datetime.groovy b/regression-test/suites/nereids_syntax_p0/test_cast_datetime.groovy index 2dc4f346da70d1..924938c136e3a0 100644 --- a/regression-test/suites/nereids_syntax_p0/test_cast_datetime.groovy +++ b/regression-test/suites/nereids_syntax_p0/test_cast_datetime.groovy @@ -36,7 +36,7 @@ suite("test_cast_datetime") { ); """ - sql "insert into casttbl values ('2000-01-01', '2000-01-01', '2000-01-01', '2000-01-01 12:12:12');" + sql "insert into casttbl values ('2000-01-01', '2000-01-01 12:12:12', '2000-01-01', '2000-01-01 12:12:12');" sql "set enable_nereids_planner=true;" diff --git a/regression-test/suites/nereids_syntax_p0/test_timestamp_arithmetic.groovy b/regression-test/suites/nereids_syntax_p0/test_timestamp_arithmetic.groovy index cd61c2b3940b47..47c52578730fd9 100644 --- a/regression-test/suites/nereids_syntax_p0/test_timestamp_arithmetic.groovy +++ b/regression-test/suites/nereids_syntax_p0/test_timestamp_arithmetic.groovy @@ -55,7 +55,7 @@ suite("nereids_timestamp_arithmetic") { """ sql """ - INSERT INTO nereids_test_ta VALUES (1, '0001-01-01', '0001-01-01', '0001-01-01 00:01:01', '0001-01-01 00:01:01.001', '0001-01-01 00:01:01.00305'); + INSERT INTO nereids_test_ta VALUES (1, '0001-01-01', '0001-01-01', '0001-01-01 00:01:01', '0001-01-01: 00:01:01.001', '0001-01-01 00:01:01.00305'); """ qt_test_add """ diff --git a/regression-test/suites/point_query_p0/test_point_query.groovy b/regression-test/suites/point_query_p0/test_point_query.groovy index da74b64f8e2396..5be89b840b1ae4 100644 --- a/regression-test/suites/point_query_p0/test_point_query.groovy +++ b/regression-test/suites/point_query_p0/test_point_query.groovy @@ -128,16 +128,16 @@ suite("test_point_query") { def sql2 = create_table_sql("\"function_column.sequence_col\" = 'k6',") sql """ ${sql2} """ } - sql """ INSERT INTO ${tableName} VALUES(1231, 119291.11, "ddd", "laooq", null, "2020-01-01 12:36:38", null, "1022-01-01", null, 1.111112, [119181.1111, 819019.1191, null], null) """ - sql """ INSERT INTO ${tableName} VALUES(1232, 12222.99121135, "xxx", "laooq", "2023-01-02", "2020-01-01 12:36:38", 522.762, "2022-01-01", 1, 212.111, null, null) """ - sql """ INSERT INTO ${tableName} VALUES(1233, 1.392932911, "yyy", "laooq", "2024-01-02", "2020-01-01 12:36:38", 52.862, "3022-01-01", 0, 5973903488739435.668, [119181.1111, null, 819019.1191], ["dijiiixxx"]) """ - sql """ INSERT INTO ${tableName} VALUES(1234, 12919291.129191137, "xxddd", "laooq", "2025-01-02", "2020-01-01 12:36:38", 552.872, "4022-01-01", 1, 5973903488739435.668, [1888109181.192111, 192129019.1191], ["1", "2", "3"]) """ - sql """ INSERT INTO ${tableName} VALUES(1235, 991129292901.11138, "dd", null, "2120-01-02", "2020-01-01 12:36:38", 652.692, "5022-01-01", 0, 90696620686827832.374, [119181.1111], ["${generateString(251)}"]) """ - sql """ INSERT INTO ${tableName} VALUES(1236, 100320.11139, "laa ddd", "laooq", "2220-01-02", "2020-01-01 12:36:38", 2.7692, "6022-01-01", 1, 23698.299, [], ["${generateString(251)}"]) """ - sql """ INSERT INTO ${tableName} VALUES(1237, 120939.11130, "a ddd", "laooq", "2030-01-02", "2020-01-01 12:36:38", 22.822, "7022-01-01", 0, 90696620686827832.374, [1.1, 2.2, 3.3, 4.4, 5.5], []) """ - sql """ INSERT INTO ${tableName} VALUES(251, 120939.11130, "${generateString(251)}", "laooq", "2030-01-02", "2020-01-01 12:36:38", 251, "7022-01-01", 1, 90696620686827832.374, [11111], []) """ - sql """ INSERT INTO ${tableName} VALUES(252, 120939.11130, "${generateString(252)}", "laooq", "2030-01-02", "2020-01-01 12:36:38", 252, "7022-01-01", 0, 90696620686827832.374, [0], null) """ - sql """ INSERT INTO ${tableName} VALUES(298, 120939.11130, "${generateString(298)}", "laooq", "2030-01-02", "2020-01-01 12:36:38", 298, "7022-01-01", 1, 90696620686827832.374, [], []) """ + sql """ INSERT INTO ${tableName} VALUES(1231, 119291.11, "ddd", "laooq", null, "2020-01-01 12:36:38", null, "1022-01-01 11:30:38", null, 1.111112, [119181.1111, 819019.1191, null], null) """ + sql """ INSERT INTO ${tableName} VALUES(1232, 12222.99121135, "xxx", "laooq", "2023-01-02", "2020-01-01 12:36:38", 522.762, "2022-01-01 11:30:38", 1, 212.111, null, null) """ + sql """ INSERT INTO ${tableName} VALUES(1233, 1.392932911, "yyy", "laooq", "2024-01-02", "2020-01-01 12:36:38", 52.862, "3022-01-01 11:30:38", 0, 5973903488739435.668, [119181.1111, null, 819019.1191], ["dijiiixxx"]) """ + sql """ INSERT INTO ${tableName} VALUES(1234, 12919291.129191137, "xxddd", "laooq", "2025-01-02", "2020-01-01 12:36:38", 552.872, "4022-01-01 11:30:38", 1, 5973903488739435.668, [1888109181.192111, 192129019.1191], ["1", "2", "3"]) """ + sql """ INSERT INTO ${tableName} VALUES(1235, 991129292901.11138, "dd", null, "2120-01-02", "2020-01-01 12:36:38", 652.692, "5022-01-01 11:30:38", 0, 90696620686827832.374, [119181.1111], ["${generateString(251)}"]) """ + sql """ INSERT INTO ${tableName} VALUES(1236, 100320.11139, "laa ddd", "laooq", "2220-01-02", "2020-01-01 12:36:38", 2.7692, "6022-01-01 11:30:38", 1, 23698.299, [], ["${generateString(251)}"]) """ + sql """ INSERT INTO ${tableName} VALUES(1237, 120939.11130, "a ddd", "laooq", "2030-01-02", "2020-01-01 12:36:38", 22.822, "7022-01-01 11:30:38", 0, 90696620686827832.374, [1.1, 2.2, 3.3, 4.4, 5.5], []) """ + sql """ INSERT INTO ${tableName} VALUES(251, 120939.11130, "${generateString(251)}", "laooq", "2030-01-02", "2020-01-01 12:36:38", 251, "7022-01-01 11:30:38", 1, 90696620686827832.374, [11111], []) """ + sql """ INSERT INTO ${tableName} VALUES(252, 120939.11130, "${generateString(252)}", "laooq", "2030-01-02", "2020-01-01 12:36:38", 252, "7022-01-01 11:30:38", 0, 90696620686827832.374, [0], null) """ + sql """ INSERT INTO ${tableName} VALUES(298, 120939.11130, "${generateString(298)}", "laooq", "2030-01-02", "2020-01-01 12:36:38", 298, "7022-01-01 11:30:38", 1, 90696620686827832.374, [], []) """ def result1 = connect(user=user, password=password, url=prepare_url) { def stmt = prepareStatement "select /*+ SET_VAR(enable_nereids_planner=false) */ * from ${tableName} where k1 = ? and k2 = ? and k3 = ?" @@ -195,13 +195,13 @@ suite("test_point_query") { ALTER table ${tableName} ADD COLUMN new_column0 INT default "0"; """ sleep(1); - nprep_sql """ INSERT INTO ${tableName} VALUES(1235, 120939.11130, "a ddd", "laooq", "2030-01-02", "2020-01-01 12:36:38", 22.822, "7022-01-01", 1, 1.1111299, [119291.19291], ["111", "222", "333"], 1) """ + nprep_sql """ INSERT INTO ${tableName} VALUES(1235, 120939.11130, "a ddd", "laooq", "2030-01-02", "2020-01-01 12:36:38", 22.822, "7022-01-01 11:30:38", 1, 1.1111299, [119291.19291], ["111", "222", "333"], 1) """ stmt.setBigDecimal(1, new BigDecimal("120939.11130")) stmt.setString(2, "a ddd") qe_point_select stmt qe_point_select stmt // invalidate cache - nprep_sql """ INSERT INTO ${tableName} VALUES(1235, 120939.11130, "a ddd", "xxxxxx", "2030-01-02", "2020-01-01 12:36:38", 22.822, "7022-01-01", 0, 1929111.1111,[119291.19291], ["111", "222", "333"], 2) """ + nprep_sql """ INSERT INTO ${tableName} VALUES(1235, 120939.11130, "a ddd", "xxxxxx", "2030-01-02", "2020-01-01 12:36:38", 22.822, "7022-01-01 11:30:38", 0, 1929111.1111,[119291.19291], ["111", "222", "333"], 2) """ qe_point_select stmt qe_point_select stmt qe_point_select stmt 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 0c7b47f087d732..b6f1fea75dbd97 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 @@ -325,7 +325,7 @@ suite("test_date_function") { qt_sql """ select datediff(CAST('2007-12-31 23:59:59' AS DATETIME), CAST('2007-12-30' AS DATETIME)) """ qt_sql """ select datediff(CAST('2010-11-30 23:59:59' AS DATETIME), CAST('2010-12-31' AS DATETIME)) """ qt_sql """ select datediff('2010-10-31', '2010-10-15') """ - qt_sql """ select datediff('1000-10-31', '2010-10-15') from ${tableName}; """ + qt_sql """ select datediff('10000-10-31', '2010-10-15') from ${tableName}; """ // DAY qt_sql """ select day('1987-01-31') """ @@ -678,7 +678,7 @@ suite("test_date_function") { ('2022-01-01', '2022-01-01', '2022-01-01 00:00:00', '2022-01-01 00:00:00'), ('2000-02-01', '2000-02-01', '2000-02-01 00:00:00', '2000-02-01 00:00:00.123'), ('2022-02-27', '2022-02-27', '2022-02-27 00:00:00', '2022-02-27 00:00:00'), - ('2022-02-28', '2022-02-28', '2022-02-28 23:59:59', '2022-02-28 23:59:59');""" + ('2022-02-28', '2022-02-28', '2022-02-28T23:59:59', '2022-02-28T23:59:59');""" qt_sql """ select last_day(birth), last_day(birth1), last_day(birth2), last_day(birth3)