Problem Description:
Requires storage of 13-bit millisecond-level timestamps, formatted as INT (13) in MySQL, overflow, auto-truncated to 2147483647
Analysis:
If you ask directly the scope of the int type of storage, it must be known, but the addition of the following (n) is confusing.
FIX: Modify to bigint (use MySQL version below 5.6.4)
Https://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html
5.6.4 previously: millisecond-level timestamp storage not supported (DATETIME TIMESTAMP)
After 5.6.4: Can be stored by setting the number of decimal digits
Added
Knowledge Point One: what does n in int (n) mean? Display width
- n represents the length of the display, the left padded space when insufficient
- n does not affect the range that can be stored
Knowledge Point Two: What does N in VARCHAR and char mean?
CHAR (n): n max is 255, use size always n bytes;
VARCHAR (n): n maximum is 65535, the use of size is related to the actual length of the stored string;
13-bit millisecond timestamp vs MySQL Int (13)