mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
More fixes due to "in" function arguments being incorrectly checked as ASTIdentifier
This commit is contained in:
parent
d0ad6d9cff
commit
365e52817b
@ -848,7 +848,7 @@ bool KeyCondition::tryPrepareSetIndex(
|
|||||||
const ASTPtr & right_arg = args[1];
|
const ASTPtr & right_arg = args[1];
|
||||||
|
|
||||||
SetPtr prepared_set;
|
SetPtr prepared_set;
|
||||||
if (right_arg->as<ASTSubquery>() || right_arg->as<ASTIdentifier>())
|
if (right_arg->as<ASTSubquery>() || right_arg->as<ASTTableIdentifier>())
|
||||||
{
|
{
|
||||||
auto set_it = prepared_sets.find(PreparedSetKey::forSubquery(*right_arg));
|
auto set_it = prepared_sets.find(PreparedSetKey::forSubquery(*right_arg));
|
||||||
if (set_it == prepared_sets.end())
|
if (set_it == prepared_sets.end())
|
||||||
|
@ -138,10 +138,9 @@ bool isCompatible(const IAST & node)
|
|||||||
if (name == "tuple" && function->arguments->children.size() <= 1)
|
if (name == "tuple" && function->arguments->children.size() <= 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/// If the right hand side of IN is an identifier (example: x IN table), then it's not compatible.
|
/// If the right hand side of IN is a table identifier (example: x IN table), then it's not compatible.
|
||||||
if ((name == "in" || name == "notIn")
|
if ((name == "in" || name == "notIn")
|
||||||
&& (function->arguments->children.size() != 2
|
&& (function->arguments->children.size() != 2 || function->arguments->children[1]->as<ASTTableIdentifier>()))
|
||||||
|| function->arguments->children[1]->as<ASTIdentifier>()))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (const auto & expr : function->arguments->children)
|
for (const auto & expr : function->arguments->children)
|
||||||
|
Loading…
Reference in New Issue
Block a user