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

Function pg_encoding_set_invalid

src/common/wchar.c:1899–1906  ·  view source on GitHub ↗

* Fills the provided buffer with two bytes such that: * pg_encoding_mblen(dst) == 2 && pg_encoding_verifymbstr(dst) == 0 */

Source from the content-addressed store, hash-verified

1897 * pg_encoding_mblen(dst) == 2 && pg_encoding_verifymbstr(dst) == 0
1898 */
1899void
1900pg_encoding_set_invalid(int encoding, char *dst)
1901{
1902 Assert(pg_encoding_max_length(encoding) > 1);
1903
1904 dst[0] = (encoding == PG_UTF8 ? 0xc0 : NONUTF8_INVALID_BYTE0);
1905 dst[1] = NONUTF8_INVALID_BYTE1;
1906}
1907
1908/*
1909 *-------------------------------------------------------------------

Callers 4

fmtIdEncFunction · 0.85
appendStringLiteralFunction · 0.85
test_enc_setupFunction · 0.85
PQescapeStringInternalFunction · 0.85

Calls 1

pg_encoding_max_lengthFunction · 0.85

Tested by 1

test_enc_setupFunction · 0.68