diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-07-10 13:55:53 +0200 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-07-10 13:55:53 +0200 |
commit | 8f21a3166908d71b5828d50bfce65b480508c6c1 (patch) | |
tree | c4aff2031f1402155445fb5cf4e5e29c5dcb1774 /sql/rpl_parallel.cc | |
parent | 45f6262f54c5d1ef535c0529c399a7352b5fdea4 (diff) | |
download | mariadb-git-8f21a3166908d71b5828d50bfce65b480508c6c1.tar.gz |
MDEV-6435: Assertion `m_status == DA_ERROR' failed in Diagnostics_area::sql_errno() with parallel replication
When a MyISAM query is killed midway, the query is logged to the binlog marked
with the error.
The slave does not attempt to run the query, but aborts with a suitable error
message in the error log for the DBA to act on.
In this case, the parallel replication code would check the sql_errno() code,
even no my_error() had been set. In debug builds, this causes an assertion.
Fixed the code to check that we actually have an error set before querying for
an error code.
Diffstat (limited to 'sql/rpl_parallel.cc')
-rw-r--r-- | sql/rpl_parallel.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 98753865568..0d23248539c 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -234,8 +234,11 @@ static void convert_kill_to_deadlock_error(rpl_group_info *rgi) { THD *thd= rgi->thd; - int err_code= thd->get_stmt_da()->sql_errno(); + int err_code; + if (!thd->get_stmt_da()->is_error()) + return; + err_code= thd->get_stmt_da()->sql_errno(); if ((err_code == ER_QUERY_INTERRUPTED || err_code == ER_CONNECTION_KILLED) && rgi->killed_for_retry) { |