MySQL Forums
Forum List  »  General

Backwards compatibility for TIMESTAMP format change in 4.1.x??
Posted by: tb_mysql
Date: November 24, 2004 12:12PM

Hi,

since mySQL 4.1.0 TIMESTAMP is returned as a string of type 'YYYY-MM-DD HH:MM:SS'. Before that it was an integer of type 'YYYYMMDDHHMMSS'.

I strongly suggest a variable for switching between the old and the new behaviour to keep all the code out there compatible. This should be very easy to implement in mySQL but would help many people a lot.

Without it, you would have to publish different versions of code for use with mySQL < 4.1.0 and mySQL >= 4.1.0, for example when using substrings for extracting year, month, ... from the TIMESTAMP.

And it is quite an effort to find all the places where a timestamp from a SELECT might be used, for example for a WHERE in another query. Before 4.1.0 this could be done without '' as it was an integer, but now you have to put '' around it.

There are many discussions around this in a lot of forums. So, please give this compatibility switch to all of us (including me).

Thomas

P.S.: This is the change that I refer to:

Warning: Incompatible change! TIMESTAMP is now returned as a string of type 'YYYY-MM-DD HH:MM:SS' and different timestamp lengths are not supported. This change was necessary for SQL standards compliance. In a future version, a further change will be made (backward compatible with this change), allowing the timestamp length to indicate the desired number of digits of fractions of a second.

http://dev.mysql.com/doc/mysql/en/News-4.1.0.html

Options: ReplyQuote


Subject
Written By
Posted
Backwards compatibility for TIMESTAMP format change in 4.1.x??
November 24, 2004 12:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.