| 515 | } |
| 516 | |
| 517 | void |
| 518 | dbcontext::resp_record(dbcallback_i& cb, TABLE *const table, |
| 519 | const prep_stmt& pst) |
| 520 | { |
| 521 | char rwpstr_buf[64]; |
| 522 | String rwpstr(rwpstr_buf, sizeof(rwpstr_buf), &my_charset_bin); |
| 523 | const prep_stmt::fields_type& rf = pst.get_ret_fields(); |
| 524 | const size_t n = rf.size(); |
| 525 | for (size_t i = 0; i < n; ++i) { |
| 526 | uint32_t fn = rf[i]; |
| 527 | Field *const fld = table->field[fn]; |
| 528 | DBG_FLD(fprintf(stderr, "fld=%p %zu\n", fld, fn)); |
| 529 | if (fld->is_null()) { |
| 530 | /* null */ |
| 531 | cb.dbcb_resp_entry(0, 0); |
| 532 | } else { |
| 533 | fld->val_str(&rwpstr, &rwpstr); |
| 534 | const size_t len = rwpstr.length(); |
| 535 | if (len != 0) { |
| 536 | /* non-empty */ |
| 537 | cb.dbcb_resp_entry(rwpstr.ptr(), rwpstr.length()); |
| 538 | } else { |
| 539 | /* empty */ |
| 540 | static const char empty_str[] = ""; |
| 541 | cb.dbcb_resp_entry(empty_str, 0); |
| 542 | } |
| 543 | } |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | void |
| 548 | dbcontext::dump_record(dbcallback_i& cb, TABLE *const table, |
nothing calls this directly
no test coverage detected