@ -36,12 +36,6 @@ static const char* mcp_thread_variables_names[] = {
" stats_show_queries_max_rows " ,
" stats_show_processlist_max_rows " ,
" stats_enable_debug_tools " ,
// MySQL Tool Handler configuration
" mysql_hosts " ,
" mysql_ports " ,
" mysql_user " ,
" mysql_password " ,
" mysql_schema " ,
NULL
} ;
@ -66,12 +60,6 @@ MCP_Threads_Handler::MCP_Threads_Handler() {
variables . mcp_stats_show_queries_max_rows = 200 ;
variables . mcp_stats_show_processlist_max_rows = 200 ;
variables . mcp_stats_enable_debug_tools = false ;
// MySQL Tool Handler default values
variables . mcp_mysql_hosts = strdup ( " 127.0.0.1 " ) ;
variables . mcp_mysql_ports = strdup ( " 3306 " ) ;
variables . mcp_mysql_user = strdup ( " " ) ;
variables . mcp_mysql_password = strdup ( " " ) ;
variables . mcp_mysql_schema = strdup ( " " ) ;
status_variables . total_requests = 0 ;
status_variables . failed_requests = 0 ;
@ -105,17 +93,6 @@ MCP_Threads_Handler::~MCP_Threads_Handler() {
free ( variables . mcp_ai_endpoint_auth ) ;
if ( variables . mcp_rag_endpoint_auth )
free ( variables . mcp_rag_endpoint_auth ) ;
// Free MySQL Tool Handler variables
if ( variables . mcp_mysql_hosts )
free ( variables . mcp_mysql_hosts ) ;
if ( variables . mcp_mysql_ports )
free ( variables . mcp_mysql_ports ) ;
if ( variables . mcp_mysql_user )
free ( variables . mcp_mysql_user ) ;
if ( variables . mcp_mysql_password )
free ( variables . mcp_mysql_password ) ;
if ( variables . mcp_mysql_schema )
free ( variables . mcp_mysql_schema ) ;
if ( mcp_server ) {
delete mcp_server ;
@ -248,27 +225,6 @@ int MCP_Threads_Handler::get_variable(const char* name, char* val) {
sprintf ( val , " %s " , variables . mcp_stats_enable_debug_tools ? " true " : " false " ) ;
return 0 ;
}
// MySQL Tool Handler configuration
if ( ! strcmp ( name , " mysql_hosts " ) ) {
sprintf ( val , " %s " , variables . mcp_mysql_hosts ? variables . mcp_mysql_hosts : " " ) ;
return 0 ;
}
if ( ! strcmp ( name , " mysql_ports " ) ) {
sprintf ( val , " %s " , variables . mcp_mysql_ports ? variables . mcp_mysql_ports : " " ) ;
return 0 ;
}
if ( ! strcmp ( name , " mysql_user " ) ) {
sprintf ( val , " %s " , variables . mcp_mysql_user ? variables . mcp_mysql_user : " " ) ;
return 0 ;
}
if ( ! strcmp ( name , " mysql_password " ) ) {
sprintf ( val , " %s " , variables . mcp_mysql_password ? variables . mcp_mysql_password : " " ) ;
return 0 ;
}
if ( ! strcmp ( name , " mysql_schema " ) ) {
sprintf ( val , " %s " , variables . mcp_mysql_schema ? variables . mcp_mysql_schema : " " ) ;
return 0 ;
}
return - 1 ;
}
@ -393,37 +349,6 @@ int MCP_Threads_Handler::set_variable(const char* name, const char* value) {
}
return - 1 ;
}
// MySQL Tool Handler configuration
if ( ! strcmp ( name , " mysql_hosts " ) ) {
if ( variables . mcp_mysql_hosts )
free ( variables . mcp_mysql_hosts ) ;
variables . mcp_mysql_hosts = strdup ( value ) ;
return 0 ;
}
if ( ! strcmp ( name , " mysql_ports " ) ) {
if ( variables . mcp_mysql_ports )
free ( variables . mcp_mysql_ports ) ;
variables . mcp_mysql_ports = strdup ( value ) ;
return 0 ;
}
if ( ! strcmp ( name , " mysql_user " ) ) {
if ( variables . mcp_mysql_user )
free ( variables . mcp_mysql_user ) ;
variables . mcp_mysql_user = strdup ( value ) ;
return 0 ;
}
if ( ! strcmp ( name , " mysql_password " ) ) {
if ( variables . mcp_mysql_password )
free ( variables . mcp_mysql_password ) ;
variables . mcp_mysql_password = strdup ( value ) ;
return 0 ;
}
if ( ! strcmp ( name , " mysql_schema " ) ) {
if ( variables . mcp_mysql_schema )
free ( variables . mcp_mysql_schema ) ;
variables . mcp_mysql_schema = strdup ( value ) ;
return 0 ;
}
return - 1 ;
}