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

Function exec_command_timing

src/bin/psql/command.c:2534–2561  ·  view source on GitHub ↗

* \timing -- enable/disable timing of queries */

Source from the content-addressed store, hash-verified

2532 * \timing -- enable/disable timing of queries
2533 */
2534static backslashResult
2535exec_command_timing(PsqlScanState scan_state, bool active_branch)
2536{
2537 bool success = true;
2538
2539 if (active_branch)
2540 {
2541 char *opt = psql_scan_slash_option(scan_state,
2542 OT_NORMAL, NULL, false);
2543
2544 if (opt)
2545 success = ParseVariableBool(opt, "\\timing", &pset.timing);
2546 else
2547 pset.timing = !pset.timing;
2548 if (!pset.quiet)
2549 {
2550 if (pset.timing)
2551 puts(_("Timing is on."));
2552 else
2553 puts(_("Timing is off."));
2554 }
2555 free(opt);
2556 }
2557 else
2558 ignore_slash_options(scan_state);
2559
2560 return success ? PSQL_CMD_SKIP_LINE : PSQL_CMD_ERROR;
2561}
2562
2563/*
2564 * \unset -- unset variable

Callers 1

exec_commandFunction · 0.85

Calls 2

ParseVariableBoolFunction · 0.85
ignore_slash_optionsFunction · 0.85

Tested by

no test coverage detected