summaryrefslogtreecommitdiffstats
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
commit86fbb58c3ac0865482819c10a3e81f2eea001c36 (patch)
tree28c9e526ea739c6f9b89e36115e1e2698bddf981 /sql/mysqld.cc
parentReleasing progress-linux version 1:10.11.6-2~progress7.99u1. (diff)
downloadmariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.tar.xz
mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.zip
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc164
1 files changed, 88 insertions, 76 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 95286923..738fd73e 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -5221,6 +5221,14 @@ static int init_server_components()
if (!opt_abort && ddl_log_initialize())
unireg_abort(1);
+ /*
+ Plugins may not be completed because system table DDLs are only
+ run after the ddl recovery done. Therefore between the
+ plugin_init() call and the ha_signal_ddl_recovery_done() call
+ below only things related to preparation for recovery should be
+ done and nothing else, and definitely not anything assuming that
+ all plugins have been initialised.
+ */
if (plugin_init(&remaining_argc, remaining_argv,
(opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) |
(opt_abort ? PLUGIN_INIT_SKIP_INITIALIZATION : 0)))
@@ -5544,6 +5552,15 @@ static int init_server_components()
#else
locked_in_memory= 0;
#endif
+#ifdef PR_SET_THP_DISABLE
+ /*
+ Engine page buffers are now allocated.
+ Disable transparent huge pages for all
+ future allocations as these causes memory
+ leaks.
+ */
+ prctl(PR_SET_THP_DISABLE, 1, 0, 0, 0);
+#endif
ft_init_stopwords();
@@ -5791,8 +5808,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;
@@ -6867,8 +6882,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;
@@ -6876,16 +6891,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;
@@ -6894,8 +6909,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;
@@ -6905,32 +6920,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;
@@ -6940,7 +6951,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;
@@ -6951,19 +6963,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;
@@ -6971,19 +6981,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;
@@ -6993,8 +7001,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;
@@ -7002,8 +7010,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;
@@ -7013,8 +7021,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;
@@ -7033,8 +7041,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 )
@@ -7044,8 +7052,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;
@@ -7056,8 +7064,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;
@@ -7072,8 +7080,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;
@@ -7085,8 +7093,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 )
@@ -7096,9 +7104,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)
@@ -7183,8 +7192,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)
@@ -7193,7 +7202,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;
@@ -7217,8 +7226,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)
@@ -7227,7 +7236,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;
@@ -7281,7 +7290,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)
{
@@ -7337,8 +7346,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;
@@ -7347,8 +7356,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;
@@ -7500,7 +7509,7 @@ SHOW_VAR status_vars[]= {
SHOW_FUNC_ENTRY("Rpl_semi_sync_master_net_avg_wait_time", &SHOW_FNAME(avg_net_wait_time)),
{"Rpl_semi_sync_master_request_ack", (char*) &rpl_semi_sync_master_request_ack, SHOW_LONGLONG},
{"Rpl_semi_sync_master_get_ack", (char*)&rpl_semi_sync_master_get_ack, SHOW_LONGLONG},
- {"Rpl_semi_sync_slave_status", (char*) &rpl_semi_sync_slave_status, SHOW_BOOL},
+ SHOW_FUNC_ENTRY("Rpl_semi_sync_slave_status", &rpl_semi_sync_enabled),
{"Rpl_semi_sync_slave_send_ack", (char*) &rpl_semi_sync_slave_send_ack, SHOW_LONGLONG},
#endif /* HAVE_REPLICATION */
#ifdef HAVE_QUERY_CACHE
@@ -8082,6 +8091,9 @@ mysqld_get_one_option(const struct my_option *opt, const char *argument,
test_flags= argument ? ((uint) atoi(argument) & ~TEST_BLOCKING) : 0;
opt_endinfo=1;
break;
+ case OPT_SECURE_AUTH:
+ WARN_DEPRECATED_NO_REPLACEMENT(NULL, "--secure-auth");
+ break;
case OPT_THREAD_CONCURRENCY:
WARN_DEPRECATED_NO_REPLACEMENT(NULL, "THREAD_CONCURRENCY");
break;