Navigation Menu

Skip to content

Commit

Permalink
Fix multi range read disk sweep. refs #1959
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmaru777 committed Nov 13, 2013
1 parent 2f10768 commit f8dd232
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ha_mroonga.cpp
Expand Up @@ -3809,6 +3809,7 @@ int ha_mroonga::wrapper_open(const char *name, int mode, uint test_if_locked)
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
}
wrap_handler->init();
wrap_handler->set_ha_share_ref(&table->s->ha_share);
error = wrap_handler->ha_open(table, name, mode, test_if_locked);
} else {
#ifdef MRN_HANDLER_CLONE_NEED_NAME
Expand Down Expand Up @@ -6702,7 +6703,7 @@ int ha_mroonga::wrapper_index_end()
MRN_DBUG_ENTER_METHOD();
MRN_SET_WRAP_SHARE_KEY(share, table->s);
MRN_SET_WRAP_TABLE_KEY(this, table);
error = wrap_handler->ha_index_end();
error = wrap_handler->ha_index_or_rnd_end();
MRN_SET_BASE_SHARE_KEY(share, table->s);
MRN_SET_BASE_TABLE_KEY(this, table);
DBUG_RETURN(error);
Expand Down
18 changes: 18 additions & 0 deletions mysql-test/mroonga/wrapper/multi_range_read/r/disk_sweep.result
@@ -0,0 +1,18 @@
DROP TABLE IF EXISTS many_records;
SET optimizer_switch='mrr_cost_based=off';
CREATE TABLE many_records (
id INT PRIMARY KEY AUTO_INCREMENT,
value INT,
KEY (value)
) COMMENT='engine "InnoDB"';
INSERT INTO many_records (value) VALUES (0), (1), (2), (3);
EXPLAIN SELECT * FROM many_records
WHERE value IN (0, 2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE many_records range value value 5 NULL 2 Using where; Using MRR
SELECT * FROM many_records
WHERE value IN (0, 2);
id value
1 0
3 2
DROP TABLE many_records;

0 comments on commit f8dd232

Please sign in to comment.