Bug #21824 LIMIT work incorrect
Submitted: 25 Aug 2006 7:19 Modified: 25 Aug 2006 19:56
Reporter: Ivan Shumkov Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.24 (from ports) OS:FreeBSD (FreeBSD 6.1)
Assigned to: CPU Architecture:Any
Tags: limit

[25 Aug 2006 7:19] Ivan Shumkov
Description:
LIMIT work incorrect with join and subqueres

How to repeat:
CREATE TABLE `groups` (
  `id` int(10) unsigned NOT NULL auto_increment,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;
INSERT INTO `groups` (`id`) VALUES (1), (2), (3), (4);
CREATE TABLE `users` (
  `id` int(11) NOT NULL auto_increment,
  `group_id` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;
INSERT INTO `users` (`id`, `group_id`) VALUES (1, 1), (2, 1), (3, 2), (4, 3), (5, 4), (6, 4), (7, 4);

SELECT GROUP_CONCAT( users.id
SEPARATOR ', ' )
FROM groups
LEFT JOIN users ON ( users.group_id = groups.id )
GROUP BY groups.id
LIMIT 0 , 2
[25 Aug 2006 7:22] Ivan Shumkov
System
[25 Aug 2006 7:25] Ivan Shumkov
Detail system
[25 Aug 2006 18:52] Sveta Smirnova
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Duplicate of bug #21705.
[25 Aug 2006 19:56] Ivan Shumkov
I search report with this problem, but didn't find it.
[2 Jul 2007 16:56] alastair knowles
I just came across the same bug using GROUP_CONCAT. Very confusing. I agree with you Ivan, not sure how anyone could have figured out this was a duplicate bug.