1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge branch '10.6' into 10.9

This commit is contained in:
Oleksandr Byelkin
2023-08-04 08:01:06 +02:00
858 changed files with 12277 additions and 6177 deletions

View File

@ -321,7 +321,7 @@ typedef struct st_copy_info {
class Key_part_spec :public Sql_alloc {
public:
LEX_CSTRING field_name;
Lex_ident field_name;
uint length;
bool generated, asc;
Key_part_spec(const LEX_CSTRING *name, uint len, bool gen= false)
@ -456,6 +456,7 @@ public:
bool generated;
bool invisible;
bool without_overlaps;
bool old;
Lex_ident period;
Key(enum Keytype type_par, const LEX_CSTRING *name_arg,
@ -463,7 +464,7 @@ public:
:DDL_options(ddl_options),
type(type_par), key_create_info(default_key_create_info),
name(*name_arg), option_list(NULL), generated(generated_arg),
invisible(false), without_overlaps(false)
invisible(false), without_overlaps(false), old(false)
{
key_create_info.algorithm= algorithm_arg;
}
@ -474,12 +475,12 @@ public:
:DDL_options(ddl_options),
type(type_par), key_create_info(*key_info_arg), columns(*cols),
name(*name_arg), option_list(create_opt), generated(generated_arg),
invisible(false), without_overlaps(false)
invisible(false), without_overlaps(false), old(false)
{}
Key(const Key &rhs, MEM_ROOT *mem_root);
virtual ~Key() = default;
/* Equality comparison of keys (ignoring name) */
friend bool foreign_key_prefix(Key *a, Key *b);
friend bool is_foreign_key_prefix(Key *a, Key *b);
/**
Used to make a clone of this object for ALTER/CREATE TABLE
@sa comment for Key_part_spec::clone
@ -512,9 +513,7 @@ public:
ref_db(*ref_db_arg), ref_table(*ref_table_arg), ref_columns(*ref_cols),
delete_opt(delete_opt_arg), update_opt(update_opt_arg),
match_opt(match_opt_arg)
{
// We don't check for duplicate FKs.
key_create_info.check_for_duplicate_indexes= false;
{
}
Foreign_key(const Foreign_key &rhs, MEM_ROOT *mem_root);
/**
@ -2344,14 +2343,14 @@ struct wait_for_commit
bool commit_started;
void register_wait_for_prior_commit(wait_for_commit *waitee);
int wait_for_prior_commit(THD *thd)
int wait_for_prior_commit(THD *thd, bool allow_kill=true)
{
/*
Quick inline check, to avoid function call and locking in the common case
where no wakeup is registered, or a registered wait was already signalled.
*/
if (waitee.load(std::memory_order_acquire))
return wait_for_prior_commit2(thd);
return wait_for_prior_commit2(thd, allow_kill);
else
{
if (wakeup_error)
@ -2405,7 +2404,7 @@ struct wait_for_commit
void wakeup(int wakeup_error);
int wait_for_prior_commit2(THD *thd);
int wait_for_prior_commit2(THD *thd, bool allow_kill);
void wakeup_subsequent_commits2(int wakeup_error);
void unregister_wait_for_prior_commit2();
@ -3060,6 +3059,16 @@ public:
return m_binlog_filter_state;
}
/**
Checks if a user connection is read-only
*/
inline bool is_read_only_ctx()
{
return opt_readonly &&
!(security_ctx->master_access & PRIV_IGNORE_READ_ONLY) &&
!slave_thread;
}
private:
/**
Indicate if the current statement should be discarded
@ -4189,6 +4198,10 @@ public:
{
return strmake_lex_cstring(from.str, from.length);
}
LEX_CSTRING strmake_lex_cstring_trim_whitespace(const LEX_CSTRING &from)
{
return strmake_lex_cstring(Lex_cstring(from).trim_whitespace(charset()));
}
LEX_STRING *make_lex_string(LEX_STRING *lex_str, const char* str, size_t length)
{
@ -5143,10 +5156,10 @@ public:
}
wait_for_commit *wait_for_commit_ptr;
int wait_for_prior_commit()
int wait_for_prior_commit(bool allow_kill=true)
{
if (wait_for_commit_ptr)
return wait_for_commit_ptr->wait_for_prior_commit(this);
return wait_for_commit_ptr->wait_for_prior_commit(this, allow_kill);
return 0;
}
void wakeup_subsequent_commits(int wakeup_error)