From c5afd0322e344f1749f49fedbe9f37938a6c73f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Mon, 14 Aug 2023 17:12:16 +0200 Subject: [PATCH] Properly parse mysql version even if it doesn't have type tag --- src/ejabberd_sql.erl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ejabberd_sql.erl b/src/ejabberd_sql.erl index 99f74953e..c5c06d078 100644 --- a/src/ejabberd_sql.erl +++ b/src/ejabberd_sql.erl @@ -1166,6 +1166,14 @@ get_db_version(#state{db_type = mysql} = State) -> _ -> 0 end, State#state{db_version = {V, TypeA, Flags}}; + {match, [V1, V2, V3]} -> + V = ((bin_to_int(V1)*1000)+bin_to_int(V2))*1000+bin_to_int(V3), + Flags = case V of + _ when V >= 5007026 andalso V < 8000000 -> 1; + _ when V >= 8000020 -> 1; + _ -> 0 + end, + State#state{db_version = {V, unknown, Flags}}; _ -> ?WARNING_MSG("Error parsing mysql version: ~p", [SVersion]), State