summaryrefslogtreecommitdiff
path: root/storage/myisammrg
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2013-03-21 11:06:27 +0400
committerSergey Petrunya <psergey@askmonty.org>2013-03-21 11:06:27 +0400
commitfb2501e2d4cf099bfea0cc1ef9d441ad08c3ee68 (patch)
treec3b91a9c787e802b6817fd8d4b5d0b844928a90e /storage/myisammrg
parent8f607aae127439e132dae00b2750727162f4d564 (diff)
downloadmariadb-git-fb2501e2d4cf099bfea0cc1ef9d441ad08c3ee68.tar.gz
MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg
- Set MI_INFO::external_ref for MyISAM tables that are parts of myisamMRG table.
Diffstat (limited to 'storage/myisammrg')
-rw-r--r--storage/myisammrg/ha_myisammrg.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 274ba2fcd81..61fa32f86fe 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -422,6 +422,19 @@ static MI_INFO *myisammrg_attach_children_callback(void *callback_param)
DBUG_RETURN(my_errno ? NULL : myisam);
}
+/*
+ Set external_ref for the child MyISAM tables. They need this to be set in
+ order to check for killed status.
+*/
+static void myrg_set_external_ref(MYRG_INFO *m_info, void *ext_ref_arg)
+{
+ int i;
+ for (i= 0; i < (int)m_info->tables; i++)
+ {
+ m_info->open_tables[i].table->external_ref= ext_ref_arg;
+ }
+}
+
/**
@brief Open a MERGE parent table, not its children.
@@ -467,6 +480,7 @@ int ha_myisammrg::open(const char *name, int mode __attribute__((unused)),
}
file->children_attached= TRUE;
+ myrg_set_external_ref(file, (void*)table);
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
}