mirror of
https://gitee.com/wangbin579/cetus.git
synced 2024-11-30 02:47:35 +08:00
Merge master
This commit is contained in:
commit
f08817525c
@ -927,6 +927,20 @@ void admin_set_maintain(network_mysqld_con* con, int mode)
|
||||
network_mysqld_con_send_ok_full(con->client, affected, 0,2,0);
|
||||
}
|
||||
|
||||
void admin_set_charset_check(network_mysqld_con* con, int mode)
|
||||
{
|
||||
if (con->is_admin_client) {
|
||||
return;
|
||||
}
|
||||
|
||||
int affected = 0;
|
||||
if (con->srv->charset_check != mode) {
|
||||
con->srv->charset_check = mode;
|
||||
affected = 1;
|
||||
}
|
||||
network_mysqld_con_send_ok_full(con->client, affected, 0,2,0);
|
||||
}
|
||||
|
||||
void admin_show_maintain(network_mysqld_con* con)
|
||||
{
|
||||
if (con->is_processed_by_subordinate) {
|
||||
@ -1983,6 +1997,7 @@ static struct sql_help_entry_t {
|
||||
{"delete allow_ip/deny_ip '<user>@<address>'", "delete address from white list of module", ALL_HELP},
|
||||
{"set reduce_conns (true|false)", "reduce idle connections if set to true", ALL_HELP},
|
||||
{"set maintain (true|false)", "close all client connections if set to true", ALL_HELP},
|
||||
{"set charset_check (true|false)", "check the client charset is equal to the default charset", ALL_HELP},
|
||||
{"refresh conns", "refresh all server connections", ALL_HELP},
|
||||
{"show maintain status", "show maintain status", ALL_HELP},
|
||||
{"show status [like '%pattern%']", "show select/update/insert/delete statistics", ALL_HELP},
|
||||
|
@ -23,6 +23,7 @@ void admin_acl_add_rule(network_mysqld_con *con, gboolean is_white, char *addr);
|
||||
void admin_acl_delete_rule(network_mysqld_con *con, gboolean is_white, char* ip);
|
||||
void admin_set_reduce_conns(network_mysqld_con* con, int mode);
|
||||
void admin_set_maintain(network_mysqld_con* con, int mode);
|
||||
void admin_set_charset_check(network_mysqld_con* con, int mode);
|
||||
void admin_show_maintain(network_mysqld_con* con);
|
||||
void admin_show_status(network_mysqld_con* con, const char* like);
|
||||
void admin_show_variables(network_mysqld_con* con, const char* like);
|
||||
|
@ -211,6 +211,9 @@ cmd ::= SET REDUCE_CONNS boolean(X) SEMI. {
|
||||
cmd ::= SET MAINTAIN boolean(X) SEMI. {
|
||||
admin_set_maintain(con, X);
|
||||
}
|
||||
cmd ::= SET CHARSET_CHECK boolean(X) SEMI. {
|
||||
admin_set_charset_check(con, X);
|
||||
}
|
||||
cmd ::= REFRESH_CONNS SEMI. {
|
||||
admin_set_server_conn_refresh(con);
|
||||
}
|
||||
|
@ -77,6 +77,7 @@
|
||||
"master" return TK_MASTER;
|
||||
"slave" return TK_SLAVE;
|
||||
"maintain" return TK_MAINTAIN;
|
||||
"charset_check" return TK_CHARSET_CHECK;
|
||||
"status" return TK_STATUS;
|
||||
"variables" return TK_VARIABLES;
|
||||
"conn_num" return TK_CONN_NUM;
|
||||
|
@ -834,6 +834,13 @@ adjust_charset(network_mysqld_con *con, mysqld_query_attr_t *query_attr)
|
||||
g_string_assign_len(con->server->charset, charset->str, charset->len);
|
||||
}
|
||||
|
||||
if (con->srv->charset_check) {
|
||||
if (strcmp(con->client->charset->str, con->srv->default_charset) != 0) {
|
||||
g_message("%s: client charset:%s, default charset:%s, client address:%s", G_STRLOC,
|
||||
con->client->charset->str, con->srv->default_charset, con->client->src->name->str);
|
||||
}
|
||||
}
|
||||
|
||||
if (!query_attr->charset_client_set) {
|
||||
if (!g_string_equal(con->client->charset_client, con->server->charset_client)) {
|
||||
if (con->client->charset_client->len > 0) {
|
||||
|
@ -1607,6 +1607,13 @@ check_and_set_attr_bitmap(network_mysqld_con *con)
|
||||
g_warning("%s: not support different sql modes", G_STRLOC);
|
||||
}
|
||||
|
||||
if (con->srv->charset_check) {
|
||||
if (strcmp(con->client->charset->str, con->srv->default_charset) != 0) {
|
||||
g_message("%s: client charset:%s, default charset:%s, client address:%s", G_STRLOC,
|
||||
con->client->charset->str, con->srv->default_charset, con->client->src->name->str);
|
||||
}
|
||||
}
|
||||
|
||||
if (!g_string_equal(con->client->charset, ss->server->charset)) {
|
||||
ss->attr_diff |= ATTR_DIF_CHARSET;
|
||||
con->unmatched_attribute |= ATTR_DIF_CHARSET;
|
||||
|
@ -150,6 +150,7 @@ struct chassis {
|
||||
unsigned int is_manual_down:1;
|
||||
unsigned int is_reduce_conns:1;
|
||||
unsigned int xa_log_detailed:1;
|
||||
unsigned int charset_check:1;
|
||||
unsigned int check_slave_delay:1;
|
||||
unsigned int complement_conn_flag:1;
|
||||
unsigned int disable_dns_cache:1;
|
||||
|
Loading…
Reference in New Issue
Block a user