1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '10.5' into 10.6

This commit is contained in:
Yuchen Pei
2024-01-11 12:59:22 +11:00
90 changed files with 713 additions and 198 deletions

View File

@@ -5686,8 +5686,6 @@ int mysqld_main(int argc, char **argv)
SYSVAR_AUTOSIZE(my_thread_stack_size, new_thread_stack_size);
}
(void) thr_setconcurrency(concurrency); // 10 by default
select_thread=pthread_self();
select_thread_in_use=1;
@@ -6772,8 +6770,8 @@ struct my_option my_long_options[]=
#endif
};
static int show_queries(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_queries(THD *thd, SHOW_VAR *var, void *,
system_status_var *, enum_var_type)
{
var->type= SHOW_LONGLONG;
var->value= &thd->query_id;
@@ -6781,16 +6779,16 @@ static int show_queries(THD *thd, SHOW_VAR *var, char *buff,
}
static int show_net_compression(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_net_compression(THD *thd, SHOW_VAR *var, void *,
system_status_var *, enum_var_type)
{
var->type= SHOW_MY_BOOL;
var->value= &thd->net.compress;
return 0;
}
static int show_starttime(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_starttime(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_LONG;
var->value= buff;
@@ -6799,8 +6797,8 @@ static int show_starttime(THD *thd, SHOW_VAR *var, char *buff,
}
#ifdef ENABLED_PROFILING
static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_flushstatustime(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_LONG;
var->value= buff;
@@ -6810,32 +6808,28 @@ static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff,
#endif
#ifdef HAVE_REPLICATION
static int show_rpl_status(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_rpl_status(THD *, SHOW_VAR *var, void *, system_status_var *,
enum_var_type)
{
var->type= SHOW_CHAR;
var->value= const_cast<char*>(rpl_status_type[(int)rpl_status]);
return 0;
}
static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_slave_running(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
Master_info *mi= NULL;
bool UNINIT_VAR(tmp);
var->type= SHOW_MY_BOOL;
var->value= buff;
if ((mi= get_master_info(&thd->variables.default_master_connection,
Sql_condition::WARN_LEVEL_NOTE)))
if (Master_info *mi=
get_master_info(&thd->variables.default_master_connection,
Sql_condition::WARN_LEVEL_NOTE))
{
tmp= (my_bool) (mi->slave_running == MYSQL_SLAVE_RUN_READING &&
mi->rli.slave_running != MYSQL_SLAVE_NOT_RUN);
*((my_bool*) buff)=
(mi->slave_running == MYSQL_SLAVE_RUN_READING &&
mi->rli.slave_running != MYSQL_SLAVE_NOT_RUN);
mi->release();
var->type= SHOW_MY_BOOL;
var->value= buff;
}
if (mi)
*((my_bool *)buff)= tmp;
else
var->type= SHOW_UNDEF;
return 0;
@@ -6845,7 +6839,8 @@ static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff,
/* How many masters this slave is connected to */
static int show_slaves_running(THD *thd, SHOW_VAR *var, char *buff)
static int show_slaves_running(THD *, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_LONGLONG;
var->value= buff;
@@ -6856,19 +6851,17 @@ static int show_slaves_running(THD *thd, SHOW_VAR *var, char *buff)
}
static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
Master_info *mi;
var->type= SHOW_LONGLONG;
var->value= buff;
if ((mi= get_master_info(&thd->variables.default_master_connection,
Sql_condition::WARN_LEVEL_NOTE)))
if (Master_info *mi=
get_master_info(&thd->variables.default_master_connection,
Sql_condition::WARN_LEVEL_NOTE))
{
*((longlong *)buff)= mi->received_heartbeats;
mi->release();
var->type= SHOW_LONGLONG;
var->value= buff;
}
else
var->type= SHOW_UNDEF;
@@ -6876,19 +6869,17 @@ static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, char *buff,
}
static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_heartbeat_period(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
Master_info *mi;
var->type= SHOW_CHAR;
var->value= buff;
if ((mi= get_master_info(&thd->variables.default_master_connection,
Sql_condition::WARN_LEVEL_NOTE)))
if (Master_info *mi=
get_master_info(&thd->variables.default_master_connection,
Sql_condition::WARN_LEVEL_NOTE))
{
sprintf(buff, "%.3f", mi->heartbeat_period);
sprintf(static_cast<char*>(buff), "%.3f", mi->heartbeat_period);
mi->release();
var->type= SHOW_CHAR;
var->value= buff;
}
else
var->type= SHOW_UNDEF;
@@ -6898,8 +6889,8 @@ static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff,
#endif /* HAVE_REPLICATION */
static int show_open_tables(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_open_tables(THD *, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_LONG;
var->value= buff;
@@ -6907,8 +6898,8 @@ static int show_open_tables(THD *thd, SHOW_VAR *var, char *buff,
return 0;
}
static int show_prepared_stmt_count(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_prepared_stmt_count(THD *, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_LONG;
var->value= buff;
@@ -6918,8 +6909,8 @@ static int show_prepared_stmt_count(THD *thd, SHOW_VAR *var, char *buff,
return 0;
}
static int show_table_definitions(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_table_definitions(THD *, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_LONG;
var->value= buff;
@@ -6938,8 +6929,8 @@ static int show_table_definitions(THD *thd, SHOW_VAR *var, char *buff,
inside an Event.
*/
static int show_ssl_get_version(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_ssl_get_version(THD *thd, SHOW_VAR *var, void *,
system_status_var *, enum_var_type)
{
var->type= SHOW_CHAR;
if( thd->vio_ok() && thd->net.vio->ssl_arg )
@@ -6949,8 +6940,8 @@ static int show_ssl_get_version(THD *thd, SHOW_VAR *var, char *buff,
return 0;
}
static int show_ssl_get_default_timeout(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_ssl_get_default_timeout(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_LONG;
var->value= buff;
@@ -6961,8 +6952,8 @@ static int show_ssl_get_default_timeout(THD *thd, SHOW_VAR *var, char *buff,
return 0;
}
static int show_ssl_get_verify_mode(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_ssl_get_verify_mode(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_LONG;
var->value= buff;
@@ -6977,8 +6968,8 @@ static int show_ssl_get_verify_mode(THD *thd, SHOW_VAR *var, char *buff,
return 0;
}
static int show_ssl_get_verify_depth(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_ssl_get_verify_depth(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_LONG;
var->value= buff;
@@ -6990,8 +6981,8 @@ static int show_ssl_get_verify_depth(THD *thd, SHOW_VAR *var, char *buff,
return 0;
}
static int show_ssl_get_cipher(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_ssl_get_cipher(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_CHAR;
if( thd->vio_ok() && thd->net.vio->ssl_arg )
@@ -7001,9 +6992,10 @@ static int show_ssl_get_cipher(THD *thd, SHOW_VAR *var, char *buff,
return 0;
}
static int show_ssl_get_cipher_list(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_ssl_get_cipher_list(THD *thd, SHOW_VAR *var, void *buf,
system_status_var *, enum_var_type)
{
char *buff= static_cast<char*>(buf);
var->type= SHOW_CHAR;
var->value= buff;
if (thd->vio_ok() && thd->net.vio->ssl_arg)
@@ -7088,8 +7080,8 @@ end:
*/
static int
show_ssl_get_server_not_before(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
show_ssl_get_server_not_before(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_CHAR;
if(thd->vio_ok() && thd->net.vio->ssl_arg)
@@ -7098,7 +7090,7 @@ show_ssl_get_server_not_before(THD *thd, SHOW_VAR *var, char *buff,
X509 *cert= SSL_get_certificate(ssl);
const ASN1_TIME *not_before= X509_get0_notBefore(cert);
var->value= my_asn1_time_to_string(not_before, buff,
var->value= my_asn1_time_to_string(not_before, static_cast<char*>(buff),
SHOW_VAR_FUNC_BUFF_SIZE);
if (!var->value)
return 1;
@@ -7122,8 +7114,8 @@ show_ssl_get_server_not_before(THD *thd, SHOW_VAR *var, char *buff,
*/
static int
show_ssl_get_server_not_after(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
show_ssl_get_server_not_after(THD *thd, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_CHAR;
if(thd->vio_ok() && thd->net.vio->ssl_arg)
@@ -7132,7 +7124,7 @@ show_ssl_get_server_not_after(THD *thd, SHOW_VAR *var, char *buff,
X509 *cert= SSL_get_certificate(ssl);
const ASN1_TIME *not_after= X509_get0_notAfter(cert);
var->value= my_asn1_time_to_string(not_after, buff,
var->value= my_asn1_time_to_string(not_after, static_cast<char*>(buff),
SHOW_VAR_FUNC_BUFF_SIZE);
if (!var->value)
return 1;
@@ -7186,7 +7178,7 @@ static int show_default_keycache(THD *thd, SHOW_VAR *var, void *buff,
}
static int show_memory_used(THD *thd, SHOW_VAR *var, char *buff,
static int show_memory_used(THD *thd, SHOW_VAR *var, void *buff,
struct system_status_var *status_var,
enum enum_var_type scope)
{
@@ -7242,8 +7234,8 @@ static int debug_status_func(THD *thd, SHOW_VAR *var, void *buff,
#endif
#ifdef HAVE_POOL_OF_THREADS
static int show_threadpool_idle_threads(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_threadpool_idle_threads(THD *, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_INT;
var->value= buff;
@@ -7252,8 +7244,8 @@ static int show_threadpool_idle_threads(THD *thd, SHOW_VAR *var, char *buff,
}
static int show_threadpool_threads(THD *thd, SHOW_VAR *var, char *buff,
enum enum_var_type scope)
static int show_threadpool_threads(THD *, SHOW_VAR *var, void *buff,
system_status_var *, enum_var_type)
{
var->type= SHOW_INT;
var->value= buff;