' gs_modified ' timestamp not NULL DEFAULT current_timestamp on update current_timestamp COMMENT ' database last update time '
After a big six months, because of some business problems, found such a hidden point.
Not NULL default Current_timestamp, this sentence does not need to participate in the following discussion, this field is not empty, if the new time is empty, the default is stored as the current system time.
Gs_modified, this field is mainly from the business library, and then the cold storage to back up the business library data, the first version is insert into on dumplicate key update
, this table has a primary key, each time the backup is inserted if it does not exist, if it exists, update some fields of business data.
So, on update Current_timestam is effective, if the UPDATE statement, regardless of whether the field is passed over, will be updated to the current time.
And then the logic of the cold backup, into the replace into, so on the UPDATE Current_timestam will not be effective, is always the business library data transfer over the gs_modified.