Debian Codegraph @

mysql-test/suite/perfschema/include/socket_ipv6.inc

raw
1 #==============================================================================
2 # Set IP address defaults with respect to IPV6 support
3 #
4 # This file determines the level of support for IPV4, IPV4 mapped or IPV6, then
5 # sets the appropriate localhost IP format to use for 'connect()' commands.
6 #
7 # Input: $my_socket_debug - Print results of IP version check (optional)
8 # Output: $my_localhost - Default localhost IP
9 #==============================================================================
10
11 let $check_ipv6_just_check= 1;
12 #--source include/check_ipv6.inc
13
14 #==============================================================================
15 # Determine if IPV6 supported
16 #
17 # Parameters:
18 # $check_ipv6_just_check - Don't skip the test if IPv6 is unsupported,
19 # just set the variable $check_ipv6_supported
20 #==============================================================================
21 --disable_query_log
22 --disable_result_log
23 --disable_connect_log
24 --disable_abort_on_error
25
26 let $check_ipv6_supported= 1;
27
28 connect (checkcon123456789,::1,root,,test);
29
30 if($mysql_errno)
31 {
32 let $check_ipv6_supported=0;
33 if(!$check_ipv6_just_check)
34 {
35 skip No IPv6 support;
36 }
37 }
38
39 if(!$mysql_errno)
40 {
41 disconnect checkcon123456789;
42 --source include/wait_until_disconnected.inc
43 }
44
45 connection default;
46
47 --enable_abort_on_error
48 --enable_connect_log
49 --enable_result_log
50 --enable_query_log
51
52 #==============================================================================
53 #
54 # Determine if IPV4 mapped to IPV6 supported
55 #
56 let $check_ipv4_mapped_just_check= 1;
57 #--source include/check_ipv4_mapped.inc
58 #==============================================================================
59 # Check if ipv4 mapped to ipv6 is available.
60 #
61 # Parameters:
62 # $check_ipv4_mapped_just_check - Don't skip the test if IPv4 mapped is unsupported,
63 # just set the variable $check_ipv4_mapped_supported
64 #==============================================================================
65 --disable_query_log
66 --disable_result_log
67 --disable_connect_log
68 --disable_abort_on_error
69
70 let $check_ipv4_mapped_supported= 1;
71
72 connect (checkcon123456789a,::FFFF:127.0.0.1,root,,test);
73
74 if($mysql_errno)
75 {
76 let $check_ipv4_mapped_supported=0;
77 if(!$check_ipv4_mapped_just_check)
78 {
79 skip No mapped IPv4 support;
80 }
81 }
82
83 if(!$mysql_errno)
84 {
85 disconnect checkcon123456789a;
86 --source include/wait_until_disconnected.inc
87 }
88
89 connection default;
90
91 --enable_abort_on_error
92 --enable_connect_log
93 --enable_result_log
94 --enable_query_log
95
96 #==============================================================================
97 # Set the localhost IP default to use when establishing connections
98 #
99 #==============================================================================
100 let $my_localhost=127.0.0.1;
101
102 if($check_ipv6_supported)
103 {
104 let $my_localhost=::1;
105 }
106
107 if($check_ipv4_mapped_supported)
108 {
109 let $my_localhost=::ffff:127.0.0.1;
110 }
111
112 if($my_socket_debug)
113 {
114 --echo IPV6=$check_ipv6_supported, IPV4_MAPPED=$check_ipv4_mapped_supported, LOCALHOST=$my_localhost
115 }
116 #==============================================================================
117