Skip to content

Commit

Permalink
[bugfix](VecDateTimeValue) eat the value of microsecond in function f…
Browse files Browse the repository at this point in the history
…rom_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]>
  • Loading branch information
xiaojunjie and xiaojunjie authored Oct 20, 2022
1 parent b3235ee commit 54ed8fb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions be/src/vec/runtime/vdatetime_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 54ed8fb

Please sign in to comment.