Merge pull request #27 from gcapital/master

NULL handling in gen_storage_odbc
obsolete_3alpha
badlop 10 years ago
commit 9fe0eff75e
  1. 2
      src/ejabberd_c2s.erl
  2. 7
      src/gen_storage_odbc.erl

@ -1645,7 +1645,7 @@ send_text(StateData, Text) when StateData#state.xml_socket ->
(StateData#state.sockmod):send_xml(StateData#state.socket,
{xmlstreamraw, Text1});
send_text(StateData, Text) ->
?DEBUG("Send XML on stream = ~s", [Text]),
?DEBUG("Send XML on stream = ~s", [iolist_to_binary(Text)]),
(StateData#state.sockmod):send(StateData#state.socket, Text).
send_element(StateData, #xmlel{ns = ?NS_XMPP, name = 'stream'} = El) ->

@ -423,6 +423,9 @@ rows_to_result(#tabdef{record_name = RecordName,
row_to_result(Row, [], Result) ->
{Row, lists:reverse(Result)};
row_to_result([null | Row], [_ | Types], Result) ->
row_to_result(Row, Types, [undefined | Result]);
row_to_result([Field | Row], [Type | Types], Result) ->
case Type of
int ->
@ -649,6 +652,10 @@ format(I) when is_integer(I) ->
%% escaping not needed
integer_to_list(I);
format(undefined) ->
"NULL";
format(A) when is_atom(A) ->
%% escaping usually not needed, watch atom() usage
"'" ++ atom_to_list(A) ++ "'";

Loading…
Cancel
Save