Merge branch 'master' of github.com:processone/ejabberd

This commit is contained in:
Evgeniy Khramtsov 2017-03-31 19:08:16 +03:00
commit 178a0a3e1b
1 changed files with 8 additions and 0 deletions

View File

@ -39,6 +39,8 @@
sql_query_t/1,
sql_transaction/2,
sql_bloc/2,
abort/1,
restart/1,
sql_query_to_iolist/1,
escape/1,
standard_escape/1,
@ -190,6 +192,12 @@ sql_query_t(Query) ->
_ -> QRes
end.
abort(Reason) ->
exit(Reason).
restart(Reason) ->
throw({aborted, Reason}).
%% Escape character that will confuse an SQL engine
escape(S) ->
<< <<(sql_queries:escape(Char))/binary>> || <<Char>> <= S >>.