Merge branch '10.11' into 11.4

This commit is contained in:
Sergei Golubchik 2026-01-28 16:06:03 +01:00
commit 40f7084661
391 changed files with 14213 additions and 2900 deletions

View file

@ -42,7 +42,7 @@ public:
}
const char *fully_qualified_func_name() const override
{ return "sysconst_test()"; }
Item *do_get_copy(THD *thd) const override
Item *shallow_copy(THD *thd) const override
{ return get_item_copy<Item_func_sysconst_test>(thd, this); }
};

View file

@ -1,6 +1,3 @@
IF(VCPKG_INSTALLED_DIR AND (WITH_ZLIB STREQUAL "bundled"))
SET(CMAKE_DISABLE_FIND_PACKAGE_ZLIB 1)
ENDIF()
FIND_PACKAGE(CURL)
IF(NOT CURL_FOUND)
# Can't build plugin

View file

@ -161,7 +161,7 @@ static clock_t cache_max_ver_time;
Convert milliseconds to timer ticks with rounding
to nearest integer:
*/
static clock_t ms_to_ticks (long ms)
static clock_t ms_to_ticks (long long ms)
{
long long ticks_1000 = ms * (long long) CLOCKS_PER_SEC;
clock_t ticks = (clock_t) (ticks_1000 / 1000);
@ -343,9 +343,11 @@ static int timeout;
static int max_retries;
static char caching_enabled;
static char check_kv_version;
static long cache_timeout; // for KEY_MAP key_info_cache
static long cache_version_timeout; // for VER_MAP latest_version_cache
#if MYSQL_VERSION_ID < 130300
static long long cache_timeout; // for KEY_MAP key_info_cache
static char use_cache_on_timeout;
#endif
static long cache_version_timeout; // for VER_MAP latest_version_cache
static MYSQL_SYSVAR_STR(vault_ca, vault_ca,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
@ -391,15 +393,15 @@ static void cache_timeout_update (MYSQL_THD thd,
void *var_ptr,
const void *save)
{
long timeout = * (long *) save;
* (long *) var_ptr = timeout;
long long timeout = * (long long *) save;
* (long long *) var_ptr = timeout;
cache_max_time = ms_to_ticks(timeout);
}
static MYSQL_SYSVAR_LONG(cache_timeout, cache_timeout,
PLUGIN_VAR_RQCMDARG,
static MYSQL_SYSVAR_LONGLONG(cache_timeout, cache_timeout,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED,
"Cache timeout for key data (in milliseconds)",
NULL, cache_timeout_update, 24*60*60*1000, 0, LONG_MAX, 1);
NULL, cache_timeout_update, INT64_MAX, 0, INT64_MAX, 1);
static void
cache_version_timeout_update (MYSQL_THD thd,
@ -418,10 +420,10 @@ static MYSQL_SYSVAR_LONG(cache_version_timeout, cache_version_timeout,
NULL, cache_version_timeout_update, 60*1000, 0, LONG_MAX, 1);
static MYSQL_SYSVAR_BOOL(use_cache_on_timeout, use_cache_on_timeout,
PLUGIN_VAR_RQCMDARG,
"In case of timeout (when accessing the vault server) "
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED,
"In case of an error when accessing the vault server "
"use the value taken from the cache",
NULL, NULL, 0);
NULL, NULL, 1);
static struct st_mysql_sys_var *settings[] = {
MYSQL_SYSVAR(vault_url),
@ -532,7 +534,7 @@ int HCData::curl_run (const char *url, std::string *response,
&http_code)) != CURLE_OK)
{
curl_easy_cleanup(curl);
if (soft_timeout && curl_res == CURLE_OPERATION_TIMEDOUT)
if (soft_timeout)
{
return OPERATION_TIMEOUT;
}

View file

@ -6,12 +6,16 @@ SELECT
SET GLOBAL
HASHICORP_KEY_MANAGEMENT_CACHE_VERSION_TIMEOUT= 1,
HASHICORP_KEY_MANAGEMENT_CACHE_TIMEOUT= 1;
Warnings:
Warning 1287 '@@hashicorp_key_management_cache_timeout' is deprecated and will be removed in a future release
SELECT
@@HASHICORP_KEY_MANAGEMENT_CACHE_VERSION_TIMEOUT,
@@HASHICORP_KEY_MANAGEMENT_CACHE_TIMEOUT;
@@HASHICORP_KEY_MANAGEMENT_CACHE_VERSION_TIMEOUT @@HASHICORP_KEY_MANAGEMENT_CACHE_TIMEOUT
1 1
SET GLOBAL HASHICORP_KEY_MANAGEMENT_CACHE_VERSION_TIMEOUT=0, HASHICORP_KEY_MANAGEMENT_CACHE_TIMEOUT=180000;
Warnings:
Warning 1287 '@@hashicorp_key_management_cache_timeout' is deprecated and will be removed in a future release
SELECT
@@HASHICORP_KEY_MANAGEMENT_CACHE_VERSION_TIMEOUT,
@@HASHICORP_KEY_MANAGEMENT_CACHE_TIMEOUT;

View file

@ -1,12 +1,12 @@
SHOW GLOBAL variables LIKE "hashicorp%";
Variable_name Value
hashicorp_key_management_cache_timeout 86400000
hashicorp_key_management_cache_timeout 9223372036854775807
hashicorp_key_management_cache_version_timeout 60000
hashicorp_key_management_caching_enabled ON
hashicorp_key_management_check_kv_version OFF
hashicorp_key_management_max_retries 3
hashicorp_key_management_timeout 60
hashicorp_key_management_use_cache_on_timeout OFF
hashicorp_key_management_use_cache_on_timeout ON
hashicorp_key_management_vault_ca
hashicorp_key_management_vault_url VAULT_ADDR/v1/mariadbtest/
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;

View file

@ -1,12 +1,12 @@
SHOW GLOBAL variables LIKE "hashicorp%";
Variable_name Value
hashicorp_key_management_cache_timeout 86400000
hashicorp_key_management_cache_timeout 9223372036854775807
hashicorp_key_management_cache_version_timeout 0
hashicorp_key_management_caching_enabled ON
hashicorp_key_management_check_kv_version OFF
hashicorp_key_management_max_retries 3
hashicorp_key_management_timeout 60
hashicorp_key_management_use_cache_on_timeout OFF
hashicorp_key_management_use_cache_on_timeout ON
hashicorp_key_management_vault_ca
hashicorp_key_management_vault_url VAULT_ADDR/v1/mariadbtest/
# Restart the server with encryption

View file

@ -0,0 +1,22 @@
#
# MDEV-38604 Assertion `thd->utime_after_query >= thd->utime_after_lock' failed in query_response_time_audit_notify on 2nd execution of SP with query cache
#
set global query_response_time_stats=on;
set global query_cache_type=on;
set query_cache_type=on;
create table t (a int);
create procedure sp() execute immediate 'select * from t';
call sp;
a
call sp;
a
drop table t;
drop procedure sp;
set global query_cache_type= default;
create procedure p1() begin end;
create procedure p2() call p1();
call p2();
call p2();
drop procedure p2;
drop procedure p1;
set global query_response_time_stats=default;

View file

@ -0,0 +1,23 @@
--echo #
--echo # MDEV-38604 Assertion `thd->utime_after_query >= thd->utime_after_lock' failed in query_response_time_audit_notify on 2nd execution of SP with query cache
--echo #
set global query_response_time_stats=on;
set global query_cache_type=on;
set query_cache_type=on;
create table t (a int);
create procedure sp() execute immediate 'select * from t';
call sp;
call sp;
drop table t;
drop procedure sp;
set global query_cache_type= default;
create procedure p1() begin end;
create procedure p2() call p1();
call p2();
call p2();
drop procedure p2;
drop procedure p1;
set global query_response_time_stats=default;

View file

@ -129,7 +129,10 @@ static void query_response_time_audit_notify(MYSQL_THD thd,
THDVAR(thd, exec_time_debug) : 0);
else
#endif
query_response_time_collect(thd->utime_after_query - thd->utime_after_lock);
{
DBUG_ASSERT(thd->utime_after_query >= thd->utime_after_lock);
query_response_time_collect(thd->utime_after_query - thd->utime_after_lock);
}
}
}

View file

@ -1671,20 +1671,10 @@ static int log_statement_ex(const struct connection_info *cn,
if (query && !(events & EVENT_QUERY_ALL) &&
(events & EVENT_QUERY && !cn->log_always))
{
const char *orig_query= query;
if (events & EVENT_QUERY_DDL && cmdtype & EVENT_QUERY_DDL)
goto do_log_query;
if (events & EVENT_QUERY_DML && cmdtype & EVENT_QUERY_DML)
goto do_log_query;
if (events & EVENT_QUERY_DML_NO_SELECT && cmdtype & EVENT_QUERY_DML_NO_SELECT)
goto do_log_query;
if (events & EVENT_QUERY_DCL && cmdtype & EVENT_QUERY_DCL)
goto do_log_query;
return 0;
do_log_query:
query= orig_query;
if (!(events & cmdtype &
(EVENT_QUERY_DDL | EVENT_QUERY_DML | EVENT_QUERY_DML_NO_SELECT |
EVENT_QUERY_DCL)))
return 0;
}
csize= log_header(message, message_size-1, &ev_time,

View file

@ -45,7 +45,7 @@ public:
unsigned_flag= 1;
return FALSE;
}
Item *do_get_copy(THD *thd) const override
Item *shallow_copy(THD *thd) const override
{ return get_item_copy<Item_func_inet_aton>(thd, this); }
};
@ -72,7 +72,7 @@ public:
set_maybe_null();
return FALSE;
}
Item *do_get_copy(THD *thd) const override
Item *shallow_copy(THD *thd) const override
{ return get_item_copy<Item_func_inet_ntoa>(thd, this); }
};
@ -118,7 +118,7 @@ public:
set_maybe_null();
return FALSE;
}
Item *do_get_copy(THD *thd) const override
Item *shallow_copy(THD *thd) const override
{ return get_item_copy<Item_func_inet6_aton>(thd, this); }
String *val_str(String *to) override;
@ -156,7 +156,7 @@ public:
return FALSE;
}
String *val_str_ascii(String *to) override;
Item *do_get_copy(THD *thd) const override
Item *shallow_copy(THD *thd) const override
{ return get_item_copy<Item_func_inet6_ntoa>(thd, this); }
};
@ -178,7 +178,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4") };
return name;
}
Item *do_get_copy(THD *thd) const override
Item *shallow_copy(THD *thd) const override
{ return get_item_copy<Item_func_is_ipv4>(thd, this); }
bool val_bool() override;
@ -201,7 +201,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv6") };
return name;
}
Item *do_get_copy(THD *thd) const override
Item *shallow_copy(THD *thd) const override
{ return get_item_copy<Item_func_is_ipv6>(thd, this); }
bool val_bool() override;
@ -223,7 +223,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4_compat") };
return name;
}
Item *do_get_copy(THD *thd) const override
Item *shallow_copy(THD *thd) const override
{ return get_item_copy<Item_func_is_ipv4_compat>(thd, this); }
bool val_bool() override;
};
@ -244,7 +244,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4_mapped") };
return name;
}
Item *do_get_copy(THD *thd) const override
Item *shallow_copy(THD *thd) const override
{ return get_item_copy<Item_func_is_ipv4_mapped>(thd, this); }
bool val_bool() override;
};

View file

@ -45,7 +45,7 @@ public:
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_NON_DETERMINISTIC);
}
Item *do_get_copy(THD *thd) const override
Item *shallow_copy(THD *thd) const override
{ return get_item_copy<Item_func_sys_guid>(thd, this); }
};
@ -60,7 +60,7 @@ public:
return name;
}
bool val_native(THD *thd, Native *to) override;
Item *do_get_copy(THD *thd) const override
Item *shallow_copy(THD *thd) const override
{ return get_item_copy<Item_func_uuid>(thd, this); }
};