diff --git a/8.0.16.tar.gz b/8.0.16.tar.gz deleted file mode 100644 index 54f4a59607bf39ed0ed75bc3d6c0831093384cfd..0000000000000000000000000000000000000000 Binary files a/8.0.16.tar.gz and /dev/null differ diff --git a/mysql-connector-java-8.0.30.tar.gz b/mysql-connector-java-8.0.30.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..83c7629d3b874e32a551912fd38b5c259bbd442c Binary files /dev/null and b/mysql-connector-java-8.0.30.tar.gz differ diff --git a/mysql-connector-java.spec b/mysql-connector-java.spec index d5c2fda28bcc4268c4386e04565e00fca7b019b0..19bfaab8f53991597228d788b5200b3250df3ec8 100644 --- a/mysql-connector-java.spec +++ b/mysql-connector-java.spec @@ -1,17 +1,20 @@ Summary: Official JDBC driver for MySQL Name: mysql-connector-java -Version: 8.0.16 +Version: 8.0.30 Release: 1 Epoch: 1 License: GPLv2 with exceptions URL: http://dev.mysql.com/downloads/connector/j/ -Source0: https://github.com/mysql/mysql-connector-j/archive/%{version}.tar.gz -Patch4: remove-coverage-test.patch +Source0: https://github.com/mysql/mysql-connector-j/archive/%{version}/%{name}-%{version}.tar.gz + +Patch1: remove-coverage-test.patch +Patch2: remove-authentication-plugin.patch +Patch3: remove-StatementsTest.patch BuildArch: noarch BuildRequires: ant >= 1.6.0 ant-contrib >= 1.0 ant-junit apache-commons-logging c3p0 git -BuildRequires: hibernate java-devel >= 1:1.6.0 javapackages-local jta >= 1.0 junit -BuildRequires: protobuf-java slf4j +BuildRequires: hibernate java-devel >= 1:1.6.0 javapackages-local jta >= 1.0 junit5 +BuildRequires: protobuf-java slf4j Requires: jta >= 1.0 slf4j %description @@ -32,7 +35,10 @@ for file in README README.md; do rm $file.orig done sed -i 's/>@.*%{version} - 8.0.16-1 +* Tue Sep 26 2023 xu_ping <707078654@qq.com> - 1:8.0.30-1 +- Upgrade to 8.0.30 + +* Fri Feb 25 2022 houyingchao - 1:8.0.16-1 - Upgrade to 8.0.16 - Fix CVE-2019-2692 -* Fri Jul 24 2020 leiju - 8.0.15-1 +* Fri Jul 24 2020 leiju - 1:8.0.15-1 - Package init diff --git a/remove-StatementsTest.patch b/remove-StatementsTest.patch new file mode 100644 index 0000000000000000000000000000000000000000..4f7ba2f4509ff1ab264cf80785ded3a9a9f9add5 --- /dev/null +++ b/remove-StatementsTest.patch @@ -0,0 +1,86 @@ +From b9a7a929f547d1408c42aca31603d52518f6296b Mon Sep 17 00:00:00 2001 +From: Zuzana Miklankova +Date: Tue, 18 Jan 2022 15:04:09 +0100 +Subject: [PATCH] patch + +--- + .../regression/StatementRegressionTest.java | 50 ------------------- + 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 +--- 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; + import testsuite.BaseQueryInterceptor; + import testsuite.BaseTestCase; + import testsuite.UnreliableSocketFactory; +-import testsuite.simple.StatementsTest; + + /** + * Regression tests for the Statement class +@@ -11602,20 +11601,6 @@ public class StatementRegressionTest extends BaseTestCase { + } + } + +- /** +- * Tests fix for Bug#23204652, CURSOR POSITIONING API'S DOESNOT CHECK THE VALIDITY OF RESULTSET. +- * +- * @throws Exception +- * +- * @see StatementsTest#testResultSetProducingQueries() +- */ +- @Test +- public void testBug23204652() throws Exception { +- assertThrows(SQLException.class, "Statement\\.executeQuery\\(\\) cannot issue statements that do not produce result sets\\.", () -> { +- this.stmt.executeQuery("DO 1 + 2"); +- return null; +- }); +- } + + /** + * Tests fix for Bug#71929 (18346501), Prefixing query with double comments cancels query DML validation. +@@ -11643,41 +11628,6 @@ public class StatementRegressionTest extends BaseTestCase { + } + } + +- /** +- * Test fix for Bug#103612 (32902019), Incorrectly identified WITH...SELECT as unsafe for read-only connections. +- * +- * @throws Exception +- * +- * @see StatementsTest#testReadOnlySafeStatements() +- */ +- @Test +- public void testBug103612() throws Exception { +- assumeTrue(versionMeetsMinimum(8, 0, 1), "MySQL 8.0.1+ is required to run this test."); +- +- createTable("testBug103612", "(id INT)"); +- String query = "WITH cte AS (SELECT * FROM testBug103612) SELECT * FROM cte"; +- +- boolean useSPS = false; +- boolean readOnly = false; +- do { +- final String testCase = String.format("Case [SPS: %s, ReadOnly: %s]", useSPS ? "Y" : "N", readOnly ? "Y" : "N"); +- +- Properties props = new Properties(); +- props.setProperty(PropertyKey.useServerPrepStmts.getKeyName(), Boolean.toString(useSPS)); +- Connection testConn = getConnectionWithProps(props); +- testConn.setReadOnly(readOnly); +- +- try (Statement testStmt = testConn.createStatement()) { +- assertTrue(testStmt.execute(query), testCase); +- } +- try (PreparedStatement testPstmt = testConn.prepareStatement(query)) { +- assertTrue(testPstmt.execute(), testCase); +- } +- +- testConn.close(); +- } while ((useSPS = !useSPS) || (readOnly = !readOnly)); +- } +- + /** + * Tests fix for Bug#101389 (32089018), GETWARNINGS SHOULD CHECK WARNING COUNT BEFORE SENDING SHOW. + * +-- +2.34.1 diff --git a/remove-authentication-plugin.patch b/remove-authentication-plugin.patch new file mode 100644 index 0000000000000000000000000000000000000000..aed85cc9c6e742d44224b4b6c7d4f0b6b355cf27 --- /dev/null +++ b/remove-authentication-plugin.patch @@ -0,0 +1,234 @@ +From 47793b89300a19c5fd13b781f03dd580fc0186a6 Mon Sep 17 00:00:00 2001 +From: Ondrej Dubaj +Date: Tue, 18 Jan 2022 14:58:57 +0100 +Subject: [PATCH] remove AuthenticationOciClient plugin due to missing oracle dependency + +--- + .../a/NativeAuthenticationProvider.java | 2 - + .../AuthenticationOciClient.java | 177 ------------------ + .../cj/LocalizedErrorMessages.properties | 6 - + 3 files changed, 185 deletions(-) + 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 +--- 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; + import com.mysql.cj.protocol.a.authentication.AuthenticationFidoClient; + import com.mysql.cj.protocol.a.authentication.AuthenticationKerberosClient; + import com.mysql.cj.protocol.a.authentication.AuthenticationLdapSaslClientPlugin; +-import com.mysql.cj.protocol.a.authentication.AuthenticationOciClient; + import com.mysql.cj.protocol.a.authentication.CachingSha2PasswordPlugin; + import com.mysql.cj.protocol.a.authentication.MysqlClearPasswordPlugin; + import com.mysql.cj.protocol.a.authentication.MysqlNativePasswordPlugin; +@@ -256,7 +255,6 @@ public class NativeAuthenticationProvider implements AuthenticationProvider { +- public static String PLUGIN_NAME = "authentication_oci_client"; +- +- private String sourceOfAuthData = PLUGIN_NAME; +- +- protected Protocol protocol = null; +- private MysqlCallbackHandler usernameCallbackHandler = null; +- private String fingerprint = null; +- private RSAPrivateKey privateKey = null; +- +- @Override +- public void init(Protocol prot, MysqlCallbackHandler cbh) { +- this.protocol = prot; +- this.usernameCallbackHandler = cbh; +- } +- +- @Override +- public void reset() { +- this.fingerprint = null; +- this.privateKey = null; +- } +- +- @Override +- public void destroy() { +- reset(); +- this.protocol = null; +- this.usernameCallbackHandler = null; +- } +- +- @Override +- public String getProtocolPluginName() { +- return PLUGIN_NAME; +- } +- +- @Override +- public boolean requiresConfidentiality() { +- return false; +- } +- +- @Override +- public boolean isReusable() { +- return false; +- } +- +- @Override +- public void setAuthenticationParameters(String user, String password) { +- if (user == null && this.usernameCallbackHandler != null) { +- // Fall back to system login user. +- this.usernameCallbackHandler.handle(new UsernameCallback(System.getProperty("user.name"))); +- } +- } +- +- @Override +- public void setSourceOfAuthData(String sourceOfAuthData) { +- this.sourceOfAuthData = sourceOfAuthData; +- } +- +- @Override +- public boolean nextAuthenticationStep(NativePacketPayload fromServer, List toServer) { +- toServer.clear(); +- +- if (!this.sourceOfAuthData.equals(PLUGIN_NAME) || fromServer.getPayloadLength() == 0) { +- // Cannot do anything with whatever payload comes from the server, so just skip this iteration and wait for a Protocol::AuthSwitchRequest or a +- // Protocol::AuthNextFactor. +- toServer.add(new NativePacketPayload(0)); +- return true; +- } +- +- initializePrivateKey(); +- +- byte[] nonce = fromServer.readBytes(StringSelfDataType.STRING_EOF); +- byte[] signature = ExportControlled.sign(nonce, this.privateKey); +- if (signature == null) { +- signature = new byte[0]; +- } +- String payload = String.format("{\"fingerprint\":\"%s\", \"signature\":\"%s\"}", this.fingerprint, Base64.getEncoder().encodeToString(signature)); +- toServer.add(new NativePacketPayload(payload.getBytes(Charset.defaultCharset()))); +- return true; +- } +- +- private void initializePrivateKey() { +- if (this.privateKey != null) { +- // Already initialized. +- return; +- } +- +- ConfigFile configFile; +- try { +- String configFilePath = this.protocol.getPropertySet().getStringProperty(PropertyKey.ociConfigFile.getKeyName()).getStringValue(); +- if (StringUtils.isNullOrEmpty(configFilePath)) { +- configFile = ConfigFileReader.parseDefault(); +- } else if (Files.exists(Paths.get(configFilePath))) { +- configFile = ConfigFileReader.parse(configFilePath); +- } else { +- throw ExceptionFactory.createException("configuration file does not exist"); +- } +- } catch (NoClassDefFoundError e) { +- throw ExceptionFactory.createException(Messages.getString("AuthenticationOciClientPlugin.SdkNotFound"), e); +- } catch (IOException e) { +- throw ExceptionFactory.createException(Messages.getString("AuthenticationOciClientPlugin.OciConfigFileError"), e); +- } +- this.fingerprint = configFile.get("fingerprint"); +- if (StringUtils.isNullOrEmpty(this.fingerprint)) { +- throw ExceptionFactory.createException(Messages.getString("AuthenticationOciClientPlugin.OciConfigFileMissingEntry")); +- } +- String keyFilePath = configFile.get("key_file"); +- if (StringUtils.isNullOrEmpty(keyFilePath)) { +- throw ExceptionFactory.createException(Messages.getString("AuthenticationOciClientPlugin.OciConfigFileMissingEntry")); +- } +- +- try { +- String key = new String(Files.readAllBytes(Paths.get(keyFilePath)), Charset.defaultCharset()); +- this.privateKey = ExportControlled.decodeRSAPrivateKey(key); +- } catch (IOException e) { +- throw ExceptionFactory.createException(Messages.getString("AuthenticationOciClientPlugin.PrivateKeyNotFound"), e); +- } catch (RSAException | IllegalArgumentException e) { +- throw ExceptionFactory.createException(Messages.getString("AuthenticationOciClientPlugin.PrivateKeyNotValid"), e); +- } +- } +-} +diff --git a/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties b/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties +index e4709a75..d29cdeb3 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 + AuthenticationLdapSaslClientPlugin.FailCreateSaslClient=Failed creating a SASL client for the authentication mechanism ''{0}''. + AuthenticationLdapSaslClientPlugin.ErrProcessingAuthIter=Error while processing an authentication iteration for the authentication mechanism ''{0}''. + +-AuthenticationOciClientPlugin.SdkNotFound=The OCI SDK could not be found or is not installed. +-AuthenticationOciClientPlugin.OciConfigFileError=OCI configuration file could not be read. +-AuthenticationOciClientPlugin.OciConfigFileMissingEntry=OCI configuration file does not contain a ''fingerprint'' or ''key_file'' entry. +-AuthenticationOciClientPlugin.PrivateKeyNotFound=Private key could not be found at location given by OCI configuration entry ''key_file''. +-AuthenticationOciClientPlugin.PrivateKeyNotValid=OCI configuration entry ''key_file'' does not reference a valid key file. +- + AuthenticationProvider.BadAuthenticationPlugin=Unable to load authentication plugin ''{0}''. + 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 diff --git a/remove-coverage-test.patch b/remove-coverage-test.patch index ba66b51c45936473b54b02c81ba5168dd2f94db3..7705ec65913ff1e002f4b27e085707d116adc1f2 100644 --- a/remove-coverage-test.patch +++ b/remove-coverage-test.patch @@ -1,32 +1,17 @@ -From 62f1bf44f6cee0fd97500d6f761a3e03810318df Mon Sep 17 00:00:00 2001 -From: Jakub Janco -Date: Mon, 6 May 2019 15:05:17 +0200 +From cde027a4886ac1160ac42a6e4ba1fa2d271009be Mon Sep 17 00:00:00 2001 +From: Ondrej Dubaj +Date: Thu, 28 Jul 2022 09:54:06 +0200 Subject: [PATCH] Remove coverage test - + --- - build.xml | 133 -------------------------------------------------------------- - 1 file changed, 133 deletions(-) - + build.xml | 162 ------------------------------------------------------ + 1 file changed, 162 deletions(-) + diff --git a/build.xml b/build.xml -index 7572a4ce..fcce72be 100644 +index 8c4e9f5d..3d13bf45 100644 --- a/build.xml +++ b/build.xml -@@ -303,14 +303,6 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o - - - -- -- -- -- -- -- -- -- - - - -@@ -1276,56 +1268,6 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o +@@ -1279,82 +1279,6 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o ${com.mysql.cj.testsuite.message.test.mode} @@ -35,55 +20,81 @@ index 7572a4ce..fcce72be 100644 - - - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -@@ -1344,81 +1286,6 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + + + +@@ -1367,92 +1291,6 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o @@ -92,10 +103,10 @@ index 7572a4ce..fcce72be 100644 - - - -- +- - - -- +- - @@ -104,6 +115,20 @@ index 7572a4ce..fcce72be 100644 - - - +- +- +- +- +- +- +- +- +- +- +- +- +- - - - @@ -113,7 +138,7 @@ index 7572a4ce..fcce72be 100644 - - - - - @@ -136,19 +161,18 @@ index 7572a4ce..fcce72be 100644 - - - -- - - - - -- +- - - - - - - -- +- - @@ -160,11 +184,8 @@ index 7572a4ce..fcce72be 100644 - - - -- -- - - + + -- -2.14.5 - +2.37.1