summaryrefslogtreecommitdiff
path: root/sql/sql_admin.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-09-28 17:55:28 +0200
committerSergei Golubchik <serg@mariadb.org>2016-09-28 17:55:28 +0200
commit66d9696596edbc20ad36bf3d5bffb5595e8235c3 (patch)
treebbef37c9a90b63d25bee59386cac04298a13846f /sql/sql_admin.cc
parent66a58f46e937cdc3d7e0529b52ad8b658d9b2cd4 (diff)
parent23af6f5942e7235a7c14a36cb8dd0d2796b5ef37 (diff)
downloadmariadb-git-66d9696596edbc20ad36bf3d5bffb5595e8235c3.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r--sql/sql_admin.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index b974075b442..1f4426f2043 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -466,7 +466,19 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
}
thd->prepare_derived_at_open= FALSE;
- table->next_global= save_next_global;
+ /*
+ MERGE engine may adjust table->next_global chain, thus we have to
+ append save_next_global after merge children.
+ */
+ if (save_next_global)
+ {
+ TABLE_LIST *table_list_iterator= table;
+ while (table_list_iterator->next_global)
+ table_list_iterator= table_list_iterator->next_global;
+ table_list_iterator->next_global= save_next_global;
+ save_next_global->prev_global= &table_list_iterator->next_global;
+ }
+
table->next_local= save_next_local;
thd->open_options&= ~extra_open_options;