Bug #62645 select count(distinct(...) fails in Windows 7 Professional and MySQL 5.5.9-log
Submitted: 6 Oct 2011 15:46 Modified: 22 Dec 2011 23:48
Reporter: Sammy Esmail Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: DDL Severity:S2 (Serious)
Version:MySQL 5.5.9-log OS:Windows (Windows 7 Professional)
Assigned to: CPU Architecture:Any

[6 Oct 2011 15:46] Sammy Esmail
Description:
Windows 7 Professional running MySQL 5.5.9-log fails to correctly run the following command against a table partitioned by YOM and WOM and with a length of 6802 records-not a very large table. The select command was run in MySQL Query Browsers mysql-gui-tools-5.0.-r17 and the new mysql-workbench-gpl-5.2.43.1-win32.msi.

      select count(distinct(assembly_serial_number)) from header_and_results_ph_cal_table where YOM=2011 and WOM=14;

     It returns a count of 251 which is incorrect. The correct count should be 463. When run without the count, 463 records are displayed.

When a third filter is added and all manufacturers are selected, the correct count of 463 is returned.

    select count(distinct(assembly_serial_number)) from header_and_results_ph_cal_table where YOM=2011 and WOM=14 and 
(manufacturer=2 or manufacturer=3);
    
Now both commands work successfully on our other server running XP Professional and 5.1.53-community.

On another smaller table that is not partitioned, things work correctly.

However, when the same select count(distinct(..)) instruction is run from within a MySQL Stored Procedure, it works correctly.

It seems that this issue is affecting all tables in this particular schema.

While the M

How to repeat:
See above.
[6 Oct 2011 15:50] Valeriy Kravchuk
Please, check if the same problem still happens with a recent version, 5.5.16.
[7 Nov 2011 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[12 Nov 2011 21:22] Sammy Esmail
I have done an upgrade to MySQL 5.5.17. In addition, I have loaded all recent Windows 7 updates as of yesterday.
The problem still persists.
[22 Nov 2011 23:48] MySQL Verification Team
Could you please provide a complete script test case (create table, data insert, stored procedure, etc). Thanks.
[23 Dec 2011 7:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".