This is an automated email from the ASF dual-hosted git repository.
menghaoran 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 c12f35d7f4a Remove SQLExceptionHandler (#20205)
c12f35d7f4a is described below
commit c12f35d7f4ac9aee7d0e385ce2e9b4ebd5a85cf3
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Aug 15 23:58:32 2022 +0800
Remove SQLExceptionHandler (#20205)
---
.../shardingsphere/error/SQLExceptionHandler.java | 52 ----------------------
.../SQLDialectException.java | 2 +-
.../connection/TooManyConnectionsException.java | 4 +-
.../InsertColumnsAndValuesMismatchedException.java | 4 +-
.../data/InvalidParameterValueException.java | 4 +-
.../database/DatabaseCreateExistsException.java | 4 +-
.../database/DatabaseDropNotExistsException.java | 4 +-
.../database/NoDatabaseSelectedException.java | 4 +-
.../syntax/database/UnknownDatabaseException.java | 4 +-
.../syntax/table/NoSuchTableException.java | 4 +-
.../syntax/table/TableExistsException.java | 4 +-
.../transaction/InTransactionException.java | 4 +-
.../TableModifyInTransactionException.java | 4 +-
.../error/mapper/SQLDialectExceptionMapper.java | 2 +-
.../mysql/mapper/MySQLDialectExceptionMapper.java | 20 ++++-----
.../mapper/PostgreSQLDialectExceptionMapper.java | 12 ++---
.../impl/InsertClauseShardingConditionEngine.java | 2 +-
.../ddl/ShardingDDLStatementValidator.java | 4 +-
.../InsertClauseShardingConditionEngineTest.java | 2 +-
...ardingCreateFunctionStatementValidatorTest.java | 4 +-
.../ShardingCreateIndexStatementValidatorTest.java | 2 +-
...rdingCreateProcedureStatementValidatorTest.java | 4 +-
.../ShardingCreateTableStatementValidatorTest.java | 2 +-
.../statement/dml/InsertStatementContext.java | 4 +-
.../statement/dml/SelectStatementContext.java | 4 +-
.../backend/communication/ProxySQLExecutor.java | 2 +-
.../communication/ReactiveProxySQLExecutor.java | 2 +-
.../proxy/backend/context/ProxyContext.java | 2 +-
.../handler/DatabaseRequiredBackendHandler.java | 4 +-
.../mysql/executor/ShowCreateDatabaseExecutor.java | 2 +-
.../executor/UnicastResourceShowExecutor.java | 2 +-
.../admin/mysql/executor/UseDatabaseExecutor.java | 2 +-
.../executor/PostgreSQLSetCharsetExecutor.java | 2 +-
.../data/impl/UnicastDatabaseBackendHandler.java | 2 +-
.../database/CreateDatabaseBackendHandler.java | 2 +-
.../database/DropDatabaseBackendHandler.java | 4 +-
.../ExportDatabaseConfigurationHandler.java | 4 +-
...ShowReadwriteSplittingReadResourcesHandler.java | 4 +-
.../ral/queryable/ShowTableMetadataHandler.java | 4 +-
.../ral/updatable/RefreshTableMetadataHandler.java | 4 +-
.../SetReadwriteSplittingStatusHandler.java | 4 +-
.../handler/distsql/rul/sql/PreviewHandler.java | 4 +-
.../transaction/TransactionBackendHandler.java | 2 +-
.../communication/ProxySQLExecutorTest.java | 2 +-
.../proxy/backend/context/ProxyContextTest.java | 2 +-
.../DatabaseOperateBackendHandlerFactoryTest.java | 2 +-
.../mysql/executor/UseDatabaseExecutorTest.java | 2 +-
.../database/CreateDatabaseBackendHandlerTest.java | 2 +-
.../database/DropDatabaseBackendHandlerTest.java | 2 +-
.../ExportDatabaseConfigurationHandlerTest.java | 4 +-
.../FrontendChannelLimitationInboundHandler.java | 2 +-
.../frontend/exception/ExpectedExceptionsTest.java | 2 +-
.../admin/initdb/MySQLComInitDbExecutor.java | 2 +-
.../frontend/mysql/err/MySQLErrPacketFactory.java | 13 ++++--
.../mysql/err/MySQLErrPacketFactoryTest.java | 14 +++---
.../opengauss/OpenGaussFrontendEngine.java | 2 +-
.../opengauss/err/OpenGaussErrorPacketFactory.java | 12 +++--
.../postgresql/PostgreSQLFrontendEngine.java | 2 +-
.../postgresql/err/PostgreSQLErrPacketFactory.java | 12 +++--
.../test/integration/engine/ddl/BaseDDLIT.java | 2 +-
.../cases/truncate/MySQLXATruncateTestCase.java | 2 +-
61 files changed, 127 insertions(+), 166 deletions(-)
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
deleted file mode 100644
index e9d957b03e6..00000000000
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/SQLExceptionHandler.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.error;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
-import org.apache.shardingsphere.error.mapper.SQLDialectExceptionMapperFactory;
-import
org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;
-import
org.apache.shardingsphere.infra.util.exception.sql.ShardingSphereSQLException;
-import org.apache.shardingsphere.infra.util.exception.sql.UnknownSQLException;
-
-import java.sql.SQLException;
-
-/**
- * SQL exception handler.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class SQLExceptionHandler {
-
- /**
- * Convert to SQL exception.
- *
- * @param databaseType database type
- * @param insideException inside exception
- * @return SQL exception
- */
- public static SQLException convert(final String databaseType, final
ShardingSphereInsideException insideException) {
- if (insideException instanceof SQLDialectException) {
- return
SQLDialectExceptionMapperFactory.getInstance(databaseType).convert((SQLDialectException)
insideException);
- }
- if (insideException instanceof ShardingSphereSQLException) {
- return ((ShardingSphereSQLException)
insideException).toSQLException();
- }
- return new UnknownSQLException(insideException).toSQLException();
- }
-}
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/SQLDialectException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/SQLDialectException.java
similarity index 95%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/SQLDialectException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/SQLDialectException.java
index 8bddf4454f9..bad4e22c94a 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/SQLDialectException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/SQLDialectException.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect;
+package org.apache.shardingsphere.error.exception;
import
org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/connection/TooManyConnectionsException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/connection/TooManyConnectionsException.java
similarity index 88%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/connection/TooManyConnectionsException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/connection/TooManyConnectionsException.java
index 8de451da6bb..ac7da53764a 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/connection/TooManyConnectionsException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/connection/TooManyConnectionsException.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect.connection;
+package org.apache.shardingsphere.error.exception.connection;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
/**
* Too many connections exception.
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/data/InsertColumnsAndValuesMismatchedException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/data/InsertColumnsAndValuesMismatchedException.java
similarity index 90%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/data/InsertColumnsAndValuesMismatchedException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/data/InsertColumnsAndValuesMismatchedException.java
index 804341d9c6a..4f3957b886f 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/data/InsertColumnsAndValuesMismatchedException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/data/InsertColumnsAndValuesMismatchedException.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect.data;
+package org.apache.shardingsphere.error.exception.data;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
/**
* Insert columns and values mismatched exception.
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/data/InvalidParameterValueException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/data/InvalidParameterValueException.java
similarity index 90%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/data/InvalidParameterValueException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/data/InvalidParameterValueException.java
index 20d27002cd2..5adf4933295 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/data/InvalidParameterValueException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/data/InvalidParameterValueException.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect.data;
+package org.apache.shardingsphere.error.exception.data;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
/**
* Invalid parameter value exception.
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/DatabaseCreateExistsException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/DatabaseCreateExistsException.java
similarity index 89%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/DatabaseCreateExistsException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/DatabaseCreateExistsException.java
index f284d043aab..dc08d0247ea 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/DatabaseCreateExistsException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/DatabaseCreateExistsException.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect.syntax.database;
+package org.apache.shardingsphere.error.exception.syntax.database;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
/**
* Database create exists exception.
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/DatabaseDropNotExistsException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/DatabaseDropNotExistsException.java
similarity index 89%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/DatabaseDropNotExistsException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/DatabaseDropNotExistsException.java
index 3653ab6a7dc..c23a2779977 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/DatabaseDropNotExistsException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/DatabaseDropNotExistsException.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect.syntax.database;
+package org.apache.shardingsphere.error.exception.syntax.database;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
/**
* Database drop exists exception.
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/NoDatabaseSelectedException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/NoDatabaseSelectedException.java
similarity index 87%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/NoDatabaseSelectedException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/NoDatabaseSelectedException.java
index 3627d42d4cf..ba6684ffc3c 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/NoDatabaseSelectedException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/NoDatabaseSelectedException.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect.syntax.database;
+package org.apache.shardingsphere.error.exception.syntax.database;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
/**
* No database selected exception.
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/UnknownDatabaseException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/UnknownDatabaseException.java
similarity index 89%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/UnknownDatabaseException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/UnknownDatabaseException.java
index 1f1bb3600bd..05c181f7082 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/database/UnknownDatabaseException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/database/UnknownDatabaseException.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect.syntax.database;
+package org.apache.shardingsphere.error.exception.syntax.database;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
/**
* Unknown database exception.
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/table/NoSuchTableException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/table/NoSuchTableException.java
similarity index 89%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/table/NoSuchTableException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/table/NoSuchTableException.java
index 05ed2422ab9..b29fbf93c5b 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/table/NoSuchTableException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/table/NoSuchTableException.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect.syntax.table;
+package org.apache.shardingsphere.error.exception.syntax.table;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
/**
* No such table exception.
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/table/TableExistsException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/table/TableExistsException.java
similarity index 89%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/table/TableExistsException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/table/TableExistsException.java
index e21eeeb4e3e..c871e6c220f 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/syntax/table/TableExistsException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/syntax/table/TableExistsException.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect.syntax.table;
+package org.apache.shardingsphere.error.exception.syntax.table;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
/**
* Table exists exception.
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/transaction/InTransactionException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/transaction/InTransactionException.java
similarity index 89%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/transaction/InTransactionException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/transaction/InTransactionException.java
index b98b0e0db3b..212efb91d6b 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/transaction/InTransactionException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/transaction/InTransactionException.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect.transaction;
+package org.apache.shardingsphere.error.exception.transaction;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
/**
* In transaction exception.
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/transaction/TableModifyInTransactionException.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/transaction/TableModifyInTransactionException.java
similarity index 89%
rename from
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/transaction/TableModifyInTransactionException.java
rename to
shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/transaction/TableModifyInTransactionException.java
index 032e06a31b8..334813df039 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/dialect/transaction/TableModifyInTransactionException.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/exception/transaction/TableModifyInTransactionException.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.error.dialect.transaction;
+package org.apache.shardingsphere.error.exception.transaction;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
/**
* Table modify in transaction exception.
diff --git
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/SQLDialectExceptionMapper.java
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/SQLDialectExceptionMapper.java
index 21218445755..0b708a4b187 100644
---
a/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/SQLDialectExceptionMapper.java
+++
b/shardingsphere-error/shardingsphere-common-error/src/main/java/org/apache/shardingsphere/error/mapper/SQLDialectExceptionMapper.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.error.mapper;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
diff --git
a/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLDialectExceptionMapper.java
b/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLDialectExceptionMapper.java
index 1f2827d4806..88010738fef 100644
---
a/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLDialectExceptionMapper.java
+++
b/shardingsphere-error/shardingsphere-mysql-error/src/main/java/org/apache/shardingsphere/error/mysql/mapper/MySQLDialectExceptionMapper.java
@@ -17,16 +17,16 @@
package org.apache.shardingsphere.error.mysql.mapper;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
-import
org.apache.shardingsphere.error.dialect.connection.TooManyConnectionsException;
-import
org.apache.shardingsphere.error.dialect.data.InsertColumnsAndValuesMismatchedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.DatabaseCreateExistsException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.DatabaseDropNotExistsException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
-import
org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
-import
org.apache.shardingsphere.error.dialect.syntax.table.TableExistsException;
-import
org.apache.shardingsphere.error.dialect.transaction.TableModifyInTransactionException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
+import
org.apache.shardingsphere.error.exception.connection.TooManyConnectionsException;
+import
org.apache.shardingsphere.error.exception.data.InsertColumnsAndValuesMismatchedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.DatabaseCreateExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.database.DatabaseDropNotExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
+import
org.apache.shardingsphere.error.exception.syntax.table.TableExistsException;
+import
org.apache.shardingsphere.error.exception.transaction.TableModifyInTransactionException;
import org.apache.shardingsphere.error.mapper.SQLDialectExceptionMapper;
import org.apache.shardingsphere.error.mysql.code.MySQLVendorError;
import org.apache.shardingsphere.infra.util.exception.sql.UnknownSQLException;
diff --git
a/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLDialectExceptionMapper.java
b/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLDialectExceptionMapper.java
index a4693a30f86..84b4368f58f 100644
---
a/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLDialectExceptionMapper.java
+++
b/shardingsphere-error/shardingsphere-postgresql-error/src/main/java/org/apache/shardingsphere/error/postgresql/mapper/PostgreSQLDialectExceptionMapper.java
@@ -19,12 +19,12 @@ package org.apache.shardingsphere.error.postgresql.mapper;
import org.apache.shardingsphere.error.mapper.SQLDialectExceptionMapper;
import org.apache.shardingsphere.error.postgresql.code.PostgreSQLVendorError;
-import
org.apache.shardingsphere.error.dialect.transaction.InTransactionException;
-import
org.apache.shardingsphere.error.dialect.data.InsertColumnsAndValuesMismatchedException;
-import
org.apache.shardingsphere.error.dialect.data.InvalidParameterValueException;
-import
org.apache.shardingsphere.error.dialect.connection.TooManyConnectionsException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.DatabaseCreateExistsException;
-import org.apache.shardingsphere.error.dialect.SQLDialectException;
+import
org.apache.shardingsphere.error.exception.transaction.InTransactionException;
+import
org.apache.shardingsphere.error.exception.data.InsertColumnsAndValuesMismatchedException;
+import
org.apache.shardingsphere.error.exception.data.InvalidParameterValueException;
+import
org.apache.shardingsphere.error.exception.connection.TooManyConnectionsException;
+import
org.apache.shardingsphere.error.exception.syntax.database.DatabaseCreateExistsException;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
import org.postgresql.util.PSQLException;
import org.postgresql.util.PSQLState;
diff --git
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/impl/InsertClauseShardingConditionEngine.java
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/impl/InsertClauseShardingConditionEngine.java
index 13d58457c8b..e753694dea7 100644
---
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/impl/InsertClauseShardingConditionEngine.java
+++
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/impl/InsertClauseShardingConditionEngine.java
@@ -25,7 +25,7 @@ import
org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementConte
import
org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
import org.apache.shardingsphere.infra.datetime.DatetimeService;
import org.apache.shardingsphere.infra.datetime.DatetimeServiceFactory;
-import
org.apache.shardingsphere.error.dialect.data.InsertColumnsAndValuesMismatchedException;
+import
org.apache.shardingsphere.error.exception.data.InsertColumnsAndValuesMismatchedException;
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import
org.apache.shardingsphere.sharding.route.engine.condition.ExpressionConditionUtils;
diff --git
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingDDLStatementValidator.java
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingDDLStatementValidator.java
index f9ea7ffd7cc..44ace5b919f 100644
---
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingDDLStatementValidator.java
+++
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingDDLStatementValidator.java
@@ -20,8 +20,8 @@ package
org.apache.shardingsphere.sharding.route.engine.validator.ddl;
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import
org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import org.apache.shardingsphere.infra.route.context.RouteContext;
-import
org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
-import
org.apache.shardingsphere.error.dialect.syntax.table.TableExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
+import
org.apache.shardingsphere.error.exception.syntax.table.TableExistsException;
import
org.apache.shardingsphere.sharding.route.engine.validator.ShardingStatementValidator;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import
org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
diff --git
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/InsertClauseShardingConditionEngineTest.java
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/InsertClauseShardingConditionEngineTest.java
index ee49e8f4699..e2a2ca9cbc0 100644
---
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/InsertClauseShardingConditionEngineTest.java
+++
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/InsertClauseShardingConditionEngineTest.java
@@ -21,7 +21,7 @@ import
org.apache.shardingsphere.infra.binder.segment.insert.keygen.GeneratedKey
import
org.apache.shardingsphere.infra.binder.segment.insert.values.InsertSelectContext;
import
org.apache.shardingsphere.infra.binder.segment.insert.values.InsertValueContext;
import
org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext;
-import
org.apache.shardingsphere.error.dialect.data.InsertColumnsAndValuesMismatchedException;
+import
org.apache.shardingsphere.error.exception.data.InsertColumnsAndValuesMismatchedException;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import
org.apache.shardingsphere.sharding.route.engine.condition.ShardingCondition;
import
org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.InsertClauseShardingConditionEngine;
diff --git
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateFunctionStatementValidatorTest.java
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateFunctionStatementValidatorTest.java
index e5933eaa4b2..e64bf33173d 100644
---
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateFunctionStatementValidatorTest.java
+++
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateFunctionStatementValidatorTest.java
@@ -20,8 +20,8 @@ package
org.apache.shardingsphere.sharding.route.engine.validator.ddl;
import
org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.database.DefaultDatabase;
-import
org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
-import
org.apache.shardingsphere.error.dialect.syntax.table.TableExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
+import
org.apache.shardingsphere.error.exception.syntax.table.TableExistsException;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import
org.apache.shardingsphere.sharding.route.engine.validator.ddl.impl.ShardingCreateFunctionStatementValidator;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
diff --git
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateIndexStatementValidatorTest.java
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateIndexStatementValidatorTest.java
index c1467d44bf1..5314744b209 100644
---
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateIndexStatementValidatorTest.java
+++
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateIndexStatementValidatorTest.java
@@ -21,7 +21,7 @@ import
org.apache.shardingsphere.infra.binder.statement.ddl.CreateIndexStatement
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import
org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereTable;
-import
org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
+import
org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
import
org.apache.shardingsphere.sharding.route.engine.validator.ddl.impl.ShardingCreateIndexStatementValidator;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import
org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexNameSegment;
diff --git
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateProcedureStatementValidatorTest.java
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateProcedureStatementValidatorTest.java
index 8f82a570501..1571c3bdf23 100644
---
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateProcedureStatementValidatorTest.java
+++
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateProcedureStatementValidatorTest.java
@@ -20,8 +20,8 @@ package
org.apache.shardingsphere.sharding.route.engine.validator.ddl;
import
org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.database.DefaultDatabase;
-import
org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
-import
org.apache.shardingsphere.error.dialect.syntax.table.TableExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
+import
org.apache.shardingsphere.error.exception.syntax.table.TableExistsException;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import
org.apache.shardingsphere.sharding.route.engine.validator.ddl.impl.ShardingCreateProcedureStatementValidator;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
diff --git
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateTableStatementValidatorTest.java
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateTableStatementValidatorTest.java
index 5cf8e27ca88..f34e030158c 100644
---
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateTableStatementValidatorTest.java
+++
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingCreateTableStatementValidatorTest.java
@@ -25,7 +25,7 @@ import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.route.context.RouteContext;
import org.apache.shardingsphere.infra.route.context.RouteMapper;
import org.apache.shardingsphere.infra.route.context.RouteUnit;
-import
org.apache.shardingsphere.error.dialect.syntax.table.TableExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.table.TableExistsException;
import
org.apache.shardingsphere.sharding.route.engine.validator.ddl.impl.ShardingCreateTableStatementValidator;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sharding.rule.TableRule;
diff --git
a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/InsertStatementContext.java
b/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/InsertStatementContext.java
index 9ee6a284f20..0eb93e0ffaa 100644
---
a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/InsertStatementContext.java
+++
b/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/InsertStatementContext.java
@@ -28,8 +28,8 @@ import
org.apache.shardingsphere.infra.binder.segment.table.TablesContext;
import
org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
import org.apache.shardingsphere.infra.binder.type.TableAvailable;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import
org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import
org.apache.shardingsphere.sql.parser.sql.common.extractor.TableExtractor;
diff --git
a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/SelectStatementContext.java
b/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/SelectStatementContext.java
index 20823153292..50321587b62 100644
---
a/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/SelectStatementContext.java
+++
b/shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/SelectStatementContext.java
@@ -39,8 +39,8 @@ import
org.apache.shardingsphere.infra.binder.segment.table.TablesContext;
import
org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
import org.apache.shardingsphere.infra.binder.type.TableAvailable;
import org.apache.shardingsphere.infra.binder.type.WhereAvailable;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import
org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import
org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutor.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutor.java
index 99a0f2fd9be..edf06d3937a 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutor.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutor.java
@@ -43,7 +43,7 @@ import
org.apache.shardingsphere.proxy.backend.communication.jdbc.executor.Proxy
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.statement.JDBCBackendStatement;
import org.apache.shardingsphere.proxy.backend.context.BackendExecutorContext;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.transaction.TableModifyInTransactionException;
+import
org.apache.shardingsphere.error.exception.transaction.TableModifyInTransactionException;
import
org.apache.shardingsphere.proxy.backend.session.transaction.TransactionStatus;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
import
org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CloseStatement;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ReactiveProxySQLExecutor.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ReactiveProxySQLExecutor.java
index b488a755d21..e56ab148593 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ReactiveProxySQLExecutor.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ReactiveProxySQLExecutor.java
@@ -36,7 +36,7 @@ import
org.apache.shardingsphere.proxy.backend.communication.vertx.VertxBackendS
import
org.apache.shardingsphere.proxy.backend.communication.vertx.executor.ProxyReactiveExecutor;
import org.apache.shardingsphere.proxy.backend.context.BackendExecutorContext;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.transaction.TableModifyInTransactionException;
+import
org.apache.shardingsphere.error.exception.transaction.TableModifyInTransactionException;
import
org.apache.shardingsphere.proxy.backend.session.transaction.TransactionStatus;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
import
org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DDLStatement;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/context/ProxyContext.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/context/ProxyContext.java
index 3716df5c9d8..2afc9ca2fb9 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/context/ProxyContext.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/context/ProxyContext.java
@@ -26,7 +26,7 @@ import
org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.state.StateContext;
import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.JDBCBackendDataSource;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
import java.util.Collection;
import java.util.LinkedList;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/DatabaseRequiredBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/DatabaseRequiredBackendHandler.java
index f77117e0198..98849c9ff8a 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/DatabaseRequiredBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/DatabaseRequiredBackendHandler.java
@@ -20,8 +20,8 @@ package org.apache.shardingsphere.proxy.backend.handler;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import
org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DatabaseSegment;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/ShowCreateDatabaseExecutor.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/ShowCreateDatabaseExecutor.java
index 4709f9a7dfe..c504da2c1b2 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/ShowCreateDatabaseExecutor.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/ShowCreateDatabaseExecutor.java
@@ -19,7 +19,7 @@ package
org.apache.shardingsphere.proxy.backend.handler.admin.mysql.executor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import
org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import
org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResultMetaData;
import
org.apache.shardingsphere.infra.executor.sql.execute.result.query.impl.raw.metadata.RawQueryResultColumnMetaData;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UnicastResourceShowExecutor.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UnicastResourceShowExecutor.java
index 3946c9b7def..ba12daffd34 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UnicastResourceShowExecutor.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UnicastResourceShowExecutor.java
@@ -33,7 +33,7 @@ import
org.apache.shardingsphere.infra.merge.result.impl.transparent.Transparent
import
org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngineFactory;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
import
org.apache.shardingsphere.proxy.backend.exception.RuleNotExistedException;
import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
import
org.apache.shardingsphere.proxy.backend.response.header.query.QueryHeader;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UseDatabaseExecutor.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UseDatabaseExecutor.java
index 9d82cf28f69..d963cd9acab 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UseDatabaseExecutor.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UseDatabaseExecutor.java
@@ -21,7 +21,7 @@ import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.executor.check.SQLCheckEngine;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import
org.apache.shardingsphere.proxy.backend.handler.admin.executor.DatabaseAdminExecutor;
import
org.apache.shardingsphere.sql.parser.sql.common.statement.dal.UseStatement;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/executor/PostgreSQLSetCharsetExecutor.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/executor/PostgreSQLSetCharsetExecutor.java
index de9ba35bfa8..ba21c972c24 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/executor/PostgreSQLSetCharsetExecutor.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/admin/postgresql/executor/PostgreSQLSetCharsetExecutor.java
@@ -18,7 +18,7 @@
package
org.apache.shardingsphere.proxy.backend.handler.admin.postgresql.executor;
import org.apache.shardingsphere.db.protocol.CommonConstants;
-import
org.apache.shardingsphere.error.dialect.data.InvalidParameterValueException;
+import
org.apache.shardingsphere.error.exception.data.InvalidParameterValueException;
import
org.apache.shardingsphere.proxy.backend.handler.admin.postgresql.PostgreSQLCharacterSets;
import
org.apache.shardingsphere.proxy.backend.handler.admin.postgresql.PostgreSQLSessionVariableHandler;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/data/impl/UnicastDatabaseBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/data/impl/UnicastDatabaseBackendHandler.java
index 271c155ef2c..867883f5360 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/data/impl/UnicastDatabaseBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/data/impl/UnicastDatabaseBackendHandler.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.infra.binder.LogicSQL;
import
org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine;
import
org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngineFactory;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
import
org.apache.shardingsphere.proxy.backend.exception.RuleNotExistedException;
import org.apache.shardingsphere.proxy.backend.response.data.QueryResponseRow;
import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/database/CreateDatabaseBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/database/CreateDatabaseBackendHandler.java
index 28a2c36a68e..61505e7f8a2 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/database/CreateDatabaseBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/database/CreateDatabaseBackendHandler.java
@@ -19,7 +19,7 @@ package
org.apache.shardingsphere.proxy.backend.handler.database;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.DatabaseCreateExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.database.DatabaseCreateExistsException;
import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
import
org.apache.shardingsphere.proxy.backend.response.header.update.UpdateResponseHeader;
import org.apache.shardingsphere.proxy.backend.handler.ProxyBackendHandler;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/database/DropDatabaseBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/database/DropDatabaseBackendHandler.java
index 0274e8c4bf6..33a44feb5ec 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/database/DropDatabaseBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/database/DropDatabaseBackendHandler.java
@@ -24,8 +24,8 @@ import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.user.Grantee;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.DatabaseDropNotExistsException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.DatabaseDropNotExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
import
org.apache.shardingsphere.proxy.backend.response.header.update.UpdateResponseHeader;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationHandler.java
index e211ed66a97..1150e1a6d07 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationHandler.java
@@ -22,9 +22,9 @@ import
org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ExportDa
import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
import org.apache.shardingsphere.infra.datasource.props.DataSourceProperties;
import
org.apache.shardingsphere.infra.datasource.props.DataSourcePropertiesCreator;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowReadwriteSplittingReadResourcesHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowReadwriteSplittingReadResourcesHandler.java
index 314a0268515..b2d5ec7f09f 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowReadwriteSplittingReadResourcesHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowReadwriteSplittingReadResourcesHandler.java
@@ -20,8 +20,8 @@ package
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable;
import com.google.common.base.Strings;
import org.apache.shardingsphere.infra.distsql.constant.ExportableConstants;
import
org.apache.shardingsphere.infra.distsql.constant.ExportableItemConstants;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import
org.apache.shardingsphere.infra.metadata.database.schema.QualifiedDatabase;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetadataHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetadataHandler.java
index f3b61a7f8c0..c7e5e721e9a 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetadataHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetadataHandler.java
@@ -20,8 +20,8 @@ package
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable;
import com.google.common.base.Strings;
import
org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ShowTableMetadataStatement;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
import
org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereIndex;
import
org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/RefreshTableMetadataHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/RefreshTableMetadataHandler.java
index d919716ef79..9cd53169c67 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/RefreshTableMetadataHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/RefreshTableMetadataHandler.java
@@ -23,8 +23,8 @@ import
org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine;
import org.apache.shardingsphere.infra.distsql.exception.DistSQLException;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.UpdatableRALBackendHandler;
/**
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetReadwriteSplittingStatusHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetReadwriteSplittingStatusHandler.java
index 32f1c3af759..c8bf475226f 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetReadwriteSplittingStatusHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetReadwriteSplittingStatusHandler.java
@@ -23,8 +23,8 @@ import
org.apache.shardingsphere.infra.distsql.constant.ExportableConstants;
import
org.apache.shardingsphere.infra.distsql.constant.ExportableItemConstants;
import org.apache.shardingsphere.infra.distsql.exception.DistSQLException;
import
org.apache.shardingsphere.infra.distsql.exception.resource.RequiredResourceMissedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import
org.apache.shardingsphere.infra.metadata.database.schema.QualifiedDatabase;
import
org.apache.shardingsphere.infra.rule.identifier.type.exportable.RuleExportEngine;
import org.apache.shardingsphere.mode.manager.ContextManager;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/PreviewHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/PreviewHandler.java
index 1401dc2b062..0195d5e608b 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/PreviewHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/PreviewHandler.java
@@ -34,9 +34,9 @@ import
org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.context.kernel.KernelProcessor;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
import
org.apache.shardingsphere.proxy.backend.exception.RuleNotExistedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.infra.executor.sql.context.ExecutionUnit;
import
org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode;
import
org.apache.shardingsphere.infra.executor.sql.execute.engine.SQLExecutorExceptionHandler;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandler.java
index 54ffd1b8808..f14481ef267 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandler.java
@@ -21,7 +21,7 @@ import io.vertx.core.Future;
import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
import
org.apache.shardingsphere.infra.database.type.dialect.OpenGaussDatabaseType;
import
org.apache.shardingsphere.infra.database.type.dialect.PostgreSQLDatabaseType;
-import
org.apache.shardingsphere.error.dialect.transaction.InTransactionException;
+import
org.apache.shardingsphere.error.exception.transaction.InTransactionException;
import
org.apache.shardingsphere.proxy.backend.communication.TransactionManager;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.JDBCBackendConnection;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.transaction.JDBCBackendTransactionManager;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutorTest.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutorTest.java
index 30b70fc0387..1527937575d 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutorTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutorTest.java
@@ -36,7 +36,7 @@ import
org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.JDBCBackendConnection;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.transaction.TableModifyInTransactionException;
+import
org.apache.shardingsphere.error.exception.transaction.TableModifyInTransactionException;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import org.apache.shardingsphere.proxy.backend.util.ProxyContextRestorer;
import
org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java
index baa792d635e..11693501983 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/context/ProxyContextTest.java
@@ -26,7 +26,7 @@ import
org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRule
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
import org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
import org.apache.shardingsphere.proxy.backend.util.ProxyContextRestorer;
import org.junit.Test;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/DatabaseOperateBackendHandlerFactoryTest.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/DatabaseOperateBackendHandlerFactoryTest.java
index 6fbdf644f95..ea9e2f07504 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/DatabaseOperateBackendHandlerFactoryTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/DatabaseOperateBackendHandlerFactoryTest.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
import org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.DatabaseCreateExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.database.DatabaseCreateExistsException;
import
org.apache.shardingsphere.proxy.backend.handler.database.DatabaseOperateBackendHandlerFactory;
import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
import
org.apache.shardingsphere.proxy.backend.response.header.update.UpdateResponseHeader;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UseDatabaseExecutorTest.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UseDatabaseExecutorTest.java
index afa79f93a3e..ce589f35829 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UseDatabaseExecutorTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/admin/mysql/executor/UseDatabaseExecutorTest.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
import org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import org.apache.shardingsphere.proxy.backend.util.ProxyContextRestorer;
import
org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLUseStatement;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/CreateDatabaseBackendHandlerTest.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/CreateDatabaseBackendHandlerTest.java
index 3351fb3a33b..81b74579d79 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/CreateDatabaseBackendHandlerTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/CreateDatabaseBackendHandlerTest.java
@@ -22,7 +22,7 @@ import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.DatabaseCreateExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.database.DatabaseCreateExistsException;
import
org.apache.shardingsphere.proxy.backend.response.header.update.UpdateResponseHeader;
import org.apache.shardingsphere.proxy.backend.util.ProxyContextRestorer;
import
org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateDatabaseStatement;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/DropDatabaseBackendHandlerTest.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/DropDatabaseBackendHandlerTest.java
index 790cd7aaa2f..0cb3de78a70 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/DropDatabaseBackendHandlerTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/database/DropDatabaseBackendHandlerTest.java
@@ -21,7 +21,7 @@ import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.DatabaseDropNotExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.database.DatabaseDropNotExistsException;
import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
import
org.apache.shardingsphere.proxy.backend.response.header.update.UpdateResponseHeader;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationHandlerTest.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationHandlerTest.java
index d326186e150..3cbe0e589f3 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationHandlerTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportDatabaseConfigurationHandlerTest.java
@@ -20,8 +20,8 @@ package
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable;
import lombok.SneakyThrows;
import
org.apache.shardingsphere.distsql.parser.statement.ral.queryable.ExportDatabaseConfigurationStatement;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import
org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereColumn;
import
org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereIndex;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelLimitationInboundHandler.java
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelLimitationInboundHandler.java
index 3ca06adc3f9..2e1584d443e 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelLimitationInboundHandler.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/netty/FrontendChannelLimitationInboundHandler.java
@@ -22,7 +22,7 @@ import io.netty.channel.ChannelInboundHandlerAdapter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import
org.apache.shardingsphere.proxy.frontend.connection.ConnectionLimitContext;
-import
org.apache.shardingsphere.error.dialect.connection.TooManyConnectionsException;
+import
org.apache.shardingsphere.error.exception.connection.TooManyConnectionsException;
import
org.apache.shardingsphere.proxy.frontend.spi.DatabaseProtocolFrontendEngine;
/**
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptionsTest.java
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptionsTest.java
index 796d142b612..24fedf9064c 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptionsTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/exception/ExpectedExceptionsTest.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.proxy.frontend.exception;
import
org.apache.shardingsphere.infra.config.exception.ShardingSphereConfigurationException;
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import
org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.exception.DistSQLException;
import org.apache.shardingsphere.sql.parser.exception.SQLParsingException;
import org.junit.Test;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/admin/initdb/MySQLComInitDbExecutor.java
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/admin/initdb/MySQLComInitDbExecutor.java
index f28ed962c71..c6cb2834cff 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/admin/initdb/MySQLComInitDbExecutor.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/admin/initdb/MySQLComInitDbExecutor.java
@@ -24,7 +24,7 @@ import
org.apache.shardingsphere.db.protocol.packet.DatabasePacket;
import org.apache.shardingsphere.infra.executor.check.SQLCheckEngine;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import
org.apache.shardingsphere.proxy.frontend.command.executor.CommandExecutor;
import
org.apache.shardingsphere.proxy.frontend.mysql.command.ServerStatusFlagCalculator;
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 3e586e0bbe1..5adf24844d5 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
@@ -21,9 +21,10 @@ import com.google.common.base.Strings;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import
org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket;
-import org.apache.shardingsphere.error.SQLExceptionHandler;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
+import org.apache.shardingsphere.error.mapper.SQLDialectExceptionMapperFactory;
import org.apache.shardingsphere.error.mysql.code.MySQLVendorError;
-import
org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;
+import
org.apache.shardingsphere.infra.util.exception.sql.ShardingSphereSQLException;
import org.apache.shardingsphere.infra.util.exception.sql.UnknownSQLException;
import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.exception.DistSQLException;
import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.exception.DistSQLVendorError;
@@ -50,8 +51,12 @@ public final class MySQLErrPacketFactory {
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) {
- SQLException sqlException = SQLExceptionHandler.convert("MySQL",
(ShardingSphereInsideException) cause);
+ if (cause instanceof SQLDialectException) {
+ SQLException sqlException =
SQLDialectExceptionMapperFactory.getInstance("MySQL").convert((SQLDialectException)
cause);
+ return new MySQLErrPacket(1, sqlException.getErrorCode(),
sqlException.getSQLState(), sqlException.getMessage());
+ }
+ if (cause instanceof ShardingSphereSQLException) {
+ SQLException sqlException = ((ShardingSphereSQLException)
cause).toSQLException();
return new MySQLErrPacket(1, sqlException.getErrorCode(),
sqlException.getSQLState(), sqlException.getMessage());
}
if (cause instanceof DistSQLException) {
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactoryTest.java
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactoryTest.java
index 3854dd8312e..15893032e32 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactoryTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactoryTest.java
@@ -20,17 +20,17 @@ package org.apache.shardingsphere.proxy.frontend.mysql.err;
import
org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLErrPacket;
import
org.apache.shardingsphere.infra.config.exception.ShardingSphereConfigurationException;
import
org.apache.shardingsphere.infra.distsql.exception.rule.RuleDefinitionViolationException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
+import
org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
+import
org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import
org.apache.shardingsphere.proxy.frontend.exception.CircuitBreakException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.DatabaseCreateExistsException;
-import
org.apache.shardingsphere.error.dialect.syntax.database.DatabaseDropNotExistsException;
-import
org.apache.shardingsphere.error.dialect.transaction.TableModifyInTransactionException;
+import
org.apache.shardingsphere.error.exception.syntax.database.DatabaseCreateExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.database.DatabaseDropNotExistsException;
+import
org.apache.shardingsphere.error.exception.transaction.TableModifyInTransactionException;
import
org.apache.shardingsphere.proxy.backend.handler.distsql.ral.common.exception.UnsupportedVariableException;
import
org.apache.shardingsphere.proxy.frontend.exception.UnsupportedCommandException;
import
org.apache.shardingsphere.proxy.frontend.exception.UnsupportedPreparedStatementException;
-import
org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
-import
org.apache.shardingsphere.error.dialect.syntax.table.TableExistsException;
+import
org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
+import
org.apache.shardingsphere.error.exception.syntax.table.TableExistsException;
import org.apache.shardingsphere.sql.parser.exception.SQLParsingException;
import org.junit.Test;
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/OpenGaussFrontendEngine.java
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/OpenGaussFrontendEngine.java
index 770c54cee6a..f4b6eb5a9eb 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/OpenGaussFrontendEngine.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-opengauss/src/main/java/org/apache/shardingsphere/proxy/frontend/opengauss/OpenGaussFrontendEngine.java
@@ -21,7 +21,7 @@ import lombok.AccessLevel;
import lombok.Getter;
import
org.apache.shardingsphere.db.protocol.opengauss.codec.OpenGaussPacketCodecEngine;
import
org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLServerInfo;
-import
org.apache.shardingsphere.error.dialect.transaction.InTransactionException;
+import
org.apache.shardingsphere.error.exception.transaction.InTransactionException;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import org.apache.shardingsphere.proxy.frontend.context.FrontendContext;
import
org.apache.shardingsphere.proxy.frontend.opengauss.authentication.OpenGaussAuthenticationEngine;
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 5a16a5a18c8..bd45d220f14 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
@@ -23,9 +23,10 @@ import lombok.NoArgsConstructor;
import lombok.SneakyThrows;
import
org.apache.shardingsphere.db.protocol.opengauss.packet.command.generic.OpenGaussErrorResponsePacket;
import
org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLMessageSeverityLevel;
-import org.apache.shardingsphere.error.SQLExceptionHandler;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
+import org.apache.shardingsphere.error.mapper.SQLDialectExceptionMapperFactory;
import org.apache.shardingsphere.error.postgresql.code.PostgreSQLVendorError;
-import
org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;
+import
org.apache.shardingsphere.infra.util.exception.sql.ShardingSphereSQLException;
import
org.apache.shardingsphere.proxy.frontend.postgresql.authentication.exception.InvalidAuthorizationSpecificationException;
import
org.apache.shardingsphere.proxy.frontend.postgresql.authentication.exception.PostgreSQLAuthenticationException;
import
org.apache.shardingsphere.proxy.frontend.postgresql.authentication.exception.PostgreSQLProtocolViolationException;
@@ -75,8 +76,11 @@ public final class OpenGaussErrorPacketFactory {
if (cause instanceof SQLException) {
return createErrorResponsePacket((SQLException) cause);
}
- if (cause instanceof ShardingSphereInsideException) {
- return
createErrorResponsePacket(SQLExceptionHandler.convert("PostgreSQL",
(ShardingSphereInsideException) cause));
+ if (cause instanceof SQLDialectException) {
+ return
createErrorResponsePacket(SQLDialectExceptionMapperFactory.getInstance("PostgreSQL").convert((SQLDialectException)
cause));
+ }
+ if (cause instanceof ShardingSphereSQLException) {
+ return createErrorResponsePacket(((ShardingSphereSQLException)
cause).toSQLException());
}
if (cause instanceof InvalidAuthorizationSpecificationException) {
return new
OpenGaussErrorResponsePacket(PostgreSQLMessageSeverityLevel.FATAL,
PostgreSQLVendorError.INVALID_AUTHORIZATION_SPECIFICATION.getSqlState().getValue(),
cause.getMessage());
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngine.java
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngine.java
index 423a8adcb43..294aadf2d3d 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngine.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/PostgreSQLFrontendEngine.java
@@ -22,7 +22,7 @@ import
org.apache.shardingsphere.db.protocol.codec.DatabasePacketCodecEngine;
import
org.apache.shardingsphere.db.protocol.postgresql.codec.PostgreSQLPacketCodecEngine;
import
org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLServerInfo;
import
org.apache.shardingsphere.db.protocol.postgresql.packet.PostgreSQLPacket;
-import
org.apache.shardingsphere.error.dialect.transaction.InTransactionException;
+import
org.apache.shardingsphere.error.exception.transaction.InTransactionException;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import
org.apache.shardingsphere.proxy.frontend.authentication.AuthenticationEngine;
import org.apache.shardingsphere.proxy.frontend.command.CommandExecuteEngine;
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 502fa7749c1..b6b0c15a690 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
@@ -22,9 +22,10 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import
org.apache.shardingsphere.db.protocol.postgresql.constant.PostgreSQLMessageSeverityLevel;
import
org.apache.shardingsphere.db.protocol.postgresql.packet.generic.PostgreSQLErrorResponsePacket;
-import org.apache.shardingsphere.error.SQLExceptionHandler;
+import org.apache.shardingsphere.error.exception.SQLDialectException;
+import org.apache.shardingsphere.error.mapper.SQLDialectExceptionMapperFactory;
import org.apache.shardingsphere.error.postgresql.code.PostgreSQLVendorError;
-import
org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;
+import
org.apache.shardingsphere.infra.util.exception.sql.ShardingSphereSQLException;
import
org.apache.shardingsphere.proxy.frontend.postgresql.authentication.exception.InvalidAuthorizationSpecificationException;
import
org.apache.shardingsphere.proxy.frontend.postgresql.authentication.exception.PostgreSQLAuthenticationException;
import
org.apache.shardingsphere.proxy.frontend.postgresql.authentication.exception.PostgreSQLProtocolViolationException;
@@ -49,8 +50,11 @@ public final class PostgreSQLErrPacketFactory {
if (cause instanceof PSQLException && null != ((PSQLException)
cause).getServerErrorMessage()) {
return createErrorResponsePacket(((PSQLException)
cause).getServerErrorMessage());
}
- if (cause instanceof ShardingSphereInsideException) {
- return
createErrorResponsePacket(SQLExceptionHandler.convert("PostgreSQL",
(ShardingSphereInsideException) cause));
+ if (cause instanceof SQLDialectException) {
+ return
createErrorResponsePacket(SQLDialectExceptionMapperFactory.getInstance("PostgreSQL").convert((SQLDialectException)
cause));
+ }
+ if (cause instanceof ShardingSphereSQLException) {
+ return createErrorResponsePacket(((ShardingSphereSQLException)
cause).toSQLException());
}
if (cause instanceof SQLException) {
return createErrorResponsePacket((SQLException) cause);
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ddl/BaseDDLIT.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ddl/BaseDDLIT.java
index 07d2a21363a..42a62913ed0 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ddl/BaseDDLIT.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ddl/BaseDDLIT.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.test.integration.engine.ddl;
import com.google.common.base.Splitter;
import lombok.SneakyThrows;
import org.apache.shardingsphere.infra.datanode.DataNode;
-import
org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
+import
org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
import org.apache.shardingsphere.infra.util.expr.InlineExpressionParser;
import
org.apache.shardingsphere.test.integration.cases.dataset.metadata.DataSetColumn;
import
org.apache.shardingsphere.test.integration.cases.dataset.metadata.DataSetIndex;
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/truncate/MySQLXATruncateTestCase.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/truncate/MySQLXATruncateTestCase.java
index b843855a3e5..ad842f6966a 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/truncate/MySQLXATruncateTestCase.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/cases/truncate/MySQLXATruncateTestCase.java
@@ -23,7 +23,7 @@ import
org.apache.shardingsphere.integration.transaction.cases.base.BaseTransact
import
org.apache.shardingsphere.integration.transaction.engine.base.BaseTransactionITCase;
import
org.apache.shardingsphere.integration.transaction.engine.base.TransactionTestCase;
import
org.apache.shardingsphere.integration.transaction.engine.constants.TransactionTestConstants;
-import
org.apache.shardingsphere.error.dialect.transaction.TableModifyInTransactionException;
+import
org.apache.shardingsphere.error.exception.transaction.TableModifyInTransactionException;
import org.apache.shardingsphere.transaction.core.TransactionType;
import javax.sql.DataSource;