Bug #7128 SELECT COUNT with GROUP BY bug
Submitted: 9 Dec 2004 11:20 Modified: 9 Dec 2004 13:36
Reporter: George Sogrwig Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.14 OS:MacOS (MAC OS X)
Assigned to: CPU Architecture:Any

[9 Dec 2004 11:20] George Sogrwig
Description:
My table data:

(vote_id , vote_day)
-------------------- 
(16, 9)
(17, 16)
(32, 2) 
(33, 16) 
(35, 9) 
(37, 11) 
(38, 16) 

running the code:

SELECT vote_day, count(*) as mycount
FROM `vote`
GROUP BY vote_day

RETURNS:
-----------
(vote_day , mycount)
2 , 1 
9 , 2 
11 , 1 
16 , 3 

...on My WinXP PRO - version: 4.0.20a-max.

....while on a MAC OS X - version 4.0.14:

vote_day , mycount 
2 , 72057594037927936 
9 , 144115188075855872 
11 , 72057594037927936 
16 , 216172782113783808 
      

My table is: 
---------------------------------
CREATE TABLE `vote` (
`vote_id` int(11) NOT NULL auto_increment,
`vote_day` int(11) default NULL,
PRIMARY KEY (`vote_id`)
) TYPE=InnoDB ROW_FORMAT=FIXED COMMENT='InnoDB free'

How to repeat:
CREATE TABLE `vote` (
`vote_id` int(11) NOT NULL auto_increment,
`vote_day` int(11) default NULL,
PRIMARY KEY (`vote_id`)
) TYPE=InnoDB ROW_FORMAT=FIXED COMMENT='InnoDB free'

on a MAC OS X - Mysql vesions: 4.0.14

insert some data.... and run the query:

SELECT vote_day, count(*) as mycount
FROM `vote`
GROUP BY vote_day
[9 Dec 2004 13:36] Hartmut Holzgraefe
Thank you for taking the time to report a problem.  Unfortunately
you are not using a current version of the product your reported a
problem with -- the problem might already be fixed. Please download
a new version from http://www.mysql.com/downloads/

If you are able to reproduce the bug with one of the latest versions,
please change the version on this bug report to the version you
tested and change the status back to "Open".  Again, thank you for
your continued support of MySQL.

Additional info:

Does this also happen with a more current (4.0.22) Mac OS X MySQL version?
[9 Dec 2004 13:46] George Sogrwig
> Does this also happen with a more current (4.0.22) Mac OS X MySQL version?
> 

I am sorry, but I can't update this version... It is located on a host that I
can only upload my database. I don't have administratior privillages.

Can anyone else confirm this bug on the current version?
[6 Jul 2008 7:16] Axel Krysztofiak
I have the same Problem using MySQL 5.0.51a on Mac OS X. This version is included in the current version of XAMPP (version 0.7.2). On Kubuntu 8.04 I have installed MySQL version 5.0.51a-3ubuntu5.1. There I have no problems like this.
[29 Dec 2008 6:33] Sveta Smirnova
Axel,

thank you for the feedback.

I can not repeat described behavior with data provided by original reporter. Please provide repeatable test case if you still have this problem.