summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/handler0alter.cc6
-rw-r--r--storage/innobase/include/fil0fil.h5
2 files changed, 8 insertions, 3 deletions
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 42b7afd0256..9e9c0dc67e8 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -10120,6 +10120,7 @@ commit_try_rebuild(
ha_innobase_inplace_ctx*ctx,
TABLE* altered_table,
const TABLE* old_table,
+ bool statistics_exist,
trx_t* trx,
const char* table_name)
{
@@ -10190,7 +10191,9 @@ commit_try_rebuild(
if (error == DB_SUCCESS) {
/* The statistics for the surviving indexes will be
re-inserted in alter_stats_rebuild(). */
- error = trx->drop_table_statistics(old_name);
+ if (statistics_exist) {
+ error = trx->drop_table_statistics(old_name);
+ }
if (error == DB_SUCCESS) {
error = trx->drop_table(*user_table);
}
@@ -11335,6 +11338,7 @@ fail:
if (commit_try_rebuild(ha_alter_info, ctx,
altered_table, table,
+ table_stats && index_stats,
trx,
table_share->table_name.str)) {
goto fail;
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index 09626569f09..940e1b68458 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -1534,9 +1534,10 @@ template<bool have_reference> inline void fil_space_t::flush()
}
else if (have_reference)
flush_low();
- else if (!(acquire_low() & STOPPING))
+ else
{
- flush_low();
+ if (!(acquire_low() & (STOPPING | CLOSING)))
+ flush_low();
release();
}
}