Merge pull request #35500 from kitaisreal/throw-if-constant-argument-crash-fix

Fix crash for function throwIf with constant arguments
This commit is contained in:
Maksim Kita 2022-03-22 13:44:37 +01:00 committed by GitHub
commit 0576c1b0f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -131,8 +131,10 @@ public:
message.value_or("Value passed to '" + getName() + "' function is non zero"));
}
size_t result_size = in_untyped->size();
/// We return non constant to avoid constant folding.
return ColumnUInt8::create(in_data.size(), 0);
return ColumnUInt8::create(result_size, 0);
}
return nullptr;

View File

@ -0,0 +1,10 @@
0
0
0
0
0
0
0
0
0
0

View File

@ -0,0 +1 @@
SELECT throwIf(0 AND 2147483646) FROM system.numbers LIMIT 10;