Commit 34436edb authored by Marc Alff's avatar Marc Alff

Merge mysql-next-mr (revno 2937) --> mysql-next-mr-marc

parents bd2c8005 3f797a46
......@@ -39,6 +39,9 @@ ADD_DEFINITIONS(-DDEFAULT_CHARSET_HOME="c:/Program Files/MySQL/MySQL Server ${MY
ADD_DEFINITIONS(-DPACKAGE=mysql)
ADD_DEFINITIONS(-DSHAREDIR="share")
# Enable IPv6 handling code
ADD_DEFINITIONS(-DHAVE_IPV6)
# Set debug options
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS")
......
......@@ -878,6 +878,42 @@ AC_CHECK_DECLS(MHA_MAPSIZE_VA,
fi
#--------------------------------------------------------------------
# Check for IPv6 support
#--------------------------------------------------------------------
AC_CHECK_HEADERS(netinet/in6.h)
AC_CHECK_TYPES([struct sockaddr_in6, struct in6_addr],
[have_in6_types=yes],
[have_in6_types=no],
[[
#ifdef WIN32
#include <winsock2.h>
#else
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN6_H
#include <netinet/in6.h>
#endif
]])
AC_MSG_CHECKING([for IPv6 support])
AC_ARG_ENABLE(ipv6,
AS_HELP_STRING([--disable-ipv6], [Disable support for IPv6 networking]),
[disable_ipv6=yes], [disable_ipv6=no])
if test x"$disable_ipv6" = xyes -o x"$have_in6_types" = xno; then
AC_MSG_RESULT([no])
else
AC_DEFINE([HAVE_IPV6], [1], [Define if IPv6 networking support is present])
AC_MSG_RESULT([yes])
fi
#--------------------------------------------------------------------
# Check for TCP wrapper support
#--------------------------------------------------------------------
......@@ -976,12 +1012,6 @@ AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
uchar, uint, ulong],[],[], [
#include <sys/types.h>
])
AC_CHECK_TYPES([in_addr_t], [], [], [
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
])
AC_CHECK_TYPES([fp_except], [], [], [
#include <sys/types.h>
#include <ieeefp.h>
......
......@@ -20,6 +20,13 @@
#define BIG_TABLES
/*
Minimal version of Windows we should be able to run on.
Currently Windows XP.
*/
#define _WIN32_WINNT 0x0501
#if defined(_MSC_VER) && _MSC_VER >= 1400
/* Avoid endless warnings about sprintf() etc. being unsafe. */
#define _CRT_SECURE_NO_DEPRECATE 1
......@@ -27,6 +34,7 @@
#include <sys/locking.h>
#include <winsock2.h>
#include <Ws2tcpip.h>
#include <fcntl.h>
#include <io.h>
#include <malloc.h>
......@@ -88,6 +96,12 @@
#define S_IROTH S_IREAD /* for my_lib */
/* Winsock2 constant (Vista SDK and later)*/
#define IPPROTO_IPV6 41
#ifndef IPV6_V6ONLY
#define IPV6_V6ONLY 27
#endif
#ifdef __BORLANDC__
#define FILE_BINARY O_BINARY /* my_fopen in binary mode */
#define O_TEMPORARY 0
......
......@@ -43,7 +43,7 @@ C_MODE_START
#include <sys/ioctl.h>
#endif
#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__NETWARE__)
#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__NETWARE__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
......@@ -73,11 +73,6 @@ C_MODE_START
#define in_addr_t uint32
#endif
/* On some operating systems (e.g. Solaris) INADDR_NONE is not defined */
#ifndef INADDR_NONE
#define INADDR_NONE -1 /* Error value from inet_addr */
#endif
/* Thread safe or portable version of some functions */
void my_inet_ntoa(struct in_addr in, char *buf);
......@@ -86,9 +81,6 @@ void my_inet_ntoa(struct in_addr in, char *buf);
Handling of gethostbyname_r()
*/
#if !defined(HPUX10)
struct hostent;
#endif /* HPUX */
#if !defined(HAVE_GETHOSTBYNAME_R)
struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
......@@ -118,11 +110,5 @@ struct hostent *my_gethostbyname_r(const char *name,
#define GETHOSTBYNAME_BUFF_SIZE 2048
#endif
/* On SCO you get a link error when refering to h_errno */
#ifdef SCO
#undef h_errno
#define h_errno errno
#endif
C_MODE_END
#endif
......@@ -81,13 +81,19 @@ int vio_errno(Vio*vio);
/* Get socket number */
my_socket vio_fd(Vio*vio);
/* Remote peer's address and name in text form */
my_bool vio_peer_addr(Vio* vio, char *buf, uint16 *port);
/* Remotes in_addr */
void vio_in_addr(Vio *vio, struct in_addr *in);
my_bool vio_peer_addr(Vio *vio, char *buf, uint16 *port, size_t buflen);
my_bool vio_poll_read(Vio *vio, uint timeout);
my_bool vio_is_connected(Vio *vio);
ssize_t vio_pending(Vio *vio);
my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, int addr_length,
char *ip_string, size_t ip_string_size);
int vio_getnameinfo(const struct sockaddr *sa,
char *hostname, size_t hostname_size,
char *port, size_t port_size,
int flags);
#ifdef HAVE_OPENSSL
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER < 0x0090700f
......@@ -154,8 +160,7 @@ void vio_end(void);
#define vio_should_retry(vio) (vio)->should_retry(vio)
#define vio_was_interrupted(vio) (vio)->was_interrupted(vio)
#define vio_close(vio) ((vio)->vioclose)(vio)
#define vio_peer_addr(vio, buf, prt) (vio)->peer_addr(vio, buf, prt)
#define vio_in_addr(vio, in) (vio)->in_addr(vio, in)
#define vio_peer_addr(vio, buf, prt, buflen) (vio)->peer_addr(vio, buf, prt, buflen)
#define vio_timeout(vio, which, seconds) (vio)->timeout(vio, which, seconds)
#define vio_poll_read(vio, timeout) (vio)->poll_read(vio, timeout)
#define vio_is_connected(vio) (vio)->is_connected(vio)
......@@ -180,8 +185,9 @@ struct st_vio
HANDLE hPipe;
my_bool localhost; /* Are we from localhost? */
int fcntl_mode; /* Buffered fcntl(sd,F_GETFL) */
struct sockaddr_in local; /* Local internet address */
struct sockaddr_in remote; /* Remote internet address */
struct sockaddr_storage local; /* Local internet address */
struct sockaddr_storage remote; /* Remote internet address */
int addrLen; /* Length of remote address */
enum enum_vio_type type; /* Type of connection */
char desc[30]; /* String description */
char *read_buffer; /* buffer for vio_read_buff */
......@@ -197,8 +203,8 @@ struct st_vio
my_bool (*is_blocking)(Vio*);
int (*viokeepalive)(Vio*, my_bool);
int (*fastsend)(Vio*);
my_bool (*peer_addr)(Vio*, char *, uint16*);
void (*in_addr)(Vio*, struct in_addr*);
my_bool (*peer_addr)(Vio*, char *, uint16*, size_t);
void (*in_addr)(Vio*, struct sockaddr_storage*);
my_bool (*should_retry)(Vio*);
my_bool (*was_interrupted)(Vio*);
int (*vioclose)(Vio*);
......
# Check if ipv6 is available. If not, server is crashing (see BUG#48915).
--disable_query_log
--disable_abort_on_error
connect (checkcon123456789,::1,root,,test);
if($mysql_errno)
{
skip wrong IP;
}
connection default;
disconnect checkcon123456789;
--enable_abort_on_error
--enable_query_log
# end check
eval CREATE USER testuser@'$IPv6' identified by '1234';
eval GRANT ALL ON test.* TO testuser@'$IPv6';
eval SHOW GRANTS FOR testuser@'$IPv6';
# deliver NULL instead of a valid number, see bug#34037
eval SET @nip= inet_aton('$IPv6');
SELECT @nip;
SELECT inet_ntoa(@nip);
# delivers a wrong value, see bug#34037
SELECT USER();
SELECT current_user();
--disable_result_log
SHOW PROCESSLIST;
--enable_result_log
connect (con1, $IPv6, root, , test, $MASTER_MYPORT);
connection default;
disconnect con1;
eval REVOKE ALL ON test.* FROM testuser@'$IPv6';
eval RENAME USER testuser@'$IPv6' to testuser1@'$IPv6';
eval SET PASSWORD FOR testuser1@'$IPv6' = PASSWORD ('9876');
SELECT USER();
eval DROP USER testuser1@'$IPv6';
--exec $MYSQLADMIN --no-defaults --default-character-set=latin1 -h $IPv6 -P $MASTER_MYPORT -u root ping
--disable_result_log
--exec $MYSQL_CHECK -h $IPv6 -P $MASTER_MYPORT -u root test
--exec $MYSQL_DUMP -h $IPv6 -P $MASTER_MYPORT -u root test
--exec $MYSQL_SHOW -h $IPv6 -P $MASTER_MYPORT -u root
--exec $MYSQL --host=$IPv6 --port=$MASTER_MYPORT --user=root test -e "SELECT current_user();SELECT user();"
--enable_result_log
--echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
--echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
--echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
--echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
--echo disconnect slave;
disconnect slave;
--echo disconnect master;
disconnect master;
--echo connection default;
connection default;
--echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
--echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
--echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
--echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
--echo disconnect slave;
disconnect slave;
--echo disconnect master;
disconnect master;
--echo connection default;
connection default;
--echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
--echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
--echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
--echo connection slave;
connection slave;
reset slave;
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
--echo disconnect slave;
disconnect slave;
--echo disconnect master;
disconnect master;
--echo connection default;
connection default;
=============Test of '127.0.0.1' (IPv4) ===========================
mysqld is alive
CREATE USER testuser@'127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'127.0.0.1';
SHOW GRANTS FOR testuser@'127.0.0.1';
Grants for testuser@127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1'
SET @nip= inet_aton('127.0.0.1');
SELECT @nip;
@nip
2130706433
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
127.0.0.1
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'127.0.0.1';
RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1';
SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'127.0.0.1';
=============Test of '0:0:0:0:0:FFFF:127.0.0.1' ===================
mysqld is alive
CREATE USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0:0:0:0:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0:0:0:0:0:FFFF:127.0.0.1';
Grants for testuser@0:0:0:0:0:FFFF:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1'
SET @nip= inet_aton('0:0:0:0:0:FFFF:127.0.0.1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:FFFF:127.0.0.1';
RENAME USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' to testuser1@'0:0:0:0:0:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0:0:0:0:0:FFFF:127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'0:0:0:0:0:FFFF:127.0.0.1';
=============Test of '0000:0000:0000:0000:0000:FFFF:127.0.0.1' ====
mysqld is alive
CREATE USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
Grants for testuser@0000:0000:0000:0000:0000:FFFF:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'
SET @nip= inet_aton('0000:0000:0000:0000:0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
RENAME USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' to testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
=============Test of '0:0000:0000:0:0000:FFFF:127.0.0.1' ====
mysqld is alive
CREATE USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
Grants for testuser@0:0000:0000:0:0000:FFFF:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1'
SET @nip= inet_aton('0:0000:0000:0:0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
RENAME USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' to testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1';
=============Test of '0::0000:FFFF:127.0.0.1' ====
mysqld is alive
CREATE USER testuser@'0::0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0::0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0::0000:FFFF:127.0.0.1';
Grants for testuser@0::0000:FFFF:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0::0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0::0000:FFFF:127.0.0.1'
SET @nip= inet_aton('0::0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0::0000:FFFF:127.0.0.1';
RENAME USER testuser@'0::0000:FFFF:127.0.0.1' to testuser1@'0::0000:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0::0000:FFFF:127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'0::0000:FFFF:127.0.0.1';
=============Test of '0:0:0:0:0:FFFF:127.0.0.1/96' ================
=============Test of '::FFFF:127.0.0.1' ===========================
mysqld is alive
CREATE USER testuser@'::FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'::FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'::FFFF:127.0.0.1';
Grants for testuser@::FFFF:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'::FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::FFFF:127.0.0.1'
SET @nip= inet_aton('::FFFF:127.0.0.1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'::FFFF:127.0.0.1';
RENAME USER testuser@'::FFFF:127.0.0.1' to testuser1@'::FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'::FFFF:127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'::FFFF:127.0.0.1';
=============Test of '::FFFF:127.0.0.1/96' ========================
=============Test of '::1' ========================
connect (con1, ::1, root, , test, MASTER_MYPORT,);
Got one of the listed errors
=============Test of '127.0.0.1' (IPv4) ===========================
mysqld is alive
CREATE USER testuser@'127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'127.0.0.1';
SHOW GRANTS FOR testuser@'127.0.0.1';
Grants for testuser@127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1'
SET @nip= inet_aton('127.0.0.1');
SELECT @nip;
@nip
2130706433
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
127.0.0.1
SELECT USER();
USER()
root@127.0.0.1
SELECT current_user();
current_user()
root@127.0.0.1
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'127.0.0.1';
RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1';
SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@127.0.0.1
DROP USER testuser1@'127.0.0.1';
=============Test of '::1' ========================
connect (con1, ::1, root, , test, MASTER_MYPORT);
Got one of the listed errors
=============Test of '::1' ========================================
mysqld is alive
CREATE USER testuser@'::1' identified by '1234';
GRANT ALL ON test.* TO testuser@'::1';
SHOW GRANTS FOR testuser@'::1';
Grants for testuser@::1
GRANT USAGE ON *.* TO 'testuser'@'::1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::1'
SET @nip= inet_aton('::1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'::1';
RENAME USER testuser@'::1' to testuser1@'::1';
SET PASSWORD FOR testuser1@'::1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'::1';
=============Test of '::1/128' ====================================
=============Test of '0000:0000:0000:0000:0000:0000:0000:0001' ====
mysqld is alive
CREATE USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' identified by '1234';
GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
Grants for testuser@0000:0000:0000:0000:0000:0000:0000:0001
GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001'
SET @nip= inet_aton('0000:0000:0000:0000:0000:0000:0000:0001');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
RENAME USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' to testuser1@'0000:0000:0000:0000:0000:0000:0000:0001';
SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:0000:0000:0001' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'0000:0000:0000:0000:0000:0000:0000:0001';
=============Test of '0:0:0:0:0:0:0:1' ============================
mysqld is alive
CREATE USER testuser@'0:0:0:0:0:0:0:1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0:0:0:0:0:0:1';
SHOW GRANTS FOR testuser@'0:0:0:0:0:0:0:1';
Grants for testuser@0:0:0:0:0:0:0:1
GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:0:0:1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:0:0:1'
SET @nip= inet_aton('0:0:0:0:0:0:0:1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:0:0:1';
RENAME USER testuser@'0:0:0:0:0:0:0:1' to testuser1@'0:0:0:0:0:0:0:1';
SET PASSWORD FOR testuser1@'0:0:0:0:0:0:0:1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'0:0:0:0:0:0:0:1';
=============Test of '127.0.0.1' (IPv4) ===========================
mysqld is alive
CREATE USER testuser@'127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'127.0.0.1';
SHOW GRANTS FOR testuser@'127.0.0.1';
Grants for testuser@127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1'
SET @nip= inet_aton('127.0.0.1');
SELECT @nip;
@nip
2130706433
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
127.0.0.1
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'127.0.0.1';
RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1';
SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'127.0.0.1';
=============Test of '0:0:0:0:0:FFFF:127.0.0.1' ===================
mysqld is alive
CREATE USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0:0:0:0:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0:0:0:0:0:FFFF:127.0.0.1';
Grants for testuser@0:0:0:0:0:FFFF:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1'
SET @nip= inet_aton('0:0:0:0:0:FFFF:127.0.0.1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:FFFF:127.0.0.1';
RENAME USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' to testuser1@'0:0:0:0:0:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0:0:0:0:0:FFFF:127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'0:0:0:0:0:FFFF:127.0.0.1';
=============Test of '0000:0000:0000:0000:0000:FFFF:127.0.0.1' ====
mysqld is alive
CREATE USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
Grants for testuser@0000:0000:0000:0000:0000:FFFF:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'
SET @nip= inet_aton('0000:0000:0000:0000:0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
RENAME USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' to testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
=============Test of '0:0000:0000:0:0000:FFFF:127.0.0.1' ====
mysqld is alive
CREATE USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
Grants for testuser@0:0000:0000:0:0000:FFFF:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1'
SET @nip= inet_aton('0:0000:0000:0:0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
RENAME USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' to testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1';
=============Test of '0::0000:FFFF:127.0.0.1' ====
mysqld is alive
CREATE USER testuser@'0::0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0::0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0::0000:FFFF:127.0.0.1';
Grants for testuser@0::0000:FFFF:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'0::0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0::0000:FFFF:127.0.0.1'
SET @nip= inet_aton('0::0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0::0000:FFFF:127.0.0.1';
RENAME USER testuser@'0::0000:FFFF:127.0.0.1' to testuser1@'0::0000:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0::0000:FFFF:127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'0::0000:FFFF:127.0.0.1';
=============Test of '0:0:0:0:0:FFFF:127.0.0.1/96' ================
=============Test of '::FFFF:127.0.0.1' ===========================
mysqld is alive
CREATE USER testuser@'::FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'::FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'::FFFF:127.0.0.1';
Grants for testuser@::FFFF:127.0.0.1
GRANT USAGE ON *.* TO 'testuser'@'::FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::FFFF:127.0.0.1'
SET @nip= inet_aton('::FFFF:127.0.0.1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@localhost
SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'::FFFF:127.0.0.1';
RENAME USER testuser@'::FFFF:127.0.0.1' to testuser1@'::FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'::FFFF:127.0.0.1' = PASSWORD ('9876');
SELECT USER();
USER()
root@localhost
DROP USER testuser1@'::FFFF:127.0.0.1';
=============Test of '::FFFF:127.0.0.1/96' ========================
=============Test of '::1' ========================================
mysqld is alive
CREATE USER testuser@'::1' identified by '1234';
GRANT ALL ON test.* TO testuser@'::1';
SHOW GRANTS FOR testuser@'::1';
Grants for testuser@::1
GRANT USAGE ON *.* TO 'testuser'@'::1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::1'
SET @nip= inet_aton('::1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@::1
SELECT current_user();
current_user()
root@::1
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'::1';
RENAME USER testuser@'::1' to testuser1@'::1';
SET PASSWORD FOR testuser1@'::1' = PASSWORD ('9876');
SELECT USER();
USER()
root@::1
DROP USER testuser1@'::1';
=============Test of '::1/128' ====================================
=============Test of '0000:0000:0000:0000:0000:0000:0000:0001' ====
mysqld is alive
CREATE USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' identified by '1234';
GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
Grants for testuser@0000:0000:0000:0000:0000:0000:0000:0001
GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001'
SET @nip= inet_aton('0000:0000:0000:0000:0000:0000:0000:0001');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@::1
SELECT current_user();
current_user()
root@::1
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
RENAME USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' to testuser1@'0000:0000:0000:0000:0000:0000:0000:0001';
SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:0000:0000:0001' = PASSWORD ('9876');
SELECT USER();
USER()
root@::1
DROP USER testuser1@'0000:0000:0000:0000:0000:0000:0000:0001';
=============Test of '0:0:0:0:0:0:0:1' ============================
mysqld is alive
CREATE USER testuser@'0:0:0:0:0:0:0:1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0:0:0:0:0:0:1';
SHOW GRANTS FOR testuser@'0:0:0:0:0:0:0:1';
Grants for testuser@0:0:0:0:0:0:0:1
GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:0:0:1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:0:0:1'
SET @nip= inet_aton('0:0:0:0:0:0:0:1');
SELECT @nip;
@nip
NULL
SELECT inet_ntoa(@nip);
inet_ntoa(@nip)
NULL
SELECT USER();
USER()
root@::1
SELECT current_user();
current_user()
root@::1
SHOW PROCESSLIST;
REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:0:0:1';
RENAME USER testuser@'0:0:0:0:0:0:0:1' to testuser1@'0:0:0:0:0:0:0:1';
SET PASSWORD FOR testuser1@'0:0:0:0:0:0:0:1' = PASSWORD ('9876');
SELECT USER();
USER()
root@::1
DROP USER testuser1@'0:0:0:0:0:0:0:1';
#################### IP: ::1 ###########################
connect (master,::1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: No such row
change master to master_host='::1';
Master-Host: ::1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ###########################
connect (master,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::1
change master to master_host='0000:0000:0000:0000:0000:0000:0000:0001';
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:0:0:1 ###########################
connect (master,0:0:0:0:0:0:0:1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: 127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0:0:0:0:0:0:0:1
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:FFFF:127.0.0.1 ###########################
connect (master,0:0:0:0:0:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:FFFF:127.0.0.1';
Master-Host: 0:0:0:0:0:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 ###########################
connect (master,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0:0:0:0:0:FFFF:127.0.0.1
change master to master_host='0000:0000:0000:0000:0000:FFFF:127.0.0.1';
Master-Host: 0000:0000:0000:0000:0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0000:0000:0:0000:FFFF:127.0.0.1 ###########################
connect (master,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0000:0000:0000:0000:0000:FFFF:127.0.0.1
change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1';
Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0::0000:FFFF:127.0.0.1 ###########################
connect (master,0::0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1
change master to master_host='0::0000:FFFF:127.0.0.1';
Master-Host: 0::0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::FFFF:127.0.0.1 ###########################
connect (master,::FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0::0000:FFFF:127.0.0.1
change master to master_host='::FFFF:127.0.0.1';
Master-Host: ::FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 mix #######################
connect (master,::1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::FFFF:127.0.0.1
change master to master_host='::1';
Master-Host: ::1
change master to master_host='::FFFF:127.0.0.1';
Master-Host: ::FFFF:127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,::1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: No such row
change master to master_host='::1';
Master-Host: ::1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,::1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::1
change master to master_host='::1';
Master-Host: ::1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::1
change master to master_host='0000:0000:0000:0000:0000:0000:0000:0001';
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:0:0:1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0:0:0:0:0:0:0:1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: 127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0:0:0:0:0:0:0:1
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:FFFF:127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0:0:0:0:0:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:FFFF:127.0.0.1';
Master-Host: 0:0:0:0:0:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0:0:0:0:0:FFFF:127.0.0.1
change master to master_host='0000:0000:0000:0000:0000:FFFF:127.0.0.1';
Master-Host: 0000:0000:0000:0000:0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0000:0000:0:0000:FFFF:127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0000:0000:0000:0000:0000:FFFF:127.0.0.1
change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1';
Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0::0000:FFFF:127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0::0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1
change master to master_host='0::0000:FFFF:127.0.0.1';
Master-Host: 0::0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::FFFF:127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,::FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0::0000:FFFF:127.0.0.1
change master to master_host='::FFFF:127.0.0.1';
Master-Host: ::FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 mix #######################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,::1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::FFFF:127.0.0.1
change master to master_host='::1';
Master-Host: ::1
change master to master_host='::FFFF:127.0.0.1';
Master-Host: ::FFFF:127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,::1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: No such row
change master to master_host='::1';
Master-Host: ::1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::1
change master to master_host='0000:0000:0000:0000:0000:0000:0000:0001';
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:0:0:1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0:0:0:0:0:0:0:1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: 127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0:0:0:0:0:0:0:1
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 mix #######################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,::1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 127.0.0.1
change master to master_host='::1';
Master-Host: ::1
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 ###########################
connect (master,::1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: No such row
change master to master_host='::1';
Master-Host: ::1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ###########################
connect (master,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::1
change master to master_host='0000:0000:0000:0000:0000:0000:0000:0001';
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:0:0:1 ###########################
connect (master,0:0:0:0:0:0:0:1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: 127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 0:0:0:0:0:0:0:1
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 mix #######################
connect (master,::1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 127.0.0.1
change master to master_host='::1';
Master-Host: ::1
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: 127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:FFFF:127.0.0.1 ###########################
connect (master,0:0:0:0:0:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0:0:0:0:0:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0:0:0:0:0:FFFF:127.0.0.1';
Master-Host: 0:0:0:0:0:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 ###########################
connect (master,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0000:0000:0000:0000:0000:FFFF:127.0.0.1';
Master-Host: 0000:0000:0000:0000:0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0000:0000:0:0000:FFFF:127.0.0.1 ###########################
connect (master,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1';
Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0::0000:FFFF:127.0.0.1 ###########################
connect (master,0::0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0::0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0::0000:FFFF:127.0.0.1';
Master-Host: 0::0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::FFFF:127.0.0.1 ###########################
connect (master,::FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,::FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='::FFFF:127.0.0.1';
Master-Host: ::FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::FFFF:127.0.0.1
change master to master_host='::1';
Master-Host: ::1
change master to master_host='::FFFF:127.0.0.1';
Master-Host: ::FFFF:127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: 127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 127.0.0.1
change master to master_host='::1';
Master-Host: ::1
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 ###########################
connect (master,::1,root,,test,MASTER_MYPORT);
connect (slave,::1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='::1';
Master-Host: ::1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ###########################
connect (master,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,MASTER_MYPORT);
connect (slave,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0000:0000:0000:0000:0000:0000:0000:0001';
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:0:0:1 ###########################
connect (master,0:0:0:0:0:0:0:1,root,,test,MASTER_MYPORT);
connect (slave,0:0:0:0:0:0:0:1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: 127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:FFFF:127.0.0.1 ###########################
connect (master,0:0:0:0:0:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0:0:0:0:0:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0:0:0:0:0:FFFF:127.0.0.1';
Master-Host: 0:0:0:0:0:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 ###########################
connect (master,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0000:0000:0000:0000:0000:FFFF:127.0.0.1';
Master-Host: 0000:0000:0000:0000:0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0000:0000:0:0000:FFFF:127.0.0.1 ###########################
connect (master,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1';
Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0::0000:FFFF:127.0.0.1 ###########################
connect (master,0::0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,0::0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0::0000:FFFF:127.0.0.1';
Master-Host: 0::0000:FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::FFFF:127.0.0.1 ###########################
connect (master,::FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,::FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='::FFFF:127.0.0.1';
Master-Host: ::FFFF:127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 mix #######################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: ::FFFF:127.0.0.1
change master to master_host='::1';
Master-Host: ::1
change master to master_host='::FFFF:127.0.0.1';
Master-Host: ::FFFF:127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 ###########################
connect (master,::1,root,,test,MASTER_MYPORT);
connect (slave,::1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='::1';
Master-Host: ::1
disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ###########################
connect (master,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,MASTER_MYPORT);
connect (slave,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0000:0000:0000:0000:0000:0000:0000:0001';
Master-Host: 0000:0000:0000:0000:0000:0000:0000:0001
disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:0:0:1 ###########################
connect (master,0:0:0:0:0:0:0:1,root,,test,MASTER_MYPORT);
connect (slave,0:0:0:0:0:0:0:1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
#################### IP: 127.0.0.1 ###########################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 mix #######################
connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connection master;
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
reset slave;
Master-Host: 127.0.0.1
change master to master_host='::1';
Master-Host: ::1
change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
disconnect slave;
disconnect master;
connection default;
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
!include include/default_client.cnf
[mysqld.1]
# Run the master.sh script before starting this process
#!run-master-sh
log-bin= master-bin
loose-innodb
skip-name-resolve
bind-address= ::
[mysqld.2]
# Run the slave.sh script before starting this process
#!run-slave-sh
# Append <testname>-slave.opt file to the list of argument used when
# starting the mysqld
#!use-slave-opt
log-bin= slave-bin
relay-log= slave-relay-bin
init-rpl-role= slave
log-slave-updates
master-retry-count= 10
# Values reported by slave when it connect to master
# and shows up in SHOW SLAVE STATUS;
report-host= localhost
report-port= @mysqld.2.port
report-user= root
skip-slave-start
skip-name-resolve
bind-address= 0.0.0.0
# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
# test results will vary, thus a relative path is used.
slave-load-tmpdir= ../../tmp
loose-innodb
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
SLAVE_MYPORT= @mysqld.2.port
SLAVE_MYSOCK= @mysqld.2.socket
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv6 format, especially "change master host=..."
# Options: --skip-name-resolve, master: --bind-address=::, slave: --bind-address=0.0.0.0
# (see corresponding cnf file)
#
--source include/check_ipv6.inc
# Can't be tested with windows due to mixed format like 0::0000:FFFF:127.0.0.1
--source include/not_windows.inc
--source include/have_log_bin.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
let $IPv6= ::1/128;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ip_mix.inc
let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
let $IPv6= 0:0:0:0:0:0:0:1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
let $IPv6= 127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
let $IPv6= 0000:0000:0000:0000:0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
let $IPv6= 0:0000:0000:0:0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
let $IPv6= 0::0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
#let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1/96;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ip_mix.inc
let $IPv6= ::FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
#let $IPv6= ::FFFF:127.0.0.1/96;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ip_mix.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 mix #######################
--echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
--echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
--echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
--echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='::FFFF:127.0.0.1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
--echo disconnect slave;
disconnect slave;
--echo disconnect master;
disconnect master;
--echo connection default;
connection default;
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
!include include/default_client.cnf
[mysqld.1]
# Run the master.sh script before starting this process
#!run-master-sh
log-bin= master-bin
loose-innodb
skip-name-resolve
bind-address= 0.0.0.0
[mysqld.2]
# Run the slave.sh script before starting this process
#!run-slave-sh
# Append <testname>-slave.opt file to the list of argument used when
# starting the mysqld
#!use-slave-opt
log-bin= slave-bin
relay-log= slave-relay-bin
init-rpl-role= slave
log-slave-updates
master-retry-count= 10
# Values reported by slave when it connect to master
# and shows up in SHOW SLAVE STATUS;
report-host= localhost
report-port= @mysqld.2.port
report-user= root
skip-slave-start
skip-name-resolve
bind-address= ::
# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
# test results will vary, thus a relative path is used.
slave-load-tmpdir= ../../tmp
loose-innodb
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
SLAVE_MYPORT= @mysqld.2.port
SLAVE_MYSOCK= @mysqld.2.socket
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv6 format, especially "change master host=..."
# Options: --skip-name-resolve, master: --bind-address=0.0.0.0, slave: --bind-address=::
# (see corresponding cnf file)
#
# Check if ipv6 is available. If not, server is crashing (see BUG#48915).
--disable_query_log
--disable_abort_on_error
connect (checkcon123456789,::1,root,,test,$SLAVE_MYPORT);
if($mysql_errno)
{
skip wrong IP for slave;
}
connection default;
disconnect checkcon123456789;
--enable_abort_on_error
--enable_query_log
# end check
# Can't be tested with windows due to mixed format like 0::0000:FFFF:127.0.0.1
--source include/not_windows.inc
--source include/have_log_bin.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= ::1/128;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ip_mix2.inc
let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= 0:0:0:0:0:0:0:1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= 127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= 0000:0000:0000:0000:0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= 0:0000:0000:0:0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= 0::0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
#let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1/96;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ip_mix2.inc
let $IPv6= ::FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
#let $IPv6= ::FFFF:127.0.0.1/96;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ip_mix2.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 mix #######################
--echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
--echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
--echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
--echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='::FFFF:127.0.0.1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
--echo disconnect slave;
disconnect slave;
--echo disconnect master;
disconnect master;
--echo connection default;
connection default;
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
!include include/default_client.cnf
[mysqld.1]
# Run the master.sh script before starting this process
#!run-master-sh
log-bin= master-bin
loose-innodb
skip-name-resolve
bind-address= 0.0.0.0
[mysqld.2]
# Run the slave.sh script before starting this process
#!run-slave-sh
# Append <testname>-slave.opt file to the list of argument used when
# starting the mysqld
#!use-slave-opt
log-bin= slave-bin
relay-log= slave-relay-bin
init-rpl-role= slave
log-slave-updates
master-retry-count= 10
# Values reported by slave when it connect to master
# and shows up in SHOW SLAVE STATUS;
report-host= localhost
report-port= @mysqld.2.port
report-user= root
skip-slave-start
skip-name-resolve
bind-address= ::
# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
# test results will vary, thus a relative path is used.
slave-load-tmpdir= ../../tmp
loose-innodb
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
SLAVE_MYPORT= @mysqld.2.port
SLAVE_MYSOCK= @mysqld.2.socket
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv6 format, especially "change master host=..."
# Options: --skip-name-resolve, master: --bind-address=0.0.0.0, slave: --bind-address=::
# (see corresponding cnf file)
#
# Check if ipv6 is available. If not, server is crashing (see BUG#48915).
--disable_query_log
--disable_abort_on_error
connect (checkcon123456789,::1,root,,test,$SLAVE_MYPORT);
if($mysql_errno)
{
skip wrong IP for slave;
}
connection default;
disconnect checkcon123456789;
--enable_abort_on_error
--enable_query_log
# end check
# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1
--source include/windows.inc
--source include/have_log_bin.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= ::1/128;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ip_mix2.inc
let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= 0:0:0:0:0:0:0:1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= 127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix2.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 mix #######################
--echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
--echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
--echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
--echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='127.0.0.1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
--echo disconnect slave;
disconnect slave;
--echo disconnect master;
disconnect master;
--echo connection default;
connection default;
--exit
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
!include include/default_client.cnf
[mysqld.1]
# Run the master.sh script before starting this process
#!run-master-sh
log-bin= master-bin
loose-innodb
skip-name-resolve
bind-address= ::
[mysqld.2]
# Run the slave.sh script before starting this process
#!run-slave-sh
# Append <testname>-slave.opt file to the list of argument used when
# starting the mysqld
#!use-slave-opt
log-bin= slave-bin
relay-log= slave-relay-bin
init-rpl-role= slave
log-slave-updates
master-retry-count= 10
# Values reported by slave when it connect to master
# and shows up in SHOW SLAVE STATUS;
report-host= localhost
report-port= @mysqld.2.port
report-user= root
skip-slave-start
skip-name-resolve
bind-address= 0.0.0.0
# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
# test results will vary, thus a relative path is used.
slave-load-tmpdir= ../../tmp
loose-innodb
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
SLAVE_MYPORT= @mysqld.2.port
SLAVE_MYSOCK= @mysqld.2.socket
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv6 format, especially "change master host=..."
# Options: --skip-name-resolve, master: --bind-address=::, slave: --bind-address=0.0.0.0
# (see corresponding cnf file)
#
--source include/check_ipv6.inc
# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1
--source include/windows.inc
--source include/have_log_bin.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
let $IPv6= ::1/128;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ip_mix.inc
let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
let $IPv6= 0:0:0:0:0:0:0:1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
let $IPv6= 127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ip_mix.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 mix #######################
--echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
--echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
--echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
--echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='127.0.0.1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
--echo disconnect slave;
disconnect slave;
--echo disconnect master;
disconnect master;
--echo connection default;
connection default;
--exit
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
!include include/default_client.cnf
[mysqld.1]
# Run the master.sh script before starting this process
#!run-master-sh
log-bin= master-bin
loose-innodb
skip-name-resolve
bind-address= 0.0.0.0
[mysqld.2]
# Run the slave.sh script before starting this process
#!run-slave-sh
# Append <testname>-slave.opt file to the list of argument used when
# starting the mysqld
#!use-slave-opt
log-bin= slave-bin
relay-log= slave-relay-bin
init-rpl-role= slave
log-slave-updates
master-retry-count= 10
# Values reported by slave when it connect to master
# and shows up in SHOW SLAVE STATUS;
report-host= localhost
report-port= @mysqld.2.port
report-user= root
skip-slave-start
skip-name-resolve
bind-address= 0.0.0.0
# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
# test results will vary, thus a relative path is used.
slave-load-tmpdir= ../../tmp
loose-innodb
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
SLAVE_MYPORT= @mysqld.2.port
SLAVE_MYSOCK= @mysqld.2.socket
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv4 (127.0.0.1) in ipv6 format, especially "change master host=..."
# Options: --skip-name-resolve, --bind-address=0.0.0.0 (see corresponding cnf file)
# for master and slave
#
# Check if ipv4 is available.
--disable_query_log
--disable_abort_on_error
connect (checkcon123456789,127.0.0.1,root,,test);
if($mysql_errno)
{
skip wrong IP;
}
connection default;
disconnect checkcon123456789;
--enable_abort_on_error
--enable_query_log
# end check
# Can't be tested with windows due to mixed format like 0::0000:FFFF:127.0.0.1
--source include/not_windows.inc
--source include/have_log_bin.inc
let $IPv6= 127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 0000:0000:0000:0000:0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 0:0000:0000:0:0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 0::0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
#let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1/96;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ipv6.inc
let $IPv6= ::FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
#let $IPv6= ::FFFF:127.0.0.1/96;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ipv6.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 ###########################
--echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
--echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
--echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
--echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='::FFFF:127.0.0.1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
--echo disconnect slave;
disconnect slave;
--echo disconnect master;
disconnect master;
--echo connection default;
connection default;
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
!include include/default_client.cnf
[mysqld.1]
# Run the master.sh script before starting this process
#!run-master-sh
log-bin= master-bin
loose-innodb
skip-name-resolve
bind-address= 0.0.0.0
[mysqld.2]
# Run the slave.sh script before starting this process
#!run-slave-sh
# Append <testname>-slave.opt file to the list of argument used when
# starting the mysqld
#!use-slave-opt
log-bin= slave-bin
relay-log= slave-relay-bin
init-rpl-role= slave
log-slave-updates
master-retry-count= 10
# Values reported by slave when it connect to master
# and shows up in SHOW SLAVE STATUS;
report-host= localhost
report-port= @mysqld.2.port
report-user= root
skip-slave-start
skip-name-resolve
bind-address= 0.0.0.0
# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
# test results will vary, thus a relative path is used.
slave-load-tmpdir= ../../tmp
loose-innodb
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
SLAVE_MYPORT= @mysqld.2.port
SLAVE_MYSOCK= @mysqld.2.socket
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv4 (127.0.0.1) in ipv6 format, especially "change master host=..."
# Options: --skip-name-resolve, --bind-address=0.0.0.0 (see corresponding cnf file)
# for master and slave
#
# Check if ipv4 is available.
--disable_query_log
--disable_abort_on_error
connect (checkcon123456789,127.0.0.1,root,,test);
if($mysql_errno)
{
skip wrong IP;
}
connection default;
disconnect checkcon123456789;
--enable_abort_on_error
--enable_query_log
# end check
# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1
--source include/windows.inc
--source include/have_log_bin.inc
let $IPv6= 127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 ###########################
--echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
--echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
--echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
--echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='127.0.0.1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
--echo disconnect slave;
disconnect slave;
--echo disconnect master;
disconnect master;
--echo connection default;
connection default;
--exit
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
!include include/default_client.cnf
[mysqld.1]
# Run the master.sh script before starting this process
#!run-master-sh
log-bin= master-bin
loose-innodb
skip-name-resolve
bind-address= ::
[mysqld.2]
# Run the slave.sh script before starting this process
#!run-slave-sh
# Append <testname>-slave.opt file to the list of argument used when
# starting the mysqld
#!use-slave-opt
log-bin= slave-bin
relay-log= slave-relay-bin
init-rpl-role= slave
log-slave-updates
master-retry-count= 10
# Values reported by slave when it connect to master
# and shows up in SHOW SLAVE STATUS;
report-host= localhost
report-port= @mysqld.2.port
report-user= root
skip-slave-start
skip-name-resolve
bind-address= ::
# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
# test results will vary, thus a relative path is used.
slave-load-tmpdir= ../../tmp
loose-innodb
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
SLAVE_MYPORT= @mysqld.2.port
SLAVE_MYSOCK= @mysqld.2.socket
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv6 format, especially "change master host=..."
# Options: --skip-name-resolve, --bind-address=:: (see corresponding cnf file)
# for master and slave.
#
--source include/check_ipv6.inc
# Can't be tested with windows due to mixed format like 0::0000:FFFF:127.0.0.1
--source include/not_windows.inc
--source include/have_log_bin.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= ::1/128;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ipv6.inc
let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 0:0:0:0:0:0:0:1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 0000:0000:0000:0000:0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 0:0000:0000:0:0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 0::0000:FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
#let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1/96;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ipv6.inc
let $IPv6= ::FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
#let $IPv6= ::FFFF:127.0.0.1/96;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ipv6.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 mix #######################
--echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
--echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
--echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
--echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='::FFFF:127.0.0.1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
--echo disconnect slave;
disconnect slave;
--echo disconnect master;
disconnect master;
--echo connection default;
connection default;
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
!include include/default_client.cnf
[mysqld.1]
# Run the master.sh script before starting this process
#!run-master-sh
log-bin= master-bin
loose-innodb
skip-name-resolve
bind-address= ::
[mysqld.2]
# Run the slave.sh script before starting this process
#!run-slave-sh
# Append <testname>-slave.opt file to the list of argument used when
# starting the mysqld
#!use-slave-opt
log-bin= slave-bin
relay-log= slave-relay-bin
init-rpl-role= slave
log-slave-updates
master-retry-count= 10
# Values reported by slave when it connect to master
# and shows up in SHOW SLAVE STATUS;
report-host= localhost
report-port= @mysqld.2.port
report-user= root
skip-slave-start
skip-name-resolve
bind-address= ::
# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
# test results will vary, thus a relative path is used.
slave-load-tmpdir= ../../tmp
loose-innodb
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
SLAVE_MYPORT= @mysqld.2.port
SLAVE_MYSOCK= @mysqld.2.socket
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv6 format, especially "change master host=..."
# Options: --skip-name-resolve, --bind-address=:: (see corresponding cnf file)
# for master and slave.
#
--source include/check_ipv6.inc
# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1
--source include/windows.inc
--source include/have_log_bin.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= ::1/128;
#--echo #################### IP: $IPv6 ###########################
#--source include/rpl_ipv6.inc
let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 0:0:0:0:0:0:0:1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= 127.0.0.1;
--echo #################### IP: $IPv6 ###########################
--source include/rpl_ipv6.inc
let $IPv6= ::1;
--echo #################### IP: $IPv6 mix #######################
--echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
--echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
--echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
--echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='127.0.0.1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
--echo disconnect slave;
disconnect slave;
--echo disconnect master;
disconnect master;
--echo connection default;
connection default;
--exit
--skip-name-resolve --bind-address=0.0.0.0
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv4 (127.0.0.1) in ipv6 format
# Options: --skip-name-resolve, --bind-address=0.0.0.0 (see corresponding opt file).
#
# Can't be tested with windows due to mixed format like 0::0000:FFFF:127.0.0.1
--source include/not_windows.inc
# Can't be tested with embedded server
--source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
echo =============Test of '127.0.0.1' (IPv4) ===========================;
let $IPv6= 127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0:0:0:0:0:FFFF:127.0.0.1' ===================;
let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0000:0000:0000:0000:0000:FFFF:127.0.0.1' ====;
let $IPv6= 0000:0000:0000:0000:0000:FFFF:127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0:0000:0000:0:0000:FFFF:127.0.0.1' ====;
let $IPv6= 0:0000:0000:0:0000:FFFF:127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0::0000:FFFF:127.0.0.1' ====;
let $IPv6= 0::0000:FFFF:127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0:0:0:0:0:FFFF:127.0.0.1/96' ================;
let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1/96;
#--source include/ipv6_clients.inc
#--source include/ipv6.inc
echo =============Test of '::FFFF:127.0.0.1' ===========================;
let $IPv6= ::FFFF:127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '::FFFF:127.0.0.1/96' ========================;
let $IPv6= ::FFFF:127.0.0.1/96;
#--source include/ipv6_clients.inc
#--source include/ipv6.inc
echo =============Test of '::1' ========================;
let $IPv6= ::1;
--echo connect (con1, $IPv6, root, , test, MASTER_MYPORT,);
--disable_query_log
--error 2003,2006
connect (con1, $IPv6, root, , test, $MASTER_MYPORT,);
--enable_query_log
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
--skip-name-resolve --bind-address=0.0.0.0
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv4 (127.0.0.1) in ipv6 format
# Options: --skip-name-resolve, --bind-address=0.0.0.0 (see corresponding opt file).
#
# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1
--source include/windows.inc
# Can't be tested with embedded server
--source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
echo =============Test of '127.0.0.1' (IPv4) ===========================;
let $IPv6= 127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '::1' ========================;
let $IPv6= ::1;
--echo connect (con1, $IPv6, root, , test, MASTER_MYPORT);
--disable_query_log
--error 2003,2006
connect (con1, $IPv6, root, , test, $MASTER_MYPORT);
--enable_query_log
connection default;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
--skip-name-resolve --bind-address=::
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv6 format
# Options: --skip-name-resolve, --bind-address=:: (see corresponding opt file).
#
--source include/check_ipv6.inc
# Can't be tested with windows due to the mixed format like 0:0:0:0:0:FFFF:127.0.0.1
--source include/not_windows.inc
# Can't be tested with embedded server
--source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
echo =============Test of '::1' ========================================;
let $IPv6= ::1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '::1/128' ====================================;
let $IPv6= ::1/128;
#--source include/ipv6_clients.inc
#--source include/ipv6.inc
echo =============Test of '0000:0000:0000:0000:0000:0000:0000:0001' ====;
let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0:0:0:0:0:0:0:1' ============================;
let $IPv6= 0:0:0:0:0:0:0:1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '127.0.0.1' (IPv4) ===========================;
let $IPv6= 127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0:0:0:0:0:FFFF:127.0.0.1' ===================;
let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0000:0000:0000:0000:0000:FFFF:127.0.0.1' ====;
let $IPv6= 0000:0000:0000:0000:0000:FFFF:127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0:0000:0000:0:0000:FFFF:127.0.0.1' ====;
let $IPv6= 0:0000:0000:0:0000:FFFF:127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0::0000:FFFF:127.0.0.1' ====;
let $IPv6= 0::0000:FFFF:127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0:0:0:0:0:FFFF:127.0.0.1/96' ================;
let $IPv6= 0:0:0:0:0:FFFF:127.0.0.1/96;
#--source include/ipv6_clients.inc
#--source include/ipv6.inc
echo =============Test of '::FFFF:127.0.0.1' ===========================;
let $IPv6= ::FFFF:127.0.0.1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '::FFFF:127.0.0.1/96' ========================;
let $IPv6= ::FFFF:127.0.0.1/96;
#--source include/ipv6_clients.inc
#--source include/ipv6.inc
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
--skip-name-resolve --bind-address=::
# Copyright (C) 2009 SUN Microsystems
# All rights reserved. Use is subject to license terms.
# Author: Horst Hunger
# Nov. 19, 2009
# Test of ipv6 format
# Options: --skip-name-resolve, --bind-address=:: (see corresponding opt file).
#
--source include/check_ipv6.inc
# For windows due to missing the mixed format like 0::0000:FFFF:127.0.0.1
--source include/windows.inc
# Can't be tested with embedded server
--source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
echo =============Test of '::1' ========================================;
let $IPv6= ::1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '::1/128' ====================================;
let $IPv6= ::1/128;
#--source include/ipv6_clients.inc
#--source include/ipv6.inc
echo =============Test of '0000:0000:0000:0000:0000:0000:0000:0001' ====;
let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001;
--source include/ipv6_clients.inc
--source include/ipv6.inc
echo =============Test of '0:0:0:0:0:0:0:1' ============================;
let $IPv6= 0:0:0:0:0:0:0:1;
--source include/ipv6_clients.inc
--source include/ipv6.inc
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
......@@ -15,7 +15,7 @@ DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';
# Bug#13407 Remote connecting crashes server
# Server crashed when one used USER() function in connection for which
# was impossible to obtain peer hostname.
connect (con1, 127.0.0.1, root, , test, $MASTER_MYPORT, );
connect (con1, localhost, root, , test, $MASTER_MYPORT, );
--replace_column 1 #
SELECT USER();
# We are only interested in the fact that statement below doesn't
......
......@@ -24,6 +24,7 @@ set @current_hostname= @@hostname;
INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost';
REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
INSERT INTO tmp_user (host,user) VALUES ('localhost','');
INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost';
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
......
This diff is collapsed.
......@@ -30,10 +30,6 @@
#define set_sigpipe(mysql)
#define reset_sigpipe(mysql)
#define read_user_name(A) {}
#define mysql_rpl_query_type(A,B) MYSQL_RPL_ADMIN
#define mysql_master_send_query(A, B, C) 1
#define mysql_slave_send_query(A, B, C) 1
#define mysql_rpl_probe(mysql) 0
#undef HAVE_SMEM
#undef _CUSTOMCONFIG_
......
This diff is collapsed.
......@@ -53,6 +53,9 @@
#include "sql_array.h"
#include "sql_plugin.h"
#include "scheduler.h"
#ifndef __WIN__
#include <netdb.h>
#endif
class Parser_state;
......@@ -2254,10 +2257,11 @@ uint build_table_shadow_filename(char *buff, size_t bufflen,
#define FRM_ONLY (1 << 3)
/* from hostname.cc */
struct in_addr;
char * ip_to_hostname(struct in_addr *in,uint *errors);
void inc_host_errors(struct in_addr *in);
void reset_host_errors(struct in_addr *in);
bool ip_to_hostname(struct sockaddr_storage *ip_storage,
const char *ip_string,
char **hostname, uint *connect_errors);
void inc_host_errors(const char *ip_string);
void reset_host_errors(const char *ip_string);
bool hostname_cache_init();
void hostname_cache_free();
void hostname_cache_refresh(void);
......
......@@ -106,7 +106,6 @@ extern "C" { // Because of SCO 3.2V4.2
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif
#include <netdb.h>
#ifdef HAVE_SELECT_H
# include <select.h>
#endif
......@@ -176,7 +175,7 @@ static void registerwithneb();
static void getvolumename();
static void getvolumeID(BYTE *volumeName);
#endif /* __NETWARE__ */
#ifdef _AIX41
int initgroups(const char *,unsigned int);
......@@ -390,7 +389,6 @@ static my_bool opt_short_log_format= 0;
static uint kill_cached_threads, wake_thread;
static ulong killed_threads, thread_created;
static ulong max_used_connections;
static ulong my_bind_addr; /**< the address we bind to */
static volatile ulong cached_thread_count= 0;
static const char *sql_mode_str= "OFF";
/* Text representation for OPTIMIZER_SWITCH_DEFAULT */
......@@ -1630,17 +1628,18 @@ static void set_root(const char *path)
#endif
}
static void network_init(void)
{
struct sockaddr_in IPaddr;
#ifdef HAVE_SYS_UN_H
struct sockaddr_un UNIXaddr;
#endif
int arg=1;
int arg;
int ret;
uint waited;
uint this_wait;
uint retry;
char port_buf[NI_MAXSERV];
DBUG_ENTER("network_init");
LINT_INIT(ret);
......@@ -1651,26 +1650,65 @@ static void network_init(void)
if (mysqld_port != 0 && !opt_disable_networking && !opt_bootstrap)
{
struct addrinfo *ai, *a;
struct addrinfo hints;
int error;
DBUG_PRINT("general",("IP Socket is %d",mysqld_port));
ip_sock = socket(AF_INET, SOCK_STREAM, 0);
bzero(&hints, sizeof (hints));
hints.ai_flags= AI_PASSIVE;
hints.ai_socktype= SOCK_STREAM;
hints.ai_family= AF_UNSPEC;
my_snprintf(port_buf, NI_MAXSERV, "%d", mysqld_port);
error= getaddrinfo(my_bind_addr_str, port_buf, &hints, &ai);
if (error != 0)
{
DBUG_PRINT("error",("Got error: %d from getaddrinfo()", error));
sql_perror(ER_DEFAULT(ER_IPSOCK_ERROR)); /* purecov: tested */
unireg_abort(1); /* purecov: tested */
}
for (a= ai; a != NULL; a= a->ai_next)
{
ip_sock= socket(a->ai_family, a->ai_socktype, a->ai_protocol);
if (ip_sock != INVALID_SOCKET)
break;
}
if (ip_sock == INVALID_SOCKET)
{
DBUG_PRINT("error",("Got error: %d from socket()",socket_errno));
sql_perror(ER(ER_IPSOCK_ERROR)); /* purecov: tested */
sql_perror(ER_DEFAULT(ER_IPSOCK_ERROR)); /* purecov: tested */
unireg_abort(1); /* purecov: tested */
}
bzero((char*) &IPaddr, sizeof(IPaddr));
IPaddr.sin_family = AF_INET;
IPaddr.sin_addr.s_addr = my_bind_addr;
IPaddr.sin_port = (unsigned short) htons((unsigned short) mysqld_port);
#ifndef __WIN__
/*
We should not use SO_REUSEADDR on windows as this would enable a
user to open two mysqld servers with the same TCP/IP port.
*/
arg= 1;
(void) setsockopt(ip_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,sizeof(arg));
#endif /* __WIN__ */
#ifdef IPV6_V6ONLY
/*
For interoperability with older clients, IPv6 socket should
listen on both IPv6 and IPv4 wildcard addresses.
Turn off IPV6_V6ONLY option.
NOTE: this will work starting from Windows Vista only.
On Windows XP dual stack is not available, so it will not
listen on the corresponding IPv4-address.
*/
if (a->ai_family == AF_INET6)
{
arg= 0;
(void) setsockopt(ip_sock, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&arg,
sizeof(arg));
}
#endif
/*
Sometimes the port is not released fast enough when stopping and
restarting the server. This happens quite often with the test suite
......@@ -1681,8 +1719,7 @@ static void network_init(void)
*/
for (waited= 0, retry= 1; ; retry++, waited+= this_wait)
{
if (((ret= bind(ip_sock, my_reinterpret_cast(struct sockaddr *) (&IPaddr),
sizeof(IPaddr))) >= 0) ||
if (((ret= bind(ip_sock, a->ai_addr, a->ai_addrlen)) >= 0 ) ||
(socket_errno != SOCKET_EADDRINUSE) ||
(waited >= mysqld_port_timeout))
break;
......@@ -1690,6 +1727,7 @@ static void network_init(void)
this_wait= retry * retry / 3 + 1;
sleep(this_wait);
}
freeaddrinfo(ai);
if (ret < 0)
{
DBUG_PRINT("error",("Got error: %d from bind",socket_errno));
......@@ -1711,7 +1749,6 @@ static void network_init(void)
if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap &&
opt_enable_named_pipe)
{
strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\.\\pipe\\",
mysqld_unix_port, NullS);
bzero((char*) &saPipeSecurity, sizeof(saPipeSecurity));
......@@ -1777,6 +1814,7 @@ static void network_init(void)
UNIXaddr.sun_family = AF_UNIX;
strmov(UNIXaddr.sun_path, mysqld_unix_port);
(void) unlink(mysqld_unix_port);
arg= 1;
(void) setsockopt(unix_sock,SOL_SOCKET,SO_REUSEADDR,(char*)&arg,
sizeof(arg));
umask(0);
......@@ -4832,7 +4870,7 @@ static bool read_init_file(char *file_name)
When we enter this function, LOCK_thread_count is hold!
*/
void handle_connection_in_main_thread(THD *thd)
{
safe_mutex_assert_owner(&LOCK_thread_count);
......@@ -4915,7 +4953,6 @@ void create_thread_to_handle_connection(THD *thd)
static void create_new_thread(THD *thd)
{
NET *net=&thd->net;
DBUG_ENTER("create_new_thread");
/*
......@@ -4985,6 +5022,7 @@ inline void kill_broken_server()
/* Handle new connections and spawn new process to handle them */
#ifndef EMBEDDED_LIBRARY
void handle_connections_sockets()
{
my_socket sock,new_sock;
......@@ -4992,7 +5030,7 @@ void handle_connections_sockets()
uint max_used_connection= (uint) (max(ip_sock,unix_sock)+1);
fd_set readFDs,clientFDs;
THD *thd;
struct sockaddr_in cAddr;
struct sockaddr_storage cAddr;
int ip_flags=0,socket_flags=0,flags;
st_vio *vio_tmp;
DBUG_ENTER("handle_connections_sockets");
......@@ -5066,9 +5104,9 @@ void handle_connections_sockets()
#endif /* NO_FCNTL_NONBLOCK */
for (uint retry=0; retry < MAX_ACCEPT_RETRY; retry++)
{
size_socket length=sizeof(struct sockaddr_in);
new_sock = accept(sock, my_reinterpret_cast(struct sockaddr *) (&cAddr),
&length);
size_socket length= sizeof(struct sockaddr_storage);
new_sock= accept(sock, (struct sockaddr *)(&cAddr),
&length);
#ifdef __NETWARE__
// TODO: temporary fix, waiting for TCP/IP fix - DEFECT000303149
if ((new_sock == INVALID_SOCKET) && (socket_errno == EINVAL))
......@@ -5139,9 +5177,10 @@ void handle_connections_sockets()
{
size_socket dummyLen;
struct sockaddr dummy;
dummyLen = sizeof(struct sockaddr);
if (getsockname(new_sock,&dummy, &dummyLen) < 0)
struct sockaddr_storage dummy;
dummyLen = sizeof(dummy);
if ( getsockname(new_sock,(struct sockaddr *)&dummy,
(SOCKET_SIZE_TYPE *)&dummyLen) < 0 )
{
sql_perror("Error on new connection socket");
(void) shutdown(new_sock, SHUT_RDWR);
......@@ -5487,7 +5526,7 @@ pthread_handler_t handle_connections_shared_memory(void *arg)
NullS);
sql_perror(buff);
}
if (handle_client_file_map)
if (handle_client_file_map)
CloseHandle(handle_client_file_map);
if (handle_client_map)
UnmapViewOfFile(handle_client_map);
......@@ -7718,7 +7757,6 @@ static int mysql_init_variables(void)
strmov(server_version, MYSQL_SERVER_VERSION);
myisam_recover_options_str= sql_mode_str= "OFF";
myisam_stats_method_str= "nulls_unequal";
my_bind_addr = htonl(INADDR_ANY);
threads.empty();
thread_cache.empty();
key_caches.empty();
......@@ -8153,27 +8191,25 @@ mysqld_get_one_option(int optid,
my_use_symdir=0;
break;
case (int) OPT_BIND_ADDRESS:
if ((my_bind_addr= (ulong) inet_addr(argument)) == INADDR_NONE)
{
struct hostent *ent;
if (argument[0])
ent=gethostbyname(argument);
else
struct addrinfo *res_lst, hints;
bzero(&hints, sizeof(struct addrinfo));
hints.ai_socktype= SOCK_STREAM;
hints.ai_protocol= IPPROTO_TCP;
if (getaddrinfo(argument, NULL, &hints, &res_lst) != 0)
{
char myhostname[255];
if (gethostname(myhostname,sizeof(myhostname)) < 0)
{
sql_perror("Can't start server: cannot get my own hostname!");
return 1;
}
ent=gethostbyname(myhostname);
sql_print_error("Can't start server: cannot resolve hostname!");
return 1;
}
if (!ent)
if (res_lst->ai_next)
{
sql_perror("Can't start server: cannot resolve hostname!");
sql_print_error("Can't start server: bind-address refers to multiple interfaces!");
return 1;
}
my_bind_addr = (ulong) ((in_addr*)ent->h_addr_list[0])->s_addr;
freeaddrinfo(res_lst);
}
break;
case (int) OPT_PID_FILE:
......
......@@ -1785,24 +1785,83 @@ static bool compare_hostname(const acl_host_and_ip *host, const char *hostname,
(ip && !wild_compare(ip, host->hostname, 0)));
}
/**
Check if the given host name needs to be resolved or not.
Host name has to be resolved if it actually contains *name*.
For example:
192.168.1.1 --> FALSE
192.168.1.0/255.255.255.0 --> FALSE
% --> FALSE
192.168.1.% --> FALSE
AB% --> FALSE
AAAAFFFF --> TRUE (Hostname)
AAAA:FFFF:1234:5678 --> FALSE
::1 --> FALSE
This function does not check if the given string is a valid host name or
not. It assumes that the argument is a valid host name.
@param hostname the string to check.
@return a flag telling if the argument needs to be resolved or not.
@retval TRUE the argument is a host name and needs to be resolved.
@retval FALSE the argument is either an IP address, or a patter and
should not be resolved.
*/
bool hostname_requires_resolving(const char *hostname)
{
char cur;
if (!hostname)
return FALSE;
size_t namelen= strlen(hostname);
size_t lhlen= strlen(my_localhost);
if ((namelen == lhlen) &&
!my_strnncoll(system_charset_info, (const uchar *)hostname, namelen,
(const uchar *)my_localhost, strlen(my_localhost)))
/* Check if hostname is the localhost. */
size_t hostname_len= strlen(hostname);
size_t localhost_len= strlen(my_localhost);
if (hostname == my_localhost ||
(hostname_len == localhost_len &&
!my_strnncoll(system_charset_info,
(const uchar *) hostname, hostname_len,
(const uchar *) my_localhost, strlen(my_localhost))))
{
return FALSE;
for (; (cur=*hostname); hostname++)
}
/*
If the string contains any of {':', '%', '_', '/'}, it is definitely
not a host name:
- ':' means that the string is an IPv6 address;
- '%' or '_' means that the string is a pattern;
- '/' means that the string is an IPv4 network address;
*/
for (const char *p= hostname; *p; ++p)
{
if ((cur != '%') && (cur != '_') && (cur != '.') && (cur != '/') &&
((cur < '0') || (cur > '9')))
return TRUE;
switch (*p) {
case ':':
case '%':
case '_':
case '/':
return FALSE;
}
}
return FALSE;
/*
Now we have to tell a host name (ab.cd, 12.ab) from an IPv4 address
(12.34.56.78). The assumption is that if the string contains only
digits and dots, it is an IPv4 address. Otherwise -- a host name.
*/
for (const char *p= hostname; *p; ++p)
{
if (*p != '.' && !my_isdigit(&my_charset_latin1, *p))
return TRUE; /* a "letter" has been found. */
}
return FALSE; /* all characters are either dots or digits. */
}
......
......@@ -1238,7 +1238,6 @@ class THD :public Statement,
HASH user_vars; // hash for user variables
String packet; // dynamic buffer for network I/O
String convert_buffer; // buffer for charset conversions
struct sockaddr_in remote; // client socket address
struct rand_struct rand; // used for authentication
struct system_variables variables; // Changeable local variables
struct system_status_var status_var; // Per thread statistic vars
......
......@@ -377,7 +377,8 @@ check_user(THD *thd, enum enum_server_command command,
if (send_old_password_request(thd) ||
my_net_read(net) != SCRAMBLE_LENGTH_323 + 1)
{
inc_host_errors(&thd->remote.sin_addr);
inc_host_errors(thd->main_security_ctx.ip);
my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
DBUG_RETURN(1);
}
......@@ -498,9 +499,9 @@ check_user(THD *thd, enum enum_server_command command,
thd->main_security_ctx.host_or_ip,
passwd_len ? ER(ER_YES) : ER(ER_NO));
/*
log access denied messages to the error log when log-warnings = 2
Log access denied messages to the error log when log-warnings = 2
so that the overhead of the general query log is not required to track
failed connections
failed connections.
*/
if (global_system_variables.log_warnings > 1)
{
......@@ -666,9 +667,9 @@ static int check_connection(THD *thd)
if (!thd->main_security_ctx.host) // If TCP/IP connection
{
char ip[30];
char ip[NI_MAXHOST];
if (vio_peer_addr(net->vio, ip, &thd->peer_port))
if (vio_peer_addr(net->vio, ip, &thd->peer_port, NI_MAXHOST))
{
my_error(ER_BAD_HOST_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
return 1;
......@@ -676,12 +677,15 @@ static int check_connection(THD *thd)
if (!(thd->main_security_ctx.ip= my_strdup(ip,MYF(MY_WME))))
return 1; /* The error is set by my_strdup(). */
thd->main_security_ctx.host_or_ip= thd->main_security_ctx.ip;
vio_in_addr(net->vio,&thd->remote.sin_addr);
if (!(specialflag & SPECIAL_NO_RESOLVE))
{
vio_in_addr(net->vio,&thd->remote.sin_addr);
thd->main_security_ctx.host=
ip_to_hostname(&thd->remote.sin_addr, &connect_errors);
if (ip_to_hostname(&net->vio->remote, thd->main_security_ctx.ip,
&thd->main_security_ctx.host, &connect_errors))
{
my_error(ER_BAD_HOST_ERROR, MYF(0), ip);
return 1;
}
/* Cut very long hostnames to avoid possible overflows */
if (thd->main_security_ctx.host)
{
......@@ -714,7 +718,7 @@ static int check_connection(THD *thd)
thd->main_security_ctx.host_or_ip= thd->main_security_ctx.host;
thd->main_security_ctx.ip= 0;
/* Reset sin_addr */
bzero((char*) &thd->remote, sizeof(thd->remote));
bzero((char*) &net->vio->remote, sizeof(net->vio->remote));
}
vio_keepalive(net->vio, TRUE);
......@@ -769,7 +773,8 @@ static int check_connection(THD *thd)
(pkt_len= my_net_read(net)) == packet_error ||
pkt_len < MIN_HANDSHAKE_SIZE)
{
inc_host_errors(&thd->remote.sin_addr);
inc_host_errors(thd->main_security_ctx.ip);
my_error(ER_HANDSHAKE_ERROR, MYF(0),
thd->main_security_ctx.host_or_ip);
return 1;
......@@ -779,7 +784,7 @@ static int check_connection(THD *thd)
#include "_cust_sql_parse.h"
#endif
if (connect_errors)
reset_host_errors(&thd->remote.sin_addr);
reset_host_errors(thd->main_security_ctx.ip);
if (thd->packet.alloc(thd->variables.net_buffer_length))
return 1; /* The error is set by alloc(). */
......@@ -813,7 +818,7 @@ static int check_connection(THD *thd)
/* Do the SSL layering. */
if (!ssl_acceptor_fd)
{
inc_host_errors(&thd->remote.sin_addr);
inc_host_errors(thd->main_security_ctx.ip);
my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
return 1;
}
......@@ -821,7 +826,8 @@ static int check_connection(THD *thd)
if (sslaccept(ssl_acceptor_fd, net->vio, net->read_timeout))
{
DBUG_PRINT("error", ("Failed to accept new SSL connection"));
inc_host_errors(&thd->remote.sin_addr);
inc_host_errors(thd->main_security_ctx.ip);
my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
return 1;
}
......@@ -831,7 +837,8 @@ static int check_connection(THD *thd)
{
DBUG_PRINT("error", ("Failed to read user information (pkt_len= %lu)",
pkt_len));
inc_host_errors(&thd->remote.sin_addr);
inc_host_errors(thd->main_security_ctx.ip);
my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
return 1;
}
......@@ -840,7 +847,8 @@ static int check_connection(THD *thd)
if (end >= (char*) net->read_pos+ pkt_len +2)
{
inc_host_errors(&thd->remote.sin_addr);
inc_host_errors(thd->main_security_ctx.ip);
my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
return 1;
}
......@@ -878,7 +886,8 @@ static int check_connection(THD *thd)
if (passwd + passwd_len + db_len > (char *)net->read_pos + pkt_len)
{
inc_host_errors(&thd->remote.sin_addr);
inc_host_errors(thd->main_security_ctx.ip);
my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
return 1;
}
......
......@@ -78,7 +78,6 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->was_interrupted=vio_was_interrupted;
vio->vioclose =vio_close_pipe;
vio->peer_addr =vio_peer_addr;
vio->in_addr =vio_in_addr;
vio->vioblocking =vio_blocking;
vio->is_blocking =vio_is_blocking;
......@@ -108,7 +107,6 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->was_interrupted=vio_was_interrupted;
vio->vioclose =vio_close_shared_memory;
vio->peer_addr =vio_peer_addr;
vio->in_addr =vio_in_addr;
vio->vioblocking =vio_blocking;
vio->is_blocking =vio_is_blocking;
......@@ -136,7 +134,6 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->was_interrupted=vio_was_interrupted;
vio->vioclose =vio_ssl_close;
vio->peer_addr =vio_peer_addr;
vio->in_addr =vio_in_addr;
vio->vioblocking =vio_ssl_blocking;
vio->is_blocking =vio_is_blocking;
vio->timeout =vio_timeout;
......@@ -156,7 +153,6 @@ static void vio_init(Vio* vio, enum enum_vio_type type,
vio->was_interrupted=vio_was_interrupted;
vio->vioclose =vio_close;
vio->peer_addr =vio_peer_addr;
vio->in_addr =vio_in_addr;
vio->vioblocking =vio_blocking;
vio->is_blocking =vio_is_blocking;
vio->timeout =vio_timeout;
......
......@@ -25,6 +25,11 @@
#include <m_string.h>
#include <violite.h>
#ifndef __WIN__
#include <sys/socket.h>
#include <netdb.h>
#endif
#ifdef _WIN32
void vio_win32_timeout(Vio *vio, uint which, uint timeout);
#endif
......
......@@ -300,53 +300,209 @@ my_socket vio_fd(Vio* vio)
return vio->sd;
}
/**
Convert a sock-address (AF_INET or AF_INET6) into the "normalized" form,
which is the IPv4 form for IPv4-mapped or IPv4-compatible IPv6 addresses.
@note Background: when IPv4 and IPv6 are used simultaneously, IPv4
addresses may be written in a form of IPv4-mapped or IPv4-compatible IPv6
addresses. That means, one address (a.b.c.d) can be written in three forms:
- IPv4: a.b.c.d;
- IPv4-compatible IPv6: ::a.b.c.d;
- IPv4-mapped IPv4: ::ffff:a.b.c.d;
Having three forms of one address makes it a little difficult to compare
addresses with each other (the IPv4-compatible IPv6-address of foo.bar
will be different from the IPv4-mapped IPv6-address of foo.bar).
@note This function can be made public when it's needed.
@param src [in] source IP address (AF_INET or AF_INET6).
@param src_length [in] length of the src.
@param dst [out] a buffer to store normalized IP address
(sockaddr_storage).
@param dst_length [out] actual length of the normalized IP address.
*/
static void vio_get_normalized_ip(const struct sockaddr *src,
int src_length,
struct sockaddr *dst,
int *dst_length)
{
switch (src->sa_family) {
case AF_INET:
memcpy(dst, src, src_length);
*dst_length= src_length;
break;
#ifdef HAVE_IPV6
case AF_INET6:
{
const struct sockaddr_in6 *src_addr6= (const struct sockaddr_in6 *) src;
const struct in6_addr *src_ip6= &(src_addr6->sin6_addr);
const uint32 *src_ip6_int32= (uint32 *) src_ip6->s6_addr;
if (IN6_IS_ADDR_V4MAPPED(src_ip6) || IN6_IS_ADDR_V4COMPAT(src_ip6))
{
struct sockaddr_in *dst_ip4= (struct sockaddr_in *) dst;
/*
This is an IPv4-mapped or IPv4-compatible IPv6 address. It should
be converted to the IPv4 form.
*/
*dst_length= sizeof (struct sockaddr_in);
my_bool vio_peer_addr(Vio * vio, char *buf, uint16 *port)
memset(dst_ip4, 0, *dst_length);
dst_ip4->sin_family= AF_INET;
dst_ip4->sin_port= src_addr6->sin6_port;
/*
In an IPv4 mapped or compatible address, the last 32 bits represent
the IPv4 address. The byte orders for IPv6 and IPv4 addresses are
the same, so a simple copy is possible.
*/
dst_ip4->sin_addr.s_addr= src_ip6_int32[3];
}
else
{
/* This is a "native" IPv6 address. */
memcpy(dst, src, src_length);
*dst_length= src_length;
}
break;
}
#endif /* HAVE_IPV6 */
}
}
/**
Return the normalized IP address string for a sock-address.
The idea is to return an IPv4-address for an IPv4-mapped and
IPv4-compatible IPv6 address.
The function writes the normalized IP address to the given buffer.
The buffer should have enough space, otherwise error flag is returned.
The system constant INET6_ADDRSTRLEN can be used to reserve buffers of
the right size.
@param addr [in] sockaddr object (AF_INET or AF_INET6).
@param addr_length [in] length of the addr.
@param ip_string [out] buffer to write normalized IP address.
@param ip_string_size [in] size of the ip_string.
@return Error status.
@retval TRUE in case of error (the ip_string buffer is not enough).
@retval FALSE on success.
*/
my_bool vio_get_normalized_ip_string(const struct sockaddr *addr,
int addr_length,
char *ip_string,
size_t ip_string_size)
{
struct sockaddr_storage norm_addr_storage;
struct sockaddr *norm_addr= (struct sockaddr *) &norm_addr_storage;
int norm_addr_length;
int err_code;
vio_get_normalized_ip(addr, addr_length, norm_addr, &norm_addr_length);
err_code= vio_getnameinfo(norm_addr, ip_string, ip_string_size, NULL, 0,
NI_NUMERICHOST);
if (!err_code)
return FALSE;
DBUG_PRINT("error", ("getnameinfo() failed with %d (%s).",
(int) err_code,
(const char *) gai_strerror(err_code)));
return TRUE;
}
/**
Return IP address and port of a VIO client socket.
The function returns an IPv4 address if IPv6 support is disabled.
The function returns an IPv4 address if the client socket is associated
with an IPv4-compatible or IPv4-mapped IPv6 address. Otherwise, the native
IPv6 address is returned.
*/
my_bool vio_peer_addr(Vio *vio, char *ip_buffer, uint16 *port,
size_t ip_buffer_size)
{
DBUG_ENTER("vio_peer_addr");
DBUG_PRINT("enter", ("sd: %d", vio->sd));
DBUG_PRINT("enter", ("Client socked fd: %d", (int) vio->sd));
if (vio->localhost)
{
strmov(buf,"127.0.0.1");
/*
Initialize vio->remote and vio->addLen. Set vio->remote to IPv4 loopback
address.
*/
struct in_addr *ip4= &((struct sockaddr_in *) &(vio->remote))->sin_addr;
vio->remote.ss_family= AF_INET;
vio->addrLen= sizeof (struct sockaddr_in);
ip4->s_addr= htonl(INADDR_LOOPBACK);
/* Initialize ip_buffer and port. */
strmov(ip_buffer, "127.0.0.1");
*port= 0;
}
else
{
size_socket addrLen = sizeof(vio->remote);
if (getpeername(vio->sd, (struct sockaddr *) (&vio->remote),
&addrLen) != 0)
int err_code;
char port_buffer[NI_MAXSERV];
struct sockaddr_storage addr_storage;
struct sockaddr *addr= (struct sockaddr *) &addr_storage;
size_socket addr_length= sizeof (addr_storage);
/* Get sockaddr by socked fd. */
err_code= getpeername(vio->sd, addr, &addr_length);
if (err_code)
{
DBUG_PRINT("exit", ("getpeername gave error: %d", socket_errno));
DBUG_RETURN(1);
DBUG_PRINT("exit", ("getpeername() gave error: %d", socket_errno));
DBUG_RETURN(TRUE);
}
my_inet_ntoa(vio->remote.sin_addr,buf);
*port= ntohs(vio->remote.sin_port);
}
DBUG_PRINT("exit", ("addr: %s", buf));
DBUG_RETURN(0);
}
/* Normalize IP address. */
/*
Get in_addr for a TCP/IP connection
vio_get_normalized_ip(addr, addr_length,
(struct sockaddr *) &vio->remote, &vio->addrLen);
SYNOPSIS
vio_in_addr()
vio vio handle
in put in_addr here
/* Get IP address & port number. */
NOTES
one must call vio_peer_addr() before calling this one
*/
err_code= vio_getnameinfo((struct sockaddr *) &vio->remote,
ip_buffer, ip_buffer_size,
port_buffer, NI_MAXSERV,
NI_NUMERICHOST | NI_NUMERICSERV);
void vio_in_addr(Vio *vio, struct in_addr *in)
{
DBUG_ENTER("vio_in_addr");
if (vio->localhost)
bzero((char*) in, sizeof(*in));
else
*in=vio->remote.sin_addr;
DBUG_VOID_RETURN;
if (err_code)
{
DBUG_PRINT("exit", ("getnameinfo() gave error: %s",
gai_strerror(err_code)));
DBUG_RETURN(TRUE);
}
*port= (uint16) strtol(port_buffer, NULL, 10);
}
DBUG_PRINT("exit", ("Client IP address: %s; port: %d",
(const char *) ip_buffer,
(int) *port));
DBUG_RETURN(FALSE);
}
......@@ -377,7 +533,8 @@ static my_bool socket_poll_read(my_socket sd, uint timeout)
FD_ZERO(&errorfds);
FD_SET(fd, &readfds);
FD_SET(fd, &errorfds);
if ((res= select(fd, &readfds, NULL, &errorfds, &tm) <= 0))
/* The first argument is ignored on Windows, so a conversion to int is OK */
if ((res= select((int) fd, &readfds, NULL, &errorfds, &tm) <= 0))
{
DBUG_RETURN(res < 0 ? 0 : 1);
}
......@@ -879,3 +1036,36 @@ ssize_t vio_pending(Vio *vio)
return 0;
}
/**
This is a wrapper for the system getnameinfo(), because different OS
differ in the getnameinfo() implementation. For instance, Solaris 10
requires that the 2nd argument (salen) must match the actual size of the
struct sockaddr_storage passed to it.
*/
int vio_getnameinfo(const struct sockaddr *sa,
char *hostname, size_t hostname_size,
char *port, size_t port_size,
int flags)
{
int sa_length= 0;
switch (sa->sa_family) {
case AF_INET:
sa_length= sizeof (struct sockaddr_in);
break;
#ifdef HAVE_IPV6
case AF_INET6:
sa_length= sizeof (struct sockaddr_in6);
break;
#endif /* HAVE_IPV6 */
}
return getnameinfo(sa, sa_length,
hostname, hostname_size,
port, port_size,
flags);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment