diff options
author | unknown <guilhem@mysql.com> | 2004-01-28 15:26:01 +0100 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2004-01-28 15:26:01 +0100 |
commit | f138cd10152d4df58dcd3f573f443a58b7705250 (patch) | |
tree | f0a0cc1676877e0a2050bd29f4c342317c587247 /sql/log_event.cc | |
parent | 4db4ffef27624e58cc5c45cc8a165bfb9509fbfa (diff) | |
download | mariadb-git-f138cd10152d4df58dcd3f573f443a58b7705250.tar.gz |
Fix for BUG#2542 "If slave ignores a query it may make the next LOAD DATA INFILE fail":
reset errors (in thd) before executing the event. Otherwise if an event is ignored
because of replicate-*-table rules (error ER_SLAVE_IGNORED_TABLE) this error code
may remain in thd->net and the next event may pick it.
sql/log_event.cc:
Reset errors (in thd) before executing the event. Otherwise if an event is ignored
because of replicate-*-table rules (error ER_SLAVE_IGNORED_TABLE) this error code
may remain in thd->net and the next event may pick it.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 4413a77c364..cafd1666eac 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1823,6 +1823,8 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) since we must store the pos of the END of the current log event */ rli->event_len= get_event_len(); + thd->query_error= 0; // clear error + thd->clear_error(); if (db_ok(thd->db, replicate_do_db, replicate_ignore_db)) { @@ -1833,9 +1835,6 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query_id = query_id++; VOID(pthread_mutex_unlock(&LOCK_thread_count)); - thd->query_error = 0; // clear error - thd->net.last_errno = 0; - thd->net.last_error[0] = 0; thd->slave_proxy_id = thread_id; // for temp tables /* @@ -1890,6 +1889,7 @@ Default database: '%s'", ignored_error_code(actual_error)) { thd->query_error = 0; + thd->clear_error(); *rli->last_slave_error = 0; rli->last_slave_errno = 0; } @@ -1960,6 +1960,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, DBUG_ASSERT(thd->query == 0); thd->query = 0; // Should not be needed thd->query_error = 0; + thd->clear_error(); /* We test replicate_*_db rules. Note that we have already prepared the file to |