| Bug #30324 | Grouping queries with COUNT(DISTINCT bit column) return wrong results | ||
|---|---|---|---|
| Submitted: | 9 Aug 2007 1:31 | Modified: | 23 Oct 2007 18:34 |
| Reporter: | Igor Babaev | ||
| Status: | Closed | ||
| Category: | Server: Optimizer | Severity: | S2 (Serious) |
| Version: | 5.0-bk, 5.1-bk | OS: | Any |
| Assigned to: | Sergey Petrunia | Target Version: | 5.1.23 |
[9 Aug 2007 1:31]
Igor Babaev
[9 Aug 2007 1:57]
Miguel Solorzano
Thank you for the bug report.
[8 Sep 2007 18:25]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/33963 ChangeSet@1.2513, 2007-09-08 20:23:52+04:00, sergefp@mysql.com +3 -0 BUG#30324: Grouping queries with COUNT(DISTINCT bit column) return wrong results - The bug was caused by COUNT(DISTINCT ...) code using Unique object in a way that assumed that BIT(N) column occupies a continous space in temp_table->record[0] buffer. - The fix is to make COUNT(DISTINCT ...) code instruct create_tmp_table to create temporary table with column of type BIGINT, not BIT(N).
[14 Sep 2007 12:54]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/34262 ChangeSet@1.2513, 2007-09-14 14:53:13+04:00, sergefp@mysql.com +3 -0 BUG#30324: Grouping queries with COUNT(DISTINCT bit column) return wrong results - The bug was caused by COUNT(DISTINCT ...) code using Unique object in a way that assumed that BIT(N) column occupies a contiguous space in temp_table->record[0] buffer. - The fix is to make COUNT(DISTINCT ...) code instruct create_tmp_table to create temporary table with column of type BIGINT, not BIT(N).
[24 Sep 2007 10:31]
Bugs System
Pushed into 5.0.50
[24 Sep 2007 10:35]
Bugs System
Pushed into 5.1.23-beta
[23 Oct 2007 18:34]
Paul DuBois
Noted in 5.0.50, 5.1.23 changelogs. Queries that had a GROUP BY clause and selected COUNT(DISTINCT bit_column) returned incorrect results.
