Debian Codegraph @

mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test

raw
1
2 #
3 # Tests for the performance_schema host_cache.
4 #
5 # Simulate failures from DNS:
6 # - getnameinfo() fails with AGAIN
7 # - reported in COUNT_NAMEINFO_TRANSIENT_ERRORS
8
9 --source include/not_embedded.inc
10 --source include/have_debug.inc
11 --source include/have_perfschema.inc
12 --source include/have_hostname_cache.inc
13
14 # [Warning] IP address '192.0.2.4' could not be resolved:
15 # Temporary failure in name resolution
16 call mtr.add_suppression("192.0.2.4");
17
18 # Enforce a clean state
19 --source ../include/wait_for_pfs_thread_count.inc
20 --source ../include/hostcache_set_state.inc
21
22 create user 'root'@'192.0.2.4';
23 grant select on test.* to 'root'@'192.0.2.4';
24 create user 'root'@'santa.claus.ipv4.example.com';
25 grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
26
27 connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
28 select "Con1 is alive";
29 select current_user();
30 disconnect con1;
31
32 --connection default
33 SET @saved_dbug = @@GLOBAL.debug_dbug;
34 set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again";
35
36 connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
37 select "Con2 is alive";
38 select current_user();
39 disconnect con2;
40
41 --connection default
42 --source ../include/hostcache_dump.inc
43
44 connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
45 select "Con3 is alive";
46 select current_user();
47 disconnect con3;
48
49 --connection default
50 --source ../include/hostcache_dump.inc
51
52 set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
53
54 connect (con4,"127.0.0.1",root,,test,$MASTER_MYPORT,);
55 select "Con4 is alive";
56 select current_user();
57 disconnect con4;
58
59 --connection default
60 --source ../include/hostcache_dump.inc
61
62 connect (con5,"127.0.0.1",root,,test,$MASTER_MYPORT,);
63 select "Con5 is alive";
64 select current_user();
65 disconnect con5;
66
67 --connection default
68 --source ../include/hostcache_dump.inc
69
70 revoke select on test.* from 'root'@'192.0.2.4';
71 revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
72 drop user 'root'@'192.0.2.4';
73 drop user 'root'@'santa.claus.ipv4.example.com';
74
75 SET @@GLOBAL.debug_dbug = @saved_dbug;
76