mariadb/mysql-test/suite/gcol/t
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
..
gcol_archive.test
gcol_blackhole.test
gcol_blocked_sql_funcs_innodb.test
gcol_blocked_sql_funcs_myisam.test
gcol_bug20746926.test mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
gcol_bugfixes.test MDEV-33281 Optimizer hints Cleanup: fix formatting, rename objects 2025-05-05 12:02:47 +07:00
gcol_column_def_options_innodb.test
gcol_column_def_options_myisam.test
gcol_handler_innodb.test
gcol_handler_myisam.test
gcol_ins_upd_innodb.test MDEV-17890 Server crash on DELETE with YEAR field with truncated expr 2021-07-12 22:00:39 +03:00
gcol_ins_upd_myisam.test
gcol_keys_innodb.test
gcol_keys_myisam.test
gcol_memory.test
gcol_merge.test
gcol_non_stored_columns_innodb.test
gcol_non_stored_columns_myisam.test
gcol_partition_innodb.test MDEV-32050 fixup: Stabilize tests 2023-11-21 12:42:00 +02:00
gcol_partition_myisam.test
gcol_purge.test MDEV-32050 fixup: Stabilize tests 2023-11-21 12:42:00 +02:00
gcol_rejected_innodb.test
gcol_rollback.test mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
gcol_select_innodb.test
gcol_select_myisam.test
gcol_supported_sql_funcs_innodb.test
gcol_supported_sql_funcs_myisam.test
gcol_trigger_sp_innodb.test
gcol_trigger_sp_myisam.test
gcol_update.test MDEV-32050 fixup: Stabilize tests 2023-11-21 12:42:00 +02:00
gcol_view_innodb.test
gcol_view_myisam.test
innodb_partition.test
innodb_prefix_index_check.test MDEV-13626 Merge InnoDB test cases from MySQL 5.7 2023-11-08 12:17:14 +02:00
innodb_virtual_basic.test MDEV-28933: Per-table unique FOREIGN KEY constraint names 2025-07-08 12:30:27 +03:00
innodb_virtual_blob.test MDEV-23497 Make ROW_FORMAT=COMPRESSED read-only by default 2020-11-11 11:15:11 +02:00
innodb_virtual_debug.test mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
innodb_virtual_debug_purge.opt Merge 10.2 into 10.3 2019-09-23 10:25:34 +03:00
innodb_virtual_debug_purge.test mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
innodb_virtual_fk.test MDEV-26866 FOREIGN KEY…SET NULL corrupts an index on a virtual column 2021-10-28 07:32:27 +03:00
innodb_virtual_fk_restart.test
innodb_virtual_index.opt MDEV-25872 InnoDB: Assertion failure in row_merge_read_clustered_index upon ALTER on table with indexed virtual columns 2021-06-15 13:15:32 +05:30
innodb_virtual_index.test Fix typos in mysql-test/ 2025-04-29 13:53:16 +10:00
innodb_virtual_purge.test mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
innodb_virtual_rebuild.test support 'alter online table t1 page_checksum=0' 2023-08-15 10:16:11 +02:00
innodb_virtual_stats.test MDEV-24564 Statistics are lost after ALTER TABLE 2021-01-28 14:15:01 +02:00
innodb_wl8114.test
main_alter_table.test MDEV-16678: Fix a problem with duplicate #sql2 table names 2019-12-10 16:18:30 +02:00
main_mysqldump.test
rpl_gcol.test
virtual_index_drop.test Fix build without either ENABLED_DEBUG_SYNC or DBUG_OFF 2022-09-23 17:37:52 +03:00