Commit 5ba196c4 authored by Alexander Barkov's avatar Alexander Barkov Committed by Sergei Golubchik

More test for MDEV-10134 Add full support for DEFAULT

INET4/INET6 functions
parent 6cb4731f
...@@ -1433,3 +1433,39 @@ release_lock('test') ...@@ -1433,3 +1433,39 @@ release_lock('test')
# -- Done. # -- 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
#
...@@ -1081,3 +1081,37 @@ select release_lock('test'); ...@@ -1081,3 +1081,37 @@ select release_lock('test');
--echo --echo
--echo # -- Done. --echo # -- Done.
--echo --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 #
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