This PR improves the string formatting of time type columns, FormatBinaryTime does not return properly formatted time strings in all cases.
In the zero value case, it was incorrectly returning a date formatted string instead of the expected zero time of 00:00:00. For positive times there was a leading null byte in the returned []byte.
This PR improves the string formatting of time type columns,
FormatBinaryTime
does not return properly formatted time strings in all cases.In the zero value case, it was incorrectly returning a
date
formatted string instead of the expected zerotime
of00:00:00
. For positive times there was a leading null byte in the returned []byte.CREATE TABLE time_test (ts TIME);
INSERT INTO time_test (ts) VALUES ("00:00:00"), ("06:12:10");
Reading the values out (using a statement as direct queries don't use FormatBinaryTime)
SELECT * FROM %s WHERE ts > ?
with query parameter-5
or some other numberresulted in
when the expected result is