summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2019-10-14 18:14:36 +0300
committerMonty <monty@mariadb.org>2019-10-20 11:52:29 +0300
commitb62101f84be49013cf07f323c202606847dcc453 (patch)
treedab5a7aab47b675ad9264b0146edaa89b0a125ab /sql/sql_update.cc
parente0b6294338fdfc8a4a8b42e6b199c588453be879 (diff)
downloadmariadb-git-b62101f84be49013cf07f323c202606847dcc453.tar.gz
Fixes for binary logging --read-only mode
- Any temporary tables created under read-only mode will never be logged to binary log. Any usage of these tables to update normal tables, even after read-only has been disabled, will use row base logging (as the temporary table will not be on the slave). - Analyze, check and repair table will not be logged in read-only mode. Other things: - Removed not used varaibles in MYSQL_BIN_LOG::flush_and_set_pending_rows_event. - Set table_share->table_creation_was_logged for all normal tables. - THD::binlog_query() now returns -1 if statement was not logged., This is used to update table_share->table_creation_was_logged. - Don't log admin statements in opt_readonly is set. - Table's that doesn't have table_creation_was_logged will set binlog format to row logging. - Removed not needed/wrong setting of table->s->table_creation_was_logged in create_table_from_items()
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 18ab69d3557..32adc4420b3 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1156,7 +1156,7 @@ update_end:
if (thd->binlog_query(THD::ROW_QUERY_TYPE,
thd->query(), thd->query_length(),
- transactional_table, FALSE, FALSE, errcode))
+ transactional_table, FALSE, FALSE, errcode) > 0)
{
error=1; // Rollback update
}
@@ -2885,7 +2885,7 @@ bool multi_update::send_eof()
if (thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query(),
thd->query_length(), transactional_tables, FALSE,
- FALSE, errcode))
+ FALSE, errcode) > 0)
local_error= 1; // Rollback update
thd->set_current_stmt_binlog_format(save_binlog_format);
}