summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2013-10-14 12:36:31 +0400
committerSergey Vojtovich <svoj@mariadb.org>2013-10-14 12:36:31 +0400
commit2c0a073970cf5f1dc679b34bb13e7fc55109dfd0 (patch)
tree88064e3042b832b38bc6473cb437c9b4d37da643 /storage
parentc776f5ac2614e24e64dd06f488ee29716f056c95 (diff)
downloadmariadb-git-2c0a073970cf5f1dc679b34bb13e7fc55109dfd0.tar.gz
MDEV-5042 - Server crashes when accessing incorrect MERGE table from trigger
When we open merge children open error is normally handled early during open phase. But there are two exceptions when error is handled later during attach phase: CHECK/REPAIR TABLE and tables added by the pre-locking code. The latter case wasn't considered by assertion in the merge code. This assertion is corrected. Note that in MySQL-5.6 this assertion is removed.
Diffstat (limited to 'storage')
-rw-r--r--storage/myisammrg/ha_myisammrg.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index bb225002dc0..a1fe8a6efb8 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -653,8 +653,12 @@ extern "C" MI_INFO *myisammrg_attach_children_callback(void *callback_param)
{
DBUG_PRINT("error", ("failed to open underlying table '%s'.'%s'",
child_l->db, child_l->table_name));
- /* This should only happen inside of CHECK/REPAIR TABLE. */
- DBUG_ASSERT(current_thd->open_options & HA_OPEN_FOR_REPAIR);
+ /*
+ This should only happen inside of CHECK/REPAIR TABLE or
+ for the tables added by the pre-locking code.
+ */
+ DBUG_ASSERT(current_thd->open_options & HA_OPEN_FOR_REPAIR ||
+ child_l->prelocking_placeholder);
goto end;
}