List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:May 3 2011 1:04pm
Subject:bzr commit into mysql-trunk branch (alexander.nozdrin:3360) WL#5787
View as plain text  
#At file:///home/alik/MySQL/bzr/00/wl5787/mysql-trunk-wl5787.2/ based on revid:alexander.nozdrin@stripped

 3360 Alexander Nozdrin	2011-05-03
      MTR tests for QA sign off of wl#5787.

    modified:
      mysql-test/include/ipv6.inc
      mysql-test/r/ipv4_as_ipv6.result
      mysql-test/r/ipv6.result
      mysql-test/t/ipv4_as_ipv6.test
      mysql-test/t/ipv6.test
=== modified file 'mysql-test/include/ipv6.inc'
--- a/mysql-test/include/ipv6.inc	2010-02-08 10:43:56 +0000
+++ b/mysql-test/include/ipv6.inc	2011-05-03 13:04:00 +0000
@@ -1,11 +1,6 @@
 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
 --replace_result ::1 localhost
 SELECT USER();
 --replace_result ::1 localhost

=== modified file 'mysql-test/r/ipv4_as_ipv6.result'
--- a/mysql-test/r/ipv4_as_ipv6.result	2010-10-18 16:20:26 +0000
+++ b/mysql-test/r/ipv4_as_ipv6.result	2011-05-03 13:04:00 +0000
@@ -6,13 +6,6 @@ SHOW GRANTS FOR testuser@'127.0.0.1';
 Grants for testuser@stripped
 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
@@ -27,6 +20,98 @@ SELECT USER();
 USER()
 root@localhost
 DROP USER testuser1@'127.0.0.1';
+SET @nip= inet_aton('127.0.0.1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip);
+SELECT inet_ntoa(c1) FROM t1;
+inet_ntoa(c1)
+127.0.0.1
+SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c1 AS UNSIGNED))
+127.0.0.1
+SELECT inet_ntoa(c2) FROM t1;
+inet_ntoa(c2)
+127.0.0.1
+SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c2 AS UNSIGNED))
+127.0.0.1
+SELECT inet_ntoa(c3) FROM t1;
+inet_ntoa(c3)
+127.0.0.1
+Warnings:
+Warning	1292	Truncated incorrect INTEGER value: '2130706433\x00\x00\x00\x00\x00\x00'
+SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c3 AS UNSIGNED))
+127.0.0.1
+Warnings:
+Warning	1292	Truncated incorrect INTEGER value: '2130706433\x00\x00\x00\x00\x00\x00'
+SELECT inet_ntoa(c4) FROM t1;
+inet_ntoa(c4)
+127.0.0.1
+SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c4 AS UNSIGNED))
+127.0.0.1
+SELECT inet_ntoa(c5) FROM t1;
+inet_ntoa(c5)
+127.0.0.1
+SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c5 AS UNSIGNED))
+127.0.0.1
+SELECT inet_ntoa(c6) FROM t1;
+inet_ntoa(c6)
+127.0.0.1
+DROP TABLE IF EXISTS t1;
+SELECT @nip;
+@nip
+2130706433
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+127.0.0.1
+SET @nip6= inet6_aton('127.0.0.1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6);
+Warnings:
+Warning	1366	Incorrect integer value: '\x7F\x00\x00\x01' for column 'c6' at row 1
+SELECT inet6_ntoa(c1) FROM t1;
+inet6_ntoa(c1)
+127.0.0.1
+SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c1 AS BINARY(16)))
+7f00:1::
+SELECT inet6_ntoa(c2) FROM t1;
+inet6_ntoa(c2)
+NULL
+SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c2 AS BINARY(16)))
+7f00:1::
+SELECT inet6_ntoa(c3) FROM t1;
+inet6_ntoa(c3)
+7f00:1::
+SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c3 AS BINARY(16)))
+7f00:1::
+SELECT inet6_ntoa(c4) FROM t1;
+inet6_ntoa(c4)
+NULL
+SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c4 AS BINARY(16)))
+7f00:1::
+SELECT inet6_ntoa(c5) FROM t1;
+inet6_ntoa(c5)
+NULL
+SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c5 AS BINARY(16)))
+7f00:1::
+SELECT inet6_ntoa(c6) FROM t1;
+inet6_ntoa(c6)
+NULL
+SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c6 AS BINARY(16)))
+3000::
+DROP TABLE IF EXISTS t1;
+SELECT inet6_ntoa(@nip6);
+inet6_ntoa(@nip6)
+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';
@@ -35,13 +120,6 @@ SHOW GRANTS FOR testuser@'0:0:0:0:0:FFFF
 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
@@ -56,6 +134,94 @@ SELECT USER();
 USER()
 root@localhost
 DROP USER testuser1@'0:0:0:0:0:FFFF:127.0.0.1';
+SET @nip= inet_aton('0:0:0:0:0:FFFF:127.0.0.1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip);
+SELECT inet_ntoa(c1) FROM t1;
+inet_ntoa(c1)
+NULL
+SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c1 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c2) FROM t1;
+inet_ntoa(c2)
+NULL
+SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c2 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c3) FROM t1;
+inet_ntoa(c3)
+NULL
+SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c3 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c4) FROM t1;
+inet_ntoa(c4)
+NULL
+SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c4 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c5) FROM t1;
+inet_ntoa(c5)
+NULL
+SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c5 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c6) FROM t1;
+inet_ntoa(c6)
+NULL
+DROP TABLE IF EXISTS t1;
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SET @nip6= inet6_aton('0:0:0:0:0:FFFF:127.0.0.1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6);
+Warnings:
+Warning	1366	Incorrect integer value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\x7F\x00\x00\x01' for column 'c6' at row 1
+SELECT inet6_ntoa(c1) FROM t1;
+inet6_ntoa(c1)
+::ffff:127.0.0.1
+SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c1 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c2) FROM t1;
+inet6_ntoa(c2)
+NULL
+SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c2 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c3) FROM t1;
+inet6_ntoa(c3)
+::ffff:127.0.0.1
+SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c3 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c4) FROM t1;
+inet6_ntoa(c4)
+NULL
+SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c4 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c5) FROM t1;
+inet6_ntoa(c5)
+NULL
+SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c5 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c6) FROM t1;
+inet6_ntoa(c6)
+NULL
+SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c6 AS BINARY(16)))
+3000::
+DROP TABLE IF EXISTS t1;
+SELECT inet6_ntoa(@nip6);
+inet6_ntoa(@nip6)
+::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';
@@ -64,13 +230,6 @@ SHOW GRANTS FOR testuser@'0000:0000:0000
 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
@@ -85,6 +244,94 @@ SELECT USER();
 USER()
 root@localhost
 DROP USER testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
+SET @nip= inet_aton('0000:0000:0000:0000:0000:FFFF:127.0.0.1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip);
+SELECT inet_ntoa(c1) FROM t1;
+inet_ntoa(c1)
+NULL
+SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c1 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c2) FROM t1;
+inet_ntoa(c2)
+NULL
+SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c2 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c3) FROM t1;
+inet_ntoa(c3)
+NULL
+SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c3 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c4) FROM t1;
+inet_ntoa(c4)
+NULL
+SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c4 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c5) FROM t1;
+inet_ntoa(c5)
+NULL
+SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c5 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c6) FROM t1;
+inet_ntoa(c6)
+NULL
+DROP TABLE IF EXISTS t1;
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SET @nip6= inet6_aton('0000:0000:0000:0000:0000:FFFF:127.0.0.1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6);
+Warnings:
+Warning	1366	Incorrect integer value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\x7F\x00\x00\x01' for column 'c6' at row 1
+SELECT inet6_ntoa(c1) FROM t1;
+inet6_ntoa(c1)
+::ffff:127.0.0.1
+SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c1 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c2) FROM t1;
+inet6_ntoa(c2)
+NULL
+SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c2 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c3) FROM t1;
+inet6_ntoa(c3)
+::ffff:127.0.0.1
+SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c3 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c4) FROM t1;
+inet6_ntoa(c4)
+NULL
+SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c4 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c5) FROM t1;
+inet6_ntoa(c5)
+NULL
+SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c5 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c6) FROM t1;
+inet6_ntoa(c6)
+NULL
+SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c6 AS BINARY(16)))
+3000::
+DROP TABLE IF EXISTS t1;
+SELECT inet6_ntoa(@nip6);
+inet6_ntoa(@nip6)
+::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';
@@ -93,13 +340,6 @@ SHOW GRANTS FOR testuser@'0:0000:0000:0:
 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
@@ -114,6 +354,94 @@ SELECT USER();
 USER()
 root@localhost
 DROP USER testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1';
+SET @nip= inet_aton('0:0000:0000:0:0000:FFFF:127.0.0.1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip);
+SELECT inet_ntoa(c1) FROM t1;
+inet_ntoa(c1)
+NULL
+SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c1 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c2) FROM t1;
+inet_ntoa(c2)
+NULL
+SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c2 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c3) FROM t1;
+inet_ntoa(c3)
+NULL
+SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c3 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c4) FROM t1;
+inet_ntoa(c4)
+NULL
+SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c4 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c5) FROM t1;
+inet_ntoa(c5)
+NULL
+SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c5 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c6) FROM t1;
+inet_ntoa(c6)
+NULL
+DROP TABLE IF EXISTS t1;
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SET @nip6= inet6_aton('0:0000:0000:0:0000:FFFF:127.0.0.1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6);
+Warnings:
+Warning	1366	Incorrect integer value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\x7F\x00\x00\x01' for column 'c6' at row 1
+SELECT inet6_ntoa(c1) FROM t1;
+inet6_ntoa(c1)
+::ffff:127.0.0.1
+SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c1 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c2) FROM t1;
+inet6_ntoa(c2)
+NULL
+SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c2 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c3) FROM t1;
+inet6_ntoa(c3)
+::ffff:127.0.0.1
+SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c3 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c4) FROM t1;
+inet6_ntoa(c4)
+NULL
+SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c4 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c5) FROM t1;
+inet6_ntoa(c5)
+NULL
+SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c5 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c6) FROM t1;
+inet6_ntoa(c6)
+NULL
+SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c6 AS BINARY(16)))
+3000::
+DROP TABLE IF EXISTS t1;
+SELECT inet6_ntoa(@nip6);
+inet6_ntoa(@nip6)
+::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';
@@ -122,13 +450,6 @@ SHOW GRANTS FOR testuser@'0::0000:FFFF: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
@@ -143,7 +464,181 @@ SELECT USER();
 USER()
 root@localhost
 DROP USER testuser1@'0::0000:FFFF:127.0.0.1';
+SET @nip= inet_aton('0::0000:FFFF:127.0.0.1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip);
+SELECT inet_ntoa(c1) FROM t1;
+inet_ntoa(c1)
+NULL
+SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c1 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c2) FROM t1;
+inet_ntoa(c2)
+NULL
+SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c2 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c3) FROM t1;
+inet_ntoa(c3)
+NULL
+SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c3 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c4) FROM t1;
+inet_ntoa(c4)
+NULL
+SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c4 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c5) FROM t1;
+inet_ntoa(c5)
+NULL
+SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c5 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c6) FROM t1;
+inet_ntoa(c6)
+NULL
+DROP TABLE IF EXISTS t1;
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SET @nip6= inet6_aton('0::0000:FFFF:127.0.0.1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6);
+Warnings:
+Warning	1366	Incorrect integer value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\x7F\x00\x00\x01' for column 'c6' at row 1
+SELECT inet6_ntoa(c1) FROM t1;
+inet6_ntoa(c1)
+::ffff:127.0.0.1
+SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c1 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c2) FROM t1;
+inet6_ntoa(c2)
+NULL
+SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c2 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c3) FROM t1;
+inet6_ntoa(c3)
+::ffff:127.0.0.1
+SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c3 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c4) FROM t1;
+inet6_ntoa(c4)
+NULL
+SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c4 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c5) FROM t1;
+inet6_ntoa(c5)
+NULL
+SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c5 AS BINARY(16)))
+::ffff:127.0.0.1
+SELECT inet6_ntoa(c6) FROM t1;
+inet6_ntoa(c6)
+NULL
+SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c6 AS BINARY(16)))
+3000::
+DROP TABLE IF EXISTS t1;
+SELECT inet6_ntoa(@nip6);
+inet6_ntoa(@nip6)
+::ffff:127.0.0.1
 =============Test of '0:0:0:0:0:FFFF:127.0.0.1/96' ================
+SET @nip= inet_aton('0:0:0:0:0:FFFF:127.0.0.1/96');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip);
+SELECT inet_ntoa(c1) FROM t1;
+inet_ntoa(c1)
+NULL
+SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c1 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c2) FROM t1;
+inet_ntoa(c2)
+NULL
+SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c2 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c3) FROM t1;
+inet_ntoa(c3)
+NULL
+SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c3 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c4) FROM t1;
+inet_ntoa(c4)
+NULL
+SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c4 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c5) FROM t1;
+inet_ntoa(c5)
+NULL
+SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c5 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c6) FROM t1;
+inet_ntoa(c6)
+NULL
+DROP TABLE IF EXISTS t1;
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SET @nip6= inet6_aton('0:0:0:0:0:FFFF:127.0.0.1/96');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6);
+SELECT inet6_ntoa(c1) FROM t1;
+inet6_ntoa(c1)
+NULL
+SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c1 AS BINARY(16)))
+NULL
+SELECT inet6_ntoa(c2) FROM t1;
+inet6_ntoa(c2)
+NULL
+SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c2 AS BINARY(16)))
+NULL
+SELECT inet6_ntoa(c3) FROM t1;
+inet6_ntoa(c3)
+NULL
+SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c3 AS BINARY(16)))
+NULL
+SELECT inet6_ntoa(c4) FROM t1;
+inet6_ntoa(c4)
+NULL
+SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c4 AS BINARY(16)))
+NULL
+SELECT inet6_ntoa(c5) FROM t1;
+inet6_ntoa(c5)
+NULL
+SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c5 AS BINARY(16)))
+NULL
+SELECT inet6_ntoa(c6) FROM t1;
+inet6_ntoa(c6)
+NULL
+SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c6 AS BINARY(16)))
+NULL
+DROP TABLE IF EXISTS t1;
+SELECT inet6_ntoa(@nip6);
+inet6_ntoa(@nip6)
+NULL
 =============Test of '::FFFF:127.0.0.1' ===========================
 mysqld is alive
 CREATE USER testuser@'::FFFF:127.0.0.1' identified by '1234';
@@ -152,13 +647,6 @@ SHOW GRANTS FOR testuser@'::FFFF:127.0.0
 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
@@ -174,6 +662,92 @@ USER()
 root@localhost
 DROP USER testuser1@'::FFFF:127.0.0.1';
 =============Test of '::FFFF:127.0.0.1/96' ========================
+SET @nip= inet_aton('::FFFF:127.0.0.1/96');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip);
+SELECT inet_ntoa(c1) FROM t1;
+inet_ntoa(c1)
+NULL
+SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c1 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c2) FROM t1;
+inet_ntoa(c2)
+NULL
+SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c2 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c3) FROM t1;
+inet_ntoa(c3)
+NULL
+SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c3 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c4) FROM t1;
+inet_ntoa(c4)
+NULL
+SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c4 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c5) FROM t1;
+inet_ntoa(c5)
+NULL
+SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c5 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c6) FROM t1;
+inet_ntoa(c6)
+NULL
+DROP TABLE IF EXISTS t1;
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SET @nip6= inet6_aton('::FFFF:127.0.0.1/96');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6);
+SELECT inet6_ntoa(c1) FROM t1;
+inet6_ntoa(c1)
+NULL
+SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c1 AS BINARY(16)))
+NULL
+SELECT inet6_ntoa(c2) FROM t1;
+inet6_ntoa(c2)
+NULL
+SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c2 AS BINARY(16)))
+NULL
+SELECT inet6_ntoa(c3) FROM t1;
+inet6_ntoa(c3)
+NULL
+SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c3 AS BINARY(16)))
+NULL
+SELECT inet6_ntoa(c4) FROM t1;
+inet6_ntoa(c4)
+NULL
+SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c4 AS BINARY(16)))
+NULL
+SELECT inet6_ntoa(c5) FROM t1;
+inet6_ntoa(c5)
+NULL
+SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c5 AS BINARY(16)))
+NULL
+SELECT inet6_ntoa(c6) FROM t1;
+inet6_ntoa(c6)
+NULL
+SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c6 AS BINARY(16)))
+NULL
+DROP TABLE IF EXISTS t1;
+SELECT inet6_ntoa(@nip6);
+inet6_ntoa(@nip6)
+NULL
 =============Test of '::1' ========================
 connect (con1, ::1, root, , test, MASTER_MYPORT,);
 Got one of the listed errors

=== modified file 'mysql-test/r/ipv6.result'
--- a/mysql-test/r/ipv6.result	2010-01-29 10:48:11 +0000
+++ b/mysql-test/r/ipv6.result	2011-05-03 13:04:00 +0000
@@ -6,13 +6,6 @@ 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
@@ -27,6 +20,94 @@ SELECT USER();
 USER()
 root@localhost
 DROP USER testuser1@'::1';
+SET @nip= inet_aton('::1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip);
+SELECT inet_ntoa(c1) FROM t1;
+inet_ntoa(c1)
+NULL
+SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c1 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c2) FROM t1;
+inet_ntoa(c2)
+NULL
+SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c2 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c3) FROM t1;
+inet_ntoa(c3)
+NULL
+SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c3 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c4) FROM t1;
+inet_ntoa(c4)
+NULL
+SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c4 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c5) FROM t1;
+inet_ntoa(c5)
+NULL
+SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c5 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c6) FROM t1;
+inet_ntoa(c6)
+NULL
+DROP TABLE IF EXISTS t1;
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SET @nip6= inet6_aton('::1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6);
+Warnings:
+Warning	1366	Incorrect integer value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01' for column 'c6' at row 1
+SELECT inet6_ntoa(c1) FROM t1;
+inet6_ntoa(c1)
+::1
+SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c1 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c2) FROM t1;
+inet6_ntoa(c2)
+NULL
+SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c2 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c3) FROM t1;
+inet6_ntoa(c3)
+::1
+SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c3 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c4) FROM t1;
+inet6_ntoa(c4)
+NULL
+SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c4 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c5) FROM t1;
+inet6_ntoa(c5)
+NULL
+SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c5 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c6) FROM t1;
+inet6_ntoa(c6)
+NULL
+SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c6 AS BINARY(16)))
+3000::
+DROP TABLE IF EXISTS t1;
+SELECT inet6_ntoa(@nip6);
+inet6_ntoa(@nip6)
+::1
 =============Test of '::1/128' ====================================
 =============Test of '0000:0000:0000:0000:0000:0000:0000:0001' ====
 mysqld is alive
@@ -36,13 +117,6 @@ SHOW GRANTS FOR testuser@'0000:0000:0000
 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
@@ -57,6 +131,94 @@ SELECT USER();
 USER()
 root@localhost
 DROP USER testuser1@'0000:0000:0000:0000:0000:0000:0000:0001';
+SET @nip= inet_aton('0000:0000:0000:0000:0000:0000:0000:0001');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip);
+SELECT inet_ntoa(c1) FROM t1;
+inet_ntoa(c1)
+NULL
+SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c1 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c2) FROM t1;
+inet_ntoa(c2)
+NULL
+SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c2 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c3) FROM t1;
+inet_ntoa(c3)
+NULL
+SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c3 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c4) FROM t1;
+inet_ntoa(c4)
+NULL
+SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c4 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c5) FROM t1;
+inet_ntoa(c5)
+NULL
+SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c5 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c6) FROM t1;
+inet_ntoa(c6)
+NULL
+DROP TABLE IF EXISTS t1;
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SET @nip6= inet6_aton('0000:0000:0000:0000:0000:0000:0000:0001');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6);
+Warnings:
+Warning	1366	Incorrect integer value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01' for column 'c6' at row 1
+SELECT inet6_ntoa(c1) FROM t1;
+inet6_ntoa(c1)
+::1
+SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c1 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c2) FROM t1;
+inet6_ntoa(c2)
+NULL
+SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c2 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c3) FROM t1;
+inet6_ntoa(c3)
+::1
+SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c3 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c4) FROM t1;
+inet6_ntoa(c4)
+NULL
+SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c4 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c5) FROM t1;
+inet6_ntoa(c5)
+NULL
+SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c5 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c6) FROM t1;
+inet6_ntoa(c6)
+NULL
+SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c6 AS BINARY(16)))
+3000::
+DROP TABLE IF EXISTS t1;
+SELECT inet6_ntoa(@nip6);
+inet6_ntoa(@nip6)
+::1
 =============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';
@@ -65,13 +227,6 @@ SHOW GRANTS FOR testuser@'0:0:0:0:0:0:0:
 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
@@ -86,3 +241,91 @@ SELECT USER();
 USER()
 root@localhost
 DROP USER testuser1@'0:0:0:0:0:0:0:1';
+SET @nip= inet_aton('0:0:0:0:0:0:0:1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip);
+SELECT inet_ntoa(c1) FROM t1;
+inet_ntoa(c1)
+NULL
+SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c1 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c2) FROM t1;
+inet_ntoa(c2)
+NULL
+SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c2 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c3) FROM t1;
+inet_ntoa(c3)
+NULL
+SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c3 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c4) FROM t1;
+inet_ntoa(c4)
+NULL
+SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c4 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c5) FROM t1;
+inet_ntoa(c5)
+NULL
+SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1;
+inet_ntoa(CAST(c5 AS UNSIGNED))
+NULL
+SELECT inet_ntoa(c6) FROM t1;
+inet_ntoa(c6)
+NULL
+DROP TABLE IF EXISTS t1;
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SET @nip6= inet6_aton('0:0:0:0:0:0:0:1');
+CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int);
+INSERT INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6);
+Warnings:
+Warning	1366	Incorrect integer value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01' for column 'c6' at row 1
+SELECT inet6_ntoa(c1) FROM t1;
+inet6_ntoa(c1)
+::1
+SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c1 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c2) FROM t1;
+inet6_ntoa(c2)
+NULL
+SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c2 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c3) FROM t1;
+inet6_ntoa(c3)
+::1
+SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c3 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c4) FROM t1;
+inet6_ntoa(c4)
+NULL
+SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c4 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c5) FROM t1;
+inet6_ntoa(c5)
+NULL
+SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c5 AS BINARY(16)))
+::1
+SELECT inet6_ntoa(c6) FROM t1;
+inet6_ntoa(c6)
+NULL
+SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1;
+inet6_ntoa(CAST(c6 AS BINARY(16)))
+3000::
+DROP TABLE IF EXISTS t1;
+SELECT inet6_ntoa(@nip6);
+inet6_ntoa(@nip6)
+::1

=== modified file 'mysql-test/t/ipv4_as_ipv6.test'
--- a/mysql-test/t/ipv4_as_ipv6.test	2010-01-29 10:48:11 +0000
+++ b/mysql-test/t/ipv4_as_ipv6.test	2011-05-03 13:04:00 +0000
@@ -16,31 +16,37 @@ echo =============Test of '127.0.0.1' (I
 let $IPv6= 127.0.0.1;
 --source include/ipv6_clients.inc
 --source include/ipv6.inc
+--source include/ipv6_func.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
+--source include/ipv6_func.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
+--source include/ipv6_func.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
+--source include/ipv6_func.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
+--source include/ipv6_func.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
+--source include/ipv6_func.inc
 
 echo =============Test of '::FFFF:127.0.0.1' ===========================;
 let $IPv6= ::FFFF:127.0.0.1;
@@ -51,6 +57,7 @@ echo =============Test of '::FFFF:127.0.
 let $IPv6= ::FFFF:127.0.0.1/96;
 #--source include/ipv6_clients.inc
 #--source include/ipv6.inc
+--source include/ipv6_func.inc
 
 echo =============Test of '::1' ========================;
 let $IPv6= ::1;

=== modified file 'mysql-test/t/ipv6.test'
--- a/mysql-test/t/ipv6.test	2010-01-29 10:48:11 +0000
+++ b/mysql-test/t/ipv6.test	2011-05-03 13:04:00 +0000
@@ -16,6 +16,7 @@ echo =============Test of '::1' ========
 let $IPv6= ::1;
 --source include/ipv6_clients.inc
 --source include/ipv6.inc
+--source include/ipv6_func.inc
 
 echo =============Test of '::1/128' ====================================;
 let $IPv6= ::1/128;
@@ -26,11 +27,13 @@ echo =============Test of '0000:0000:000
 let $IPv6= 0000:0000:0000:0000:0000:0000:0000:0001;
 --source include/ipv6_clients.inc
 --source include/ipv6.inc
+--source include/ipv6_func.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
+--source include/ipv6_func.inc
 
 # Wait till all disconnects are completed
 --source include/wait_until_count_sessions.inc


Attachment: [text/bzr-bundle] bzr/alexander.nozdrin@oracle.com-20110503130400-xy365zff0vd1fsu9.bundle
Thread
bzr commit into mysql-trunk branch (alexander.nozdrin:3360) WL#5787Alexander Nozdrin3 May