MCPcopy Create free account
hub / github.com/DeNA/HandlerSocket-Plugin-for-MySQL / resp_record

Method resp_record

handlersocket/database.cpp:517–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517void
518dbcontext::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
547void
548dbcontext::dump_record(dbcallback_i& cb, TABLE *const table,

Callers

nothing calls this directly

Calls 2

dbcb_resp_entryMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected