on_connect_to_backend() to accept a MySQL_Connection as argument instead of a MySQL_Session

pull/2675/head
René Cannaò 6 years ago
parent 6dd73fc631
commit d83f2974b6

@ -45,7 +45,7 @@ public:
bool verify_variable(MySQL_Session* session, int idx) const;
bool update_variable(MySQL_Session* session, session_status status, int &_rc);
bool on_connect_to_backend(MySQL_Session* session);
bool on_connect_to_backend(MySQL_Connection *myconn);
};
#endif // #ifndef MYSQL_VARIABLES_H

@ -2494,7 +2494,7 @@ bool MySQL_Session::handler_again___status_CONNECTING_SERVER(int *_rc) {
myds->myconn->send_quit = false;
myds->myconn->reusable = false;
}
mysql_variables.on_connect_to_backend(this);
mysql_variables.on_connect_to_backend(myds->myconn);
NEXT_IMMEDIATE_NEW(st);
break;
case -1:
@ -6332,7 +6332,7 @@ void MySQL_Session::create_new_session_and_reset_connection(MySQL_Data_Stream *_
mc->async_state_machine = ASYNC_IDLE; // may not be true, but is used to correctly perform error handling
new_myds->DSS = STATE_MARIADB_QUERY;
thread->register_session_connection_handler(new_sess,true);
mysql_variables.on_connect_to_backend(this);
mysql_variables.on_connect_to_backend(mc);
if (new_myds->mypolls==NULL) {
thread->mypolls.add(POLLIN|POLLOUT, new_myds->fd, new_myds, thread->curtime);
}

@ -44,15 +44,15 @@ MySQL_Variables::MySQL_Variables() {
MySQL_Variables::~MySQL_Variables() {}
bool MySQL_Variables::on_connect_to_backend(MySQL_Session* session) {
if (!session || !session->mybe || !session->mybe->server_myds || !session->mybe->server_myds->myconn) return false;
auto be_version = session->mybe->server_myds->myconn->mysql->server_version;
bool MySQL_Variables::on_connect_to_backend(MySQL_Connection *myconn) {
assert(myconn);
auto be_version = myconn->mysql->server_version;
// verify this is not galera cluster
// assume galera cluster has two dashes in a version
char* first_dash = strstr(be_version, "-");
if (!first_dash || !strstr(first_dash+1, "-")) {
session->mybe->server_myds->myconn->var_absent[SQL_WSREP_SYNC_WAIT] = true;
myconn->var_absent[SQL_WSREP_SYNC_WAIT] = true;
}
return true;

Loading…
Cancel
Save