This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 e35f31eea4c Add SQL parser test cases for MySQL (#37839)
e35f31eea4c is described below
commit e35f31eea4c9ae98b9f372d8a05673adcd92f97f
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Jan 25 21:28:48 2026 +0800
Add SQL parser test cases for MySQL (#37839)
---
test/it/parser/src/main/resources/case/dal/kill.xml | 1 +
.../resources/case/dml/select-special-function.xml | 18 ++++++++++++++++++
.../src/main/resources/sql/supported/dal/kill.xml | 1 +
.../sql/supported/dml/select-special-function.xml | 1 +
4 files changed, 21 insertions(+)
diff --git a/test/it/parser/src/main/resources/case/dal/kill.xml
b/test/it/parser/src/main/resources/case/dal/kill.xml
index c7386e7b6bf..4769920ca7c 100644
--- a/test/it/parser/src/main/resources/case/dal/kill.xml
+++ b/test/it/parser/src/main/resources/case/dal/kill.xml
@@ -19,6 +19,7 @@
<sql-parser-test-cases>
<kill sql-case-id="kill_process_id" process-id="abc" />
<kill sql-case-id="kill_process_with_id" process-id="@id" />
+ <kill sql-case-id="kill_connection_with_identifier_mysql"
process-id="job_session" />
<kill sql-case-id="kill_connection_with_numeric_id" process-id="16" />
<kill sql-case-id="kill_query_with_numeric_id" process-id="16" />
<kill sql-case-id="kill_with_numeric_id" process-id="16" />
diff --git
a/test/it/parser/src/main/resources/case/dml/select-special-function.xml
b/test/it/parser/src/main/resources/case/dml/select-special-function.xml
index b3a5cfcdd7f..1b147a74e97 100644
--- a/test/it/parser/src/main/resources/case/dml/select-special-function.xml
+++ b/test/it/parser/src/main/resources/case/dml/select-special-function.xml
@@ -2364,6 +2364,24 @@
</projections>
</select>
+ <select sql-case-id="select_convert_function_using_binary">
+ <projections start-index="7" stop-index="33">
+ <expression-projection text="CONVERT('abc' USING BINARY)"
start-index="7" stop-index="33">
+ <expr>
+ <function function-name="CONVERT" start-index="7"
stop-index="33" text="CONVERT('abc' USING BINARY)">
+ <parameter>
+ <literal-expression value="abc" start-index="15"
stop-index="19" />
+ <using-character-set text="USING BINARY"
start-index="20" stop-index="33" />
+ </parameter>
+ <parameter start-index="27" stop-index="32">
+ <literal-expression value="BINARY"
start-index="27" stop-index="32"/>
+ </parameter>
+ </function>
+ </expr>
+ </expression-projection>
+ </projections>
+ </select>
+
<select sql-case-id="select_convert_tz_function">
<projections start-index="7" stop-index="51">
<expression-projection text="CONVERT_TZ('2004-01-01
12:00:00','GMT','MET')" start-index="7" stop-index="51">
diff --git a/test/it/parser/src/main/resources/sql/supported/dal/kill.xml
b/test/it/parser/src/main/resources/sql/supported/dal/kill.xml
index 54605250e63..c4964bd1a7f 100644
--- a/test/it/parser/src/main/resources/sql/supported/dal/kill.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dal/kill.xml
@@ -19,6 +19,7 @@
<sql-cases>
<sql-case id="kill_process_id" value="KILL abc" db-types="MySQL" />
<sql-case id="kill_process_with_id" value="KILL QUERY @id"
db-types="MySQL" />
+ <sql-case id="kill_connection_with_identifier_mysql" value="KILL
CONNECTION job_session" db-types="MySQL" />
<sql-case id="kill_connection_with_numeric_id" value="KILL CONNECTION 16"
db-types="Doris" />
<sql-case id="kill_query_with_numeric_id" value="KILL QUERY 16"
db-types="Doris" />
<sql-case id="kill_with_numeric_id" value="KILL 16" db-types="Doris" />
diff --git
a/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml
b/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml
index a68dfb3eb93..625a89312a4 100644
---
a/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml
+++
b/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml
@@ -25,6 +25,7 @@
<sql-case id="select_cast" value="SELECT CAST(c AT TIME ZONE 'UTC' AS
DATETIME)" db-types="MySQL" />
<sql-case id="select_cast_multiset" value="select CAST(MULTISET(SELECT
cust_address FROM customers c WHERE c.customer_id = cd.customer_id) as
cust_address_tab_typ) from customer;" db-types="Oracle" />
<sql-case id="select_convert_function" value="SELECT CONVERT('2020-10-01',
DATE)" db-types="MySQL" />
+ <sql-case id="select_convert_function_using_binary" value="SELECT
CONVERT('abc' USING BINARY)" db-types="MySQL" />
<sql-case id="select_position" value="SELECT POSITION('bar' IN
'foobarbar')" db-types="MySQL,Doris,Hive" />
<sql-case id="select_substring" value="SELECT SUBSTRING('foobarbar' from
-4 for 2)" db-types="MySQL" />
<sql-case id="select_substr" value="SELECT SUBSTR('foobarbar' from 4)"
db-types="MySQL,Presto" />