Bug #24300 group_concat() result truncated in MySQL 4.1
Submitted: 14 Nov 2006 14:56 Modified: 18 Apr 2008 12:33
Reporter: Jerome Asselin Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.23-BK, 4.1.20 OS:Linux (RHEL4 AS)
Assigned to: Alexey Kopytov CPU Architecture:Any

[14 Nov 2006 14:56] Jerome Asselin
Description:
Hi,

I'm seeing that strings can get truncated using group_concat(), even though I've set group_concat_max_len to be high enough. MySQL 5.0.26 is NOT affected.

I found a related report with respect to MySQL 5.0 (Bug #19552), but I'm posting a new bug report as MySQL 5.0.26 doesn't seem affected. I'm presenting the bug in a different perspective. You should be able to reproduce the behaviour on the 4.1 series simply by running the code below.

Regards,

How to repeat:
drop table if exists temp1;
create table temp1 (
  id int not null,
  res longtext,
  primary key (id)
) ENGINE=MyISAM;

set group_concat_max_len=100000;

insert into temp1 select 1, repeat('a',66000);
select length(group_concat(res separator '')) from temp1;
# Result: 66000

insert into temp1 select 2, '';
select length(group_concat(res separator '')) from temp1;
# Result: 464 (should be 66000!)

# Note that if I use INNODB engine instead, then both results are 464.
[14 Nov 2006 15:29] Valeriy Kravchuk
Thank you for a problem report. Verified just as described with 4.1.23-BK on Linux.
[18 Apr 2008 12:33] Alexey Kopytov
Setting to "Won't fix" since the bug is not reproducible on 5.0, and 4.1 is now in the "end of life" state.