From c31aa75dee67b1a122c31c2033896025ec62f7f3 Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Fri, 17 Nov 2017 19:59:31 +0300 Subject: [PATCH] SQL: open TRT only after versioned write [#305][fixes #321] --- mysql-test/suite/innodb/r/monitor.result | 4 ++-- sql/sql_table.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/innodb/r/monitor.result b/mysql-test/suite/innodb/r/monitor.result index 6bc0793eb9f..2700479e7f7 100644 --- a/mysql-test/suite/innodb/r/monitor.result +++ b/mysql-test/suite/innodb/r/monitor.result @@ -418,7 +418,7 @@ max_count_reset, min_count_reset, count_reset, status from information_schema.innodb_metrics where name like "metadata%"; name max_count min_count count max_count_reset min_count_reset count_reset status -metadata_table_handles_opened 3 NULL 3 3 NULL 3 enabled +metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled set global innodb_monitor_disable = module_metadata; @@ -428,7 +428,7 @@ max_count_reset, min_count_reset, count_reset, status from information_schema.innodb_metrics where name like "metadata%"; name max_count min_count count max_count_reset min_count_reset count_reset status -metadata_table_handles_opened 3 NULL 3 NULL NULL 0 disabled +metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled set global innodb_monitor_reset_all = module_metadata; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index e96426f4e69..8f41b213028 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -7430,7 +7430,7 @@ static bool mysql_inplace_alter_table(THD *thd, { TR_table trt(thd, true); - if (table->file->native_versioned() && trt != *table_list) + if (thd->vers_update_trt && trt != *table_list) { if (opt_transaction_registry && trt.update()) return true;