mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
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.
This commit is contained in:
parent
31abddb5e1
commit
599b731660
@@ -390,6 +390,30 @@ select f1, group_concat(f1+1) from t1 group by f1 with rollup;
|
||||
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
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user