summaryrefslogtreecommitdiff
path: root/storage/innobase/row/row0ins.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/row/row0ins.cc')
-rw-r--r--storage/innobase/row/row0ins.cc48
1 files changed, 8 insertions, 40 deletions
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 24fb6eb39ce..eca839fa7be 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -48,6 +48,7 @@ Created 4/20/1996 Heikki Tuuri
#ifdef WITH_WSREP
#include <wsrep.h>
#include <mysql/service_wsrep.h>
+#include "ha_prototypes.h"
#endif /* WITH_WSREP */
/*************************************************************************
@@ -2580,42 +2581,6 @@ but GCC 4.8.5 does not support pop_options. */
# pragma GCC optimize ("O0")
#endif
-#ifdef WITH_WSREP
-/** Start bulk insert operation for Galera by appending
-table-level exclusive key for bulk insert.
-@param trx transaction
-@param index index
-@retval false on success
-@retval true on failure */
-ATTRIBUTE_COLD static bool row_ins_wsrep_start_bulk(trx_t *trx, const dict_index_t &index)
-{
- char db_buf[NAME_LEN + 1];
- char tbl_buf[NAME_LEN + 1];
- ulint db_buf_len, tbl_buf_len;
-
- if (!index.table->parse_name(db_buf, tbl_buf, &db_buf_len, &tbl_buf_len))
- {
- WSREP_ERROR("Parse_name for bulk insert failed: %s",
- wsrep_thd_query(trx->mysql_thd));
- trx->error_state = DB_ROLLBACK;
- return true;
- }
-
- /* Append table-level exclusive key for bulk insert. */
- const int rcode = wsrep_thd_append_table_key(trx->mysql_thd, db_buf,
- tbl_buf, WSREP_SERVICE_KEY_EXCLUSIVE);
- if (rcode)
- {
- WSREP_ERROR("Appending table key for bulk insert failed: %s, %d",
- wsrep_thd_query(trx->mysql_thd), rcode);
- trx->error_state = DB_ROLLBACK;
- return true;
- }
-
- return false;
-}
-#endif
-
/***************************************************************//**
Tries to insert an entry into a clustered index, ignoring foreign key
constraints. If a record with the same unique key is found, the other
@@ -2780,10 +2745,13 @@ avoid_bulk:
#ifdef WITH_WSREP
if (trx->is_wsrep())
{
- if (!wsrep_thd_is_local_transaction(trx->mysql_thd))
- goto skip_bulk_insert;
- if (row_ins_wsrep_start_bulk(trx, *index))
- goto err_exit;
+ if (!wsrep_thd_is_local_transaction(trx->mysql_thd))
+ goto skip_bulk_insert;
+ if (wsrep_append_table_key(trx->mysql_thd, *index->table))
+ {
+ trx->error_state = DB_ROLLBACK;
+ goto err_exit;
+ }
}
#endif /* WITH_WSREP */