You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/04/12 00:20:51 UTC

[shardingsphere] branch master updated: Proofread SQLServer DROP USER Statement (#16745)

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 9e8086694d1 Proofread SQLServer DROP USER Statement (#16745)
9e8086694d1 is described below

commit 9e8086694d1d7722c20c7aff78eec93dc14755d8
Author: Thanoshan MV <48...@users.noreply.github.com>
AuthorDate: Tue Apr 12 05:50:39 2022 +0530

    Proofread SQLServer DROP USER Statement (#16745)
---
 .../src/main/antlr4/imports/sqlserver/DCLStatement.g4                 | 2 +-
 .../visitor/statement/impl/SQLServerDCLStatementSQLVisitor.java       | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DCLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DCLStatement.g4
index e46caa26e06..0853245c58a 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DCLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DCLStatement.g4
@@ -334,7 +334,7 @@ ignoredNameIdentifier
     ;
 
 dropUser
-    : DROP USER
+    : DROP USER (IF EXISTS)? userName
     ;
 
 alterUser
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerDCLStatementSQLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerDCLStatementSQLVisitor.java
index 252ac817388..1a793878367 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerDCLStatementSQLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerDCLStatementSQLVisitor.java
@@ -290,7 +290,9 @@ public final class SQLServerDCLStatementSQLVisitor extends SQLServerStatementSQL
     
     @Override
     public ASTNode visitDropUser(final DropUserContext ctx) {
-        return new SQLServerDropUserStatement();
+        SQLServerDropUserStatement result = new SQLServerDropUserStatement();
+        result.getUsers().add(((UserSegment) visit(ctx.userName())).getUser());
+        return result;
     }
     
     @Override