fix(postgres): fix buffer management in PgCopyIn.read_from (#2630)

This commit is contained in:
Jesse Wang
2023-07-25 11:07:29 +12:00
committed by GitHub
parent f2bb464bcd
commit 94379d88b3
2 changed files with 2 additions and 2 deletions

View File

@@ -229,7 +229,7 @@ impl<C: DerefMut<Target = PgConnection>> PgCopyIn<C> {
let buf = conn.stream.write_buffer_mut();
// CopyData format code and reserved space for length
buf.put_slice(b"d\0\0\0\0");
buf.put_slice(b"d\0\0\0\x04");
let read = match () {
// Tokio lets us read into the buffer without zeroing first