diff --git a/sql/log_event.cc b/sql/log_event.cc
index 76532836b73b1d284f221d6b83cabf957e06bbc2..2cb253c9c56c08f80043d3a775828a05be71d532 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -7541,7 +7541,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
   }
 
   if (get_flags(STMT_END_F))
-    if (error= rows_event_stmt_cleanup(rli, thd))
+    if ((error= rows_event_stmt_cleanup(rli, thd)))
       rli->report(ERROR_LEVEL, error,
                   "Error in %s event: commit of row events failed, "
                   "table `%s`.`%s`",
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 3389821a718779c1dd48ae7c5b0d8f8e377377e9..357bc78b1cd0eb1143e8fef4123b286065498fd7 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -1842,7 +1842,7 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli)
       are involved, commit the transaction and flush the pending event to the
       binlog.
     */
-    if (error= ha_autocommit_or_rollback(thd, 0))
+    if ((error= ha_autocommit_or_rollback(thd, 0)))
       rli->report(ERROR_LEVEL, error,
                   "Error in %s event: commit of row events failed, "
                   "table `%s`.`%s`",