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

Method op_readnolock

client/hslongrun.cpp:648–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

646}
647
648int
649hs_longrun_thread_hs::op_readnolock(int key)
650{
651 const std::string k = to_stdstring(key);
652 const string_ref op_ref("=", 1);
653 const string_ref op_args[1] = {
654 to_string_ref(k),
655 };
656 cli->request_buf_exec_generic(0, op_ref, op_args, 1, 1, 0,
657 string_ref(), 0, 0, 0, 0);
658 cli->request_send();
659 if (check_hs_error("op_read_send", 0) != 0) { return 1; }
660 size_t num_flds = 0;
661 size_t num_rows = 0;
662 cli->response_recv(num_flds);
663 if (check_hs_error("op_read_recv", 0) != 0) { return 1; }
664 const string_ref *row = cli->get_next_row();
665 std::string rrec[4];
666 if (row != 0 && num_flds == 4) {
667 for (int i = 0; i < 4; ++i) {
668 rrec[i] = to_string(row[i]);
669 }
670 ++num_rows;
671 }
672 row = cli->get_next_row();
673 if (row != 0) {
674 ++num_rows;
675 }
676 cli->response_buf_remove();
677 return verify_readnolock(k, num_rows, num_flds, rrec);
678}
679
680int
681hs_longrun_thread_hs::check_hs_error(const char *mess, record_value *rec)

Callers

nothing calls this directly

Calls 9

to_stdstringFunction · 0.85
to_string_refFunction · 0.85
string_refClass · 0.85
to_stringFunction · 0.85
request_sendMethod · 0.80
response_recvMethod · 0.80
get_next_rowMethod · 0.80
response_buf_removeMethod · 0.80

Tested by

no test coverage detected