Debian Codegraph @

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

raw
1
2 #
3 # Tests for the performance_schema host_cache.
4 #
5 # Simulate failures from DNS:
6 # - getaddrinfo() fails with AGAIN
7 # - reported in COUNT_ADDRINFO_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] Host name 'santa.claus.ipv4.example.com' could not be resolved:
15 # Name or service not known
16 call mtr.add_suppression("santa.claus.ipv4.example.com");
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'@'santa.claus.ipv4.example.com';
23 grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
24 create user 'root'@'192.0.2.4';
25 grant select on test.* to 'root'@'192.0.2.4';
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_fake_ipv4,getaddrinfo_error_noname";
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 revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
53 revoke select on test.* from 'root'@'192.0.2.4';
54 drop user 'root'@'santa.claus.ipv4.example.com';
55 drop user 'root'@'192.0.2.4';
56
57 SET @@GLOBAL.debug_dbug = @saved_dbug;
58