Accepting request 976412 from Java:packages

8.0.29

OBS-URL: https://build.opensuse.org/request/show/976412
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mysql-connector-java?expand=0&rev=37
This commit is contained in:
Dominique Leuenberger 2022-05-14 20:51:53 +00:00 committed by Git OBS Bridge
commit bb8219d657
5 changed files with 110 additions and 196 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2260d656eb12c90a81f365acc215d79bda2364c90046e8dc7cd4a4a0fc375885
size 1886765

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:438646ae72afa6ee8f873185e2cfab7f5abee619ccb5b480ee75f64bd8057a66
size 1897372

View File

@ -1,208 +1,28 @@
Index: mysql-connector-j-8.0.28/src/main/protocol-impl/java/com/mysql/cj/protocol/a/authentication/AuthenticationOciClient.java
Index: mysql-connector-j-8.0.29/src/main/protocol-impl/java/com/mysql/cj/protocol/a/NativeAuthenticationProvider.java
===================================================================
--- mysql-connector-j-8.0.28.orig/src/main/protocol-impl/java/com/mysql/cj/protocol/a/authentication/AuthenticationOciClient.java
+++ mysql-connector-j-8.0.28/src/main/protocol-impl/java/com/mysql/cj/protocol/a/authentication/AuthenticationOciClient.java
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2021, Oracle and/or its affiliates.
- *
- * This program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, version 2.0, as published by the
- * Free Software Foundation.
- *
- * This program is also distributed with certain software (including but not
- * limited to OpenSSL) that is licensed under separate terms, as designated in a
- * particular file or component or in included license documentation. The
- * authors of MySQL hereby grant you an additional permission to link the
- * program and your derivative works with the separately licensed software that
- * they have included with MySQL.
- *
- * Without limiting anything contained in the foregoing, this file, which is
- * part of MySQL Connector/J, is also subject to the Universal FOSS Exception,
- * version 1.0, a copy of which can be found at
- * http://oss.oracle.com/licenses/universal-foss-exception.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package com.mysql.cj.protocol.a.authentication;
-
-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.security.interfaces.RSAPrivateKey;
-import java.util.Base64;
-import java.util.List;
-
-import com.mysql.cj.Messages;
-import com.mysql.cj.callback.MysqlCallbackHandler;
-import com.mysql.cj.callback.UsernameCallback;
-import com.mysql.cj.conf.PropertyKey;
-import com.mysql.cj.exceptions.ExceptionFactory;
-import com.mysql.cj.exceptions.RSAException;
-import com.mysql.cj.protocol.AuthenticationPlugin;
-import com.mysql.cj.protocol.ExportControlled;
-import com.mysql.cj.protocol.Protocol;
-import com.mysql.cj.protocol.a.NativeConstants.StringSelfDataType;
-import com.mysql.cj.protocol.a.NativePacketPayload;
-import com.mysql.cj.util.StringUtils;
-import com.oracle.bmc.ConfigFileReader;
-import com.oracle.bmc.ConfigFileReader.ConfigFile;
-
-/**
- * MySQL 'authentication_iam_client' authentication plugin.
- */
-public class AuthenticationOciClient implements AuthenticationPlugin<NativePacketPayload> {
- public static String PLUGIN_NAME = "authentication_oci_client";
-
- private String sourceOfAuthData = PLUGIN_NAME;
-
- protected Protocol<NativePacketPayload> protocol = null;
- private MysqlCallbackHandler usernameCallbackHandler = null;
- private String fingerprint = null;
- private RSAPrivateKey privateKey = null;
-
- @Override
- public void init(Protocol<NativePacketPayload> prot, MysqlCallbackHandler cbh) {
- this.protocol = prot;
- this.usernameCallbackHandler = cbh;
- }
-
- @Override
- public void reset() {
- this.fingerprint = null;
- this.privateKey = null;
- }
-
- @Override
- public void destroy() {
- reset();
- }
-
- @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<NativePacketPayload> 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);
- }
- }
-}
Index: mysql-connector-j-8.0.28/src/main/protocol-impl/java/com/mysql/cj/protocol/a/NativeAuthenticationProvider.java
===================================================================
--- mysql-connector-j-8.0.28.orig/src/main/protocol-impl/java/com/mysql/cj/protocol/a/NativeAuthenticationProvider.java
+++ mysql-connector-j-8.0.28/src/main/protocol-impl/java/com/mysql/cj/protocol/a/NativeAuthenticationProvider.java
@@ -57,7 +57,6 @@ import com.mysql.cj.protocol.a.NativeCon
import com.mysql.cj.protocol.a.NativeConstants.StringSelfDataType;
--- mysql-connector-j-8.0.29.orig/src/main/protocol-impl/java/com/mysql/cj/protocol/a/NativeAuthenticationProvider.java
+++ mysql-connector-j-8.0.29/src/main/protocol-impl/java/com/mysql/cj/protocol/a/NativeAuthenticationProvider.java
@@ -58,7 +58,6 @@ import com.mysql.cj.protocol.a.NativeCon
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;
@@ -255,7 +254,6 @@ public class NativeAuthenticationProvide
@@ -256,7 +255,6 @@ public class NativeAuthenticationProvide
pluginsToInit.add(new MysqlOldPasswordPlugin());
pluginsToInit.add(new AuthenticationLdapSaslClientPlugin());
pluginsToInit.add(new AuthenticationKerberosClient());
- pluginsToInit.add(new AuthenticationOciClient());
pluginsToInit.add(new AuthenticationFidoClient());
// plugins from authenticationPluginClasses connection parameter
String authenticationPluginClasses = this.propertySet.getStringProperty(PropertyKey.authenticationPlugins).getValue();
Index: mysql-connector-j-8.0.28/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties
Index: mysql-connector-j-8.0.29/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties
===================================================================
--- mysql-connector-j-8.0.28.orig/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties
+++ mysql-connector-j-8.0.28/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties
@@ -44,12 +44,6 @@ AuthenticationLdapSaslClientPlugin.Missi
--- mysql-connector-j-8.0.29.orig/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties
+++ mysql-connector-j-8.0.29/src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties
@@ -50,12 +50,6 @@ AuthenticationLdapSaslClientPlugin.Missi
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}''.

View File

@ -1,3 +1,92 @@
-------------------------------------------------------------------
Thu Apr 28 09:47:16 UTC 2022 - David Anes <david.anes@suse.com>
- Update to 8.0.29:
Functionality added or changed:
* Historically, MySQL has used utf8 as an alias for utf8mb3.
Since release 8.0.29, utf8mb3 has become a recognized (though
deprecated) character set on its own for MySQL Server.
Therefore, Connector/J has added utf8mb3 to its character set
mapping, and users are encouraged to update to
Connector/J 8.0.29 to avoid potential issues when working with
MySQL Server 8.0.29 or later. (Bug #33850155)
* A new connection property socksProxyRemoteDns has been added,
which, when set to true, makes the SocksProxySocketFactory
execute its own connect() implementation that passes the
unresolved InetSocketAddress of a MySQL Server host to the
created proxy socket, instead of having the address resolved
locally. (Bug #77924, Bug #25710160)
* The code for prepared statements has been refactored to make
the code simpler and the logic for binding more consistent
between ServerPreparedStatement and ClientPreparedStatement.
* Connector/J now supports Fast Identity Online (FIDO)
Authentication. See Connecting Using Fast Identity Online
(FIDO) Authentication for details.
Bugs fixed:
* X DevAPI: If the connection property xdevapi.ssl-mode was set
to DISABLED (or xdevapi.ssl-mode was not set, but the value
was picked up from the sslMode setting), specifying some of
the security properties caused Connector/J to throw an error.
With this fix, even when encryption is turned off and
irrelevant security properties are set, Connector/J does not
throw an error.
* DatabaseMetaData.getDefaultTransactionIsolation() returned a
wrong value. It now returns the correct value of
Connection.TRANSACTION_REPEATABLE_READ. (Bug #33723611)
* Statement executions failed for replication connections when
useCursorFetch was true and defaultFetchSize was greater than
0. (Bug #25701740)
* Prepared statements were parsed incorrectly sometimes when
they contained comments marked by /* and */. (Bug #21978230)
* A connection did not maintain the correct autocommit state
when it was used in a pool with useLocalSessionState=true.
(Bug #106435, Bug #33850099)
* References: This issue is a regression of: Bug #33054827.
* A spelling error in the error message for the buffer length
being less than the expected payload length has been corrected.
Thanks to Jianjian Song for contributing the fix.
(Bug #106397, Bug #33893591)
* When using client-side prepared statements, if the VALUES
clause came after the ON DUPLICATE KEY UPDATE clause or it
came at the end of the statement, a StringIndexOutOfBoundsException
was thrown. This patch refactors the query parser to fix the
problem behind the issue, and also to improve the parser's
performance. (Bug #106240, Bug #33781440)
* An unnecessary boxing has been removed from findColumn() in
the ResultSetImpl class. Thanks to Pei Pei Ning for
contributing this improvement. (Bug #106171, Bug #33757217)
* When decoding decimals, the constructor used for creating the
BigDecimal object has been changed from BigDecimal(String) to
BigDecimal(char[]) in order to save memory. Thanks to Chen Yi
for contributing to this improvement.
(Bug #106065, Bug #33726184)
* When inserting BigDecimal values into a database using
rewritable server-side prepared statements with cursor-based
fetching, the values suffered precision loss. (Bug #105915,
Bug #33678490)
* When the Connector/J logger level was at TRACE, a null bind
value for a PreparedStatement resulted in a NullPointerException
when the logger tried to read the value. This patch added a
null check to avoid the exception to be thrown under the
situation. (Bug #104349, Bug #33563548)
* When the connection property rewriteBatchedStatements was set
to true, inserting a BLOB using a prepared statement and
executeBatch() resulted in a NullPointerException.
(Bug #85317, Bug #25672958)
* ResultSetMetaData and DatabaseMetaData returned Types.DATE for
a YEAR table column even when yearIsDateType=false. With this
fix, Types.SMALLINT was returned correctly in the situation.
(Bug #82084, Bug #23743938)
* A PreparedStatement could not be rewritten for batch insert if
any table column involved contained "select" as a substring in
the column name. (Bug #81468, Bug #23312764)
* When using server-side prepared statements and the connection
property profileSQL was set to true, setting a parameter of
type LONGTEXT using a StringReader() resulted in a j
ava.io.NotSerializableException. (Bug #62006, Bug #16714956)
* Data truncation occurred for INOUT type parameters of data
type BIT(1) for stored procedures. (Bug #38954, Bug #11749415)
-------------------------------------------------------------------
Fri Feb 25 20:40:59 UTC 2022 - David Anes <david.anes@suse.com>

View File

@ -17,7 +17,7 @@
Name: mysql-connector-java
Version: 8.0.28
Version: 8.0.29
Release: 0
Summary: Official JDBC Driver for MySQL
License: GPL-2.0-or-later
@ -25,7 +25,9 @@ URL: https://dev.mysql.com/downloads/connector/j/
Source0: https://github.com/mysql/mysql-connector-j/archive/refs/tags/%{version}.tar.gz#:/%{name}-%{version}.tar.gz
Group: Development/Languages/Java
Patch0: javac-check.patch
# TODO: Oracle OCI is not packaged yet
# NOTE: Oracle OCI is not packaged yet
# The patch doesn't remove the file AuthenticationOciClient.java
# therefore it's removed during prep phase
Patch1: %{name}-remove-oci-support.patch
BuildRequires: ant
BuildRequires: ant-contrib
@ -64,6 +66,9 @@ set that supports the capabilities of MySQL.
%patch0 -p1
%patch1 -p1
# remove OCI support
rm -rf src/main/protocol-impl/java/com/mysql/cj/protocol/a/authentication/AuthenticationOciClient.java
# extra libs
mkdir -p lib
mkdir -p src/lib