This is an automated email from the ASF dual-hosted git repository. rmannibucau pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openjpa.git
The following commit(s) were added to refs/heads/master by this push: new a38684b [OPENJPA-2830] ensure we don't drop a SQL statement when running action executeScript a38684b is described below commit a38684b3231e13cef7fa6588194c68f226589d52 Author: Romain Manni-Bucau <rmannibu...@gmail.com> AuthorDate: Tue Sep 15 17:57:24 2020 +0200 [OPENJPA-2830] ensure we don't drop a SQL statement when running action executeScript --- .../src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java index f57293d..1bdbf64 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java @@ -525,9 +525,9 @@ public class SchemaTool { continue; } - int semiColonPosition = sql.indexOf(";"); - if (semiColonPosition != -1) { - sql = sql.substring(0, semiColonPosition); + int semiColonPosition = sql.indexOf(";"); // ';' can be in string, don't blindly drop it + if (sql.endsWith(";")) { + sql = sql.substring(0, sql.length() - 1); } if (sql.isEmpty()) { continue;