25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

Return MySQL error messages as binary.

This commit is contained in:
Jerome Sautret 2014-07-04 17:28:19 +02:00 committed by Christophe Romain
parent 26a4d91297
commit aba7150af1

View File

@ -553,10 +553,16 @@ mysql_to_odbc({data, MySQLRes}) ->
mysql_item_to_odbc(p1_mysql:get_result_field_info(MySQLRes), mysql_item_to_odbc(p1_mysql:get_result_field_info(MySQLRes),
p1_mysql:get_result_rows(MySQLRes)); p1_mysql:get_result_rows(MySQLRes));
mysql_to_odbc({error, MySQLRes}) mysql_to_odbc({error, MySQLRes})
when is_binary(MySQLRes) -> when is_binary(MySQLRes) ->
{error, MySQLRes}; {error, MySQLRes};
mysql_to_odbc({error, MySQLRes})
when is_list(MySQLRes) ->
{error, list_to_binary(MySQLRes)};
mysql_to_odbc({error, MySQLRes}) -> mysql_to_odbc({error, MySQLRes}) ->
{error, p1_mysql:get_result_reason(MySQLRes)}. {error, p1_mysql:get_result_reason(MySQLRes)};
mysql_to_odbc(ok) ->
ok.
%% When tabular data is returned, convert it to the ODBC formalism %% When tabular data is returned, convert it to the ODBC formalism
mysql_item_to_odbc(Columns, Recs) -> mysql_item_to_odbc(Columns, Recs) ->