@ -4833,7 +4833,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
This algorithm will be become obsolete once we implement session
tracking for MySQL 5.7 +
*/
bool exit_after_SetParse = fals e;
bool exit_after_SetParse = tru e;
unsigned char command_type = * ( ( unsigned char * ) pkt - > ptr + sizeof ( mysql_hdr ) ) ;
if ( qpo - > new_query ) {
// the query was rewritten
@ -5056,7 +5056,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
}
proxy_debug ( PROXY_DEBUG_MYSQL_COM , 8 , " Changing connection SQL Mode to %s \n " , value1 . c_str ( ) ) ;
}
exit_after_SetParse = true ;
//exit_after_SetParse = true;
// the following two blocks of code will be simplified later
} else if ( ( var = = " sql_auto_is_null " ) | | ( var = = " sql_safe_updates " ) ) {
int idx = SQL_NAME_LAST ;
@ -5069,7 +5069,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
}
}
if ( idx ! = SQL_NAME_LAST ) {
if ( mysql_variables . parse_variable_boolean ( this , idx , * values , exit_after_SetParse, lock_hostgroup) = = false ) {
if ( mysql_variables . parse_variable_boolean ( this , idx , * values , lock_hostgroup) = = false ) {
return false ;
}
}
@ -5084,7 +5084,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
}
}
if ( idx ! = SQL_NAME_LAST ) {
if ( mysql_variables . parse_variable_number ( this , idx , * values , exit_after_SetParse, lock_hostgroup) = = false ) {
if ( mysql_variables . parse_variable_number ( this , idx , * values , lock_hostgroup) = = false ) {
return false ;
}
}
@ -5127,7 +5127,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
autocommit = true ;
client_myds - > myconn - > set_autocommit ( autocommit ) ;
autocommit_on_hostgroup = FindOneActiveTransaction ( ) ;
exit_after_SetParse = tru e;
exit_after_SetParse = fals e;
} else {
// as there is no active transaction, we do no need to forward it
// just change internal state
@ -5142,7 +5142,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
}
} else {
if ( autocommit_handled = = true ) {
exit_after_SetParse = tru e;
exit_after_SetParse = fals e;
}
}
} else if ( var = = " time_zone " ) {
@ -5159,7 +5159,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
return false ;
proxy_debug ( PROXY_DEBUG_MYSQL_COM , 8 , " Changing connection Time zone to %s \n " , value1 . c_str ( ) ) ;
}
exit_after_SetParse = true ;
//exit_after_SetParse = true;
} else if ( var = = " session_track_gtids " ) {
std : : string value1 = * values ;
if ( ( strcasecmp ( value1 . c_str ( ) , " OWN_GTID " ) = = 0 ) | | ( strcasecmp ( value1 . c_str ( ) , " OFF " ) = = 0 ) ) {
@ -5173,7 +5173,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
proxy_debug ( PROXY_DEBUG_MYSQL_COM , 5 , " Changing connection session_track_gtids to %s \n " , value1 . c_str ( ) ) ;
client_myds - > myconn - > options . session_track_gtids = strdup ( value1 . c_str ( ) ) ;
}
exit_after_SetParse = true ;
//exit_after_SetParse = true;
} else {
unable_to_parse_set_statement ( lock_hostgroup ) ;
return false ;
@ -5252,7 +5252,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
proxy_debug ( PROXY_DEBUG_MYSQL_COM , 5 , " Changing connection %s to %s \n " , var . c_str ( ) , value1 . c_str ( ) ) ;
}
}
exit_after_SetParse = true ;
//exit_after_SetParse = true;
} else {
unable_to_parse_set_statement ( lock_hostgroup ) ;
return false ;
@ -5295,7 +5295,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
} else {
proxy_debug ( PROXY_DEBUG_MYSQL_COM , 8 , " Changing connection charset to %d \n " , c - > nr ) ;
client_myds - > myconn - > set_charset ( c - > nr , NAMES ) ;
exit_after_SetParse = true ;
//exit_after_SetParse = true;
}
} else if ( var = = " tx_isolation " ) {
std : : string value1 = * values ;
@ -5309,7 +5309,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
return false ;
proxy_debug ( PROXY_DEBUG_MYSQL_COM , 8 , " Changing connection TX ISOLATION to %s \n " , value1 . c_str ( ) ) ;
}
exit_after_SetParse = true ;
//exit_after_SetParse = true;
} else {
std : : string value1 = * values ;
std : : size_t found_at = value1 . find ( " @ " ) ;
@ -5426,7 +5426,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
return false ;
proxy_debug ( PROXY_DEBUG_MYSQL_COM , 8 , " Changing connection TRANSACTION ISOLATION LEVEL to %s \n " , value1 . c_str ( ) ) ;
}
exit_after_SetParse = true ;
//exit_after_SetParse = true;
} else if ( var = = " read " ) {
std : : string value1 = * values ;
proxy_debug ( PROXY_DEBUG_MYSQL_COM , 5 , " Processing SET SESSION TRANSACTION READ value %s \n " , value1 . c_str ( ) ) ;
@ -5436,7 +5436,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
return false ;
proxy_debug ( PROXY_DEBUG_MYSQL_COM , 8 , " Changing connection TRANSACTION READ to %s \n " , value1 . c_str ( ) ) ;
}
exit_after_SetParse = true ;
//exit_after_SetParse = true;
} else {
unable_to_parse_set_statement ( lock_hostgroup ) ;
return false ;
@ -5481,7 +5481,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
} else {
proxy_debug ( PROXY_DEBUG_MYSQL_COM , 8 , " Changing connection charset to %d \n " , c - > nr ) ;
client_myds - > myconn - > set_charset ( c - > nr , CHARSET ) ;
exit_after_SetParse = true ;
//exit_after_SetParse = true;
}
if ( exit_after_SetParse ) {
if ( command_type = = _MYSQL_COM_QUERY ) {