1eval SET @nip= inet_aton('$IPv6'); 2CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int); 3INSERT INTO t1 VALUES (@nip,@nip,@nip,@nip,@nip,@nip); 4SELECT inet_ntoa(c1) FROM t1; 5SELECT inet_ntoa(CAST(c1 AS UNSIGNED)) FROM t1; 6SELECT inet_ntoa(c2) FROM t1; 7SELECT inet_ntoa(CAST(c2 AS UNSIGNED)) FROM t1; 8SELECT inet_ntoa(c3) FROM t1; 9SELECT inet_ntoa(CAST(c3 AS UNSIGNED)) FROM t1; 10SELECT inet_ntoa(c4) FROM t1; 11SELECT inet_ntoa(CAST(c4 AS UNSIGNED)) FROM t1; 12SELECT inet_ntoa(c5) FROM t1; 13SELECT inet_ntoa(CAST(c5 AS UNSIGNED)) FROM t1; 14SELECT inet_ntoa(c6) FROM t1; 15DROP TABLE IF EXISTS t1; 16SELECT @nip; 17SELECT inet_ntoa(@nip); 18 19eval SET @nip6= inet6_aton('$IPv6'); 20CREATE TABLE t1 (c1 varbinary(16), c2 varchar(16), c3 binary(16), c4 char(16), c5 long, c6 int); 21INSERT IGNORE INTO t1 VALUES (@nip6,@nip6,@nip6,@nip6,@nip6,@nip6); 22SELECT inet6_ntoa(c1) FROM t1; 23SELECT inet6_ntoa(CAST(c1 AS BINARY(16))) FROM t1; 24SELECT inet6_ntoa(c2) FROM t1; 25SELECT inet6_ntoa(CAST(c2 AS BINARY(16))) FROM t1; 26SELECT inet6_ntoa(c3) FROM t1; 27SELECT inet6_ntoa(CAST(c3 AS BINARY(16))) FROM t1; 28SELECT inet6_ntoa(c4) FROM t1; 29SELECT inet6_ntoa(CAST(c4 AS BINARY(16))) FROM t1; 30SELECT inet6_ntoa(c5) FROM t1; 31SELECT inet6_ntoa(CAST(c5 AS BINARY(16))) FROM t1; 32SELECT inet6_ntoa(c6) FROM t1; 33SELECT inet6_ntoa(CAST(c6 AS BINARY(16))) FROM t1; 34DROP TABLE IF EXISTS t1; 35SELECT inet6_ntoa(@nip6); 36 37