Skip to content

Commit 59e245b

Browse files
committed
mysql-srv: Correct the size of binary TIME buffers
We were incorrectly setting the size of TIME data types, returned over the binary (prepared statement) protocol, with a fixed size of 9 bytes. It should be 8 bytes if not sending microseconds, or 12 if sending microseconds. [0] [0] https://dev.mysql.com/doc/dev/mysql-server/latest/ \ page_protocol_binary_resultset.html Fixes: REA-5961 Release-Note-Core: Fix bug in mysql binary protocol for TIME types without microseconds. Change-Id: I59356596160fd8bbe772d4829b1cfe2680b00f23 Reviewed-on: https://gerrit.readyset.name/c/readyset/+/10280 Tested-by: Buildkite CI Reviewed-by: Michael Zink <michael.z@readyset.io>
1 parent 3b0344f commit 59e245b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mysql-srv/src/value/encode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ impl ToMySqlValue for Duration {
692692
if us != 0 {
693693
w.write_u8(12u8)?;
694694
} else {
695-
w.write_u8(9u8)?;
695+
w.write_u8(8u8)?;
696696
}
697697

698698
w.write_u8(0u8)?; // positive only (for now)

0 commit comments

Comments
 (0)