432
int2store(buff,sql_errno);
438
int2store(buff, static_cast<uint16_t>(sql_errno));
435
441
/* The first # is to make the client backward compatible */
437
pos= (unsigned char*) strcpy((char*) buff+3, drizzle_errno_to_sqlstate(sql_errno));
438
pos+= strlen(drizzle_errno_to_sqlstate(sql_errno));
443
pos= (unsigned char*) strcpy((char*) buff+3, error::convert_to_sqlstate(sql_errno));
444
pos+= strlen(error::convert_to_sqlstate(sql_errno));
440
446
char *tmp= strncpy((char*)pos, err, DRIZZLE_ERRMSG_SIZE-1);
441
447
tmp+= strlen((char*)pos);
1000
1017
context("port",
1001
1018
po::value<port_constraint>(&port)->default_value(3306),
1002
N_("Port number to use for connection or 0 for default to with MySQL "
1019
_("Port number to use for connection or 0 for default to with MySQL "
1004
1021
context("connect-timeout",
1005
1022
po::value<timeout_constraint>(&connect_timeout)->default_value(10),
1006
N_("Connect Timeout."));
1023
_("Connect Timeout."));
1007
1024
context("read-timeout",
1008
1025
po::value<timeout_constraint>(&read_timeout)->default_value(30),
1009
N_("Read Timeout."));
1026
_("Read Timeout."));
1010
1027
context("write-timeout",
1011
1028
po::value<timeout_constraint>(&write_timeout)->default_value(60),
1012
N_("Write Timeout."));
1029
_("Write Timeout."));
1013
1030
context("retry-count",
1014
1031
po::value<retry_constraint>(&retry_count)->default_value(10),
1015
N_("Retry Count."));
1016
1033
context("buffer-length",
1017
1034
po::value<buffer_constraint>(&buffer_length)->default_value(16384),
1018
N_("Buffer length."));
1035
_("Buffer length."));
1019
1036
context("bind-address",
1020
1037
po::value<string>()->default_value(""),
1021
N_("Address to bind to."));
1038
_("Address to bind to."));
1022
1039
context("max-connections",
1023
1040
po::value<uint32_t>(&ListenMySQLProtocol::mysql_counters->max_connections)->default_value(1000),
1024
N_("Maximum simultaneous connections."));
1041
_("Maximum simultaneous connections."));
1025
1042
context("admin-ip-addresses",
1026
1043
po::value<vector<string> >()->composing()->notifier(&ClientMySQLProtocol::mysql_compose_ip_addresses),
1027
N_("A restrictive IP address list for incoming admin connections."));
1030
static int mysql_protocol_connection_count_func(drizzle_show_var *var, char *buff)
1032
var->type= SHOW_LONGLONG;
1034
*((uint64_t *)buff)= ListenMySQLProtocol::mysql_counters->connectionCount;
1038
static int mysql_protocol_connected_count_func(drizzle_show_var *var, char *buff)
1040
var->type= SHOW_LONGLONG;
1042
*((uint64_t *)buff)= ListenMySQLProtocol::mysql_counters->connected;
1046
static int mysql_protocol_failed_count_func(drizzle_show_var *var, char *buff)
1048
var->type= SHOW_LONGLONG;
1050
*((uint64_t *)buff)= ListenMySQLProtocol::mysql_counters->failedConnections;
1054
static st_show_var_func_container mysql_protocol_connection_count=
1055
{ &mysql_protocol_connection_count_func };
1057
static st_show_var_func_container mysql_protocol_connected_count=
1058
{ &mysql_protocol_connected_count_func };
1060
static st_show_var_func_container mysql_protocol_failed_count=
1061
{ &mysql_protocol_failed_count_func };
1063
static drizzle_show_var mysql_protocol_status_variables[]= {
1065
(char*) &mysql_protocol_connection_count, SHOW_FUNC},
1067
(char*) &mysql_protocol_connected_count, SHOW_FUNC},
1068
{"Failed_connections",
1069
(char*) &mysql_protocol_failed_count, SHOW_FUNC},
1070
{NULL, NULL, SHOW_LONGLONG}
1073
MysqlProtocolStatus::Generator::Generator(drizzled::Field **fields) :
1074
plugin::TableFunction::Generator(fields)
1076
status_var_ptr= mysql_protocol_status_variables;
1079
bool MysqlProtocolStatus::Generator::populate()
1081
MY_ALIGNED_BYTE_ARRAY(buff_data, SHOW_VAR_FUNC_BUFF_SIZE, int64_t);
1082
char * const buff= (char *) &buff_data;
1083
drizzle_show_var tmp;
1085
if (status_var_ptr->name)
1087
std::ostringstream oss;
1088
string return_value;
1092
push(status_var_ptr->name);
1094
if (status_var_ptr->type == SHOW_FUNC)
1096
((drizzle_show_var_func)((st_show_var_func_container *)status_var_ptr->value)->func)(&tmp, buff);
1102
value= status_var_ptr->value;
1103
type= status_var_ptr->type;
1109
oss << *(uint64_t*) value;
1110
return_value= oss.str();
1115
if (return_value.length())
1044
_("A restrictive IP address list for incoming admin connections."));
1127
1047
} /* namespace drizzle_plugin */