summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <joerg@trift2.>2007-08-24 12:38:26 +0200
committerunknown <joerg@trift2.>2007-08-24 12:38:26 +0200
commitb824ff95c9dc07d7875f95fa3bd5bcb97a4d54fe (patch)
tree746a811d8708678b4cc04abbf43b617676f68e7b /sql
parentfa91482f61768bbc9009058674c2458e884bb499 (diff)
parent42bd0a4a6f805d274005ce7b83735057bc709963 (diff)
downloadmariadb-git-b824ff95c9dc07d7875f95fa3bd5bcb97a4d54fe.tar.gz
Merge trift2.:/MySQL/M51/target-5.1.22
into trift2.:/MySQL/M51/push-5.1 sql/ha_ndbcluster.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_ndbcluster.cc50
-rw-r--r--sql/ha_ndbcluster_binlog.cc13
2 files changed, 50 insertions, 13 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 68295509e78..5f36da4da8e 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -2812,11 +2812,17 @@ int ha_ndbcluster::write_row(uchar *record)
if (unlikely(m_slow_path))
{
+ /*
+ ignore TNTO_NO_LOGGING for slave thd. It is used to indicate
+ log-slave-updates option. This is instead handled in the
+ injector thread, by looking explicitly at the
+ opt_log_slave_updates flag.
+ */
Thd_ndb *thd_ndb= get_thd_ndb(thd);
- if (thd_ndb->trans_options & TNTO_NO_LOGGING)
- op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
- else if (thd->slave_thread)
+ if (thd->slave_thread)
op->setAnyValue(thd->server_id);
+ else if (thd_ndb->trans_options & TNTO_NO_LOGGING)
+ op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
}
m_rows_changed++;
@@ -3102,11 +3108,17 @@ int ha_ndbcluster::update_row(const uchar *old_data, uchar *new_data)
if (unlikely(m_slow_path))
{
+ /*
+ ignore TNTO_NO_LOGGING for slave thd. It is used to indicate
+ log-slave-updates option. This is instead handled in the
+ injector thread, by looking explicitly at the
+ opt_log_slave_updates flag.
+ */
Thd_ndb *thd_ndb= get_thd_ndb(thd);
- if (thd_ndb->trans_options & TNTO_NO_LOGGING)
- op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
- else if (thd->slave_thread)
+ if (thd->slave_thread)
op->setAnyValue(thd->server_id);
+ else if (thd_ndb->trans_options & TNTO_NO_LOGGING)
+ op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
}
/*
Execute update operation if we are not doing a scan for update
@@ -3170,13 +3182,19 @@ int ha_ndbcluster::delete_row(const uchar *record)
if (unlikely(m_slow_path))
{
+ /*
+ ignore TNTO_NO_LOGGING for slave thd. It is used to indicate
+ log-slave-updates option. This is instead handled in the
+ injector thread, by looking explicitly at the
+ opt_log_slave_updates flag.
+ */
Thd_ndb *thd_ndb= get_thd_ndb(thd);
- if (thd_ndb->trans_options & TNTO_NO_LOGGING)
- ((NdbOperation *)trans->getLastDefinedOperation())->
- setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
- else if (thd->slave_thread)
+ if (thd->slave_thread)
((NdbOperation *)trans->getLastDefinedOperation())->
setAnyValue(thd->server_id);
+ else if (thd_ndb->trans_options & TNTO_NO_LOGGING)
+ ((NdbOperation *)trans->getLastDefinedOperation())->
+ setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
}
if (!(m_primary_key_update || m_delete_cannot_batch))
// If deleting from cursor, NoCommit will be handled in next_result
@@ -3210,11 +3228,17 @@ int ha_ndbcluster::delete_row(const uchar *record)
if (unlikely(m_slow_path))
{
+ /*
+ ignore TNTO_NO_LOGGING for slave thd. It is used to indicate
+ log-slave-updates option. This is instead handled in the
+ injector thread, by looking explicitly at the
+ opt_log_slave_updates flag.
+ */
Thd_ndb *thd_ndb= get_thd_ndb(thd);
- if (thd_ndb->trans_options & TNTO_NO_LOGGING)
- op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
- else if (thd->slave_thread)
+ if (thd->slave_thread)
op->setAnyValue(thd->server_id);
+ else if (thd_ndb->trans_options & TNTO_NO_LOGGING)
+ op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING);
}
}
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index c91faac388f..468adba0aa0 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -114,6 +114,9 @@ NDB_SHARE *ndb_apply_status_share= 0;
NDB_SHARE *ndb_schema_share= 0;
pthread_mutex_t ndb_schema_share_mutex;
+extern my_bool opt_log_slave_updates;
+static my_bool g_ndb_log_slave_updates;
+
/* Schema object distribution handling */
HASH ndb_schema_objects;
typedef struct st_ndb_schema_object {
@@ -3296,6 +3299,14 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
originating_server_id);
return 0;
}
+ else if (!g_ndb_log_slave_updates)
+ {
+ /*
+ This event comes from a slave applier since it has an originating
+ server id set. Since option to log slave updates is not set, skip it.
+ */
+ return 0;
+ }
TABLE *table= share->table;
DBUG_ASSERT(trans.good());
@@ -3942,6 +3953,8 @@ restart:
! IS_NDB_BLOB_PREFIX(pOp->getEvent()->getTable()->getName()));
DBUG_ASSERT(gci <= ndb_latest_received_binlog_epoch);
+ /* initialize some variables for this epoch */
+ g_ndb_log_slave_updates= opt_log_slave_updates;
i_ndb->
setReportThreshEventGCISlip(ndb_report_thresh_binlog_epoch_slip);
i_ndb->setReportThreshEventFreeMem(ndb_report_thresh_binlog_mem_usage);