Browse Source

Compatible with MySQL 5.7 and MariaDB 10.2.6+

Feng Lee 7 years ago
parent
commit
829196ed1b
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/mysql_protocol.erl

+ 2 - 1
src/mysql_protocol.erl

@@ -72,7 +72,8 @@ handshake_finish_or_switch_auth(Handshake, Password, SockModule, Socket,
     {ok, ConfirmPacket, SeqNum1} = recv_packet(SockModule, Socket, SeqNum0),
     case parse_handshake_confirm(ConfirmPacket) of
         #ok{status = OkStatus} ->
-            OkStatus = Handshake#handshake.status,
+            true = (OkStatus == Handshake#handshake.status)
+                    orelse (OkStatus == (16#4000 bor Handshake#handshake.status)),
             {ok, Handshake, SockModule, Socket};
         #auth_method_switch{auth_plugin_name = AuthPluginName,
                             auth_plugin_data = AuthPluginData} ->