Support OTP R13B.

Remove use of R13B04 features.
This commit is contained in:
Alexey Romanov
2011-02-16 18:54:04 +03:00
parent 6fa9f738bb
commit b677cb45e8
5 changed files with 10 additions and 8 deletions

View File

@@ -1062,15 +1062,15 @@ do_handle_call_sql_exec(SQL, State) ->
{reply, Reply, State}.
do_sql_exec(SQL, #state{port = Port}) ->
?dbg("SQL: ~s~n", [SQL]),
?dbgF("SQL: ~s~n", [SQL]),
exec(Port, {sql_exec, SQL}).
do_sql_bind_and_exec(SQL, Params, #state{port = Port}) ->
?dbg("SQL: ~s; Parameters: ~p~n", [SQL, Params]),
?dbgF("SQL: ~s; Parameters: ~p~n", [SQL, Params]),
exec(Port, {sql_bind_and_exec, SQL, Params}).
do_sql_exec_script(SQL, #state{port = Port}) ->
?dbg("SQL: ~s~n", [SQL]),
?dbgF("SQL: ~s~n", [SQL]),
exec(Port, {sql_exec_script, SQL}).
exec(_Port, {create_function, _FunctionName, _Function}) ->

View File

@@ -358,7 +358,7 @@ sql_number(NumberStr) ->
sql_string(StringWithEscapedQuotes) ->
Res1 = re:replace(StringWithEscapedQuotes, "''", "'",
[global, {return, binary}]),
binary_part(Res1, 0, byte_size(Res1) - 1).
erlang:binary_part(Res1, 0, byte_size(Res1) - 1).
-spec sql_blob(string()) -> binary().
sql_blob([$' | Tail]) -> hex_str_to_bin(Tail, <<>>).