-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix](common) If the properties in DDL is not provided, the mysql client will lost connection. #30256
[fix](common) If the properties in DDL is not provided, the mysql client will lost connection. #30256
Conversation
… returned to suppress the exception
run buildall |
TPC-H: Total hot run time: 38709 ms
|
TPC-DS: Total hot run time: 186549 ms
|
ClickBench: Total hot run time: 30.91 s
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
…ent will lost connection (#30256)
fix If the properties in DDL is not provided, the mysql client will lost connection, and no error message is output on the client side.
Case
If the properties in DDL is not provided (wrong DDL), the mysql client will lost connection:
The correct error message should appear here.
Here is the stack trace:
’‘’
org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Resource properties can't be null
at org.apache.doris.analysis.CreateResourceStmt.analyze(CreateResourceStmt.java:84) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:1080) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.executeByLegacy(StmtExecutor.java:728) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:509) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:462) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:245) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.handleQuery(MysqlConnectProcessor.java:166) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.dispatch(MysqlConnectProcessor.java:193) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.processOnce(MysqlConnectProcessor.java:246) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) ~[doris-fe.jar:1.2-SNAPSHOT]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
at java.lang.Thread.run(Unknown Source) ~[?:?]
2024-01-23 09:31:51,757 WARN (mysql-nio-pool-1|316) [ConnectProcessor.handleQueryException():329] Process one query failed because unknown reason:
java.lang.NullPointerException: Cannot invoke "java.util.Map.entrySet()" because "this.map" is null
at org.apache.doris.common.util.PrintableMap.showEntries(PrintableMap.java:108) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.common.util.PrintableMap.toString(PrintableMap.java:97) ~[doris-fe.jar:1.2-SNAPSHOT]
at java.lang.String.valueOf(Unknown Source) ~[?:?]
at java.lang.StringBuilder.append(Unknown Source) ~[?:?]
at org.apache.doris.analysis.CreateResourceStmt.toSql(CreateResourceStmt.java:111) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.AuditLogHelper.logAuditLog(AuditLogHelper.java:101) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.ConnectProcessor.auditAfterExec(ConnectProcessor.java:171) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:267) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.handleQuery(MysqlConnectProcessor.java:166) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.dispatch(MysqlConnectProcessor.java:193) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.processOnce(MysqlConnectProcessor.java:246) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) ~[doris-fe.jar:1.2-SNAPSHOT]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
at java.lang.Thread.run(Unknown Source) ~[?:?]
‘’‘
It's because PrintableMap.toString() does not correctly handle the situation where map is null.
The test results are as follows:
'''sql
mysql> CREATE EXTERNAL RESOURCE 'mysql_v';
ERROR 1105 (HY000): errCode = 2, detailMessage = Resource properties can't be null
'''
Further comments
The modification is small, please evaluate the side effects of this modification