Commit ad51d77f authored by Aleksey Midenkov's avatar Aleksey Midenkov

SQL: WHERE top level item [#365 bug 11]

Tests affected (forced mode):

main.range main.range_mrr_icp
parent 8c9c3020
......@@ -313,6 +313,11 @@ x
execute stmt;
x
1
### Issue #365, bug 11 (WHERE cond not top level item)
create or replace table t1 (a int, b int, key idx(a)) with system versioning;
insert into t1 values (1, 1), (2, 2);
select * from t1 where (a, 2) in ((1, 1), (2, 2)) and b = 1;
a b
drop view v1;
drop table t1, t2;
call innodb_verify_vtq(29);
......@@ -346,3 +351,4 @@ No A B C D
27 1 1 1 1
28 1 1 1 1
29 1 1 1 1
30 1 1 1 1
......@@ -208,6 +208,11 @@ select x from t1 where x in (select x from v1);";
execute stmt;
execute stmt;
--echo ### Issue #365, bug 11 (WHERE cond not top level item)
create or replace table t1 (a int, b int, key idx(a)) with system versioning;
insert into t1 values (1, 1), (2, 2);
select * from t1 where (a, 2) in ((1, 1), (2, 2)) and b = 1;
drop view v1;
drop table t1, t2;
......
......@@ -7347,6 +7347,7 @@ SEL_TREE *Item_func_in::get_func_row_mm_tree(RANGE_OPT_PARAM *param,
key_col->bring_value();
key_col_info.comparator= row_cmp_item->get_comparator(i);
DBUG_ASSERT(key_col_info.comparator);
key_col_info.comparator->store_value(key_col);
col_comparators++;
......
......@@ -986,6 +986,7 @@ int vers_setup_select(THD *thd, TABLE_LIST *tables, COND **where_expr,
thd->change_item_tree(dst_cond, cond1);
slex->where= *dst_cond;
slex->where->top_level_item();
}
} // if (... table->table->versioned())
} // for (table= tables; ...)
......
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