Skip to content

Commit

Permalink
Refactor SyntaxSQLException (#30748)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Apr 2, 2024
1 parent 15b9d70 commit dc80ce0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| 42000 | 12001 | Can not accept SQL type '%s'. |
| 42000 | 12002 | SQL String can not be NULL or empty. |
| 42000 | 12010 | Can not support variable '%s'. |
| 42S02 | 12011 | Can not find column label '%s'. |
| HV008 | 12020 | Column index '%d' is out of range. |
| HY000 | 12021 | Column '%s' in %s is ambiguous. |
| 42S02 | 12021 | Can not find column label '%s'. |
| HY000 | 12022 | Column '%s' in %s is ambiguous. |
| 0A000 | 12100 | DROP TABLE ... CASCADE is not supported. |

### 连接
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
| 42000 | 12001 | Can not accept SQL type '%s'. |
| 42000 | 12002 | SQL String can not be NULL or empty. |
| 42000 | 12010 | Can not support variable '%s'. |
| 42S02 | 12011 | Can not find column label '%s'. |
| HV008 | 12020 | Column index '%d' is out of range. |
| HY000 | 12021 | Column '%s' in %s is ambiguous. |
| 42S02 | 12021 | Can not find column label '%s'. |
| HY000 | 12022 | Column '%s' in %s is ambiguous. |
| 0A000 | 12100 | DROP TABLE ... CASCADE is not supported. |

### Connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public final class AmbiguousColumnException extends SyntaxSQLException {
private static final long serialVersionUID = -9002743483594729164L;

public AmbiguousColumnException(final String columnExpression, final String segmentTypeMessage) {
super(XOpenSQLState.GENERAL_ERROR, 21, "Column '%s' in %s is ambiguous.", columnExpression, segmentTypeMessage);
super(XOpenSQLState.GENERAL_ERROR, 22, "Column '%s' in %s is ambiguous.", columnExpression, segmentTypeMessage);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public final class ColumnLabelNotFoundException extends SyntaxSQLException {
private static final long serialVersionUID = -4634399403612501335L;

public ColumnLabelNotFoundException(final String columnLabel) {
super(XOpenSQLState.NOT_FOUND, 11, "Can not find column label '%s'.", columnLabel);
super(XOpenSQLState.NOT_FOUND, 21, "Can not find column label '%s'.", columnLabel);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public final class UnsupportedVariableException extends SyntaxSQLException {
private static final long serialVersionUID = 1955281568807066737L;

public UnsupportedVariableException(final String variable) {
super(XOpenSQLState.CHECK_OPTION_VIOLATION, 14, "Can not support variable '%s'.", variable);
super(XOpenSQLState.CHECK_OPTION_VIOLATION, 10, "Can not support variable '%s'.", variable);
}
}

0 comments on commit dc80ce0

Please sign in to comment.