| 4516 | |
| 4517 | |
| 4518 | static void |
| 4519 | print_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 | |
| 4557 | static int com_tee(String *, char *line) |
| 4558 | { |
no test coverage detected