mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix error in parseDateTimeBestEffort
This commit is contained in:
parent
cece629145
commit
241017bc1f
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
#include <common/defines.h>
|
||||
|
||||
@ -11,6 +12,7 @@
|
||||
*/
|
||||
inline unsigned int bitScanReverse(unsigned int x)
|
||||
{
|
||||
assert(x != 0);
|
||||
return sizeof(unsigned int) * 8 - 1 - __builtin_clz(x);
|
||||
}
|
||||
|
||||
|
@ -104,6 +104,7 @@ ReturnType parseDateTimeBestEffortImpl(
|
||||
return false;
|
||||
};
|
||||
|
||||
res = 0;
|
||||
UInt16 year = 0;
|
||||
UInt8 month = 0;
|
||||
UInt8 day_of_month = 0;
|
||||
|
@ -0,0 +1,3 @@
|
||||
2020-08-07 01:29:00
|
||||
1973-03-03 12:46:40
|
||||
2020-08-07 00:00:00
|
@ -0,0 +1,3 @@
|
||||
SELECT parseDateTimeBestEffort('1596752940', 'Europe/Moscow');
|
||||
SELECT parseDateTimeBestEffort('100000000', 'Europe/Moscow');
|
||||
SELECT parseDateTimeBestEffort('20200807', 'Europe/Moscow');
|
Loading…
Reference in New Issue
Block a user