Skip to content

Commit 756568f

Browse files
committed
MDEV-22256 Assertion `length == pack_length()' failed in Field_timestamp_with_dec::sort_string
Adding 10.5 specific tests only. No code change. The patches for MDEV-21580 and MDEV-22715 fixed this problem.
1 parent c9fcea1 commit 756568f

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

plugin/type_inet/mysql-test/type_inet/type_inet6.result

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,3 +2194,36 @@ SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::1';
21942194
f
21952195
::
21962196
DROP TABLE t1;
2197+
#
2198+
# MDEV-22256 Assertion `length == pack_length()' failed in Field_timestamp_with_dec::sort_string
2199+
#
2200+
SET sql_mode='';
2201+
SET @@SESSION.max_sort_length=4;
2202+
Warnings:
2203+
Warning 1292 Truncated incorrect max_sort_length value: '4'
2204+
CREATE TEMPORARY TABLE t1(c INET6,d DATE);
2205+
INSERT INTO t1 VALUES(0,0);
2206+
Warnings:
2207+
Warning 1292 Incorrect inet6 value: '0' for column `test`.`t1`.`c` at row 1
2208+
SELECT c FROM t1 ORDER BY c;
2209+
c
2210+
::
2211+
DROP TABLE t1;
2212+
SET max_sort_length=DEFAULT;
2213+
SET sql_mode=DEFAULT;
2214+
CREATE TABLE t1 (a INET6);
2215+
INSERT INTO t1 VALUES ('::'),('f::f');
2216+
SET SESSION max_sort_length= 8;
2217+
Warnings:
2218+
Warning 1292 Truncated incorrect max_sort_length value: '8'
2219+
SELECT CASE 1 WHEN 0 THEN 'foo' ELSE a END AS f FROM t1 GROUP BY f WITH ROLLUP;
2220+
f
2221+
::
2222+
f::f
2223+
NULL
2224+
SELECT CASE 1 WHEN 0 THEN 'foo' ELSE a END AS f FROM t1 GROUP BY f;
2225+
f
2226+
::
2227+
f::f
2228+
DROP TABLE t1;
2229+
SET max_sort_length=DEFAULT;

plugin/type_inet/mysql-test/type_inet/type_inet6.test

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,3 +1612,24 @@ SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '';
16121612
SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::';
16131613
SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::1';
16141614
DROP TABLE t1;
1615+
1616+
--echo #
1617+
--echo # MDEV-22256 Assertion `length == pack_length()' failed in Field_timestamp_with_dec::sort_string
1618+
--echo #
1619+
1620+
SET sql_mode='';
1621+
SET @@SESSION.max_sort_length=4;
1622+
CREATE TEMPORARY TABLE t1(c INET6,d DATE);
1623+
INSERT INTO t1 VALUES(0,0);
1624+
SELECT c FROM t1 ORDER BY c;
1625+
DROP TABLE t1;
1626+
SET max_sort_length=DEFAULT;
1627+
SET sql_mode=DEFAULT;
1628+
1629+
CREATE TABLE t1 (a INET6);
1630+
INSERT INTO t1 VALUES ('::'),('f::f');
1631+
SET SESSION max_sort_length= 8;
1632+
SELECT CASE 1 WHEN 0 THEN 'foo' ELSE a END AS f FROM t1 GROUP BY f WITH ROLLUP;
1633+
SELECT CASE 1 WHEN 0 THEN 'foo' ELSE a END AS f FROM t1 GROUP BY f;
1634+
DROP TABLE t1;
1635+
SET max_sort_length=DEFAULT;

0 commit comments

Comments
 (0)