mariadb/client
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
..
async_example.c MDEV-25602 get rid of __WIN__ in favor of standard _WIN32 2021-06-06 13:21:03 +02:00
client_metadata.h MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRY 2020-03-10 20:43:32 +04:00
client_priv.h MDEV-33627 : Implement option --dir in mariadb-import 2024-07-16 15:16:29 +02:00
CMakeLists.txt MDEV-34740 mariadb-import: optimize index and constraint creation 2025-01-24 13:15:05 +01:00
completion_hash.cc Merge 10.4 into 10.5 2020-11-03 16:24:47 +02:00
completion_hash.h Update FSF Address 2019-05-11 21:29:06 +03:00
connection_pool.cc MDEV-32216 Connection pool with asynchronous query execution. 2024-01-29 11:54:37 +01:00
connection_pool.h MDEV-32216 Connection pool with asynchronous query execution. 2024-01-29 11:54:37 +01:00
echo.c Fix typos in the codebase. 2022-08-09 18:41:09 +03:00
import_util.cc MDEV-34740 mariadb-import: optimize index and constraint creation 2025-01-24 13:15:05 +01:00
import_util.h Fix typos in C comments in miscellaneous files 2025-03-24 13:36:28 +11:00
mariadb-conv.cc unify client/tool version string 2023-01-19 12:39:28 +01:00
my_readline.h Update FSF Address 2019-05-11 21:29:06 +03:00
mysql.cc MDEV-34860 Fix opt_hint_timeout.test for embedded; fix mariadb client 2025-05-05 12:02:47 +07:00
mysql_plugin.c Merge branch '10.11' into 11.2 2024-09-18 10:45:26 +10:00
mysql_upgrade.c Merge 11.4 into 11.8 2025-04-02 14:07:01 +03:00
mysqladmin.cc cleanup: CREATE_TYPELIB_FOR() helper 2024-11-05 14:00:47 -08:00
mysqlbinlog.cc Merge branch '11.8' into 12.0 2025-05-22 09:22:55 +02:00
mysqlcheck.c Merge branch '11.8' into 12.0 2025-06-18 07:50:39 +02:00
mysqldump.cc Merge branch '11.8' into main 2025-04-18 17:11:01 +02:00
mysqlimport.cc Fix typos in C comments in miscellaneous files 2025-03-24 13:36:28 +11:00
mysqlshow.c [MDEV-14978] Client programs to use $MARIADB_HOST consistently 2024-10-04 06:44:39 +01:00
mysqlslap.c Merge branch '11.4' into 11.8 2025-06-18 07:43:24 +02:00
mysqltest.cc mariadb-test: wait on disconnect 2025-07-16 09:14:33 +07:00
readline.cc MDEV-27142 disable text mode for Windows stdio by default 2022-07-18 13:18:03 +02:00