Bug #98919 Connector/J 5.1.48 assumes that MySQl 5.6 is built with perf schema support
Submitted: 11 Mar 2020 22:32 Modified: 12 Mar 2020 7:03
Reporter: Mark Callaghan Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1.48, 8.0.19 OS:Any
Assigned to: CPU Architecture:Any
Tags: regression

[11 Mar 2020 22:32] Mark Callaghan
Description:
Connector/J cannot connect to MySQL 5.6.35 when MySQL the perf schema is disabled at compile time.

I get errors like this:
 java.sql.SQLException: Unknown system variable 'performance_schema'

Release notes for connector/j 5.1.48 state:
https://dev.mysql.com/doc/relnotes/connector-j/5.1/en/news-5-1-48.html
"Because the SHOW PROCESSLIST statement might cause the server to fail sometimes, Connector/J now avoids using the statement, but queries the performance scheme instead for the information it needs. (Bug #29329326)"

Change appears to show up via:
https://github.com/mysql/mysql-connector-j/commit/2e350a5d66cda9317aa308954bafaf952e8054cb

How to repeat:
1) Build MySQL from source with -DWITH_PERFSCHEMA_STORAGE_ENGINE=0
2) For that to work you also need to remove plugin/connection_control, otherwise the build fails
3) Connection to MySQL with a JDBC client that uses Connector/J 5.1.48
[11 Mar 2020 22:34] Mark Callaghan
That isn't an issue for you, but this also might prevent the use of Connector/J in MemSQL and any other DBMS (maybe TiDB) that implements the MySQL API. See:
https://www.memsql.com/forum/t/not-able-to-connect-to-memsql-6-7-with-mysql-j-connector-8-...
[12 Mar 2020 7:03] MySQL Verification Team
Hello Mark,

Thank you for the report and feedback!

Thanks,
Umesh
[12 Mar 2020 7:05] MySQL Verification Team
Test results - C/J 5.1.48, 8.0.19

Attachment: 98919.results (application/octet-stream, text), 156.94 KiB.

[12 Mar 2020 7:07] MySQL Verification Team
This looks like regression to me.

ant -f C:\\Work\\MySQLJava\\Bug98919 -Dnb.internal.action.name=run run
init:
Deleting: C:\Work\MySQLJava\Bug98919\build\built-jar.properties
deps-jar:
Updating property file: C:\Work\MySQLJava\Bug98919\build\built-jar.properties
compile:
run:
JDK version: 11.0.3+12-LTS
MySQL Server: 5.6.47
Driver Name & Ver: MySQL Connector Javamysql-connector-java-5.1.38 ( Revision: fe541c166cec739c74cc727c5da96c1028b4834a )
BUILD SUCCESSFUL (total time: 4 seconds)