You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2021/05/09 12:50:41 UTC

[shardingsphere] branch master updated: fix PG show syntax conflicting with DistSQL (#10277)

This is an automated email from the ASF dual-hosted git repository.

panjuan 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 c35fef5  fix PG show syntax conflicting with DistSQL (#10277)
c35fef5 is described below

commit c35fef5a32a425746f76528de5be159670a163fb
Author: Zhengqiang Duan <st...@gmail.com>
AuthorDate: Sun May 9 20:50:18 2021 +0800

    fix PG show syntax conflicting with DistSQL (#10277)
    
    * fix pg show syntax conflicting with DistSQL
    
    * add test case for show statement parse conflict
    
    * modify test case
---
 .../src/main/antlr4/imports/postgresql/DALStatement.g4                  | 2 +-
 .../src/main/resources/sql/unsupported/unsupported.xml                  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DALStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DALStatement.g4
index f9a3c7c..b7846db 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DALStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DALStatement.g4
@@ -20,7 +20,7 @@ grammar DALStatement;
 import Symbol, Keyword, PostgreSQLKeyword, Literals, BaseRule, DMLStatement, DDLStatement;
 
 show
-    : SHOW (varName | TIME ZONE | TRANSACTION ISOLATION LEVEL | SESSION AUTHORIZATION | ALL)
+    : SHOW (varName | TIME ZONE | TRANSACTION ISOLATION LEVEL | SESSION AUTHORIZATION | ALL) EOF
     ;
 
 set
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/unsupported/unsupported.xml b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/unsupported/unsupported.xml
index 96f8b30..8bfebe4 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/unsupported/unsupported.xml
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/sql/unsupported/unsupported.xml
@@ -43,4 +43,5 @@
     <!--<sql-case id="assertSelectWithMatchAgainstWithParameterMarker" value="SELECT * FROM TABLE_XXX WHERE MATCH(TABLE_XXX.COLUMN_XXX) AGAINST (? IN NATURAL LANGUAGE MODE)" db-types="MySQL" />-->
     <!--<sql-case id="assertSelectLikeConcatWithParameterMarker" value="SELECT * FROM TABLE_XXX WHERE COLUMN_XXX LIKE CONCAT('%%', ?, '%%')" />-->
     <!--<sql-case id="assertSelectGeographyWithParameterMarker" value="SELECT * FROM t_order WHERE rule BETWEEN ?::jsonb AND ?::jsonb AND start_point=ST_GeographyFromText('SRID=4326;POINT('||?||' '||?||')') AND order_id = ?" db-types="PostgreSQL" />-->
+    <sql-case id="assertDistSQLShowRuleParseConflict" value="SHOW REPLICA_QUERY RULE FROM schema_name" />
 </sql-cases>