mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
Fix that SHOW STATUS works with SSL.
Add 4.0 commands to SHOW STATUS.
This commit is contained in:
parent
6aeb40bd3f
commit
0c0a170fa7
7 changed files with 63 additions and 29 deletions
|
@ -22819,6 +22819,7 @@ snapshot.
|
|||
listing of slaves currently registered with the master (Master)
|
||||
|
||||
@item @code{SHOW SLAVE STATUS} @tab Provides status information on essential parameters of the slave thread. (Slave)
|
||||
|
||||
@item @code{SHOW MASTER LOGS} @tab Only available starting in Version
|
||||
3.23.28. Lists the binary logs on the master. You should use this
|
||||
command prior to @code{PURGE MASTER LOGS TO} to find out how far you
|
||||
|
|
|
@ -900,7 +900,7 @@ explain select a,b,c from t1;
|
|||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ALL NULL NULL NULL NULL 4
|
||||
drop table t1;
|
||||
create table t1 (testint int not null default 1);
|
||||
create table t1 (testint int not null default 1) type=innodb;
|
||||
desc t1;
|
||||
Field Type Null Key Default Extra
|
||||
testint int(11) 1
|
||||
|
|
|
@ -3147,16 +3147,21 @@ struct show_var_st status_vars[]= {
|
|||
{"Com_create_index", (char*) (com_stat+(uint) SQLCOM_CREATE_INDEX),SHOW_LONG},
|
||||
{"Com_create_table", (char*) (com_stat+(uint) SQLCOM_CREATE_TABLE),SHOW_LONG},
|
||||
{"Com_delete", (char*) (com_stat+(uint) SQLCOM_DELETE),SHOW_LONG},
|
||||
{"Com_delete_multi", (char*) (com_stat+(uint) SQLCOM_DELETE_MULTI),SHOW_LONG},
|
||||
{"Com_drop_db", (char*) (com_stat+(uint) SQLCOM_DROP_DB),SHOW_LONG},
|
||||
{"Com_drop_function", (char*) (com_stat+(uint) SQLCOM_DROP_FUNCTION),SHOW_LONG},
|
||||
{"Com_drop_index", (char*) (com_stat+(uint) SQLCOM_DROP_INDEX),SHOW_LONG},
|
||||
{"Com_drop_table", (char*) (com_stat+(uint) SQLCOM_DROP_TABLE),SHOW_LONG},
|
||||
{"Com_flush", (char*) (com_stat+(uint) SQLCOM_FLUSH),SHOW_LONG},
|
||||
{"Com_grant", (char*) (com_stat+(uint) SQLCOM_GRANT),SHOW_LONG},
|
||||
{"Com_ha_close", (char*) (com_stat+(uint) SQLCOM_HA_OPEN),SHOW_LONG},
|
||||
{"Com_ha_open", (char*) (com_stat+(uint) SQLCOM_HA_OPEN),SHOW_LONG},
|
||||
{"Com_ha_read", (char*) (com_stat+(uint) SQLCOM_HA_READ),SHOW_LONG},
|
||||
{"Com_insert", (char*) (com_stat+(uint) SQLCOM_INSERT),SHOW_LONG},
|
||||
{"Com_insert_select", (char*) (com_stat+(uint) SQLCOM_INSERT_SELECT),SHOW_LONG},
|
||||
{"Com_kill", (char*) (com_stat+(uint) SQLCOM_KILL),SHOW_LONG},
|
||||
{"Com_load", (char*) (com_stat+(uint) SQLCOM_LOAD),SHOW_LONG},
|
||||
{"Com_load_master_data", (char*) (com_stat+(uint) SQLCOM_LOAD_MASTER_DATA),SHOW_LONG},
|
||||
{"Com_load_master_table", (char*) (com_stat+(uint) SQLCOM_LOAD_MASTER_TABLE),SHOW_LONG},
|
||||
{"Com_lock_tables", (char*) (com_stat+(uint) SQLCOM_LOCK_TABLES),SHOW_LONG},
|
||||
{"Com_optimize", (char*) (com_stat+(uint) SQLCOM_OPTIMIZE),SHOW_LONG},
|
||||
|
@ -3171,6 +3176,7 @@ struct show_var_st status_vars[]= {
|
|||
{"Com_rollback", (char*) (com_stat+(uint) SQLCOM_ROLLBACK),SHOW_LONG},
|
||||
{"Com_select", (char*) (com_stat+(uint) SQLCOM_SELECT),SHOW_LONG},
|
||||
{"Com_set_option", (char*) (com_stat+(uint) SQLCOM_SET_OPTION),SHOW_LONG},
|
||||
{"Com_show_binlog_events", (char*) (com_stat+(uint) SQLCOM_SHOW_BINLOG_EVENTS),SHOW_LONG},
|
||||
{"Com_show_binlogs", (char*) (com_stat+(uint) SQLCOM_SHOW_BINLOGS),SHOW_LONG},
|
||||
{"Com_show_create", (char*) (com_stat+(uint) SQLCOM_SHOW_CREATE),SHOW_LONG},
|
||||
{"Com_show_databases", (char*) (com_stat+(uint) SQLCOM_SHOW_DATABASES),SHOW_LONG},
|
||||
|
@ -3178,9 +3184,11 @@ struct show_var_st status_vars[]= {
|
|||
{"Com_show_grants", (char*) (com_stat+(uint) SQLCOM_SHOW_GRANTS),SHOW_LONG},
|
||||
{"Com_show_keys", (char*) (com_stat+(uint) SQLCOM_SHOW_KEYS),SHOW_LONG},
|
||||
{"Com_show_logs", (char*) (com_stat+(uint) SQLCOM_SHOW_LOGS),SHOW_LONG},
|
||||
{"Com_show_master_STAT", (char*) (com_stat+(uint) SQLCOM_SHOW_MASTER_STAT),SHOW_LONG},
|
||||
{"Com_show_master_stat", (char*) (com_stat+(uint) SQLCOM_SHOW_MASTER_STAT),SHOW_LONG},
|
||||
{"Com_show_new_master", (char*) (com_stat+(uint) SQLCOM_SHOW_NEW_MASTER),SHOW_LONG},
|
||||
{"Com_show_open_tables", (char*) (com_stat+(uint) SQLCOM_SHOW_OPEN_TABLES),SHOW_LONG},
|
||||
{"Com_show_processlist", (char*) (com_stat+(uint) SQLCOM_SHOW_PROCESSLIST),SHOW_LONG},
|
||||
{"Com_show_slave_hosts", (char*) (com_stat+(uint) SQLCOM_SHOW_SLAVE_HOSTS),SHOW_LONG},
|
||||
{"Com_show_slave_stat", (char*) (com_stat+(uint) SQLCOM_SHOW_SLAVE_STAT),SHOW_LONG},
|
||||
{"Com_show_status", (char*) (com_stat+(uint) SQLCOM_SHOW_STATUS),SHOW_LONG},
|
||||
{"Com_show_tables", (char*) (com_stat+(uint) SQLCOM_SHOW_TABLES),SHOW_LONG},
|
||||
|
|
|
@ -55,7 +55,7 @@ enum enum_sql_command {
|
|||
SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_SHOW_BINLOGS,
|
||||
SQLCOM_SHOW_OPEN_TABLES, SQLCOM_LOAD_MASTER_DATA,
|
||||
SQLCOM_HA_OPEN, SQLCOM_HA_CLOSE, SQLCOM_HA_READ,
|
||||
SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_MULTI_DELETE,
|
||||
SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI,
|
||||
SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_SHOW_NEW_MASTER,
|
||||
SQLCOM_END
|
||||
};
|
||||
|
|
|
@ -1691,7 +1691,7 @@ mysql_execute_command(void)
|
|||
select_lex->options);
|
||||
break;
|
||||
}
|
||||
case SQLCOM_MULTI_DELETE:
|
||||
case SQLCOM_DELETE_MULTI:
|
||||
{
|
||||
TABLE_LIST *aux_tables=(TABLE_LIST *)thd->lex.auxilliary_table_list.first;
|
||||
TABLE_LIST *auxi;
|
||||
|
|
|
@ -1180,65 +1180,85 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables)
|
|||
/* First group - functions relying on CTX */
|
||||
case SHOW_SSL_CTX_SESS_ACCEPT:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_accept(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_accept(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_ACCEPT_GOOD:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_accept_good(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_accept_good(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_CONNECT_GOOD:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_connect_good(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_connect_good(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_ACCEPT_RENEGOTIATE:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_accept_renegotiate(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_accept_renegotiate(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_CONNECT_RENEGOTIATE:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_connect_renegotiate(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_connect_renegotiate(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_CB_HITS:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_cb_hits(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_cb_hits(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_HITS:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_hits(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_hits(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_CACHE_FULL:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_cache_full(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_cache_full(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_MISSES:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_misses(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_misses(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_TIMEOUTS:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_timeouts(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_timeouts(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_NUMBER:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_number(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_number(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_CONNECT:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_connect(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_connect(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_SESS_GET_CACHE_SIZE:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_sess_get_cache_size(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_sess_get_cache_size(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_GET_VERIFY_MODE:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_get_verify_mode(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_get_verify_mode(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_GET_VERIFY_DEPTH:
|
||||
net_store_data(&packet2,(uint32)
|
||||
SSL_CTX_get_verify_depth(ssl_acceptor_fd->ssl_context_));
|
||||
(!ssl_acceptor_fd ? 0 :
|
||||
SSL_CTX_get_verify_depth(ssl_acceptor_fd->ssl_context_)));
|
||||
break;
|
||||
case SHOW_SSL_CTX_GET_SESSION_CACHE_MODE:
|
||||
if (!ssl_acceptor_fd)
|
||||
{
|
||||
net_store_data(&packet2,"NONE" );
|
||||
break;
|
||||
}
|
||||
switch(SSL_CTX_get_session_cache_mode(ssl_acceptor_fd->ssl_context_))
|
||||
{
|
||||
case SSL_SESS_CACHE_OFF:
|
||||
|
@ -1286,23 +1306,28 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables)
|
|||
SSL_get_verify_depth(thd->net.vio->ssl_):0));
|
||||
break;
|
||||
case SHOW_SSL_GET_CIPHER:
|
||||
net_store_data(&packet2, thd->net.vio->ssl_ ? SSL_get_cipher(thd->net.vio->ssl_) : "");
|
||||
net_store_data(&packet2, thd->net.vio->ssl_ ?
|
||||
SSL_get_cipher(thd->net.vio->ssl_) : "");
|
||||
break;
|
||||
case SHOW_SSL_GET_CIPHER_LIST:
|
||||
if(thd->net.vio->ssl_)
|
||||
if (thd->net.vio->ssl_)
|
||||
{
|
||||
char buf[1024]="";
|
||||
for (int i=0; ; i++)
|
||||
char buf[1024], *pos;
|
||||
pos=buf;
|
||||
for (int i=0 ; i++ ;)
|
||||
{
|
||||
const char *p=SSL_get_cipher_list(thd->net.vio->ssl_,i);
|
||||
if (p == NULL)
|
||||
break;
|
||||
if (i != 0)
|
||||
strcat(buf,":");
|
||||
strcat(buf,p);
|
||||
DBUG_PRINT("info",("cipher to add: %s,%s",p,buf));
|
||||
pos=strmov(pos, p);
|
||||
*pos++= ':';
|
||||
}
|
||||
if (pos != buf)
|
||||
pos--; // Remove last ':'
|
||||
*pos=0;
|
||||
net_store_data(&packet2, buf);
|
||||
} else
|
||||
}
|
||||
else
|
||||
net_store_data(&packet2, "");
|
||||
break;
|
||||
|
||||
|
|
|
@ -2406,7 +2406,7 @@ single_multi:
|
|||
| table_wild_list
|
||||
{
|
||||
LEX *lex=Lex;
|
||||
lex->sql_command = SQLCOM_MULTI_DELETE;
|
||||
lex->sql_command = SQLCOM_DELETE_MULTI;
|
||||
mysql_init_select(lex);
|
||||
lex->select->select_limit=HA_POS_ERROR;
|
||||
lex->auxilliary_table_list.elements=0;
|
||||
|
|
Loading…
Reference in a new issue