From ab201625c35e2f2568c8cd727a4707f3b71dfcdc Mon Sep 17 00:00:00 2001 From: zhouzb Date: Thu, 21 Oct 2021 17:07:24 +0800 Subject: [PATCH] fix(authn): fix sql parse for mysql --- apps/emqx_authn/src/simple_authn/emqx_authn_mysql.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/emqx_authn/src/simple_authn/emqx_authn_mysql.erl b/apps/emqx_authn/src/simple_authn/emqx_authn_mysql.erl index 9df50cf8f..065e951c5 100644 --- a/apps/emqx_authn/src/simple_authn/emqx_authn_mysql.erl +++ b/apps/emqx_authn/src/simple_authn/emqx_authn_mysql.erl @@ -145,7 +145,7 @@ parse_query(Query) -> case re:run(Query, ?RE_PLACEHOLDER, [global, {capture, all, binary}]) of {match, Captured} -> PlaceHolders = [PlaceHolder || [PlaceHolder] <- Captured], - NQuery = re:replace(Query, "'\\$\\{[a-z0-9\\_]+\\}'", "?", [global, {return, binary}]), + NQuery = re:replace(Query, "'\\$\\{[a-z0-9\\-]+\\}'", "?", [global, {return, binary}]), {NQuery, PlaceHolders}; nomatch -> {Query, []}