Debian Codegraph @

mysql-test/suite/connection_control/t/connection_control_long_hostname.test

raw
1 --source include/have_debug.inc
2 --source include/mysql_have_debug.inc
3
4 # Make sure that connection_control plugin can be loaded
5 --source ../inc/have_connection_control_plugin.inc
6
7 # Save the initial number of concurrent sessions
8 --source include/count_sessions.inc
9
10 --echo # Setup
11 --echo # Install connection_control plugin
12 --source ../inc/install_connection_control_plugin.inc
13
14 # We don't need to use client side authentication plugin for this test.
15 let $USE_AUTH_PLUGIN= 0;
16
17 --echo # Create user accounts for testing
18 CREATE USER u1@host_1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890 IDENTIFIED BY 'abcd';
19 CREATE USER u2@host_1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890 IDENTIFIED BY 'abcd';
20 CREATE USER u3@host_1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890 IDENTIFIED BY 'abcd';
21
22 SET GLOBAL DEBUG='+d,vio_peer_addr_fake_hostname1';
23 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
24 --error 1
25 --exec $MYSQL --user=u1 --host=host_1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890 --password='haha' -#d,vio_client_use_localhost -v test -e "SELECT CURRENT_USER();"
26
27 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
28 --error 1
29 --exec $MYSQL --user=u1 --host=host_1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890 --password='ijkl' -#d,vio_client_use_localhost -v test -e "SELECT CURRENT_USER();"
30
31 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
32 --error 1
33 --exec $MYSQL --user=u1 --host=host_1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890 --password='mnop' -#d,vio_client_use_localhost -v test -e "SELECT CURRENT_USER();"
34 SET GLOBAL DEBUG='-d,vio_peer_addr_fake_hostname1';
35
36 -- echo # Try various queries
37
38 --sorted_result
39 SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts
40 WHERE USERHOST LIKE '\'u1\'@\'host_%';
41
42 -- echo # Cleanup.
43 DROP USER u1@host_1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890;
44 DROP USER u2@host_1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890;
45 DROP USER u3@host_1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890abcdefghij1234567890;
46
47 --echo # Uninstall connection_control plugin
48 --source ../inc/uninstall_connection_control_plugin.inc
49
50 # Wait till all disconnects are completed.
51 --source include/wait_until_count_sessions.inc