You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2023/06/02 02:26:48 UTC

[shardingsphere] branch master updated: Change create tablespace syntax (#25535) (#25996)

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 520d136687a Change create tablespace syntax (#25535) (#25996)
520d136687a is described below

commit 520d136687af3b0b383b1eca272058f57a6d3e7b
Author: niu niu <zi...@aliyun.com>
AuthorDate: Fri Jun 2 10:26:40 2023 +0800

    Change create tablespace syntax (#25535) (#25996)
---
 parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DDLStatement.g4   | 1 +
 test/it/parser/src/main/resources/case/ddl/create-tablespace.xml         | 1 +
 .../it/parser/src/main/resources/sql/supported/ddl/create-tablespace.xml | 1 +
 3 files changed, 3 insertions(+)

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 940b368342d..f810d1a6a58 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
@@ -354,6 +354,7 @@ createTablespaceInnodb
       (FILE_BLOCK_SIZE EQ_ fileSizeLiteral)?
       (ENCRYPTION EQ_ y_or_n=string_)?
       (ENGINE EQ_? identifier)?
+      (COMMENT EQ_? string_)?
     ;
 
 createTablespaceNdb
diff --git a/test/it/parser/src/main/resources/case/ddl/create-tablespace.xml b/test/it/parser/src/main/resources/case/ddl/create-tablespace.xml
index 8773ce4c28d..c481b152e12 100644
--- a/test/it/parser/src/main/resources/case/ddl/create-tablespace.xml
+++ b/test/it/parser/src/main/resources/case/ddl/create-tablespace.xml
@@ -17,6 +17,7 @@
   -->
 
 <sql-parser-test-cases>
+    <create-tablespace sql-case-id="create_tablespace_with_comment" />
     <create-tablespace sql-case-id="create_tablespace_with_maxsize" />
     <create-tablespace sql-case-id="create_tablespace_for_innodb" />
     <create-tablespace sql-case-id="create_tablespace_for_myisam" />
diff --git a/test/it/parser/src/main/resources/sql/supported/ddl/create-tablespace.xml b/test/it/parser/src/main/resources/sql/supported/ddl/create-tablespace.xml
index 330cb6e7b46..f0a17e3efd0 100644
--- a/test/it/parser/src/main/resources/sql/supported/ddl/create-tablespace.xml
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/create-tablespace.xml
@@ -17,6 +17,7 @@
   -->
 
 <sql-cases>
+    <sql-case id="create_tablespace_with_comment" value="CREATE TABLESPACE ts1 ADD DATAFILE 'df1.ibd' COMMENT 'tsdolphin'" db-types="MySQL" />
     <sql-case id="create_tablespace_with_maxsize" value="CREATE TABLESPACE ts1 LOCATION '/openGauss/tbspc_test' maxsize=19M" db-types="openGauss" />
     <sql-case id="create_tablespace_for_innodb" value="CREATE TABLESPACE `ts1` ADD DATAFILE '/my/tablespace/directory/ts1.ibd' Engine=InnoDB;" db-types="MySQL" />
     <sql-case id="create_tablespace_for_myisam" value="CREATE TABLESPACE ndb_ts1 ADD DATAFILE 'ndb_ts1.dat' USE LOGFILE GROUP ndb_lg1 MAX_SIZE=10M ENGINE=MyISAM " db-types="MySQL" />