Comment 12 for bug 1441259

Yura Sorokin (yura-sorokin) wrote :

Although the original bug was fixed in 5.5 (or even 5.1) and therefore a new bug was introduced in the same version, this problem did not reveal itself until "super_read_only" functionality was introduced (in 5.6).

Despite the fact that the execution was going through the wrong path ("else" block of the "if (unlikely(thd->slave_thread))"), the error was never reported.

Here is this "else" block from 5.5
*****************************************
    else
    {
#endif /* HAVE_REPLICATION */
      if (res)
        break;
      if (opt_readonly &&
   !(thd->security_ctx->master_access & SUPER_ACL) &&
   some_non_temp_table_to_be_updated(thd, all_tables))
      {
 my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only");
 break;
      }
#ifdef HAVE_REPLICATION
    } /* unlikely */
#endif

*****************************************
Because for slave threads "thd->security_ctx->master_access" was always set in "Security_context::skip_grants()" and therefore always included "SUPER_ACL" flag, "my_error()" was never called.