mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #32506 from ClickHouse/fix-has-column-in-table-subquery
Fix queries with hasColumnInTable constant condition and non existing column
This commit is contained in:
commit
c90e588e24
@ -51,7 +51,7 @@ static bool tryExtractConstValueFromCondition(const ASTPtr & condition, bool & v
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (function->name == "toUInt8" || function->name == "toInt8")
|
||||
else if (function->name == "toUInt8" || function->name == "toInt8" || function->name == "identity")
|
||||
{
|
||||
if (const auto * expr_list = function->arguments->as<ASTExpressionList>())
|
||||
{
|
||||
|
@ -6,3 +6,7 @@
|
||||
42
|
||||
42
|
||||
42
|
||||
SELECT
|
||||
x,
|
||||
concat(x, \'_\')
|
||||
FROM test
|
||||
|
@ -11,4 +11,7 @@ select if(toUInt8(1), 42, y) from test;
|
||||
select if(toInt8(1), 42, y) from test;
|
||||
select if(toUInt8(toUInt8(0)), y, 42) from test;
|
||||
select if(cast(cast(0, 'UInt8'), 'UInt8'), y, 42) from test;
|
||||
|
||||
explain syntax select x, if((select hasColumnInTable(currentDatabase(), 'test', 'y')), y, x || '_') from test;
|
||||
|
||||
drop table if exists t;
|
||||
|
Loading…
Reference in New Issue
Block a user