From 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 14 Jul 2018 21:03:06 +0100 Subject: gentoo resync : 14.07.2018 --- dev-db/hsqldb/files/StringComparator.java | 53 +++ dev-db/hsqldb/files/TestBug1191815.java | 129 +++++++ dev-db/hsqldb/files/hsqldb | 19 ++ dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch | 380 +++++++++++++++++++++ dev-db/hsqldb/files/resolve-config-softlinks.patch | 22 ++ dev-db/hsqldb/files/server.properties | 20 ++ dev-db/hsqldb/files/sqltool.rc | 18 + 7 files changed, 641 insertions(+) create mode 100644 dev-db/hsqldb/files/StringComparator.java create mode 100644 dev-db/hsqldb/files/TestBug1191815.java create mode 100644 dev-db/hsqldb/files/hsqldb create mode 100644 dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch create mode 100644 dev-db/hsqldb/files/resolve-config-softlinks.patch create mode 100644 dev-db/hsqldb/files/server.properties create mode 100644 dev-db/hsqldb/files/sqltool.rc (limited to 'dev-db/hsqldb/files') diff --git a/dev-db/hsqldb/files/StringComparator.java b/dev-db/hsqldb/files/StringComparator.java new file mode 100644 index 000000000000..ae0f7b0fb979 --- /dev/null +++ b/dev-db/hsqldb/files/StringComparator.java @@ -0,0 +1,53 @@ +/* Copyright (c) 2001-2008, The HSQL Development Group + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the HSQL Development Group nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG, + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +package org.hsqldb.lib; + +public class StringComparator implements ObjectComparator { + + public int compare(Object a, Object b) { + + // handle nulls + if (a == b) { + return 0; + } + + if (a == null) { + return -1; + } + + if (b == null) { + return 1; + } + + return ((String) a).compareTo((String) b); + } +} diff --git a/dev-db/hsqldb/files/TestBug1191815.java b/dev-db/hsqldb/files/TestBug1191815.java new file mode 100644 index 000000000000..06c606401cdd --- /dev/null +++ b/dev-db/hsqldb/files/TestBug1191815.java @@ -0,0 +1,129 @@ +/* Copyright (c) 2001-2009, The HSQL Development Group + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the HSQL Development Group nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG, + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +package org.hsqldb.test; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Statement; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +import junit.framework.TestCase; +import junit.framework.TestResult; + +/** + * Created on Apr 28, 2005 + * @author Antranig Basman (antranig@caret.cam.ac.uk) + */ +public class TestBug1191815 extends TestBase { + + public TestBug1191815(String name) { + super(name); + } + + public void test() throws Exception { + + try { + Connection conn = newConnection(); + Statement stmt = conn.createStatement(); + + stmt.executeUpdate("drop table testA if exists;"); + stmt.executeUpdate("create table testA(data timestamp);"); + + TimeZone pst = TimeZone.getTimeZone("PST"); + Calendar cal = new GregorianCalendar(pst); + + cal.clear(); + cal.set(2005, 0, 1, 0, 0, 0); + + + // yyyy-mm-dd hh:mm:ss.fffffffff + Timestamp ts = new Timestamp(cal.getTimeInMillis()); + ts.setNanos(1000); + PreparedStatement ps = + conn.prepareStatement("insert into testA values(?)"); + + ps.setTimestamp(1, ts, cal); + ps.execute(); + ps.setTimestamp(1, ts, null); + ps.execute(); + + String sql = "select * from testA"; + + stmt = conn.createStatement(); + + ResultSet rs = stmt.executeQuery(sql); + + rs.next(); + + Timestamp returned = rs.getTimestamp(1, cal); + + rs.next(); + + Timestamp def = rs.getTimestamp(1, null); + + assertEquals(ts, returned); + assertEquals(ts, def); + } catch (Exception e) { + e.printStackTrace(); + fail(); + } + } + + public static void main(String[] args) throws Exception { + + TestResult result; + TestCase test; + java.util.Enumeration exceptions; + java.util.Enumeration failures; + int count; + + result = new TestResult(); + test = new TestBug1191815("test"); + + test.run(result); + + count = result.failureCount(); + + System.out.println("TestBug1192000 failure count: " + count); + + failures = result.failures(); + + while (failures.hasMoreElements()) { + System.out.println(failures.nextElement()); + } + } +} + diff --git a/dev-db/hsqldb/files/hsqldb b/dev-db/hsqldb/files/hsqldb new file mode 100644 index 000000000000..69920b07f868 --- /dev/null +++ b/dev-db/hsqldb/files/hsqldb @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + use net +} + +start() { + ebegin "Starting HSQL Database" + hsqldb_enable=yes /var/lib/hsqldb/bin/hsqldb start + eend $? +} + +stop() { + ebegin "Stopping HSQL Database" + hsqldb_enable=yes /var/lib/hsqldb/bin/hsqldb stop + eend $? +} diff --git a/dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch b/dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch new file mode 100644 index 000000000000..7f9245597182 --- /dev/null +++ b/dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch @@ -0,0 +1,380 @@ +diff --git a/build/build.xml b/build/build.xml +index 68c446f..e82f00f 100644 +--- a/build/build.xml ++++ b/build/build.xml +@@ -98,16 +98,24 @@ examples: + + + +- ++ ++ ++ ++ ++ ++ + ++ + + +- ++ + ++ + + +- ++ + ++ + + + +@@ -166,6 +174,7 @@ examples: + + + ++ + + + +@@ -183,6 +192,7 @@ examples: + + + ++ + + + +@@ -210,6 +220,7 @@ examples: + + + ++ + + + +@@ -218,6 +229,7 @@ examples: + + + ++ + + + +@@ -244,6 +256,7 @@ examples: + + + ++ + + + +@@ -253,6 +266,43 @@ examples: + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +@@ -279,10 +329,11 @@ examples: + + + ++ + + + +- + T getObject(String columnLabel, Class type) throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++ public T getObject(int ColumnIndex, Class type) throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++ ++//#endif JAVA7 + } +diff --git a/src/org/hsqldb/jdbc/jdbcConnection.java b/src/org/hsqldb/jdbc/jdbcConnection.java +index 5d59464..0c7e08a 100644 +--- a/src/org/hsqldb/jdbc/jdbcConnection.java ++++ b/src/org/hsqldb/jdbc/jdbcConnection.java +@@ -43,13 +43,17 @@ import java.sql.Connection; + import java.sql.DatabaseMetaData; + + //#ifdef JAVA6 +-/* + import java.sql.NClob; + import java.sql.SQLClientInfoException; + import java.sql.SQLXML; +-*/ + + //#endif JAVA6 ++ ++//#ifdef JAVA7 ++import java.util.concurrent.Executor; ++ ++//#endif JAVA7 ++ + import java.sql.PreparedStatement; + import java.sql.SQLException; + import java.sql.SQLWarning; +@@ -2794,4 +2798,31 @@ public class jdbcConnection implements Connection { + */ + + //#endif JAVA6 ++ ++//#ifdef JAVA7 ++ public int getNetworkTimeout() throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++ public void setNetworkTimeout(Executor executor, int millis) throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++ public void abort(Executor executor) throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++ public String getSchema() throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++ public void setSchema(String schema) throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++//#endif JAVA7 + } +diff --git a/src/org/hsqldb/jdbc/jdbcDataSource.java b/src/org/hsqldb/jdbc/jdbcDataSource.java +index 9f79a37..d0ab49b 100644 +--- a/src/org/hsqldb/jdbc/jdbcDataSource.java ++++ b/src/org/hsqldb/jdbc/jdbcDataSource.java +@@ -47,6 +47,11 @@ import javax.sql.DataSource; + //#endif JAVA4 + import org.hsqldb.jdbcDriver; + ++//#ifdef JAVA7 ++import java.sql.SQLFeatureNotSupportedException; ++import java.util.logging.Logger; ++//#endif JAVA7 ++ + // boucherb@users 20040411 - doc 1.7.2 - javadoc updates toward 1.7.2 final + + /** +@@ -312,7 +317,6 @@ public class jdbcDataSource implements Serializable { + } + + //#ifdef JAVA6 +-/* + public T unwrap(Class iface) throws SQLException + { + throw new UnsupportedOperationException("Not supported yet."); +@@ -322,7 +326,14 @@ public class jdbcDataSource implements Serializable { + { + throw new UnsupportedOperationException("Not supported yet."); + } +-*/ + + //#endif JAVA6 ++ ++//#ifdef JAVA7 ++ public Logger getParentLogger() throws SQLFeatureNotSupportedException ++ { ++ throw new SQLFeatureNotSupportedException("Not supported yet."); ++ } ++ ++//#endif JAVA7 + } +diff --git a/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java b/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java +index ffa238d..0480228 100644 +--- a/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java ++++ b/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java +@@ -5650,7 +5650,6 @@ public class jdbcDatabaseMetaData implements DatabaseMetaData { + } + + //#ifdef JAVA6 +-/* + public RowIdLifetime getRowIdLifetime() throws SQLException + { + throw new UnsupportedOperationException("Not supported yet."); +@@ -5694,7 +5693,23 @@ public class jdbcDatabaseMetaData implements DatabaseMetaData { + { + throw new UnsupportedOperationException("Not supported yet."); + } +-*/ + + //#endif JAVA6 ++ ++ ++//#ifdef JAVA7 ++ public boolean generatedKeyAlwaysReturned() throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++ public ResultSet getPseudoColumns(String catalog, String schemaPattern, ++ String tableNamePattern, String columnNamePattern) throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++ ++//#endif JAVA7 ++ + } +diff --git a/src/org/hsqldb/jdbc/jdbcResultSet.java b/src/org/hsqldb/jdbc/jdbcResultSet.java +index 2a6567e..81aecf3 100644 +--- a/src/org/hsqldb/jdbc/jdbcResultSet.java ++++ b/src/org/hsqldb/jdbc/jdbcResultSet.java +@@ -5332,4 +5332,19 @@ public class jdbcResultSet implements ResultSet { + */ + + //#endif JAVA6 ++ ++//#ifdef JAVA7 ++ ++ public T getObject(String columnLabel, Class type) throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++ public T getObject(int columnNum, Class type) throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++//#endif JAVA7 ++ + } +diff --git a/src/org/hsqldb/jdbc/jdbcStatement.java b/src/org/hsqldb/jdbc/jdbcStatement.java +index f84f2e2..38bf8d0 100644 +--- a/src/org/hsqldb/jdbc/jdbcStatement.java ++++ b/src/org/hsqldb/jdbc/jdbcStatement.java +@@ -1588,7 +1588,6 @@ public class jdbcStatement implements Statement { + } + } + //#ifdef JAVA6 +-/* + public void setPoolable(boolean poolable) throws SQLException + { + throw new UnsupportedOperationException("Not supported yet."); +@@ -1608,6 +1607,17 @@ public class jdbcStatement implements Statement { + { + throw new UnsupportedOperationException("Not supported yet."); + } +-*/ + //#endif JAVA6 ++ ++//#ifdef JAVA7 ++ public boolean isCloseOnCompletion() throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++ public void closeOnCompletion() throws SQLException ++ { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++//#endif JAVA7 + } +diff --git a/src/org/hsqldb/jdbcDriver.java b/src/org/hsqldb/jdbcDriver.java +index a377b36..361c074 100644 +--- a/src/org/hsqldb/jdbcDriver.java ++++ b/src/org/hsqldb/jdbcDriver.java +@@ -42,6 +42,11 @@ import org.hsqldb.jdbc.jdbcConnection; + import org.hsqldb.persist.HsqlDatabaseProperties; + import org.hsqldb.persist.HsqlProperties; + ++//#ifdef JAVA7 ++import java.sql.SQLFeatureNotSupportedException; ++import java.util.logging.Logger; ++//#endif JAVA7 ++ + // fredt@users 20011220 - patch 1.7.0 by fredt + // new version numbering scheme + // fredt@users 20020320 - patch 1.7.0 - JDBC 2 support and error trapping +@@ -321,4 +326,12 @@ public class jdbcDriver implements Driver { + DriverManager.registerDriver(new jdbcDriver()); + } catch (Exception e) {} + } ++ ++//#ifdef JAVA7 ++ public Logger getParentLogger() throws SQLFeatureNotSupportedException ++ { ++ throw new SQLFeatureNotSupportedException("Not supported yet."); ++ } ++ ++//#endif JAVA7 + } diff --git a/dev-db/hsqldb/files/resolve-config-softlinks.patch b/dev-db/hsqldb/files/resolve-config-softlinks.patch new file mode 100644 index 000000000000..5a716e6dc3a2 --- /dev/null +++ b/dev-db/hsqldb/files/resolve-config-softlinks.patch @@ -0,0 +1,22 @@ +diff -urpN hsqldb.orig/bin/hsqldb hsqldb/bin/hsqldb +--- hsqldb.orig/bin/hsqldb 2006-07-08 15:55:55.000000000 +0200 ++++ hsqldb/bin/hsqldb 2006-07-08 16:03:28.000000000 +0200 +@@ -282,6 +282,18 @@ else + echo "Auth file '$_AUTH_TEST_PATH' not readable" 1>&2 + exit 2 + } ++ ++ # resolve links - $_AUTH_TEST_PATH may be a softlink ++ while [ -h "$_AUTH_TEST_PATH" ]; do ++ ls=`ls -ld "$_AUTH_TEST_PATH"` ++ link=`expr "$ls" : '.*-> \(.*\)$'` ++ if expr "$link" : '.*/.*' > /dev/null; then ++ _AUTH_TEST_PATH="$link" ++ else ++ _AUTH_TEST_PATH=`dirname "$_AUTH_TEST_PATH"`/"$link" ++ fi ++ done ++ + ls -ld "$_AUTH_TEST_PATH" | grep '^-..------' > /dev/null 2>&1 || { + echo "Fix permissions on '$_AUTH_TEST_PATH' like 'chmod 600 $_AUTH_TEST_PATH'" 1>&2 + exit 2 diff --git a/dev-db/hsqldb/files/server.properties b/dev-db/hsqldb/files/server.properties new file mode 100644 index 000000000000..4827d1cb6ec0 --- /dev/null +++ b/dev-db/hsqldb/files/server.properties @@ -0,0 +1,20 @@ +# Hsqldb Server cfg file. +# See the UNIX Quick Start and the Advanced Topics chapters +# of the Hsqldb User Guide. + +server.database.0=file:/var/lib/hsqldb/db1 +server.urlid.0=localhost + +# Warning! +# When running hsqldb in Server mode, for each additional database +# the server.urlid.X entry must have a proper corresponding urlid +# section in the 'sqltool.rc' file. +# Otherwise you may have problems with shutting down the server. +# +# Note that each server can serve only up to 10 different +# databases simultaneously (with consecutive {0-9} suffixes). + +# An example of additional database. +#server.database.1=file:/var/lib/hsqldb/newdb/newdb +#server.dbname.1=newdb +#server.urlid.1=newdb diff --git a/dev-db/hsqldb/files/sqltool.rc b/dev-db/hsqldb/files/sqltool.rc new file mode 100644 index 000000000000..2e65a6816f3d --- /dev/null +++ b/dev-db/hsqldb/files/sqltool.rc @@ -0,0 +1,18 @@ +# This is a sample SqlTool configuration file, a.k.a. rc file. + +# This is for a hsqldb Server running with default settings on your local +# computer (and for which you have not changed the password for "sa"). +urlid localhost +url jdbc:hsqldb:hsql://localhost +username sa +password + +# Each urlid section in this file corresponds to one of the +# server.urlid.X entries in the 'server.properties' file. +# This is required by the hsqldb init script. + +# An example of additional database. +#urlid newdb +#url jdbc:hsqldb:hsql://localhost/newdb +#username sa +#password -- cgit v1.2.3