Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #27 from gcapital/master

NULL handling in gen_storage_odbc
  • Loading branch information...
commit 9fe0eff75ed4d6b596f20c56b5a33495a63ce875 2 parents 2905b90 + b1ef38f
@badlop badlop authored
Showing with 8 additions and 1 deletion.
  1. +1 −1  src/ejabberd_c2s.erl
  2. +7 −0 src/gen_storage_odbc.erl
View
2  src/ejabberd_c2s.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) ->
View
7 src/gen_storage_odbc.erl
@@ -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) ++ "'";

1 comment on commit 9fe0eff

@sharp

Hi , Does master branch support R15b02 ?

Please sign in to comment.
Something went wrong with that request. Please try again.