Mysql updating timestamp
The column is not specified explicitly in an UPDATE statement and some other column changes value..." In other words: with those server versions the first timestamp will basically be treated like 4.1 TIMESTAMPS defined ' NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'.But with those versions this is not implemented in the CREATE STATEMENT for the table.In one of our larger Rails apps the sheer volume of data we process means we’ve had to rely more and more on direct SQL queries, denormalised tables and summary tables to speed things up.When updating summary tables we typically use query.Our lawyers have asked us to point out that no DBAs were harmed in the making of the post!for details); these include syntax extensions which are deprecated in My SQL 5.1, and no longer supported in My SQL 5.5.
I was wrongly under the impression that the updates took place in one mass-assignment after the entire query had been interpreted by My SQL.
For example, a slightly different summary table could look like this: This summary table tracks the most recent event for the most recent session for a user.
Updates to this table should only be made if the session is newer, or if the session is the same and the event is newer.
Currently SQLyog always uses the '' (empty) sql_mode for its connection/session, unless changed by user. For sql_modes where ZERO-dates are not allowed setting an explicit default is required (and also note that ZERO-time - as opposite to ZERO-date - is perfectly legal in every sql_mode - however some specific server versions are buggy in this respect! With the CREATE TABLE and ALTER TABLE GUIs, however, you cannot create TIMESTAMP definitions like e) NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP f) (NOT) NULL DEFAULT 'yyyy-mm-dd hh:mm:ss' ON UPDATE CURRENT_TIMESTAMP Those constructions - that are both very rare - can be handled from the editor.
Users who want to use those will undoubtedly also understand.