List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:February 25 2000 10:17pm
Subject:Re: timestamp field gets updated by inserting '00000000000000' or
'0000-00-00 00:00:00'
View as plain text  
At 2:03 PM -0800 2000-02-25, jason.c.axley@stripped wrote:
>  >Description:
>	In my database, I have a timestamp(14) field that I configured
>to have a default value of NULL (I can't change this with alter 
>table--look for another bug report for that).

That's not a bug.  That's how TIMESTAMP columns work.

>  Anyhow, I am doing an INSERT from php3 using
>the mysql_db_query() function and have tried inserting both 
>'00000000000000' and
>'0000-00-00 00:00:00' into the timestamp(14) field, but instead of the value
>being set to the zero value, the field is updated with the current timestamp!

That's not a bug, either.  That's how TIMESTAMP columns work.

Perhaps you should consider using a DATETIME field instead.
It appears from your description that you don't want TIMESTAMP
behavior at all.


Might be a good idea to check chapter 7 of the MySQL Reference
Manual for a refresher on the behavior of TIMESTAMP...

-- 
Paul DuBois, paul@stripped
Thread
timestamp field gets updated by inserting '00000000000000' or '0000-00-00 00:00:00'jason.c.axley26 Feb
  • Re: timestamp field gets updated by inserting '00000000000000' or'0000-00-00 00:00:00'Paul DuBois26 Feb
RE: timestamp field gets updated by inserting '00000000000000' or'0000-00-00 00:00:00'Jason C Axley26 Feb
RE: timestamp field gets updated by inserting '00000000000000' or'0000-00-00 00:00:00'Paul DuBois26 Feb