Replace binary_to_atom with list_to_atom (binary_to_list ())

To avoid comilation errors on ERTS with version lower than 5.7
(for example, ubuntu 9.04)
This commit is contained in:
sergey-miryanov
2010-02-10 18:13:02 +05:00
parent 846e29c75e
commit 27169869c0

View File

@@ -424,7 +424,7 @@ handle_call({sql_exec, SQL}, _From, #state{port = Port} = State) ->
handle_call(list_tables, _From, #state{port = Port} = State) ->
Reply = exec(Port, {sql_exec, "select name from sqlite_master where type='table';"}),
TableList = proplists:get_value(rows, Reply),
TableNames = [binary_to_atom(Name, utf8) || {Name} <- TableList],
TableNames = [erlang:list_to_atom (erlang:binary_to_list (Name)) || {Name} <- TableList],
{reply, TableNames, State};
handle_call({table_info, Tbl}, _From, #state{port = Port} = State) ->
% make sure we only get table info.