mariadb/mysql-test/suite/storage_engine/trx
Sergei Golubchik bead24b7f3 mariadb-test: wait on disconnect
Remove one of the major sources of race condiitons in mariadb-test.
Normally, mariadb_close() sends COM_QUIT to the server and immediately
disconnects. In mariadb-test it means the test can switch to another
connection and sends queries to the server before the server even
started parsing the COM_QUIT packet and these queries can see the
connection as fully active, as it didn't reach dispatch_command yet.

This is a major source of instability in tests and many - but not all,
still less than a half - tests employ workarounds. The correct one
is a pair count_sessions.inc/wait_until_count_sessions.inc.
Also very popular was wait_until_disconnected.inc, which was completely
useless, because it verifies that the connection is closed, and after
disconnect it always is, it didn't verify whether the server processed
COM_QUIT. Sadly the placebo was as widely used as the real thing.

Let's fix this by making mariadb-test `disconnect` command _to wait_ for
the server to confirm. This makes almost all workarounds redundant.

In some cases count_sessions.inc/wait_until_count_sessions.inc is still
needed, though, as only `disconnect` command is changed:

 * after external tools, like `exec $MYSQL`
 * after failed `connect` command
 * replication, after `STOP SLAVE`
 * Federated/CONNECT/SPIDER/etc after `DROP TABLE`

and also in some XA tests, because an XA transaction is dissociated from
the THD very late, after the server has closed the client connection.

Collateral cleanups: fix comments, remove some redundant statements:
 * DROP IF EXISTS if nothing is known to exist
 * DROP table/view before DROP DATABASE
 * REVOKE privileges before DROP USER
 etc
2025-07-16 09:14:33 +07:00
..
cons_snapshot_repeatable_read.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
cons_snapshot_repeatable_read.test MDEV-11: Generic storage engine test suite 2012-07-16 06:17:56 +04:00
cons_snapshot_serializable.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
cons_snapshot_serializable.test MDEV-11: Generic storage engine test suite 2012-07-16 06:17:56 +04:00
consistent_snapshot.inc mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
delete.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
delete.test MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
insert.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
insert.test MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
level_read_committed.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
level_read_committed.test MDEV-11: Generic storage engine test suite 2012-07-16 06:17:56 +04:00
level_read_uncommitted.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
level_read_uncommitted.test MDEV-11: Generic storage engine test suite 2012-07-16 06:17:56 +04:00
level_repeatable_read.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
level_repeatable_read.test MDEV-11: Generic storage engine test suite 2012-07-16 06:17:56 +04:00
level_serializable.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
level_serializable.test MDEV-11: Generic storage engine test suite 2012-07-16 06:17:56 +04:00
my.cnf MDEV-11: Generic storage engine test suite 2012-07-16 06:17:56 +04:00
select_for_update.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
select_for_update.test mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
select_lock_in_share_mode.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
select_lock_in_share_mode.test mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
support_savepoints.inc MDEV-11: Generic storage engine test suite 2012-07-16 06:17:56 +04:00
support_transactions.inc MDEV-11: Generic storage engine test suite 2012-07-16 06:17:56 +04:00
support_xa.inc MDEV-11: Generic storage engine test suite 2012-07-16 06:17:56 +04:00
transaction_isolation.inc mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
update.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
update.test MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
xa.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
xa.test mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
xa_recovery.result MDEV-4028 - Converted rdiff files to uniform 2013-02-03 02:53:57 +04:00
xa_recovery.test MDEV-23511 shutdown_server 10 times out, causing server kill at shutdown 2020-08-21 14:48:53 +03:00