Debian Codegraph @

mysql-test/suite/perfschema/t/hostcache_ipv6_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/check_ipv6.inc
12 --source include/have_perfschema.inc
13 --source include/have_hostname_cache.inc
14
15 # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved:
16 # Name or service not known
17 call mtr.add_suppression("santa.claus.ipv6.example.com");
18
19 # Enforce a clean state
20 --source ../include/wait_for_pfs_thread_count.inc
21 --source ../include/hostcache_set_state.inc
22
23 create user 'root'@'santa.claus.ipv6.example.com';
24 grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
25 create user 'root'@'2001:db8::6:6';
26 grant select on test.* to 'root'@'2001:db8::6:6';
27
28 connect (con1,"::1",root,,test,$MASTER_MYPORT,);
29 select "Con1 is alive";
30 select current_user();
31 disconnect con1;
32
33 --connection default
34 SET @saved_dbug = @@GLOBAL.debug_dbug;
35 set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_noname";
36
37 connect (con2,"::1",root,,test,$MASTER_MYPORT,);
38 select "Con2 is alive";
39 select current_user();
40 disconnect con2;
41
42 --connection default
43 --source ../include/hostcache_dump.inc
44
45 connect (con3,"::1",root,,test,$MASTER_MYPORT,);
46 select "Con3 is alive";
47 select current_user();
48 disconnect con3;
49
50 --connection default
51 --source ../include/hostcache_dump.inc
52
53 revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
54 revoke select on test.* from 'root'@'2001:db8::6:6';
55 drop user 'root'@'santa.claus.ipv6.example.com';
56 drop user 'root'@'2001:db8::6:6';
57
58 SET @@GLOBAL.debug_dbug = @saved_dbug;