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

Merge branch '11.1' into 11.2

This commit is contained in:
Oleksandr Byelkin
2024-04-09 12:12:33 +02:00
727 changed files with 22644 additions and 8310 deletions

View File

@@ -680,8 +680,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
#ifdef HAVE_REPLICATION
,
current_linfo(0),
slave_info(0),
is_awaiting_semisync_ack(0)
slave_info(0)
#endif
#ifdef WITH_WSREP
,
@@ -4482,7 +4481,7 @@ void Security_context::destroy()
my_free((char*) host);
host= NULL;
}
if (user != delayed_user)
if (is_user_defined())
{
my_free((char*) user);
user= NULL;
@@ -5304,14 +5303,6 @@ extern "C" enum enum_server_command thd_current_command(MYSQL_THD thd)
return thd->get_command();
}
#ifdef HAVE_REPLICATION /* Working around MDEV-24622 */
/** @return whether the current thread is for applying binlog in a replica */
extern "C" int thd_is_slave(const MYSQL_THD thd)
{
return thd && thd->slave_thread;
}
#endif /* HAVE_REPLICATION */
/* Returns high resolution timestamp for the start
of the current query. */
extern "C" unsigned long long thd_start_utime(const MYSQL_THD thd)
@@ -5710,6 +5701,40 @@ extern "C" void *thd_mdl_context(MYSQL_THD thd)
return &thd->mdl_context;
}
/**
Send check/repair message to the user
@param op one of check or repair
@param msg_type one of info, warning or error
@param print_to_log <> 0 if we should also print the message to error log.
*/
extern "C" void
print_check_msg(THD *thd, const char *db_name, const char *table_name, const char *op,
const char *msg_type, const char *message, my_bool print_to_log)
{
char name[NAME_LEN * 2 + 2];
Protocol *protocol= thd->protocol;
DBUG_ASSERT(strlen(db_name) <= NAME_LEN);
DBUG_ASSERT(strlen(table_name) <= NAME_LEN);
size_t length= size_t(strxnmov(name, sizeof name - 1,
db_name, ".", table_name, NullS) -
name);
protocol->prepare_for_resend();
protocol->store(name, length, system_charset_info);
protocol->store(op, strlen(op), system_charset_info);
protocol->store(msg_type, strlen(msg_type), system_charset_info);
protocol->store(message, strlen(message), system_charset_info);
if (protocol->write())
sql_print_error("Failed on my_net_write, writing to stderr instead: %s: %s\n",
table_name, message);
else if (thd->variables.log_warnings > 2 && print_to_log)
sql_print_error("%s: table '%s' got '%s' during %s",
msg_type, table_name, message, op);
}
/****************************************************************************
Handling of statement states in functions and triggers.