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

Function runInitSteps

src/bin/pgbench/pgbench.c:4470–4549  ·  view source on GitHub ↗

* Invoke each initialization step in the given string */

Source from the content-addressed store, hash-verified

4468 * Invoke each initialization step in the given string
4469 */
4470static void
4471runInitSteps(const char *initialize_steps)
4472{
4473 PQExpBufferData stats;
4474 PGconn *con;
4475 const char *step;
4476 double run_time = 0.0;
4477 bool first = true;
4478
4479 initPQExpBuffer(&stats);
4480
4481 if ((con = doConnect()) == NULL)
4482 exit(1);
4483
4484 setup_cancel_handler(NULL);
4485 SetCancelConn(con);
4486
4487 for (step = initialize_steps; *step != '\0'; step++)
4488 {
4489 char *op = NULL;
4490 pg_time_usec_t start = pg_time_now();
4491
4492 switch (*step)
4493 {
4494 case 'd':
4495 op = "drop tables";
4496 initDropTables(con);
4497 break;
4498 case 't':
4499 op = "create tables";
4500 initCreateTables(con);
4501 break;
4502 case 'g':
4503 op = "client-side generate";
4504 initGenerateDataClientSide(con);
4505 break;
4506 case 'G':
4507 op = "server-side generate";
4508 initGenerateDataServerSide(con);
4509 break;
4510 case 'v':
4511 op = "vacuum";
4512 initVacuum(con);
4513 break;
4514 case 'p':
4515 op = "primary keys";
4516 initCreatePKeys(con);
4517 break;
4518 case 'f':
4519 op = "foreign keys";
4520 initCreateFKeys(con);
4521 break;
4522 case ' ':
4523 break; /* ignore */
4524 default:
4525 pg_log_fatal("unrecognized initialization step \"%c\"", *step);
4526 PQfinish(con);
4527 exit(1);

Callers 1

mainFunction · 0.85

Calls 15

initPQExpBufferFunction · 0.85
doConnectFunction · 0.85
SetCancelConnFunction · 0.85
pg_time_nowFunction · 0.85
initDropTablesFunction · 0.85
initCreateTablesFunction · 0.85
initVacuumFunction · 0.85
initCreatePKeysFunction · 0.85
initCreateFKeysFunction · 0.85
PQfinishFunction · 0.85

Tested by

no test coverage detected