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

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2024-02-12 11:38:13 +02:00
87 changed files with 1677 additions and 477 deletions

View File

@ -105,23 +105,41 @@ public:
class Wsrep_load_data_split
{
public:
Wsrep_load_data_split(THD *thd)
Wsrep_load_data_split(THD *thd, TABLE *table)
: m_thd(thd)
, m_load_data_splitting(wsrep_load_data_splitting)
, m_load_data_splitting(false)
, m_fragment_unit(thd->wsrep_trx().streaming_context().fragment_unit())
, m_fragment_size(thd->wsrep_trx().streaming_context().fragment_size())
{
if (WSREP(m_thd) && m_load_data_splitting)
/*
We support load data splitting for InnoDB only as it will use
streaming replication (SR).
*/
if (WSREP(thd) && wsrep_load_data_splitting)
{
/* Override streaming settings with backward compatible values for
load data splitting */
m_thd->wsrep_cs().streaming_params(wsrep::streaming_context::row, 10000);
handlerton *ht= table->s->db_type();
// For partitioned tables find underlying hton
if (table->file->partition_ht())
ht= table->file->partition_ht();
if (ht->db_type != DB_TYPE_INNODB)
{
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_NOT_SUPPORTED_YET,
"wsrep_load_data_splitting for other than InnoDB tables");
}
else
{
/* Override streaming settings with backward compatible values for
load data splitting */
m_thd->wsrep_cs().streaming_params(wsrep::streaming_context::row, 10000);
m_load_data_splitting= true;
}
}
}
~Wsrep_load_data_split()
{
if (WSREP(m_thd) && m_load_data_splitting)
if (m_load_data_splitting)
{
/* Restore original settings */
m_thd->wsrep_cs().streaming_params(m_fragment_unit, m_fragment_size);
@ -346,6 +364,7 @@ int mysql_load(THD *thd, const sql_exchange *ex, TABLE_LIST *table_list,
bool is_concurrent;
#endif
const char *db= table_list->db.str; // This is never null
/*
If path for file is not defined, we will use the current database.
If this is not set, we will use the directory where the table to be
@ -356,9 +375,6 @@ int mysql_load(THD *thd, const sql_exchange *ex, TABLE_LIST *table_list,
bool transactional_table __attribute__((unused));
DBUG_ENTER("mysql_load");
#ifdef WITH_WSREP
Wsrep_load_data_split wsrep_load_data_split(thd);
#endif /* WITH_WSREP */
/*
Bug #34283
mysqlbinlog leaves tmpfile after termination if binlog contains
@ -423,6 +439,11 @@ int mysql_load(THD *thd, const sql_exchange *ex, TABLE_LIST *table_list,
{
DBUG_RETURN(TRUE);
}
#ifdef WITH_WSREP
Wsrep_load_data_split wsrep_load_data_split(thd, table_list->table);
#endif /* WITH_WSREP */
thd_proc_info(thd, "Executing");
/*
Let us emit an error if we are loading data to table which is used