mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Fix error in parseDateTimeBestEffort
This commit is contained in:
parent
cece629145
commit
241017bc1f
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <cassert>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <common/defines.h>
|
#include <common/defines.h>
|
||||||
|
|
||||||
@ -11,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
inline unsigned int bitScanReverse(unsigned int x)
|
inline unsigned int bitScanReverse(unsigned int x)
|
||||||
{
|
{
|
||||||
|
assert(x != 0);
|
||||||
return sizeof(unsigned int) * 8 - 1 - __builtin_clz(x);
|
return sizeof(unsigned int) * 8 - 1 - __builtin_clz(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +104,7 @@ ReturnType parseDateTimeBestEffortImpl(
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
res = 0;
|
||||||
UInt16 year = 0;
|
UInt16 year = 0;
|
||||||
UInt8 month = 0;
|
UInt8 month = 0;
|
||||||
UInt8 day_of_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