diff options
author | unknown <anozdrin/alik@quad.> | 2008-03-17 14:26:00 +0300 |
---|---|---|
committer | unknown <anozdrin/alik@quad.> | 2008-03-17 14:26:00 +0300 |
commit | c1e69a77a6f6563214b5f5e8813db423c4f3a04c (patch) | |
tree | dbed4b209c7f0db9b9c6015b42e71bd1761897b8 /libmysql/libmysql.c | |
parent | 30d644f859ee65748f12e3861abaf1fbb2c3b2c7 (diff) | |
download | mariadb-git-c1e69a77a6f6563214b5f5e8813db423c4f3a04c.tar.gz |
Avoid races in connect.test.
The problem was in a test case for Bug33507:
- when the number of active connections reaches the limit,
the server accepts only root connections. That's achieved by
accepting a connection, negotiating with the client and
checking user credentials. If it is not SUPER, the connection
is dropped.
- when the server accepts connection, it increases the counter;
- when the server drops connection, it decreases the counter;
- the race was in between of decreasing the counter and accepting
new connection:
- max_user_connections = 2;
- 2 oridinary user connections accepted;
- extra user connection is establishing;
- server checked user credentials, and sent 'Too many connections'
error;
- the client receives the error and establishes extra SUPER user
connection;
- the server however didn't decrease the counter (the extra
user connection still is "alive" in the server) -- so, the new
SUPER-user connection, will be dropped, because it exceeds
(max_user_connections + 1).
The fix is to implement "safe connect", which makes several attempts
to connect and use it in the test script.
mysql-test/r/connect.result:
Update test file.
mysql-test/t/connect.test:
Avoid races in connect.test.
mysql-test/include/connect2.inc:
Auxiliary routine to establish a connection reliably.
Diffstat (limited to 'libmysql/libmysql.c')
0 files changed, 0 insertions, 0 deletions