-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support current_timestamp and now as default constrains (#2690)
Signed-off-by: Ruihang Xia <[email protected]>
- Loading branch information
Showing
3 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/cases/standalone/common/create/current_timestamp.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
create table t1 (ts timestamp time index default CURRENT_TIMESTAMP); | ||
|
||
Affected Rows: 0 | ||
|
||
create table t2 (ts timestamp time index default currEnt_tImEsTamp()); | ||
|
||
Affected Rows: 0 | ||
|
||
create table t3 (ts timestamp time index default now()); | ||
|
||
Affected Rows: 0 | ||
|
||
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 | ||
|
||
drop table t1; | ||
|
||
Affected Rows: 0 | ||
|
||
drop table t2; | ||
|
||
Affected Rows: 0 | ||
|
||
drop table t3; | ||
|
||
Affected Rows: 0 | ||
|
11 changes: 11 additions & 0 deletions
11
tests/cases/standalone/common/create/current_timestamp.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
create table t1 (ts timestamp time index default CURRENT_TIMESTAMP); | ||
|
||
create table t2 (ts timestamp time index default currEnt_tImEsTamp()); | ||
|
||
create table t3 (ts timestamp time index default now()); | ||
|
||
create table t4 (ts timestamp time index default now); | ||
|
||
drop table t1; | ||
drop table t2; | ||
drop table t3; |