summaryrefslogtreecommitdiff
path: root/mysql-test/r/case.result
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mysql.com>2010-08-19 15:55:35 +0400
committerAlexander Barkov <bar@mysql.com>2010-08-19 15:55:35 +0400
commit6e9298bddcb7501a1619a340fc84b1484ab84ed7 (patch)
tree0da012c099ad33a789a218b378cd58bbe76ccb47 /mysql-test/r/case.result
parent67d895d4990795258d02ead9cc9ed6abe52c085a (diff)
downloadmariadb-git-6e9298bddcb7501a1619a340fc84b1484ab84ed7.tar.gz
Bug#54916 GROUP_CONCAT + IFNULL truncates output
Problem: a few functions did not calculate their max_length correctly. This is an after-fix for WL#2649 Number-to-string conversions". Fix: changing the buggy functions to calculate max_length using fix_char_length() introduced in WL#2649, instead of setting max_length directly mysql-test/include/ctype_numconv.inc Adding new tests mysql-test/r/ctype_binary.result Adding new tests mysql-test/r/ctype_cp1251.result Adding new tests mysql-test/r/ctype_latin1.result Adding new tests mysql-test/r/ctype_ucs.result Adding new tests mysql-test/r/ctype_utf8.result Adding new tests mysql-test/t/ctype_utf8.test Including ctype_numconv sql/item.h - Introducing new method fix_char_length_ulonglong(), for the cases when length is potentially greater than UINT_MAX32. This method removes a few instances of duplicate code, e.g. in item_strfunc.cc. - Setting collation in Item_copy properly. This change fixes wrong metadata on client side in some cases, when "binary" instead of the real character set was reported. sql/item_cmpfunc.cc - Using fix_char_length() and max_char_length() methods, instead of direct access to max_length, to calculate item length properly. - Moving count_only_length() in COALESCE after agg_arg_charsets_for_string_result(). The old order was incorrect and led to wrong length calucation in case of multi-byte character sets. sql/item_func.cc Fixing that count_only_length() didn't work properly for multi-byte character sets. Using fix_char_length() and max_char_length() instead of direct access to max_length. sql/item_strfunc.cc - Using fix_char_length(), fix_char_length_ulonglong(), max_char_length() instead of direct access to max_length. - Removing wierd condition: "if (collation.collation->mbmaxlen > 0)", which is never FALSE.
Diffstat (limited to 'mysql-test/r/case.result')
-rw-r--r--mysql-test/r/case.result2
1 files changed, 2 insertions, 0 deletions
diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result
index fcbf5812312..40d900a0389 100644
--- a/mysql-test/r/case.result
+++ b/mysql-test/r/case.result
@@ -160,6 +160,8 @@ t1 CREATE TABLE `t1` (
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
+CREATE TABLE t1 SELECT IFNULL('a' COLLATE latin1_swedish_ci, 'b' COLLATE latin1_bin);
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'ifnull'
SELECT 'case+union+test'
UNION
SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END;