csurong opened a new pull request, #18683: URL: https://github.com/apache/dolphinscheduler/pull/18683
## Was this PR generated or assisted by AI? YES. Assisted with the diagnosis, patch, regression test, and pull request description. ## Purpose of the pull request Closes #18682. The SQL script parser merges consecutive statements when a semicolon is followed by spaces or tabs. Recognize these terminators so each statement is submitted separately to JDBC. ## Brief change log - Trim the line only when checking for the terminating semicolon; preserve the returned SQL text. - Add regression coverage for spaces, tabs, mixed whitespace, and terminators without trailing whitespace in single-line and multiline statements. ## Verify this pull request The new regression test fails against the original parser and passes with the fix. Passed on Java 11: ```sh mvn -pl dolphinscheduler-common -am -Dtest=ClasspathSqlScriptParserTest -Dsurefire.failIfNoSpecifiedTests=false test mvn -pl dolphinscheduler-common spotless:apply mvn -o -pl dolphinscheduler-common spotless:check git diff --check ``` `ClasspathSqlScriptParserTest`: 4 tests, 0 failures, 0 errors, 0 skipped. Parsing the existing PostgreSQL 3.4.0 upgrade script returns 15 statements after the fix, compared with 14 before it. No database execution was performed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
