diff options
Diffstat (limited to '')
-rw-r--r-- | sql/sql_load.cc | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc index be3063e5..7a82e0ce 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -107,23 +107,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); @@ -348,6 +366,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 @@ -358,9 +377,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 @@ -425,6 +441,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 |