Bug 1646363

Summary: the connector doesn't work with new mysql 8
Product: Red Hat Enterprise Linux 7 Reporter: Karel Volný <kvolny>
Component: mysql-connector-javaAssignee: Ondrej Dubaj <odubaj>
Status: CLOSED WONTFIX QA Contact: RHEL CS Apps Subsystem QE <rhel-cs-apps-subsystem-qe>
Severity: unspecified Docs Contact: Lenka Špačková <lkuprova>
Priority: unspecified    
Version: 7.6CC: databases-maint, lkuprova, mschorm, pasik
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
.`mysql-connector-java` does not work with MySQL 8.0 The `mysql-connector-java` database connector provided in RHEL 7 does not work with the MySQL 8.0 database server. To work around this problem, use the `rh-mariadb103-mariadb-java-client` database connector from Red Hat Software Collections.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-24 06:59:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Karel Volný 2018-11-05 13:14:15 UTC
Description of problem:
SSIA ... there is a problem using the mysql-connector-java with new mysql 8

first it fails due to different default charset, then there is a datatype issue


Version-Release number of selected component (if applicable):
mysql-connector-java-5.1.25-3.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. install the new rh-mysql80 collection
2. try to use the connector
3. add 'character-set-server=utf8' to mysql server configuration (and restart the daemon)
4. try to use the connector again

Actual results:
2.
 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
       at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
       at com.mysql.jdbc.Util.getInstance(Util.java:386)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
       at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2570)
       at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2306)
       at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:839)
       at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
       at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
       at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:421)
       at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:350)
       at java.sql.DriverManager.getConnection(DriverManager.java:571)
       at java.sql.DriverManager.getConnection(DriverManager.java:215)
       at MYSQLTest.main(MYSQLTest.java:53)
 Caused by: java.lang.NullPointerException
       at com.mysql.jdbc.ConnectionImpl.getServerCharacterEncoding(ConnectionImpl.java:3281)
       at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(MysqlIO.java:1940)
       at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1866)
       at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1252)
       at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2488)
       at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2521)
       ... 13 more



4.
 java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
       at com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1079)
       at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3595)
       at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2536)
       at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2306)
       at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:839)
       at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
       at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
       at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:421)
       at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:350)
       at java.sql.DriverManager.getConnection(DriverManager.java:571)
       at java.sql.DriverManager.getConnection(DriverManager.java:215)
       at MYSQLTest.main(MYSQLTest.java:53)
 Caused by: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
       at com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1024)
       ... 15 more


Expected results:


Additional info:

Comment 2 Jakub Jančo 2018-11-05 14:17:42 UTC
mariadb-java-client 2.2.5 is working with MySQL server 8.0.{12,13}.