This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 66c79a0cc36 Add oracle alter table supplementalTableLogging rule
(#27958)
66c79a0cc36 is described below
commit 66c79a0cc3600ddb1d828e74d84851d1c75ec608
Author: niu niu <[email protected]>
AuthorDate: Mon Aug 7 12:24:14 2023 +0800
Add oracle alter table supplementalTableLogging rule (#27958)
---
.../dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4 | 7 ++++++-
test/it/parser/src/main/resources/case/ddl/alter-table.xml | 6 ++++++
.../it/parser/src/main/resources/sql/supported/ddl/alter-table.xml | 1 +
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git
a/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
b/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
index 11171ed408c..283fe5dc25b 100644
--- a/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
+++ b/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4
@@ -398,13 +398,18 @@ alterDefinitionClause
;
alterTableProperties
- : renameTableSpecification | REKEY encryptionSpecification
+ : renameTableSpecification | REKEY encryptionSpecification |
supplementalTableLogging
;
renameTableSpecification
: RENAME TO identifier
;
+supplementalTableLogging
+ : ADD SUPPLEMENTAL LOG (supplementalLogGrpClause |
supplementalIdKeyClause) (COMMA_ SUPPLEMENTAL LOG (supplementalLogGrpClause |
supplementalIdKeyClause))*
+ | DROP SUPPLEMENTAL LOG (supplementalIdKeyClause | GROUP logGroupName)
(COMMA_ SUPPLEMENTAL LOG (supplementalIdKeyClause | GROUP logGroupName))*
+ ;
+
dropSynonym
: DROP PUBLIC? SYNONYM (schemaName DOT_)? synonymName FORCE?
;
diff --git a/test/it/parser/src/main/resources/case/ddl/alter-table.xml
b/test/it/parser/src/main/resources/case/ddl/alter-table.xml
index d329973aa07..b333a2721f8 100644
--- a/test/it/parser/src/main/resources/case/ddl/alter-table.xml
+++ b/test/it/parser/src/main/resources/case/ddl/alter-table.xml
@@ -1266,4 +1266,10 @@
<alter-table sql-case-id="alter_table_order_by">
<table name="t_order" start-index="12" stop-index="18" />
</alter-table>
+
+ <alter-table sql-case-id="alter_table_add_supplemental_log_group">
+ <table name="EMPLOYEES" start-index="12" stop-index="23">
+ <owner start-index="12" stop-index="13" name="HR" />
+ </table>
+ </alter-table>
</sql-parser-test-cases>
diff --git
a/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml
b/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml
index 21911536d90..2a96944dafb 100644
--- a/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/alter-table.xml
@@ -158,4 +158,5 @@
<sql-case id="alter_table_drop_expression" value="ALTER TABLE t_order
ALTER COLUMN a DROP EXPRESSION;" db-types="PostgreSQL" />
<sql-case id="alter_table_modify_column_precision_with_decimal"
value="ALTER TABLE t_order MODIFY COLUMN a VARCHAR(10.000000000001)"
db-types="MySQL" />
<sql-case id="alter_table_order_by" value="ALTER TABLE t_order ORDER BY
t_order.id, t_order.status desc" db-types="MySQL" />
+ <sql-case id="alter_table_add_supplemental_log_group" value="ALTER TABLE
HR.EMPLOYEES ADD SUPPLEMENTAL LOG GROUP emp_fulltime (EMPLOYEE_ID, LAST_NAME,
DEPARTMENT_ID)" db-types="Oracle" />
</sql-cases>