Skip to content

Commit

Permalink
Minor code optimizations
Browse files Browse the repository at this point in the history
About:
handler_again___verify_backend_multi_statement()
handler_again___verify_init_connect()
  • Loading branch information
renecannao committed Jan 25, 2024
1 parent 78fd49e commit 1d11701
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/MySQL_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5005,6 +5005,7 @@ int MySQL_Session::handler() {
MySQL_Data_Stream *myds=mybe->server_myds;
MySQL_Connection *myconn=myds->myconn;
mybe->server_myds->max_connect_time=0;
MySQL_Connection *client_myconn = client_myds->myconn;
// we insert it in mypolls only if not already there
if (myds->mypolls==NULL) {
thread->mypolls.add(POLLIN|POLLOUT, mybe->server_myds->fd, mybe->server_myds, thread->curtime);
Expand All @@ -5018,8 +5019,10 @@ int MySQL_Session::handler() {
if (mirror==false) { // do not care about autocommit and charset if mirror
proxy_debug(PROXY_DEBUG_MYSQL_CONNECTION, 5, "Session %p , default_HG=%d server_myds DSS=%d , locked_on_HG=%d\n", this, default_hostgroup, mybe->server_myds->DSS, locked_on_hostgroup);
if (mybe->server_myds->DSS == STATE_READY || mybe->server_myds->DSS == STATE_MARIADB_GENERIC) {
if (handler_again___verify_init_connect()) {
goto handler_again;
if (unlikely(myconn->options.init_connect_sent==false)) { // micro-optimization. Perform this check outside handler_again___verify_init_connect()
if (handler_again___verify_init_connect()) {
goto handler_again;
}
}
if (use_ldap_auth) {
if (handler_again___verify_ldap_user_variable()) {
Expand All @@ -5031,8 +5034,10 @@ int MySQL_Session::handler() {
}
if (locked_on_hostgroup == -1 || locked_on_hostgroup_and_all_variables_set == false ) {

if (handler_again___verify_backend_multi_statement()) {
goto handler_again;
if (unlikely(client_myconn->options.client_flag & CLIENT_MULTI_STATEMENTS) != (myconn->options.client_flag & CLIENT_MULTI_STATEMENTS)) { // micro-optimization. Perform this check outside handler_again___verify_backend_multi_statement
if (handler_again___verify_backend_multi_statement()) {
goto handler_again;
}
}

if (handler_again___verify_backend_session_track_gtids()) {
Expand Down

0 comments on commit 1d11701

Please sign in to comment.