diff options
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r-- | sql/sql_admin.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 1c1ab82e570..297733a00a7 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -1314,7 +1314,7 @@ bool Sql_cmd_analyze_table::execute(THD *thd) "analyze", lock_type, 1, 0, 0, 0, &handler::ha_analyze, 0); /* ! we write after unlocking the table */ - if (!res && !m_lex->no_write_to_binlog) + if (!res && !m_lex->no_write_to_binlog && !opt_readonly) { /* Presumably, ANALYZE and binlog writing doesn't require synchronization @@ -1372,7 +1372,7 @@ bool Sql_cmd_optimize_table::execute(THD *thd) "optimize", TL_WRITE, 1, 0, 0, 0, &handler::ha_optimize, 0); /* ! we write after unlocking the table */ - if (!res && !m_lex->no_write_to_binlog) + if (!res && !m_lex->no_write_to_binlog && !opt_readonly) { /* Presumably, OPTIMIZE and binlog writing doesn't require synchronization @@ -1406,7 +1406,7 @@ bool Sql_cmd_repair_table::execute(THD *thd) &handler::ha_repair, &view_repair); /* ! we write after unlocking the table */ - if (!res && !m_lex->no_write_to_binlog) + if (!res && !m_lex->no_write_to_binlog && !opt_readonly) { /* Presumably, REPAIR and binlog writing doesn't require synchronization |