This is an automated email from the ASF dual-hosted git repository.
sunnianjun 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 3375cee3f7b Refactor AmbiguousColumnException (#30734)
3375cee3f7b is described below
commit 3375cee3f7b1b7883c453fe734fd99e3b156f65f
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Apr 1 19:49:23 2024 +0800
Refactor AmbiguousColumnException (#30734)
* Refactor AmbiguousColumnException
* Refactor AmbiguousColumnException
---
docs/document/content/user-manual/error-code/sql-error-code.cn.md | 2 +-
docs/document/content/user-manual/error-code/sql-error-code.en.md | 2 +-
.../distsql/update/DropDefaultShardingStrategyExecutorTest.java | 2 +-
.../infra/binder/segment/expression/impl/ColumnSegmentBinder.java | 2 +-
.../exception/{metadata => syntax}/AmbiguousColumnException.java | 8 ++++----
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/docs/document/content/user-manual/error-code/sql-error-code.cn.md
b/docs/document/content/user-manual/error-code/sql-error-code.cn.md
index 3ac5180f863..d6a0260435c 100644
--- a/docs/document/content/user-manual/error-code/sql-error-code.cn.md
+++ b/docs/document/content/user-manual/error-code/sql-error-code.cn.md
@@ -19,7 +19,6 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| 42S02 | 10002 | Schema '%s' does not exist.
|
| 42S02 | 10003 | Table or view '%s' does not exist.
|
| 42S02 | 10004 | Unknown column '%s' in '%s'.
|
-| HY000 | 10005 | Column '%s' in %s is ambiguous.
|
| HY000 | 10100 | Can not %s storage units '%s'.
|
| 42S02 | 10101 | There is no storage unit in database '%s'.
|
| 44000 | 10102 | Storage units '%s' do not exist in database '%s'.
|
@@ -63,6 +62,7 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| 42S02 | 12011 | Can not find column label \`%s\`. |
| 42S02 | 12012 | Can not find url provider for \`%s`\. |
| HV008 | 12020 | Column index \`%d\` is out of range. |
+| HY000 | 12021 | Column '%s' in %s is ambiguous. |
| 0A000 | 12100 | DROP TABLE ... CASCADE is not supported. |
### 连接
diff --git a/docs/document/content/user-manual/error-code/sql-error-code.en.md
b/docs/document/content/user-manual/error-code/sql-error-code.en.md
index 2d1df3f61bf..8088e588f37 100644
--- a/docs/document/content/user-manual/error-code/sql-error-code.en.md
+++ b/docs/document/content/user-manual/error-code/sql-error-code.en.md
@@ -19,7 +19,6 @@ SQL error codes provide by standard `SQL State`, `Vendor
Code` and `Reason`, whi
| 42S02 | 10002 | Schema '%s' does not exist.
|
| 42S02 | 10003 | Table or view '%s' does not exist.
|
| 42S02 | 10004 | Unknown column '%s' in '%s'.
|
-| HY000 | 10005 | Column '%s' in %s is ambiguous.
|
| HY000 | 10100 | Can not %s storage units '%s'.
|
| 42S02 | 10101 | There is no storage unit in database '%s'.
|
| 44000 | 10102 | Storage units '%s' do not exist in database '%s'.
|
@@ -63,6 +62,7 @@ SQL error codes provide by standard `SQL State`, `Vendor
Code` and `Reason`, whi
| 42S02 | 12011 | Can not find column label \`%s\`. |
| 42S02 | 12012 | Can not find url provider for \`%s`\. |
| HV008 | 12020 | Column index \`%d\` is out of range. |
+| HY000 | 12021 | Column '%s' in %s is ambiguous. |
| 0A000 | 12100 | DROP TABLE ... CASCADE is not supported. |
### Connection
diff --git
a/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/DropDefaultShardingStrategyExecutorTest.java
b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/DropDefaultShardingStrategyExecutorTest.java
index b6925de90c7..07b01d47a59 100644
---
a/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/DropDefaultShardingStrategyExecutorTest.java
+++
b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/update/DropDefaultShardingStrategyExecutorTest.java
@@ -17,8 +17,8 @@
package org.apache.shardingsphere.sharding.distsql.update;
-import
org.apache.shardingsphere.infra.exception.metadata.rule.MissingRequiredRuleException;
import
org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
+import
org.apache.shardingsphere.infra.exception.metadata.rule.MissingRequiredRuleException;
import
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import
org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
diff --git
a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/expression/impl/ColumnSegmentBinder.java
b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/expression/impl/ColumnSegmentBinder.java
index eab41467179..a2419148fc3 100644
---
a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/expression/impl/ColumnSegmentBinder.java
+++
b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/expression/impl/ColumnSegmentBinder.java
@@ -26,7 +26,7 @@ import
org.apache.shardingsphere.infra.binder.segment.from.FunctionTableSegmentB
import
org.apache.shardingsphere.infra.binder.segment.from.SimpleTableSegmentBinderContext;
import
org.apache.shardingsphere.infra.binder.segment.from.TableSegmentBinderContext;
import
org.apache.shardingsphere.infra.binder.statement.SQLStatementBinderContext;
-import
org.apache.shardingsphere.infra.exception.metadata.AmbiguousColumnException;
+import
org.apache.shardingsphere.infra.exception.syntax.AmbiguousColumnException;
import
org.apache.shardingsphere.infra.exception.metadata.ColumnNotFoundException;
import
org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
import
org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/metadata/AmbiguousColumnException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/syntax/AmbiguousColumnException.java
similarity index 79%
rename from
infra/common/src/main/java/org/apache/shardingsphere/infra/exception/metadata/AmbiguousColumnException.java
rename to
infra/common/src/main/java/org/apache/shardingsphere/infra/exception/syntax/AmbiguousColumnException.java
index 5d35b2c2c92..9fa47dcc33d 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/metadata/AmbiguousColumnException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/syntax/AmbiguousColumnException.java
@@ -15,19 +15,19 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.exception.metadata;
+package org.apache.shardingsphere.infra.exception.syntax;
import
org.apache.shardingsphere.infra.exception.core.external.sql.sqlstate.XOpenSQLState;
-import
org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.category.MetaDataSQLException;
+import
org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.category.SyntaxSQLException;
/**
* Ambiguous column exception.
*/
-public final class AmbiguousColumnException extends MetaDataSQLException {
+public final class AmbiguousColumnException extends SyntaxSQLException {
private static final long serialVersionUID = -9002743483594729164L;
public AmbiguousColumnException(final String columnExpression, final
String segmentTypeMessage) {
- super(XOpenSQLState.GENERAL_ERROR, 5, "Column '%s' in %s is
ambiguous.", columnExpression, segmentTypeMessage);
+ super(XOpenSQLState.GENERAL_ERROR, 21, "Column '%s' in %s is
ambiguous.", columnExpression, segmentTypeMessage);
}
}