diff options
author | Luis Soares <luis.soares@oracle.com> | 2011-07-15 12:43:38 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@oracle.com> | 2011-07-15 12:43:38 +0100 |
commit | f333700a71bb3f457ef2509f9078f0afdab5cc46 (patch) | |
tree | 97aab60b9677ef8ed68d3d64e24f586651c1cf60 /sql | |
parent | 0caa1960091b520db780d6c2f6c3f3b9af138b26 (diff) | |
parent | 72857dc89cfe71eda4311a91e915d5a4ddde624e (diff) | |
download | mariadb-git-f333700a71bb3f457ef2509f9078f0afdab5cc46.tar.gz |
Automerge from mysql-5.1 into mysql-5.5.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log_event.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 9685d69234e..b29bcfdb536 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -71,6 +71,11 @@ static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD* thd); static const char *HA_ERR(int i) { + /* + This function should only be called in case of an error + was detected + */ + DBUG_ASSERT(i != 0); switch (i) { case HA_ERR_KEY_NOT_FOUND: return "HA_ERR_KEY_NOT_FOUND"; case HA_ERR_FOUND_DUPP_KEY: return "HA_ERR_FOUND_DUPP_KEY"; @@ -123,7 +128,7 @@ static const char *HA_ERR(int i) case HA_ERR_CORRUPT_EVENT: return "HA_ERR_CORRUPT_EVENT"; case HA_ERR_ROWS_EVENT_APPLY : return "HA_ERR_ROWS_EVENT_APPLY"; } - return 0; + return "No Error!"; } /** @@ -144,7 +149,7 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error, TABLE *table, const char * type, const char *log_name, ulong pos) { - const char *handler_error= HA_ERR(ha_error); + const char *handler_error= (ha_error ? HA_ERR(ha_error) : NULL); char buff[MAX_SLAVE_ERRMSG], *slider; const char *buff_end= buff + sizeof(buff); uint len; @@ -7765,7 +7770,8 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) error= do_exec_row(rli); - DBUG_PRINT("info", ("error: %s", HA_ERR(error))); + if (error) + DBUG_PRINT("info", ("error: %s", HA_ERR(error))); DBUG_ASSERT(error != HA_ERR_RECORD_DELETED); table->in_use = old_thd; @@ -9508,7 +9514,8 @@ int Rows_log_event::find_row(const Relay_log_info *rli) restart_rnd_next: error= table->file->rnd_next(table->record[0]); - DBUG_PRINT("info", ("error: %s", HA_ERR(error))); + if (error) + DBUG_PRINT("info", ("error: %s", HA_ERR(error))); switch (error) { case 0: |