Skip to content

Commit

Permalink
Optimize error code for encrypt. (apache#23507)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuichenchuxin authored Jan 11, 2023
1 parent 6ca1d03 commit 7c6bef8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ SQL 错误码以标准的 SQL State,Vendor Code 和详细错误信息提供,
| 42000 | 20740 | Insert value of index \`%s\` can not support for encrypt. |
| 0A000 | 20741 | The SQL clause \`%s\` is unsupported in encrypt rule. |
| HY004 | 20780 | Encrypt algorithm \`%s\` initialization failed, reason is: %s. |
| 44000 | 20703 | Cipher column of \`%s\` can not be null in database \`%s\`. |
| 44000 | 20704 | Encrypt column encryptor not found, reason is: %s. |
| 44000 | 20705 | Assisted query column of \`%s\` can not be null in database \`%s\`. |
| 44000 | 20706 | Assisted query encryptor not found, reason is: %s. |
| 44000 | 20707 | Like query column of \`%s\` can not be null in database \`%s\`. |
| 44000 | 20708 | Encrypt like query encryptor not found, reason is: %s. |
| 44000 | 20709 | Can not find encrypt table: \`%s\`. |

### 影子库

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ SQL error codes provide by standard `SQL State`, `Vendor Code` and `Reason`, whi
| 42000 | 20740 | Insert value of index \`%s\` can not support for encrypt. |
| 0A000 | 20741 | The SQL clause \`%s\` is unsupported in encrypt rule. |
| HY004 | 20780 | Encrypt algorithm \`%s\` initialization failed, reason is: %s. |
| 44000 | 20703 | Cipher column of \`%s\` can not be null in database \`%s\`. |
| 44000 | 20704 | Encrypt column encryptor not found, reason is: %s. |
| 44000 | 20705 | Assisted query column of \`%s\` can not be null in database \`%s\`. |
| 44000 | 20706 | Assisted query encryptor not found, reason is: %s. |
| 44000 | 20707 | Like query column of \`%s\` can not be null in database \`%s\`. |
| 44000 | 20708 | Encrypt like query encryptor not found, reason is: %s. |
| 44000 | 20709 | Can not find encrypt table: \`%s\`. |

### Shadow Database

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public final class EncryptAssistedQueryEncryptorNotFoundException extends Encryp
private static final long serialVersionUID = -8700683634804933320L;

public EncryptAssistedQueryEncryptorNotFoundException(final String reason) {
super(XOpenSQLState.CHECK_OPTION_VIOLATION, 6, reason);
super(XOpenSQLState.CHECK_OPTION_VIOLATION, 6, "Assisted query encryptor not found, reason is: %s.", reason);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public final class EncryptEncryptorNotFoundException extends EncryptSQLException
private static final long serialVersionUID = -4847495252826650747L;

public EncryptEncryptorNotFoundException(final String reason) {
super(XOpenSQLState.CHECK_OPTION_VIOLATION, 4, reason);
super(XOpenSQLState.CHECK_OPTION_VIOLATION, 4, "Encrypt column encryptor not found, reason is: %s.", reason);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public final class EncryptLikeQueryEncryptorNotFoundException extends EncryptSQL
private static final long serialVersionUID = 1620586484949188815L;

public EncryptLikeQueryEncryptorNotFoundException(final String reason) {
super(XOpenSQLState.CHECK_OPTION_VIOLATION, 8, reason);
super(XOpenSQLState.CHECK_OPTION_VIOLATION, 8, "Encrypt like query encryptor not found, reason is: %s.", reason);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public final class EncryptTableNotFoundException extends EncryptSQLException {
private static final long serialVersionUID = 8909641495852822938L;

public EncryptTableNotFoundException(final String tableName) {
super(XOpenSQLState.CHECK_OPTION_VIOLATION, 9, "Can not find encrypt table: %s", tableName);
super(XOpenSQLState.CHECK_OPTION_VIOLATION, 9, "Can not find encrypt table: `%s`.", tableName);
}
}

0 comments on commit 7c6bef8

Please sign in to comment.