Kenji Maruyama
null+****@clear*****
Wed Nov 13 21:38:00 JST 2013
Kenji Maruyama 2013-11-13 21:38:00 +0900 (Wed, 13 Nov 2013) New Revision: f8dd232dc6daa23ecef8800c3b0c977b2e024e8b https://github.com/mroonga/mroonga/commit/f8dd232dc6daa23ecef8800c3b0c977b2e024e8b Message: Fix multi range read disk sweep. refs #1959 Added files: mysql-test/mroonga/wrapper/multi_range_read/r/disk_sweep.result Modified files: ha_mroonga.cpp Modified: ha_mroonga.cpp (+2 -1) =================================================================== --- ha_mroonga.cpp 2013-11-13 12:17:52 +0900 (2048007) +++ ha_mroonga.cpp 2013-11-13 21:38:00 +0900 (2e01a18) @@ -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 @@ -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); Added: mysql-test/mroonga/wrapper/multi_range_read/r/disk_sweep.result (+18 -0) 100644 =================================================================== --- /dev/null +++ mysql-test/mroonga/wrapper/multi_range_read/r/disk_sweep.result 2013-11-13 21:38:00 +0900 (5fa898c) @@ -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; -------------- next part -------------- HTML����������������������������...Download