mariadb/include
Marko Mäkelä 1bd681c8b3 MDEV-25506 (3 of 3): Do not delete .ibd files before commit
This is a complete rewrite of DROP TABLE, also as part of other DDL,
such as ALTER TABLE, CREATE TABLE...SELECT, TRUNCATE TABLE.

The background DROP TABLE queue hack is removed.
If a transaction needs to drop and create a table by the same name
(like TRUNCATE TABLE does), it must first rename the table to an
internal #sql-ib name. No committed version of the data dictionary
will include any #sql-ib tables, because whenever a transaction
renames a table to a #sql-ib name, it will also drop that table.
Either the rename will be rolled back, or the drop will be committed.

Data files will be unlinked after the transaction has been committed
and a FILE_RENAME record has been durably written. The file will
actually be deleted when the detached file handle returned by
fil_delete_tablespace() will be closed, after the latches have been
released. It is possible that a purge of the delete of the SYS_INDEXES
record for the clustered index will execute fil_delete_tablespace()
concurrently with the DDL transaction. In that case, the thread that
arrives later will wait for the other thread to finish.

HTON_TRUNCATE_REQUIRES_EXCLUSIVE_USE: A new handler flag.
ha_innobase::truncate() now requires that all other references to
the table be released in advance. This was implemented by Monty.

ha_innobase::delete_table(): If CREATE TABLE..SELECT is detected,
we will "hijack" the current transaction, drop the table in
the current transaction and commit the current transaction.
This essentially fixes MDEV-21602. There is a FIXME comment about
making the check less failure-prone.

ha_innobase::truncate(), ha_innobase::delete_table():
Implement a fast path for temporary tables. We will no longer allow
temporary tables to use the adaptive hash index.

dict_table_t::mdl_name: The original table name for the purpose of
acquiring MDL in purge, to prevent a race condition between a
DDL transaction that is dropping a table, and purge processing
undo log records of DML that had executed before the DDL operation.
For #sql-backup- tables during ALTER TABLE...ALGORITHM=COPY, the
dict_table_t::mdl_name will differ from dict_table_t::name.

dict_table_t::parse_name(): Use mdl_name instead of name.

dict_table_rename_in_cache(): Update mdl_name.

For the internal FTS_ tables of FULLTEXT INDEX, purge would
acquire MDL on the FTS_ table name, but not on the main table,
and therefore it would be able to run concurrently with a
DDL transaction that is dropping the table. Previously, the
DROP TABLE queue hack prevented a race between purge and DDL.
For now, we introduce purge_sys.stop_FTS() to prevent purge from
opening any table, while a DDL transaction that may drop FTS_
tables is in progress. The function fts_lock_table(), which will
be invoked before the dictionary is locked, will wait for
purge to release any table handles.

trx_t::drop_table_statistics(): Drop statistics for the table.
This replaces dict_stats_drop_index(). We will drop or rename
persistent statistics atomically as part of DDL transactions.
On lock conflict for dropping statistics, we will fail instantly
with DB_LOCK_WAIT_TIMEOUT, because we will be holding the
exclusive data dictionary latch.

trx_t::commit_cleanup(): Separated from trx_t::commit_in_memory().
Relax an assertion around fts_commit() and allow DB_LOCK_WAIT_TIMEOUT
in addition to DB_DUPLICATE_KEY. The call to fts_commit() is
entirely misplaced here and may obviously break the consistency
of transactions that affect FULLTEXT INDEX. It needs to be fixed
separately.

dict_table_t::n_foreign_key_checks_running: Remove (MDEV-21175).
The counter was a work-around for missing meta-data locking (MDL)
on the SQL layer, and not really needed in MariaDB.

ER_TABLE_IN_FK_CHECK: Replaced with ER_UNUSED_28.

HA_ERR_TABLE_IN_FK_CHECK: Remove.

row_ins_check_foreign_constraints(): Do not acquire
dict_sys.latch either. The SQL-layer MDL will protect us.

This was reviewed by Thirunarayanan Balathandayuthapani
and tested by Matthias Leich.
2021-06-09 17:06:07 +03:00
..
atomic
mysql MDEV-5536: add systemd socket activation 2021-03-28 13:53:55 +11:00
aria_backup.h
assume_aligned.h
big_endian.h
byte_order_generic.h Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
byte_order_generic_x86.h Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
byte_order_generic_x86_64.h
CMakeLists.txt
decimal.h Added typedef decimal_digits_t (uint16) for number of digits in most 2021-05-19 22:27:27 +02:00
dur_prop.h
errmsg.h
ft_global.h
handler_ername.h MDEV-25506 (3 of 3): Do not delete .ibd files before commit 2021-06-09 17:06:07 +03:00
handler_state.h
hash.h
heap.h
ilist.h MDEV-25223 change fil_system_t::space_list and fil_system_t::named_spaces from UT_LIST to ilist 2021-03-24 15:15:18 +03:00
json_lib.h Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
keycache.h
lf.h MDEV-23510: arm64 lf_hash alignment of pointers 2021-02-25 10:06:15 +11:00
little_endian.h
m_ctype.h Change CHARSET_INFO character set and collaction names to LEX_CSTRING 2021-05-19 22:54:07 +02:00
m_string.h Simplify a preprocessor condition 2021-05-17 18:10:11 +03:00
ma_dyncol.h
maria.h
my_alarm.h
my_alloc.h
my_atomic.h
my_atomic_wrapper.h Merge 10.5 into 10.6 (except MDEV-24630) 2021-03-30 13:28:05 +03:00
my_attribute.h
my_base.h MDEV-25506 (3 of 3): Do not delete .ibd files before commit 2021-06-09 17:06:07 +03:00
my_bit.h
my_bitmap.h
my_byteorder.h MDEV-25870 Windows - fix ARM64 cross-compilation 2021-06-07 23:15:36 +02:00
my_check_opt.h
my_compare.h Merge 10.4 into 10.5 2021-04-21 09:01:01 +03:00
my_compiler.h
my_counter.h
my_cpu.h MDEV-24630: MY_RELAX_CPU assembly instruction upgrade/research for 2021-03-30 13:26:19 +03:00
my_crypt.h
my_dbug.h MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_decimal_limits.h
my_default.h
my_dir.h
my_getopt.h Added 'const' to arguments in get_one_option and find_typeset() 2021-02-08 12:16:29 +02:00
my_global.h MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_handler_errors.h
my_libwrap.h
my_list.h
my_md5.h
my_net.h MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_nosys.h
my_pthread.h MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_rdtsc.h MDEV-25870 Windows - fix ARM64 cross-compilation 2021-06-07 23:15:36 +02:00
my_rnd.h
my_service_manager.h MDEV-5536: add systemd socket activation 2021-03-28 13:53:55 +11:00
my_stack_alloc.h
my_stacktrace.h MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
my_sys.h Added checking to protect against simultaneous double free in safemalloc 2021-05-19 22:54:14 +02:00
my_time.h MDEV-23311 CEILING() and FLOOR() convert temporal input to numbers, unlike ROUND() and TRUNCATE() 2020-07-28 23:29:08 +04:00
my_tree.h
my_uctype.h
my_user.h
my_valgrind.h MEM_CHECK_DEFINED: replace HAVE_valgrind 2021-03-26 07:58:49 +11:00
my_xml.h
myisam.h
myisamchk.h MDEV-17913 Encrypted transactional Aria tables remain corrupt after crash recovery, automatic repairment does not work 2021-04-06 14:57:22 +03:00
myisammrg.h
myisampack.h Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
mysql.h MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
mysql.h.pp Merge 10.5 into 10.6 2021-02-11 09:26:53 +02:00
mysql_com.h MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
mysql_com_server.h
mysql_embed.h
mysql_time.h
mysql_version.h.in Merge 10.3 into 10.4 2020-10-29 13:38:38 +02:00
mysqld_default_groups.h
mysys_err.h
pack.h
password.h
pfs_file_provider.h
pfs_idle_provider.h
pfs_memory_provider.h
pfs_metadata_provider.h
pfs_socket_provider.h
pfs_stage_provider.h
pfs_statement_provider.h
pfs_table_provider.h
pfs_thread_provider.h
pfs_transaction_provider.h
probes_mysql.d.base
probes_mysql.h
probes_mysql_nodtrace.h.in
queues.h
rijndael.h
scope.h
service_versions.h Merge 10.4 into 10.5 2021-03-19 13:09:21 +02:00
source_revision.h.in
span.h
sql_common.h MDEV-23238 - remove async client from server code. 2020-09-01 21:30:52 +02:00
ssl_compat.h WolfSSL v4.6.0-stable 2021-01-02 11:56:41 +02:00
sslopt-case.h MDEV-25511: Command line tools don't support CRL parameters 2021-05-31 08:29:37 +02:00
sslopt-longopts.h
sslopt-vars.h
t_ctype.h
thr_alarm.h MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
thr_lock.h MDEV-13115: Implement SELECT SKIP LOCKED 2021-04-08 16:51:36 +10:00
thr_timer.h
typelib.h Added 'const' to arguments in get_one_option and find_typeset() 2021-02-08 12:16:29 +02:00
violite.h MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
waiting_threads.h
welcome_copyright_notice.h
wqueue.h
wsrep.h MDEV-9609 : wsrep_debug only logs DDL information on originating node 2021-05-15 13:24:22 +03:00