List:General Discussion« Previous MessageNext Message »
From:Ferindo Middleton Jr Date:April 1 2006 12:30am
Subject:Re: TIMESTAMP field not automatically updating last_updated field
View as plain text  
Ferindo Middleton Jr wrote:
> Hank wrote:
>> Are the other fields in the update statement actually changing the
>> data? I don't know for sure, but if the data on disk is the same as
>> the update statement, mysql won't actually update the record, and
>> therefore might not update the last_updated field also.  Just a
>> thought.
>>
>>   
> Yes, I understand that one concept. I have seen it before.... If you 
> do an update on a record but the actually values that you are passing 
> in the statement are the exact values as were there before, no update 
> to the timestamp field is made because none of the records values 
> actually changed....
>
> But no, that is not my situation. I've tested it.... and I am actually 
> changing the values in the table (of course not specifying a new value 
> for the TIMESTAMP field) but still the TIMESTAMP field doesn't 
> auto-update.
>
> What disturbes me is that  it works fine in one particular  table but 
> all the others it works.
>
> Ferindo
>
I'm running 5.0.19-nt. I haven't had a chance to test it but should  it 
make any difference if I say:

     last_updated TIMESTAMP,

than if I say all this:

last_updated    TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,

I think this may be the difference in why some tables are auto 
incrementing and others aren't.

Ferindo
Thread
TIMESTAMP field not automatically updating last_updated fieldFerindo Middleton Jr31 Mar
  • Re: TIMESTAMP field not automatically updating last_updated fieldScott Haneda31 Mar
  • Re: TIMESTAMP field not automatically updating last_updated fieldjonathan31 Mar
    • Re: TIMESTAMP field not automatically updating last_updated fieldFerindo Middleton Jr31 Mar
      • Re: TIMESTAMP field not automatically updating last_updated fieldHank31 Mar
        • Re: TIMESTAMP field not automatically updating last_updated fieldBarry31 Mar
        • Re: TIMESTAMP field not automatically updating last_updated fieldFerindo Middleton Jr1 Apr
          • Re: TIMESTAMP field not automatically updating last_updated fieldFerindo Middleton Jr1 Apr
  • Re: TIMESTAMP field not automatically updating last_updated fieldJonathan Mangin2 Apr