Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions postgres-replication/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const TUPLE_OLD_TAG: u8 = b'O';
const TUPLE_DATA_NULL_TAG: u8 = b'n';
const TUPLE_DATA_TOAST_TAG: u8 = b'u';
const TUPLE_DATA_TEXT_TAG: u8 = b't';
const TUPLE_DATA_BINARY_TAG: u8 = b'b';

// replica identity tags
const REPLICA_IDENTITY_DEFAULT_TAG: u8 = b'd';
Expand Down Expand Up @@ -428,6 +429,8 @@ pub enum TupleData {
UnchangedToast,
/// Column data as text formatted value.
Text(Bytes),
/// Column data as binary formatted value.
Binary(Bytes),
}

impl TupleData {
Expand All @@ -443,6 +446,12 @@ impl TupleData {
buf.read_exact(&mut data)?;
TupleData::Text(data.into())
}
TUPLE_DATA_BINARY_TAG => {
let len = buf.read_i32::<BigEndian>()?;
let mut data = vec![0; len as usize];
buf.read_exact(&mut data)?;
TupleData::Binary(data.into())
}
tag => {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
Expand Down
Loading