Skip to content

fix(plsql): add MAXSIZE option to STORAGE clause grammar#65

Merged
h3n4l merged 1 commit intomainfrom
vk/6892-byt-9088
Mar 24, 2026
Merged

fix(plsql): add MAXSIZE option to STORAGE clause grammar#65
h3n4l merged 1 commit intomainfrom
vk/6892-byt-9088

Conversation

@h3n4l
Copy link
Member

@h3n4l h3n4l commented Mar 24, 2026

Summary

  • Added MAXSIZE (UNLIMITED | size_clause) to the Oracle storage_clause grammar rule
  • Added test case from BYT-9088 reproducing the exact DDL with ROW STORE COMPRESS ADVANCED and STORAGE(... MAXSIZE UNLIMITED ...)

Test plan

  • make build — parser regenerated successfully
  • make test — all 343+ test cases pass including the new test case

Fixes BYT-9088

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings March 24, 2026 09:18
@h3n4l h3n4l enabled auto-merge (squash) March 24, 2026 09:20
@h3n4l h3n4l merged commit 1d52e54 into main Mar 24, 2026
8 checks passed
@h3n4l h3n4l deleted the vk/6892-byt-9088 branch March 24, 2026 09:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 valid storage_clause attribute.
  • 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.

Comment on lines +399 to +444
(
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
));
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
(
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.

Copilot uses AI. Check for mistakes.
h3n4l added a commit to bytebase/bytebase that referenced this pull request Mar 25, 2026
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>
h3n4l added a commit to bytebase/bytebase that referenced this pull request Mar 25, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants