This is an automated email from the ASF dual-hosted git repository.
terrymanu 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 42688a5c49a Fix duplicate vendor codes 10003, 10005 and 10010 in
metadata kernel block (#39767)
42688a5c49a is described below
commit 42688a5c49a7ac02d53a2c8df826280dddb0fc32
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Sep 8 11:59:41 2026 +0800
Fix duplicate vendor codes 10003, 10005 and 10010 in metadata kernel block
(#39767)
- Change DuplicateColumnException error code from 3 to 13 (vendor code
10013)
to stop colliding with ColumnNotFoundException
- Change DuplicateIndexException error code from 5 to 14 (vendor code 10014)
to stop colliding with CheckDatabaseEnvironmentFailedException
- Change ClusterRepositoryPersistException error code from 10 to 16 (vendor
code 10016)
to stop colliding with RuleAndStorageMetaDataMismatchedException
- Register the three messages in sql-error-code.cn.md and
sql-error-code.en.md
Intentional behavior change: duplicate column, duplicate index, and cluster
repository persist errors previously returned 10003/10005/10010 and now
return
10013/10014/10016, restoring one error definition per vendor code.
---
docs/document/content/user-manual/error-code/sql-error-code.cn.md | 3 +++
docs/document/content/user-manual/error-code/sql-error-code.en.md | 3 +++
.../infra/exception/kernel/metadata/DuplicateColumnException.java | 2 +-
.../infra/exception/kernel/metadata/DuplicateIndexException.java | 2 +-
.../cluster/exception/ClusterRepositoryPersistException.java | 2 +-
5 files changed, 9 insertions(+), 3 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 2865bc1e0c6..c32042360ae 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
@@ -25,6 +25,9 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| 10008 | HY000 | Unexpected variable value of '%s', required '%s',
now is '%s'. |
| 10010 | HY000 | Rule and storage meta data mismatched, reason is:
%s. |
| 10012 | HY000 | Load table meta data failed for database '%s' and
tables '%s'. |
+| 10013 | 42S01 | Duplicate column name '%s'.
|
+| 10014 | 42S01 | Index '%s' already exists.
|
+| 10016 | HY000 | Cluster repository persist error.
|
| 10023 | HY000 | Identifier '%s' is ambiguous, matched actual
identifiers: %s. |
| 10024 | HY000 | Can not resolve prepared statement metadata
because %s. |
| 10100 | HY000 | Can not %s storage units '%s'.
|
diff --git a/docs/document/content/user-manual/error-code/sql-error-code.en.md
b/docs/document/content/user-manual/error-code/sql-error-code.en.md
index b87bab90a74..6adec94bdf0 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
@@ -25,6 +25,9 @@ SQL error codes provide by standard `SQL State`, `Vendor
Code` and `Reason`, whi
| 10008 | HY000 | Unexpected variable value of '%s', required '%s',
now is '%s'. |
| 10010 | HY000 | Rule and storage meta data mismatched, reason is:
%s. |
| 10012 | HY000 | Load table meta data failed for database '%s' and
tables '%s'. |
+| 10013 | 42S01 | Duplicate column name '%s'.
|
+| 10014 | 42S01 | Index '%s' already exists.
|
+| 10016 | HY000 | Cluster repository persist error.
|
| 10023 | HY000 | Identifier '%s' is ambiguous, matched actual
identifiers: %s. |
| 10024 | HY000 | Can not resolve prepared statement metadata
because %s. |
| 10100 | HY000 | Can not %s storage units '%s'.
|
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/kernel/metadata/DuplicateColumnException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/kernel/metadata/DuplicateColumnException.java
index a4342718cf4..6570c5f15a2 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/kernel/metadata/DuplicateColumnException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/kernel/metadata/DuplicateColumnException.java
@@ -28,6 +28,6 @@ public final class DuplicateColumnException extends
MetaDataSQLException {
private static final long serialVersionUID = -8930912306382133265L;
public DuplicateColumnException(final String columnExpression) {
- super(XOpenSQLState.DUPLICATE, 3, "Duplicate column name '%s'.",
columnExpression);
+ super(XOpenSQLState.DUPLICATE, 13, "Duplicate column name '%s'.",
columnExpression);
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/kernel/metadata/DuplicateIndexException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/kernel/metadata/DuplicateIndexException.java
index 8e90c2919f0..d435da5f542 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/kernel/metadata/DuplicateIndexException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/kernel/metadata/DuplicateIndexException.java
@@ -28,6 +28,6 @@ public final class DuplicateIndexException extends
MetaDataSQLException {
private static final long serialVersionUID = 1463379993377506978L;
public DuplicateIndexException(final String indexName) {
- super(XOpenSQLState.DUPLICATE, 5, "Index '%s' already exists.",
indexName);
+ super(XOpenSQLState.DUPLICATE, 14, "Index '%s' already exists.",
indexName);
}
}
diff --git
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/exception/ClusterRepositoryPersistException.java
b/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/exception/ClusterRepositoryPersistException.java
index 788226ddcd7..38abcf4e109 100644
---
a/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/exception/ClusterRepositoryPersistException.java
+++
b/mode/type/cluster/repository/api/src/main/java/org/apache/shardingsphere/mode/repository/cluster/exception/ClusterRepositoryPersistException.java
@@ -28,6 +28,6 @@ public final class ClusterRepositoryPersistException extends
MetaDataPersistExce
private static final long serialVersionUID = -6417179023552012152L;
public ClusterRepositoryPersistException(final Exception cause) {
- super(XOpenSQLState.GENERAL_ERROR, 10, cause, "Cluster repository
persist error.");
+ super(XOpenSQLState.GENERAL_ERROR, 16, cause, "Cluster repository
persist error.");
}
}