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

Function copy_previous_query

src/bin/psql/command.c:3035–3044  ·  view source on GitHub ↗

* If query_buf is empty, copy previous_buf into it. * * This is used by various slash commands for which re-execution of a * previous query is a common usage. For convenience, we allow the * case of query_buf == NULL (and do nothing). * * Returns "true" if the previous query was copied into the query * buffer, else "false". */

Source from the content-addressed store, hash-verified

3033 * buffer, else "false".
3034 */
3035static bool
3036copy_previous_query(PQExpBuffer query_buf, PQExpBuffer previous_buf)
3037{
3038 if (query_buf && query_buf->len == 0)
3039 {
3040 appendPQExpBufferStr(query_buf, previous_buf->data);
3041 return true;
3042 }
3043 return false;
3044}
3045
3046/*
3047 * Ask the user for a password; 'username' is the username the

Callers 3

exec_commandFunction · 0.85
exec_command_editFunction · 0.85
exec_command_watchFunction · 0.85

Calls 1

appendPQExpBufferStrFunction · 0.85

Tested by

no test coverage detected