anchor.diff:      case recv(P, 0) of
           {ok, Binary, Protocol} ->
               {error, binary_to_reason(C,Binary,0,byte_size(Binary)), Protocol};
  -        {error, Reason, Protocol} ->
  -            {error, Reason, Protocol}
  -    end.
  -
  -recv_plugin(#protocol{}=P) ->
  -    case recv(P, 0) of
  -        {ok, Binary, Protocol} ->
  -            {ok, [binary_to_plugin(Binary),Protocol]};
           {error, Reason, Protocol} ->
               {error, Reason, Protocol}
       end.
  
positive.code:     recv_handshake(Socket, H#handshake{plugin = Binary});
  recv_handshake(S, #handshake{plugin=undefined}=H) ->
      recv_handshake(S, H#handshake{plugin = <<"mysql_native_password">>});
  recv_handshake(Protocol, #handshake{caps1=C1,caps2=C2,seed1=S1,seed2=S2}=H) ->
      {ok, [H#handshake{caps = (C2 bsl 16) bor C1, seed = <<S1/binary, S2/binary>>},Protocol]}.
  
  %% -----------------------------------------------------------------------------
  %% << sql/protocol.cc : send_plugin_request_packet/3
  %% -----------------------------------------------------------------------------
  binary_to_plugin(<<>>) ->
      #plugin{name = <<>>};
  binary_to_plugin(Binary) ->
      [B, <<>>] = binary:split(Binary, <<0>>),
      #plugin{name = B}.
  
  %% -----------------------------------------------------------------------------
  %% << sql/sql_prepare.cc : send_prep_stmt/2
  
negative.code: %% -----------------------------------------------------------------------------
  %% << sql/auth/sql_authentication.cc : send_server_handshake_packet/3
  %% -----------------------------------------------------------------------------
  recv_handshake(S, #handshake{version=undefined}=H) ->
      {ok, Binary, Socket} = recv(S, <<0>>),
      recv_handshake(Socket, H#handshake{version = binary_to_version(Binary)});
  