Bug #6258 timestamp update problem
Submitted: 26 Oct 2004 9:08 Modified: 26 Oct 2004 11:22
Reporter: István Juhász Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.0.21 OS:Linux (Red Hat 7.0)
Assigned to: CPU Architecture:Any

[26 Oct 2004 9:08] István Juhász
Description:
If you try to update a timestamp value with a value like this 20041025102114+600, then it does not update the value in 10%-of the trys. It seems, that it depends on what the new value is like.

How to repeat:
Create a table. ID = Int 16 auto_increment, TS TimeStamp(14) Null, Deafault 00000000000000

Create some records, with the default TS. (00000..)

Try to update the records.
If you try this:
UPDATE xxx SET ts=20041025102114+600 WHERE id=1

In some cases the the ts wont update. It depends on the timestamp you try to update with.

Suggested fix:
-
[26 Oct 2004 11:22] MySQL Verification Team
Hi,

Thank you for the report, but this is not a bug. You can't use arithmetic operations directly with date and time column types. Use DATE_ADD()/DATE_SUB() functions instead.