From 0d3f926a1c21f3b760a18d5aa0e2587fe2136709 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Apr 2007 14:55:28 +0200 Subject: WL#2735: Refactor replication Factoring out pack_row() and unpack_row() into new files rpl_record.{cc,h}. libmysqld/Makefile.am: Adding file rpl_record.cc sql/CMakeLists.txt: Adding file rpl_record.cc sql/Makefile.am: Adding file rpl_record.cc and rpl_record.h sql/log_event.cc: Moving implementation of unpack_row() into "rpl_record.cc". Adding inclusion of header file "rpl_record.h". sql/log_event_old.cc: Signature of do_prepare_row() changed. sql/log_event_old.h: Adding copyright. sql/rpl_record_old.cc: Signature of do_prepare_row() changed. sql/rpl_record_old.h: Adding copyright. Signature of do_prepare_row() changed. sql/sql_class.cc: Moving implementation THD::pack_row() into "rpl_record.cc" and rewriting it to be a global function. Adding inclusion of header file "rpl_record.h". sql/sql_class.h: Removing pack_row() as THD member function. sql/rpl_record.cc: New BitKeeper file ``sql/rpl_record.cc'' sql/rpl_record.h: New BitKeeper file ``sql/rpl_record.h'' --- sql/log_event_old.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'sql/log_event_old.cc') diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 1172a3e0ad4..500feab0542 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -5,7 +5,8 @@ #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) int -Write_rows_log_event_old::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli, +Write_rows_log_event_old::do_prepare_row(THD *thd, + RELAY_LOG_INFO const *rli, TABLE *table, char const *row_start, char const **row_end) @@ -14,7 +15,8 @@ Write_rows_log_event_old::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli, DBUG_ASSERT(row_start && row_end); int error; - error= unpack_row_old(rli, table, m_width, table->record[0], + error= unpack_row_old(const_cast(rli), + table, m_width, table->record[0], row_start, &m_cols, row_end, &m_master_reclength, table->write_set, PRE_GA_WRITE_ROWS_EVENT); bitmap_copy(table->read_set, table->write_set); @@ -23,7 +25,8 @@ Write_rows_log_event_old::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli, int -Delete_rows_log_event_old::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli, +Delete_rows_log_event_old::do_prepare_row(THD *thd, + RELAY_LOG_INFO const *rli, TABLE *table, char const *row_start, char const **row_end) @@ -36,7 +39,8 @@ Delete_rows_log_event_old::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli, */ DBUG_ASSERT(table->s->fields >= m_width); - error= unpack_row_old(rli, table, m_width, table->record[0], + error= unpack_row_old(const_cast(rli), + table, m_width, table->record[0], row_start, &m_cols, row_end, &m_master_reclength, table->read_set, PRE_GA_DELETE_ROWS_EVENT); /* @@ -54,7 +58,8 @@ Delete_rows_log_event_old::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli, } -int Update_rows_log_event_old::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli, +int Update_rows_log_event_old::do_prepare_row(THD *thd, + RELAY_LOG_INFO const *rli, TABLE *table, char const *row_start, char const **row_end) @@ -68,12 +73,14 @@ int Update_rows_log_event_old::do_prepare_row(THD *thd, RELAY_LOG_INFO *rli, DBUG_ASSERT(table->s->fields >= m_width); /* record[0] is the before image for the update */ - error= unpack_row_old(rli, table, m_width, table->record[0], + error= unpack_row_old(const_cast(rli), + table, m_width, table->record[0], row_start, &m_cols, row_end, &m_master_reclength, table->read_set, PRE_GA_UPDATE_ROWS_EVENT); row_start = *row_end; /* m_after_image is the after image for the update */ - error= unpack_row_old(rli, table, m_width, m_after_image, + error= unpack_row_old(const_cast(rli), + table, m_width, m_after_image, row_start, &m_cols, row_end, &m_master_reclength, table->write_set, PRE_GA_UPDATE_ROWS_EVENT); -- cgit v1.2.1