summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorsjaakola <seppo.jaakola@iki.fi>2017-04-27 19:51:18 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2017-07-20 13:50:31 +0300
commita4bc8db216b4dd61ca0b1cb5a8b7806437416dc7 (patch)
tree0de9b24917f49ed5a05fcccb6387c0f72ad9c9ac /storage
parenta481de30bb972f055cff088a84a211c1acd5be38 (diff)
downloadmariadb-git-a4bc8db216b4dd61ca0b1cb5a8b7806437416dc7.tar.gz
MW-322 - CTAS fix merged to 5.5-v25 branch
Signed-off-by: Jan Lindström <jan.lindstrom@mariadb.com>
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc62
1 files changed, 35 insertions, 27 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 5261a50fdd6..ad31598384c 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -6000,10 +6000,14 @@ report_error:
prebuilt->table->flags,
user_thd);
#ifdef WITH_WSREP
- if (!error_result &&
- wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
- wsrep_on(user_thd) &&
- !wsrep_consistency_check(user_thd))
+ if (!error_result
+ && wsrep_on(user_thd)
+ && wsrep_thd_exec_mode(user_thd) == LOCAL_STATE
+ && !wsrep_consistency_check(user_thd))
+ && (sql_command != SQLCOM_CREATE_TABLE)
+ && (sql_command != SQLCOM_LOAD ||
+ thd_binlog_format(user_thd) == BINLOG_FORMAT_ROW)) {
+
{
if (wsrep_append_keys(user_thd, false, record, NULL))
{
@@ -12788,8 +12792,10 @@ wsrep_innobase_kill_one_trx(
wsrep_thd_thread_id(thd),
victim_trx->id);
- WSREP_DEBUG("Aborting query: %s",
- (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void");
+ WSREP_DEBUG("Aborting query: %s conf %d trx: %lu",
+ (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void",
+ wsrep_thd_conflict_state(thd),
+ wsrep_thd_ws_handle(thd)->trx_id);
wsrep_thd_LOCK(thd);
@@ -12841,9 +12847,8 @@ wsrep_innobase_kill_one_trx(
} else {
rcode = wsrep->abort_pre_commit(
wsrep, bf_seqno,
- (wsrep_trx_id_t)victim_trx->id
+ (wsrep_trx_id_t)wsrep_thd_ws_handle(thd)->trx_id
);
-
switch (rcode) {
case WSREP_WARNING:
WSREP_DEBUG("cancel commit warning: %llu",
@@ -12973,14 +12978,16 @@ wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd,
my_bool signal)
{
DBUG_ENTER("wsrep_innobase_abort_thd");
- trx_t* victim_trx = thd_to_trx(victim_thd);
- trx_t* bf_trx = (bf_thd) ? thd_to_trx(bf_thd) : NULL;
+
+ trx_t* victim_trx = thd_to_trx(victim_thd);
+ trx_t* bf_trx = (bf_thd) ? thd_to_trx(bf_thd) : NULL;
- ut_ad(!mutex_own(&kernel_mutex));
+ WSREP_DEBUG("abort transaction: BF: %s victim: %s victim conf: %d",
+ wsrep_thd_query(bf_thd),
+ wsrep_thd_query(victim_thd),
+ wsrep_thd_conflict_state(victim_thd));
- WSREP_DEBUG("abort transaction: BF: %s victim: %s",
- wsrep_thd_query(bf_thd),
- wsrep_thd_query(victim_thd));
+ ut_ad(!mutex_own(&kernel_mutex));
if (victim_trx)
{
@@ -13001,24 +13008,24 @@ wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd,
static int innobase_wsrep_set_checkpoint(handlerton* hton, const XID* xid)
{
DBUG_ASSERT(hton == innodb_hton_ptr);
- if (wsrep_is_wsrep_xid(xid)) {
- mtr_t mtr;
- mtr_start(&mtr);
- trx_sysf_t* sys_header = trx_sysf_get(&mtr);
- trx_sys_update_wsrep_checkpoint(xid, sys_header, &mtr);
- mtr_commit(&mtr);
- innobase_flush_logs(hton);
- return 0;
- } else {
- return 1;
- }
+ if (wsrep_is_wsrep_xid(xid)) {
+ mtr_t mtr;
+ mtr_start(&mtr);
+ trx_sysf_t* sys_header = trx_sysf_get(&mtr);
+ trx_sys_update_wsrep_checkpoint(xid, sys_header, &mtr);
+ mtr_commit(&mtr);
+ innobase_flush_logs(hton);
+ return 0;
+ } else {
+ return 1;
+ }
}
static int innobase_wsrep_get_checkpoint(handlerton* hton, XID* xid)
{
DBUG_ASSERT(hton == innodb_hton_ptr);
- trx_sys_read_wsrep_checkpoint(xid);
- return 0;
+ trx_sys_read_wsrep_checkpoint(xid);
+ return 0;
}
static void
@@ -13030,6 +13037,7 @@ wsrep_fake_trx_id(
mutex_enter(&kernel_mutex);
trx_id_t trx_id = trx_sys_get_new_trx_id();
mutex_exit(&kernel_mutex);
+ WSREP_DEBUG("innodb fake trx id: %lu thd: %s", trx_id, wsrep_thd_query(thd));
(void *)wsrep_ws_handle_for_trx(wsrep_thd_ws_handle(thd), trx_id);
}