Closed shiyuhang0 closed 2 years ago
I also have a question about this code in connection.ts
this.capabilities = handshakePacket.serverCapabilities;
The capabilities should be handshakePacket.serverCapabilities
or HandshakeResponse's client_flag?
@lideming PTAL
But I wonder why it works without this change.
The capabilities should be handshakePacket.serverCapabilities or HandshakeResponse's client_flag?
I think both should work. As we response with the flags that server advertised and client recognized.
Because we judge EOF package by 0xFE. And OK packet can be either 0x00 or 0xFE. When the client and server both support CLIENT_DEPRECATE_EOF, serve will send OK packet. If it is 0xFE ,it happens to work. But if it is 0x00, I think we can't work.
Optimize https://github.com/denodrivers/mysql/pull/139
when CLIENT_DEPRECATE_EOF is set. EOF_Packet can also be Ok_Packet.
https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_com_query_response_text_resultset.html