diff options
author | unknown <tomas@whalegate.ndb.mysql.com> | 2007-08-21 14:41:50 +0200 |
---|---|---|
committer | unknown <tomas@whalegate.ndb.mysql.com> | 2007-08-21 14:41:50 +0200 |
commit | 7468714a4744b486581fbdbb58d303b42d9d707a (patch) | |
tree | 1276ab73b97bf69f0b61f7a8630b462547613588 /sql | |
parent | 47058476a15136e5bcb026cc5ec3d4e3feb1feed (diff) | |
parent | b0ac87dc443f4b7b704d49f906f7673562541352 (diff) | |
download | mariadb-git-7468714a4744b486581fbdbb58d303b42d9d707a.tar.gz |
manual merge
mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test:
Auto merged
mysql-test/suite/ndb/r/ndb_read_multi_range.result:
Auto merged
mysql-test/suite/ndb/t/ndb_read_multi_range.test:
Auto merged
mysql-test/suite/rpl/r/rpl_row_max_relay_size.result:
Auto merged
mysql-test/suite/rpl/t/rpl_row_create_table.test:
Auto merged
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
Auto merged
mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result:
Auto merged
sql/ha_ndbcluster_binlog.cc:
Auto merged
sql/rpl_rli.h:
Auto merged
BitKeeper/deleted/.del-rpl_extraMaster_Col.test:
Delete: mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_ndbcluster.cc | 14 | ||||
-rw-r--r-- | sql/ha_ndbcluster_binlog.cc | 13 |
2 files changed, 26 insertions, 1 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 3b68b3828d2..f6c41af5312 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2817,6 +2817,8 @@ int ha_ndbcluster::write_row(uchar *record) op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); else 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++; @@ -3107,6 +3109,8 @@ int ha_ndbcluster::update_row(const uchar *old_data, uchar *new_data) op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); else 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 @@ -3177,6 +3181,9 @@ int ha_ndbcluster::delete_row(const uchar *record) else 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 @@ -3215,6 +3222,8 @@ int ha_ndbcluster::delete_row(const uchar *record) op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); else if (thd->slave_thread) op->setAnyValue(thd->server_id); + else if (!(thd->options & OPTION_BIN_LOG)) + op->setAnyValue(NDB_ANYVALUE_FOR_NOLOGGING); } } @@ -3960,6 +3969,8 @@ int ha_ndbcluster::info(uint flag) DBUG_PRINT("info", ("HA_STATUS_AUTO")); if (m_table && table->found_next_number_field) { + if ((my_errno= check_ndb_connection())) + DBUG_RETURN(my_errno); Ndb *ndb= get_ndb(); Ndb_tuple_id_range_guard g(m_share); @@ -8536,7 +8547,8 @@ ha_ndbcluster::read_multi_range_first(KEY_MULTI_RANGE **found_range_p, if (uses_blob_value() || (cur_index_type == UNIQUE_INDEX && has_null_in_unique_index(active_index) && - null_value_index_search(ranges, ranges+range_count, buffer))) + null_value_index_search(ranges, ranges+range_count, buffer)) + || m_delete_cannot_batch || m_update_cannot_batch) { m_disable_multi_read= TRUE; DBUG_RETURN(handler::read_multi_range_first(found_range_p, 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); |