From f7e996c93aaf612ad4af855af0224b7d3dc46548 Mon Sep 17 00:00:00 2001 From: Kazuki Shimizu Date: Wed, 21 Mar 2018 16:58:34 +0900 Subject: [PATCH 1/5] Upgrade to ognl 3.1.17 #1219 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 91658ee1977..cf22a740214 100644 --- a/pom.xml +++ b/pom.xml @@ -146,7 +146,7 @@ ognl ognl - 3.1.16 + 3.1.17 compile true From c6336a2b475515e8f71cbf60feaa6cf6748e23e1 Mon Sep 17 00:00:00 2001 From: Kazuki Shimizu Date: Sun, 25 Mar 2018 14:15:27 +0900 Subject: [PATCH 2/5] Fix to refer the line separator from system property on ScriptRunnerTest #1230 (cherry picked from commit 9e9d968f030de1b74a27cd329e0690b064e4a8d0) --- .../apache/ibatis/jdbc/ScriptRunnerTest.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java b/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java index 017981b230b..2df2cf16b07 100644 --- a/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java +++ b/src/test/java/org/apache/ibatis/jdbc/ScriptRunnerTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2009-2017 the original author or authors. + * Copyright 2009-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,8 @@ public class ScriptRunnerTest extends BaseDataTest { + private static final String LINE_SEPARATOR = System.getProperty("line.separator", "\n"); + @Test @Ignore("This fails with HSQLDB 2.0 due to the create index statements in the schema script") public void shouldRunScriptsBySendingFullScriptAtOnce() throws Exception { @@ -198,9 +200,9 @@ public void testLogging() throws Exception { conn.close(); assertEquals( - "select userid from account where userid = 'j2ee'" + System.getProperty("line.separator") - + System.getProperty("line.separator") + "USERID\t" + System.getProperty("line.separator") - + "j2ee\t" + System.getProperty("line.separator"), sw.toString()); + "select userid from account where userid = 'j2ee'" + LINE_SEPARATOR + + LINE_SEPARATOR + "USERID\t" + LINE_SEPARATOR + + "j2ee\t" + LINE_SEPARATOR, sw.toString()); } @Test @@ -221,9 +223,9 @@ public void testLoggingFullScipt() throws Exception { conn.close(); assertEquals( - "select userid from account where userid = 'j2ee';" + System.getProperty("line.separator") - + System.getProperty("line.separator") + "USERID\t" + System.getProperty("line.separator") - + "j2ee\t" + System.getProperty("line.separator"), sw.toString()); + "select userid from account where userid = 'j2ee';" + LINE_SEPARATOR + + LINE_SEPARATOR + "USERID\t" + LINE_SEPARATOR + + "j2ee\t" + LINE_SEPARATOR, sw.toString()); } private void runJPetStoreScripts(ScriptRunner runner) throws IOException, SQLException { @@ -264,10 +266,10 @@ public void shouldAcceptDelimiterVariations() throws Exception { Reader reader = new StringReader(sql); runner.runScript(reader); - verify(stmt, Mockito.times(1)).execute(eq("line 1;\n" + "line 2;\n\n")); - verify(stmt, Mockito.times(1)).execute(eq("line 3\n")); - verify(stmt, Mockito.times(1)).execute(eq("line 4\n")); - verify(stmt, Mockito.times(1)).execute(eq("line 5\n")); + verify(stmt, Mockito.times(1)).execute(eq("line 1;" + LINE_SEPARATOR + "line 2;" + LINE_SEPARATOR + LINE_SEPARATOR)); + verify(stmt, Mockito.times(1)).execute(eq("line 3" + LINE_SEPARATOR)); + verify(stmt, Mockito.times(1)).execute(eq("line 4" + LINE_SEPARATOR)); + verify(stmt, Mockito.times(1)).execute(eq("line 5" + LINE_SEPARATOR)); } @Test @@ -298,7 +300,7 @@ public void shouldAcceptMultiCharDelimiter() throws Exception { Reader reader = new StringReader(sql); runner.runScript(reader); - verify(stmt, Mockito.times(1)).execute(eq("line 1;\n" + "line 2;\n\n")); - verify(stmt, Mockito.times(1)).execute(eq("line 3\n")); + verify(stmt, Mockito.times(1)).execute(eq("line 1;" + LINE_SEPARATOR + "line 2;" + LINE_SEPARATOR + LINE_SEPARATOR)); + verify(stmt, Mockito.times(1)).execute(eq("line 3" + LINE_SEPARATOR)); } } From 2f1a43cba035b9fb5e52c1869bb5c42232f6a189 Mon Sep 17 00:00:00 2001 From: Iwao AVE! Date: Fri, 16 Nov 2018 02:42:53 +0900 Subject: [PATCH 3/5] fixes #1386 Revert a154e545a6e65dd1bb886aea4569bd5bdd7110a0 . Some users are using VERY old drivers. (cherry picked from commit 8800351748ad88df68ba402ad1464e733685c21b) --- src/main/java/org/apache/ibatis/executor/BaseExecutor.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/apache/ibatis/executor/BaseExecutor.java b/src/main/java/org/apache/ibatis/executor/BaseExecutor.java index dd76cfc7a8a..19420d9adef 100644 --- a/src/main/java/org/apache/ibatis/executor/BaseExecutor.java +++ b/src/main/java/org/apache/ibatis/executor/BaseExecutor.java @@ -282,9 +282,7 @@ protected abstract Cursor doQueryCursor(MappedStatement ms, Object parame protected void closeStatement(Statement statement) { if (statement != null) { try { - if (!statement.isClosed()) { - statement.close(); - } + statement.close(); } catch (SQLException e) { // ignore } From 5294e60b587c7ecd95611d0d54111e5b96c0e966 Mon Sep 17 00:00:00 2001 From: Kazuki Shimizu Date: Sat, 19 Jan 2019 02:59:20 +0900 Subject: [PATCH 4/5] Update license year --- src/main/java/org/apache/ibatis/executor/BaseExecutor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/apache/ibatis/executor/BaseExecutor.java b/src/main/java/org/apache/ibatis/executor/BaseExecutor.java index 19420d9adef..7593bdcd84a 100644 --- a/src/main/java/org/apache/ibatis/executor/BaseExecutor.java +++ b/src/main/java/org/apache/ibatis/executor/BaseExecutor.java @@ -1,5 +1,5 @@ /** - * Copyright 2009-2017 the original author or authors. + * Copyright 2009-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From fc4539970c64e5b86600ff6b84b1d3ab05fbc8f6 Mon Sep 17 00:00:00 2001 From: Kazuki Shimizu Date: Sun, 20 Jan 2019 01:06:17 +0900 Subject: [PATCH 5/5] Fix build error on JDK 6 Fixes gh-1388 --- .travis.yml | 10 +++++++++- pom.xml | 26 +++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7473fa4bd69..45655991c3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: java +dist: trusty sudo: false addons: @@ -6,12 +7,19 @@ addons: packages: - openjdk-6-jdk +# for gh-1388 (workaround for supporting test using OpenJDK 6) +matrix: + include: + - env: JDK='OpenJDK 6' + before_install: + - echo "MAVEN_OPTS='-Dlicense.skip=true'" > ~/.mavenrc + - TRAVIS_JDK_VERSION=openjdk6 + jdk: - oraclejdk9 - oraclejdk8 - openjdk8 - openjdk7 - - openjdk6 before_install: - echo "MAVEN_OPTS='-Dlicense.skip=true'" > ~/.mavenrc diff --git a/pom.xml b/pom.xml index cf22a740214..d5dd2eb9faf 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ + + + + false + + central + Central Repository + http://repo1.maven.org/maven2/ + + + + + + never + + + false + + central + Central Repository + http://repo1.maven.org/maven2/ + + java17