summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-02-15 10:57:27 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-02-15 10:57:27 +0200
commit22770a9f9a7fb4c30dbdc204e5a8f829303b7373 (patch)
treeb2f7a307b9568244d2d3a916fe7650c9c841ffe1 /sql/sql_load.cc
parent7bd81c726b941e2cc3a0aa1d2eaa22419a4d2979 (diff)
parent27ea2963fce74f9f597f63eab0df63e395efcc50 (diff)
downloadmariadb-git-22770a9f9a7fb4c30dbdc204e5a8f829303b7373.tar.gz
Merge 10.2 into bb-10.2-ext
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 2f061b8377d..9a1e998a68b 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -104,23 +104,25 @@ the transaction after every 10,000 inserted rows. */
static bool wsrep_load_data_split(THD *thd, const TABLE *table,
const COPY_INFO &info)
{
- extern struct handlerton* innodb_hton_ptr;
-
DBUG_ENTER("wsrep_load_data_split");
- if (wsrep_load_data_splitting && wsrep_on(thd)
- && info.records && !(info.records % 10000)
- && thd->transaction.stmt.ha_list
- && thd->transaction.stmt.ha_list->ht() == binlog_hton
- && thd->transaction.stmt.ha_list->next()
- && thd->transaction.stmt.ha_list->next()->ht() == innodb_hton_ptr
- && !thd->transaction.stmt.ha_list->next()->next())
+ if (!wsrep_load_data_splitting || !wsrep_on(thd)
+ || !info.records || (info.records % 10000)
+ || !thd->transaction.stmt.ha_list
+ || thd->transaction.stmt.ha_list->ht() != binlog_hton
+ || !thd->transaction.stmt.ha_list->next()
+ || thd->transaction.stmt.ha_list->next()->next())
+ DBUG_RETURN(false);
+
+ if (handlerton* hton= thd->transaction.stmt.ha_list->next()->ht())
{
+ if (hton->db_type != DB_TYPE_INNODB)
+ DBUG_RETURN(false);
WSREP_DEBUG("intermediate transaction commit in LOAD DATA");
if (wsrep_run_wsrep_commit(thd, true) != WSREP_TRX_OK) DBUG_RETURN(true);
if (binlog_hton->commit(binlog_hton, thd, true)) DBUG_RETURN(true);
wsrep_post_commit(thd, true);
- innodb_hton_ptr->commit(innodb_hton_ptr, thd, true);
+ hton->commit(hton, thd, true);
table->file->extra(HA_EXTRA_FAKE_START_STMT);
}