summaryrefslogtreecommitdiff
path: root/plugin/type_inet/mysql-test/type_inet/type_inet6_csv.test
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/type_inet/mysql-test/type_inet/type_inet6_csv.test')
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6_csv.test51
1 files changed, 51 insertions, 0 deletions
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_csv.test b/plugin/type_inet/mysql-test/type_inet/type_inet6_csv.test
new file mode 100644
index 00000000000..65761cf0af7
--- /dev/null
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_csv.test
@@ -0,0 +1,51 @@
+--source include/have_csv.inc
+
+--echo #
+--echo # Start of 10.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-274 The data type for IPv6/IPv4 addresses in MariaDB
+--echo #
+
+SET default_storage_engine=CSV;
+
+CREATE TABLE t1 (a INET6 NOT NULL);
+SHOW CREATE TABLE t1;
+
+DELIMITER $$;
+FOR i IN 0..255
+DO
+ INSERT INTO t1 VALUES (CONCAT('::', HEX(i)));
+END FOR
+$$
+DELIMITER ;$$
+
+SELECT * FROM t1 WHERE a='::ff';
+
+SELECT * FROM t1 WHERE a>='::fe' ORDER BY a;
+
+SELECT * FROM t1 WHERE a IN ('::80','::a0','::f0') ORDER BY a;
+
+SELECT * FROM t1 WHERE a BETWEEN '::80' AND '::81' ORDER BY a;
+
+SELECT * FROM t1 WHERE a=CAST('::ff' AS INET6);
+
+UPDATE t1 SET a=CONCAT('ffff', a) WHERE a LIKE '::a%';
+SELECT * FROM t1 WHERE a LIKE 'ffff::%' ORDER BY a;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-20790 CSV table with INET6 can be created and inserted into, but cannot be read from
+--echo #
+
+CREATE TABLE t1 (a INET6 NOT NULL) ENGINE=CSV;
+INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329');
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.5 tests
+--echo #