| 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/have_debug.inc |
| 10 |
|
| 11 |
# [Warning] IP address '192.0.2.4' could not be resolved: |
| 12 |
# Temporary failure in name resolution |
| 13 |
call mtr.add_suppression("192.0.2.4"); |
| 14 |
|
| 15 |
# Enforce a clean state |
| 16 |
--source ../include/wait_for_pfs_thread_count.inc |
| 17 |
--source ../include/hostcache_set_state.inc |
| 18 |
|
| 19 |
create user 'root'@'192.0.2.4', 'root'@'santa.claus.ipv4.example.com'; |
| 20 |
grant select on test.* to 'root'@'192.0.2.4'; |
| 21 |
grant select on test.* to 'root'@'santa.claus.ipv4.example.com'; |
| 22 |
|
| 23 |
connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,); |
| 24 |
select "Con1 is alive"; |
| 25 |
select current_user(); |
| 26 |
disconnect con1; |
| 27 |
|
| 28 |
--connection default |
| 29 |
set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again"; |
| 30 |
|
| 31 |
connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,); |
| 32 |
select "Con2 is alive"; |
| 33 |
select current_user(); |
| 34 |
disconnect con2; |
| 35 |
|
| 36 |
--connection default |
| 37 |
--source ../include/hostcache_dump.inc |
| 38 |
|
| 39 |
connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,); |
| 40 |
select "Con3 is alive"; |
| 41 |
select current_user(); |
| 42 |
disconnect con3; |
| 43 |
|
| 44 |
--connection default |
| 45 |
--source ../include/hostcache_dump.inc |
| 46 |
|
| 47 |
set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4"; |
| 48 |
|
| 49 |
connect (con4,"127.0.0.1",root,,test,$MASTER_MYPORT,); |
| 50 |
select "Con4 is alive"; |
| 51 |
select current_user(); |
| 52 |
disconnect con4; |
| 53 |
|
| 54 |
--connection default |
| 55 |
--source ../include/hostcache_dump.inc |
| 56 |
|
| 57 |
connect (con5,"127.0.0.1",root,,test,$MASTER_MYPORT,); |
| 58 |
select "Con5 is alive"; |
| 59 |
select current_user(); |
| 60 |
disconnect con5; |
| 61 |
|
| 62 |
--connection default |
| 63 |
--source ../include/hostcache_dump.inc |
| 64 |
|
| 65 |
revoke select on test.* from 'root'@'192.0.2.4'; |
| 66 |
revoke select on test.* from 'root'@'santa.claus.ipv4.example.com'; |
| 67 |
drop user 'root'@'192.0.2.4'; |
| 68 |
drop user 'root'@'santa.claus.ipv4.example.com'; |
| 69 |
|
| 70 |
set global debug= default; |
| 71 |
|