You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/08/14 01:56:05 UTC

[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #6812: Some parser grammer about PostgreSQL DAL&DCL

jingshanglu commented on a change in pull request #6812:
URL: https://github.com/apache/shardingsphere/pull/6812#discussion_r470367367



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DDLStatement.g4
##########
@@ -130,8 +130,8 @@ dropDatabase
     : DROP DATABASE (IF EXISTS)? name
     ;
 
-createDatabaseSpecification_
-    :  createdbOptName (EQ_)? (signedIconst | optBooleanOrString | DEFAULT)
+ createDatabaseSpecification_

Review comment:
       keep original format.

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/BaseRule.g4
##########
@@ -1639,3 +1639,114 @@ argClass
 funcArgsList
     : funcArg (COMMA_ funcArg)*
     ;
+
+nonReservedWordOrSconst
+    : nonReservedWord
+    | STRING_
+    ;
+
+fileName
+    : STRING_
+    ;
+
+roleList
+    : roleSpec (COMMA_ roleSpec)*
+    ;
+
+setResetClause
+    : SET setRest
+    | variableResetStmt
+    ;
+
+setRest
+    : TRANSACTION transactionModeList
+    | SESSION CHARACTERISTICS AS TRANSACTION transactionModeList
+    | setRestMore
+    ;
+
+transactionModeList
+    : transactionModeItem ((COMMA_)? transactionModeItem)*
+    ;
+
+transactionModeItem
+    : ISOLATION LEVEL isoLevel
+    | READ ONLY
+    | READ WRITE
+    | DEFERRABLE
+    | NOT DEFERRABLE
+    ;
+
+setRestMore
+    : genericSet
+    | varName FROM CURRENT
+    | TIME ZONE zoneValue
+    | CATALOG STRING_
+    | SCHEMA STRING_
+    | NAMES encoding?
+    | ROLE nonReservedWord | STRING_
+    | SESSION AUTHORIZATION nonReservedWord | STRING_
+    | SESSION AUTHORIZATION DEFAULT
+    | XML OPTION documentOrContent
+    | TRANSACTION SNAPSHOT STRING_
+    ;
+
+encoding
+    : STRING_
+    | DEFAULT
+    ;
+
+genericSet
+    : varName (EQ_|TO) (varList | DEFAULT)
+    ;
+
+variableResetStmt
+    : RESET resetRest
+    ;
+
+resetRest
+    : genericReset
+    | TIME ZONE
+    | TRANSACTION ISOLATION LEVEL
+    | SESSION AUTHORIZATION
+    ;
+
+genericReset
+    : varName
+    | ALL
+    ;
+
+relationExprList
+    : relationExpr (COMMA_ relationExpr)*
+    ;
+
+relationExpr
+    : qualifiedName
+    | qualifiedName ASTERISK_
+    | ONLY qualifiedName
+    | ONLY LP_ qualifiedName RP_
+    ;
+
+commonFuncOptItem
+    : CALLED ON NULL INPUT
+    | RETURNS NULL ON NULL INPUT
+    | STRICT
+    | IMMUTABLE
+    | STABLE
+    | VOLATILE
+    | EXTERNAL SECURITY DEFINER
+    | EXTERNAL SECURITY INVOKER
+    | SECURITY DEFINER
+    | SECURITY INVOKER
+    | LEAKPROOF
+    | NOT LEAKPROOF
+    | COST numericOnly
+    | ROWS numericOnly
+    | SUPPORT anyName
+    | functionSetResetClause
+    | PARALLEL colId
+    ;
+
+functionSetResetClause
+    : SET setRestMore
+    | variableResetStmt
+    ;

Review comment:
       Add a new line at end of file.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org