1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merging revision from codership-mysql/5.5 (r3928..3968) and

codership-mysql/5.6 (r4021..4065).
- Also contains fixes for some build failures.
This commit is contained in:
Nirbhay Choubey
2014-03-27 16:26:00 -04:00
57 changed files with 2161 additions and 722 deletions

View File

@@ -1148,10 +1148,27 @@ int ha_prepare(THD *thd)
{
if ((err= ht->prepare(ht, thd, all)))
{
#ifdef WITH_WSREP
if (WSREP(thd) && ht->db_type== DB_TYPE_WSREP)
{
error= 1;
/* avoid sending error, if we need to replay */
if (thd->wsrep_conflict_state!= MUST_REPLAY)
{
my_error(ER_LOCK_DEADLOCK, MYF(0), err);
}
}
else
{
/* not wsrep hton, bail to native mysql behavior */
#endif
my_error(ER_ERROR_DURING_COMMIT, MYF(0), err);
ha_rollback_trans(thd, all);
error=1;
break;
#ifdef WITH_WSREP
}
#endif
}
}
else
@@ -1407,16 +1424,25 @@ int ha_commit_trans(THD *thd, bool all)
if (WSREP(thd) && ht->db_type== DB_TYPE_WSREP)
{
error= 1;
/* avoid sending error, if we need to replay */
if (thd->wsrep_conflict_state!= MUST_REPLAY)
switch (err)
{
my_error(ER_LOCK_DEADLOCK, MYF(0), err);
case WSREP_TRX_SIZE_EXCEEDED:
/* give user size exeeded erro from wsrep_api.h */
my_error(ER_ERROR_DURING_COMMIT, MYF(0), WSREP_SIZE_EXCEEDED);
break;
case WSREP_TRX_CERT_FAIL:
case WSREP_TRX_ERROR:
/* avoid sending error, if we need to replay */
if (thd->wsrep_conflict_state!= MUST_REPLAY)
{
my_error(ER_LOCK_DEADLOCK, MYF(0), err);
}
}
}
else
/* not wsrep hton, bail to native mysql behavior */
else
/* not wsrep hton, bail to native mysql behavior */
#endif /* WITH_WSREP */
my_error(ER_ERROR_DURING_COMMIT, MYF(0), err);
my_error(ER_ERROR_DURING_COMMIT, MYF(0), err);
#ifdef WITH_WSREP
}
#endif /* WITH_WSREP */
@@ -5699,7 +5725,9 @@ static bool check_table_binlog_row_based(THD *thd, TABLE *table)
table->s->cached_row_logging_check &&
(thd->variables.option_bits & OPTION_BIN_LOG) &&
#ifdef WITH_WSREP
((WSREP(thd) && wsrep_emulate_bin_log) || mysql_bin_log.is_open()));
/* applier and replayer should not binlog */
((WSREP_EMULATE_BINLOG(thd) && (thd->wsrep_exec_mode != REPL_RECV)) ||
mysql_bin_log.is_open()));
#else
mysql_bin_log.is_open());
#endif
@@ -5802,6 +5830,17 @@ static int binlog_log_row(TABLE* table,
bool error= 0;
THD *const thd= table->in_use;
#ifdef WITH_WSREP
/* only InnoDB tables will be replicated through binlog emulation */
if (WSREP_EMULATE_BINLOG(thd) &&
table->file->ht->db_type != DB_TYPE_INNODB &&
!(table->file->ht->db_type == DB_TYPE_PARTITION_DB &&
(((ha_partition*)(table->file))->wsrep_db_type() == DB_TYPE_INNODB)))
// !strcmp(table->file->table_type(), "InnoDB"))
{
return 0;
}
#endif /* WITH_WSREP */
if (check_table_binlog_row_based(thd, table))
{
MY_BITMAP cols;