Commit 5b6a4f25 authored by Jan Lindström's avatar Jan Lindström

Fixed issue on wsrep_kill_victim mutexing order error. Furthermore, fixed merge

errors found on mysql-test suite testing.
parent 86d47038
......@@ -3476,6 +3476,11 @@ innobase_commit_low(
/*================*/
trx_t* trx) /*!< in: transaction handle */
{
if (trx_is_started(trx)) {
trx_commit_for_mysql(trx);
}
#ifdef WITH_WSREP
THD* thd = (THD*)trx->mysql_thd;
const char* tmp = 0;
......@@ -3493,10 +3498,7 @@ innobase_commit_low(
#endif /* WSREP_PROC_INFO */
}
#endif /* WITH_WSREP */
if (trx_is_started(trx)) {
trx_commit_for_mysql(trx);
}
#ifdef WITH_WSREP
if (wsrep_on((void*)thd)) { thd_proc_info(thd, tmp); }
#endif /* WITH_WSREP */
......
......@@ -1587,8 +1587,8 @@ wsrep_kill_victim(const trx_t * const trx, const lock_t *lock) {
ut_ad(lock_mutex_own());
ut_ad(trx_mutex_own(lock->trx));
int bf_this = wsrep_thd_is_brute_force(trx->mysql_thd);
int bf_other =
wsrep_thd_is_brute_force(lock->trx->mysql_thd);
int bf_other = wsrep_thd_is_brute_force(lock->trx->mysql_thd);
if ((bf_this && !bf_other) ||
(bf_this && bf_other && wsrep_trx_order_before(
trx->mysql_thd, lock->trx->mysql_thd))) {
......@@ -4658,7 +4658,9 @@ lock_table_other_has_incompatible(
#ifdef WITH_WSREP
if (wsrep_debug)
fprintf(stderr, "WSREP: table lock abort");
trx_mutex_enter(lock->trx);
wsrep_kill_victim((trx_t *)trx, (lock_t *)lock);
trx_mutex_exit(lock->trx);
#endif
return(lock);
......
......@@ -1277,9 +1277,6 @@ row_ins_foreign_check_on_constraint(
cascade->state = UPD_NODE_UPDATE_CLUSTERED;
err = row_update_cascade_for_mysql(thr, cascade,
foreign->foreign_table);
#ifdef WITH_WSREP
err = wsrep_append_foreign_key(
thr_get_trx(thr),
......@@ -1292,6 +1289,9 @@ row_ins_foreign_check_on_constraint(
"WSREP: foreign key append failed: %d\n", err);
} else
#endif /* WITH_WSREP */
err = row_update_cascade_for_mysql(thr, cascade,
foreign->foreign_table);
if (foreign->foreign_table->n_foreign_key_checks_running == 0) {
fprintf(stderr,
"InnoDB: error: table %s has the counter 0"
......
......@@ -5182,6 +5182,7 @@ row_check_index_for_mysql(
dtuple_get_nth_field(prev_entry, i))) {
contains_null = TRUE;
break;
}
}
......
......@@ -1592,9 +1592,12 @@ lock_rec_other_has_expl_req(
#ifdef WITH_WSREP
static void
wsrep_kill_victim(trx_t *trx, lock_t *lock) {
ut_ad(lock_mutex_own());
ut_ad(trx_mutex_own(lock->trx));
int bf_this = wsrep_thd_is_brute_force(trx->mysql_thd);
int bf_other =
wsrep_thd_is_brute_force(lock->trx->mysql_thd);
int bf_other = wsrep_thd_is_brute_force(lock->trx->mysql_thd);
if ((bf_this && !bf_other) ||
(bf_this && bf_other && wsrep_trx_order_before(
trx->mysql_thd, lock->trx->mysql_thd))) {
......
......@@ -1277,19 +1277,21 @@ row_ins_foreign_check_on_constraint(
cascade->state = UPD_NODE_UPDATE_CLUSTERED;
err = row_update_cascade_for_mysql(thr, cascade,
foreign->foreign_table);
#ifdef WITH_WSREP
if (err == DB_SUCCESS) {
err = (dberr_t)wsrep_append_foreign_key(
thr_get_trx(thr),
foreign,
clust_rec,
clust_index,
FALSE, FALSE);
}
if (err != DB_SUCCESS) {
fprintf(stderr,
"WSREP: foreign key append failed: %d\n", err);
} else
#endif /* WITH_WSREP */
err = row_update_cascade_for_mysql(thr, cascade,
foreign->foreign_table);
if (foreign->foreign_table->n_foreign_key_checks_running == 0) {
fprintf(stderr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment