Merge branch '11.8' into 12.2

This commit is contained in:
Sergei Golubchik 2026-02-03 11:28:23 +01:00
commit d653fcb564
465 changed files with 16286 additions and 3706 deletions

View file

@ -161,7 +161,10 @@ public:
File m_data_file = -1;
MY_STAT m_data_file_stat;
};
Table() = default;
Table()
{
bzero(&m_cap, sizeof(m_cap));
}
Table (Table &&other) = delete;
Table & operator= (Table &&other) = delete;
Table(const Table &) = delete;
@ -222,6 +225,7 @@ private:
};
Table::~Table() {
aria_free_capabilities(&m_cap);
(void)close();
}
@ -298,7 +302,8 @@ bool Table::open(MYSQL *con, bool opt_no_lock, unsigned thread_num) {
goto exit;
}
if (!have_capabilities) {
if ((error= aria_get_capabilities(partition.m_index_file, &m_cap))) {
if ((error= aria_get_capabilities(partition.m_index_file,
m_full_name.c_str(), &m_cap))) {
msg(thread_num, "aria_get_capabilities failed: %d", error);
goto exit;
}
@ -343,6 +348,7 @@ exit:
}
bool Table::close() {
aria_free_capabilities(&m_cap);
for (Partition &partition : m_partitions) {
if (partition.m_index_file >= 0) {
my_close(partition.m_index_file, MYF(MY_WME));
@ -409,14 +415,17 @@ bool Table::copy(ds_ctxt_t *ds, bool is_index, unsigned thread_num) {
{
if (error == HA_ERR_END_OF_FILE)
break;
msg(thread_num, "error: aria_read %s failed: %d",
is_index ? "index" : "data", error);
msg(thread_num, "error: aria_read %s from %s failed "
"with error %d",
is_index ? "index" : "data", full_name.c_str(),
error);
goto err;
}
xtrabackup_io_throttling();
if ((error = ds_write(dst_file, copy_buffer, length))) {
msg(thread_num, "error: aria_write failed: %d", error);
goto err;
msg(thread_num, "error: aria_write to %s failed "
"with error: %d", dst_path, error);
goto err;
}
}

View file

@ -548,6 +548,7 @@ bool get_mysql_vars(MYSQL *connection)
xb_load_list_string(ignore_db_dirs, ",", register_ignore_db_dirs_filter);
out:
free_mysql_variables(mysql_vars);
return (ret);
}
@ -1515,7 +1516,9 @@ write_galera_info(ds_ctxt *datasink, MYSQL *connection)
domain_id ? domain_id : domain_id55);
cleanup:
free_mysql_variables(vars);
free_mysql_variables(status);
free_mysql_variables(value);
return(result);
}

View file

@ -29,6 +29,7 @@
extern struct st_maria_plugin *mysql_optional_plugins[];
extern struct st_maria_plugin *mysql_mandatory_plugins[];
static void encryption_plugin_init(int argc, char **argv);
void initialize_default_encryption();
extern char *xb_plugin_load;
extern char *xb_plugin_dir;
@ -140,7 +141,10 @@ void encryption_plugin_backup_init(MYSQL *mysql)
}
mysql_free_result(result);
if (!plugin_load.length())
{
initialize_default_encryption();
return;
}
oss << "plugin_load=" << plugin_load.c_str() + 1 << std::endl;
@ -248,3 +252,45 @@ static void encryption_plugin_init(int argc, char **argv)
plugin_init(&argc, argv, PLUGIN_INIT_SKIP_PLUGIN_TABLE);
}
/*
Setup encryption_handler with default encryption to avoid crashes when
calling encryption_get_key
*/
uint no_get_key(uint, uint, uchar*, uint*)
{
return ENCRYPTION_KEY_VERSION_INVALID;
}
uint no_key(uint)
{
return ENCRYPTION_KEY_VERSION_INVALID;
}
static int ctx_init(void *ctx, const unsigned char* key, unsigned int klen,
const unsigned char* iv, unsigned int ivlen, int flags,
unsigned int key_id, unsigned int key_version)
{
return my_aes_crypt_init(ctx, MY_AES_CBC, flags, key, klen, iv, ivlen);
}
static unsigned int get_length(unsigned int slen, unsigned int key_id,
unsigned int key_version)
{
return my_aes_get_size(MY_AES_CBC, slen);
}
uint ctx_size(unsigned int, unsigned int)
{
return MY_AES_CTX_SIZE;
}
void initialize_default_encryption()
{
encryption_handler.encryption_ctx_size_func= ctx_size;
encryption_handler.encryption_ctx_init_func= ctx_init;
encryption_handler.encryption_ctx_update_func= my_aes_crypt_update;
encryption_handler.encryption_ctx_finish_func= my_aes_crypt_finish;
encryption_handler.encryption_encrypted_length_func= get_length;
encryption_handler.encryption_key_get_func= no_get_key;
encryption_handler.encryption_key_get_latest_version_func= no_key;
}

View file

@ -5509,6 +5509,7 @@ fail:
if (fil_system.is_initialised()) {
innodb_shutdown();
}
backup_datasinks.destroy();
return(false);
}

View file

@ -353,13 +353,9 @@ int main(int argc,char *argv[])
{
found= 1;
if (verbose)
{
int hundred= code / 100;
printf("MariaDB error code %3d (%s): %s\n"
"Learn more: https://mariadb.com/docs/server/reference/"
"error-codes/mariadb-error-codes-%d00-to-%d99/e%3d\n",
code, name, msg, hundred, hundred, code);
}
"Learn more: https://err.mariadb.com/%3d\n",
code, name, msg, code);
else
puts(msg);
}

@ -1 +1 @@
Subproject commit b077c81eb635392e694ccedbab8b644297ec0285
Subproject commit 59f4fa568615396fbf381b073b220d1e8d61e4c2