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 8fecd25b9df Add more SQL parser test cases on ClickHouse (#37609)
8fecd25b9df is described below
commit 8fecd25b9dffdece29eecb033ad323e11a0e30cb
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Jan 1 20:50:29 2026 +0800
Add more SQL parser test cases on ClickHouse (#37609)
---
.../src/main/resources/case/dml/clickhouse.xml | 59 ++++++++++++++++++++++
.../resources/sql/supported/dml/clickhouse.xml | 2 +
2 files changed, 61 insertions(+)
diff --git a/test/it/parser/src/main/resources/case/dml/clickhouse.xml
b/test/it/parser/src/main/resources/case/dml/clickhouse.xml
index 4850562a228..15696d1e27d 100644
--- a/test/it/parser/src/main/resources/case/dml/clickhouse.xml
+++ b/test/it/parser/src/main/resources/case/dml/clickhouse.xml
@@ -906,6 +906,65 @@
</from>
</select>
+ <select sql-case-id="clickhouse_select_addition_no_alias">
+ <projections start-index="7" stop-index="18">
+ <expression-projection text="order_id + 1" start-index="7"
stop-index="18">
+ <expr>
+ <binary-operation-expression start-index="7"
stop-index="18">
+ <left>
+ <column name="order_id" start-index="7"
stop-index="14" />
+ </left>
+ <operator>+</operator>
+ <right>
+ <literal-expression value="1" start-index="18"
stop-index="18" />
+ </right>
+ </binary-operation-expression>
+ </expr>
+ </expression-projection>
+ </projections>
+ <from>
+ <simple-table name="t_order" start-index="25" stop-index="31" />
+ </from>
+ </select>
+
+ <select sql-case-id="clickhouse_select_hex_bit_literals">
+ <projections start-index="7" stop-index="7">
+ <shorthand-projection start-index="7" stop-index="7" />
+ </projections>
+ <from>
+ <simple-table name="t_order" start-index="14" stop-index="20" />
+ </from>
+ <where start-index="22" stop-index="63">
+ <expr>
+ <binary-operation-expression start-index="28" stop-index="63">
+ <left>
+ <binary-operation-expression start-index="28"
stop-index="42">
+ <left>
+ <column name="hex_col" start-index="28"
stop-index="34" />
+ </left>
+ <operator>=</operator>
+ <right>
+ <common-expression text="X'1A'"
start-index="38" stop-index="42" />
+ </right>
+ </binary-operation-expression>
+ </left>
+ <operator>AND</operator>
+ <right>
+ <binary-operation-expression start-index="48"
stop-index="63">
+ <left>
+ <column name="bit_col" start-index="48"
stop-index="54" />
+ </left>
+ <operator>=</operator>
+ <right>
+ <common-expression text="B'101'"
start-index="58" stop-index="63" />
+ </right>
+ </binary-operation-expression>
+ </right>
+ </binary-operation-expression>
+ </expr>
+ </where>
+ </select>
+
<update sql-case-id="clickhouse_update_set_default">
<table start-index="7" stop-index="13">
<simple-table name="t_order" start-index="7" stop-index="13" />
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/clickhouse.xml
b/test/it/parser/src/main/resources/sql/supported/dml/clickhouse.xml
index e54e539d389..98541b3b3df 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/clickhouse.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/clickhouse.xml
@@ -44,6 +44,8 @@
<sql-case id="clickhouse_select_or_boolean" value="SELECT * FROM t_order
WHERE status IS TRUE OR amount > 100" db-types="ClickHouse" />
<sql-case id="clickhouse_select_is_false" value="SELECT * FROM t_order
WHERE is_deleted IS FALSE" db-types="ClickHouse" />
<sql-case id="clickhouse_select_parenthesized_right_cross_join"
value="SELECT * FROM (t_order o RIGHT JOIN t_order_item i ON o.order_id =
i.order_id) CROSS JOIN t_user u" db-types="ClickHouse" />
+ <sql-case id="clickhouse_select_addition_no_alias" value="SELECT order_id
+ 1 FROM t_order" db-types="ClickHouse" />
+ <sql-case id="clickhouse_select_hex_bit_literals" value="SELECT * FROM
t_order WHERE hex_col = X'1A' AND bit_col = B'101'" db-types="ClickHouse" />
<sql-case id="clickhouse_update_set_default" value="UPDATE t_order SET
status = DEFAULT WHERE order_id = 1" db-types="ClickHouse" />
<sql-case id="clickhouse_delete_without_where" value="ALTER TABLE t_order
DELETE" db-types="ClickHouse" />
</sql-cases>