fix(emqx_rule_engine): missing calls

some calls are for enterprise only
This commit is contained in:
Zaiming Shi 2021-04-11 11:00:33 +02:00 committed by Zaiming (Stone) Shi
parent 4116806544
commit d8e410e770
1 changed files with 8 additions and 0 deletions

View File

@ -853,6 +853,7 @@ time_unit(<<"nanosecond">>) -> nanosecond.
%% Here the emqx_rule_funcs module acts as a proxy, forwarding
%% the function handling to the worker module.
%% @end
-ifdef(EMQX_ENTERPRISE).
'$handle_undefined_function'(schema_decode, [SchemaId, Data|MoreArgs]) ->
emqx_schema_parser:decode(SchemaId, Data, MoreArgs);
'$handle_undefined_function'(schema_decode, Args) ->
@ -868,6 +869,13 @@ time_unit(<<"nanosecond">>) -> nanosecond.
'$handle_undefined_function'(Fun, Args) ->
error({sql_function_not_supported, function_literal(Fun, Args)}).
-else.
'$handle_undefined_function'(sprintf, [Format|Args]) ->
erlang:apply(fun sprintf_s/2, [Format, Args]);
'$handle_undefined_function'(Fun, Args) ->
error({sql_function_not_supported, function_literal(Fun, Args)}).
-endif. % EMQX_ENTERPRISE
map_path(Key) ->
{path, [{key, P} || P <- string:split(Key, ".", all)]}.