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 bdfb7f35a32 Rename ShardingSphereVendorError (#20149)
bdfb7f35a32 is described below

commit bdfb7f35a32e89f214565d18d4c75754a6844d2a
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Aug 13 20:00:18 2022 +0800

    Rename ShardingSphereVendorError (#20149)
    
    * Rename ShardingSphereVendorError
    
    * Refactor PostgreSQLVendorError
---
 .../mysql/codec/MySQLPacketCodecEngine.java        |  4 +--
 .../mysql/packet/generic/MySQLErrPacketTest.java   | 24 +++++++-------
 .../codec/OpenGaussPacketCodecEngine.java          |  2 +-
 .../generic/OpenGaussErrorResponsePacketTest.java  |  2 +-
 .../codec/PostgreSQLPacketCodecEngine.java         |  4 +--
 .../generic/PostgreSQLErrorResponsePacket.java     | 18 +++++------
 .../shardingsphere/error/SQLExceptionHandler.java  | 16 +++++-----
 ...orError.java => ShardingSphereVendorError.java} |  4 +--
 ...est.java => ShardingSphereVendorErrorTest.java} | 20 ++++++------
 .../{MyVendorError.java => MySQLVendorError.java}  |  2 +-
 .../error/mysql/mapper/MySQLExceptionMapper.java   | 26 +++++++--------
 ...dorErrorTest.java => MySQLVendorErrorTest.java} | 20 ++++++------
 .../postgresql/code/PostgreSQLVendorError.java     | 37 ++++++++++++++--------
 .../mapper/PostgreSQLExceptionMapper.java          |  4 +--
 .../client/netty/MySQLNegotiateHandlerTest.java    |  4 +--
 ...istVendorError.java => DistSQLVendorError.java} |  4 +--
 .../authentication/MySQLAuthenticationEngine.java  | 14 ++++----
 .../authentication/MySQLAuthenticationHandler.java |  8 ++---
 .../frontend/mysql/err/MySQLErrPacketFactory.java  | 18 +++++------
 .../MySQLAuthenticationEngineTest.java             |  4 +--
 .../MySQLAuthenticationHandlerTest.java            |  8 ++---
 .../opengauss/err/OpenGaussErrorPacketFactory.java | 10 +++---
 .../PostgreSQLUnsupportedCommandExecutor.java      |  2 +-
 .../describe/PostgreSQLComDescribeExecutor.java    |  2 +-
 .../postgresql/err/PostgreSQLErrPacketFactory.java |  2 +-
 .../PostgreSQLComDescribeExecutorTest.java         |  2 +-
 26 files changed, 135 insertions(+), 126 deletions(-)

diff --git 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngine.java
 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngine.java
index a1a3f78c824..23922d53388 100644
--- 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngine.java
+++ 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/main/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngine.java
@@ -25,7 +25,7 @@ import 
org.apache.shardingsphere.db.protocol.codec.DatabasePacketCodecEngine;
 import org.apache.shardingsphere.db.protocol.mysql.packet.MySQLPacket;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket;
 import org.apache.shardingsphere.db.protocol.mysql.payload.MySQLPacketPayload;
-import org.apache.shardingsphere.error.vendor.StandardVendorError;
+import org.apache.shardingsphere.error.vendor.ShardingSphereVendorError;
 
 import java.nio.charset.Charset;
 import java.util.Iterator;
@@ -91,7 +91,7 @@ public final class MySQLPacketCodecEngine implements 
DatabasePacketCodecEngine<M
         } catch (final Exception ex) {
             // CHECKSTYLE:ON
             out.resetWriterIndex();
-            new MySQLErrPacket(1, StandardVendorError.UNKNOWN_EXCEPTION, 
ex.getMessage()).write(payload);
+            new MySQLErrPacket(1, ShardingSphereVendorError.UNKNOWN_EXCEPTION, 
ex.getMessage()).write(payload);
         } finally {
             updateMessageHeader(out, message.getSequenceId());
         }
diff --git 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/generic/MySQLErrPacketTest.java
 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/generic/MySQLErrPacketTest.java
index 4f501940b60..b07197bc58d 100644
--- 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/generic/MySQLErrPacketTest.java
+++ 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/generic/MySQLErrPacketTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.db.protocol.mysql.packet.generic;
 
-import org.apache.shardingsphere.error.mysql.code.MyVendorError;
+import org.apache.shardingsphere.error.mysql.code.MySQLVendorError;
 import org.apache.shardingsphere.db.protocol.mysql.payload.MySQLPacketPayload;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -37,30 +37,30 @@ public final class MySQLErrPacketTest {
     
     @Test
     public void assertNewErrPacketWithServerErrorCode() {
-        MySQLErrPacket actual = new MySQLErrPacket(1, 
MyVendorError.ER_ACCESS_DENIED_ERROR, "root", "localhost", "root");
+        MySQLErrPacket actual = new MySQLErrPacket(1, 
MySQLVendorError.ER_ACCESS_DENIED_ERROR, "root", "localhost", "root");
         assertThat(actual.getSequenceId(), is(1));
-        assertThat(actual.getErrorCode(), 
is(MyVendorError.ER_ACCESS_DENIED_ERROR.getVendorCode()));
-        assertThat(actual.getSqlState(), 
is(MyVendorError.ER_ACCESS_DENIED_ERROR.getSqlState().getValue()));
-        assertThat(actual.getErrorMessage(), 
is(String.format(MyVendorError.ER_ACCESS_DENIED_ERROR.getReason(), "root", 
"localhost", "root")));
+        assertThat(actual.getErrorCode(), 
is(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getVendorCode()));
+        assertThat(actual.getSqlState(), 
is(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getSqlState().getValue()));
+        assertThat(actual.getErrorMessage(), 
is(String.format(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getReason(), "root", 
"localhost", "root")));
     }
     
     @Test
     public void assertNewErrPacketWithPayload() {
         when(payload.readInt1()).thenReturn(1, MySQLErrPacket.HEADER);
-        
when(payload.readInt2()).thenReturn(MyVendorError.ER_ACCESS_DENIED_ERROR.getVendorCode());
+        
when(payload.readInt2()).thenReturn(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getVendorCode());
         when(payload.readStringFix(1)).thenReturn("#");
-        
when(payload.readStringFix(5)).thenReturn(MyVendorError.ER_ACCESS_DENIED_ERROR.getSqlState().getValue());
-        
when(payload.readStringEOF()).thenReturn(String.format(MyVendorError.ER_ACCESS_DENIED_ERROR.getReason(),
 "root", "localhost", "root"));
+        
when(payload.readStringFix(5)).thenReturn(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getSqlState().getValue());
+        
when(payload.readStringEOF()).thenReturn(String.format(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getReason(),
 "root", "localhost", "root"));
         MySQLErrPacket actual = new MySQLErrPacket(payload);
         assertThat(actual.getSequenceId(), is(1));
-        assertThat(actual.getErrorCode(), 
is(MyVendorError.ER_ACCESS_DENIED_ERROR.getVendorCode()));
-        assertThat(actual.getSqlState(), 
is(MyVendorError.ER_ACCESS_DENIED_ERROR.getSqlState().getValue()));
-        assertThat(actual.getErrorMessage(), 
is(String.format(MyVendorError.ER_ACCESS_DENIED_ERROR.getReason(), "root", 
"localhost", "root")));
+        assertThat(actual.getErrorCode(), 
is(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getVendorCode()));
+        assertThat(actual.getSqlState(), 
is(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getSqlState().getValue()));
+        assertThat(actual.getErrorMessage(), 
is(String.format(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getReason(), "root", 
"localhost", "root")));
     }
     
     @Test
     public void assertWrite() {
-        new MySQLErrPacket(1, MyVendorError.ER_NO_DB_ERROR).write(payload);
+        new MySQLErrPacket(1, MySQLVendorError.ER_NO_DB_ERROR).write(payload);
         verify(payload).writeInt1(MySQLErrPacket.HEADER);
         verify(payload).writeInt2(1046);
         verify(payload).writeStringFix("#");
diff --git 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java
 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java
index ef08a319fe8..f7aea187a9b 100644
--- 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java
+++ 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/main/java/org/apache/shardingsphere/db/protocol/opengauss/codec/OpenGaussPacketCodecEngine.java
@@ -120,7 +120,7 @@ public final class OpenGaussPacketCodecEngine implements 
DatabasePacketCodecEngi
             payload.getByteBuf().resetWriterIndex();
             // TODO consider what severity to use
             OpenGaussErrorResponsePacket errorResponsePacket = new 
OpenGaussErrorResponsePacket(
-                    PostgreSQLMessageSeverityLevel.ERROR, 
PostgreSQLVendorError.SYSTEM_ERROR.getErrorCode(), ex.getMessage());
+                    PostgreSQLMessageSeverityLevel.ERROR, 
PostgreSQLVendorError.SYSTEM_ERROR.getSqlState().getValue(), ex.getMessage());
             isPostgreSQLIdentifierPacket = true;
             prepareMessageHeader(out, 
errorResponsePacket.getIdentifier().getValue());
             errorResponsePacket.write(payload);
diff --git 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/test/java/org/apache/shardingsphere/db/protocol/opengauss/packet/command/generic/OpenGaussErrorResponsePacketTest.java
 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/test/java/org/apache/shardingsphere/db/protocol/opengauss/packet/command/generic/OpenGaussErrorResponsePacketTest.java
index dca2a8f22e0..968a0afcfaf 100644
--- 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/test/java/org/apache/shardingsphere/db/protocol/opengauss/packet/command/generic/OpenGaussErrorResponsePacketTest.java
+++ 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-opengauss/src/test/java/org/apache/shardingsphere/db/protocol/opengauss/packet/command/generic/OpenGaussErrorResponsePacketTest.java
@@ -84,7 +84,7 @@ public final class OpenGaussErrorResponsePacketTest {
     private OpenGaussErrorResponsePacket createErrorResponsePacket() {
         Map<Character, String> serverErrorMessages = new LinkedHashMap<>();
         
serverErrorMessages.put(OpenGaussErrorResponsePacket.FIELD_TYPE_SEVERITY, 
PostgreSQLMessageSeverityLevel.FATAL);
-        serverErrorMessages.put(OpenGaussErrorResponsePacket.FIELD_TYPE_CODE, 
PostgreSQLVendorError.INVALID_CATALOG_NAME.getErrorCode());
+        serverErrorMessages.put(OpenGaussErrorResponsePacket.FIELD_TYPE_CODE, 
PostgreSQLVendorError.INVALID_CATALOG_NAME.getSqlState().getValue());
         
serverErrorMessages.put(OpenGaussErrorResponsePacket.FIELD_TYPE_MESSAGE, 
"database \"test\" does not exist");
         
serverErrorMessages.put(OpenGaussErrorResponsePacket.FIELD_TYPE_ERRORCODE, 
"-1");
         
serverErrorMessages.put(OpenGaussErrorResponsePacket.FIELD_TYPE_DETAIL, 
"detail");
diff --git 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
index 59f031f2026..9f1ff7abd36 100644
--- 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
+++ 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/codec/PostgreSQLPacketCodecEngine.java
@@ -117,8 +117,8 @@ public final class PostgreSQLPacketCodecEngine implements 
DatabasePacketCodecEng
             // CHECKSTYLE:ON
             payload.getByteBuf().resetWriterIndex();
             // TODO consider what severity to use
-            PostgreSQLErrorResponsePacket errorResponsePacket = 
PostgreSQLErrorResponsePacket.newBuilder(PostgreSQLMessageSeverityLevel.ERROR, 
PostgreSQLVendorError.SYSTEM_ERROR, ex.getMessage())
-                    .build();
+            PostgreSQLErrorResponsePacket errorResponsePacket = 
PostgreSQLErrorResponsePacket.newBuilder(
+                    PostgreSQLMessageSeverityLevel.ERROR, 
PostgreSQLVendorError.SYSTEM_ERROR, ex.getMessage()).build();
             isPostgreSQLIdentifierPacket = true;
             prepareMessageHeader(out, 
errorResponsePacket.getIdentifier().getValue());
             errorResponsePacket.write(payload);
diff --git 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLErrorResponsePacket.java
 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLErrorResponsePacket.java
index d89ea45870c..6b28ecb09d8 100644
--- 
a/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLErrorResponsePacket.java
+++ 
b/shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/generic/PostgreSQLErrorResponsePacket.java
@@ -106,39 +106,39 @@ public final class PostgreSQLErrorResponsePacket 
implements PostgreSQLIdentifier
      * Create PostgreSQL error response packet builder with required arguments.
      *
      * @param severity severity
-     * @param postgreSQLvendorError PostgreSQL error code
+     * @param vendorError PostgreSQL vendor error
      * @param message message
      * @return PostgreSQL error response packet builder
      * @see <a 
href="https://www.postgresql.org/docs/12/protocol-error-fields.html";>52.8. 
Error and Notice Message Fields</a>
      */
-    public static Builder newBuilder(final String severity, final 
PostgreSQLVendorError postgreSQLvendorError, final String message) {
-        return newBuilder(severity, postgreSQLvendorError.getErrorCode(), 
message);
+    public static Builder newBuilder(final String severity, final 
PostgreSQLVendorError vendorError, final String message) {
+        return newBuilder(severity, vendorError.getSqlState().getValue(), 
message);
     }
     
     /**
      * Create PostgreSQL error response packet builder with required arguments.
      *
      * @param severity severity
-     * @param code code
+     * @param sqlState SQL state
      * @param message message
      * @return PostgreSQL error response packet builder
      * @see <a 
href="https://www.postgresql.org/docs/12/protocol-error-fields.html";>52.8. 
Error and Notice Message Fields</a>
      */
-    public static Builder newBuilder(final String severity, final String code, 
final String message) {
-        return new Builder(severity, code, message);
+    public static Builder newBuilder(final String severity, final String 
sqlState, final String message) {
+        return new Builder(severity, sqlState, message);
     }
     
     public static final class Builder {
         
         private final Map<Character, String> fields = new LinkedHashMap<>(16, 
1);
         
-        private Builder(final String severity, final String code, final String 
message) {
+        private Builder(final String severity, final String sqlState, final 
String message) {
             Preconditions.checkArgument(null != severity, "The severity is 
always present!");
-            Preconditions.checkArgument(!Strings.isNullOrEmpty(code), "The 
SQLSTATE code is always present!");
+            Preconditions.checkArgument(!Strings.isNullOrEmpty(sqlState), "The 
SQLSTATE code is always present!");
             Preconditions.checkArgument(!Strings.isNullOrEmpty(message), "The 
message is always present!");
             fields.put(FIELD_TYPE_SEVERITY, severity);
             fields.put(FIELD_TYPE_SEVERITY_NON_LOCALIZED, severity);
-            fields.put(FIELD_TYPE_CODE, code);
+            fields.put(FIELD_TYPE_CODE, sqlState);
             fields.put(FIELD_TYPE_MESSAGE, message);
         }
         
diff --git 
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/SQLExceptionHandler.java
 
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/SQLExceptionHandler.java
index fe471c00d9f..9567879b4dc 100644
--- 
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/SQLExceptionHandler.java
+++ 
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/SQLExceptionHandler.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.error;
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.shardingsphere.error.vendor.VendorError;
-import org.apache.shardingsphere.error.vendor.StandardVendorError;
+import org.apache.shardingsphere.error.vendor.ShardingSphereVendorError;
 import org.apache.shardingsphere.error.mapper.DialectSQLExceptionMapperFactory;
 import 
org.apache.shardingsphere.infra.config.exception.ShardingSphereConfigurationException;
 import org.apache.shardingsphere.infra.exception.CircuitBreakException;
@@ -53,29 +53,29 @@ public final class SQLExceptionHandler {
         if (insideException instanceof InsideDialectSQLException) {
             return 
DialectSQLExceptionMapperFactory.getInstance(databaseType).convert((InsideDialectSQLException)
 insideException);
         }
-        return convert(insideException).orElseGet(() -> 
toSQLException(StandardVendorError.UNKNOWN_EXCEPTION, 
insideException.getMessage()));
+        return convert(insideException).orElseGet(() -> 
toSQLException(ShardingSphereVendorError.UNKNOWN_EXCEPTION, 
insideException.getMessage()));
     }
     
     private static Optional<SQLException> convert(final 
ShardingSphereInsideException insideException) {
         if (insideException instanceof CircuitBreakException) {
-            return 
Optional.of(toSQLException(StandardVendorError.CIRCUIT_BREAK_MODE));
+            return 
Optional.of(toSQLException(ShardingSphereVendorError.CIRCUIT_BREAK_MODE));
         }
         if (insideException instanceof TableLockWaitTimeoutException) {
             TableLockWaitTimeoutException exception = 
(TableLockWaitTimeoutException) insideException;
-            return 
Optional.of(toSQLException(StandardVendorError.TABLE_LOCK_WAIT_TIMEOUT, 
exception.getTableName(), exception.getSchemaName(), 
exception.getTimeoutMilliseconds()));
+            return 
Optional.of(toSQLException(ShardingSphereVendorError.TABLE_LOCK_WAIT_TIMEOUT, 
exception.getTableName(), exception.getSchemaName(), 
exception.getTimeoutMilliseconds()));
         }
         if (insideException instanceof TableLockedException) {
             TableLockedException exception = (TableLockedException) 
insideException;
-            return 
Optional.of(toSQLException(StandardVendorError.TABLE_LOCKED, 
exception.getTableName(), exception.getSchemaName()));
+            return 
Optional.of(toSQLException(ShardingSphereVendorError.TABLE_LOCKED, 
exception.getTableName(), exception.getSchemaName()));
         }
         if (insideException instanceof RuleNotExistedException || 
insideException instanceof ResourceNotExistedException) {
-            return 
Optional.of(toSQLException(StandardVendorError.RESOURCE_OR_RULE_NOT_EXIST));
+            return 
Optional.of(toSQLException(ShardingSphereVendorError.RESOURCE_OR_RULE_NOT_EXIST));
         }
         if (insideException instanceof ShardingSphereConfigurationException || 
insideException instanceof SQLParsingException) {
-            return 
Optional.of(toSQLException(StandardVendorError.UNSUPPORTED_SQL, 
insideException.getMessage()));
+            return 
Optional.of(toSQLException(ShardingSphereVendorError.UNSUPPORTED_SQL, 
insideException.getMessage()));
         }
         if (insideException instanceof UnsupportedCommandException) {
-            return 
Optional.of(toSQLException(StandardVendorError.UNSUPPORTED_COMMAND, 
((UnsupportedCommandException) insideException).getCommandType()));
+            return 
Optional.of(toSQLException(ShardingSphereVendorError.UNSUPPORTED_COMMAND, 
((UnsupportedCommandException) insideException).getCommandType()));
         }
         return Optional.empty();
     }
diff --git 
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/vendor/StandardVendorError.java
 
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/vendor/ShardingSphereVendorError.java
similarity index 95%
rename from 
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/vendor/StandardVendorError.java
rename to 
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/vendor/ShardingSphereVendorError.java
index 3e9fefc3f01..427f61c51c9 100644
--- 
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/vendor/StandardVendorError.java
+++ 
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/vendor/ShardingSphereVendorError.java
@@ -23,11 +23,11 @@ import org.apache.shardingsphere.error.sqlstate.SQLState;
 import org.apache.shardingsphere.error.sqlstate.XOpenSQLState;
 
 /**
- * Standard vendor error.
+ * ShardingSphere vendor error.
  */
 @RequiredArgsConstructor
 @Getter
-public enum StandardVendorError implements VendorError {
+public enum ShardingSphereVendorError implements VendorError {
     
     CIRCUIT_BREAK_MODE(XOpenSQLState.GENERAL_WARNING, 1000, "Circuit break 
open, the request has been ignored"),
     
diff --git 
a/shardingsphere-error/shardingsphere-common-error/src/test/java/org/apache/shardingsphere/error/vendor/StandardVendorErrorTest.java
 
b/shardingsphere-error/shardingsphere-common-error/src/test/java/org/apache/shardingsphere/error/vendor/ShardingSphereVendorErrorTest.java
similarity index 53%
rename from 
shardingsphere-error/shardingsphere-common-error/src/test/java/org/apache/shardingsphere/error/vendor/StandardVendorErrorTest.java
rename to 
shardingsphere-error/shardingsphere-common-error/src/test/java/org/apache/shardingsphere/error/vendor/ShardingSphereVendorErrorTest.java
index 8556927b0ce..c4b435d868c 100644
--- 
a/shardingsphere-error/shardingsphere-common-error/src/test/java/org/apache/shardingsphere/error/vendor/StandardVendorErrorTest.java
+++ 
b/shardingsphere-error/shardingsphere-common-error/src/test/java/org/apache/shardingsphere/error/vendor/ShardingSphereVendorErrorTest.java
@@ -22,26 +22,26 @@ import org.junit.Test;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 
-public final class StandardVendorErrorTest {
+public final class ShardingSphereVendorErrorTest {
     
     @Test
     public void assertCircuitBreakMode() {
-        
assertThat(StandardVendorError.CIRCUIT_BREAK_MODE.getSqlState().getValue(), 
is("01000"));
-        assertThat(StandardVendorError.CIRCUIT_BREAK_MODE.getVendorCode(), 
is(1000));
-        assertThat(StandardVendorError.CIRCUIT_BREAK_MODE.getReason(), 
is("Circuit break open, the request has been ignored"));
+        
assertThat(ShardingSphereVendorError.CIRCUIT_BREAK_MODE.getSqlState().getValue(),
 is("01000"));
+        
assertThat(ShardingSphereVendorError.CIRCUIT_BREAK_MODE.getVendorCode(), 
is(1000));
+        assertThat(ShardingSphereVendorError.CIRCUIT_BREAK_MODE.getReason(), 
is("Circuit break open, the request has been ignored"));
     }
     
     @Test
     public void assertUnsupportedCommand() {
-        
assertThat(StandardVendorError.UNSUPPORTED_COMMAND.getSqlState().getValue(), 
is("42000"));
-        assertThat(StandardVendorError.UNSUPPORTED_COMMAND.getVendorCode(), 
is(1998));
-        assertThat(StandardVendorError.UNSUPPORTED_COMMAND.getReason(), 
is("Unsupported command: %s"));
+        
assertThat(ShardingSphereVendorError.UNSUPPORTED_COMMAND.getSqlState().getValue(),
 is("42000"));
+        
assertThat(ShardingSphereVendorError.UNSUPPORTED_COMMAND.getVendorCode(), 
is(1998));
+        assertThat(ShardingSphereVendorError.UNSUPPORTED_COMMAND.getReason(), 
is("Unsupported command: %s"));
     }
     
     @Test
     public void assertUnknownException() {
-        
assertThat(StandardVendorError.UNKNOWN_EXCEPTION.getSqlState().getValue(), 
is("42000"));
-        assertThat(StandardVendorError.UNKNOWN_EXCEPTION.getVendorCode(), 
is(1999));
-        assertThat(StandardVendorError.UNKNOWN_EXCEPTION.getReason(), 
is("Unknown exception: %s"));
+        
assertThat(ShardingSphereVendorError.UNKNOWN_EXCEPTION.getSqlState().getValue(),
 is("42000"));
+        
assertThat(ShardingSphereVendorError.UNKNOWN_EXCEPTION.getVendorCode(), 
is(1999));
+        assertThat(ShardingSphereVendorError.UNKNOWN_EXCEPTION.getReason(), 
is("Unknown exception: %s"));
     }
 }
diff --git 
a/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/code/MyVendorError.java
 
b/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/code/MySQLVendorError.java
similarity index 98%
rename from 
shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/code/MyVendorError.java
rename to 
shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/code/MySQLVendorError.java
index 2b14b4309b5..df26e9aa2f7 100644
--- 
a/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/code/MyVendorError.java
+++ 
b/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/code/MySQLVendorError.java
@@ -30,7 +30,7 @@ import org.apache.shardingsphere.error.sqlstate.XOpenSQLState;
  */
 @RequiredArgsConstructor
 @Getter
-public enum MyVendorError implements VendorError {
+public enum MySQLVendorError implements VendorError {
     
     ER_DBACCESS_DENIED_ERROR(XOpenSQLState.SYNTAX_ERROR, 1044, "Access denied 
for user '%s'@'%s' to database '%s'"),
     
diff --git 
a/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLExceptionMapper.java
 
b/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLExceptionMapper.java
index 3d642bf3a02..d5b99faa5bb 100644
--- 
a/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLExceptionMapper.java
+++ 
b/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLExceptionMapper.java
@@ -18,9 +18,9 @@
 package org.apache.shardingsphere.error.mysql.mapper;
 
 import org.apache.shardingsphere.error.vendor.VendorError;
-import org.apache.shardingsphere.error.vendor.StandardVendorError;
+import org.apache.shardingsphere.error.vendor.ShardingSphereVendorError;
 import org.apache.shardingsphere.error.mapper.DialectSQLExceptionMapper;
-import org.apache.shardingsphere.error.mysql.code.MyVendorError;
+import org.apache.shardingsphere.error.mysql.code.MySQLVendorError;
 import 
org.apache.shardingsphere.infra.exception.dialect.DBCreateExistsException;
 import 
org.apache.shardingsphere.infra.exception.dialect.DBDropNotExistsException;
 import 
org.apache.shardingsphere.infra.exception.dialect.InsertColumnsAndValuesMismatchedException;
@@ -42,35 +42,35 @@ public final class MySQLExceptionMapper implements 
DialectSQLExceptionMapper {
     @Override
     public SQLException convert(final InsideDialectSQLException 
dialectSQLException) {
         if (dialectSQLException instanceof TableModifyInTransactionException) {
-            return 
toSQLException(MyVendorError.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE, 
((TableModifyInTransactionException) dialectSQLException).getTableName());
+            return 
toSQLException(MySQLVendorError.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE, 
((TableModifyInTransactionException) dialectSQLException).getTableName());
         }
         if (dialectSQLException instanceof 
InsertColumnsAndValuesMismatchedException) {
-            return toSQLException(MyVendorError.ER_WRONG_VALUE_COUNT_ON_ROW, 
((InsertColumnsAndValuesMismatchedException) 
dialectSQLException).getMismatchedRowNumber());
+            return 
toSQLException(MySQLVendorError.ER_WRONG_VALUE_COUNT_ON_ROW, 
((InsertColumnsAndValuesMismatchedException) 
dialectSQLException).getMismatchedRowNumber());
         }
         if (dialectSQLException instanceof UnknownDatabaseException) {
             return null != ((UnknownDatabaseException) 
dialectSQLException).getDatabaseName()
-                    ? toSQLException(MyVendorError.ER_BAD_DB_ERROR, 
((UnknownDatabaseException) dialectSQLException).getDatabaseName())
-                    : toSQLException(MyVendorError.ER_NO_DB_ERROR);
+                    ? toSQLException(MySQLVendorError.ER_BAD_DB_ERROR, 
((UnknownDatabaseException) dialectSQLException).getDatabaseName())
+                    : toSQLException(MySQLVendorError.ER_NO_DB_ERROR);
         }
         if (dialectSQLException instanceof NoDatabaseSelectedException) {
-            return toSQLException(MyVendorError.ER_NO_DB_ERROR);
+            return toSQLException(MySQLVendorError.ER_NO_DB_ERROR);
         }
         if (dialectSQLException instanceof DBCreateExistsException) {
-            return toSQLException(MyVendorError.ER_DB_CREATE_EXISTS_ERROR, 
((DBCreateExistsException) dialectSQLException).getDatabaseName());
+            return toSQLException(MySQLVendorError.ER_DB_CREATE_EXISTS_ERROR, 
((DBCreateExistsException) dialectSQLException).getDatabaseName());
         }
         if (dialectSQLException instanceof DBDropNotExistsException) {
-            return toSQLException(MyVendorError.ER_DB_DROP_NOT_EXISTS_ERROR, 
((DBDropNotExistsException) dialectSQLException).getDatabaseName());
+            return 
toSQLException(MySQLVendorError.ER_DB_DROP_NOT_EXISTS_ERROR, 
((DBDropNotExistsException) dialectSQLException).getDatabaseName());
         }
         if (dialectSQLException instanceof TableExistsException) {
-            return toSQLException(MyVendorError.ER_TABLE_EXISTS_ERROR, 
((TableExistsException) dialectSQLException).getTableName());
+            return toSQLException(MySQLVendorError.ER_TABLE_EXISTS_ERROR, 
((TableExistsException) dialectSQLException).getTableName());
         }
         if (dialectSQLException instanceof NoSuchTableException) {
-            return toSQLException(MyVendorError.ER_NO_SUCH_TABLE, 
((NoSuchTableException) dialectSQLException).getTableName());
+            return toSQLException(MySQLVendorError.ER_NO_SUCH_TABLE, 
((NoSuchTableException) dialectSQLException).getTableName());
         }
         if (dialectSQLException instanceof TooManyConnectionsException) {
-            return toSQLException(MyVendorError.ER_CON_COUNT_ERROR);
+            return toSQLException(MySQLVendorError.ER_CON_COUNT_ERROR);
         }
-        return toSQLException(StandardVendorError.UNKNOWN_EXCEPTION, 
dialectSQLException.getMessage());
+        return toSQLException(ShardingSphereVendorError.UNKNOWN_EXCEPTION, 
dialectSQLException.getMessage());
     }
     
     private SQLException toSQLException(final VendorError vendorError, final 
Object... messageArguments) {
diff --git 
a/shardingsphere-error/shardingsphere-mysql-error/src/test/java/org/apache/shardingsphere/error/mysql/code/MyVendorErrorTest.java
 
b/shardingsphere-error/shardingsphere-mysql-error/src/test/java/org/apache/shardingsphere/error/mysql/code/MySQLVendorErrorTest.java
similarity index 58%
rename from 
shardingsphere-error/shardingsphere-mysql-error/src/test/java/org/apache/shardingsphere/error/mysql/code/MyVendorErrorTest.java
rename to 
shardingsphere-error/shardingsphere-mysql-error/src/test/java/org/apache/shardingsphere/error/mysql/code/MySQLVendorErrorTest.java
index a5408a68d5f..a716d21a8ef 100644
--- 
a/shardingsphere-error/shardingsphere-mysql-error/src/test/java/org/apache/shardingsphere/error/mysql/code/MyVendorErrorTest.java
+++ 
b/shardingsphere-error/shardingsphere-mysql-error/src/test/java/org/apache/shardingsphere/error/mysql/code/MySQLVendorErrorTest.java
@@ -22,27 +22,27 @@ import org.junit.Test;
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 
-public final class MyVendorErrorTest {
+public final class MySQLVendorErrorTest {
     
     @Test
     public void assertAccessDeniedError() {
-        assertThat(MyVendorError.ER_ACCESS_DENIED_ERROR.getVendorCode(), 
is(1045));
-        
assertThat(MyVendorError.ER_ACCESS_DENIED_ERROR.getSqlState().getValue(), 
is("28000"));
-        assertThat(MyVendorError.ER_ACCESS_DENIED_ERROR.getReason(), 
is("Access denied for user '%s'@'%s' (using password: %s)"));
+        assertThat(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getVendorCode(), 
is(1045));
+        
assertThat(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getSqlState().getValue(), 
is("28000"));
+        assertThat(MySQLVendorError.ER_ACCESS_DENIED_ERROR.getReason(), 
is("Access denied for user '%s'@'%s' (using password: %s)"));
     }
     
     @Test
     public void assertBadDbError() {
-        assertThat(MyVendorError.ER_BAD_DB_ERROR.getVendorCode(), is(1049));
-        assertThat(MyVendorError.ER_BAD_DB_ERROR.getSqlState().getValue(), 
is("42000"));
-        assertThat(MyVendorError.ER_BAD_DB_ERROR.getReason(), is("Unknown 
database '%s'"));
+        assertThat(MySQLVendorError.ER_BAD_DB_ERROR.getVendorCode(), is(1049));
+        assertThat(MySQLVendorError.ER_BAD_DB_ERROR.getSqlState().getValue(), 
is("42000"));
+        assertThat(MySQLVendorError.ER_BAD_DB_ERROR.getReason(), is("Unknown 
database '%s'"));
     }
     
     @Test
     public void assertErrorOnModifyingGtidExecutedTable() {
-        
assertThat(MyVendorError.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE.getVendorCode(),
 is(3176));
-        
assertThat(MyVendorError.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE.getSqlState().getValue(),
 is("HY000"));
-        
assertThat(MyVendorError.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE.getReason(), 
is("Please do not modify the %s table with an XA transaction. "
+        
assertThat(MySQLVendorError.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE.getVendorCode(),
 is(3176));
+        
assertThat(MySQLVendorError.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE.getSqlState().getValue(),
 is("HY000"));
+        
assertThat(MySQLVendorError.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE.getReason(),
 is("Please do not modify the %s table with an XA transaction. "
                 + "This is an internal system table used to store GTIDs for 
committed transactions. "
                 + "Although modifying it can lead to an inconsistent GTID 
state, if necessary you can modify it with a non-XA transaction."));
     }
diff --git 
a/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/code/PostgreSQLVendorError.java
 
b/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/code/PostgreSQLVendorError.java
index bf4c0492212..9d5c94c7bc9 100644
--- 
a/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/code/PostgreSQLVendorError.java
+++ 
b/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/code/PostgreSQLVendorError.java
@@ -19,6 +19,10 @@ package org.apache.shardingsphere.error.postgresql.code;
 
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.error.postgresql.sqlstate.PostgreSQLState;
+import org.apache.shardingsphere.error.sqlstate.SQLState;
+import org.apache.shardingsphere.error.sqlstate.XOpenSQLState;
+import org.apache.shardingsphere.error.vendor.VendorError;
 
 /**
  * PostgreSQL vendor error.
@@ -27,31 +31,36 @@ import lombok.RequiredArgsConstructor;
  */
 @RequiredArgsConstructor
 @Getter
-public enum PostgreSQLVendorError {
+public enum PostgreSQLVendorError implements VendorError {
     
-    SUCCESSFUL_COMPLETION("00000", "successful_completion"),
+    SUCCESSFUL_COMPLETION(XOpenSQLState.SUCCESSFUL_COMPLETION, 
"successful_completion"),
     
-    PRIVILEGE_NOT_GRANTED("01007", "privilege_not_granted"),
+    PRIVILEGE_NOT_GRANTED(XOpenSQLState.PRIVILEGE_NOT_GRANTED, 
"privilege_not_granted"),
     
-    PROTOCOL_VIOLATION("08P01", "protocol_violation"),
+    PROTOCOL_VIOLATION(PostgreSQLState.PROTOCOL_VIOLATION, 
"protocol_violation"),
     
-    FEATURE_NOT_SUPPORTED("0A000", "feature_not_supported"),
+    FEATURE_NOT_SUPPORTED(XOpenSQLState.FEATURE_NOT_SUPPORTED, 
"feature_not_supported"),
     
-    DUPLICATE_DATABASE("42P04", "Database '%s' already exists"),
+    DUPLICATE_DATABASE(PostgreSQLState.DUPLICATE_DATABASE, "Database '%s' 
already exists"),
     
-    INVALID_AUTHORIZATION_SPECIFICATION("28000", 
"invalid_authorization_specification"),
+    
INVALID_AUTHORIZATION_SPECIFICATION(XOpenSQLState.INVALID_AUTHORIZATION_SPECIFICATION,
 "invalid_authorization_specification"),
     
-    INVALID_PASSWORD("28P01", "invalid_password"),
+    INVALID_PASSWORD(PostgreSQLState.INVALID_PASSWORD, "invalid_password"),
     
-    INVALID_CATALOG_NAME("3D000", "invalid_catalog_name"),
+    INVALID_CATALOG_NAME(XOpenSQLState.INVALID_CATALOG_NAME, 
"invalid_catalog_name"),
     
-    UNDEFINED_COLUMN("42703", "undefined_column"),
+    UNDEFINED_COLUMN(PostgreSQLState.UNDEFINED_COLUMN, "undefined_column"),
     
-    TOO_MANY_CONNECTIONS("53300", "too_many_connections"),
+    TOO_MANY_CONNECTIONS(PostgreSQLState.TOO_MANY_CONNECTIONS, 
"too_many_connections"),
     
-    SYSTEM_ERROR("58000", "system_error");
+    SYSTEM_ERROR(PostgreSQLState.SYSTEM_ERROR, "system_error");
     
-    private final String errorCode;
+    private final SQLState sqlState;
     
-    private final String conditionName;
+    private final String reason;
+    
+    @Override
+    public int getVendorCode() {
+        return 0;
+    }
 }
diff --git 
a/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLExceptionMapper.java
 
b/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLExceptionMapper.java
index ef22c6e13d0..17c671f555b 100644
--- 
a/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLExceptionMapper.java
+++ 
b/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLExceptionMapper.java
@@ -49,10 +49,10 @@ public final class PostgreSQLExceptionMapper implements 
DialectSQLExceptionMappe
             return new PSQLException(message, 
PSQLState.INVALID_PARAMETER_VALUE);
         }
         if (dialectSQLException instanceof DBCreateExistsException) {
-            return new 
PSQLException(PostgreSQLVendorError.DUPLICATE_DATABASE.getConditionName(), 
null);
+            return new 
PSQLException(PostgreSQLVendorError.DUPLICATE_DATABASE.getReason(), null);
         }
         if (dialectSQLException instanceof TooManyConnectionsException) {
-            return new 
PSQLException(PostgreSQLVendorError.TOO_MANY_CONNECTIONS.getConditionName(), 
null);
+            return new 
PSQLException(PostgreSQLVendorError.TOO_MANY_CONNECTIONS.getReason(), null);
         }
         return new PSQLException(dialectSQLException.getMessage(), null);
     }
diff --git 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandlerTest.java
 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandlerTest.java
index b4479bd9ed5..096d63ef577 100644
--- 
a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandlerTest.java
+++ 
b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/client/netty/MySQLNegotiateHandlerTest.java
@@ -24,7 +24,7 @@ import io.netty.util.concurrent.Promise;
 import org.apache.shardingsphere.data.pipeline.core.util.ReflectionUtil;
 import org.apache.shardingsphere.data.pipeline.mysql.ingest.client.ServerInfo;
 import 
org.apache.shardingsphere.db.protocol.mysql.constant.MySQLAuthenticationMethod;
-import org.apache.shardingsphere.error.mysql.code.MyVendorError;
+import org.apache.shardingsphere.error.mysql.code.MySQLVendorError;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLOKPacket;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.handshake.MySQLAuthPluginData;
@@ -96,7 +96,7 @@ public final class MySQLNegotiateHandlerTest {
     
     @Test(expected = RuntimeException.class)
     public void assertChannelReadErrorPacket() {
-        MySQLErrPacket errorPacket = new MySQLErrPacket(0, 
MyVendorError.ER_NO_DB_ERROR);
+        MySQLErrPacket errorPacket = new MySQLErrPacket(0, 
MySQLVendorError.ER_NO_DB_ERROR);
         mysqlNegotiateHandler.channelRead(channelHandlerContext, errorPacket);
     }
 }
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/DistVendorError.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/DistSQLVendorError.java
similarity index 93%
rename from 
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/DistVendorError.java
rename to 
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/DistSQLVendorError.java
index 94cde638dfb..71bff33fd01 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/DistVendorError.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/DistSQLVendorError.java
@@ -28,7 +28,7 @@ import org.apache.shardingsphere.error.sqlstate.XOpenSQLState;
  */
 @RequiredArgsConstructor
 @Getter
-public enum DistVendorError implements VendorError {
+public enum DistSQLVendorError implements VendorError {
     
     UNSUPPORTED_VARIABLE(XOpenSQLState.GENERAL_ERROR, 11001, "Could not 
support variable `%s`"),
     
@@ -46,7 +46,7 @@ public enum DistVendorError implements VendorError {
      * @param distSQLException dist SQL exception
      * @return dist SQL error code
      */
-    public static DistVendorError valueOf(final DistSQLException 
distSQLException) {
+    public static DistSQLVendorError valueOf(final DistSQLException 
distSQLException) {
         if (distSQLException instanceof UnsupportedVariableException) {
             return UNSUPPORTED_VARIABLE;
         }
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngine.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngine.java
index 1bcf05d6b29..4357c4b0194 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngine.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngine.java
@@ -24,7 +24,7 @@ import 
org.apache.shardingsphere.db.protocol.mysql.constant.MySQLCapabilityFlag;
 import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLCharacterSet;
 import 
org.apache.shardingsphere.db.protocol.mysql.constant.MySQLConnectionPhase;
 import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLConstants;
-import org.apache.shardingsphere.error.mysql.code.MyVendorError;
+import org.apache.shardingsphere.error.mysql.code.MySQLVendorError;
 import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLStatusFlag;
 import 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.binary.MySQLStatementIDGenerator;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket;
@@ -82,7 +82,7 @@ public final class MySQLAuthenticationEngine implements 
AuthenticationEngine {
         } else if (MySQLConnectionPhase.AUTHENTICATION_METHOD_MISMATCH == 
connectionPhase) {
             authenticationMethodMismatch((MySQLPacketPayload) payload);
         }
-        Optional<MyVendorError> errorCode = 
authenticationHandler.login(currentAuthResult.getUsername(), 
getHostAddress(context), authResponse, currentAuthResult.getDatabase());
+        Optional<MySQLVendorError> errorCode = 
authenticationHandler.login(currentAuthResult.getUsername(), 
getHostAddress(context), authResponse, currentAuthResult.getDatabase());
         context.writeAndFlush(errorCode.isPresent() ? 
createErrorPacket(errorCode.get(), context) : new MySQLOKPacket(++sequenceId, 
DEFAULT_STATUS_FLAG));
         return 
AuthenticationResultBuilder.finished(currentAuthResult.getUsername(), 
getHostAddress(context), currentAuthResult.getDatabase());
     }
@@ -95,7 +95,7 @@ public final class MySQLAuthenticationEngine implements 
AuthenticationEngine {
         
context.channel().attr(CommonConstants.CHARSET_ATTRIBUTE_KEY).set(mySQLCharacterSet.getCharset());
         
context.channel().attr(MySQLConstants.MYSQL_CHARACTER_SET_ATTRIBUTE_KEY).set(mySQLCharacterSet);
         if (!Strings.isNullOrEmpty(packet.getDatabase()) && 
!ProxyContext.getInstance().databaseExists(packet.getDatabase())) {
-            context.writeAndFlush(new MySQLErrPacket(++sequenceId, 
MyVendorError.ER_BAD_DB_ERROR, packet.getDatabase()));
+            context.writeAndFlush(new MySQLErrPacket(++sequenceId, 
MySQLVendorError.ER_BAD_DB_ERROR, packet.getDatabase()));
             return AuthenticationResultBuilder.continued();
         }
         MySQLAuthenticator authenticator = 
authenticationHandler.getAuthenticator(packet.getUsername(), 
getHostAddress(context));
@@ -117,10 +117,10 @@ public final class MySQLAuthenticationEngine implements 
AuthenticationEngine {
         authResponse = packet.getAuthPluginResponse();
     }
     
-    private MySQLErrPacket createErrorPacket(final MyVendorError vendorError, 
final ChannelHandlerContext context) {
-        return MyVendorError.ER_DBACCESS_DENIED_ERROR == vendorError
-                ? new MySQLErrPacket(++sequenceId, 
MyVendorError.ER_DBACCESS_DENIED_ERROR, currentAuthResult.getUsername(), 
getHostAddress(context), currentAuthResult.getDatabase())
-                : new MySQLErrPacket(++sequenceId, 
MyVendorError.ER_ACCESS_DENIED_ERROR, currentAuthResult.getUsername(), 
getHostAddress(context), getErrorMessage());
+    private MySQLErrPacket createErrorPacket(final MySQLVendorError 
vendorError, final ChannelHandlerContext context) {
+        return MySQLVendorError.ER_DBACCESS_DENIED_ERROR == vendorError
+                ? new MySQLErrPacket(++sequenceId, 
MySQLVendorError.ER_DBACCESS_DENIED_ERROR, currentAuthResult.getUsername(), 
getHostAddress(context), currentAuthResult.getDatabase())
+                : new MySQLErrPacket(++sequenceId, 
MySQLVendorError.ER_ACCESS_DENIED_ERROR, currentAuthResult.getUsername(), 
getHostAddress(context), getErrorMessage());
     }
     
     private String getErrorMessage() {
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandler.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandler.java
index cf7450bf731..d8523da57f6 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandler.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandler.java
@@ -18,7 +18,7 @@
 package org.apache.shardingsphere.proxy.frontend.mysql.authentication;
 
 import lombok.Getter;
-import org.apache.shardingsphere.error.mysql.code.MyVendorError;
+import org.apache.shardingsphere.error.mysql.code.MySQLVendorError;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.handshake.MySQLAuthPluginData;
 import org.apache.shardingsphere.infra.executor.check.SQLCheckEngine;
 import org.apache.shardingsphere.infra.metadata.user.Grantee;
@@ -48,14 +48,14 @@ public final class MySQLAuthenticationHandler {
      * @param databaseName database name
      * @return login success or failure
      */
-    public Optional<MyVendorError> login(final String username, final String 
hostname, final byte[] authenticationResponse, final String databaseName) {
+    public Optional<MySQLVendorError> login(final String username, final 
String hostname, final byte[] authenticationResponse, final String 
databaseName) {
         Grantee grantee = new Grantee(username, hostname);
         Collection<ShardingSphereRule> rules = 
ProxyContext.getInstance().getRules(databaseName);
         MySQLAuthenticator authenticator = getAuthenticator(username, 
hostname);
         if (!SQLCheckEngine.check(grantee, (a, b) -> 
authenticator.authenticate((ShardingSphereUser) a, (byte[]) b), 
authenticationResponse, rules)) {
-            return Optional.of(MyVendorError.ER_ACCESS_DENIED_ERROR);
+            return Optional.of(MySQLVendorError.ER_ACCESS_DENIED_ERROR);
         }
-        return null == databaseName || SQLCheckEngine.check(databaseName, 
rules, grantee) ? Optional.empty() : 
Optional.of(MyVendorError.ER_DBACCESS_DENIED_ERROR);
+        return null == databaseName || SQLCheckEngine.check(databaseName, 
rules, grantee) ? Optional.empty() : 
Optional.of(MySQLVendorError.ER_DBACCESS_DENIED_ERROR);
     }
     
     /**
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactory.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactory.java
index 50fa0a167bc..636ddc55275 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactory.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactory.java
@@ -23,10 +23,10 @@ import lombok.NoArgsConstructor;
 import 
org.apache.shardingsphere.data.pipeline.core.exception.PipelineJobNotFoundException;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket;
 import org.apache.shardingsphere.error.SQLExceptionHandler;
-import org.apache.shardingsphere.error.vendor.StandardVendorError;
-import org.apache.shardingsphere.error.mysql.code.MyVendorError;
+import org.apache.shardingsphere.error.vendor.ShardingSphereVendorError;
+import org.apache.shardingsphere.error.mysql.code.MySQLVendorError;
 import 
org.apache.shardingsphere.infra.util.exception.inside.ShardingSphereInsideException;
-import 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.exception.DistVendorError;
+import 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.exception.DistSQLVendorError;
 import 
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.exception.DistSQLException;
 import 
org.apache.shardingsphere.proxy.frontend.exception.UnsupportedPreparedStatementException;
 
@@ -48,7 +48,7 @@ public final class MySQLErrPacketFactory {
     public static MySQLErrPacket newInstance(final Exception cause) {
         if (cause instanceof SQLException) {
             SQLException sqlException = (SQLException) cause;
-            return null == sqlException.getSQLState() ? new MySQLErrPacket(1, 
MyVendorError.ER_INTERNAL_ERROR, getErrorMessage(sqlException))
+            return null == sqlException.getSQLState() ? new MySQLErrPacket(1, 
MySQLVendorError.ER_INTERNAL_ERROR, getErrorMessage(sqlException))
                     : new MySQLErrPacket(1, sqlException.getErrorCode(), 
sqlException.getSQLState(), sqlException.getMessage());
         }
         if (cause instanceof ShardingSphereInsideException) {
@@ -57,18 +57,18 @@ public final class MySQLErrPacketFactory {
         }
         if (cause instanceof DistSQLException) {
             DistSQLException distSQLException = (DistSQLException) cause;
-            return new MySQLErrPacket(1, 
DistVendorError.valueOf(distSQLException), distSQLException.getVariable());
+            return new MySQLErrPacket(1, 
DistSQLVendorError.valueOf(distSQLException), distSQLException.getVariable());
         }
         if (cause instanceof UnsupportedPreparedStatementException) {
-            return new MySQLErrPacket(1, MyVendorError.ER_UNSUPPORTED_PS);
+            return new MySQLErrPacket(1, MySQLVendorError.ER_UNSUPPORTED_PS);
         }
         if (cause instanceof PipelineJobNotFoundException) {
-            return new MySQLErrPacket(1, 
StandardVendorError.SCALING_JOB_NOT_EXIST, ((PipelineJobNotFoundException) 
cause).getJobId());
+            return new MySQLErrPacket(1, 
ShardingSphereVendorError.SCALING_JOB_NOT_EXIST, 
((PipelineJobNotFoundException) cause).getJobId());
         }
         if (cause instanceof UnsupportedCharsetException) {
-            return new MySQLErrPacket(1, 
MyVendorError.ER_UNKNOWN_CHARACTER_SET, cause.getMessage());
+            return new MySQLErrPacket(1, 
MySQLVendorError.ER_UNKNOWN_CHARACTER_SET, cause.getMessage());
         }
-        return new MySQLErrPacket(1, StandardVendorError.UNKNOWN_EXCEPTION, 
cause.getMessage());
+        return new MySQLErrPacket(1, 
ShardingSphereVendorError.UNKNOWN_EXCEPTION, cause.getMessage());
     }
     
     private static String getErrorMessage(final SQLException cause) {
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngineTest.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngineTest.java
index a9a2c587aae..607694ae8f2 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngineTest.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationEngineTest.java
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.db.protocol.CommonConstants;
 import 
org.apache.shardingsphere.db.protocol.mysql.constant.MySQLCapabilityFlag;
 import 
org.apache.shardingsphere.db.protocol.mysql.constant.MySQLConnectionPhase;
 import org.apache.shardingsphere.db.protocol.mysql.constant.MySQLConstants;
-import org.apache.shardingsphere.error.mysql.code.MyVendorError;
+import org.apache.shardingsphere.error.mysql.code.MySQLVendorError;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLOKPacket;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.handshake.MySQLAuthPluginData;
@@ -135,7 +135,7 @@ public final class MySQLAuthenticationEngineTest extends 
ProxyContextRestorer {
         setConnectionPhase(MySQLConnectionPhase.AUTH_PHASE_FAST_PATH);
         ChannelHandlerContext context = getContext();
         setMetaDataContexts();
-        when(authenticationHandler.login(anyString(), any(), any(), 
anyString())).thenReturn(Optional.of(MyVendorError.ER_ACCESS_DENIED_ERROR));
+        when(authenticationHandler.login(anyString(), any(), any(), 
anyString())).thenReturn(Optional.of(MySQLVendorError.ER_ACCESS_DENIED_ERROR));
         authenticationEngine.authenticate(context, getPayload("root", 
"sharding_db", authResponse));
         verify(context).writeAndFlush(any(MySQLErrPacket.class));
     }
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java
index 2c65ebf7985..cf28561aaea 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/authentication/MySQLAuthenticationHandlerTest.java
@@ -24,7 +24,7 @@ import 
org.apache.shardingsphere.authority.model.AuthorityRegistry;
 import org.apache.shardingsphere.authority.rule.AuthorityRule;
 import org.apache.shardingsphere.authority.rule.builder.AuthorityRuleBuilder;
 import 
org.apache.shardingsphere.db.protocol.mysql.constant.MySQLAuthenticationMethod;
-import org.apache.shardingsphere.error.mysql.code.MyVendorError;
+import org.apache.shardingsphere.error.mysql.code.MySQLVendorError;
 import 
org.apache.shardingsphere.db.protocol.mysql.packet.handshake.MySQLAuthPluginData;
 import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
@@ -92,14 +92,14 @@ public final class MySQLAuthenticationHandlerTest extends 
ProxyContextRestorer {
     public void assertLoginWithAbsentUser() {
         initProxyContext(new ShardingSphereUser("root", "root", ""), true);
         byte[] authResponse = {-27, 89, -20, -27, 65, -120, -64, -101, 86, 
-100, -108, -100, 6, -125, -37, 117, 14, -43, 95, -113};
-        assertThat(authenticationHandler.login("root1", "", authResponse, 
"db1").orElse(null), is(MyVendorError.ER_ACCESS_DENIED_ERROR));
+        assertThat(authenticationHandler.login("root1", "", authResponse, 
"db1").orElse(null), is(MySQLVendorError.ER_ACCESS_DENIED_ERROR));
     }
     
     @Test
     public void assertLoginWithIncorrectPassword() {
         initProxyContext(new ShardingSphereUser("root", "root", ""), true);
         byte[] authResponse = {0, 89, -20, -27, 65, -120, -64, -101, 86, -100, 
-108, -100, 6, -125, -37, 117, 14, -43, 95, -113};
-        assertThat(authenticationHandler.login("root", "", authResponse, 
"db1").orElse(null), is(MyVendorError.ER_ACCESS_DENIED_ERROR));
+        assertThat(authenticationHandler.login("root", "", authResponse, 
"db1").orElse(null), is(MySQLVendorError.ER_ACCESS_DENIED_ERROR));
     }
     
     @Test
@@ -113,7 +113,7 @@ public final class MySQLAuthenticationHandlerTest extends 
ProxyContextRestorer {
     public void assertLoginWithUnauthorizedSchema() {
         initProxyContext(new ShardingSphereUser("root", "root", ""), false);
         byte[] authResponse = {-27, 89, -20, -27, 65, -120, -64, -101, 86, 
-100, -108, -100, 6, -125, -37, 117, 14, -43, 95, -113};
-        assertThat(authenticationHandler.login("root", "", authResponse, 
"db11").orElse(null), is(MyVendorError.ER_DBACCESS_DENIED_ERROR));
+        assertThat(authenticationHandler.login("root", "", authResponse, 
"db11").orElse(null), is(MySQLVendorError.ER_DBACCESS_DENIED_ERROR));
     }
     
     @Test
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/err/OpenGaussErrorPacketFactory.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/err/OpenGaussErrorPacketFactory.java
index 25b60765701..62802bc1539 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/err/OpenGaussErrorPacketFactory.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/err/OpenGaussErrorPacketFactory.java
@@ -79,15 +79,15 @@ public final class OpenGaussErrorPacketFactory {
             return 
createErrorResponsePacket(SQLExceptionHandler.convert("PostgreSQL", 
(ShardingSphereInsideException) cause));
         }
         if (cause instanceof InvalidAuthorizationSpecificationException) {
-            return new 
OpenGaussErrorResponsePacket(PostgreSQLMessageSeverityLevel.FATAL, 
PostgreSQLVendorError.INVALID_AUTHORIZATION_SPECIFICATION.getErrorCode(), 
cause.getMessage());
+            return new 
OpenGaussErrorResponsePacket(PostgreSQLMessageSeverityLevel.FATAL, 
PostgreSQLVendorError.INVALID_AUTHORIZATION_SPECIFICATION.getSqlState().getValue(),
 cause.getMessage());
         }
         if (cause instanceof PostgreSQLProtocolViolationException) {
-            return new 
OpenGaussErrorResponsePacket(PostgreSQLMessageSeverityLevel.FATAL, 
PostgreSQLVendorError.PROTOCOL_VIOLATION.getErrorCode(),
+            return new 
OpenGaussErrorResponsePacket(PostgreSQLMessageSeverityLevel.FATAL, 
PostgreSQLVendorError.PROTOCOL_VIOLATION.getSqlState().getValue(),
                     String.format("expected %s response, got message type %s", 
((PostgreSQLProtocolViolationException) cause).getExpectedMessageType(),
                             ((PostgreSQLProtocolViolationException) 
cause).getActualMessageType()));
         }
         if (cause instanceof PostgreSQLAuthenticationException) {
-            return new 
OpenGaussErrorResponsePacket(PostgreSQLMessageSeverityLevel.FATAL, 
((PostgreSQLAuthenticationException) cause).getVendorError().getErrorCode(), 
cause.getMessage());
+            return new 
OpenGaussErrorResponsePacket(PostgreSQLMessageSeverityLevel.FATAL, 
((PostgreSQLAuthenticationException) 
cause).getVendorError().getSqlState().getValue(), cause.getMessage());
         }
         // TODO OpenGauss need consider FrontendConnectionLimitException
         return createErrorResponsePacketForUnknownException(cause);
@@ -106,7 +106,7 @@ public final class OpenGaussErrorPacketFactory {
     
     private static OpenGaussErrorResponsePacket 
createErrorResponsePacket(final SQLException cause) {
         // TODO consider what severity to use
-        String sqlState = Strings.isNullOrEmpty(cause.getSQLState()) ? 
PostgreSQLVendorError.SYSTEM_ERROR.getErrorCode() : cause.getSQLState();
+        String sqlState = Strings.isNullOrEmpty(cause.getSQLState()) ? 
PostgreSQLVendorError.SYSTEM_ERROR.getSqlState().getValue() : 
cause.getSQLState();
         String message = Strings.isNullOrEmpty(cause.getMessage()) ? 
cause.toString() : cause.getMessage();
         return new 
OpenGaussErrorResponsePacket(PostgreSQLMessageSeverityLevel.ERROR, sqlState, 
message);
     }
@@ -118,6 +118,6 @@ public final class OpenGaussErrorPacketFactory {
     private static OpenGaussErrorResponsePacket 
createErrorResponsePacketForUnknownException(final Exception cause) {
         // TODO add FIELD_TYPE_CODE for common error and consider what 
severity to use
         String message = Strings.isNullOrEmpty(cause.getLocalizedMessage()) ? 
cause.toString() : cause.getLocalizedMessage();
-        return new 
OpenGaussErrorResponsePacket(PostgreSQLMessageSeverityLevel.ERROR, 
PostgreSQLVendorError.SYSTEM_ERROR.getErrorCode(), message);
+        return new 
OpenGaussErrorResponsePacket(PostgreSQLMessageSeverityLevel.ERROR, 
PostgreSQLVendorError.SYSTEM_ERROR.getSqlState().getValue(), message);
     }
 }
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/generic/PostgreSQLUnsupportedCommandExecutor.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/generic/PostgreSQLUnsupportedCommandExecutor.java
index eafedf78431..59c4550706c 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/generic/PostgreSQLUnsupportedCommandExecutor.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/generic/PostgreSQLUnsupportedCommandExecutor.java
@@ -37,7 +37,7 @@ public final class PostgreSQLUnsupportedCommandExecutor 
implements CommandExecut
     public Collection<DatabasePacket<?>> execute() {
         // TODO consider what severity and error code to use
         PostgreSQLErrorResponsePacket packet = 
PostgreSQLErrorResponsePacket.newBuilder(PostgreSQLMessageSeverityLevel.ERROR, 
PostgreSQLVendorError.FEATURE_NOT_SUPPORTED,
-                
PostgreSQLVendorError.FEATURE_NOT_SUPPORTED.getConditionName()).build();
+                
PostgreSQLVendorError.FEATURE_NOT_SUPPORTED.getReason()).build();
         return Collections.singletonList(packet);
     }
 }
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutor.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutor.java
index 400835f13f2..f77a0e9e7c5 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutor.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutor.java
@@ -164,7 +164,7 @@ public final class PostgreSQLComDescribeExecutor implements 
CommandExecutor {
                 }
                 if (null == column) {
                     String reason = String.format("Column \"%s\" of relation 
\"%s\" does not exist. Please check the SQL or execute REFRESH TABLE 
METADATA.", columnName, logicTableName);
-                    throw new SQLException(reason, 
PostgreSQLVendorError.UNDEFINED_COLUMN.getErrorCode());
+                    throw new SQLException(reason, 
PostgreSQLVendorError.UNDEFINED_COLUMN.getSqlState().getValue());
                 }
                 PostgreSQLColumnType parameterType = 
PostgreSQLColumnType.valueOfJDBCType(column.getDataType());
                 
preparedStatement.getParameterTypes().set(parameterMarkerIndex++, 
parameterType);
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/err/PostgreSQLErrPacketFactory.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/err/PostgreSQLErrPacketFactory.java
index 1439328e99a..8cea647df59 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/err/PostgreSQLErrPacketFactory.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/err/PostgreSQLErrPacketFactory.java
@@ -73,7 +73,7 @@ public final class PostgreSQLErrPacketFactory {
     
     private static PostgreSQLErrorResponsePacket 
createErrorResponsePacket(final SQLException cause) {
         // TODO consider what severity to use
-        String sqlState = Strings.isNullOrEmpty(cause.getSQLState()) ? 
PostgreSQLVendorError.SYSTEM_ERROR.getErrorCode() : cause.getSQLState();
+        String sqlState = Strings.isNullOrEmpty(cause.getSQLState()) ? 
PostgreSQLVendorError.SYSTEM_ERROR.getSqlState().getValue() : 
cause.getSQLState();
         String message = Strings.isNullOrEmpty(cause.getMessage()) ? 
cause.toString() : cause.getMessage();
         return 
PostgreSQLErrorResponsePacket.newBuilder(PostgreSQLMessageSeverityLevel.ERROR, 
sqlState, message).build();
     }
diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutorTest.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutorTest.java
index 56fe434766e..c1bd7e3c999 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutorTest.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/test/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/describe/PostgreSQLComDescribeExecutorTest.java
@@ -233,7 +233,7 @@ public final class PostgreSQLComDescribeExecutorTest 
extends ProxyContextRestore
         } catch (final SQLException ex) {
             actual = ex;
         }
-        assertThat(actual.getSQLState(), 
is(PostgreSQLVendorError.UNDEFINED_COLUMN.getErrorCode()));
+        assertThat(actual.getSQLState(), 
is(PostgreSQLVendorError.UNDEFINED_COLUMN.getSqlState().getValue()));
         assertThat(actual.getMessage(), is("Column \"undefined_column\" of 
relation \"t_order\" does not exist. Please check the SQL or execute REFRESH 
TABLE METADATA."));
     }
     

Reply via email to