Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PlSql] Support SUBPARTITION and CHECK clauses when altering table #4123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions sql/plsql/PlSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -4006,7 +4006,9 @@ deallocate_unused_clause
;

shrink_clause
: SHRINK SPACE_KEYWORD COMPACT? CASCADE?
// CHECK is an internal Oracle option
// It is used to check for proper segment type and segment attributes to allow shrink
: SHRINK SPACE_KEYWORD (COMPACT | CASCADE | CHECK)?
;

records_per_block_clause
Expand Down Expand Up @@ -4792,7 +4794,7 @@ merge_table_partition

modify_table_partition
: MODIFY (
PARTITION partition_name ((ADD | DROP) list_values_clause)? (ADD range_subpartition_desc)? (
(PARTITION | SUBPARTITION) partition_name ((ADD | DROP) list_values_clause)? (ADD range_subpartition_desc)? (
REBUILD? UNUSABLE LOCAL INDEXES
)? shrink_clause?
| range_partitions
Expand Down
2 changes: 2 additions & 0 deletions sql/plsql/examples/alter_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,5 @@ UPDATE INDEXES (COST_IX (PARTITION C_P1 TABLESPACE TBS_02, PARTITION C_P2 TABLES
ALTER TABLE "AB01"."SMOSTAMM" ADD CONSTRAINT "CC_SMOSTAMM_KRAB" CHECK ((KRAB >= 0. ) AND (KRAB <= 100. )) ENABLE;

ALTER TABLE "ME_CARRIER_HISTORY" ADD CONSTRAINT "CHECK_COMM_TYPE" CHECK (communication_type in('EDI','NON-EDI','API')) NOVALIDATE PARALLEL;

ALTER TABLE NAV.SPAC_AUT_APOLICE MODIFY SUBPARTITION P12345 SHRINK SPACE CHECK;
Loading