MCPcopy Create free account
hub / github.com/MariaDB/server / print_tab_data

Function print_tab_data

client/mysql.cc:4518–4555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4516
4517
4518static void
4519print_tab_data(MYSQL_RES *result)
4520{
4521 MYSQL_ROW cur;
4522 MYSQL_FIELD *field;
4523 ulong *lengths;
4524
4525 if (opt_silent < 2 && column_names)
4526 {
4527 int first=0;
4528 while ((field = mysql_fetch_field(result)))
4529 {
4530 if (first++)
4531 (void) tee_fputs("\t", PAGER);
4532 (void) tee_fputs(field->name, PAGER);
4533 }
4534 (void) tee_fputs("\n", PAGER);
4535 }
4536 while ((cur = fetch_row(result)))
4537 {
4538 lengths=mysql_fetch_lengths(result);
4539 field= mysql_fetch_fields(result);
4540 if (opt_binhex && is_binary_field(&field[0]))
4541 print_as_hex(PAGER, cur[0], lengths[0], lengths[0]);
4542 else
4543 safe_put_field(cur[0],lengths[0]);
4544
4545 for (uint off=1 ; off < mysql_num_fields(result); off++)
4546 {
4547 (void) tee_fputs("\t", PAGER);
4548 if (opt_binhex && field && is_binary_field(&field[off]))
4549 print_as_hex(PAGER, cur[off], lengths[off], lengths[off]);
4550 else
4551 safe_put_field(cur[off], lengths[off]);
4552 }
4553 (void) tee_fputs("\n", PAGER);
4554 }
4555}
4556
4557static int com_tee(String *, char *line)
4558{

Callers 1

com_goFunction · 0.85

Calls 6

tee_fputsFunction · 0.85
fetch_rowFunction · 0.85
is_binary_fieldFunction · 0.85
print_as_hexFunction · 0.85
safe_put_fieldFunction · 0.85
mysql_num_fieldsFunction · 0.85

Tested by

no test coverage detected