List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:February 2 2001 12:49am
Subject:Re: Severe problem in handling timestamp column type
View as plain text  
At 12:31 AM -0100 2/2/01, alexdusty@stripped wrote:
>  >Description:
>There is a _severe_ problem when dealing with "timestamp" column: if I update
>a column, also other columns are affected! I enclose a sample script to
>show the problem
>
>>How-To-Repeat:
>create table a(t1 timestamp, t2 timestamp);
>insert into a values("2001-01-20","1999-03-04");
>select * from a;
>update a set t2="1998-05-06";
>select * from a;
>drop table a;
>-- The second "select" shows that column t1 changed too!

That's how the TIMESTAMP type is supposed to work.  The first TIMESTAMP
column in a table is automatically updated to the current time and date
when you update any of the other columns in the table.

http://www.mysql.com/doc/D/A/DATETIME.html

>
>>Fix:
>I don't know. I used datetime type instead of timestamp and it 
>_seems_ working.


-- 
Paul DuBois, paul@stripped
Thread
Severe problem in handling timestamp column typealexdusty2 Feb
  • Re: Severe problem in handling timestamp column typePaul DuBois2 Feb
RE: Severe problem in handling timestamp column typeQuentin Bennett2 Feb