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 2d67080fc93 Add alter table test sql (#28201)
2d67080fc93 is described below
commit 2d67080fc93a82202f1e6090d35e7f0c687941a2
Author: niu niu <[email protected]>
AuthorDate: Tue Aug 22 16:50:04 2023 +0800
Add alter table test sql (#28201)
---
.../parser/src/main/resources/case/ddl/alter-table.xml | 16 ++++++++++++++++
.../src/main/resources/sql/supported/ddl/alter-table.xml | 2 ++
2 files changed, 18 insertions(+)
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 39f298cc5a2..23c45b56768 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
@@ -84,6 +84,15 @@
</modify-column>
</alter-table>
+ <alter-table sql-case-id="alter_table_modify9">
+ <table name="sales" start-index="12" stop-index="16" />
+ <modify-column>
+ <column-definition type="time_view_fk" start-index="25"
stop-index="52">
+ <column name="CONSTRAINT" />
+ </column-definition>
+ </modify-column>
+ </alter-table>
+
<alter-table sql-case-id="alter_table_add_constraint">
<table name="employees" start-index="12" stop-index="20" />
<add-constraint constraint-name="emp_emp_id_pk" start-index="27"
stop-index="76">
@@ -1477,4 +1486,11 @@
</column-definition>
</add-column>
</alter-table>
+
+ <alter-table
sql-case-id="alter_table_add_constraint_foreign_key_references_disable_novalidate">
+ <table name="sales" start-index="12" stop-index="16" />
+ <add-constraint constraint-name="time_view_fk" start-index="23"
stop-index="116">
+ <referenced-table start-index="80" stop-index="88"
name="time_view" />
+ </add-constraint>
+ </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 778ffb0e724..b05eb94a3ee 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
@@ -25,6 +25,7 @@
<sql-case id="alter_table_modify6" value="ALTER TABLE employees MODIFY
(emp_ssn ENCRYPT)" db-types="Oracle" />
<sql-case id="alter_table_modify7" value="ALTER TABLE locations MODIFY
PRIMARY KEY DISABLE CASCADE" db-types="Oracle" />
<sql-case id="alter_table_modify8" value="ALTER TABLE employees MODIFY
(salary ENCRYPT USING 'AES256' 'NOMAC')" db-types="Oracle" />
+ <sql-case id="alter_table_modify9" value="ALTER TABLE sales MODIFY
CONSTRAINT time_view_fk RELY" db-types="Oracle" />
<sql-case id="alter_table_add_constraint" value="ALTER TABLE employees ADD
(CONSTRAINT emp_emp_id_pk PRIMARY KEY (employee_id), CONSTRAINT emp_dept_fk
FOREIGN KEY (department_id) REFERENCES departments, CONSTRAINT emp_job_fk
FOREIGN KEY (job_id) REFERENCES jobs (job_id), CONSTRAINT emp_manager_fk
FOREIGN KEY (manager_id) REFERENCES employees)" db-types="Oracle" />
<sql-case id="alter_table_no_flashback_archive" value="ALTER TABLE
employee NO FLASHBACK ARCHIVE" db-types="Oracle" />
<sql-case id="alter_table_move_tablespace_overflow_tablespace"
value="ALTER TABLE admin_docindex MOVE TABLESPACE admin_tbs2 OVERFLOW
TABLESPACE admin_tbs3" db-types="Oracle" />
@@ -191,4 +192,5 @@
<sql-case id="alter_table_set_subpartition_template2" value="ALTER TABLE
emp_sub_template SET SUBPARTITION TEMPLATE()" db-types="Oracle" />
<sql-case
id="alter_table_modify_default_attributes_for_partition_tablespace"
value="ALTER TABLE emp MODIFY DEFAULT ATTRIBUTES FOR PARTITION p1 TABLESPACE
ts1" db-types="Oracle" />
<sql-case id="alter_table_ref_with_rowid" value="ALTER TABLE emp ADD
(REF(column_value) WITH ROWID)" db-types="Oracle" />
+ <sql-case
id="alter_table_add_constraint_foreign_key_references_disable_novalidate"
value="ALTER TABLE sales ADD (CONSTRAINT time_view_fk FOREIGN KEY (time_id)
REFERENCES time_view(time_id) DISABLE NOVALIDATE)" db-types="Oracle" />
</sql-cases>