Commit 0ff62ad8 authored by Marko Mäkelä's avatar Marko Mäkelä

InnoDB: Remove a redundant condition and an outdated comment

Since MariaDB 10.2.2, temporary table metadata is not written
to the InnoDB data dictionary tables. Therefore,
the DICT_TF2_TEMPORARY flag cannot be set in SYS_TABLES,
except if there exist orphan temporary tables that were created
before MariaDB 10.2.2.

trx_resurrect_table_locks(): Do not skip temporary tables.
If a resurrect transaction modified a temporary table that was
created before MariaDB 10.2.2, that table would be treated
internally as a persistent table. It is safer to resurrect
locks than to skip the table, because the table would be modified
on transaction rollback.
parent 72a2de92
...@@ -342,8 +342,7 @@ dict_boot(void) ...@@ -342,8 +342,7 @@ dict_boot(void)
dict_mem_table_add_col(table, heap, "TYPE", DATA_INT, 0, 4); dict_mem_table_add_col(table, heap, "TYPE", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "MIX_ID", DATA_BINARY, 0, 0); dict_mem_table_add_col(table, heap, "MIX_ID", DATA_BINARY, 0, 0);
/* MIX_LEN may contain additional table flags when /* MIX_LEN may contain additional table flags when
ROW_FORMAT!=REDUNDANT. Currently, these flags include ROW_FORMAT!=REDUNDANT. */
DICT_TF2_TEMPORARY. */
dict_mem_table_add_col(table, heap, "MIX_LEN", DATA_INT, 0, 4); dict_mem_table_add_col(table, heap, "MIX_LEN", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "CLUSTER_NAME", DATA_BINARY, 0, 0); dict_mem_table_add_col(table, heap, "CLUSTER_NAME", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "SPACE", DATA_INT, 0, 4); dict_mem_table_add_col(table, heap, "SPACE", DATA_INT, 0, 4);
......
...@@ -772,8 +772,7 @@ trx_resurrect_table_locks( ...@@ -772,8 +772,7 @@ trx_resurrect_table_locks(
i != tables.end(); i++) { i != tables.end(); i++) {
if (dict_table_t* table = dict_table_open_on_id( if (dict_table_t* table = dict_table_open_on_id(
*i, FALSE, DICT_TABLE_OP_LOAD_TABLESPACE)) { *i, FALSE, DICT_TABLE_OP_LOAD_TABLESPACE)) {
if (!table->is_readable() if (!table->is_readable()) {
|| dict_table_is_temporary(table)) {
mutex_enter(&dict_sys->mutex); mutex_enter(&dict_sys->mutex);
dict_table_close(table, TRUE, FALSE); dict_table_close(table, TRUE, FALSE);
dict_table_remove_from_cache(table); dict_table_remove_from_cache(table);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment