-
-
Couldn't load subscription status.
- Fork 585
Closed
Labels
analyzerbugSomething isn't workingSomething isn't workingcorrectnessWe don't return the same result as MySQLWe don't return the same result as MySQLsqlIssue with SQLIssue with SQL
Description
In MySQL, these are all the same function:
CURRENT_TIMESTAMPCURRENT_TIMESTAMP()NOW()LOCALTIMELOCALTIME()LOCALTIMESTAMPLOCALTIMESTAMP()
Dolt lacks support for these
dolt> select localtime;
function: 'localtime' not found
dolt> select localtime();
function: 'localtime' not found
dolt> select localtimestamp;
function: 'localtimestamp' not found
dolt> select localtimestamp();
function: 'localtimestamp' not foundNote: We also have slightly different implementations of NOW() and CURRENT_TIMESTAMP()
As a result, we lack support for using these functions as column defaults and as on update expressions.
dolt> create table t (ts timestamp default localtime);
function: 'localtime' not foundNote: We just support on update localtime, but treat it like a no-op
dolt> create table t (ts timestamp on update localtime);
dolt> show create table t;
+-------+------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------+
| t | CREATE TABLE `t` ( |
| | `ts` timestamp |
| | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin |
+-------+------------------------------------------------------------------+
1 row in set (0.00 sec)Relevant MySQL Docs:
- https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html
- https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html
Related Issues:
Metadata
Metadata
Assignees
Labels
analyzerbugSomething isn't workingSomething isn't workingcorrectnessWe don't return the same result as MySQLWe don't return the same result as MySQLsqlIssue with SQLIssue with SQL