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

Function defaultGetLocalPQExpBuffer

src/fe_utils/string_utils.c:41–58  ·  view source on GitHub ↗

* Returns a temporary PQExpBuffer, valid until the next call to the function. * This is used by fmtId and fmtQualifiedId. * * Non-reentrant and non-thread-safe but reduces memory leakage. You can * replace this with a custom version by setting the getLocalPQExpBuffer * function pointer. */

Source from the content-addressed store, hash-verified

39 * function pointer.
40 */
41static PQExpBuffer
42defaultGetLocalPQExpBuffer(void)
43{
44 static PQExpBuffer id_return = NULL;
45
46 if (id_return) /* first time through? */
47 {
48 /* same buffer, just wipe contents */
49 resetPQExpBuffer(id_return);
50 }
51 else
52 {
53 /* new buffer */
54 id_return = createPQExpBuffer();
55 }
56
57 return id_return;
58}
59
60/*
61 * Set the encoding that fmtId() and fmtQualifiedId() use.

Callers

nothing calls this directly

Calls 2

resetPQExpBufferFunction · 0.85
createPQExpBufferFunction · 0.85

Tested by

no test coverage detected