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

Method execute_line

handlersocket/hstcpsvr_worker.cpp:677–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

675}
676
677void
678hstcpsvr_worker::execute_line(char *start, char *finish, hstcpsvr_conn& conn)
679{
680 /* safe to modify, safe to dereference 'finish' */
681 char *const cmd_begin = start;
682 read_token(start, finish);
683 char *const cmd_end = start;
684 skip_one(start, finish);
685 if (cmd_begin == cmd_end) {
686 return conn.dbcb_resp_short(2, "cmd");
687 }
688 if (cmd_begin + 1 == cmd_end) {
689 if (cmd_begin[0] == 'P') {
690 if (cshared.require_auth && !conn.authorized) {
691 return conn.dbcb_resp_short(3, "unauth");
692 }
693 return do_open_index(start, finish, conn);
694 }
695 if (cmd_begin[0] == 'A') {
696 return do_authorization(start, finish, conn);
697 }
698 }
699 if (cmd_begin[0] >= '0' && cmd_begin[0] <= '9') {
700 if (cshared.require_auth && !conn.authorized) {
701 return conn.dbcb_resp_short(3, "unauth");
702 }
703 return do_exec_on_index(cmd_begin, cmd_end, start, finish, conn);
704 }
705 return conn.dbcb_resp_short(2, "cmd");
706}
707
708void
709hstcpsvr_worker::do_open_index(char *start, char *finish, hstcpsvr_conn& conn)

Callers

nothing calls this directly

Calls 3

read_tokenFunction · 0.85
skip_oneFunction · 0.85
dbcb_resp_shortMethod · 0.80

Tested by

no test coverage detected