summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorunknown <mats@kindahl-laptop.dnsalias.net>2007-06-11 22:15:39 +0200
committerunknown <mats@kindahl-laptop.dnsalias.net>2007-06-11 22:15:39 +0200
commitabbf5941d950e3a857987785991b72f1040d0721 (patch)
treea5aeb5e654946367a567da821efa7b17263f59d2 /sql/log_event.cc
parent9fea6f4775c64b12b0cc65375f523c02b7b03457 (diff)
downloadmariadb-git-abbf5941d950e3a857987785991b72f1040d0721.tar.gz
BUG#24954 (Last_errno and Last_error not set after master_retry_count has
been reached): Post-merge patch to handle all the changes to the tree since the tree was cloned. mysql-test/extra/rpl_tests/rpl_log.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/extra/rpl_tests/rpl_max_relay_size.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/extra/rpl_tests/rpl_reset_slave.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/include/show_slave_status.inc: Column change. mysql-test/r/rpl_000015.result: Result file change. mysql-test/r/rpl_change_master.result: Result file change. mysql-test/r/rpl_empty_master_crash.result: Result file change. mysql-test/r/rpl_extraCol_innodb.result: Result file change. mysql-test/r/rpl_extraCol_myisam.result: Result file change. mysql-test/r/rpl_flushlog_loop.result: Result file change. mysql-test/r/rpl_incident.result: Result file change. mysql-test/r/rpl_known_bugs_detection.result: Result file change. mysql-test/r/rpl_loaddata.result: Result file change. mysql-test/r/rpl_loaddata_fatal.result: Result file change. mysql-test/r/rpl_log_pos.result: Result file change. mysql-test/r/rpl_ndb_basic.result: Result file change. mysql-test/r/rpl_ndb_circular.result: Result file change. mysql-test/r/rpl_ndb_extraCol.result: Result file change. mysql-test/r/rpl_ndb_idempotent.result: Result file change. mysql-test/r/rpl_ndb_log.result: Result file change. mysql-test/r/rpl_ndb_sync.result: Result file change. mysql-test/r/rpl_rbr_to_sbr.result: Result file change. mysql-test/r/rpl_redirect.result: Result file change. mysql-test/r/rpl_replicate_do.result: Result file change. mysql-test/r/rpl_rotate_logs.result: Result file change. mysql-test/r/rpl_row_inexist_tbl.result: Result file change. mysql-test/r/rpl_row_log.result: Result file change. mysql-test/r/rpl_row_log_innodb.result: Result file change. mysql-test/r/rpl_row_max_relay_size.result: Result file change. mysql-test/r/rpl_row_reset_slave.result: Result file change. mysql-test/r/rpl_row_tabledefs_2myisam.result: Result file change. mysql-test/r/rpl_row_tabledefs_3innodb.result: Result file change. mysql-test/r/rpl_row_until.result: Result file change. mysql-test/r/rpl_server_id1.result: Result file change. mysql-test/r/rpl_server_id2.result: Result file change. mysql-test/r/rpl_slave_skip.result: Result file change. mysql-test/r/rpl_ssl.result: Result file change. mysql-test/r/rpl_ssl1.result: Result file change. mysql-test/r/rpl_stm_log.result: Result file change. mysql-test/r/rpl_stm_max_relay_size.result: Result file change. mysql-test/r/rpl_stm_reset_slave.result: Result file change. mysql-test/r/rpl_stm_until.result: Result file change. mysql-test/t/rpl_000015.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_change_master.test: Column position change. Making result of SHOW SLAVE STATUS vertical. mysql-test/t/rpl_empty_master_crash.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_log_pos.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_ndb_basic.test: Column position change. mysql-test/t/rpl_ndb_idempotent.test: Column position change. mysql-test/t/rpl_ndb_sync.test: Column position change. Making result of SHOW SLAVE STATUS vertical. mysql-test/t/rpl_redirect.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_replicate_do.test: Column position change. Making result of SHOW SLAVE STATUS vertical. mysql-test/t/rpl_rotate_logs.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_row_inexist_tbl.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_row_until.test: Replacing SHOW SLAVE STATUS with include file. mysql-test/t/rpl_server_id1.test: Column position change. Making result of SHOW SLAVE STATUS vertical. mysql-test/t/rpl_server_id2.test: Column position change. Making result of SHOW SLAVE STATUS vertical. mysql-test/t/rpl_slave_status.test: Column position change. mysql-test/t/rpl_ssl.test: Column position change. mysql-test/t/rpl_ssl1.test: Column position change. mysql-test/t/rpl_stm_until.test: Replacing SHOW SLAVE STATUS with include file. sql/log_event.cc: Using member function last_error() instead of member variable. Replacing use of 'table' with 'm_table'. Suppressing warnings in debug printout. Setting thd->net.last_error on error return from unpack_row() to get a non-zero error message. The error codes for are being harmonized in another worklog. Replacing use of slave_print_msg() with RELAY_LOG_INFO::report(). sql/rpl_mi.h: Moving order of include files since they are dependent (!). sql/rpl_record.cc: Adding missing include file. Replacing use of slave_print_msg() with RELAY_LOG_INFO::report(). sql/rpl_record_old.cc: Adding missing include file. Replacing use of slave_print_msg() with RELAY_LOG_INFO::report(). sql/rpl_reporting.cc: Adding const modifier to member function. Using renamed member variable m_last_error. sql/rpl_reporting.h: Adding missing constant MAX_SLAVE_ERRMSG. Adding const modifier to Slave_reporting_capability::report(). Hiding and renaming member variable last_error and incorporating member function for access in order to make it mutable. sql/rpl_rli.h: Moving constant MAX_SLAVE_ERRMSG. sql/rpl_utility.cc: Adding missing include file rpl_rli.h. sql/slave.cc: Replacing use of member variable last_error with call to member function last_error(). Replacing use of slave_print_msg() with RELAY_LOG_INFO::report().
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc65
1 files changed, 41 insertions, 24 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index eae87b75724..ac5e5a86cb2 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -5279,10 +5279,10 @@ int Execute_load_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
don't want to overwrite it with the filename.
What we want instead is add the filename to the current error message.
*/
- char *tmp= my_strdup(rli->last_error.message, MYF(MY_WME));
+ char *tmp= my_strdup(rli->last_error().message, MYF(MY_WME));
if (tmp)
{
- rli->report(ERROR_LEVEL, rli->last_error.number,
+ rli->report(ERROR_LEVEL, rli->last_error().number,
"%s. Failed executing load from '%s'", tmp, fname);
my_free(tmp,MYF(0));
}
@@ -5757,7 +5757,7 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
size_t const data_size= event_len - (ptr_rows_data - (const uchar *) buf);
DBUG_PRINT("info",("m_table_id: %lu m_flags: %d m_width: %lu data_size: %lu",
- m_table_id, m_flags, m_width, data_size));
+ m_table_id, m_flags, m_width, (ulong) data_size));
m_rows_buf= (uchar*) my_malloc(data_size, MYF(MY_WME));
if (likely((bool)m_rows_buf))
@@ -6131,7 +6131,7 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
get_type_str(), table->s->db.str,
table->s->table_name.str);
- /*
+ /*
If one day we honour --skip-slave-errors in row-based replication, and
the error should be skipped, then we would clear mappings, rollback,
close tables, but the slave SQL thread would not stop and then may
@@ -6266,8 +6266,8 @@ Rows_log_event::do_update_pos(RELAY_LOG_INFO *rli)
rli->report(ERROR_LEVEL, error,
"Error in %s event: commit of row events failed, "
"table `%s`.`%s`",
- get_type_str(), table->s->db.str,
- table->s->table_name.str);
+ get_type_str(), m_table->s->db.str,
+ m_table->s->table_name.str);
}
else
{
@@ -6485,8 +6485,8 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
m_colcnt= net_field_length(&ptr_after_colcnt);
DBUG_PRINT("info",("m_dblen: %lu off: %ld m_tbllen: %lu off: %ld m_colcnt: %lu off: %ld",
- m_dblen, (long) (ptr_dblen-(const uchar*)vpart),
- m_tbllen, (long) (ptr_tbllen-(const uchar*)vpart),
+ (ulong) m_dblen, (long) (ptr_dblen-(const uchar*)vpart),
+ (ulong) m_tbllen, (long) (ptr_tbllen-(const uchar*)vpart),
m_colcnt, (long) (ptr_colcnt-(const uchar*)vpart)));
/* Allocate mem for all fields in one go. If fails, catched in is_valid() */
@@ -6874,11 +6874,14 @@ int Write_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
DBUG_ASSERT(table != NULL);
DBUG_ASSERT(row_start && row_end);
- int error;
- error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
- &m_master_reclength, table->write_set, WRITE_ROWS_EVENT);
+ if (int error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
+ &m_master_reclength, table->write_set, WRITE_ROWS_EVENT))
+ {
+ thd->net.last_errno= error;
+ return error;
+ }
bitmap_copy(table->read_set, table->write_set);
- return error;
+ return 0;
}
/*
@@ -7586,7 +7589,6 @@ int Delete_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
uchar const *const row_start,
uchar const **const row_end)
{
- int error;
DBUG_ASSERT(row_start && row_end);
/*
This assertion actually checks that there is at least as many
@@ -7594,8 +7596,13 @@ int Delete_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
*/
DBUG_ASSERT(table->s->fields >= m_width);
- error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
- &m_master_reclength, table->read_set, DELETE_ROWS_EVENT);
+ if (int error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
+ &m_master_reclength, table->read_set, DELETE_ROWS_EVENT))
+ {
+ thd->net.last_errno= error;
+ return error;
+ }
+
/*
If we will access rows using the random access method, m_key will
be set to NULL, so we do not need to make a key copy in that case.
@@ -7607,7 +7614,7 @@ int Delete_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
key_copy(m_key, table->record[0], key_info, 0);
}
- return error;
+ return 0;
}
int Delete_rows_log_event::do_exec_row(TABLE *table)
@@ -7776,13 +7783,23 @@ int Update_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
*/
/* record[0] is the before image for the update */
- error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
- &m_master_reclength, table->read_set, UPDATE_ROWS_EVENT);
+ if ((error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
+ &m_master_reclength, table->read_set, UPDATE_ROWS_EVENT)))
+ {
+ thd->net.last_errno= error;
+ return error;
+ }
+
store_record(table, record[1]);
uchar const *next_start = *row_end;
/* m_after_image is the after image for the update */
- error= unpack_row(rli, table, m_width, next_start, &m_cols_ai, row_end,
- &m_master_reclength, table->write_set, UPDATE_ROWS_EVENT);
+ if ((error= unpack_row(rli, table, m_width, next_start, &m_cols_ai, row_end,
+ &m_master_reclength, table->write_set, UPDATE_ROWS_EVENT)))
+ {
+ thd->net.last_errno= error;
+ return error;
+ }
+
bmove_align(m_after_image, table->record[0], table->s->reclength);
restore_record(table, record[1]);
@@ -7937,10 +7954,10 @@ int
Incident_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
{
DBUG_ENTER("Incident_log_event::do_apply_event");
- slave_print_msg(ERROR_LEVEL, rli, ER_SLAVE_INCIDENT,
- ER(ER_SLAVE_INCIDENT),
- description(),
- m_message.length > 0 ? m_message.str : "<none>");
+ rli->report(ERROR_LEVEL, ER_SLAVE_INCIDENT,
+ ER(ER_SLAVE_INCIDENT),
+ description(),
+ m_message.length > 0 ? m_message.str : "<none>");
DBUG_RETURN(1);
}
#endif