summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc6
-rw-r--r--sql/sql_load.cc22
-rw-r--r--sql/wsrep_var.cc5
3 files changed, 20 insertions, 13 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 9148d9a65f2..79ccf272a1a 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
- Copyright (c) 2009, 2016, MariaDB
+ Copyright (c) 2009, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -797,7 +797,9 @@ static my_bool closecon_handlerton(THD *thd, plugin_ref plugin,
*/
void ha_close_connection(THD* thd)
{
- plugin_foreach(thd, closecon_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, 0);
+ plugin_foreach_with_mask(thd, closecon_handlerton,
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ PLUGIN_IS_DELETED|PLUGIN_IS_READY, 0);
}
static my_bool kill_handlerton(THD *thd, plugin_ref plugin,
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);
}
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index 34c5865548c..c4226ed030e 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -42,7 +42,10 @@ int wsrep_init_vars()
return 0;
}
-extern ulong innodb_lock_schedule_algorithm;
+/* This is intentionally declared as a weak global symbol, so that
+linking will succeed even if the server is built with a dynamically
+linked InnoDB. */
+ulong innodb_lock_schedule_algorithm __attribute__((weak));
bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type)
{