From fa1436bf1f87cbe627d42e75b5e84cf7eb40b6b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Sep 2006 18:25:35 +0500 Subject: BUG#20256 - LOCK WRITE - MyISAM Only MyISAM tables locked with LOCK TABLES ... WRITE were affected. A query that is optimized with index_merge doesn't reflect rows inserted within LOCK TABLES. MyISAM doesn't flush a state within LOCK TABLES. index_merge optimization creates a copy of the handler, which thus gets outdated MyISAM state. New handler->clone() method is introduced to fix this problem. For non-MyISAM storage engines it allocates a handler and opens it with ha_open(). For MyISAM it additionally copies MyISAM state pointer to cloned handler. mysql-test/r/index_merge.result: A test case for bug#20256. mysql-test/t/index_merge.test: A test case for bug#20256. sql/ha_myisam.cc: clone method added to handler class. sql/ha_myisam.h: clone method added to handler class. sql/handler.cc: clone method added to handler class. sql/handler.h: clone method added to handler class. sql/opt_range.cc: Use handler clone method. --- sql/handler.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/handler.h') diff --git a/sql/handler.h b/sql/handler.h index 44de0cc715a..471bb08b748 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -563,6 +563,7 @@ public: pushed_cond(NULL) {} virtual ~handler(void) { /* TODO: DBUG_ASSERT(inited == NONE); */ } + virtual handler *clone(MEM_ROOT *mem_root); int ha_open(const char *name, int mode, int test_if_locked); void adjust_next_insert_id_after_explicit_value(ulonglong nr); bool update_auto_increment(); -- cgit v1.2.1