Merge branch '10.6' into 10.11

This commit is contained in:
Oleksandr Byelkin 2025-04-21 11:23:11 +02:00
commit 20b818f45e
40 changed files with 446 additions and 115 deletions

View file

@ -155,11 +155,6 @@ void close_thread_tables(THD* thd);
#include "wsrep_sst.h"
#endif /* WITH_WSREP */
#ifdef HAVE_URING
/** The Linux kernel version if io_uring() is considered unsafe */
const char *io_uring_may_be_unsafe;
#endif
#define INSIDE_HA_INNOBASE_CC
#define EQ_CURRENT_THD(thd) ((thd) == current_thd)
@ -4065,13 +4060,6 @@ static int innodb_init_params()
cases, we ignore the setting of innodb_use_native_aio. */
srv_use_native_aio= FALSE;
#endif
#ifdef HAVE_URING
if (srv_use_native_aio && io_uring_may_be_unsafe)
sql_print_warning("innodb_use_native_aio may cause "
"hangs with this kernel %s; see "
"https://jira.mariadb.org/browse/MDEV-26674",
io_uring_may_be_unsafe);
#endif
#ifdef _WIN32
switch (srv_file_flush_method) {
@ -19666,37 +19654,10 @@ static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode,
AUTOINC_OLD_STYLE_LOCKING, /* Minimum value */
AUTOINC_NO_LOCKING, 0); /* Maximum value */
#ifdef HAVE_URING
# include <sys/utsname.h>
static utsname uname_for_io_uring;
#else
static
#endif
bool innodb_use_native_aio_default()
{
#ifdef HAVE_URING
utsname &u= uname_for_io_uring;
if (!uname(&u) && u.release[0] == '5' && u.release[1] == '.' &&
u.release[2] == '1' && u.release[3] >= '1' && u.release[3] <= '5' &&
u.release[4] == '.')
{
if (u.release[3] == '5') {
const char *s= strstr(u.version, "5.15.");
if (s || (s= strstr(u.release, "5.15.")))
if ((s[5] >= '3' || s[6] >= '0'))
return true; /* 5.15.3 and later should be fine */
}
io_uring_may_be_unsafe= u.release;
return false; /* working around io_uring hangs (MDEV-26674) */
}
#endif
return true;
}
static MYSQL_SYSVAR_BOOL(use_native_aio, srv_use_native_aio,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Use native AIO if supported on this platform.",
NULL, NULL, innodb_use_native_aio_default());
NULL, NULL, TRUE);
#ifdef HAVE_LIBNUMA
static MYSQL_SYSVAR_BOOL(numa_interleave, srv_numa_interleave,

View file

@ -152,7 +152,9 @@ trx_undo_log_v_idx(
ulint n_idx = 0;
for (const auto& v_index : vcol->v_indexes) {
n_idx++;
/* FIXME: index->id is 64 bits! */
if (uint32_t hi= uint32_t(v_index.index->id >> 32)) {
size += 1 + mach_get_compressed_size(hi);
}
size += mach_get_compressed_size(uint32_t(v_index.index->id));
size += mach_get_compressed_size(v_index.nth_field);
}
@ -179,10 +181,14 @@ trx_undo_log_v_idx(
ptr += mach_write_compressed(ptr, n_idx);
for (const auto& v_index : vcol->v_indexes) {
ptr += mach_write_compressed(
/* FIXME: index->id is 64 bits! */
ptr, uint32_t(v_index.index->id));
/* This is compatible with
ptr += mach_u64_write_much_compressed(ptr, v_index.index-id)
(the added "if" statement is fixing an old regression). */
if (uint32_t hi= uint32_t(v_index.index->id >> 32)) {
*ptr++ = 0xff;
ptr += mach_write_compressed(ptr, hi);
}
ptr += mach_write_compressed(ptr, uint32_t(v_index.index->id));
ptr += mach_write_compressed(ptr, v_index.nth_field);
}
@ -221,7 +227,15 @@ trx_undo_read_v_idx_low(
dict_index_t* clust_index = dict_table_get_first_index(table);
for (ulint i = 0; i < num_idx; i++) {
index_id_t id = mach_read_next_compressed(&ptr);
index_id_t id = 0;
/* This is like mach_u64_read_much_compressed(),
but advancing ptr to the next field. */
if (*ptr == 0xff) {
ptr++;
id = mach_read_next_compressed(&ptr);
id <<= 32;
}
id |= mach_read_next_compressed(&ptr);
ulint pos = mach_read_next_compressed(&ptr);
dict_index_t* index = dict_table_get_next_index(clust_index);

View file

@ -4150,10 +4150,6 @@ int ha_spider::rnd_init(
}
}
pushed_pos = NULL;
/*
if (wide_handler->external_lock_type == F_WRLCK)
check_and_start_bulk_update(SPD_BU_START_BY_INDEX_OR_RND_INIT);
*/
rnd_scan_and_first = scan;
if (
scan &&

View file

@ -1039,8 +1039,11 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
# MDEV-36357
--disable_view_protocol
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM tb_l a WHERE
EXISTS (SELECT * FROM ta_l b WHERE b.b = a.b) ORDER BY a.a;
--enable_view_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)

View file

@ -3039,6 +3039,10 @@ int spider_db_store_result(
db_conn = conn->db_conn;
if (!result_list->current)
{
/*
Point ->current and ->bgs_current to ->first (create ->first
if needed)
*/
if (!result_list->first)
{
if (!(result_list->first = (SPIDER_RESULT *)
@ -3063,11 +3067,15 @@ int spider_db_store_result(
}
result_list->bgs_current = result_list->current;
current = (SPIDER_RESULT*) result_list->current;
} else {
} else { /* result_list->current != NULL */
if (
result_list->bgs_phase > 0 ||
result_list->quick_phase > 0
) {
/*
Advance bgs_current to the next result. Create a new result
if needed
*/
if (result_list->bgs_current == result_list->last)
{
if (!(result_list->last = (SPIDER_RESULT *)
@ -3110,6 +3118,10 @@ int spider_db_store_result(
}
current = (SPIDER_RESULT*) result_list->bgs_current;
} else {
/*
Advance current to the next result. Create a new result if
needed
*/
if (result_list->current == result_list->last)
{
if (!(result_list->last = (SPIDER_RESULT *)

View file

@ -1688,7 +1688,7 @@ typedef struct st_spider_result
st_spider_result *next;
SPIDER_POSITION *first_position; /* for quick mode */
int pos_page_size; /* for quick mode */
longlong record_num;
longlong record_num; /* number of rows */
bool finish_flg;
bool use_position;
bool first_pos_use_position;
@ -1731,7 +1731,7 @@ typedef struct st_spider_result_list
bool sorted;
bool desc_flg;
longlong current_row_num;
longlong record_num;
longlong record_num; /* number of rows */
bool finish_flg;
longlong limit_num;
longlong internal_offset;