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 6db66dcc9f2 Adjust error message of ResourceDefinitionException and
RuleDefinitionException (#30708)
6db66dcc9f2 is described below
commit 6db66dcc9f25a613d92579de48257054cd325411
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Mar 31 11:54:25 2024 +0800
Adjust error message of ResourceDefinitionException and
RuleDefinitionException (#30708)
---
.../user-manual/error-code/sql-error-code.cn.md | 18 +++++++++---------
.../user-manual/error-code/sql-error-code.en.md | 18 +++++++++---------
.../MissingRequiredReadStorageUnitException.java | 2 +-
.../infra/exception/rule/DuplicateRuleException.java | 6 +++---
.../rule/InvalidRuleConfigurationException.java | 6 +++---
.../exception/rule/MissingRequiredRuleException.java | 8 ++++----
.../infra/exception/rule/RuleInUsedException.java | 4 ++--
.../storageunit/EmptyStorageUnitException.java | 2 +-
.../MissingRequiredStorageUnitsException.java | 2 +-
.../storageunit/StorageUnitNotExistedException.java | 2 +-
.../exception/MissingRequiredSingleTableException.java | 2 +-
11 files changed, 35 insertions(+), 35 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 76ff2648e0b..1dee32a4407 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
@@ -26,18 +26,18 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| HY000 | 10022 | Can not load table with database name \`%s\` and
data source name \`%s\`. |
| 0A000 | 10030 | Can not drop schema \`%s\` because of contains
tables. |
| 0A000 | 10040 | Unsupported storage type of \`%s.%s\`.
|
-| 44000 | 10100 | Can not process invalid storage units, error
messages are: %s |
-| 44000 | 10101 | Storage units \`%s\` do not exist in database
\`%s\`. |
-| 44000 | 10102 | There is no storage unit in the database \`%s\`.
|
+| 44000 | 10100 | Can not process invalid storage units, error
messages is: %s |
+| 44000 | 10101 | Storage units '%s' do not exist in database '%s'.
|
+| 44000 | 10102 | There is no storage unit in the database '%s'.
|
| 44000 | 10103 | Storage unit '%s' still used by '%s'.
|
| 44000 | 10104 | Duplicate storage unit names '%s'.
|
| 44000 | 10105 | Invalid storage unit status, error message is: %s.
|
-| 44000 | 10106 | Read storage unit \`%s\` does not exist in rule
\`%s\`. |
-| 42000 | 10107 | There is no storage unit in database \`%s\`.
|
-| 44000 | 10200 | Invalid \`%s\` rule \`%s\`, error message is: %s
|
-| 44000 | 10201 | %s rules \`%s\` do not exist in database \`%s\`.
|
-| 44000 | 10202 | %s rules \`%s\` in database \`%s\` are still in
used. |
-| 44000 | 10205 | Duplicate %s rule names \`%s\` in database \`%s\`.
|
+| 44000 | 10106 | Read storage unit '%s' does not exist in rule
'%s'. |
+| 42000 | 10107 | There is no storage unit in database '%s'.
|
+| 44000 | 10200 | Invalid '%s' rule '%s', error message is: %s
|
+| 44000 | 10201 | %s rules '%s' do not exist in database '%s'.
|
+| 44000 | 10202 | %s rules '%s' in database '%s' are still in used.
|
+| 44000 | 10205 | Duplicate %s rule names '%s' in database '%s'.
|
| 44000 | 10210 | There is no rule in database '%s'.
|
| 44000 | 10300 | Algorithm '%s.'%s' initialization failed, reason
is: %s. |
| 44000 | 10301 | '%s' algorithm on %s is required.
|
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 0f93d51f7ec..313314aad31 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
@@ -30,18 +30,18 @@ SQL error codes provide by standard `SQL State`, `Vendor
Code` and `Reason`, whi
| HY000 | 10022 | Can not load table with database name \`%s\` and
data source name \`%s\`. |
| 0A000 | 10030 | Can not drop schema \`%s\` because of contains
tables. |
| 0A000 | 10040 | Unsupported storage type of \`%s.%s\`.
|
-| 44000 | 10100 | Can not process invalid storage units, error
messages are: %s |
-| 44000 | 10101 | Storage units \`%s\` do not exist in database
\`%s\`. |
-| 44000 | 10102 | There is no storage unit in the database \`%s\`.
|
+| 44000 | 10100 | Can not process invalid storage units, error
messages is: %s |
+| 44000 | 10101 | Storage units '%s' do not exist in database '%s'.
|
+| 44000 | 10102 | There is no storage unit in the database '%s'.
|
| 44000 | 10103 | Storage unit '%s' still used by '%s'.
|
| 44000 | 10104 | Duplicate storage unit names '%s'.
|
| 44000 | 10105 | Invalid storage unit status, error message is: %s.
|
-| 44000 | 10106 | Read storage unit \`%s\` does not exist in rule
\`%s\`. |
-| 42000 | 10107 | There is no storage unit in database \`%s\`.
|
-| 44000 | 10200 | Invalid \`%s\` rule \`%s\`, error message is: %s
|
-| 44000 | 10201 | %s rules \`%s\` do not exist in database \`%s\`.
|
-| 44000 | 10202 | %s rules \`%s\` in database \`%s\` are still in
used. |
-| 44000 | 10205 | Duplicate %s rule names \`%s\` in database \`%s\`.
|
+| 44000 | 10106 | Read storage unit '%s' does not exist in rule
'%s'. |
+| 42000 | 10107 | There is no storage unit in database '%s'.
|
+| 44000 | 10200 | Invalid '%s' rule '%s', error message is: %s
|
+| 44000 | 10201 | %s rules '%s' do not exist in database '%s'.
|
+| 44000 | 10202 | %s rules '%s' in database '%s' are still in used.
|
+| 44000 | 10205 | Duplicate %s rule names '%s' in database '%s'.
|
| 44000 | 10210 | There is no rule in database '%s'.
|
| 44000 | 10300 | Algorithm '%s.'%s' initialization failed, reason
is: %s. |
| 44000 | 10301 | '%s' algorithm on %s is required.
|
diff --git
a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/exception/MissingRequiredReadStorageUnitException.java
b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/exception/MissingRequiredReadStorageUnitException.java
index 64ba4765f4b..8c9a1e60a76 100644
---
a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/exception/MissingRequiredReadStorageUnitException.java
+++
b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/exception/MissingRequiredReadStorageUnitException.java
@@ -28,6 +28,6 @@ public final class MissingRequiredReadStorageUnitException
extends StorageUnitDe
private static final long serialVersionUID = -4252553422332603648L;
public MissingRequiredReadStorageUnitException(final String ruleName,
final String storageUnitName) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 6, "Read storage unit `%s`
does not exist in rule `%s`.", storageUnitName, ruleName);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 6, "Read storage unit '%s'
does not exist in rule '%s'.", storageUnitName, ruleName);
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/DuplicateRuleException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/DuplicateRuleException.java
index 8f201ed7d63..dc89551c2a8 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/DuplicateRuleException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/DuplicateRuleException.java
@@ -30,14 +30,14 @@ public final class DuplicateRuleException extends
RuleDefinitionException {
private static final long serialVersionUID = -1738699538105858939L;
public DuplicateRuleException(final String ruleType, final String
databaseName, final Collection<String> ruleNames) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 5,
String.format("Duplicate %s rule names `%s` in database `%s`.", ruleType,
ruleNames, databaseName));
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 5,
String.format("Duplicate %s rule names '%s' in database '%s'.", ruleType,
ruleNames, databaseName));
}
public DuplicateRuleException(final String ruleType, final
Collection<String> ruleNames) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 5,
String.format("Duplicate %s rule names `%s`.", ruleType, ruleNames));
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 5,
String.format("Duplicate %s rule names '%s'.", ruleType, ruleNames));
}
public DuplicateRuleException(final String type, final String
databaseName) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 5,
String.format("Duplicate `%s` in database `%s`.", type, databaseName));
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 5,
String.format("Duplicate '%s' in database '%s'.", type, databaseName));
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/InvalidRuleConfigurationException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/InvalidRuleConfigurationException.java
index a5ebd010df3..a964b47007c 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/InvalidRuleConfigurationException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/InvalidRuleConfigurationException.java
@@ -30,14 +30,14 @@ public final class InvalidRuleConfigurationException
extends RuleDefinitionExcep
private static final long serialVersionUID = 6085010920008859376L;
public InvalidRuleConfigurationException(final String ruleType, final
String rule, final String errorMessage) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 0, "Invalid `%s` rule
`%s`, error message is: %s", ruleType, rule, errorMessage);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 0, "Invalid '%s' rule
'%s', error message is: %s", ruleType, rule, errorMessage);
}
public InvalidRuleConfigurationException(final String ruleType, final
Collection<String> rules, final Collection<String> errorMessages) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 0, "Invalid `%s` rules
`%s`, error messages are: %s", ruleType, rules, errorMessages);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 0, "Invalid '%s' rules
'%s', error messages are: %s", ruleType, rules, errorMessages);
}
public InvalidRuleConfigurationException(final String ruleType, final
String errorMessage) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 0, "Invalid `%s` rule,
error message is: %s", ruleType, errorMessage);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 0, "Invalid '%s' rule,
error message is: %s", ruleType, errorMessage);
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/MissingRequiredRuleException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/MissingRequiredRuleException.java
index 06d3e6cff90..b1ac637ffa7 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/MissingRequiredRuleException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/MissingRequiredRuleException.java
@@ -34,18 +34,18 @@ public final class MissingRequiredRuleException extends
RuleDefinitionException
}
public MissingRequiredRuleException(final String ruleType, final String
databaseName) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 1, "%s rule does not exist
in database `%s`.", ruleType, databaseName);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 1, "%s rule does not exist
in database '%s'.", ruleType, databaseName);
}
public MissingRequiredRuleException(final String ruleType, final
Collection<String> ruleNames) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 1, "%s rules `%s` do not
exist.", ruleType, ruleNames);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 1, "%s rules '%s' do not
exist.", ruleType, ruleNames);
}
public MissingRequiredRuleException(final String ruleType, final String
databaseName, final String ruleName) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 1, "%s rule `%s` do not
exist in database `%s`.", ruleType, ruleName, databaseName);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 1, "%s rule '%s' do not
exist in database '%s'.", ruleType, ruleName, databaseName);
}
public MissingRequiredRuleException(final String ruleType, final String
databaseName, final Collection<String> ruleNames) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 1, "%s rules `%s` do not
exist in database `%s`.", ruleType, ruleNames, databaseName);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 1, "%s rules '%s' do not
exist in database '%s'.", ruleType, ruleNames, databaseName);
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/RuleInUsedException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/RuleInUsedException.java
index 020dfad9455..804942f60ed 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/RuleInUsedException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/rule/RuleInUsedException.java
@@ -30,10 +30,10 @@ public final class RuleInUsedException extends
RuleDefinitionException {
private static final long serialVersionUID = 3308787279125477660L;
public RuleInUsedException(final String ruleType, final String
databaseName, final Collection<String> ruleNames) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 2, "%s rules `%s` in
database `%s` are still in used.", ruleType, ruleNames, databaseName);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 2, "%s rules '%s' in
database '%s' are still in used.", ruleType, ruleNames, databaseName);
}
public RuleInUsedException(final String ruleType, final String
databaseName, final Collection<String> ruleNames, final String usingType) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 2, "%s rules `%s` in
database `%s` are still in used by %s.", ruleType, ruleNames, databaseName,
usingType);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 2, "%s rules '%s' in
database '%s' are still in used by %s.", ruleType, ruleNames, databaseName,
usingType);
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/EmptyStorageUnitException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/EmptyStorageUnitException.java
index 1d657b5ddd3..a743b129b99 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/EmptyStorageUnitException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/EmptyStorageUnitException.java
@@ -28,6 +28,6 @@ public final class EmptyStorageUnitException extends
ResourceDefinitionException
private static final long serialVersionUID = 1704331180489268L;
public EmptyStorageUnitException(final String databaseName) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 2, "There is no storage
unit in the database `%s`.", databaseName);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 2, "There is no storage
unit in the database '%s'.", databaseName);
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/MissingRequiredStorageUnitsException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/MissingRequiredStorageUnitsException.java
index b956ccf335a..264765c0708 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/MissingRequiredStorageUnitsException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/MissingRequiredStorageUnitsException.java
@@ -30,6 +30,6 @@ public final class MissingRequiredStorageUnitsException
extends ResourceDefiniti
private static final long serialVersionUID = 1704331180489268L;
public MissingRequiredStorageUnitsException(final String databaseName,
final Collection<String> storageUnitNames) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 1, "Storage units `%s` do
not exist in database `%s`.", storageUnitNames, databaseName);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 1, "Storage units '%s' do
not exist in database '%s'.", storageUnitNames, databaseName);
}
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/StorageUnitNotExistedException.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/StorageUnitNotExistedException.java
index e0729ae1ba4..0120304dd39 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/StorageUnitNotExistedException.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/exception/storageunit/StorageUnitNotExistedException.java
@@ -32,6 +32,6 @@ public final class StorageUnitNotExistedException extends
ResourceDefinitionExce
}
public StorageUnitNotExistedException(final String databaseName) {
- super(XOpenSQLState.SYNTAX_ERROR, 7, "There is no storage unit in
database `%s`.", databaseName);
+ super(XOpenSQLState.SYNTAX_ERROR, 7, "There is no storage unit in
database '%s'.", databaseName);
}
}
diff --git
a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/exception/MissingRequiredSingleTableException.java
b/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/exception/MissingRequiredSingleTableException.java
index dfdb87ede44..97d167e40ce 100644
---
a/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/exception/MissingRequiredSingleTableException.java
+++
b/kernel/single/distsql/handler/src/main/java/org/apache/shardingsphere/single/distsql/handler/exception/MissingRequiredSingleTableException.java
@@ -28,6 +28,6 @@ public final class MissingRequiredSingleTableException
extends RuleDefinitionExc
private static final long serialVersionUID = 3155006580453893122L;
public MissingRequiredSingleTableException(final String storageUnitName,
final String tableName) {
- super(XOpenSQLState.CHECK_OPTION_VIOLATION, 6, "Missing required table
`%s` in storage unit `%s`.", tableName, storageUnitName);
+ super(XOpenSQLState.CHECK_OPTION_VIOLATION, 6, "Missing required table
'%s' in storage unit '%s'.", tableName, storageUnitName);
}
}