1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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

Tests affected (forced mode):

main.range main.range_mrr_icp
This commit is contained in:
Aleksey Midenkov
2017-12-06 22:34:56 +03:00
parent 8c9c302016
commit ad51d77f79
4 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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;

View File

@ -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++;

View File

@ -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; ...)