Skip to content

Commit

Permalink
MDEV-22256 Assertion `length == pack_length()' failed in Field_timest…
Browse files Browse the repository at this point in the history
…amp_with_dec::sort_string

Adding 10.5 specific tests only. No code change.

The patches for MDEV-21580 and MDEV-22715 fixed this problem.
  • Loading branch information
abarkov committed Dec 29, 2021
1 parent c9fcea1 commit 756568f
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
33 changes: 33 additions & 0 deletions plugin/type_inet/mysql-test/type_inet/type_inet6.result
Original file line number Diff line number Diff line change
Expand Up @@ -2194,3 +2194,36 @@ SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::1';
f
::
DROP TABLE t1;
#
# 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 1292 Incorrect inet6 value: '0' for column `test`.`t1`.`c` at row 1
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;
21 changes: 21 additions & 0 deletions plugin/type_inet/mysql-test/type_inet/type_inet6.test
Original file line number Diff line number Diff line change
Expand Up @@ -1612,3 +1612,24 @@ SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '';
SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::';
SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::1';
DROP TABLE t1;

--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);
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;

0 comments on commit 756568f

Please sign in to comment.