1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

BUG#665669: Result differences on query re-execution

- Cause: handler::in_range_check_pushed_down was not reset when a 
  command would call handler->idx_cond_push() without later calling
  handler->index_end().
- Fix: reset the variable in handler->reset(), too (like we do with other
  Index Condition Pushdown members).
This commit is contained in:
Sergey Petrunya
2011-01-12 15:00:10 +03:00
parent cb4fa7f401
commit ad78c24a20
5 changed files with 40 additions and 0 deletions

View File

@@ -660,3 +660,24 @@ count(*) sum(table1.col_int_key*table2.pk)
drop table t1,t2;
set join_cache_level=@my_save_join_cache_level;
set join_buffer_size=@my_save_join_buffer_size;
#
# BUG#665669: Result differences on query re-execution
#
create table t1 (pk int primary key, b int, c int default 0, index idx(b)) engine=innodb;
insert into t1(pk,b) values (3, 30), (2, 20), (9, 90), (7, 70), (4, 40), (5, 50), (10, 100), (12, 120);
set @my_save_optimizer_use_mrr=@@optimizer_use_mrr;
set optimizer_use_mrr='disable';
explain select * from t1 where b > 1000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx idx 5 NULL 1 Using index condition
# The following two must produce indentical results:
select * from t1 where pk < 2 or pk between 3 and 4;
pk b c
3 30 0
4 40 0
select * from t1 where pk < 2 or pk between 3 and 4;
pk b c
3 30 0
4 40 0
drop table t1;
set optimizer_use_mrr = @my_save_optimizer_use_mrr;