@ -168,6 +168,7 @@ static char * mysql_thread_variables_names[]= {
( char * ) " server_version " ,
( char * ) " sessions_sort " ,
( char * ) " commands_stats " ,
( char * ) " query_digests " ,
( char * ) " servers_stats " ,
( char * ) " default_reconnect " ,
( char * ) " session_debug " ,
@ -226,6 +227,7 @@ MySQL_Threads_Handler::MySQL_Threads_Handler() {
variables . poll_timeout_on_failure = 100 ;
variables . have_compress = true ;
variables . commands_stats = true ;
variables . query_digests = true ;
variables . sessions_sort = true ;
variables . servers_stats = true ;
variables . default_reconnect = true ;
@ -359,6 +361,7 @@ int MySQL_Threads_Handler::get_variable_int(char *name) {
if ( ! strcasecmp ( name , " ping_timeout_server " ) ) return ( int ) variables . ping_timeout_server ;
if ( ! strcasecmp ( name , " have_compress " ) ) return ( int ) variables . have_compress ;
if ( ! strcasecmp ( name , " commands_stats " ) ) return ( int ) variables . commands_stats ;
if ( ! strcasecmp ( name , " query_digests " ) ) return ( int ) variables . commands_stats ;
if ( ! strcasecmp ( name , " sessions_sort " ) ) return ( int ) variables . sessions_sort ;
if ( ! strcasecmp ( name , " servers_stats " ) ) return ( int ) variables . servers_stats ;
if ( ! strcasecmp ( name , " default_reconnect " ) ) return ( int ) variables . default_reconnect ;
@ -498,6 +501,9 @@ char * MySQL_Threads_Handler::get_variable(char *name) { // this is the public f
if ( ! strcasecmp ( name , " commands_stats " ) ) {
return strdup ( ( variables . commands_stats ? " true " : " false " ) ) ;
}
if ( ! strcasecmp ( name , " query_digests " ) ) {
return strdup ( ( variables . query_digests ? " true " : " false " ) ) ;
}
if ( ! strcasecmp ( name , " sessions_sort " ) ) {
return strdup ( ( variables . sessions_sort ? " true " : " false " ) ) ;
}
@ -869,6 +875,17 @@ bool MySQL_Threads_Handler::set_variable(char *name, char *value) { // this is t
}
return false ;
}
if ( ! strcasecmp ( name , " query_digests " ) ) {
if ( strcasecmp ( value , " true " ) = = 0 | | strcasecmp ( value , " 1 " ) = = 0 ) {
variables . query_digests = true ;
return true ;
}
if ( strcasecmp ( value , " false " ) = = 0 | | strcasecmp ( value , " 0 " ) = = 0 ) {
variables . query_digests = false ;
return true ;
}
return false ;
}
if ( ! strcasecmp ( name , " sessions_sort " ) ) {
if ( strcasecmp ( value , " true " ) = = 0 | | strcasecmp ( value , " 1 " ) = = 0 ) {
variables . sessions_sort = true ;
@ -1501,6 +1518,7 @@ void MySQL_Thread::refresh_variables() {
mysql_thread___poll_timeout_on_failure = GloMTH - > get_variable_int ( ( char * ) " poll_timeout_on_failure " ) ;
mysql_thread___have_compress = ( bool ) GloMTH - > get_variable_int ( ( char * ) " have_compress " ) ;
mysql_thread___commands_stats = ( bool ) GloMTH - > get_variable_int ( ( char * ) " commands_stats " ) ;
mysql_thread___query_digests = ( bool ) GloMTH - > get_variable_int ( ( char * ) " query_digests " ) ;
mysql_thread___sessions_sort = ( bool ) GloMTH - > get_variable_int ( ( char * ) " sessions_sort " ) ;
mysql_thread___servers_stats = ( bool ) GloMTH - > get_variable_int ( ( char * ) " servers_stats " ) ;
mysql_thread___default_reconnect = ( bool ) GloMTH - > get_variable_int ( ( char * ) " default_reconnect " ) ;