Commit e67a0d2b authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

check of LIMIT in row IN subquery (SCRUM related)

parent 980ca356
......@@ -809,4 +809,6 @@ NULL
select ROW(1, 1, 'a') IN (select b,a,c from t where c='b' or c='a');
ROW(1, 1, 'a') IN (select b,a,c from t where c='b' or c='a')
1
select ROW(1, 1, 'a') IN (select b,a,c from t limit 2);
This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
drop table if exists t;
......@@ -454,4 +454,6 @@ select ROW(1, 1, 'a') IN (select b,a,c from t where a is not null);
select ROW(1, 1, 'a') IN (select a,b,c from t where c='b' or c='a');
select ROW(1, 2, 'a') IN (select a,b,c from t where c='b' or c='a');
select ROW(1, 1, 'a') IN (select b,a,c from t where c='b' or c='a');
-- error 1235
select ROW(1, 1, 'a') IN (select b,a,c from t limit 2);
drop table if exists t;
......@@ -517,6 +517,13 @@ void Item_in_subselect::row_value_transformer(st_select_lex *select_lex,
Item *left_expr)
{
DBUG_ENTER("Item_in_subselect::row_value_transformer");
if (select_lex->master_unit()->global_parameters->select_limit !=
HA_POS_ERROR)
{
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
"LIMIT & IN/ALL/ANY/SOME subquery");
DBUG_VOID_RETURN;
}
Item_in_optimizer *optimizer;
substitution= optimizer= new Item_in_optimizer(left_expr, this);
if (!optimizer)
......@@ -530,6 +537,13 @@ void Item_in_subselect::row_value_transformer(st_select_lex *select_lex,
DBUG_VOID_RETURN;
for (SELECT_LEX * sl= select_lex; sl; sl= sl->next_select())
{
if (select_lex->select_limit != HA_POS_ERROR)
{
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
"LIMIT & IN/ALL/ANY/SOME subquery");
DBUG_VOID_RETURN;
}
select_lex->dependent= 1;
Item *item= 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment