You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ma...@apache.org on 2022/09/09 16:15:03 UTC

[shardingsphere] branch master updated: Refactor UnsupportedCommandException (#20909)

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

machen 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 0e00ae0ffec Refactor UnsupportedCommandException (#20909)
0e00ae0ffec is described below

commit 0e00ae0ffec9f805a44d282158f52aee7b693ce7
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Sep 10 00:14:53 2022 +0800

    Refactor UnsupportedCommandException (#20909)
---
 docs/document/content/user-manual/error-code/sql-error-code.cn.md   | 2 +-
 docs/document/content/user-manual/error-code/sql-error-code.en.md   | 2 +-
 .../proxy/frontend/exception/UnsupportedCommandException.java       | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/docs/document/content/user-manual/error-code/sql-error-code.cn.md b/docs/document/content/user-manual/error-code/sql-error-code.cn.md
index 33d5c3008ec..279f9ae0fc2 100644
--- a/docs/document/content/user-manual/error-code/sql-error-code.cn.md
+++ b/docs/document/content/user-manual/error-code/sql-error-code.cn.md
@@ -34,7 +34,6 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
 | 25000     | 11321       | JDBC does not support operations across multiple logical databases in transaction |
 | 25000     | 11322       | Failed to create \`%s\` XA data source |
 | 25000     | 11323       | Can not start new XA transaction in a active transaction |
-| 42000     | 12000       | Unsupported command: %s |
 | 44000     | 13000       | SQL check failed, error message: %s |
 | HY000     | 14000       | The table \`%s\` of schema \`%s\` is locked |
 | HY000     | 14001       | The table \`%s\` of schema \`%s\` lock wait timeout of %s ms exceeded |
@@ -95,3 +94,4 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
 | 42000     | 28001       | Insert value of index \`%s\` can not support for shadow |
 | HY004     | 30000       | Unknown exception: %s |
 | 0A000     | 30001       | Unsupported operation: %s |
+| 42000     | 30002       | Unsupported command: %s |
diff --git a/docs/document/content/user-manual/error-code/sql-error-code.en.md b/docs/document/content/user-manual/error-code/sql-error-code.en.md
index c4c2cad3453..b8cc35fe547 100644
--- a/docs/document/content/user-manual/error-code/sql-error-code.en.md
+++ b/docs/document/content/user-manual/error-code/sql-error-code.en.md
@@ -34,7 +34,6 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
 | 25000     | 11321       | JDBC does not support operations across multiple logical databases in transaction |
 | 25000     | 11322       | Failed to create \`%s\` XA data source |
 | 25000     | 11323       | Can not start new XA transaction in a active transaction |
-| 42000     | 12000       | Unsupported command: %s |
 | 44000     | 13000       | SQL check failed, error message: %s |
 | HY000     | 14000       | The table \`%s\` of schema \`%s\` is locked |
 | HY000     | 14001       | The table \`%s\` of schema \`%s\` lock wait timeout of %s ms exceeded |
@@ -95,3 +94,4 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
 | 42000     | 28001       | Insert value of index \`%s\` can not support for shadow |
 | HY004     | 30000       | Unknown exception: %s |
 | 0A000     | 30001       | Unsupported operation: %s |
+| 42000     | 30002       | Unsupported command: %s |
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/UnsupportedCommandException.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/UnsupportedCommandException.java
index b0c0837b8aa..cd60c0c4e2c 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/UnsupportedCommandException.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/exception/UnsupportedCommandException.java
@@ -17,17 +17,17 @@
 
 package org.apache.shardingsphere.proxy.frontend.exception;
 
-import org.apache.shardingsphere.infra.util.exception.external.sql.type.kernel.KernelSQLException;
 import org.apache.shardingsphere.infra.util.exception.external.sql.sqlstate.XOpenSQLState;
+import org.apache.shardingsphere.infra.util.exception.external.sql.type.generic.GenericSQLException;
 
 /**
  * Unsupported command exception.
  */
-public final class UnsupportedCommandException extends KernelSQLException {
+public final class UnsupportedCommandException extends GenericSQLException {
     
     private static final long serialVersionUID = 8010680371699936338L;
     
     public UnsupportedCommandException(final String commandType) {
-        super(XOpenSQLState.SYNTAX_ERROR, 2000, "Unsupported command: %s", commandType);
+        super(XOpenSQLState.SYNTAX_ERROR, 2, "Unsupported command: %s", commandType);
     }
 }