diff --git a/remove-coverage-test.patch b/0001-Remove-coverage-test.patch similarity index 99% rename from remove-coverage-test.patch rename to 0001-Remove-coverage-test.patch index ae1e4f7..58a84ea 100644 --- a/remove-coverage-test.patch +++ b/0001-Remove-coverage-test.patch @@ -8,7 +8,7 @@ Subject: [PATCH] Remove coverage test 1 file changed, 162 deletions(-) diff --git a/build.xml b/build.xml -index 8c4e9f5d..3d13bf45 100644 +index 8c4e9f5..3d13bf4 100644 --- a/build.xml +++ b/build.xml @@ -1279,82 +1279,6 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o @@ -188,5 +188,5 @@ index 8c4e9f5d..3d13bf45 100644 -- -2.37.1 +2.48.1 diff --git a/remove-authentication-plugin.patch b/0002-Remove-authentication-plugin.patch similarity index 99% rename from remove-authentication-plugin.patch rename to 0002-Remove-authentication-plugin.patch index a7e41e0..270f72f 100644 --- a/remove-authentication-plugin.patch +++ b/0002-Remove-authentication-plugin.patch @@ -11,7 +11,7 @@ Subject: [PATCH] remove AuthenticationOciClient plugin due to missing oracle dep delete mode 100644 src/main/protocol-impl/java/com/mysql/cj/protocol/a/authentication/AuthenticationOciClient.java diff --git a/src/main/protocol-impl/java/com/mysql/cj/protocol/a/NativeAuthenticationProvider.java b/src/main/protocol-impl/java/com/mysql/cj/protocol/a/NativeAuthenticationProvider.java -index 0d94061d..58bbf23b 100644 +index 0d94061..58bbf23 100644 --- a/src/main/protocol-impl/java/com/mysql/cj/protocol/a/NativeAuthenticationProvider.java +++ b/src/main/protocol-impl/java/com/mysql/cj/protocol/a/NativeAuthenticationProvider.java @@ -58,7 +58,6 @@ import com.mysql.cj.protocol.a.NativeConstants.StringSelfDataType; @@ -32,7 +32,7 @@ index 0d94061d..58bbf23b 100644 // plugins from authenticationPluginClasses connection parameter diff --git a/src/main/protocol-impl/java/com/mysql/cj/protocol/a/authentication/AuthenticationOciClient.java b/src/main/protocol-impl/java/com/mysql/cj/protocol/a/authentication/AuthenticationOciClient.java deleted file mode 100644 -index 473e532f..00000000 +index 473e532..0000000 --- a/src/main/protocol-impl/java/com/mysql/cj/protocol/a/authentication/AuthenticationOciClient.java +++ /dev/null @@ -1,177 +0,0 @@ @@ -214,7 +214,7 @@ index 473e532f..00000000 - } -} diff --git a/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties b/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties -index e4709a75..d29cdeb3 100644 +index 8a5bfc1..53affc4 100644 --- a/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties +++ b/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties @@ -50,12 +50,6 @@ AuthenticationLdapSaslClientPlugin.MissingLdapServerHostname=An LDAP Server host @@ -231,5 +231,5 @@ index e4709a75..d29cdeb3 100644 AuthenticationProvider.BadDefaultAuthenticationPlugin=Improper value "{0}" for property ''defaultAuthenticationPlugin''. AuthenticationProvider.DefaultAuthenticationPluginIsNotListed=Default authentication plugin "{0}" is neither one of the built-in plugins nor one of the plugins listed in ''authenticationPlugins''. -- -2.35.1 +2.48.1 diff --git a/remove-StatementsTest.patch b/0003-Remove-StatementsTest.patch similarity index 93% rename from remove-StatementsTest.patch rename to 0003-Remove-StatementsTest.patch index 4f5c65f..201a330 100644 --- a/remove-StatementsTest.patch +++ b/0003-Remove-StatementsTest.patch @@ -8,10 +8,10 @@ Subject: [PATCH] patch 1 file changed, 50 deletions(-) diff --git a/src/test/java/testsuite/regression/StatementRegressionTest.java b/src/test/java/testsuite/regression/StatementRegressionTest.java -index b5c53e9a..89483a07 100644 +index 7e5a5f8..8e77de5 100644 --- a/src/test/java/testsuite/regression/StatementRegressionTest.java +++ b/src/test/java/testsuite/regression/StatementRegressionTest.java -@@ -154,7 +154,6 @@ import com.mysql.cj.util.TimeUtil; +@@ -156,7 +156,6 @@ import com.mysql.cj.util.TimeUtil; import testsuite.BaseQueryInterceptor; import testsuite.BaseTestCase; import testsuite.UnreliableSocketFactory; @@ -19,7 +19,7 @@ index b5c53e9a..89483a07 100644 /** * Regression tests for the Statement class -@@ -11602,20 +11601,6 @@ public class StatementRegressionTest extends BaseTestCase { +@@ -11607,20 +11606,6 @@ public class StatementRegressionTest extends BaseTestCase { } } @@ -40,7 +40,7 @@ index b5c53e9a..89483a07 100644 /** * Tests fix for Bug#71929 (18346501), Prefixing query with double comments cancels query DML validation. -@@ -11643,41 +11628,6 @@ public class StatementRegressionTest extends BaseTestCase { +@@ -11648,41 +11633,6 @@ public class StatementRegressionTest extends BaseTestCase { } } @@ -83,5 +83,5 @@ index b5c53e9a..89483a07 100644 * Tests fix for Bug#101389 (32089018), GETWARNINGS SHOULD CHECK WARNING COUNT BEFORE SENDING SHOW. * -- -2.34.1 +2.48.1 diff --git a/0004-Port-to-Java-21.patch b/0004-Port-to-Java-21.patch new file mode 100644 index 0000000..576594b --- /dev/null +++ b/0004-Port-to-Java-21.patch @@ -0,0 +1,42 @@ +From 790e9bdb1c73b3695a1bea9d0fccf91341728fc7 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Fri, 24 Jan 2025 10:09:16 +0100 +Subject: [PATCH 4/4] Port to Java 21 + +--- + build.xml | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +diff --git a/build.xml b/build.xml +index 3d13bf4..b3437d5 100644 +--- a/build.xml ++++ b/build.xml +@@ -350,17 +350,6 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o + + + +- +- +- +- +- +- +- +- +- +- +- + + + +-- +2.48.1 + diff --git a/java-11-migration.patch b/java-11-migration.patch deleted file mode 100644 index d0f7c4e..0000000 --- a/java-11-migration.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff --git a/build.xml b/build.xml -index 9c8ab7d..040318c 100644 ---- a/build.xml -+++ b/build.xml -@@ -97,7 +97,7 @@ com.mysql.cj.extra.libs=<full_path_to_connector-j-jardeps> - # - Must point to JDK home directory. - # - Also used for testing if 'com.mysql.cj.testsuite.jvm' is not provided. - # - Mandatory. --com.mysql.cj.build.jdk=<full_path_to_jdk1.8> -+com.mysql.cj.build.jdk=<full_path_to_jdk17> - - # Single JVM/MySQL tests: - # - Must point to JDK or JRE home directory. -@@ -259,7 +259,7 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o - - - -- -+ - - - -@@ -352,12 +352,12 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o - - - -- -+ - - - - -- -+ - - - -@@ -385,7 +385,7 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o - - - -- -+ - - - -diff --git a/src/build/misc/rpm.spec.in b/src/build/misc/rpm.spec.in -index d2926bb..9cf507b 100644 ---- a/src/build/misc/rpm.spec.in -+++ b/src/build/misc/rpm.spec.in -@@ -84,13 +84,13 @@ BuildRequires: ant - %endif - - %if 0%{!?with_java:1} --BuildRequires: java-devel >= 1:1.8.0 -+BuildRequires: java-devel >= 1:17 - %endif - - %if 0%{?sles12:1} || 0%{?sles15:1} --Requires: java-headless >= 1.8.0 -+Requires: java-headless >= 17 - %else --Requires: java-headless >= 1:1.8.0 -+Requires: java-headless >= 1:17 - %endif - - %description diff --git a/mysql-connector-java.spec b/mysql-connector-java.spec index f169c80..269900c 100644 --- a/mysql-connector-java.spec +++ b/mysql-connector-java.spec @@ -1,58 +1,27 @@ - -Summary: Official JDBC driver for MySQL -Name: mysql-connector-java -Version: 8.0.30 -Release: 8%{?dist} -Epoch: 1 -License: GPL-2.0-only -URL: http://dev.mysql.com/downloads/connector/j/ -Source0: %{name}-%{version}-nojars.tar.xz - -# Mysql has a mirror redirector for its downloads -# You can get this tarball by following a link from: -# http://dev.mysql.com/get/Downloads/Connector-J/%%{name}-%%{version}.tar.gz -# -# OR -# https://github.com/mysql/mysql-connector-j/archive/%%{version}.tar.gz -# Following prebuilt jars and sources have been removed from the tarball: -# -# %%{name}-%%{version}-bin.jar -# lib/c3p0-0.9.1-pre6.jar -# lib/c3p0-0.9.1-pre6.src.zip -# lib/jboss-common-jdbc-wrapper.jar -# lib/jboss-common-jdbc-wrapper-src.jar -# lib/protobuf-java-3.6.1.jar -# lib/slf4j-api-1.6.1.jar -# -# See http://bugs.mysql.com/bug.php?id=28512 for details. - -# To make it easier a script generate-tarball.sh has been created: -# ./generate-tarball.sh version -# will create a new tarball compressed with xz and without those jar files. -Source1: generate-tarball.sh - -Patch1: remove-coverage-test.patch -Patch2: java-11-migration.patch -Patch3: remove-authentication-plugin.patch -Patch4: remove-StatementsTest.patch - -BuildArch: noarch +Name: mysql-connector-java +Epoch: 1 +Version: 8.0.30 +Release: 8%{?dist} +Summary: Official JDBC driver for MySQL +License: GPL-2.0-only +URL: https://dev.mysql.com/downloads/connector/j/ +BuildArch: noarch ExclusiveArch: %{java_arches} noarch -BuildRequires: ant >= 1.6.0 -BuildRequires: ant-junit -BuildRequires: apache-commons-logging -BuildRequires: git -BuildRequires: javassist -BuildRequires: java-devel >= 1:1.6.0 -BuildRequires: javapackages-local -BuildRequires: junit5 -BuildRequires: protobuf-java -BuildRequires: slf4j -BuildRequires: java-17-openjdk-devel +# Generated with generate-tarball.sh +Source0: %{name}-%{version}-nojars.tar.xz +Source1: generate-tarball.sh -Requires: slf4j -Requires: java +Patch: 0001-Remove-coverage-test.patch +Patch: 0002-Remove-authentication-plugin.patch +Patch: 0003-Remove-StatementsTest.patch +Patch: 0004-Port-to-Java-21.patch + +BuildRequires: javapackages-local-openjdk21 +BuildRequires: ant-junit5 +BuildRequires: javassist +BuildRequires: protobuf-java +BuildRequires: slf4j %description MySQL Connector/J is a native Java driver that converts JDBC (Java Database @@ -64,27 +33,8 @@ IV JDBC driver and has a complete JDBC feature set that supports the capabilities of MySQL. %prep -%setup -q -n mysql-connector-j-%{version} - -# fix line endings -for file in README README.md; do - sed -i.orig 's|\r||g' $file - touch -r $file.orig $file - rm $file.orig -done - +%autosetup -p1 -C sed -i 's/>@.*%{version}