mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Merge pull request #2064 from yandex/sets-with-aliases
Sets for IN operator could be used via alias
This commit is contained in:
commit
26ca895c0c
@ -980,7 +980,8 @@ void ExpressionAnalyzer::normalizeTreeImpl(
|
||||
/// `IN t` can be specified, where t is a table, which is equivalent to `IN (SELECT * FROM t)`.
|
||||
if (functionIsInOrGlobalInOperator(func_node->name))
|
||||
if (ASTIdentifier * right = typeid_cast<ASTIdentifier *>(func_node->arguments->children.at(1).get()))
|
||||
right->kind = ASTIdentifier::Table;
|
||||
if (!aliases.count(right->name))
|
||||
right->kind = ASTIdentifier::Table;
|
||||
|
||||
/// Special cases for count function.
|
||||
String func_name_lowercase = Poco::toLower(func_node->name);
|
||||
|
@ -4,3 +4,4 @@
|
||||
1
|
||||
1
|
||||
1
|
||||
1 0
|
||||
|
@ -4,3 +4,4 @@ SELECT toDate('2015-06-12') IN (toDate('2015-06-12'));
|
||||
SELECT today() IN (toDate('2014-01-01'), toDate(now()));
|
||||
SELECT - -1 IN (2 - 1);
|
||||
SELECT - -1 IN (2 - 1, 3);
|
||||
WITH (1, 2) AS a SELECT 1 IN a, 3 IN a;
|
||||
|
Loading…
Reference in New Issue
Block a user