diff options
author | Alfranio Correia <alfranio.correia@sun.com> | 2009-04-06 01:22:34 +0100 |
---|---|---|
committer | Alfranio Correia <alfranio.correia@sun.com> | 2009-04-06 01:22:34 +0100 |
commit | e0d74efd85778495628acebb16bad435e56d6d95 (patch) | |
tree | e29c58fc2e68b4a8817b5b2b53a80256cf44890e /sql/slave.cc | |
parent | a81e21f8a433cf4b4bd7ea5f9f9a6ec57ee388d4 (diff) | |
parent | f3314e90e31b1568f11e85ff06ec9659aff58101 (diff) | |
download | mariadb-git-e0d74efd85778495628acebb16bad435e56d6d95.tar.gz |
merge 5.1-bugteam --> 5.1-bugteam (local)
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 8c29cb8a72f..cfe34bdfc41 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2713,7 +2713,8 @@ pthread_handler_t handle_slave_sql(void *arg) */ pthread_cond_broadcast(&rli->start_cond); pthread_mutex_unlock(&rli->run_lock); - sql_print_error("Failed during slave thread initialization"); + rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, + "Failed during slave thread initialization"); goto err; } thd->init_for_queries(); @@ -2757,9 +2758,9 @@ pthread_handler_t handle_slave_sql(void *arg) rli->group_relay_log_pos, 1 /*need data lock*/, &errmsg, 1 /*look for a description_event*/)) - { - sql_print_error("Error initializing relay log position: %s", - errmsg); + { + rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, + "Error initializing relay log position: %s", errmsg); goto err; } THD_CHECK_SENTRY(thd); @@ -2812,8 +2813,8 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME, execute_init_command(thd, &sys_init_slave, &LOCK_sys_init_slave); if (thd->is_slave_error) { - sql_print_error("\ -Slave SQL thread aborted. Can't execute init_slave query"); + rli->report(ERROR_LEVEL, thd->main_da.sql_errno(), + "Slave SQL thread aborted. Can't execute init_slave query"); goto err; } } @@ -2863,10 +2864,20 @@ Slave SQL thread aborted. Can't execute init_slave query"); thd->main_da.sql_errno(), last_errno)); if (last_errno == 0) { + /* + This function is reporting an error which was not reported + while executing exec_relay_log_event(). + */ rli->report(ERROR_LEVEL, thd->main_da.sql_errno(), errmsg); } else if (last_errno != thd->main_da.sql_errno()) { + /* + * An error was reported while executing exec_relay_log_event() + * however the error code differs from what is in the thread. + * This function prints out more information to help finding + * what caused the problem. + */ sql_print_error("Slave (additional info): %s Error_code: %d", errmsg, thd->main_da.sql_errno()); } |