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

Function encoding_check_str

contrib/formatter_fixedwidth/fixedwidth.c:203–217  ·  view source on GitHub ↗

* encoding_check_str * * for a given string 'str' of length 'len', check if performing * an encoding conversion will modify the original string or not * and return the answer. The input string remains *unmodified*. * While at it, the encoding converter also verifies that the * input string is valid in the client (external table) encoding. */

Source from the content-addressed store, hash-verified

201 * input string is valid in the client (external table) encoding.
202 */
203static bool
204encoding_check_str(FunctionCallInfo fcinfo, char *str, int len, bool is_import)
205{
206 char *cvt = NULL;
207
208 FORMATTER_ENCODE_STRING(fcinfo, str, len, cvt, is_import);
209
210 if (cvt != NULL && cvt != str)
211 {
212 pfree(cvt);
213 return true;
214 }
215
216 return false;
217}
218
219/*
220 * encoding_encode_strinfo

Callers 1

fixedwidth_inFunction · 0.85

Calls 1

pfreeFunction · 0.50

Tested by

no test coverage detected