dbms: don't move conditions of type PKColumn IN (subquery) to PREWHERE [#METR-18198].

This commit is contained in:
Alexey Milovidov 2015-09-27 09:50:36 +03:00
parent d04c213b27
commit 6e3394496f

View File

@ -329,7 +329,8 @@ private:
if ((primary_key_columns.count(first_arg_name) && isConstant(args[1])) ||
(primary_key_columns.count(second_arg_name) && isConstant(args[0])) ||
(primary_key_columns.count(first_arg_name) && typeid_cast<const ASTSet *>(args[1].get())))
(primary_key_columns.count(first_arg_name)
&& (typeid_cast<const ASTSet *>(args[1].get()) || typeid_cast<const ASTSubquery *>(args[1].get()))))
return true;
}