mariadb/mysql-test/suite/csv
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
..
csv.result MDEV-33449 improving repair of tables 2024-05-27 12:39:03 +02:00
csv.test mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
csv_alter_table.result Created suites for heap, archive and csv. 2012-04-04 00:16:38 +03:00
csv_alter_table.test Created suites for heap, archive and csv. 2012-04-04 00:16:38 +03:00
csv_not_null.result MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
csv_not_null.test MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
flush.result Optimize flush tables with read lock (FTWRL) to not wait for select's 2018-12-09 22:12:25 +02:00
flush.test Optimize flush tables with read lock (FTWRL) to not wait for select's 2018-12-09 22:12:25 +02:00
lowercase_table0.result MDEV-31340 Remove MY_COLLATION_HANDLER::strcasecmp() 2024-04-18 15:22:10 +04:00
lowercase_table0.test MDEV-31340 Remove MY_COLLATION_HANDLER::strcasecmp() 2024-04-18 15:22:10 +04:00
read_only.result Added Max_index_length and Temporary to SHOW TABLE STATUS 2018-02-12 17:17:26 +02:00
read_only.test Fixed errors found by MSAN 2020-07-02 23:50:56 +03:00
symlink.result MDEV-36050 DATA/INDEX DIRECTORY handling is inconsistent 2025-04-18 09:41:23 +02:00
symlink.test MDEV-36050 DATA/INDEX DIRECTORY handling is inconsistent 2025-04-18 09:41:23 +02:00