mariadb/mysql-test/suite
Marko Mäkelä e572c745dc MDEV-29504/MDEV-29849 TRUNCATE breaks FOREIGN KEY locking
ha_innobase::referenced_by_foreign_key(): Protect the check with
dict_sys.freeze(), to prevent races with TRUNCATE TABLE.
The test innodb.instant_alter_crash has been adjusted for this
additional locking.

dict_table_is_referenced_by_foreign_key(): Removed (merged to
the only caller).

create_table_info_t::create_table(): Ignore missing indexes for
FOREIGN KEY constraints if foreign_key_checks=0.

create_table_info_t::create_table_update_dict(): Rewritten as
a static function. Do not return any error.

ha_innobase::create(): When trx!=nullptr and we are operating
on a persistent table, do not rollback, commit, or release the
data dictionary latch.

ha_innobase::truncate(): Protect the entire critical section
with an exclusive dict_sys.latch, so that
ha_innobase::referenced_by_foreign_key() on referenced tables
will return a consistent result. In case of a failure,
invoke dict_load_foreigns() to restore also any FOREIGN KEY
constraints.

ha_innobase::free_foreign_key_create_info(): Define inline.

lock_release(): Disregard innodb_evict_tables_on_commit_debug=ON
when dict_sys.locked() holds. It would hold when fts_load_stopword()
is invoked by create_table_info_t::create_table_update_dict().

dict_sys_t::locked(): Return whether the current thread is holding
the exclusive dict_sys.latch.

dict_sys_t::frozen_not_locked(): Return whether any thread is
holding a shared dict_sys.latch.

In the test main.mysql_upgrade, the InnoDB persistent statistics
will no longer be recalculated in ha_innobase::open() as part of
CHECK TABLE ... FOR UPGRADE. They were deleted earlier in the test.

Tested by: Matthias Leich
2022-11-08 17:34:34 +02:00
..
archive Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
atomic Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
binlog Merge branch '10.5' into 10.6 2022-11-02 14:33:20 +01:00
binlog_encryption
client
compat Merge branch '10.5' into 10.6 2022-10-02 22:14:21 +02:00
csv
encryption Merge 10.5 into 10.6 2022-10-25 14:25:42 +03:00
engines Merge branch '10.5' into 10.6 2022-10-02 22:14:21 +02:00
federated Merge branch '10.4' into 10.5 2022-10-26 15:26:06 +02:00
funcs_1 Merge branch '10.5' into 10.6 2022-10-02 22:14:21 +02:00
funcs_2
galera Merge branch '10.5' into 10.6 2022-11-02 14:33:20 +01:00
galera_3nodes Merge 10.5 into 10.6 2022-10-13 08:27:23 +03:00
galera_3nodes_sr
galera_sr Merge 10.5 into 10.6 2022-10-13 08:27:23 +03:00
gcol MDEV-24402: InnoDB CHECK TABLE ... EXTENDED 2022-10-21 10:02:54 +03:00
handler
heap Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
innodb MDEV-29504/MDEV-29849 TRUNCATE breaks FOREIGN KEY locking 2022-11-08 17:34:34 +02:00
innodb_fts MDEV-29504/MDEV-29849 TRUNCATE breaks FOREIGN KEY locking 2022-11-08 17:34:34 +02:00
innodb_gis Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
innodb_i_s Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
innodb_zip Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
jp Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
json MDEV-28480: Assertion `0' failed in Item_row::illegal_method_call on 2022-10-13 14:55:27 +05:30
large_tests
maria Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
mariabackup Merge 10.5 into 10.6 2022-10-06 09:22:39 +03:00
mtr/t
mtr2
multi_source
optimizer_unfixed_bugs MDEV-29710: Disable some slow tests on Valgrind 2022-10-06 08:42:26 +03:00
parts Merge branch '10.5' into 10.6 2022-10-02 22:14:21 +02:00
perfschema Disable perfschema.mdl_func on Windows 2022-10-26 14:53:06 +03:00
perfschema_stress
period Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
plugins Merge branch '10.5' into 10.6 2022-11-02 14:33:20 +01:00
roles Merge 10.5 into 10.6 2022-10-25 14:25:42 +03:00
rpl Merge branch '10.5' into 10.6 2022-11-02 14:33:20 +01:00
s3 Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
sql_sequence Merge 10.5 into 10.6 2022-10-25 14:25:42 +03:00
storage_engine
stress Merge 10.5 into 10.6 2022-10-06 09:22:39 +03:00
sys_vars MDEV-29706 : SIGSEGV in wsrep_TOI_begin on non-Galera builds 2022-10-06 13:08:20 +03:00
sysschema Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
unit
vcol Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
versioning Merge 10.5 into 10.6 2022-10-25 14:25:42 +03:00
wsrep