MySQL Forums
Forum List  »  Connector/JDBC and Java

jdbc with no default db have one extra null byte cause handshake fail
Posted by: han zheng
Date: July 28, 2017 02:18AM

we are using jdbc to connect a mysql-proxy,found that jdbc is different from mysql protocal when dealing no default db connection


here is the mysql protocal,Protocol::HandshakeResponse41

if CLIENT_CONNECT_WITH_DB is set,then have a string[NULL],if not set,then have nothing


however,in jdbc source code,we found this: in function

proceedHandshakeWithPluggableAuthentication

if (this.useConnectWithDb) {
last_sent.writeString(database, enc, this.connection);
} else {
/* For empty database */
last_sent.writeByte((byte) 0);
}

if CLIENT_CONNECT_WITH_DB is not set,jdbc write a extra null byte. we use tcpdump verify this.


is this a bug?

Options: ReplyQuote


Subject
Written By
Posted
jdbc with no default db have one extra null byte cause handshake fail
July 28, 2017 02:18AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.