From 514b9b25d256b71b90f4693549c7e596ad72177a Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Fri, 25 Jun 2010 19:32:59 +0400 Subject: Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111 Bug#47633 - assert in ha_myisammrg::info during OPTIMIZE The server crashed on an attempt to optimize a MERGE table with non-existent child table. mysql_admin_table() relied on the table to be successfully open if a table object had been allocated. Changed code to check return value of the open function before calling a handler:: function on it. --- storage/myisammrg/ha_myisammrg.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'storage/myisammrg') diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 63d20f127a1..67b81225b13 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -103,6 +103,7 @@ #include "myrg_def.h" #include "thr_malloc.h" // int_sql_alloc #include "sql_class.h" // THD +#include "debug_sync.h" static handler *myisammrg_create_handler(handlerton *hton, TABLE_SHARE *table, @@ -755,6 +756,7 @@ int ha_myisammrg::attach_children(void) /* Must not call this with attached children. */ DBUG_ASSERT(!this->file->children_attached); + DEBUG_SYNC(current_thd, "before_myisammrg_attach"); /* Must call this with children list in place. */ DBUG_ASSERT(this->table->pos_in_table_list->next_global == this->children_l); -- cgit v1.2.1