diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 6590e3ef982..25e9c869793 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -1433,3 +1433,39 @@ release_lock('test') # -- Done. +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 ( +a VARCHAR(30), +b BIGINT DEFAULT INET_ATON(a), +a1 VARCHAR(30) DEFAULT INET_NTOA(b), +c INT DEFAULT IS_IPV4(a), +d INT DEFAULT IS_IPV6(a) +); +INSERT INTO t1 (a) VALUES ('192.168.001.001'),('::1'),('xxx'); +SELECT * FROM t1; +a b a1 c d +192.168.001.001 3232235777 192.168.1.1 1 0 +::1 NULL NULL 0 1 +xxx NULL NULL 0 0 +DROP TABLE t1; +CREATE TABLE t1 ( +str VARCHAR(128), +addr VARBINARY(16) DEFAULT INET6_ATON(str), +str1 VARCHAR(128) DEFAULT INET6_NTOA(addr), +b INT DEFAULT IS_IPV4_COMPAT(addr), +c INT DEFAULT IS_IPV4_MAPPED(addr) +); +INSERT INTO t1 (str) VALUES ('::FFFF:192.168.0.1'),('::10.0.5.9'); +SELECT str, str1, b,c FROM t1; +str str1 b c +::FFFF:192.168.0.1 ::ffff:192.168.0.1 0 1 +::10.0.5.9 ::10.0.5.9 1 0 +DROP TABLE t1; +# +# End of 10.2 tests +# diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 222608c0579..307f57ac954 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -1081,3 +1081,37 @@ select release_lock('test'); --echo --echo # -- Done. --echo + +--echo # +--echo # Start of 10.2 tests +--echo # + +--echo # +--echo # MDEV-10134 Add full support for DEFAULT +--echo # + +CREATE TABLE t1 ( + a VARCHAR(30), + b BIGINT DEFAULT INET_ATON(a), + a1 VARCHAR(30) DEFAULT INET_NTOA(b), + c INT DEFAULT IS_IPV4(a), + d INT DEFAULT IS_IPV6(a) +); +INSERT INTO t1 (a) VALUES ('192.168.001.001'),('::1'),('xxx'); +SELECT * FROM t1; +DROP TABLE t1; + +CREATE TABLE t1 ( + str VARCHAR(128), + addr VARBINARY(16) DEFAULT INET6_ATON(str), + str1 VARCHAR(128) DEFAULT INET6_NTOA(addr), + b INT DEFAULT IS_IPV4_COMPAT(addr), + c INT DEFAULT IS_IPV4_MAPPED(addr) +); +INSERT INTO t1 (str) VALUES ('::FFFF:192.168.0.1'),('::10.0.5.9'); +SELECT str, str1, b,c FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.2 tests +--echo #