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

Function fmtQualifiedIdEnc

src/fe_utils/string_utils.c:273–292  ·  view source on GitHub ↗

* fmtQualifiedIdEnc - construct a schema-qualified name, with quoting as * needed. * * Like fmtId, use the result before calling again. * * Since we call fmtId and it also uses getLocalPQExpBuffer() we cannot * use that buffer until we're finished with calling fmtId(). */

Source from the content-addressed store, hash-verified

271 * use that buffer until we're finished with calling fmtId().
272 */
273const char *
274fmtQualifiedIdEnc(const char *schema, const char *id, int encoding)
275{
276 PQExpBuffer id_return;
277 PQExpBuffer lcl_pqexp = createPQExpBuffer();
278
279 /* Some callers might fail to provide a schema name */
280 if (schema && *schema)
281 {
282 appendPQExpBuffer(lcl_pqexp, "%s.", fmtIdEnc(schema, encoding));
283 }
284 appendPQExpBufferStr(lcl_pqexp, fmtIdEnc(id, encoding));
285
286 id_return = getLocalPQExpBuffer();
287
288 appendPQExpBufferStr(id_return, lcl_pqexp->data);
289 destroyPQExpBuffer(lcl_pqexp);
290
291 return id_return->data;
292}
293
294/*
295 * fmtQualifiedId - construct a schema-qualified name, with quoting as needed.

Callers 4

fmtQualifiedIdFunction · 0.85
vacuum_one_databaseFunction · 0.85
appendQualifiedRelationFunction · 0.85
get_parallel_object_listFunction · 0.85

Calls 5

createPQExpBufferFunction · 0.85
appendPQExpBufferFunction · 0.85
fmtIdEncFunction · 0.85
appendPQExpBufferStrFunction · 0.85
destroyPQExpBufferFunction · 0.85

Tested by

no test coverage detected