Comment 11 for bug 1441259

Revision history for this message
Yura Sorokin (yura-sorokin) wrote :

The problem was introduced in commit 78e1f5d "Cherry picking patch for BUG#37051" (https://github.com/percona/percona-server/commit/78e1f5d5232a471e21234efb55a683161b72d40a)
Original BUG#37051 "Replication rules not evaluated correctly"
(https://bugs.mysql.com/bug.php?id=37051).

In "sql_parse.cc" in "mysql_execute_command()", "case SQLCOM_UPDATE_MULTI:" branch
*****************************************
#ifdef HAVE_REPLICATION
    /* Check slave filtering rules */
    if (unlikely(thd->slave_thread && !have_table_map_for_update))
    {
      if (all_tables_not_ok(thd, all_tables))
      {
        if (res!= 0)
        {
          res= 0; /* don't care of prev failure */
          thd->clear_error(); /* filters are of highest prior */
        }
        /* we warn the slave SQL thread */
        my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
        break;
      }
      if (res)
        break;
    }
    else
    {
#endif /* HAVE_REPLICATION */
      if (res)
        break;
      bool enforce_ro = true;
      if (!opt_super_readonly)
        enforce_ro = !(thd->security_ctx->master_access & SUPER_ACL);
      if (opt_readonly &&
   enforce_ro &&
   some_non_temp_table_to_be_updated(thd, all_tables))
      {
        my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
                 opt_super_readonly ? "--read-only (super)" : "--read-only");
      }
#ifdef HAVE_REPLICATION
    } /* unlikely */
#endif
*****************************************

"!have_table_map_for_update" additional condition was put in the wrong place. It should have been added inside the "slave" ("if (unlikely(thd->slave_thread))") branch.