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

Function print_unaligned_vertical

src/fe_utils/print.c:442–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440
441
442static void
443print_unaligned_vertical(const printTableContent *cont, FILE *fout)
444{
445 bool opt_tuples_only = cont->opt->tuples_only;
446 unsigned int i;
447 const char *const *ptr;
448 bool need_recordsep = false;
449
450 if (cancel_pressed)
451 return;
452
453 if (cont->opt->start_table)
454 {
455 /* print title */
456 if (!opt_tuples_only && cont->title)
457 {
458 fputs(cont->title, fout);
459 need_recordsep = true;
460 }
461 }
462 else
463 /* assume continuing printout */
464 need_recordsep = true;
465
466 /* print records */
467 for (i = 0, ptr = cont->cells; *ptr; i++, ptr++)
468 {
469 if (need_recordsep)
470 {
471 /* record separator is 2 occurrences of recordsep in this mode */
472 print_separator(cont->opt->recordSep, fout);
473 print_separator(cont->opt->recordSep, fout);
474 need_recordsep = false;
475 if (cancel_pressed)
476 break;
477 }
478
479 fputs(cont->headers[i % cont->ncolumns], fout);
480 print_separator(cont->opt->fieldSep, fout);
481 fputs(*ptr, fout);
482
483 if ((i + 1) % cont->ncolumns)
484 print_separator(cont->opt->recordSep, fout);
485 else
486 need_recordsep = true;
487 }
488
489 if (cont->opt->stop_table)
490 {
491 /* print footers */
492 if (!opt_tuples_only && cont->footers != NULL && !cancel_pressed)
493 {
494 printTableFooter *f;
495
496 print_separator(cont->opt->recordSep, fout);
497 for (f = cont->footers; f; f = f->next)
498 {
499 print_separator(cont->opt->recordSep, fout);

Callers 1

printTableFunction · 0.85

Calls 1

print_separatorFunction · 0.85

Tested by

no test coverage detected