mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
More test for MDEV-10134 Add full support for DEFAULT
INET4/INET6 functions
This commit is contained in:
committed by
Sergei Golubchik
parent
6cb4731fdf
commit
5ba196c428
@ -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
|
||||
#
|
||||
|
Reference in New Issue
Block a user