Skip to content

Commit

Permalink
Update error code
Browse files Browse the repository at this point in the history
  • Loading branch information
rstyp authored and yathi committed Feb 21, 2025
1 parent 38b429c commit 23c2d98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion fe/fe-core/src/main/java/com/starrocks/common/ErrorCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public enum ErrorCode {
ERR_NO_SUCH_QUERY(1365, new byte[] {'4', '2', '0', '0', '0'}, "Unknown query id: %s"),

ERR_CANNOT_USER(1396, new byte[] {'H', 'Y', '0', '0', '0'}, "Operation %s failed for %s"),
ERR_SECURE_TRANSPORT_REQUIRED(1403, new byte[] {'0', '8', '0', '0', '4'}, "Server rejected the insecure connection"),
ERR_NON_INSERTABLE_TABLE(1471, new byte[] {'H', 'Y', '0', '0', '0'},
"The target table %s of the %s is not insertable-into"),
ERR_DROP_PARTITION_NON_EXISTENT(1507, new byte[] {'H', 'Y', '0', '0', '0'},
Expand All @@ -123,6 +122,8 @@ public enum ErrorCode {
ERR_EMPTY_PARTITION_IN_TABLE(1748, new byte[] {'H', 'Y', '0', '0', '0'},
"data cannot be inserted into table with empty partition. " +
"Use `SHOW PARTITIONS FROM %s` to see the currently partitions of this table. "),
ERR_SECURE_TRANSPORT_REQUIRED(3159, new byte[] {'H', 'Y', '0', '0', '0'},
"Connections using insecure transport are prohibited"),

// Following is StarRocks's error code, which start from 5000
ERR_WRONG_PROC_PATH(5001, new byte[] {'H', 'Y', '0', '0', '0'}, "Proc path '%s' doesn't exist"),
Expand Down
4 changes: 2 additions & 2 deletions fe/fe-core/src/main/java/com/starrocks/mysql/MysqlProto.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ public static NegotiateResult negotiate(ConnectContext context) throws IOExcepti
}

if (Config.require_secure_transport && !authPacket.isSSLConnRequest()) {
LOG.debug("server refused insecure client connection");
LOG.warn("Connections using insecure transport are prohibited");
ErrorReport.report(ErrorCode.ERR_SECURE_TRANSPORT_REQUIRED);
sendResponsePacket(context);
return new NegotiateResult(null, NegotiateState.SERVER_REJECTED_INSECURE_CONNECTION);
return new NegotiateResult(null, NegotiateState.INSECURE_TRANSPORT_PROHIBITED);
}

if (authPacket.isSSLConnRequest()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public enum NegotiateState {
READ_AUTH_SWITCH_PKG_FAILED("read auth switch package failed"),
ENABLE_SSL_FAILED("enable ssl failed"),
READ_SSL_AUTH_PKG_FAILED("read ssl auth package failed"),
SERVER_REJECTED_INSECURE_CONNECTION("server rejected the insecure connection"),
INSECURE_TRANSPORT_PROHIBITED("Connections using insecure transport are prohibited"),
NOT_SUPPORTED_AUTH_MODE("not supported auth mode"),
KERBEROS_HANDSHAKE_FAILED("kerberos handshake failed"),
KERBEROS_PLUGIN_NOT_LOADED("kerberos plugin not loaded"),
Expand Down

0 comments on commit 23c2d98

Please sign in to comment.