mariadb/mysql-test/suite/perfschema/include
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
..
binlog_common.inc
binlog_edge_common.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
binlog_ok_common.inc perfschema 5.6.10 initial commit. 2014-05-06 23:22:16 +02:00
cleanup_helper.inc mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
connection_cleanup.inc perfschema 5.6.10 initial commit. 2014-05-06 23:20:50 +02:00
connection_load.inc perfschema 5.6.10 initial commit. 2014-05-06 23:20:50 +02:00
connection_setup.inc MDEV-33145 Add FLUSH GLOBAL STATUS 2024-05-27 12:39:03 +02:00
default_mysqld_autosize.cnf MDEV-14425 Improve the redo log for concurrency 2022-01-21 16:03:47 +02:00
digest_cleanup.inc perfschema 5.6.10 initial commit. 2014-05-06 23:20:50 +02:00
digest_execution.inc MDEV-7635: Update tests to adapt to the new default sql_mode 2017-02-10 06:30:42 -05:00
digest_setup.inc 5.6.25 2015-06-16 11:00:33 +02:00
disable_instruments.inc 5.6.17 2014-05-07 10:04:30 +02:00
enable_instruments.inc 5.6.17 2014-05-07 10:04:30 +02:00
event_aggregate_cleanup.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
event_aggregate_load.inc MDEV-5215 prerequisite of prerequisite: if DB is not mentioned in connect ignore errors of switching to it 2022-11-01 15:40:49 +01:00
event_aggregate_setup.inc MDEV-33145 Add FLUSH GLOBAL STATUS 2024-05-27 12:39:03 +02:00
have_aligned_memory.inc fix perfschema.sizing_* tests to run 2021-07-16 19:14:28 +02:00
have_timer_cycle.inc MDEV-8692 prefschema test failures on ARM (on Debian build system) 2015-10-30 10:10:43 +04:00
hostcache_dump.inc perfschema test formatting. Use --echo # 2020-03-14 09:51:36 +01:00
hostcache_set_state.inc MDEV-33145 Add FLUSH GLOBAL STATUS 2024-05-27 12:39:03 +02:00
memory_aggregate_cleanup.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
memory_aggregate_load.inc MDEV-22949 perfschema.memory_aggregate_no_a_no_u fails sporadically in buildbot with wrong result 2024-03-27 16:14:55 +01:00
memory_aggregate_setup.inc MDEV-33145 Add FLUSH GLOBAL STATUS 2024-05-27 12:39:03 +02:00
pfs_no_running_event_scheduler.inc MDEV-11221 - main.events_restart failed in bb 2017-03-02 12:35:31 +04:00
pfs_running_event_scheduler.inc perfschema.threads_mysql sporadic failures 2023-11-25 10:33:31 +01:00
pfs_upgrade.inc perfschema test formatting. Use --echo # 2020-03-14 09:51:36 +01:00
prepared_stmts_deallocation.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
prepared_stmts_execution.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
prepared_stmts_setup.inc Fix typos in mysql-test/ 2025-04-29 13:53:16 +10:00
privilege.inc perfschema 5.6.10 initial commit. 2014-05-06 23:20:50 +02:00
processlist_load.inc mysql-5.7.39 2022-07-29 14:48:01 +02:00
processlist_set.inc mysql-5.7.39 2022-07-29 14:48:01 +02:00
program_cleanup.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
program_execution.inc events in perfschema tests: use ON COMPLETION NOT PRESERVE 2024-03-27 16:14:55 +01:00
program_nested_cleanup.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
program_nested_execution.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
program_nested_setup.inc MDEV-23974 fixup: rpl.rpl_gtid_stop_start fails 2022-03-24 13:43:58 +02:00
program_setup.inc perfschema compilation, test and misc fixes 2020-03-10 19:24:23 +01:00
reset_transaction_gtid.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
rpl_statements_truncate.inc 5.6.17 2014-05-07 10:04:30 +02:00
schema.inc remove features that were deprecated in 10.5 2025-04-29 16:53:02 +02:00
setup_helper.inc perfschema 5.6.10 initial commit. 2014-05-06 23:20:50 +02:00
show_aggregate.inc perfschema test formatting. Use --echo # 2020-03-14 09:51:36 +01:00
show_plugin_verifier.inc perfschema test formatting. Use --echo # 2020-03-14 09:51:36 +01:00
show_transaction_gtid.inc perfschema test formatting. Use --echo # 2020-03-14 09:51:36 +01:00
socket_check1.inc perfschema test formatting. Use --echo # 2020-03-14 09:51:36 +01:00
socket_event.inc Fix typos in mysql-test/ 2025-04-29 13:53:16 +10:00
socket_event_dbg.inc mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
socket_ipv6.inc mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
socket_summary_check.inc increase tolerance in socket_summary_check.inc 2025-04-29 16:53:02 +02:00
socket_summary_check_dbg.inc perfschema 5.6.10 initial commit. 2014-05-06 23:20:50 +02:00
stage_cleanup.inc perfschema 5.6.10 initial commit. 2014-05-06 23:20:50 +02:00
stage_setup.inc MDEV-33145 Add FLUSH GLOBAL STATUS 2024-05-27 12:39:03 +02:00
start_server_common.inc remove features that were deprecated in 10.5 2025-04-29 16:53:02 +02:00
table_aggregate_cleanup.inc perfschema 5.6.10 initial commit. 2014-05-06 23:20:50 +02:00
table_aggregate_load.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
table_aggregate_setup.inc MDEV-33145 Add FLUSH GLOBAL STATUS 2024-05-27 12:39:03 +02:00
table_io_basic_dml.inc MDEV-31003: Second execution for ps-protocol 2023-07-26 17:15:00 +07:00
table_io_cleanup_helper.inc MDEV-33145 Add FLUSH GLOBAL STATUS 2024-05-27 12:39:03 +02:00
table_io_result_helper.inc MDEV-33145 Add FLUSH GLOBAL STATUS 2024-05-27 12:39:03 +02:00
table_io_setup_helper.inc MDEV-33145 Add FLUSH GLOBAL STATUS 2024-05-27 12:39:03 +02:00
transaction_cleanup.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
transaction_nested_events_verifier.inc fix a race condition in the perfschema.transaction_nested_events 2020-03-14 09:51:52 +01:00
transaction_setup.inc P_S 5.7.28 2020-03-10 19:24:22 +01:00
upgrade_check.inc mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
wait_for_pfs_thread_count.inc make perfschema.show_aggregate test more reliable 2023-10-13 18:13:12 +02:00
wait_till_sleep.inc perfschema 5.6.10 initial commit. 2014-05-06 23:20:50 +02:00