summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-12-16 10:54:33 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-12-16 10:54:33 +0200
commit8bddaddc6fcd4f146252c2dc149ecbc51cd6c788 (patch)
treef5c359b1c9ab641ee139fcb8c2d83a93dec8e7d0 /storage/innobase
parent89480340ba7eabfaff1ea8f51437324cb3d5964f (diff)
parent84774de49af133b6e702e51c0b0e69173a0594cd (diff)
downloadmariadb-git-8bddaddc6fcd4f146252c2dc149ecbc51cd6c788.tar.gz
Merge 10.7 into 10.8
Diffstat (limited to 'storage/innobase')
-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();
}
}