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