Browse Source

Fix MariaDB by not checking server capability CLIENT_LONG_PASSWORD

In a recent commit, a check for the capability flag CLIENT_LONG_PASSWORD in
the handshake message from the server was added and this broke MariaDB (at
least one version). This commit removes the check, while still reporting it as
supported by the client in the handshake response.

Fixes #154
Viktor Söderqvist 5 years ago
parent
commit
8b2713b12e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/mysql_protocol.erl

+ 3 - 3
src/mysql_protocol.erl

@@ -495,8 +495,7 @@ verify_server_capabilities(Handshake, CapabilityFlags) ->
 basic_capabilities(ConnectWithDB, SetFoundRows) ->
     CapabilityFlags0 = ?CLIENT_PROTOCOL_41 bor
                        ?CLIENT_TRANSACTIONS bor
-                       ?CLIENT_SECURE_CONNECTION bor
-                       ?CLIENT_LONG_PASSWORD,
+                       ?CLIENT_SECURE_CONNECTION,
     CapabilityFlags1 = case ConnectWithDB of
                            true -> CapabilityFlags0 bor ?CLIENT_CONNECT_WITH_DB;
                            _ -> CapabilityFlags0
@@ -512,7 +511,8 @@ add_client_capabilities(Caps) ->
     ?CLIENT_MULTI_STATEMENTS bor
     ?CLIENT_MULTI_RESULTS bor
     ?CLIENT_PS_MULTI_RESULTS bor
-    ?CLIENT_PLUGIN_AUTH.
+    ?CLIENT_PLUGIN_AUTH bor
+    ?CLIENT_LONG_PASSWORD.
 
 -spec character_set([integer()]) -> integer().
 character_set(ServerVersion) when ServerVersion >= [5, 5, 3] ->