mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 07:01:59 +00:00
Fix UBSan report in TransformDateTime64
This commit is contained in:
parent
4de5afed4e
commit
47b00ad11b
@ -49,8 +49,11 @@ public:
|
||||
{}
|
||||
|
||||
template <typename ... Args>
|
||||
inline auto execute(const DateTime64 & t, Args && ... args) const
|
||||
inline auto NO_SANITIZE_UNDEFINED execute(const DateTime64 & t, Args && ... args) const
|
||||
{
|
||||
/// Type conversion from float to integer may be required.
|
||||
/// We are Ok with implementation specific result for out of range and denormals conversion.
|
||||
|
||||
if constexpr (TransformHasExecuteOverload_v<DateTime64, decltype(scale_multiplier), Args...>)
|
||||
{
|
||||
return wrapped_transform.execute(t, scale_multiplier, std::forward<Args>(args)...);
|
||||
|
@ -0,0 +1,2 @@
|
||||
0
|
||||
0
|
2
tests/queries/0_stateless/01773_datetime64_add_ubsan.sql
Normal file
2
tests/queries/0_stateless/01773_datetime64_add_ubsan.sql
Normal file
@ -0,0 +1,2 @@
|
||||
-- The result is unspecified but UBSan should not argue.
|
||||
SELECT ignore(addHours(now64(3), inf)) FROM numbers(2);
|
Loading…
Reference in New Issue
Block a user