mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-06 13:22:57 +00:00
fix: Normalize default constrain fn name (#2737)
* fix: normalize current_timestamp to current_timestamp() Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * add sqlness case Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix clippy lints Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -2,14 +2,62 @@ create table t1 (ts timestamp time index default CURRENT_TIMESTAMP);
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
show create table t1;
|
||||
|
||||
+-------+-----------------------------------------------------------+
|
||||
| Table | Create Table |
|
||||
+-------+-----------------------------------------------------------+
|
||||
| t1 | CREATE TABLE IF NOT EXISTS "t1" ( |
|
||||
| | "ts" TIMESTAMP(3) NOT NULL DEFAULT current_timestamp(), |
|
||||
| | TIME INDEX ("ts") |
|
||||
| | ) |
|
||||
| | |
|
||||
| | ENGINE=mito |
|
||||
| | WITH( |
|
||||
| | regions = 1 |
|
||||
| | ) |
|
||||
+-------+-----------------------------------------------------------+
|
||||
|
||||
create table t2 (ts timestamp time index default currEnt_tImEsTamp());
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
show create table t2;
|
||||
|
||||
+-------+-----------------------------------------------------------+
|
||||
| Table | Create Table |
|
||||
+-------+-----------------------------------------------------------+
|
||||
| t2 | CREATE TABLE IF NOT EXISTS "t2" ( |
|
||||
| | "ts" TIMESTAMP(3) NOT NULL DEFAULT current_timestamp(), |
|
||||
| | TIME INDEX ("ts") |
|
||||
| | ) |
|
||||
| | |
|
||||
| | ENGINE=mito |
|
||||
| | WITH( |
|
||||
| | regions = 1 |
|
||||
| | ) |
|
||||
+-------+-----------------------------------------------------------+
|
||||
|
||||
create table t3 (ts timestamp time index default now());
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
show create table t3;
|
||||
|
||||
+-------+---------------------------------------------+
|
||||
| Table | Create Table |
|
||||
+-------+---------------------------------------------+
|
||||
| t3 | CREATE TABLE IF NOT EXISTS "t3" ( |
|
||||
| | "ts" TIMESTAMP(3) NOT NULL DEFAULT now(), |
|
||||
| | TIME INDEX ("ts") |
|
||||
| | ) |
|
||||
| | |
|
||||
| | ENGINE=mito |
|
||||
| | WITH( |
|
||||
| | regions = 1 |
|
||||
| | ) |
|
||||
+-------+---------------------------------------------+
|
||||
|
||||
create table t4 (ts timestamp time index default now);
|
||||
|
||||
Error: 1001(Unsupported), Unsupported expr in default constraint: Identifier(Ident { value: "now", quote_style: None }) for column: ts
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
create table t1 (ts timestamp time index default CURRENT_TIMESTAMP);
|
||||
|
||||
show create table t1;
|
||||
|
||||
create table t2 (ts timestamp time index default currEnt_tImEsTamp());
|
||||
|
||||
show create table t2;
|
||||
|
||||
create table t3 (ts timestamp time index default now());
|
||||
|
||||
show create table t3;
|
||||
|
||||
create table t4 (ts timestamp time index default now);
|
||||
|
||||
drop table t1;
|
||||
|
||||
Reference in New Issue
Block a user