diff options
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/type_inet/mysql-test/type_inet/type_inet6.result | 37 | ||||
-rw-r--r-- | plugin/type_inet/mysql-test/type_inet/type_inet6.test | 24 |
2 files changed, 61 insertions, 0 deletions
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6.result b/plugin/type_inet/mysql-test/type_inet/type_inet6.result index f4de0d8f78c..838a7ee49d3 100644 --- a/plugin/type_inet/mysql-test/type_inet/type_inet6.result +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6.result @@ -2257,3 +2257,40 @@ a m ::10 1 DROP VIEW v1; DROP TABLE t1, t2; +# +# MDEV-22256 Assertion `length == pack_length()' failed in Field_timestamp_with_dec::sort_string +# +SET sql_mode=''; +SET @@SESSION.max_sort_length=4; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '4' +CREATE TEMPORARY TABLE t1(c INET6,d DATE); +INSERT INTO t1 VALUES(0,0); +Warnings: +Warning 4078 Cannot cast 'int' as 'inet6' in assignment of `test`.`t1`.`c` +Warning 1292 Incorrect inet6 value: '0' for column `test`.`t1`.`c` at row 1 +INSERT INTO t1 VALUES('::',0); +SELECT c FROM t1 ORDER BY c; +c +:: +:: +DROP TABLE t1; +SET max_sort_length=DEFAULT; +SET sql_mode=DEFAULT; +CREATE TABLE t1 (a INET6); +INSERT INTO t1 VALUES ('::'),('f::f'); +SET SESSION max_sort_length= 8; +Warnings: +Warning 1292 Truncated incorrect max_sort_length value: '8' +SELECT CASE 1 WHEN 0 THEN 'foo' ELSE a END AS f FROM t1 GROUP BY f WITH ROLLUP; +f +:: +f::f +NULL +SELECT CASE 1 WHEN 0 THEN 'foo' ELSE a END AS f FROM t1 GROUP BY f; +f +:: +f::f +DROP TABLE t1; +SET max_sort_length=DEFAULT; +# End of 10.8 tests diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6.test b/plugin/type_inet/mysql-test/type_inet/type_inet6.test index 0f587a75a7d..857a08e7cd1 100644 --- a/plugin/type_inet/mysql-test/type_inet/type_inet6.test +++ b/plugin/type_inet/mysql-test/type_inet/type_inet6.test @@ -1655,3 +1655,27 @@ SELECT * FROM v1 ORDER BY a; SELECT * FROM t2 ORDER BY a; DROP VIEW v1; DROP TABLE t1, t2; + +--echo # +--echo # MDEV-22256 Assertion `length == pack_length()' failed in Field_timestamp_with_dec::sort_string +--echo # + +SET sql_mode=''; +SET @@SESSION.max_sort_length=4; +CREATE TEMPORARY TABLE t1(c INET6,d DATE); +INSERT INTO t1 VALUES(0,0); +INSERT INTO t1 VALUES('::',0); +SELECT c FROM t1 ORDER BY c; +DROP TABLE t1; +SET max_sort_length=DEFAULT; +SET sql_mode=DEFAULT; + +CREATE TABLE t1 (a INET6); +INSERT INTO t1 VALUES ('::'),('f::f'); +SET SESSION max_sort_length= 8; +SELECT CASE 1 WHEN 0 THEN 'foo' ELSE a END AS f FROM t1 GROUP BY f WITH ROLLUP; +SELECT CASE 1 WHEN 0 THEN 'foo' ELSE a END AS f FROM t1 GROUP BY f; +DROP TABLE t1; +SET max_sort_length=DEFAULT; + +--echo # End of 10.8 tests |