Skip to content

Commit

Permalink
Don't treat Bool and number variants as suspicious
Browse files Browse the repository at this point in the history
  • Loading branch information
Avogar committed Mar 27, 2024
1 parent c21c67f commit 043c625
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Interpreters/parseColumnsListForTableFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ void validateDataType(const DataTypePtr & type_to_check, const DataTypeValidatio
{
for (size_t j = i + 1; j < variants.size(); ++j)
{
/// Don't consider bool as similar to something (like number).
if (isBool(variants[i]) || isBool(variants[j]))
continue;

if (auto supertype = tryGetLeastSupertype(DataTypes{variants[i], variants[j]}))
{
throw Exception(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
true
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set allow_experimental_variant_type=1;
set allow_suspicious_variant_types=0;
select 'true'::Bool::Variant(UInt32, Bool);

0 comments on commit 043c625

Please sign in to comment.