fix(authn): fix sql parse for mysql

This commit is contained in:
zhouzb 2021-10-21 17:07:24 +08:00 committed by x1001100011
parent 1c144d7d67
commit ab201625c3
1 changed files with 1 additions and 1 deletions

View File

@ -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, []}