Skip to content

Commit ddd1993

Browse files
committed
Use correct minute value when decoding timestamps
1 parent 60939b5 commit ddd1993

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/p1_mysql_bin.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,12 @@ decode_binary_value(T, <<0, Rest/binary>>) when
236236
decode_binary_value(T, <<4, Y:16/little, M, D, Rest/binary>>) when
237237
T == ?TYPE_TIMESTAMP; T == ?TYPE_DATETIME; T == ?TYPE_DATE ->
238238
{{{Y, M, D}, {0, 0, 0, 0}}, Rest};
239-
decode_binary_value(T, <<7, Y:16/little, M, D, H, _MM, S, Rest/binary>>) when
239+
decode_binary_value(T, <<7, Y:16/little, M, D, H, MM, S, Rest/binary>>) when
240240
T == ?TYPE_TIMESTAMP; T == ?TYPE_DATETIME; T == ?TYPE_DATE ->
241-
{{{Y, M, D}, {H, M, S, 0}}, Rest};
242-
decode_binary_value(T, <<11, Y:16/little, M, D, H, _MM, S, MS:32/little, Rest/binary>>)
241+
{{{Y, M, D}, {H, MM, S, 0}}, Rest};
242+
decode_binary_value(T, <<11, Y:16/little, M, D, H, MM, S, MS:32/little, Rest/binary>>)
243243
when T == ?TYPE_TIMESTAMP; T == ?TYPE_DATETIME; T == ?TYPE_DATE ->
244-
{{{Y, M, D}, {H, M, S, MS}}, Rest};
244+
{{{Y, M, D}, {H, MM, S, MS}}, Rest};
245245
decode_binary_value(?TYPE_LONGLONG, <<V:64/little, Rest/binary>>) ->
246246
{V, Rest};
247247
decode_binary_value(?TYPE_TIME, <<0, Rest/binary>>) ->

0 commit comments

Comments
 (0)