It is a bug? In MySQL 5. This disables the non-standard behaviour thankfully. Also, MySQL generates a warning when you disable this setting. Prior to MySQL 5. MySQL 5. See other posts on this site for more details. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 7 years, 9 months ago. Active 1 year, 11 months ago.
Viewed 21k times. I've just spent a couple of hours tracking down this bug. Jonnny 4, 11 11 gold badges 59 59 silver badges 88 88 bronze badges. Before 5. The following notes first describe automatic initialization and updating for MySQL 5. An auto-initialized column is set to the current timestamp for inserted rows that specify no value for the column. An auto-updated column is automatically updated to the current timestamp when the value of any other column in the row is changed from its current value.
An auto-updated column remains unchanged if all other columns are set to their current values. To prevent an auto-updated column from updating when other columns change, explicitly set it to its current value.
The order of the clauses does not matter. If both are present in a column definition, either can occur first. See Section 5. Different columns can have different combinations of automatic properties.
The following rules describe the possibilities:. With a constant, the default is the given value. In this case, the column has no automatic properties at all. The default in this case is type dependent. Specify the NULL attribute. The tables differ in how the ts1 column handles NULL values.
For t3 , ts1 permits NULL but has an explicit default of 0. This is permitted:. Suppose that tables t1 and t2 have these definitions:. For example:. Numeric Type Attributes. Out-of-Range and Overflow Handling. Date and Time Data Type Syntax. Fractional Seconds in Time Values. Conversion Between Date and Time Types. The Geometry Class Hierarchy. GeometryCollection Class.
0コメント