@@ -43,9 +43,9 @@ def read_offset_or_inline(packet, large):
4343
4444 if t in (JSONB_TYPE_LITERAL ,
4545 JSONB_TYPE_INT16 , JSONB_TYPE_UINT16 ):
46- return (t , None , packet .read_binary_json_type_inlined (t ))
46+ return (t , None , packet .read_binary_json_type_inlined (t , large ))
4747 if large and t in (JSONB_TYPE_INT32 , JSONB_TYPE_UINT32 ):
48- return (t , None , packet .read_binary_json_type_inlined (t ))
48+ return (t , None , packet .read_binary_json_type_inlined (t , large ))
4949
5050 if large :
5151 return (t , packet .read_uint32 (), None )
@@ -255,7 +255,7 @@ def read_length_coded_pascal_string(self, size):
255255 def read_variable_length_string (self ):
256256 """Read a variable length string where the first 1-5 bytes stores the
257257 length of the string.
258-
258+
259259 For each byte, the first bit being high indicates another byte must be
260260 read.
261261 """
@@ -384,9 +384,9 @@ def read_binary_json_type(self, t, length):
384384
385385 raise ValueError ('Json type %d is not handled' % t )
386386
387- def read_binary_json_type_inlined (self , t ):
387+ def read_binary_json_type_inlined (self , t , large ):
388388 if t == JSONB_TYPE_LITERAL :
389- value = self .read_uint16 ()
389+ value = self .read_uint32 () if large else self . read_uint16 ()
390390 if value == JSONB_LITERAL_NULL :
391391 return None
392392 elif value == JSONB_LITERAL_TRUE :
0 commit comments