MCPcopy Create free account
hub / github.com/apache/cloudberry / appendBinaryStringInfo

Function appendBinaryStringInfo

src/common/stringinfo.c:242–260  ·  view source on GitHub ↗

* appendBinaryStringInfo * * Append arbitrary binary data to a StringInfo, allocating more space * if necessary. Ensures that a trailing null byte is present. */

Source from the content-addressed store, hash-verified

240 * if necessary. Ensures that a trailing null byte is present.
241 */
242void
243appendBinaryStringInfo(StringInfo str, const char *data, int datalen)
244{
245 Assert(str != NULL);
246
247 /* Make more room if needed */
248 enlargeStringInfo(str, datalen);
249
250 /* OK, append the data */
251 memcpy(str->data + str->len, data, datalen);
252 str->len += datalen;
253
254 /*
255 * Keep a trailing null in place, even though it's probably useless for
256 * binary data. (Some callers are dealing with text but call this because
257 * their input isn't null-terminated.)
258 */
259 str->data[str->len] = '\0';
260}
261
262/*
263 * appendBinaryStringInfoNT

Callers 15

deparseFromExprForRelFunction · 0.85
rebuildInsertSqlFunction · 0.85
unaccent_lexizeFunction · 0.85
extract_fieldFunction · 0.85
hstore_to_json_looseFunction · 0.85
hstore_to_jsonFunction · 0.85
hstore_to_jsonb_looseFunction · 0.85
pg_decode_messageFunction · 0.85
pg_decode_stream_messageFunction · 0.85
parse_fcall_argumentsFunction · 0.85
config_enum_get_optionsFunction · 0.85

Calls 1

enlargeStringInfoFunction · 0.85

Tested by 4

pg_decode_messageFunction · 0.68
pg_decode_stream_messageFunction · 0.68
check_ao_record_presentFunction · 0.68