summaryrefslogtreecommitdiff
path: root/storage/myisammrg
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-12-15 15:57:26 +0100
committerSergei Golubchik <sergii@pisem.net>2013-12-15 15:57:26 +0100
commit6bf10fac445d73fb796d4863612c87bff5f28b66 (patch)
tree4d51e193684163c21e47e9de6536cd8dae0613eb /storage/myisammrg
parent8efaff4959efe32ff9bc47c1bf1710cfe9ab21b5 (diff)
parent39a8d7965d912d8fb32436735449ce04e85583d1 (diff)
downloadmariadb-git-6bf10fac445d73fb796d4863612c87bff5f28b66.tar.gz
5.5 merge
Diffstat (limited to 'storage/myisammrg')
-rw-r--r--storage/myisammrg/ha_myisammrg.cc43
-rw-r--r--storage/myisammrg/mysql-test/storage_engine/disabled.def2
2 files changed, 25 insertions, 20 deletions
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 481ca41ba9d..3220d53aefa 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -1481,31 +1481,36 @@ void ha_myisammrg::update_create_info(HA_CREATE_INFO *create_info)
if (!(create_info->used_fields & HA_CREATE_USED_UNION))
{
- MYRG_TABLE *open_table;
+ TABLE_LIST *child_table;
THD *thd=current_thd;
create_info->merge_list.next= &create_info->merge_list.first;
create_info->merge_list.elements=0;
- for (open_table=file->open_tables ;
- open_table != file->end_table ;
- open_table++)
+ if (children_l != NULL)
{
- TABLE_LIST *ptr;
- LEX_STRING db, name;
- LINT_INIT(db.str);
-
- if (!(ptr = (TABLE_LIST *) thd->calloc(sizeof(TABLE_LIST))))
- goto err;
- split_file_name(open_table->table->filename, &db, &name);
- if (!(ptr->table_name= thd->strmake(name.str, name.length)))
- goto err;
- if (db.length && !(ptr->db= thd->strmake(db.str, db.length)))
- goto err;
-
- create_info->merge_list.elements++;
- (*create_info->merge_list.next) = ptr;
- create_info->merge_list.next= &ptr->next_local;
+ for (child_table= children_l;;
+ child_table= child_table->next_global)
+ {
+ TABLE_LIST *ptr;
+
+ if (!(ptr= (TABLE_LIST *) thd->calloc(sizeof(TABLE_LIST))))
+ goto err;
+
+ if (!(ptr->table_name= thd->strmake(child_table->table_name,
+ child_table->table_name_length)))
+ goto err;
+ if (child_table->db && !(ptr->db= thd->strmake(child_table->db,
+ child_table->db_length)))
+ goto err;
+
+ create_info->merge_list.elements++;
+ (*create_info->merge_list.next)= ptr;
+ create_info->merge_list.next= &ptr->next_local;
+
+ if (&child_table->next_global == children_last_l)
+ break;
+ }
}
*create_info->merge_list.next=0;
}
diff --git a/storage/myisammrg/mysql-test/storage_engine/disabled.def b/storage/myisammrg/mysql-test/storage_engine/disabled.def
index 9f7569a2d24..86b96c2ba2b 100644
--- a/storage/myisammrg/mysql-test/storage_engine/disabled.def
+++ b/storage/myisammrg/mysql-test/storage_engine/disabled.def
@@ -1,2 +1,2 @@
-alter_table_online : MySQL:57657 (Temporary MERGE table with temporary underlying is broken by ALTER)
+alter_table_online : MDEV-5266 (Temporary MERGE table with temporary underlying is broken by ALTER)