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

Merge 10.6 into 10.11

Some fixes related to commit f838b2d799 and
Rows_log_event::do_apply_event() and Update_rows_log_event::do_exec_row()
for system-versioned tables were provided by Nikita Malyavin.
This was required by test versioning.rpl,trx_id,row.
This commit is contained in:
Marko Mäkelä
2024-03-28 09:16:57 +02:00
319 changed files with 7106 additions and 3441 deletions

View File

@@ -719,7 +719,7 @@ typedef struct system_variables
ulonglong max_mem_used;
/*
A bitmap of OPTIMIZER_ADJ_* flags (defined in sql_priv.h).
See sql_vars.cc:adjust_secondary_key_cost for symbolic names.
See sys_vars.cc:adjust_secondary_key_cost for symbolic names.
*/
ulonglong optimizer_adjust_secondary_key_costs;
@@ -1577,6 +1577,8 @@ public:
*/
bool check_access(const privilege_t want_access, bool match_any = false);
bool is_priv_user(const char *user, const char *host);
bool is_user_defined() const
{ return user && user != delayed_user && user != slave_user; };
};
@@ -5190,11 +5192,29 @@ public:
{
if (global_system_variables.log_warnings > threshold)
{
char real_ip_str[64];
real_ip_str[0]= 0;
/* For proxied connections, add the real IP to the warning message */
if (net.using_proxy_protocol && net.vio)
{
if(net.vio->localhost)
snprintf(real_ip_str, sizeof(real_ip_str), " real ip: 'localhost'");
else
{
char buf[INET6_ADDRSTRLEN];
if (!vio_getnameinfo((sockaddr *)&(net.vio->remote), buf,
sizeof(buf),NULL, 0, NI_NUMERICHOST))
{
snprintf(real_ip_str, sizeof(real_ip_str), " real ip: '%s'",buf);
}
}
}
Security_context *sctx= &main_security_ctx;
sql_print_warning(ER_THD(this, ER_NEW_ABORTING_CONNECTION),
thread_id, (db.str ? db.str : "unconnected"),
sctx->user ? sctx->user : "unauthenticated",
sctx->host_or_ip, reason);
sctx->host_or_ip, real_ip_str, reason);
}
}
@@ -5292,8 +5312,18 @@ public:
Flag, mutex and condition for a thread to wait for a signal from another
thread.
Currently used to wait for group commit to complete, can also be used for
other purposes.
Currently used to wait for group commit to complete, and COND_wakeup_ready
is used for threads to wait on semi-sync ACKs (though is protected by
Repl_semi_sync_master::LOCK_binlog). Note the following relationships
between these two use-cases when using
rpl_semi_sync_master_wait_point=AFTER_SYNC during group commit:
1) Non-leader threads use COND_wakeup_ready to wait for the leader thread
to complete binlog commit.
2) The leader thread uses COND_wakeup_ready to await ACKs from the
replica before signalling the non-leader threads to wake up.
With wait_point=AFTER_COMMIT, there is no overlap as binlogging has
finished, so COND_wakeup_ready is safe to re-use.
*/
bool wakeup_ready;
mysql_mutex_t LOCK_wakeup_ready;
@@ -5421,14 +5451,6 @@ public:
bool is_binlog_dump_thread();
#endif
/*
Indicates if this thread is suspended due to awaiting an ACK from a
replica. True if suspended, false otherwise.
Note that this variable is protected by Repl_semi_sync_master::LOCK_binlog
*/
bool is_awaiting_semisync_ack;
inline ulong wsrep_binlog_format(ulong binlog_format) const
{
#ifdef WITH_WSREP