diff options
author | unknown <guilhem@mysql.com> | 2003-05-15 18:35:39 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2003-05-15 18:35:39 +0200 |
commit | ec72bda592d05736e18d04e07a63f07808e7c3d0 (patch) | |
tree | 67d58f120ff62e57e109c20e887b75ad2ce0c104 /sql/sql_repl.cc | |
parent | 40e4b8d0cb1faf39acbfddc0e30f3e2d209bb4c2 (diff) | |
download | mariadb-git-ec72bda592d05736e18d04e07a63f07808e7c3d0.tar.gz |
Scrum task 845. Thi is a behaviour change :
now by default, FLUSH, OPTIMIZE, ANALYZE, REPAIR commands are written to the
binlog, unless the new NO_WRITE_TO_BINLOG keyword was used :
OPTIMIZE NO_WRITE_TO_BINLOG table t;
Previously these commands were never written to the binlog, but there are
2 reasons to change this :
- the RENAME TABLE in MERGE table bug (#175) on slave
- the possible "differently optimised queries may lead to different
updates on the master and slave" bug, until we have automatic ORDER BY.
FLUSH LOGS/SLAVE/MASTER/TABLES WITH READ LOCK are never written to the binlog.
New test for the new logging behaviour.
Other small change : reload_acl_and_cache() and reset_slave() don't send their errors themselves,
this is more usual.
mysql-test/mysql-test-run.sh:
rpl_flush_tables.test generates 'table xx is open on rename'.
This is normal and done on purpose, so don't report it.
sql/lex.h:
New keyword NO_WRITE_TO_BINLOG
sql/mysql_priv.h:
reload_acl_and_cache() now decides if we want to write the FLUSH command
to the binlog or not (FLUSH MASTER, FLUSH SLAVE, FLUSH TABLES
WITH READ LOCK, FLUSH LOGS cannot go into the binlog).
sql/mysqld.cc:
updated for new prototype of reload_acl_and_cache().
sql/sql_lex.h:
New boolean no_write_to_binlog in the lex structure.
sql/sql_parse.cc:
reload_acl_and_cache() now does not send its errors itself;
it saves the error and the caller sends it.
FLUSH, OPTIMIZE, ANALYZE, REPAIR commands don't write to the binlog
if the NO_WRITE_TO_BINLOG keyword was used.
sql/sql_repl.cc:
reset_slave() does not send its errors himself.
sql/sql_yacc.yy:
New optional keyword NO_WRITE_TO_BINLOG for OPTIMIZE/ANALYZE/REPAIR/FLUSH :
OPTIMIZE NO_WRITE_TO_BINLOG TABLE t;
ANALYZE NO_WRITE_TO_BINLOG TABLE t;
REPAIR NO_WRITE_TO_BINLOG TABLE t;
FLUSH NO_WRITE_TO_BINLOG TABLE t;
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r-- | sql/sql_repl.cc | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 0eb444b85c0..a39541b0fc5 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -746,16 +746,9 @@ int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report ) thd Thread handler mi Master info for the slave - - NOTES - We don't send ok in this functions as this is called from - reload_acl_and_cache() which may have done other tasks, which may - have failed for which we want to send and error. - RETURN 0 ok 1 error - In this case error is sent to the client with send_error() */ @@ -804,8 +797,8 @@ int reset_slave(THD *thd, MASTER_INFO* mi) err: unlock_slave_threads(mi); - if (thd && error) - send_error(thd, sql_errno, errmsg); + if (error) + my_error(sql_errno, MYF(0), errmsg); DBUG_RETURN(error); } |