@ -190,6 +190,7 @@ static char * mysql_thread_variables_names[]= {
( char * ) " default_max_latency_ms " ,
( char * ) " default_query_delay " ,
( char * ) " default_query_timeout " ,
( char * ) " query_processor_iterations " ,
( char * ) " long_query_time " ,
( char * ) " query_cache_size_MB " ,
( char * ) " ping_interval_server_msec " ,
@ -266,6 +267,7 @@ MySQL_Threads_Handler::MySQL_Threads_Handler() {
variables . default_max_latency_ms = 1 * 1000 ; // by default, the maximum allowed latency for a host is 1000ms
variables . default_query_delay = 0 ;
variables . default_query_timeout = 24 * 3600 * 1000 ;
variables . query_processor_iterations = 0 ;
variables . long_query_time = 1000 ;
variables . query_cache_size_MB = 256 ;
variables . init_connect = NULL ;
@ -471,6 +473,7 @@ int MySQL_Threads_Handler::get_variable_int(char *name) {
if ( ! strcasecmp ( name , " max_connections " ) ) return ( int ) variables . max_connections ;
if ( ! strcasecmp ( name , " default_query_delay " ) ) return ( int ) variables . default_query_delay ;
if ( ! strcasecmp ( name , " default_query_timeout " ) ) return ( int ) variables . default_query_timeout ;
if ( ! strcasecmp ( name , " query_processor_iterations " ) ) return ( int ) variables . query_processor_iterations ;
if ( ! strcasecmp ( name , " default_max_latency_ms " ) ) return ( int ) variables . default_max_latency_ms ;
if ( ! strcasecmp ( name , " long_query_time " ) ) return ( int ) variables . long_query_time ;
if ( ! strcasecmp ( name , " query_cache_size_MB " ) ) return ( int ) variables . query_cache_size_MB ;
@ -682,6 +685,10 @@ char * MySQL_Threads_Handler::get_variable(char *name) { // this is the public f
sprintf ( intbuf , " %d " , variables . default_query_timeout ) ;
return strdup ( intbuf ) ;
}
if ( ! strcasecmp ( name , " query_processor_iterations " ) ) {
sprintf ( intbuf , " %d " , variables . query_processor_iterations ) ;
return strdup ( intbuf ) ;
}
if ( ! strcasecmp ( name , " default_max_latency_ms " ) ) {
sprintf ( intbuf , " %d " , variables . default_max_latency_ms ) ;
return strdup ( intbuf ) ;
@ -999,6 +1006,15 @@ bool MySQL_Threads_Handler::set_variable(char *name, char *value) { // this is t
return false ;
}
}
if ( ! strcasecmp ( name , " query_processor_iterations " ) ) {
int intv = atoi ( value ) ;
if ( intv > = 0 & & intv < = 1000 * 1000 ) {
variables . query_processor_iterations = intv ;
return true ;
} else {
return false ;
}
}
if ( ! strcasecmp ( name , " default_max_latency_ms " ) ) {
int intv = atoi ( value ) ;
if ( intv > = 0 & & intv < = 20 * 24 * 3600 * 1000 ) {
@ -2009,6 +2025,7 @@ void MySQL_Thread::refresh_variables() {
mysql_thread___max_connections = GloMTH - > get_variable_int ( ( char * ) " max_connections " ) ;
mysql_thread___default_query_delay = GloMTH - > get_variable_int ( ( char * ) " default_query_delay " ) ;
mysql_thread___default_query_timeout = GloMTH - > get_variable_int ( ( char * ) " default_query_timeout " ) ;
mysql_thread___query_processor_iterations = GloMTH - > get_variable_int ( ( char * ) " query_processor_iterations " ) ;
mysql_thread___default_max_latency_ms = GloMTH - > get_variable_int ( ( char * ) " default_max_latency_ms " ) ;
mysql_thread___long_query_time = GloMTH - > get_variable_int ( ( char * ) " long_query_time " ) ;
mysql_thread___query_cache_size_MB = GloMTH - > get_variable_int ( ( char * ) " query_cache_size_MB " ) ;