MCPcopy Create free account
hub / github.com/MariaDB/server / parse_length_encoded_string

Function parse_length_encoded_string

storage/perfschema/table_session_connect.cc:64–90  ·  view source on GitHub ↗

Take a length encoded string @arg ptr inout the input string array @arg dest where to store the result @arg dest_size max size of @c dest @arg copied_len the actual length of the data copied @arg start_ptr pointer to the start of input @arg input_length the length of the incoming data @arg copy_data copy the data or just skip the inp

Source from the content-addressed store, hash-verified

62 @retval false parsing succeeded
63*/
64bool parse_length_encoded_string(const char **ptr,
65 char *dest, uint dest_size,
66 uint *copied_len,
67 const char *start_ptr, uint input_length,
68 bool copy_data,
69 const CHARSET_INFO *from_cs,
70 uint nchars_max)
71{
72 ulong copy_length, data_length;
73 String_copier copier;
74
75 copy_length= data_length= net_field_length((uchar **) ptr);
76
77 /* we don't tolerate NULL as a length */
78 if (data_length == NULL_LENGTH)
79 return true;
80
81 if (*ptr - start_ptr + data_length > input_length)
82 return true;
83
84 copy_length= copier.well_formed_copy(&my_charset_utf8mb3_bin, dest, dest_size,
85 from_cs, *ptr, data_length, nchars_max);
86 *copied_len= copy_length;
87 (*ptr)+= data_length;
88
89 return false;
90}
91
92/**
93 Take the nth attribute name/value pair

Callers 1

read_nth_attrFunction · 0.85

Calls 2

net_field_lengthFunction · 0.85
well_formed_copyMethod · 0.45

Tested by

no test coverage detected