mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 16:50:48 +00:00
Merge pull request #45067 from kitaisreal/jit-compilation-float-to-bool-conversion-fix
JIT compilation float to bool conversion fix
This commit is contained in:
commit
c1ae35958d
@ -138,7 +138,7 @@ static inline llvm::Value * nativeBoolCast(llvm::IRBuilder<> & b, const DataType
|
||||
if (value->getType()->isIntegerTy())
|
||||
return b.CreateICmpNE(value, zero);
|
||||
if (value->getType()->isFloatingPointTy())
|
||||
return b.CreateFCmpONE(value, zero); /// QNaN is false
|
||||
return b.CreateFCmpUNE(value, zero);
|
||||
|
||||
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Cannot cast non-number {} to bool", from_type->getName());
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
@ -0,0 +1,9 @@
|
||||
SET min_count_to_compile_expression = 0;
|
||||
|
||||
SELECT NOT NOT cos(MAX(pow(1523598955, 763027371))) FROM numbers(1) SETTINGS compile_expressions = 0;
|
||||
|
||||
SELECT NOT NOT cos(MAX(pow(1523598955, 763027371))) FROM numbers(1) SETTINGS compile_expressions = 1;
|
||||
|
||||
SELECT not(not(materialize(nan))) FROM numbers(1) SETTINGS compile_expressions = 0;
|
||||
|
||||
SELECT not(not(materialize(nan))) FROM numbers(1) SETTINGS compile_expressions = 1;
|
Loading…
Reference in New Issue
Block a user