mariadb/storage/innobase/row
Marko Mäkelä 92d233a512 MDEV-15061 TRUNCATE must honor InnoDB table locks
Traditionally, DROP TABLE and TRUNCATE TABLE discarded any locks that
may have been held on the table. This feels like an ACID violation.
Probably most occurrences of it were prevented by meta-data locks (MDL)
which were introduced in MySQL 5.5.

dict_table_t::n_foreign_key_checks_running: Reduce the number of
non-debug checks.

lock_remove_all_on_table(), lock_remove_all_on_table_for_trx(): Remove.

ha_innobase::truncate(): Acquire an exclusive InnoDB table lock
before proceeding. DROP TABLE and DISCARD/IMPORT were already doing
this.

row_truncate_table_for_mysql(): Convert the already started transaction
into a dictionary operation, and do not invoke lock_remove_all_on_table().

row_mysql_table_id_reassign(): Do not call lock_remove_all_on_table().
This function is only used in ALTER TABLE...DISCARD/IMPORT TABLESPACE,
which is already holding an exclusive InnoDB table lock.

TODO: Make n_foreign_key_checks running a debug-only variable.
This would require two fixes:
(1) DROP TABLE: Exclusively lock the table beforehand, to prevent
the possibility of concurrently running foreign key checks (which
would acquire a table IS lock and then record S locks).
(2) RENAME TABLE: Find out if n_foreign_key_checks_running>0 actually
constitutes a potential problem.
2018-01-25 22:43:43 +02:00
..
row0ext.cc MDEV-14756 - Remove trx_sys_t::rw_trx_list 2018-01-20 16:09:26 +04:00
row0ftsort.cc MDEV-11369 Instant ADD COLUMN for InnoDB 2017-10-06 09:50:10 +03:00
row0import.cc Merge bb-10.2-ext into 10.3 2018-01-24 14:00:33 +02:00
row0ins.cc MDEV-15061 TRUNCATE must honor InnoDB table locks 2018-01-25 22:43:43 +02:00
row0log.cc Merge bb-10.2-ext into 10.3 2018-01-04 09:22:59 +02:00
row0merge.cc Merge bb-10.2-ext into 10.3 2018-01-24 14:00:33 +02:00
row0mysql.cc MDEV-15061 TRUNCATE must honor InnoDB table locks 2018-01-25 22:43:43 +02:00
row0purge.cc Replace trx_sys_t* trx_sys with trx_sys_t trx_sys 2018-01-20 16:10:36 +04:00
row0quiesce.cc Fixed wrong arguments to printf in InnoDB 2018-01-21 20:22:00 +02:00
row0row.cc Replace trx_sys_t* trx_sys with trx_sys_t trx_sys 2018-01-20 16:10:36 +04:00
row0sel.cc MDEV-15019 - InnoDB: store ReadView on trx 2018-01-22 16:23:15 +04:00
row0trunc.cc MDEV-15061 TRUNCATE must honor InnoDB table locks 2018-01-25 22:43:43 +02:00
row0uins.cc Merge bb-10.2-ext into 10.3 2017-12-20 22:37:24 +02:00
row0umod.cc Merge bb-10.2-ext into 10.3 2017-12-14 11:34:30 +02:00
row0undo.cc Merge bb-10.2-ext into 10.3 2017-12-14 11:34:30 +02:00
row0upd.cc Merge branch 'github/10.3' into bb-10.3-temporal 2018-01-17 00:45:02 +01:00
row0vers.cc Replace trx_sys_t* trx_sys with trx_sys_t trx_sys 2018-01-20 16:10:36 +04:00