summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_str.test
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2010-03-26 09:49:35 +0400
committerSergey Glukhov <Sergey.Glukhov@sun.com>2010-03-26 09:49:35 +0400
commitd5325c7793a640d0f32d62088f84d3d19166add7 (patch)
treebf44c28fa4ec3980528534c53a6e89a26366f729 /mysql-test/t/func_str.test
parent251be0170dabda29ab601a8386dc7e9167b5f2da (diff)
downloadmariadb-git-d5325c7793a640d0f32d62088f84d3d19166add7.tar.gz
Bug#52164 Assertion failed: param.sort_length, file .\filesort.cc, line 149
The crash happens because of incorrect max_length calculation in QUOTE function(due to overflow). max_length is set to 0 and it leads to assert failure. The fix is to cast expression result to ulonglong variable and adjust it if the result exceeds MAX_BLOB_WIDTH. mysql-test/r/func_str.result: test case mysql-test/t/func_str.test: test case sql/item_strfunc.h: cast expression result to ulonglong variable and adjust it if the result exceeds MAX_BLOB_WIDTH.
Diffstat (limited to 'mysql-test/t/func_str.test')
-rw-r--r--mysql-test/t/func_str.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 8942b0a2faf..3392a41519b 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1352,3 +1352,14 @@ SELECT DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP
FROM t2 WHERE t2.b = 1 GROUP BY t2.b;
DROP TABLE t1, t2;
+
+--echo #
+--echo # Bug#52164 Assertion failed: param.sort_length, file .\filesort.cc, line 149
+--echo #
+CREATE TABLE t1 (a LONGBLOB NOT NULL);
+INSERT INTO t1 VALUES (''),('');
+SELECT 1 FROM t1, t1 t2
+ORDER BY QUOTE(t1.a);
+DROP TABLE t1;
+
+--echo End of 5.1 tests