diff options
author | unknown <tomas@whalegate.ndb.mysql.com> | 2007-07-25 07:24:25 +0200 |
---|---|---|
committer | unknown <tomas@whalegate.ndb.mysql.com> | 2007-07-25 07:24:25 +0200 |
commit | 7e056fee171b2a4b6bfcbaaa73382761fa6c73f9 (patch) | |
tree | 8685c274038d87ddd1f75126872816c2020a7149 /sql/ha_ndbcluster.cc | |
parent | 253a8df24c600ed5607dc483a868a22a4f0c85f2 (diff) | |
download | mariadb-git-7e056fee171b2a4b6bfcbaaa73382761fa6c73f9.tar.gz |
BUG#30017 log-slave-updates incorrect behavior for cluster
- let the receiving injector thread decide what to do
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 3c64a1401cd..5c7ead196cc 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2812,10 +2812,16 @@ int ha_ndbcluster::write_row(byte *record) if (unlikely(m_slow_path)) { - if (!(thd->options & OPTION_BIN_LOG)) - op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); - else if (thd->slave_thread) + /* + ignore OPTION_BIN_LOG 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. + */ + if (thd->slave_thread) op->setAnyValue(thd->server_id); + else if (!(thd->options & OPTION_BIN_LOG)) + op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); } m_rows_changed++; @@ -3101,10 +3107,16 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) if (unlikely(m_slow_path)) { - if (!(thd->options & OPTION_BIN_LOG)) - op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); - else if (thd->slave_thread) + /* + ignore OPTION_BIN_LOG 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 + */ + if (thd->slave_thread) op->setAnyValue(thd->server_id); + else if (!(thd->options & OPTION_BIN_LOG)) + op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); } /* Execute update operation if we are not doing a scan for update @@ -3168,12 +3180,18 @@ int ha_ndbcluster::delete_row(const byte *record) if (unlikely(m_slow_path)) { - if (!(thd->options & OPTION_BIN_LOG)) - ((NdbOperation *)trans->getLastDefinedOperation())-> - setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); - else if (thd->slave_thread) + /* + ignore OPTION_BIN_LOG 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 + */ + if (thd->slave_thread) ((NdbOperation *)trans->getLastDefinedOperation())-> setAnyValue(thd->server_id); + else if (!(thd->options & OPTION_BIN_LOG)) + ((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 @@ -3207,10 +3225,16 @@ int ha_ndbcluster::delete_row(const byte *record) if (unlikely(m_slow_path)) { - if (!(thd->options & OPTION_BIN_LOG)) - op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); - else if (thd->slave_thread) + /* + ignore OPTION_BIN_LOG 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 + */ + if (thd->slave_thread) op->setAnyValue(thd->server_id); + else if (!(thd->options & OPTION_BIN_LOG)) + op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); } } |