DBZ-7898 Support parsing for interval default values

This commit is contained in:
Chris Cranford 2024-05-23 10:19:13 -04:00 committed by Jiri Pechanec
parent ccdad6819f
commit 5087b30538
2 changed files with 12 additions and 1 deletions

View File

@ -3430,7 +3430,13 @@ column_definition
column_default_value column_default_value
: constant : constant
| expression; | interval_default_value_expression
| expression
;
interval_default_value_expression
: '('? INTERVAL concatenation? interval_expression ')'?
;
virtual_column_definition virtual_column_definition
: column_name (datatype (COLLATE collation_name)?)? : column_name (datatype (COLLATE collation_name)?)?

View File

@ -691,6 +691,11 @@ PARTITION BY RANGE ( C_DATE )
PARTITION TABLE_A_202412 VALUES LESS THAN ('20250101'), PARTITION TABLE_A_202412 VALUES LESS THAN ('20250101'),
PARTITION TABLE_A_202501 VALUES LESS THAN ('20250201') PARTITION TABLE_A_202501 VALUES LESS THAN ('20250201')
) TABLESPACE TS_A; ) TABLESPACE TS_A;
CREATE TABLE "interval_type_test" (
"id" number GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1) PRIMARY KEY,
"i1" INTERVAL YEAR(9) TO MONTH DEFAULT (INTERVAL '10-3' YEAR TO MONTH) NULL,
"i2" INTERVAL DAY(6) TO SECOND (9) DEFAULT (INTERVAL '1 2:34:56.789' DAY TO SECOND) NOT NULL
);
-- Create index (Oracle 23+) -- Create index (Oracle 23+)
create index hr.name IF NOT EXISTS on hr.table (id,data) tablespace ts; create index hr.name IF NOT EXISTS on hr.table (id,data) tablespace ts;
-- Create user (Oracle 23+) -- Create user (Oracle 23+)