From 257bc353a4844c6d49101839dc6cb3765517dbe1 Mon Sep 17 00:00:00 2001 From: zhouzb Date: Wed, 20 Oct 2021 10:14:47 +0800 Subject: [PATCH] fix(authn): fix placeholders are not replaced correctly --- 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 b4c6dac08..cd658e6f1 100644 --- a/apps/emqx_authn/src/simple_authn/emqx_authn_mysql.erl +++ b/apps/emqx_authn/src/simple_authn/emqx_authn_mysql.erl @@ -144,7 +144,7 @@ destroy(#{'_unique' := Unique}) -> parse_query(Query) -> case re:run(Query, ?RE_PLACEHOLDER, [global, {capture, all, binary}]) of {match, Captured} -> - PlaceHolders = [PlaceHolder || PlaceHolder <- Captured], + PlaceHolders = [PlaceHolder || [PlaceHolder] <- Captured], NQuery = re:replace(Query, "'\\$\\{[a-z0-9\\_]+\\}'", "?", [global, {return, binary}]), {NQuery, PlaceHolders}; nomatch ->