Modifications in DDLStatement.g4 (#31052)
diff --git a/parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DDLStatement.g4 b/parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
index e7a11ad..e9fa150 100644
--- a/parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
+++ b/parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
@@ -377,10 +377,8 @@
alterTablespaceNdb
: ALTER UNDO? TABLESPACE tablespace=identifier
- ((ADD | DROP) DATAFILE string_)?
+ (ADD | DROP) DATAFILE string_
(INITIAL_SIZE EQ_? fileSizeLiteral)?
- (AUTOEXTEND_SIZE EQ_? fileSizeLiteral)?
- (ENGINE_ATTRIBUTE EQ_? string_)?
WAIT? (RENAME TO renameTableSpace=identifier)?
(ENGINE EQ_? identifier)?
;
@@ -388,7 +386,9 @@
alterTablespaceInnodb
: ALTER UNDO? TABLESPACE tablespace=identifier
(SET (ACTIVE | INACTIVE))?
+ (AUTOEXTEND_SIZE EQ_? fileSizeLiteral)?
(ENCRYPTION EQ_? y_or_n=string_)?
+ (ENGINE_ATTRIBUTE EQ_? jsonAttribute = string_)?
(RENAME TO renameTablespace=identifier)?
(ENGINE EQ_? identifier)?
;
diff --git a/test/it/parser/src/main/resources/case/ddl/alter-tablespace.xml b/test/it/parser/src/main/resources/case/ddl/alter-tablespace.xml
index cc57054..4fc7771 100644
--- a/test/it/parser/src/main/resources/case/ddl/alter-tablespace.xml
+++ b/test/it/parser/src/main/resources/case/ddl/alter-tablespace.xml
@@ -153,4 +153,8 @@
<alter-tablespace sql-case-id="alter_tablespace_with_initial_size">
<tablespace start-index="17" stop-index="20" name="ts_1" />
</alter-tablespace>
+
+ <alter-tablespace sql-case-id="alter_tablespace_with_engine_attribute">
+ <tablespace start-index="17" stop-index="19" name="ts1" />
+ </alter-tablespace>
</sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/ddl/alter-tablespace.xml b/test/it/parser/src/main/resources/sql/supported/ddl/alter-tablespace.xml
index 42104be..b08d1e7 100644
--- a/test/it/parser/src/main/resources/sql/supported/ddl/alter-tablespace.xml
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/alter-tablespace.xml
@@ -66,4 +66,5 @@
ADD DATAFILE 'data_2.dat'
INITIAL_SIZE 48M
ENGINE NDB" db-types="MySQL" />
+ <sql-case id="alter_tablespace_with_engine_attribute" value="ALTER TABLESPACE ts1 ENGINE_ATTRIBUTE='{"key":"value"}'" db-types="MySQL" />
</sql-cases>