Skip to content

Commit

Permalink
Refactor UnsupportedCommandException (apache#20909)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Sep 9, 2022
1 parent 06307aa commit 0e00ae0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| 25000 | 11321 | JDBC does not support operations across multiple logical databases in transaction |
| 25000 | 11322 | Failed to create \`%s\` XA data source |
| 25000 | 11323 | Can not start new XA transaction in a active transaction |
| 42000 | 12000 | Unsupported command: %s |
| 44000 | 13000 | SQL check failed, error message: %s |
| HY000 | 14000 | The table \`%s\` of schema \`%s\` is locked |
| HY000 | 14001 | The table \`%s\` of schema \`%s\` lock wait timeout of %s ms exceeded |
Expand Down Expand Up @@ -95,3 +94,4 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| 42000 | 28001 | Insert value of index \`%s\` can not support for shadow |
| HY004 | 30000 | Unknown exception: %s |
| 0A000 | 30001 | Unsupported operation: %s |
| 42000 | 30002 | Unsupported command: %s |
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
| 25000 | 11321 | JDBC does not support operations across multiple logical databases in transaction |
| 25000 | 11322 | Failed to create \`%s\` XA data source |
| 25000 | 11323 | Can not start new XA transaction in a active transaction |
| 42000 | 12000 | Unsupported command: %s |
| 44000 | 13000 | SQL check failed, error message: %s |
| HY000 | 14000 | The table \`%s\` of schema \`%s\` is locked |
| HY000 | 14001 | The table \`%s\` of schema \`%s\` lock wait timeout of %s ms exceeded |
Expand Down Expand Up @@ -95,3 +94,4 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
| 42000 | 28001 | Insert value of index \`%s\` can not support for shadow |
| HY004 | 30000 | Unknown exception: %s |
| 0A000 | 30001 | Unsupported operation: %s |
| 42000 | 30002 | Unsupported command: %s |
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@

package org.apache.shardingsphere.proxy.frontend.exception;

import org.apache.shardingsphere.infra.util.exception.external.sql.type.kernel.KernelSQLException;
import org.apache.shardingsphere.infra.util.exception.external.sql.sqlstate.XOpenSQLState;
import org.apache.shardingsphere.infra.util.exception.external.sql.type.generic.GenericSQLException;

/**
* Unsupported command exception.
*/
public final class UnsupportedCommandException extends KernelSQLException {
public final class UnsupportedCommandException extends GenericSQLException {

private static final long serialVersionUID = 8010680371699936338L;

public UnsupportedCommandException(final String commandType) {
super(XOpenSQLState.SYNTAX_ERROR, 2000, "Unsupported command: %s", commandType);
super(XOpenSQLState.SYNTAX_ERROR, 2, "Unsupported command: %s", commandType);
}
}

0 comments on commit 0e00ae0

Please sign in to comment.