File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const TUPLE_OLD_TAG: u8 = b'O';
2626const TUPLE_DATA_NULL_TAG : u8 = b'n' ;
2727const TUPLE_DATA_TOAST_TAG : u8 = b'u' ;
2828const TUPLE_DATA_TEXT_TAG : u8 = b't' ;
29+ const TUPLE_DATA_BINARY_TAG : u8 = b'b' ;
2930
3031// replica identity tags
3132const REPLICA_IDENTITY_DEFAULT_TAG : u8 = b'd' ;
@@ -428,6 +429,8 @@ pub enum TupleData {
428429 UnchangedToast ,
429430 /// Column data as text formatted value.
430431 Text ( Bytes ) ,
432+ /// Column data as binary formatted value.
433+ Binary ( Bytes ) ,
431434}
432435
433436impl TupleData {
@@ -443,6 +446,12 @@ impl TupleData {
443446 buf. read_exact ( & mut data) ?;
444447 TupleData :: Text ( data. into ( ) )
445448 }
449+ TUPLE_DATA_BINARY_TAG => {
450+ let len = buf. read_i32 :: < BigEndian > ( ) ?;
451+ let mut data = vec ! [ 0 ; len as usize ] ;
452+ buf. read_exact ( & mut data) ?;
453+ TupleData :: Binary ( data. into ( ) )
454+ }
446455 tag => {
447456 return Err ( io:: Error :: new (
448457 io:: ErrorKind :: InvalidInput ,
You can’t perform that action at this time.
0 commit comments