mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02:00
Handle NULL<->undefined correctly in gen_storage_odbc
This commit is contained in:
parent
b4c2a3b85f
commit
118b006cac
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue