summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorBjorn Munch <Bjorn.Munch@sun.com>2009-09-18 16:44:11 +0200
committerBjorn Munch <Bjorn.Munch@sun.com>2009-09-18 16:44:11 +0200
commitf89b36fcbfff959d5f396702cc96d64f66cd6522 (patch)
tree9bc9b5f2b9ed75a2724413e7f1a4e3dd3d1760dc /sql/log_event.cc
parentc18e4b42b32e89307f5c903566b6ee43da12466f (diff)
parentd0408492669d37167708ac6e2642327d2deb5e5f (diff)
downloadmariadb-git-f89b36fcbfff959d5f396702cc96d64f66cd6522.tar.gz
new merge from trunk
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 375f9cf1859..08fe3aba8ed 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -3202,6 +3202,15 @@ Default database: '%s'. Query: '%s'",
DBUG_PRINT("info",("error ignored"));
clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
thd->killed= THD::NOT_KILLED;
+ /*
+ When an error is expected and matches the actual error the
+ slave does not report any error and by consequence changes
+ on transactional tables are not rolled back in the function
+ close_thread_tables(). For that reason, we explicitly roll
+ them back here.
+ */
+ if (expected_error && expected_error == actual_error)
+ ha_autocommit_or_rollback(thd, TRUE);
}
/*
If we expected a non-zero error code and get nothing and, it is a concurrency
@@ -8303,6 +8312,16 @@ Write_rows_log_event::do_before_row_operations(const Slave_reporting_capability
/* Honor next number column if present */
m_table->next_number_field= m_table->found_next_number_field;
+ /*
+ * Fixed Bug#45999, In RBR, Store engine of Slave auto-generates new
+ * sequence numbers for auto_increment fields if the values of them are 0.
+ * If generateing a sequence number is decided by the values of
+ * table->auto_increment_field_not_null and SQL_MODE(if includes
+ * MODE_NO_AUTO_VALUE_ON_ZERO) in update_auto_increment function.
+ * SQL_MODE of slave sql thread is always consistency with master's.
+ * In RBR, auto_increment fields never are NULL.
+ */
+ m_table->auto_increment_field_not_null= TRUE;
return error;
}
@@ -8312,6 +8331,7 @@ Write_rows_log_event::do_after_row_operations(const Slave_reporting_capability *
{
int local_error= 0;
m_table->next_number_field=0;
+ m_table->auto_increment_field_not_null= FALSE;
if (bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1 ||
m_table->s->db_type()->db_type == DB_TYPE_NDBCLUSTER)
{