Bug #67646 ordering data by datetime
Submitted: 20 Nov 2012 7:21 Modified: 27 Dec 2012 20:36
Reporter: Lado Kandelaki Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.5.27-cll OS:Linux (x86_64 GNU/Linux)
Assigned to: CPU Architecture:Any
Tags: datetime, ordering

[20 Nov 2012 7:21] Lado Kandelaki
Description:
hello
we have a problem on our server MySQL 5.5 with ordering data by datetime value

How to repeat:
for example :

CREATE TABLE `neon_products` (
`id` int(8) unsigned NOT NULL DEFAULT '0',
`itemdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'

) ENGINE=MyISAM DEFAULT CHARSET=utf8

mysql> select itemdate from neon_products order by itemdate desc limit 10;
+---------------------+
| itemdate |
+---------------------+
| 2012-01-03 20:00:00 |
| 2012-01-03 20:00:00 |
| 2012-01-08 21:00:00 |
| 2012-01-08 21:00:00 |
| 2012-01-04 22:00:00 |
| 2012-01-04 22:00:00 |
| 2012-01-03 23:00:00 |
| 2012-01-03 23:00:00 |
| 2012-01-04 23:00:00 |
| 2012-01-04 23:00:00 |
+---------------------+
10 rows in set (0.01 sec)

with "+0" ordering works fine
mysql> select itemdate from neon_products order by itemdate + 0 desc limit 10;
+---------------------+
| itemdate |
+---------------------+
| 2012-11-19 23:00:00 |
| 2012-11-19 23:00:00 |
| 2012-11-20 23:00:00 |
| 2012-11-19 23:00:00 |
| 2012-11-19 23:00:00 |
| 2012-11-20 23:00:00 |
| 2012-11-20 23:00:00 |
| 2012-11-20 23:00:00 |
| 2012-11-20 23:00:00 |
| 2012-11-20 23:00:00 |
+---------------------+
10 rows in set (0.01 sec)
[27 Nov 2012 20:36] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. Please send us output of CHECK TABLE neon_products EXTENDED; and explain what means "5.5.27-cll" in MySQL server version. Which distribution and package do you use?
[28 Dec 2012 1: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".