Description:
The update_time metadata that was implemented in WL#6658 is not updated for XA COMMIT of recovered transactions that were in XA PREPARE state.
How to repeat:
See the test case (innodb.innodb_update_time) that contains a misleading comment about this.
Suggested fix:
This patch will also remove the innodb_ prefix from the test file names:
diff --git a/mysql-test/suite/innodb/r/update_time.result b/mysql-test/suite/innodb/r/update_time.result
index dcb925f..0c6fc67 100644
--- a/mysql-test/suite/innodb/r/update_time.result
+++ b/mysql-test/suite/innodb/r/update_time.result
@@ -46,7 +46,8 @@ SELECT update_time FROM information_schema.tables WHERE table_name = 't';
update_time
NULL
XA COMMIT 'xatrx';
-SELECT update_time FROM information_schema.tables WHERE table_name = 't';
-update_time
-NULL
+SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
+AND update_time IS NOT NULL;
+COUNT(*)
+1
DROP TABLE t;
diff --git a/mysql-test/suite/innodb/t/update_time.test b/mysql-test/suite/innodb/t/update_time.test
index 9f3a97f..922fd40 100644
--- a/mysql-test/suite/innodb/t/update_time.test
+++ b/mysql-test/suite/innodb/t/update_time.test
@@ -73,8 +73,7 @@ SELECT update_time FROM information_schema.tables WHERE table_name = 't';
XA COMMIT 'xatrx';
-# The result from this query may change once update_time becomes persistent
-# (WL#6917).
-SELECT update_time FROM information_schema.tables WHERE table_name = 't';
+SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
+AND update_time IS NOT NULL;
DROP TABLE t;
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 7c4b1a8..5005fe7 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -723,6 +723,9 @@ trx_resurrect_table_locks(
continue;
}
+ if (trx->state == TRX_STATE_PREPARED) {
+ trx->mod_tables.insert(table);
+ }
lock_table_ix_resurrect(table, trx);
DBUG_PRINT("ib_trx",