Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions oracle/parser/create_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -2184,6 +2184,10 @@ func (p *Parser) parsePartitionDef() (*nodes.PartitionDef, error) {
}

for p.cur.Type != ',' && p.cur.Type != ')' && p.cur.Type != tokEOF {
if p.cur.Type == '(' {
p.skipParenthesized()
continue
}
p.advance()
}

Expand Down
48 changes: 48 additions & 0 deletions oracle/parser/create_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,54 @@ func TestCreateTableDateLiteralPartitionBound(t *testing.T) {
ParseAndCheck(t, "CREATE TABLE t_date_bound (d DATE) PARTITION BY RANGE (d) (PARTITION p1 VALUES LESS THAN (DATE '2020-01-01'))")
}

func TestCreateTablePartitionStorageClause(t *testing.T) {
tests := []string{
`CREATE TABLE t_part_storage_initial (n NUMBER)
PARTITION BY RANGE (n)
(
PARTITION p1 VALUES LESS THAN (100)
STORAGE (INITIAL 8388608)
)`,
`CREATE TABLE t_part_storage_full (n NUMBER)
PARTITION BY RANGE (n)
(
PARTITION p1 VALUES LESS THAN (100)
STORAGE (
INITIAL 8388608
NEXT 1048576
MINEXTENTS 1
MAXEXTENTS 2147483645
BUFFER_POOL DEFAULT
)
)`,
`CREATE TABLE t_part_storage_attrs (txn_date DATE)
ROW STORE COMPRESS ADVANCED
TABLESPACE users
PCTFREE 10
NOLOGGING
PARTITION BY RANGE (txn_date)
INTERVAL (NUMTOYMINTERVAL(1,'MONTH'))
(
PARTITION part_01 VALUES LESS THAN (DATE '2024-01-01')
NOLOGGING
COMPRESS FOR OLTP
TABLESPACE users
PCTFREE 10
STORAGE (
INITIAL 8388608
NEXT 1048576
MINEXTENTS 1
MAXEXTENTS 2147483645
BUFFER_POOL DEFAULT
)
)`,
}

for _, sql := range tests {
ParseAndCheck(t, sql)
}
}

func parseCreateTableForP2(t *testing.T, sql string) *ast.CreateTableStmt {
t.Helper()
result := ParseAndCheck(t, sql)
Expand Down
Loading