summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <rafal@quant.(none)>2007-08-28 10:14:45 +0200
committerunknown <rafal@quant.(none)>2007-08-28 10:14:45 +0200
commit8b3d52630fc5c95495dec60bdd0da6be8d475714 (patch)
treefe4d8d7d7cae96ea00426b1d539a9508cd839570 /sql
parentcd7d837be6685f8afc362ba5e90d9e724745370e (diff)
downloadmariadb-git-8b3d52630fc5c95495dec60bdd0da6be8d475714.tar.gz
BUG#21842: Exclude Rows_log_event members used in event application if
not compiled as a replication server - a fix from rpl clone now applied to 5.1.22 tree. sql/log_event.cc: Exclude Rows_log_event members used in event application if not compiled as a replication server. sql/log_event.h: Don't initialize Rows_log_event members used in event application if not compiled as a replication server.
Diffstat (limited to 'sql')
-rw-r--r--sql/log_event.cc25
-rw-r--r--sql/log_event.h10
2 files changed, 20 insertions, 15 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index cfac7df21a8..deaa9ef6b30 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -5653,9 +5653,10 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid,
m_table(tbl_arg),
m_table_id(tid),
m_width(tbl_arg ? tbl_arg->s->fields : 1),
- m_rows_buf(0), m_rows_cur(0), m_rows_end(0),
- m_curr_row(NULL), m_curr_row_end(NULL),
- m_flags(0), m_key(NULL)
+ m_rows_buf(0), m_rows_cur(0), m_rows_end(0), m_flags(0)
+#ifdef HAVE_REPLICATION
+ ,m_key(NULL), m_curr_row(NULL), m_curr_row_end(NULL)
+#endif
{
/*
We allow a special form of dummy event when the table, and cols
@@ -5697,10 +5698,13 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
*description_event)
: Log_event(buf, description_event),
m_row_count(0),
+#ifndef MYSQL_CLIENT
m_table(NULL),
- m_rows_buf(0), m_rows_cur(0), m_rows_end(0),
- m_curr_row(NULL), m_curr_row_end(NULL),
- m_key(NULL)
+#endif
+ m_table_id(0), m_rows_buf(0), m_rows_cur(0), m_rows_end(0)
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+ ,m_key(NULL), m_curr_row(NULL), m_curr_row_end(NULL)
+#endif
{
DBUG_ENTER("Rows_log_event::Rows_log_event(const char*,...)");
uint8 const common_header_len= description_event->common_header_len;
@@ -5789,7 +5793,9 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
m_rows_buf= (uchar*) my_malloc(data_size, MYF(MY_WME));
if (likely((bool)m_rows_buf))
{
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
m_curr_row= m_rows_buf;
+#endif
m_rows_end= m_rows_buf + data_size;
m_rows_cur= m_rows_end;
memcpy(m_rows_buf, ptr_rows_data, data_size);
@@ -6187,8 +6193,8 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
} // if (table)
/*
- We need to delay this clear until the table def stored in m_table_def is no
- longer needed. It is used in unpack_current_row().
+ We need to delay this clear until here bacause unpack_current_row() uses
+ master-side table definitions stored in rli.
*/
if (rli->tables_to_lock && get_flags(STMT_END_F))
const_cast<RELAY_LOG_INFO*>(rli)->clear_tables_to_lock();
@@ -7825,8 +7831,7 @@ Delete_rows_log_event::do_before_row_operations(const Slave_reporting_capability
m_table->s->primary_key < MAX_KEY)
{
/*
- We don't need to allocate any memory for m_after_image and
- m_key since they are not used.
+ We don't need to allocate any memory for m_key since it is not used.
*/
return 0;
}
diff --git a/sql/log_event.h b/sql/log_event.h
index 064d13b3e62..5450048bee2 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -2294,15 +2294,15 @@ protected:
uchar *m_rows_cur; /* One-after the end of the data */
uchar *m_rows_end; /* One-after the end of the allocated space */
- const uchar *m_curr_row; /* Start of the row being processed */
- const uchar *m_curr_row_end; /* One-after the end of the current row */
-
- flag_set m_flags; /* Flags for row-level events */
- uchar *m_key; /* Buffer to keep key value during searches */
+ flag_set m_flags; /* Flags for row-level events */
/* helper functions */
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+ const uchar *m_curr_row; /* Start of the row being processed */
+ const uchar *m_curr_row_end; /* One-after the end of the current row */
+ uchar *m_key; /* Buffer to keep key value during searches */
+
int find_row(const RELAY_LOG_INFO *const);
int write_row(const RELAY_LOG_INFO *const, const bool);