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 <[email protected]>
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 <[email protected]>
Co-authored-by: xiaojunjie <[email protected]>
---
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: [email protected]
For additional commands, e-mail: [email protected]