mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-25 09:39:58 +00:00
fix(postgres): fix buffer management in PgCopyIn.read_from (#2630)
This commit is contained in:
parent
f2bb464bcd
commit
94379d88b3
@ -151,7 +151,7 @@ impl WriteBuffer {
|
||||
self.buf.truncate(self.bytes_written);
|
||||
self.buf.extend_from_slice(slice);
|
||||
}
|
||||
|
||||
self.advance(slice.len());
|
||||
self.sanity_check();
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user