fix(plsql): add MAXSIZE option to STORAGE clause grammar#65
Conversation
The Oracle parser did not recognize MAXSIZE in STORAGE clauses, causing syntax errors for valid DDL like STORAGE(NEXT 1M MAXSIZE UNLIMITED). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Extends the Oracle storage_clause grammar to support MAXSIZE (including UNLIMITED) and adds a regression DDL example reproducing BYT-9088.
Changes:
- Add
MAXSIZE (UNLIMITED | size_clause)as a validstorage_clauseattribute. - Add a new
CREATE TABLE ... PARTITION ... STORAGE(... MAXSIZE UNLIMITED ...)statement to the SQL examples corpus.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| plsql/PlSqlParser.g4 | Extends storage_clause grammar to parse MAXSIZE with UNLIMITED/size. |
| plsql/examples/create_table.sql | Adds a real-world DDL example exercising MAXSIZE UNLIMITED within partition STORAGE. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ( | ||
| TXN_DATE DATE, | ||
| ETL_DATE DATE, | ||
| ID_RSLT NUMBER, | ||
| CN_CAP1 VARCHAR2(100), | ||
| CN_CAP2 VARCHAR2(100), | ||
| TEN_CN VARCHAR2(4000), | ||
| TEN_PGD VARCHAR2(4000), | ||
| STT_AO NUMBER, | ||
| FORMAT_ROW VARCHAR2(50), | ||
| STT VARCHAR2(1000), | ||
| TEN_DV VARCHAR2(4000), | ||
| HDV NUMBER, | ||
| DUNO NUMBER, | ||
| BAO_LANH NUMBER, | ||
| LC NUMBER, | ||
| NOXAU NUMBER, | ||
| TL_NOXAU NUMBER | ||
| ) ROW STORE COMPRESS ADVANCED | ||
| TABLESPACE ARCHIVE_TBS | ||
| PCTUSED 0 | ||
| PCTFREE 10 | ||
| INITRANS 1 | ||
| MAXTRANS 255 | ||
| STORAGE ( | ||
| BUFFER_POOL DEFAULT | ||
| ) | ||
| NOLOGGING | ||
| PARTITION BY RANGE (TXN_DATE) | ||
| INTERVAL (NUMTODSINTERVAL(1,'DAY')) | ||
| ( | ||
| PARTITION PART_01 VALUES LESS THAN (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) | ||
| NOLOGGING | ||
| ROW STORE COMPRESS ADVANCED | ||
| TABLESPACE ARCHIVE_TBS | ||
| PCTFREE 10 | ||
| INITRANS 1 | ||
| MAXTRANS 255 | ||
| STORAGE ( | ||
| INITIAL 8M | ||
| NEXT 1M | ||
| MAXSIZE UNLIMITED | ||
| MINEXTENTS 1 | ||
| MAXEXTENTS UNLIMITED | ||
| BUFFER_POOL DEFAULT | ||
| )); |
There was a problem hiding this comment.
This change adds a large, production-like DDL statement into plsql/examples/create_table.sql. If this is intended primarily as a regression fixture for BYT-9088, consider moving it into a smaller, dedicated example/fixture file (e.g., plsql/examples/byt-9088.sql or a test-fixtures directory if one exists) to keep create_table.sql from growing into an unmanageable catch-all corpus.
| ( | |
| TXN_DATE DATE, | |
| ETL_DATE DATE, | |
| ID_RSLT NUMBER, | |
| CN_CAP1 VARCHAR2(100), | |
| CN_CAP2 VARCHAR2(100), | |
| TEN_CN VARCHAR2(4000), | |
| TEN_PGD VARCHAR2(4000), | |
| STT_AO NUMBER, | |
| FORMAT_ROW VARCHAR2(50), | |
| STT VARCHAR2(1000), | |
| TEN_DV VARCHAR2(4000), | |
| HDV NUMBER, | |
| DUNO NUMBER, | |
| BAO_LANH NUMBER, | |
| LC NUMBER, | |
| NOXAU NUMBER, | |
| TL_NOXAU NUMBER | |
| ) ROW STORE COMPRESS ADVANCED | |
| TABLESPACE ARCHIVE_TBS | |
| PCTUSED 0 | |
| PCTFREE 10 | |
| INITRANS 1 | |
| MAXTRANS 255 | |
| STORAGE ( | |
| BUFFER_POOL DEFAULT | |
| ) | |
| NOLOGGING | |
| PARTITION BY RANGE (TXN_DATE) | |
| INTERVAL (NUMTODSINTERVAL(1,'DAY')) | |
| ( | |
| PARTITION PART_01 VALUES LESS THAN (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) | |
| NOLOGGING | |
| ROW STORE COMPRESS ADVANCED | |
| TABLESPACE ARCHIVE_TBS | |
| PCTFREE 10 | |
| INITRANS 1 | |
| MAXTRANS 255 | |
| STORAGE ( | |
| INITIAL 8M | |
| NEXT 1M | |
| MAXSIZE UNLIMITED | |
| MINEXTENTS 1 | |
| MAXEXTENTS UNLIMITED | |
| BUFFER_POOL DEFAULT | |
| )); | |
| -- BYT-9088 regression fixture: | |
| -- The large, production-like partitioned table definition that was | |
| -- previously in this generic example file has been moved to a | |
| -- dedicated fixture (e.g., plsql/examples/byt-9088.sql) to keep | |
| -- create_table.sql small and focused on simple examples. |
Updates github.com/bytebase/parser to include fix for MAXSIZE option in Oracle STORAGE clause grammar (bytebase/parser#65). Fixes BYT-9088 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Updates github.com/bytebase/parser to include fix for MAXSIZE option in Oracle STORAGE clause grammar (bytebase/parser#65). Fixes BYT-9088 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
MAXSIZE (UNLIMITED | size_clause)to the Oraclestorage_clausegrammar ruleROW STORE COMPRESS ADVANCEDandSTORAGE(... MAXSIZE UNLIMITED ...)Test plan
make build— parser regenerated successfullymake test— all 343+ test cases pass including the new test caseFixes BYT-9088
🤖 Generated with Claude Code