mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '11.2' into 11.4
This commit is contained in:
109
sql/sql_class.h
109
sql/sql_class.h
@@ -1,5 +1,4 @@
|
||||
/*
|
||||
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2022, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -1746,6 +1745,8 @@ public:
|
||||
*/
|
||||
bool check_access(const privilege_t want_access, bool match_any = false);
|
||||
bool is_priv_user(const char *user, const char *host);
|
||||
bool is_user_defined() const
|
||||
{ return user && user != delayed_user && user != slave_user; };
|
||||
};
|
||||
|
||||
|
||||
@@ -2639,6 +2640,11 @@ public:
|
||||
swap_variables(sp_cache*, sp_package_body_cache, rhs.sp_package_body_cache);
|
||||
}
|
||||
void sp_caches_clear();
|
||||
/**
|
||||
Clear content of sp related caches.
|
||||
Don't delete cache objects itself.
|
||||
*/
|
||||
void sp_caches_empty();
|
||||
};
|
||||
|
||||
|
||||
@@ -3131,6 +3137,12 @@ public:
|
||||
|
||||
bool save_prep_leaf_list;
|
||||
|
||||
/**
|
||||
The data member reset_sp_cache is to signal that content of sp_cache
|
||||
must be reset (all items be removed from it).
|
||||
*/
|
||||
bool reset_sp_cache;
|
||||
|
||||
/* container for handler's private per-connection data */
|
||||
Ha_data ha_data[MAX_HA];
|
||||
|
||||
@@ -3191,9 +3203,14 @@ public:
|
||||
|
||||
bool binlog_need_stmt_format(bool is_transactional) const
|
||||
{
|
||||
return log_current_statement() &&
|
||||
!binlog_get_pending_rows_event(binlog_get_cache_mngr(),
|
||||
use_trans_cache(this, is_transactional));
|
||||
if (!log_current_statement())
|
||||
return false;
|
||||
auto *cache_mngr= binlog_get_cache_mngr();
|
||||
if (!cache_mngr)
|
||||
return true;
|
||||
return !binlog_get_pending_rows_event(cache_mngr,
|
||||
use_trans_cache(this,
|
||||
is_transactional));
|
||||
}
|
||||
|
||||
bool binlog_for_noop_dml(bool transactional_table);
|
||||
@@ -3642,12 +3659,12 @@ public:
|
||||
sent_row_count_for_statement+= count;
|
||||
MYSQL_SET_STATEMENT_ROWS_SENT(m_statement_psi, m_sent_row_count);
|
||||
}
|
||||
inline void inc_examined_row_count_fast()
|
||||
inline void inc_examined_row_count_fast(ha_rows count= 1)
|
||||
{
|
||||
m_examined_row_count++;
|
||||
examined_row_count_for_statement++;
|
||||
m_examined_row_count+= count;
|
||||
examined_row_count_for_statement+= count;
|
||||
}
|
||||
inline void inc_examined_row_count()
|
||||
inline void inc_examined_row_count(ha_rows count= 1)
|
||||
{
|
||||
inc_examined_row_count_fast();
|
||||
MYSQL_SET_STATEMENT_ROWS_EXAMINED(m_statement_psi, m_examined_row_count);
|
||||
@@ -4936,24 +4953,24 @@ public:
|
||||
*/
|
||||
bool copy_db_to(LEX_CSTRING *to)
|
||||
{
|
||||
if (db.str == NULL)
|
||||
if (db.str)
|
||||
{
|
||||
/*
|
||||
No default database is set. In this case if it's guaranteed that
|
||||
no CTE can be used in the statement then we can throw an error right
|
||||
now at the parser stage. Otherwise the decision about throwing such
|
||||
a message must be postponed until a post-parser stage when we are able
|
||||
to resolve all CTE names as we don't need this message to be thrown
|
||||
for any CTE references.
|
||||
*/
|
||||
if (!lex->with_cte_resolution)
|
||||
my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
|
||||
return TRUE;
|
||||
to->str= strmake(db.str, db.length);
|
||||
to->length= db.length;
|
||||
return to->str == NULL; /* True on error */
|
||||
}
|
||||
|
||||
to->str= strmake(db.str, db.length);
|
||||
to->length= db.length;
|
||||
return to->str == NULL; /* True on error */
|
||||
/*
|
||||
No default database is set. In this case if it's guaranteed that
|
||||
no CTE can be used in the statement then we can throw an error right
|
||||
now at the parser stage. Otherwise the decision about throwing such
|
||||
a message must be postponed until a post-parser stage when we are able
|
||||
to resolve all CTE names as we don't need this message to be thrown
|
||||
for any CTE references.
|
||||
*/
|
||||
if (!lex->with_cte_resolution)
|
||||
my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
|
||||
return TRUE;
|
||||
}
|
||||
/* Get db name or "". Use for printing current db */
|
||||
const char *get_db()
|
||||
@@ -5294,11 +5311,29 @@ public:
|
||||
{
|
||||
if (global_system_variables.log_warnings > threshold)
|
||||
{
|
||||
char real_ip_str[64];
|
||||
real_ip_str[0]= 0;
|
||||
|
||||
/* For proxied connections, add the real IP to the warning message */
|
||||
if (net.using_proxy_protocol && net.vio)
|
||||
{
|
||||
if(net.vio->localhost)
|
||||
snprintf(real_ip_str, sizeof(real_ip_str), " real ip: 'localhost'");
|
||||
else
|
||||
{
|
||||
char buf[INET6_ADDRSTRLEN];
|
||||
if (!vio_getnameinfo((sockaddr *)&(net.vio->remote), buf,
|
||||
sizeof(buf),NULL, 0, NI_NUMERICHOST))
|
||||
{
|
||||
snprintf(real_ip_str, sizeof(real_ip_str), " real ip: '%s'",buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
Security_context *sctx= &main_security_ctx;
|
||||
sql_print_warning(ER_THD(this, ER_NEW_ABORTING_CONNECTION),
|
||||
thread_id, (db.str ? db.str : "unconnected"),
|
||||
sctx->user ? sctx->user : "unauthenticated",
|
||||
sctx->host_or_ip, reason);
|
||||
sctx->host_or_ip, real_ip_str, reason);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5396,8 +5431,18 @@ public:
|
||||
Flag, mutex and condition for a thread to wait for a signal from another
|
||||
thread.
|
||||
|
||||
Currently used to wait for group commit to complete, can also be used for
|
||||
other purposes.
|
||||
Currently used to wait for group commit to complete, and COND_wakeup_ready
|
||||
is used for threads to wait on semi-sync ACKs (though is protected by
|
||||
Repl_semi_sync_master::LOCK_binlog). Note the following relationships
|
||||
between these two use-cases when using
|
||||
rpl_semi_sync_master_wait_point=AFTER_SYNC during group commit:
|
||||
1) Non-leader threads use COND_wakeup_ready to wait for the leader thread
|
||||
to complete binlog commit.
|
||||
2) The leader thread uses COND_wakeup_ready to await ACKs from the
|
||||
replica before signalling the non-leader threads to wake up.
|
||||
|
||||
With wait_point=AFTER_COMMIT, there is no overlap as binlogging has
|
||||
finished, so COND_wakeup_ready is safe to re-use.
|
||||
*/
|
||||
bool wakeup_ready;
|
||||
mysql_mutex_t LOCK_wakeup_ready;
|
||||
@@ -5527,14 +5572,6 @@ public:
|
||||
|
||||
bool check_slave_ignored_db_with_error(const Lex_ident_db &db) const;
|
||||
|
||||
/*
|
||||
Indicates if this thread is suspended due to awaiting an ACK from a
|
||||
replica. True if suspended, false otherwise.
|
||||
|
||||
Note that this variable is protected by Repl_semi_sync_master::LOCK_binlog
|
||||
*/
|
||||
bool is_awaiting_semisync_ack;
|
||||
|
||||
inline ulong wsrep_binlog_format(ulong binlog_format) const
|
||||
{
|
||||
#ifdef WITH_WSREP
|
||||
@@ -8354,6 +8391,10 @@ extern THD_list server_threads;
|
||||
|
||||
void setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps,
|
||||
uint field_count);
|
||||
C_MODE_START
|
||||
void mariadb_sleep_for_space(unsigned int seconds);
|
||||
C_MODE_END
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
extern void wsrep_to_isolation_end(THD*);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user