Commit 756568f2 authored by Alexander Barkov's avatar Alexander Barkov

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.
parent c9fcea14
......@@ -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;
......@@ -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;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment