You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/10/20 09:37:45 UTC
[doris] branch branch-1.1-lts updated: [bugfix](VecDateTimeValue) eat the value of microsecond in function from_date_format_str (#13446) (#13504)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-1.1-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.1-lts by this push:
new 54ed8fb227 [bugfix](VecDateTimeValue) eat the value of microsecond in function from_date_format_str (#13446) (#13504)
54ed8fb227 is described below
commit 54ed8fb227645cdc35050255c20013cc6f14aa1c
Author: xiaojunjie <97...@qq.com>
AuthorDate: Thu Oct 20 17:37:40 2022 +0800
[bugfix](VecDateTimeValue) eat the value of microsecond in function from_date_format_str (#13446) (#13504)
* [bugfix](VecDateTimeValue) eat the value of microsecond in function from_date_format_str
* add sql based regression test
Co-authored-by: xiaojunjie <xi...@baidu.com>
Co-authored-by: xiaojunjie <xi...@baidu.com>
---
be/src/vec/runtime/vdatetime_value.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/be/src/vec/runtime/vdatetime_value.cpp b/be/src/vec/runtime/vdatetime_value.cpp
index 3efc4f25d6..d4fdd5a801 100644
--- a/be/src/vec/runtime/vdatetime_value.cpp
+++ b/be/src/vec/runtime/vdatetime_value.cpp
@@ -1205,6 +1205,12 @@ bool VecDateTimeValue::from_date_format_str(const char* format, int format_len,
break;
// Micro second
case 'f':
+ // _microsecond is removed, but need to eat this val
+ tmp = val + min(6, val_end - val);
+ if (!str_to_int64(val, &tmp, &int_value)) {
+ return false;
+ }
+ val = tmp;
break;
// AM/PM
case 'p':
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org