Bug #43134 | select with distinct or group by yields incorrect records | ||
---|---|---|---|
Submitted: | 24 Feb 2009 10:10 | Modified: | 11 Nov 2009 9:14 |
Reporter: | Mike Jenkins | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: Partitions | Severity: | S2 (Serious) |
Version: | 5.1.24 and 5.1.31 | OS: | Linux (Centos 4) |
Assigned to: | CPU Architecture: | Any |
[24 Feb 2009 10:10]
Mike Jenkins
[24 Feb 2009 10:46]
Sveta Smirnova
Thank you for the report. You wrote: mysql> select RunDate from TTprices where RunDate>='20040204' group by RunDate limit 5; +----------+ | RunDate | +----------+ | 20070102 | | 20070103 |<<<<<<<<<< ALL WRONG - group by | 20070104 | | 20070105 | | 20070108 | +----------+ 5 rows in set (0.02 sec) Returns 5 different RunDate each of them >='20040204' What is wrong here? You wrote: mysql> select distinct RunDate from TTprices where RunDate>='20040204' order by RunDate limit 5; +----------+ | RunDate | +----------+ | 20070102 | | 20070103 |<<<<<<<<<< ALL WRONG - distinct | 20070104 | | 20070105 | | 20070108 | +----------+ 5 rows in set (0.00 sec) Returns 5 different RunDate each of them >='20040204' What is wrong here?
[24 Feb 2009 11:37]
Mike Jenkins
Hi, It should return data for 20040204 onwards (see below) but it is actually returning data for 2007 onwards and from the 1st record in 2007. +----------+ | RunDate | +----------+ | 20040204 | | 20040205 | | 20040206 | | 20040209 | | 20040210 | +----------+ Mike
[24 Feb 2009 17:12]
Sveta Smirnova
Thank you for the feedback. Please provide output of EXPLIAN PARTITIONS for SELECT statements provided.
[24 Feb 2009 19:40]
Mike Jenkins
Contains EXPLAIN PARTITION of each of the 6 select statements.
Attachment: explainpart.txt (text/plain), 5.47 KiB.
[25 Feb 2009 14:30]
Mike Jenkins
Have overcome problem by renaming table and creating a new one and then doing an...insert into TTprices select * from TTpricesOld where RunDate<'20040101'; so I only get 2003 records. I then do all batch processing and truncate TTprices and then repeat for 2004 etc. Workaround fine for me but when I need this online ...
[7 Sep 2009 6:21]
Susanne Ebrecht
Sorry but I am confused about the version numbers. On which version do you have this problem?
[7 Oct 2009 23: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".
[11 Oct 2009 8:42]
Sveta Smirnova
Version numbers corrected.
[11 Oct 2009 9:14]
Valeriy Kravchuk
Please, try to repeat with a newer version, 5.1.39, and inform about the results.
[12 Nov 2009 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".