diff options
author | unknown <bar@mysql.com/bar.intranet.mysql.r18.ru> | 2006-11-07 12:45:48 +0400 |
---|---|---|
committer | unknown <bar@mysql.com/bar.intranet.mysql.r18.ru> | 2006-11-07 12:45:48 +0400 |
commit | d9360eae3b57c7ef4b1a14b270d06c8423df3bfb (patch) | |
tree | 7efe124c16c347e163ec9064f07a8ccfaae1341c /mysql-test/t/func_gconcat.test | |
parent | 2ab335a5b8bb3a25796824aa14325c777ce07a86 (diff) | |
download | mariadb-git-d9360eae3b57c7ef4b1a14b270d06c8423df3bfb.tar.gz |
Bug#23451 GROUP_CONCAT truncates a multibyte utf8 character
Problem: GROUP_CONCAT on a multi-byte column can truncate
in the middle of a multibyte character when applying
group_concat_max_len limit. It produces an invalid
multi-byte character in the result string.
The second, easier version - reusing old "warning_for_row" flag,
instead of introducing of "result_is_full" - which was
added in the previous commit.
mysql-test/r/func_gconcat.result:
Adding test case
mysql-test/t/func_gconcat.test:
Adding test case
sql/item_sum.cc:
Adding well_formed_len() call not to cut
in the middle of a multi-byte character.
Diffstat (limited to 'mysql-test/t/func_gconcat.test')
-rw-r--r-- | mysql-test/t/func_gconcat.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index d51d88d50ef..aebceeedcc3 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -391,6 +391,30 @@ select count(distinct (f1+1)) from t1 group by f1 with rollup; drop table t1; # +# Bug#23451 GROUP_CONCAT truncates a multibyte utf8 character +# +set names utf8; +create table t1 +( + x text character set utf8 not null, + y integer not null +); +insert into t1 values (repeat('a', 1022), 0), (repeat(_utf8 0xc3b7, 4), 0); +let $1= 10; +while ($1) +{ + eval set group_concat_max_len= 1022 + $1; + --disable_result_log + select @x:=group_concat(x) from t1 group by y; + --enable_result_log + select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12); + dec $1; +} +drop table t1; +set group_concat_max_len=1024; +set names latin1; + +# # Bug#14169 type of group_concat() result changed to blob if tmp_table was used # create table t1 (f1 int unsigned, f2 varchar(255)); |