Skip to content

Commit

Permalink
Merge pull request #61999 from Avogar/variant-number-bool
Browse files Browse the repository at this point in the history
Don't treat Bool and number variants as suspicious in Variant type
  • Loading branch information
Avogar committed Mar 28, 2024
2 parents 0244e08 + 043c625 commit 70bb85a
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 70bb85a

Please sign in to comment.