1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Making DROP TABLE IF EXISTS, DROP DATABASE IF EXISTS, DELETE FROM, UPDATE be logged to

binlog even if they changed nothing, and a test for this.
This is useful when users use these commands to clean up their master and slave by issuing
one command on master (assume master and slave have slightly different data for some
reason and you want to clean up both).
Note that I have not changed multi-table DELETE and multi-table UPDATE because their
error-reporting mechanism is more complicated.


mysql-test/r/mysqlbinlog.result:
  result update
mysql-test/r/rpl_charset.result:
  result update
mysql-test/r/rpl_flush_log_loop.result:
  result update
mysql-test/r/rpl_replicate_do.result:
  result update
mysql-test/r/rpl_temporary.result:
  result update
mysql-test/t/mysqlbinlog.test:
  moving SET TIMESTAMP up as DROP shows up in binlog
sql/sql_db.cc:
  DROP DATABASE IF EXISTS is now always logged to binlog, even if db did not exist
sql/sql_delete.cc:
  DELETE FROM t is now always logged to binlog even if no rows deleted (but in this case, only if really no error).
sql/sql_table.cc:
  DROP TABLE IF EXISTS is now always logged to binlog even if table did not exist
sql/sql_update.cc:
  UPDATE is now always logged to binlog even if no rows updated (but in this case, only if really no error).
This commit is contained in:
unknown
2004-06-09 16:07:01 +02:00
parent ee401045be
commit 43489240ad
12 changed files with 213 additions and 122 deletions

View File

@ -39,17 +39,18 @@ f
show binlog events;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
master-bin.000001 79 Query 1 79 use `test`; create table t1(f int)
master-bin.000001 136 Query 1 136 use `test`; create table t2(f int)
master-bin.000001 193 Query 1 193 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
master-bin.000001 290 Query 1 290 use `test`; create temporary table t3(f int)
master-bin.000001 357 Query 1 357 use `test`; insert into t3 select * from t1 where f<6
master-bin.000001 433 Query 1 433 use `test`; create temporary table t3(f int)
master-bin.000001 500 Query 1 500 use `test`; insert into t2 select count(*) from t3
master-bin.000001 573 Query 1 573 use `test`; insert into t3 select * from t1 where f>=4
master-bin.000001 650 Query 1 650 use `test`; drop temporary table t3
master-bin.000001 708 Query 1 708 use `test`; insert into t2 select count(*) from t3
master-bin.000001 781 Query 1 781 use `test`; drop temporary table t3
master-bin.000001 79 Query 1 79 use `test`; drop table if exists t1,t2
master-bin.000001 140 Query 1 140 use `test`; create table t1(f int)
master-bin.000001 197 Query 1 197 use `test`; create table t2(f int)
master-bin.000001 254 Query 1 254 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
master-bin.000001 351 Query 1 351 use `test`; create temporary table t3(f int)
master-bin.000001 418 Query 1 418 use `test`; insert into t3 select * from t1 where f<6
master-bin.000001 494 Query 1 494 use `test`; create temporary table t3(f int)
master-bin.000001 561 Query 1 561 use `test`; insert into t2 select count(*) from t3
master-bin.000001 634 Query 1 634 use `test`; insert into t3 select * from t1 where f>=4
master-bin.000001 711 Query 1 711 use `test`; drop temporary table t3
master-bin.000001 769 Query 1 769 use `test`; insert into t2 select count(*) from t3
master-bin.000001 842 Query 1 842 use `test`; drop temporary table t3
drop table t1, t2;
use test;
SET TIMESTAMP=1040323920;