dbTalk Databases Forums  

different behaviour of str_to_date in MySQL 5.0 and 5.5

comp.databases.mysql comp.databases.mysql


Discuss different behaviour of str_to_date in MySQL 5.0 and 5.5 in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bodo
 
Posts: n/a

Default different behaviour of str_to_date in MySQL 5.0 and 5.5 - 10-19-2010 , 06:06 AM






Hi,

I have a MySQL 5.0.51a production database and a MySQL 5.5.6rc test
database.

The same query produces different results.

Is this a bug or does anybody have an explanation for this behaviour?

CREATE TABLE `ttt_bug` (
`vondat` datetime NOT NULL,
`standort` varchar(3) NOT NULL,
PRIMARY KEY (`vondat`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `ttt_bug` VALUES ('2002-01-15 00:00:00','GRH');

*********
5.0.51a:*
*********

select * from ttt_bug;
+---------------------+----------+
Quote:
vondat | standort |
+---------------------+----------+
2002-01-15 00:00:00 | GRH |
+---------------------+----------+
1 row in set (0.00 sec)

Here comes the query and the correct result.

select * from ttt_bug where vondat <= str_to_date('19.11.2010 10:05:14',
'%d.%m.%Y %T');
+---------------------+----------+
Quote:
vondat | standort |
+---------------------+----------+
2002-01-15 00:00:00 | GRH |
+---------------------+----------+
1 row in set (0.00 sec)

*********
5.5.6rc:*
*********

select * from ttt_bug;
+---------------------+----------+
Quote:
vondat | standort |
+---------------------+----------+
2002-01-15 00:00:00 | GRH |
+---------------------+----------+
1 row in set (0.00 sec)

Here comes the query and the -incorrect- result.

select * from ttt_bug where vondat <= str_to_date('19.11.2010 10:05:14',
'%d.%m.%Y %T');
Empty set (0.00 sec);

Server variables are as same as possible,

kind regards,

Bodo

Reply With Quote
  #2  
Old   
Bodo
 
Posts: n/a

Default Re: different behaviour of str_to_date in MySQL 5.0 and 5.5 - 10-19-2010 , 06:57 AM






Anybody knows where to get a MySQL 5.5.7 for testing now?

regards,

Toni

Reply With Quote
  #3  
Old   
Axel Schwenke
 
Posts: n/a

Default Re: different behaviour of str_to_date in MySQL 5.0 and 5.5 - 10-19-2010 , 07:29 AM



Bodo <bodo (AT) nomail (DOT) org.invalid> wrote:
Quote:
Anybody knows where to get a MySQL 5.5.7 for testing now?
You cannot, since it's not released. But you can clone the tree
from launchpad. I.e. the mysql-server trunk from

https://code.launchpad.net/mysql-server


XL

Reply With Quote
  #4  
Old   
Bodo
 
Posts: n/a

Default Re: different behaviour of str_to_date in MySQL 5.0 and 5.5 - 10-19-2010 , 08:37 AM



Hi Axel!

thanks for your quick reply.

Also found http://dev.mysql.com/doc/refman/5.5/en/news-5-5-x.html

Building from dev-source is too much, so i will have to wait :-)

Bodo

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.