[openjpa] branch master updated: [OPENJPA-2830] ensure we don't drop a SQL statement when running action executeScript

2020-09-15 Thread rmannibucau
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 
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;



[openjpa] branch master updated: [OPENJPA-2829] ensure empty lines are ignored for executeScript action

2020-09-15 Thread rmannibucau
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 8dbdc14  [OPENJPA-2829] ensure empty lines are ignored for 
executeScript action
8dbdc14 is described below

commit 8dbdc143219734d3c8ab05f13fa11b791e643458
Author: Romain Manni-Bucau 
AuthorDate: Tue Sep 15 16:57:43 2020 +0200

[OPENJPA-2829] ensure empty lines are ignored for executeScript action
---
 .../src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java   | 3 +++
 1 file changed, 3 insertions(+)

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 f7d528f..f57293d 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
@@ -529,6 +529,9 @@ public class SchemaTool {
 if (semiColonPosition != -1) {
 sql = sql.substring(0, semiColonPosition);
 }
+if (sql.isEmpty()) {
+continue;
+}
 script.add(sql);
 }