mariadb/storage/innobase/row
Marko Mäkelä 0bc36758ba MDEV-14717 RENAME TABLE in InnoDB is not crash-safe
InnoDB in MariaDB 10.2 appears to only write MLOG_FILE_RENAME2
redo log records during table-rebuilding ALGORITHM=INPLACE operations.
We must write the records for any .ibd file renames, so that the
operations are crash-safe.

If InnoDB is killed during a RENAME TABLE operation, it can happen that
the transaction for updating the data dictionary will be rolled back.
But, nothing will roll back the renaming of the .ibd file
(the MLOG_FILE_RENAME2 only guarantees roll-forward), or for that matter,
the renaming of the dict_table_t::name in the dict_sys cache. We introduce
the undo log record TRX_UNDO_RENAME_TABLE to fix this.

fil_space_for_table_exists_in_mem(): Remove the parameters
adjust_space, table_id and some code that was trying to work around
these deficiencies.

fil_name_write_rename(): Write a MLOG_FILE_RENAME2 record.

dict_table_rename_in_cache(): Invoke fil_name_write_rename().

trx_undo_rec_copy(): Set the first 2 bytes to the length of the
copied undo log record.

trx_undo_page_report_rename(), trx_undo_report_rename():
Write a TRX_UNDO_RENAME_TABLE record with the old table name.

row_rename_table_for_mysql(): Invoke trx_undo_report_rename()
before modifying any data dictionary tables.

row_undo_ins_parse_undo_rec(): Roll back TRX_UNDO_RENAME_TABLE
by invoking dict_table_rename_in_cache(), which will take care
of both renaming the table and the file.
2017-12-20 22:21:03 +02:00
..
row0ext.cc MDEV-12271 Port MySQL 8.0 Bug#23150562 REMOVE UNIV_MUST_NOT_INLINE AND UNIV_NONINL 2017-03-17 12:42:07 +02:00
row0ftsort.cc Merge 10.1 into 10.2 2017-09-17 11:05:33 +03:00
row0import.cc MDEV-14310 Possible corruption by table-rebuilding or index-creating ALTER TABLE…ALGORITHM=INPLACE 2017-11-20 13:26:56 +02:00
row0ins.cc Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-11-29 12:06:48 +04:00
row0log.cc Follow-up fix of MDEV-13795/MDEV-14332 2017-11-10 15:58:52 +02:00
row0merge.cc Adjust the MySQL 5.7 tests for MariaDB 10.2 2017-11-20 16:05:41 +02:00
row0mysql.cc MDEV-14717 RENAME TABLE in InnoDB is not crash-safe 2017-12-20 22:21:03 +02:00
row0purge.cc Remove unused parameters and dead code 2017-09-29 16:19:28 +03:00
row0quiesce.cc MDEV-14422 Assertion failure in trx_purge_run() on shutdown 2017-12-13 14:17:26 +02:00
row0row.cc InnoDB: Remove ut_snprintf() and the use of my_snprintf(); use snprintf() 2017-11-13 02:11:48 +02:00
row0sel.cc Merge 10.2 into bb-10.2-ext 2017-12-11 15:06:11 +02:00
row0trunc.cc MDEV-14511 Use fewer transactions for updating InnoDB persistent statistics 2017-12-06 18:52:28 +02:00
row0uins.cc MDEV-14717 RENAME TABLE in InnoDB is not crash-safe 2017-12-20 22:21:03 +02:00
row0umod.cc Merge 10.1 into 10.2 2017-12-14 08:40:01 +02:00
row0undo.cc Merge 10.1 into 10.2 2017-12-14 08:40:01 +02:00
row0upd.cc Merge 10.2 into bb-10.2-ext 2017-11-10 08:27:09 +02:00
row0vers.cc Correct the comment of row_vers_impl_x_locked() 2017-12-11 13:56:36 +02:00