Bug #100079 JDBC's MySQL protocol is not correct,some information will be lost
Submitted: 2 Jul 9:07 Modified: 28 Jul 2:21
Reporter: tiger lan Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1.40 and other, 8.0.20 OS:Any
Assigned to: CPU Architecture:Any
Tags: jdbc, protocol

[2 Jul 9:07] tiger lan
Description:
JDBC's MySQL protocol of Protocol::HandshakeResponse41 is not correct,
so JDBC's CLIENT_CONNECT_ATTRS can not be seen in performance_schema.session_connect_attrs

How to repeat:
1. java code like attachment and execute it.
The most import code is the URL NOT contains schema name,like this:
jdbc:mysql://127.0.0.1:3306?connectionAttributes=key1:value1 
2. login in MySQL server, execute the query:
select * from performance_schema.session_connect_attrs;
3.but you can not see any connection Attributes

Suggested fix:
remove the code 1852 to 1854 from com.mysql.jdbc.MysqlIO.java
[2 Jul 9:16] tiger lan
I mean, no connection attribute of the JDBC connection
[6 Jul 6:12] tiger lan
patch based on JDBC5.1.40

Attachment: jdbc_without_default_db.diff (application/octet-stream, text), 583 bytes.

[10 Jul 7:46] MySQL Verification Team
Hello tiger lan,

Thank you for the report and test case.

regards,
Umesh
[10 Jul 7:55] MySQL Verification Team
Please note that in order to submit contributions you must first sign the Oracle Contribution Agreement (OCA). More details are described in "Contributions" tab, please ensure to re-send the patch via that tab. Otherwise we would not be able to accept it.
[28 Jul 2:21] tiger lan
I send the OCA PDF about one month ago, but no reply till now