Quantcast
Channel: MySQL Forums - Connector/J, JDBC and Java
Viewing all articles
Browse latest Browse all 884

jdbc with no default db have one extra null byte cause handshake fail (no replies)

$
0
0
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?

Viewing all articles
Browse latest Browse all 884

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>