1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge tag '11.1' into 11.2

MariaDB 11.1.3 release
This commit is contained in:
Oleksandr Byelkin
2023-11-14 18:28:37 +01:00
608 changed files with 15628 additions and 9174 deletions

View File

@ -3625,7 +3625,7 @@ public:
return TRUE;
}
if (apc_target.have_apc_requests())
apc_target.process_apc_requests();
apc_target.process_apc_requests(false);
return FALSE;
}
@ -4719,7 +4719,7 @@ public:
tests fail and so force them to propagate the
lex->binlog_row_based_if_mixed upwards to the caller.
*/
if ((wsrep_binlog_format() == BINLOG_FORMAT_MIXED) && (in_sub_stmt == 0))
if ((wsrep_binlog_format(variables.binlog_format) == BINLOG_FORMAT_MIXED) && (in_sub_stmt == 0))
set_current_stmt_binlog_format_row();
DBUG_VOID_RETURN;
@ -4775,7 +4775,7 @@ public:
show_system_thread(system_thread)));
if (in_sub_stmt == 0)
{
if (wsrep_binlog_format() == BINLOG_FORMAT_ROW)
if (wsrep_binlog_format(variables.binlog_format) == BINLOG_FORMAT_ROW)
set_current_stmt_binlog_format_row();
else if (!has_temporary_tables())
set_current_stmt_binlog_format_stmt();
@ -5131,8 +5131,7 @@ public:
/* Relesae transactional locks if there are no active transactions */
void release_transactional_locks()
{
if (!(server_status &
(SERVER_STATUS_IN_TRANS | SERVER_STATUS_IN_TRANS_READONLY)))
if (!in_active_multi_stmt_transaction())
mdl_context.release_transactional_locks(this);
}
int decide_logging_format(TABLE_LIST *tables);
@ -5405,9 +5404,18 @@ public:
*/
bool is_awaiting_semisync_ack;
inline ulong wsrep_binlog_format() const
inline ulong wsrep_binlog_format(ulong binlog_format) const
{
return WSREP_BINLOG_FORMAT(variables.binlog_format);
#ifdef WITH_WSREP
// During CTAS we force ROW format
if (wsrep_ctas)
return BINLOG_FORMAT_ROW;
else
return ((wsrep_forced_binlog_format != BINLOG_FORMAT_UNSPEC) ?
wsrep_forced_binlog_format : binlog_format);
#else
return (binlog_format);
#endif
}
#ifdef WITH_WSREP
@ -5472,7 +5480,8 @@ public:
/* true if BF abort is observed in do_command() right after reading
client's packet, and if the client has sent PS execute command. */
bool wsrep_delayed_BF_abort;
// true if this transaction is CREATE TABLE AS SELECT (CTAS)
bool wsrep_ctas;
/*
Transaction id:
* m_wsrep_next_trx_id is assigned on the first query after
@ -7732,6 +7741,50 @@ class Sql_mode_save
sql_mode_t old_mode; // SQL mode saved at construction time.
};
/*
Save the current sql_mode. Switch off sql_mode flags which can prevent
normal parsing of VIEWs, expressions in generated columns.
Restore the old sql_mode on destructor.
*/
class Sql_mode_save_for_frm_handling: public Sql_mode_save
{
public:
Sql_mode_save_for_frm_handling(THD *thd)
:Sql_mode_save(thd)
{
/*
- MODE_REAL_AS_FLOAT affect only CREATE TABLE parsing
+ MODE_PIPES_AS_CONCAT affect expression parsing
+ MODE_ANSI_QUOTES affect expression parsing
+ MODE_IGNORE_SPACE affect expression parsing
- MODE_IGNORE_BAD_TABLE_OPTIONS affect only CREATE/ALTER TABLE parsing
* MODE_ONLY_FULL_GROUP_BY affect execution
* MODE_NO_UNSIGNED_SUBTRACTION affect execution
- MODE_NO_DIR_IN_CREATE affect table creation only
- MODE_POSTGRESQL compounded from other modes
+ MODE_ORACLE affects Item creation (e.g for CONCAT)
- MODE_MSSQL compounded from other modes
- MODE_DB2 compounded from other modes
- MODE_MAXDB affect only CREATE TABLE parsing
- MODE_NO_KEY_OPTIONS affect only SHOW
- MODE_NO_TABLE_OPTIONS affect only SHOW
- MODE_NO_FIELD_OPTIONS affect only SHOW
- MODE_MYSQL323 affect only SHOW
- MODE_MYSQL40 affect only SHOW
- MODE_ANSI compounded from other modes
(+ transaction mode)
? MODE_NO_AUTO_VALUE_ON_ZERO affect UPDATEs
+ MODE_NO_BACKSLASH_ESCAPES affect expression parsing
+ MODE_EMPTY_STRING_IS_NULL affect expression parsing
*/
thd->variables.sql_mode&= ~(MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES |
MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES |
MODE_ORACLE | MODE_EMPTY_STRING_IS_NULL);
};
};
class Switch_to_definer_security_ctx
{
public:
@ -7806,11 +7859,13 @@ public:
class Use_relaxed_field_copy: public Sql_mode_save,
public Check_level_instant_set
public Check_level_instant_set,
public Abort_on_warning_instant_set
{
public:
Use_relaxed_field_copy(THD *thd) :
Sql_mode_save(thd), Check_level_instant_set(thd, CHECK_FIELD_IGNORE)
Sql_mode_save(thd), Check_level_instant_set(thd, CHECK_FIELD_IGNORE),
Abort_on_warning_instant_set(thd, 0)
{
thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE);
thd->variables.sql_mode|= MODE_INVALID_DATES;