Repository navigation
Conversation
Extract the CLI-only changes from commit 2bdf566 in apache#19523.
| .println( | ||
| String.format( | ||
| CliMessages.LOG_MSG_ARG_240992E0, Objects.toString(SUCCESS_MESSAGE))); | ||
| String.format(CliMessages.LOG_MSG_ARG_240992E0, SUCCESS_MESSAGE + serverMessage)); |
There was a problem hiding this comment.
minor iotdb-client/cli/src/main/java/org/apache/iotdb/cli/AbstractCli.java:780 — Success message and server status concatenated without separator
When getLastStatementMessage() returns a non-blank message, SUCCESS_MESSAGE + serverMessage joins the two sentences with no delimiter: EXCEPTION_THE_STATEMENT_IS_EXECUTED_SUCCESSFULLY_B07F8CCB ends with "." and server messages such as "Table deletion task %s has been submitted..." have no leading space, so the CLI prints "Msg: The statement is executed successfully.Table deletion task 123 has been submitted for asynchronous execution." The rewritten tests (AbstractCliTest:140-146 and :168-174) assert this exact malformed string, locking the defect in.
Fix: Join with a separator, e.g. String.format(CliMessages.LOG_MSG_ARG_240992E0, SUCCESS_MESSAGE + " " + serverMessage), and update the two test expectations to include the space.
Summary
Append a server-provided status message to the standard CLI success message on one line, separated by a space.
Example
SQL:
DROP TABLE test_tableServer status:
Table deletion task 123 has been submitted for asynchronous execution.Before: the server status and generic success message are printed on separate lines.
After:
Msg: The statement is executed successfully. Table deletion task 123 has been submitted for asynchronous execution.is printed on one line.Tests
AbstractCliTest#testServerMessageIsAppendedToSuccessMessageAbstractCliTest#testNoOpServerMessageIsAppendedToSuccessMessageExplainJsonCliOutputIT#testServerMessageIsAppendedToSuccessMessageruns a real CLIDROP TABLEagainst the test cluster and checks the combined output line.Split out from #19523.