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

Function exec_command_unset

src/bin/psql/command.c:2566–2591  ·  view source on GitHub ↗

* \unset -- unset variable */

Source from the content-addressed store, hash-verified

2564 * \unset -- unset variable
2565 */
2566static backslashResult
2567exec_command_unset(PsqlScanState scan_state, bool active_branch,
2568 const char *cmd)
2569{
2570 bool success = true;
2571
2572 if (active_branch)
2573 {
2574 char *opt = psql_scan_slash_option(scan_state,
2575 OT_NORMAL, NULL, false);
2576
2577 if (!opt)
2578 {
2579 pg_log_error("\\%s: missing required argument", cmd);
2580 success = false;
2581 }
2582 else if (!SetVariable(pset.vars, opt, NULL))
2583 success = false;
2584
2585 free(opt);
2586 }
2587 else
2588 ignore_slash_options(scan_state);
2589
2590 return success ? PSQL_CMD_SKIP_LINE : PSQL_CMD_ERROR;
2591}
2592
2593/*
2594 * \w -- write query buffer to file

Callers 1

exec_commandFunction · 0.85

Calls 2

SetVariableFunction · 0.85
ignore_slash_optionsFunction · 0.85

Tested by

no test coverage detected