This is an automated email from the ASF dual-hosted git repository.
gabriellee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 63d48564ed [fix](datetimev2) fix datetimev2 error with T (#15915)
63d48564ed is described below
commit 63d48564ed072dd7244380d152c3b4593dbd62d6
Author: xueweizhang <[email protected]>
AuthorDate: Mon Jan 16 15:30:48 2023 +0800
[fix](datetimev2) fix datetimev2 error with T (#15915)
Signed-off-by: nextdreamblue <[email protected]>
---
be/src/vec/runtime/vdatetime_value.cpp | 1 +
.../query_p0/sql_functions/datetime_functions/test_date_function.groovy | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/be/src/vec/runtime/vdatetime_value.cpp
b/be/src/vec/runtime/vdatetime_value.cpp
index 8982391764..8111569c6b 100644
--- a/be/src/vec/runtime/vdatetime_value.cpp
+++ b/be/src/vec/runtime/vdatetime_value.cpp
@@ -1893,6 +1893,7 @@ bool DateV2Value<T>::from_date_str(const char* date_str,
int len, int scale) {
if (field_idx == 2 && *ptr == 'T') {
// YYYYMMDDTHHMMDD, skip 'T' and continue
ptr++;
+ field_idx++;
continue;
}
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 7fadf302a2..907843dd7e 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
@@ -565,7 +565,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-29', '2022-02-29', '2022-02-29 00:00:00', '2022-02-29
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)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]