Mats,
the patch is okay.
As we discussed on #rep the name like save_sets could be made more
clear. My suggestion is to call the class as push_sets.
I don't insist on doing that though.
regards,
/andrei
> Below is the list of changes that have just been committed into a local
> 6.0 repository of mats. When mats does a push these changes will
> be propagated to the main repository and, within 24 hours after the
> push, to the public repository.
> For information on how to access the public repository
> see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
>
> ChangeSet@stripped, 2007-12-19 09:27:29+01:00, mats@stripped +3 -0
> BUG#33055 (Replication fails for UPDATE when using falcon Storage engine):
>
> Supplementory patch to allow the injector interface to work with the
> new row-based implementation that honor the read- and write-sets of
> the tables being written.
>
> With this patch, NDB can also replicate correctly with the new code.
>
> mysql-test/suite/rpl_ndb/t/disabled.def@stripped, 2007-12-19 09:27:24+01:00,
> mats@stripped +3 -0
> Disabling some failing tests.
>
> sql/rpl_injector.cc@stripped, 2007-12-19 09:27:24+01:00,
> mats@stripped +11 -7
> Using new THD::binlog_*_row() interface that does not have
> a cols parameter. In order to do that, the cols parameter
> passed to the injectors functions are written to the read-
> and write-set of the table, and then restored afterwards.
>
> sql/rpl_injector.h@stripped, 2007-12-19 09:27:25+01:00,
> mats@stripped +21 -0
> Introducing helping class that will auto-restore read-
> and write-sets when destructed.
>
> diff -Nrup a/mysql-test/suite/rpl_ndb/t/disabled.def
> b/mysql-test/suite/rpl_ndb/t/disabled.def
> --- a/mysql-test/suite/rpl_ndb/t/disabled.def 2007-11-27 22:26:58 +01:00
> +++ b/mysql-test/suite/rpl_ndb/t/disabled.def 2007-12-19 09:27:24 +01:00
> @@ -26,3 +26,6 @@ rpl_ndb_mix_innodb : Bug #32720 20
> rpl_ndb_basic : Bug#29827 2007-07-16 ingo reports to error log
> rpl_ndb_blob : Bug#31284 rpl_ndb_blob fails on powermacg5: incorrect
> BLOB contents
> rpl_ndb_multi : Bug#30751 rpl_ndb_multi missing row in output
> +rpl_ndb_idempotent : BUG#33360 2007-12-19 mats rpl_ndb_idempotent fails due to
> null field for table on slave side
> +rpl_ndb_innodb2ndb : Bug #32648 Test failure between NDB Cluster and other
> engines
> +rpl_ndb_myisam2ndb : Bug #32648 Test failure between NDB Cluster and other
> engines
> diff -Nrup a/sql/rpl_injector.cc b/sql/rpl_injector.cc
> --- a/sql/rpl_injector.cc 2007-04-12 16:13:46 +02:00
> +++ b/sql/rpl_injector.cc 2007-12-19 09:27:24 +01:00
> @@ -89,14 +89,15 @@ int injector::transaction::write_row (se
> record_type record)
> {
> DBUG_ENTER("injector::transaction::write_row(...)");
> -
> if (int error= check_state(ROW_STATE))
> DBUG_RETURN(error);
>
> server_id_type save_id= m_thd->server_id;
> m_thd->set_server_id(sid);
> - m_thd->binlog_write_row(tbl.get_table(), tbl.is_transactional(),
> - cols, colcnt, record);
> +
> + table::save_sets saveset(tbl, cols, cols);
> +
> + m_thd->binlog_write_row(tbl.get_table(), tbl.is_transactional(), record);
> m_thd->set_server_id(save_id);
> DBUG_RETURN(0);
> }
> @@ -113,8 +114,8 @@ int injector::transaction::delete_row(se
>
> server_id_type save_id= m_thd->server_id;
> m_thd->set_server_id(sid);
> - m_thd->binlog_delete_row(tbl.get_table(), tbl.is_transactional(),
> - cols, colcnt, record);
> + table::save_sets saveset(tbl, cols, cols);
> + m_thd->binlog_delete_row(tbl.get_table(), tbl.is_transactional(), record);
> m_thd->set_server_id(save_id);
> DBUG_RETURN(0);
> }
> @@ -131,8 +132,11 @@ int injector::transaction::update_row(se
>
> server_id_type save_id= m_thd->server_id;
> m_thd->set_server_id(sid);
> - m_thd->binlog_update_row(tbl.get_table(), tbl.is_transactional(),
> - cols, colcnt, before, after);
> +
> + // The read- and write sets with autorestore
> + table::save_sets saveset(tbl, cols, cols);
> +
> + m_thd->binlog_update_row(tbl.get_table(), tbl.is_transactional(), before,
> after);
> m_thd->set_server_id(save_id);
> DBUG_RETURN(0);
> }
> diff -Nrup a/sql/rpl_injector.h b/sql/rpl_injector.h
> --- a/sql/rpl_injector.h 2007-05-10 11:59:28 +02:00
> +++ b/sql/rpl_injector.h 2007-12-19 09:27:25 +01:00
> @@ -117,6 +117,27 @@ public:
> class table
> {
> public:
> + class save_sets {
> + public:
> + save_sets(table const &tbl, MY_BITMAP const *new_rs, MY_BITMAP const
> *new_ws)
> + : m_table(tbl.get_table()),
> + save_read_set(m_table->read_set),
> + save_write_set(m_table->write_set)
> + {
> + m_table->column_bitmaps_set(const_cast<MY_BITMAP*>(new_rs),
> + const_cast<MY_BITMAP*>(new_ws));
> + }
> +
> + ~save_sets() {
> + m_table->column_bitmaps_set(save_read_set, save_write_set);
> + }
> +
> + private:
> + TABLE *m_table;
> + MY_BITMAP *save_read_set;
> + MY_BITMAP *save_write_set;
> + };
> +
> table(TABLE *table, bool is_transactional)
> : m_table(table), m_is_transactional(is_transactional)
> {
>
> --
> MySQL Code Commits Mailing List
> For list archives: http://lists.mysql.com/commits
> To unsubscribe: http://lists.mysql.com/commits?unsub=1
>