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 2bde995b752 Rename CommonDistSQLErrorCode to DistSQLErrorCode (#20133)
2bde995b752 is described below
commit 2bde995b752c5f2cc7df64e56e7a02992900a392
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Aug 13 10:16:31 2022 +0800
Rename CommonDistSQLErrorCode to DistSQLErrorCode (#20133)
---
...CommonDistSQLErrorCode.java => DistSQLErrorCode.java} | 16 ++++++++--------
.../proxy/frontend/mysql/err/MySQLErrPacketFactory.java | 4 ++--
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/CommonDistSQLErrorCode.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/DistSQLErrorCode.java
similarity index 76%
rename from
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/CommonDistSQLErrorCode.java
rename to
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/DistSQLErrorCode.java
index 5b6a7da3a74..302018012fb 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/CommonDistSQLErrorCode.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/common/exception/DistSQLErrorCode.java
@@ -22,15 +22,15 @@ import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.error.code.SQLErrorCode;
/**
- * Common dist sql error code.
+ * Dist SQL error code.
*/
@RequiredArgsConstructor
@Getter
-public enum CommonDistSQLErrorCode implements SQLErrorCode {
+public enum DistSQLErrorCode implements SQLErrorCode {
- UNSUPPORTED_VARIABLE(11001, "11001", "Could not support variable [%s]."),
+ UNSUPPORTED_VARIABLE(11001, "11001", "Could not support variable `%s`."),
- INVALID_VALUE(11002, "11002", "Invalid value [%s].");
+ INVALID_VALUE(11002, "11002", "Invalid value `%s`.");
private final int errorCode;
@@ -39,18 +39,18 @@ public enum CommonDistSQLErrorCode implements SQLErrorCode {
private final String errorMessage;
/**
- * Value of common dist sql error code.
+ * Value of Dist SQL error code.
*
* @param exception exception
- * @return common dist sql error code
+ * @return Dist SQL error code
*/
- public static CommonDistSQLErrorCode valueOf(final CommonDistSQLException
exception) {
+ public static DistSQLErrorCode valueOf(final CommonDistSQLException
exception) {
if (exception instanceof UnsupportedVariableException) {
return UNSUPPORTED_VARIABLE;
}
if (exception instanceof InvalidValueException) {
return INVALID_VALUE;
}
- throw new UnsupportedOperationException("Cannot find common dist sql
error code from exception: %s", exception);
+ throw new UnsupportedOperationException("Can not find Dist SQL error
code from exception: %s", exception);
}
}
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 9702695cc65..c76af9a8154 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
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.error.SQLExceptionHandler;
import org.apache.shardingsphere.error.code.StandardSQLErrorCode;
import org.apache.shardingsphere.error.mysql.code.MySQLServerErrorCode;
import
org.apache.shardingsphere.infra.util.exception.inside.ShardingSphereInsideException;
-import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.exception.CommonDistSQLErrorCode;
+import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.exception.DistSQLErrorCode;
import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.exception.CommonDistSQLException;
import
org.apache.shardingsphere.proxy.frontend.exception.FrontendTooManyConnectionsException;
import
org.apache.shardingsphere.proxy.frontend.exception.UnsupportedPreparedStatementException;
@@ -58,7 +58,7 @@ public final class MySQLErrPacketFactory {
}
if (cause instanceof CommonDistSQLException) {
CommonDistSQLException commonDistSQLException =
(CommonDistSQLException) cause;
- return new MySQLErrPacket(1,
CommonDistSQLErrorCode.valueOf(commonDistSQLException),
commonDistSQLException.getVariable());
+ return new MySQLErrPacket(1,
DistSQLErrorCode.valueOf(commonDistSQLException),
commonDistSQLException.getVariable());
}
if (cause instanceof UnsupportedPreparedStatementException) {
return new MySQLErrPacket(1,
MySQLServerErrorCode.ER_UNSUPPORTED_PS);