1047
1044
_("A restrictive IP address list for incoming admin connections."));
1050
static int mysql_protocol_connection_count_func(drizzle_show_var *var, char *buff)
1052
var->type= SHOW_LONGLONG;
1054
*((uint64_t *)buff)= ListenMySQLProtocol::mysql_counters->connectionCount;
1058
static int mysql_protocol_connected_count_func(drizzle_show_var *var, char *buff)
1060
var->type= SHOW_LONGLONG;
1062
*((uint64_t *)buff)= ListenMySQLProtocol::mysql_counters->connected;
1066
static int mysql_protocol_failed_count_func(drizzle_show_var *var, char *buff)
1068
var->type= SHOW_LONGLONG;
1070
*((uint64_t *)buff)= ListenMySQLProtocol::mysql_counters->failedConnections;
1074
static st_show_var_func_container mysql_protocol_connection_count=
1075
{ &mysql_protocol_connection_count_func };
1077
static st_show_var_func_container mysql_protocol_connected_count=
1078
{ &mysql_protocol_connected_count_func };
1080
static st_show_var_func_container mysql_protocol_failed_count=
1081
{ &mysql_protocol_failed_count_func };
1083
static drizzle_show_var mysql_protocol_status_variables[]= {
1085
(char*) &mysql_protocol_connection_count, SHOW_FUNC},
1087
(char*) &mysql_protocol_connected_count, SHOW_FUNC},
1088
{"Failed_connections",
1089
(char*) &mysql_protocol_failed_count, SHOW_FUNC},
1090
{NULL, NULL, SHOW_LONGLONG}
1093
MysqlProtocolStatus::Generator::Generator(drizzled::Field **fields) :
1094
plugin::TableFunction::Generator(fields)
1096
status_var_ptr= mysql_protocol_status_variables;
1099
bool MysqlProtocolStatus::Generator::populate()
1101
MY_ALIGNED_BYTE_ARRAY(buff_data, SHOW_VAR_FUNC_BUFF_SIZE, int64_t);
1102
char * const buff= (char *) &buff_data;
1103
drizzle_show_var tmp;
1105
if (status_var_ptr->name)
1107
std::ostringstream oss;
1108
string return_value;
1112
push(status_var_ptr->name);
1114
if (status_var_ptr->type == SHOW_FUNC)
1116
((drizzle_show_var_func)((st_show_var_func_container *)status_var_ptr->value)->func)(&tmp, buff);
1122
value= status_var_ptr->value;
1123
type= status_var_ptr->type;
1129
oss << *(uint64_t*) value;
1130
return_value= oss.str();
1135
if (return_value.length())
1147
1047
} /* namespace drizzle_plugin */
1149
1049
DRIZZLE_DECLARE_PLUGIN