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

Method op_update

client/hslongrun.cpp:583–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581}
582
583int
584hs_longrun_thread_hs::op_update(record_value& rec)
585{
586 const std::string k = rec.key;
587 const std::string v1 = "uv1_" + k + "_" + to_stdstring(arg.id);
588 const std::string v2 = "uv2_" + k + "_" + to_stdstring(arg.id);
589 const std::string v3 = "uv3_" + k + "_" + to_stdstring(arg.id);
590 const string_ref op_ref("=", 1);
591 const string_ref op_args[1] = {
592 to_string_ref(k),
593 };
594 const string_ref modop_ref("U", 1);
595 const string_ref modop_args[4] = {
596 to_string_ref(k),
597 to_string_ref(v1),
598 to_string_ref(v2),
599 to_string_ref(v3)
600 };
601 cli->request_buf_exec_generic(0, op_ref, op_args, 1, 1, 0,
602 modop_ref, modop_args, 4, 0, 0);
603 cli->request_send();
604 if (check_hs_error("op_update_send", &rec) != 0) { return 1; }
605 size_t numflds = 0;
606 cli->response_recv(numflds);
607 if (check_hs_error("op_update_recv", &rec) != 0) { return 1; }
608 const string_ref *row = cli->get_next_row();
609 uint32_t num_rows = row
610 ? atoi_uint32_nocheck(row[0].begin(), row[0].end()) : 0;
611 cli->response_buf_remove();
612 const bool cur_unknown_state = (num_rows == 1);
613 return verify_update(k, v1, v2, v3, rec, num_rows, cur_unknown_state);
614}
615
616int
617hs_longrun_thread_hs::op_read(record_value& rec)

Callers

nothing calls this directly

Calls 10

to_stdstringFunction · 0.85
to_string_refFunction · 0.85
atoi_uint32_nocheckFunction · 0.85
request_sendMethod · 0.80
response_recvMethod · 0.80
get_next_rowMethod · 0.80
response_buf_removeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected