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 1b7b28ba537 Enhance SQLNodeConverterEngine to support 
'select_with_dollar_parameter_for_postgresql' (#27461)
1b7b28ba537 is described below

commit 1b7b28ba537131d3f2c4e44bb096411bb830ca96
Author: Yunbo Ni <[email protected]>
AuthorDate: Mon Sep 4 16:26:35 2023 +0800

    Enhance SQLNodeConverterEngine to support 
'select_with_dollar_parameter_for_postgresql' (#27461)
    
    * fix: generate params when sqlCase register
    
    * fix: test case
    
    ---------
    
    Co-authored-by: Zhengqiang Duan <[email protected]>
---
 test/it/optimizer/src/test/resources/converter/select.xml               | 1 +
 .../shardingsphere/test/it/sql/parser/internal/cases/sql/SQLCases.java  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/it/optimizer/src/test/resources/converter/select.xml 
b/test/it/optimizer/src/test/resources/converter/select.xml
index 02cd475d2ad..931c59af091 100644
--- a/test/it/optimizer/src/test/resources/converter/select.xml
+++ b/test/it/optimizer/src/test/resources/converter/select.xml
@@ -20,6 +20,7 @@
     <test-cases sql-case-id="select_string_constant_type_cast" 
expected-sql="SELECT CAST('1' AS INTEGER), CAST('2' AS DECIMAL)" 
dbtypes="openGauss,PostgreSQL" />
     <test-cases 
sql-case-id="select_with_database_name_and_schema_name_in_table" 
expected-sql="SELECT &quot;order_id&quot; FROM 
&quot;sharding_db&quot;.&quot;public&quot;.&quot;t_order&quot; WHERE 
&quot;user_id&quot; = ? AND &quot;order_id&quot; = ?" 
db-types="PostgreSQL,openGauss" sql-case-types="PLACEHOLDER" />
     <test-cases 
sql-case-id="select_with_database_name_and_schema_name_in_table" 
expected-sql="SELECT &quot;order_id&quot; FROM 
&quot;sharding_db&quot;.&quot;public&quot;.&quot;t_order&quot; WHERE 
&quot;user_id&quot; = 1 AND &quot;order_id&quot; = 1" 
db-types="PostgreSQL,openGauss" sql-case-types="LITERAL" />
+    <test-cases sql-case-id="select_with_dollar_parameter_for_postgresql" 
expected-sql="SELECT &quot;order_id&quot; FROM &quot;t_order&quot; WHERE 
&quot;user_id&quot; = ? AND &quot;order_id&quot; = ? OR &quot;user_id&quot; = 
?" db-types="PostgreSQL, openGauss" sql-case-types="PLACEHOLDER" />
     <test-cases sql-case-id="select_with_assignment_operator" 
expected-sql="SELECT `rn` := 1, `now_code` := '' FROM `t_order`" 
db-types="MySQL" />
     <test-cases sql-case-id="select_with_assignment_operator_and_keyword" 
expected-sql="SELECT `KEY` := '', `num` := 123 FROM `t_order`" db-types="MySQL" 
/>
     <test-cases sql-case-id="select_with_json_value_return_type" 
expected-sql="SELECT * FROM `t_order` WHERE JSON_VALUE(`items`, '''$.name''' 
'RETURNING' VARCHAR(100)) = 'jack'" db-types="MySQL" />
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/sql/SQLCases.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/sql/SQLCases.java
index d481778339f..5108585965d 100644
--- 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/sql/SQLCases.java
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/sql/SQLCases.java
@@ -80,7 +80,7 @@ public final class SQLCases {
     }
     
     private boolean containsSQLCaseType(final SQLCase sqlCase, final 
SQLCaseType caseType) {
-        return null == sqlCase.getCaseTypes() || 
Splitter.on(',').trimResults().splitToList(sqlCase.getCaseTypes()).contains(caseType.name());
+        return null == sqlCase.getCaseTypes() || 
Splitter.on(',').trimResults().splitToList(sqlCase.getCaseTypes().toUpperCase()).contains(caseType.name());
     }
     
     /**

Reply via email to