Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.2(EOL)
-
None
Description
CREATE TABLE t1 ( |
a TIMESTAMP(6) DEFAULT NOW(), |
b TIMESTAMP(6) DEFAULT NOW(0), |
c TIMESTAMP(6) DEFAULT (NOW() + INTERVAL 1 DAY) |
);
|
SHOW CREATE TABLE t1; |
first column: NOW() becomes NOW(6), second column: NOW(0) becomes NOW(6), third column: NOW() becomes NOW(0). Same with CURRENT_TIMESTAMP, same in AS OF.
Suggested solution: implement sql standard behavior, where CURRENT_TIMESTAMP() means CURRENT_TIMESTAMP(6). According to SQL:2016, Part 2, Section 6.1 <data type>, Syntax Rules:
36) If <time precision> is not specified, then 0 (zero) is implicit. If <timestamp precision> is not specified, then 6 is implicit.
Perhaps we'll do an old_mode setting of DEFAULT_NOW_0 to let users to revert to the old behavior temporarily.
Attachments
Issue Links
- is part of
-
MDEV-12894 System-versioned tables
- Closed