开发者

MySQL UPDATE TIMESTAMP on row UPDATE, even when all other row data remains the same?

开发者 https://www.devze.com 2023-03-18 23:48 出处:网络
I have a table with a timestamp. The timestamp is set to \"ON UPDATE CURRENT_TIMESTAMP.\" When I run an update on a row with data that is the same as the data already in that row, I still want the 开

I have a table with a timestamp.

The timestamp is set to "ON UPDATE CURRENT_TIMESTAMP."

When I run an update on a row with data that is the same as the data already in that row, I still want the 开发者_如何学CTIMESTAMP to update. It does not. Why does it not? If the data is different it updates just fine.

I realize I can force an update with TIMESTAMP = now(), but I am trying to understand what MySQL is doing.


You have said ON UPDATE.

There is no update happening if all the row's values are the same.

0

精彩评论

暂无评论...
验证码 换一张
取 消