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

Merge branch '11.2' into 11.3

This commit is contained in:
Nikita Malyavin
2023-09-21 14:15:04 +04:00
885 changed files with 12429 additions and 6300 deletions

View File

@@ -324,7 +324,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)
@@ -459,6 +459,7 @@ public:
bool generated;
bool invisible;
bool without_overlaps;
bool old;
Lex_ident period;
Key(enum Keytype type_par, const LEX_CSTRING *name_arg,
@@ -466,7 +467,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;
}
@@ -477,12 +478,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
@@ -515,9 +516,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);
/**
@@ -1270,6 +1269,11 @@ public:
{
return strmake_lex_cstring(from.str, from.length);
}
LEX_CSTRING strmake_lex_cstring_trim_whitespace(const LEX_CSTRING &from,
CHARSET_INFO *cs)
{
return strmake_lex_cstring(Lex_cstring(from).trim_whitespace(cs));
}
/*
Methods to copy a string to memory root,
@@ -2477,14 +2481,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)
@@ -2538,7 +2542,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();
@@ -3191,6 +3195,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
@@ -4304,7 +4318,10 @@ public:
{
return alloc_root(&transaction->mem_root,size);
}
LEX_CSTRING strmake_lex_cstring_trim_whitespace(const LEX_CSTRING &from)
{
return Query_arena::strmake_lex_cstring_trim_whitespace(from, charset());
}
bool convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
const char *from, size_t from_length,
CHARSET_INFO *from_cs) const;
@@ -5194,10 +5211,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)