List:Internals« Previous MessageNext Message »
From:guilhem Date:December 12 2005 3:33pm
Subject:bk commit into 5.1 tree (guilhem:1.1986)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of guilhem. When guilhem does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1986 05/12/12 16:33:13 guilhem@stripped +13 -0
  WL#1012 "row-based replication":
  1) enabling old disabled RBR tests and giving them result files; making them more robust.
  2) setting OPTION_STATUS_NO_TRANS_UPDATE when applying a Rows_log_event to a non-transactional table
  (it's quite unlikely that this event updated no row in the slave, though it this happens
  this is not a big problem).

  mysql-test/r/rpl_row_view01.result
    1.1 05/12/12 16:33:07 guilhem@stripped +100 -0
    new result

  mysql-test/r/rpl_row_mystery22.result
    1.1 05/12/12 16:33:07 guilhem@stripped +26 -0
    new result (difference with stm_mystery22 is normal)

  mysql-test/r/rpl_row_view01.result
    1.0 05/12/12 16:33:07 guilhem@stripped +0 -0
    BitKeeper file /home/mysql_src/mysql-5.1/mysql-test/r/rpl_row_view01.result

  mysql-test/r/rpl_row_mystery22.result
    1.0 05/12/12 16:33:07 guilhem@stripped +0 -0
    BitKeeper file /home/mysql_src/mysql-5.1/mysql-test/r/rpl_row_mystery22.result

  mysql-test/r/rpl_row_NOW.result
    1.1 05/12/12 16:33:06 guilhem@stripped +28 -0
    new result

  sql/log_event.cc
    1.199 05/12/12 16:33:06 guilhem@stripped +3 -11
    setting OPTION_STATUS_NO_TRANS_UPDATE in RBR when needed (it's not really needed in fact,
    as slave thread does not care about warnings, but as this code will be used by
    mysqlbinlog client threads, why not do it...).
    removing wrong comment of mine.

  mysql-test/t/rpl_stm_mystery22.test
    1.10 05/12/12 16:33:06 guilhem@stripped +14 -9
    avoiding a sleep ,and testing a bit more

  mysql-test/t/rpl_row_view01.test
    1.5 05/12/12 16:33:06 guilhem@stripped +53 -76
    s/test/mysqltest1
    removing the "SET NAMES" part (not a requirement of replication to make SELECT behave the same
    in master's and slave's session).

  mysql-test/t/rpl_row_mystery22.test
    1.4 05/12/12 16:33:06 guilhem@stripped +18 -19
    some SBR comments don't apply to this RBR test; testing a little bit more.

  mysql-test/t/rpl_row_NOW.test
    1.6 05/12/12 16:33:06 guilhem@stripped +16 -19
    s/test/mysqltest1

  mysql-test/t/disabled.def
    1.17 05/12/12 16:33:06 guilhem@stripped +0 -5
    old RBR tests which pass now

  mysql-test/r/rpl_stm_mystery22.result
    1.7 05/12/12 16:33:06 guilhem@stripped +18 -10
    updated result

  mysql-test/r/rpl_row_sp006_InnoDB.result
    1.2 05/12/12 16:33:06 guilhem@stripped +45 -0
    new result

  mysql-test/r/rpl_row_NOW.result
    1.0 05/12/12 16:33:06 guilhem@stripped +0 -0
    BitKeeper file /home/mysql_src/mysql-5.1/mysql-test/r/rpl_row_NOW.result

  mysql-test/extra/rpl_tests/rpl_row_sp006.test
    1.11 05/12/12 16:33:06 guilhem@stripped +25 -45
    s/test/mysqltest1

  BitKeeper/deleted/.del-rpl_row_sp006_InnoDB-master.opt~90806fb49b4b88ed
    1.4 05/12/12 14:42:59 guilhem@stripped +0 -0
    Delete: mysql-test/t/rpl_row_sp006_InnoDB-master.opt

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	guilhem
# Host:	gbichot3.local
# Root:	/home/mysql_src/mysql-5.1

--- 1.198/sql/log_event.cc	2005-12-12 12:21:47 +01:00
+++ 1.199/sql/log_event.cc	2005-12-12 16:33:06 +01:00
@@ -4990,10 +4990,6 @@
     m_tbllen(strlen(tbl_arg->s->table_name)),
     m_table_id(tid),
     m_width(tbl_arg->s->fields),
-    /*
-      TODO: allocating several kB for maybe no use (e.g. read-only session)
-      is too much.
-    */
     m_rows_buf(my_malloc(opt_binlog_rows_event_max_size * sizeof(*m_rows_buf), MYF(MY_WME))),
     m_rows_cur(m_rows_buf),
     m_rows_end(m_rows_buf + opt_binlog_rows_event_max_size),
@@ -5339,6 +5335,8 @@
     DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event",
                     rli->abort_slave=1;);
     error= do_after_row_operations(table, error);
+    if (!cache_stmt)
+      thd->options|= OPTION_STATUS_NO_TRANS_UPDATE;
     
   }
 
@@ -5437,7 +5435,7 @@
     mysql_unlock_tables(thd, thd->lock);
     thd->lock= 0;
     if ((table->s->primary_key == MAX_KEY) &&
-        !table->file->has_transactions())
+        !cache_stmt)
     {
       /*
         ------------ Temporary fix until WL#2975 is implemented ---------
@@ -6178,12 +6176,6 @@
     {
       if ((error= table->file->ha_delete_row(table->record[1])))
         return error;
-
-      /*
-         Matz: Do we need to set no_trans_update for non-transactional
-         tables ???
-      */
-
       /* Will retry ha_write_row() with the offending row removed. */
     }
   }
--- New file ---
+++ mysql-test/r/rpl_row_NOW.result	05/12/12 16:33:06
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create database if not exists mysqltest1;
DROP TABLE IF EXISTS mysqltest1.t1;
CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
a TIMESTAMP DEFAULT '2005-05-05 01:01:01',
b TIMESTAMP DEFAULT '2005-05-05 01:01:01',
PRIMARY KEY(n));
CREATE FUNCTION mysqltest1.f1() RETURNS TIMESTAMP
BEGIN
DECLARE v1 INT DEFAULT 300;
WHILE v1 > 0 DO
SET v1 = v1 - 1;
END WHILE;  
RETURN NOW();
END|
INSERT INTO mysqltest1.t1 VALUES(NULL,NOW(),mysqltest1.f1());
CREATE TRIGGER mysqltest1.trig1 BEFORE INSERT ON mysqltest1.t1
FOR EACH ROW BEGIN
SET new.b = mysqltest1.f1();
END|
INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
DROP TABLE IF EXISTS mysqltest1.t1;
DROP FUNCTION mysqltest1.f1;

--- New file ---
+++ mysql-test/r/rpl_row_mystery22.result	05/12/12 16:33:07
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1(n int auto_increment primary key, s char(10));
insert into t1 values (2,'old');
insert into t1 values(NULL,'new');
insert into t1 values(NULL,'new');
select * from t1 order by n;
n	s
1	new
2	new
delete from t1 where n = 2;
start slave;
stop slave;
create table t2(n int);
drop table t2;
insert into t1 values(NULL,'new');
start slave;
select * from t1 order by n;
n	s
1	new
3	new
drop table t1;

--- New file ---
+++ mysql-test/r/rpl_row_view01.result	05/12/12 16:33:07
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create database if not exists mysqltest1;
DROP VIEW IF EXISTS mysqltest1.v1;
DROP VIEW IF EXISTS mysqltest1.v2;
DROP VIEW IF EXISTS mysqltest1.v3;
DROP VIEW IF EXISTS mysqltest1.v4;
DROP TABLE IF EXISTS mysqltest1.t3;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a));
CREATE TABLE mysqltest1.t2 (a INT, c CHAR(6),PRIMARY KEY(a));
CREATE TABLE mysqltest1.t3 (a INT, c CHAR(6), c2 CHAR(6), PRIMARY KEY(a));
CREATE TABLE mysqltest1.t4 (a INT, qty INT, price INT,PRIMARY KEY(a));
CREATE TABLE mysqltest1.t5 (qty INT, price INT, total INT, PRIMARY KEY(qty));
INSERT INTO mysqltest1.t1 VALUES (1,'Thank'),(2,'it'),(3,'Friday');
INSERT INTO mysqltest1.t2 VALUES (1,'GOD'),(2,'is'),(3,'TGIF');
INSERT INTO mysqltest1.t4 VALUES(1, 3, 50),(2, 18, 3),(4, 4, 4);
CREATE VIEW mysqltest1.v2 AS SELECT qty, price, qty*price AS value FROM mysqltest1.t4;
CREATE VIEW mysqltest1.v1 AS SELECT t1.a, t1.c, t2.c as c2 FROM mysqltest1.t1 as t1, mysqltest1.t2 AS t2 WHERE mysqltest1.t1.a = mysqltest1.t2.a;
CREATE VIEW mysqltest1.v3 AS SELECT * FROM mysqltest1.t1;
CREATE VIEW mysqltest1.v4 AS SELECT * FROM mysqltest1.v3 WHERE a > 1 WITH LOCAL CHECK OPTION;
SELECT * FROM mysqltest1.v2;
qty	price	value
3	50	150
18	3	54
4	4	16
SELECT * FROM mysqltest1.v1;
a	c	c2
1	Thank	GOD
2	it	is
3	Friday	TGIF
SELECT * FROM mysqltest1.v2;
qty	price	value
3	50	150
18	3	54
4	4	16
SELECT * FROM mysqltest1.v1;
a	c	c2
1	Thank	GOD
2	it	is
3	Friday	TGIF
INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2;
INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1;
SELECT * FROM mysqltest1.t5;
qty	price	total
3	50	150
18	3	54
4	4	16
SELECT * FROM mysqltest1.t3;
a	c	c2
1	Thank	GOD
2	it	is
3	Friday	TGIF
SELECT * FROM mysqltest1.t5;
qty	price	total
3	50	150
18	3	54
4	4	16
SELECT * FROM mysqltest1.t3;
a	c	c2
1	Thank	GOD
2	it	is
3	Friday	TGIF
INSERT INTO mysqltest1.v4 VALUES (4,'TEST');
SELECT * FROM mysqltest1.t1;
a	c
1	Thank
2	it
3	Friday
4	TEST
SELECT * FROM mysqltest1.v4;
a	c
2	it
3	Friday
4	TEST
SELECT * FROM mysqltest1.t1;
a	c
1	Thank
2	it
3	Friday
4	TEST
SELECT * FROM mysqltest1.v4;
a	c
2	it
3	Friday
4	TEST
DROP VIEW IF EXISTS mysqltest1.v1;
DROP VIEW IF EXISTS mysqltest1.v2;
DROP VIEW IF EXISTS mysqltest1.v3;
DROP VIEW IF EXISTS mysqltest1.v4;
DROP TABLE IF EXISTS mysqltest1.t3;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;


--- 1.1/mysql-test/r/rpl_row_sp006_InnoDB.result	2005-10-20 20:55:24 +02:00
+++ 1.2/mysql-test/r/rpl_row_sp006_InnoDB.result	2005-12-12 16:33:06 +01:00
@@ -0,0 +1,45 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create database if not exists mysqltest1;
+DROP PROCEDURE IF EXISTS mysqltest1.p1;
+DROP PROCEDURE IF EXISTS mysqltest1.p2;
+DROP TABLE IF EXISTS mysqltest1.t2;
+DROP TABLE IF EXISTS mysqltest1.t1;
+CREATE TABLE IF NOT EXISTS mysqltest1.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=InnoDB;
+CREATE TABLE IF NOT EXISTS mysqltest1.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=InnoDB;
+CREATE PROCEDURE mysqltest1.p1()
+BEGIN
+DECLARE done INT DEFAULT 0;
+DECLARE spa CHAR(16);
+DECLARE spb INT;
+DECLARE cur1 CURSOR FOR SELECT name, 
+(YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5)) 
+FROM mysqltest1.t1;
+DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
+OPEN cur1;
+SET AUTOCOMMIT=0;
+REPEAT
+FETCH cur1 INTO spa, spb;
+IF NOT done THEN
+START TRANSACTION;
+INSERT INTO mysqltest1.t2 VALUES (spa,spb);
+COMMIT;
+END IF;
+UNTIL done END REPEAT;
+SET AUTOCOMMIT=1;
+CLOSE cur1;
+END|
+CREATE PROCEDURE mysqltest1.p2()
+BEGIN
+INSERT INTO mysqltest1.t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
+END|
+CALL mysqltest1.p2();
+CALL mysqltest1.p1();
+DROP PROCEDURE IF EXISTS mysqltest1.p1;
+DROP PROCEDURE IF EXISTS mysqltest1.p2;
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP TABLE IF EXISTS mysqltest1.t2;

--- 1.5/mysql-test/t/rpl_row_NOW.test	2005-10-04 18:08:36 +02:00
+++ 1.6/mysql-test/t/rpl_row_NOW.test	2005-12-12 16:33:06 +01:00
@@ -14,17 +14,18 @@
 # Begin clean up test section
 connection master;
 --disable_warnings
-DROP TABLE IF EXISTS test.t1;
+create database if not exists mysqltest1;
+DROP TABLE IF EXISTS mysqltest1.t1;
 --enable_warnings
 
 
 # Begin test section 1 
-CREATE TABLE test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
+CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
                       a TIMESTAMP DEFAULT '2005-05-05 01:01:01',
                       b TIMESTAMP DEFAULT '2005-05-05 01:01:01',
                       PRIMARY KEY(n));
 delimiter |;
-CREATE FUNCTION test.f1() RETURNS TIMESTAMP
+CREATE FUNCTION mysqltest1.f1() RETURNS TIMESTAMP
 BEGIN
   DECLARE v1 INT DEFAULT 300;
   WHILE v1 > 0 DO
@@ -34,32 +35,27 @@
 END|
 delimiter ;|
 
-INSERT INTO test.t1 VALUES(NULL,NOW(),test.f1());
+INSERT INTO mysqltest1.t1 VALUES(NULL,NOW(),mysqltest1.f1());
 
 delimiter |;
-CREATE TRIGGER test.trig1 BEFORE INSERT ON test.t1
+CREATE TRIGGER mysqltest1.trig1 BEFORE INSERT ON mysqltest1.t1
 FOR EACH ROW BEGIN
-  SET new.b = test.f1();
+  SET new.b = mysqltest1.f1();
 END|
 delimiter ;|
 
-INSERT INTO test.t1 SET n = NULL, a = now();
+INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
 
-#SELECT  * FROM test.t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-#SELECT * FROM test.t1;
-connection master;
+sync_slave_with_master;
 
-#show binlog events;
+connection master;
 
---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/NOW_master.sql
---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/NOW_slave.sql
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > ./var/tmp/NOW_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > ./var/tmp/NOW_slave.sql
 
 # lets cleanup
-DROP TABLE IF EXISTS test.t1;
-DROP FUNCTION test.f1;
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP FUNCTION mysqltest1.f1;
 
 # Lets compare. Note: If they match test will pass, if they do not match
 # the test will show that the diff statement failed and not reject file
@@ -73,4 +69,5 @@
 system rm ./var/tmp/NOW_master.sql;
 system rm ./var/tmp/NOW_slave.sql;
 
-# End of 5.0 test case
+sync_slave_with_master;
+# End of 5.1 test case

--- 1.10/mysql-test/extra/rpl_tests/rpl_row_sp006.test	2005-10-20 18:22:44 +02:00
+++ 1.11/mysql-test/extra/rpl_tests/rpl_row_sp006.test	2005-12-12 16:33:06 +01:00
@@ -15,26 +15,27 @@
 # Begin clean up test section
 connection master;
 --disable_warnings
-DROP PROCEDURE IF EXISTS test.p1;
-DROP PROCEDURE IF EXISTS test.p2;
-DROP TABLE IF EXISTS test.t2;
-DROP TABLE IF EXISTS test.t1;
+create database if not exists mysqltest1;
+DROP PROCEDURE IF EXISTS mysqltest1.p1;
+DROP PROCEDURE IF EXISTS mysqltest1.p2;
+DROP TABLE IF EXISTS mysqltest1.t2;
+DROP TABLE IF EXISTS mysqltest1.t1;
 --enable_warnings
 # End of cleanup
 
 # Begin test section 1
-eval CREATE TABLE IF NOT EXISTS test.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=$engine_type;
-eval CREATE TABLE IF NOT EXISTS test.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=$engine_type;
+eval CREATE TABLE IF NOT EXISTS mysqltest1.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=$engine_type;
+eval CREATE TABLE IF NOT EXISTS mysqltest1.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=$engine_type;
 
 delimiter |;
-CREATE PROCEDURE test.p1()
+CREATE PROCEDURE mysqltest1.p1()
 BEGIN
   DECLARE done INT DEFAULT 0;
   DECLARE spa CHAR(16);
   DECLARE spb INT;
   DECLARE cur1 CURSOR FOR SELECT name, 
        (YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5)) 
-       FROM test.t1;
+       FROM mysqltest1.t1;
    DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
 
   OPEN cur1;
@@ -44,7 +45,7 @@
     FETCH cur1 INTO spa, spb;
     IF NOT done THEN
        START TRANSACTION;
-          INSERT INTO test.t2 VALUES (spa,spb);
+          INSERT INTO mysqltest1.t2 VALUES (spa,spb);
        COMMIT;
      END IF;
   UNTIL done END REPEAT;
@@ -52,52 +53,29 @@
   SET AUTOCOMMIT=1;
   CLOSE cur1;
 END|
-CREATE PROCEDURE test.p2()
+CREATE PROCEDURE mysqltest1.p2()
 BEGIN
-  INSERT INTO test.t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
+  INSERT INTO mysqltest1.t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
 END|
 delimiter ;|
 
-let $message=< ---- Master selects-- >;
---source include/show_msg.inc
-CALL test.p2();
-SELECT * FROM test.t1;
-#SELECT * FROM test.t2;
-
-let $message=< ---- Slave selects-- >;
---source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+CALL mysqltest1.p2();
+sync_slave_with_master;
 
-
-SELECT * FROM test.t1;
-#SELECT * FROM test.t2;
-
-let $message=< ---- Master selects-- >;
---source include/show_msg.inc
 connection master;
-CALL test.p1();
-#SELECT * FROM test.t2;
-
-let $message=< ---- Slave selects-- >;
---source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
-#SELECT * FROM test.t2;
+CALL mysqltest1.p1();
+sync_slave_with_master;
 
 connection master;
-#show binlog events;
 
---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp006_master.sql
---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp006_slave.sql
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > ./var/tmp/sp006_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > ./var/tmp/sp006_slave.sql
 
 
-DROP PROCEDURE IF EXISTS test.p1;
-DROP PROCEDURE IF EXISTS test.p2;
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
+DROP PROCEDURE IF EXISTS mysqltest1.p1;
+DROP PROCEDURE IF EXISTS mysqltest1.p2;
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP TABLE IF EXISTS mysqltest1.t2;
 
 # Lets compare. Note: If they match test will pass, if they do not match
 # the test will show that the diff statement failed and not reject file
@@ -107,4 +85,6 @@
 
 exec diff ./var/tmp/sp006_master.sql ./var/tmp/sp006_slave.sql;
 
-# End of 5.0 test case
+sync_slave_with_master;
+
+# End of 5.1 test case

--- 1.4/mysql-test/t/rpl_row_view01.test	2005-08-31 05:27:49 +02:00
+++ 1.5/mysql-test/t/rpl_row_view01.test	2005-12-12 16:33:06 +01:00
@@ -13,93 +13,70 @@
 # Begin clean up test section
 connection master;
 --disable_warnings
-DROP VIEW IF EXISTS test.v1;
-DROP VIEW IF EXISTS test.v2;
-DROP VIEW IF EXISTS test.v3;
-DROP VIEW IF EXISTS test.v4;
-DROP TABLE IF EXISTS test.t3;
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
-DROP TABLE IF EXISTS test.t4;
+create database if not exists mysqltest1;
+DROP VIEW IF EXISTS mysqltest1.v1;
+DROP VIEW IF EXISTS mysqltest1.v2;
+DROP VIEW IF EXISTS mysqltest1.v3;
+DROP VIEW IF EXISTS mysqltest1.v4;
+DROP TABLE IF EXISTS mysqltest1.t3;
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP TABLE IF EXISTS mysqltest1.t2;
+DROP TABLE IF EXISTS mysqltest1.t4;
 
 # Begin test section 1 
-CREATE TABLE test.t1 (a INT, c CHAR(6),PRIMARY KEY(a));
-CREATE TABLE test.t2 (a INT, c CHAR(6),PRIMARY KEY(a));
-CREATE TABLE test.t3 (a INT, c CHAR(6), c2 CHAR(6), PRIMARY KEY(a));
-CREATE TABLE test.t4 (a INT, qty INT, price INT,PRIMARY KEY(a));
-CREATE TABLE test.t5 (qty INT, price INT, total INT, PRIMARY KEY(qty));
-INSERT INTO test.t1 VALUES (1,'Thank'),(2,'it'),(3,'Friday');
-INSERT INTO test.t2 VALUES (1,'GOD'),(2,'is'),(3,'TGIF');
-INSERT INTO test.t4 VALUES(1, 3, 50),(2, 18, 3),(4, 4, 4);
-
-
-CREATE VIEW test.v2 AS SELECT qty, price, qty*price AS value FROM test.t4;
-CREATE VIEW test.v1 AS SELECT t1.a, t1.c, t2.c as c2 FROM test.t1 as t1, test.t2 AS t2 WHERE test.t1.a = test.t2.a;
-CREATE VIEW test.v3 AS SELECT * FROM test.t1;
-CREATE VIEW test.v4 AS SELECT * FROM test.v3 WHERE a > 1 WITH LOCAL CHECK OPTION;
-
-
-SELECT * FROM test.v2;
-SELECT * FROM test.v1;
-save_master_pos;
-connection slave;
-sync_with_master;
-SELECT * FROM test.v2;
-SELECT * FROM test.v1;
+CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t2 (a INT, c CHAR(6),PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t3 (a INT, c CHAR(6), c2 CHAR(6), PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t4 (a INT, qty INT, price INT,PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t5 (qty INT, price INT, total INT, PRIMARY KEY(qty));
+INSERT INTO mysqltest1.t1 VALUES (1,'Thank'),(2,'it'),(3,'Friday');
+INSERT INTO mysqltest1.t2 VALUES (1,'GOD'),(2,'is'),(3,'TGIF');
+INSERT INTO mysqltest1.t4 VALUES(1, 3, 50),(2, 18, 3),(4, 4, 4);
+
+
+CREATE VIEW mysqltest1.v2 AS SELECT qty, price, qty*price AS value FROM mysqltest1.t4;
+CREATE VIEW mysqltest1.v1 AS SELECT t1.a, t1.c, t2.c as c2 FROM mysqltest1.t1 as t1, mysqltest1.t2 AS t2 WHERE mysqltest1.t1.a = mysqltest1.t2.a;
+CREATE VIEW mysqltest1.v3 AS SELECT * FROM mysqltest1.t1;
+CREATE VIEW mysqltest1.v4 AS SELECT * FROM mysqltest1.v3 WHERE a > 1 WITH LOCAL CHECK OPTION;
+
+
+SELECT * FROM mysqltest1.v2;
+SELECT * FROM mysqltest1.v1;
+sync_slave_with_master;
+SELECT * FROM mysqltest1.v2;
+SELECT * FROM mysqltest1.v1;
 connection master;
 
-INSERT INTO test.t5 SELECT * FROM test.v2;
-INSERT INTO test.t3 SELECT * FROM test.v1;
+INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2;
+INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1;
 
-SELECT * FROM test.t5;
-SELECT * FROM test.t3;
-save_master_pos;
-connection slave;
-sync_with_master;
-SELECT * FROM test.t5;
-SELECT * FROM test.t3;
+SELECT * FROM mysqltest1.t5;
+SELECT * FROM mysqltest1.t3;
+sync_slave_with_master;
+SELECT * FROM mysqltest1.t5;
+SELECT * FROM mysqltest1.t3;
 connection master;
 
-INSERT INTO test.v4 VALUES (4,'TEST');
+INSERT INTO mysqltest1.v4 VALUES (4,'TEST');
 
-SELECT * FROM test.t1;
-SELECT * FROM test.v4;
-save_master_pos;
-connection slave;
-sync_with_master;
-SELECT * FROM test.t1;
-SELECT * FROM test.v4;
+SELECT * FROM mysqltest1.t1;
+SELECT * FROM mysqltest1.v4;
+sync_slave_with_master;
+SELECT * FROM mysqltest1.t1;
+SELECT * FROM mysqltest1.v4;
 
 connection master;
-CREATE VIEW test.v5 AS SELECT CHARSET(CHAR(65)), COLLATION(CHAR(65));
-SET NAMES 'latin1';
 
-SELECT * FROM test.v5;
-save_master_pos;
-connection slave;
-sync_with_master;
-SELECT * FROM test.v5;
-
-connection master;
-SET NAMES 'utf8';
-
-SELECT * FROM test.v5;
-save_master_pos;
-connection slave;
-sync_with_master;
-SELECT * FROM test.v5;
-
-connection master;
-#show binlog events;
 # lets cleanup
-DROP VIEW IF EXISTS test.v1;
-DROP VIEW IF EXISTS test.v2;
-DROP VIEW IF EXISTS test.v3;
-DROP VIEW IF EXISTS test.v4;
-DROP TABLE IF EXISTS test.t3;
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
-DROP TABLE IF EXISTS test.t4;
+DROP VIEW IF EXISTS mysqltest1.v1;
+DROP VIEW IF EXISTS mysqltest1.v2;
+DROP VIEW IF EXISTS mysqltest1.v3;
+DROP VIEW IF EXISTS mysqltest1.v4;
+DROP TABLE IF EXISTS mysqltest1.t3;
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP TABLE IF EXISTS mysqltest1.t2;
+DROP TABLE IF EXISTS mysqltest1.t4;
+sync_slave_with_master;
 
-# End of 5.0 test case
+# End of 5.1 test case
 

--- 1.16/mysql-test/t/disabled.def	2005-12-06 11:13:09 +01:00
+++ 1.17/mysql-test/t/disabled.def	2005-12-12 16:33:06 +01:00
@@ -14,11 +14,6 @@
 rpl_until       : Unstable test case, bug#12429
 rpl_deadlock    : Unstable test case, bug#12429
 kill            : Unstable test case, bug#9712
-rpl_row_mystery22:shows rbr slave issues Bug 12418
-rpl_row_000002:create table from temporary Bug 12345
-rpl_row_sp006_InnoDB:Bug 12586
-rpl_row_view01:Bug 12687
-rpl_row_NOW:Bug 12574 
 rpl_bit_npk:Bug 13418
 compress        : Magnus will fix
 innodb_concurrent: Results are not deterministic

--- 1.3/mysql-test/t/rpl_row_mystery22.test	2005-08-26 02:13:48 +02:00
+++ 1.4/mysql-test/t/rpl_row_mystery22.test	2005-12-12 16:33:06 +01:00
@@ -1,46 +1,45 @@
-# TBI - row-based result mismatch
+# Originally taken from rpl_mystery22.test,
+# but this row-based-replication test has a totally different spirit:
+# slave will not stop because of dup key,
+# instead we test if it does overwrite the dup key
+# as expected.
 -- source include/have_binlog_format_row.inc
-
-# test case to make slave thread get ahead by 22 bytes
-
 -- source include/master-slave.inc
 
 # first, cause a duplicate key problem on the slave
-create table t1(n int auto_increment primary key);
+create table t1(n int auto_increment primary key, s char(10));
 sync_slave_with_master;
-insert into t1 values (2);
+insert into t1 values (2,'old');
 connection master;
-insert into t1 values(NULL);
-insert into t1 values(NULL);
+insert into t1 values(NULL,'new');
+insert into t1 values(NULL,'new');
 save_master_pos;
 connection slave;
-sleep 3; # there is no way around this sleep - we have to wait until
-# the slave tries to run the query, fails and aborts slave thread
+sync_with_master;
+select * from t1 order by n;
 delete from t1 where n = 2;
 --disable_warnings
 start slave;
 --enable_warnings
 sync_with_master;
-#now the buggy slave would be confused on the offset but it can replicate
-#in order to make it break, we need to stop/start the slave one more time
 stop slave;
 connection master;
-# to be able to really confuse the slave, we need some non-auto-increment
-# events in the log
 create table t2(n int);
 drop table t2;
-insert into t1 values(NULL);
+insert into t1 values(NULL,'new');
+# what happens when we delete a row which does not exist on slave?
+set sql_log_bin=0;
+insert into t1 values(NULL,'new');
+set sql_log_bin=1;
+delete from t1 where n=4;
 save_master_pos;
 connection slave;
 --disable_warnings
 start slave;
 --enable_warnings
-#now the truth comes out - if the slave is buggy, it will never sync because
-#the slave thread is not able to read events
 sync_with_master;
-select * from t1;
+select * from t1 order by n;
 #clean up
 connection master;
 drop table t1;
 sync_slave_with_master;
-

--- 1.6/mysql-test/r/rpl_stm_mystery22.result	2005-08-13 10:58:49 +02:00
+++ 1.7/mysql-test/r/rpl_stm_mystery22.result	2005-12-12 16:33:06 +01:00
@@ -4,20 +4,28 @@
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-create table t1(n int auto_increment primary key);
-insert into t1 values (2);
-insert into t1 values(NULL);
-insert into t1 values(NULL);
+create table t1(n int auto_increment primary key, s char(10));
+insert into t1 values (2,'old');
+insert into t1 values(NULL,'new');
+insert into t1 values(NULL,'new');
+select * from t1 order by n;
+n	s
+1	new
+2	old
 delete from t1 where n = 2;
 start slave;
 stop slave;
 create table t2(n int);
 drop table t2;
-insert into t1 values(NULL);
+insert into t1 values(NULL,'new');
+set sql_log_bin=0;
+insert into t1 values(NULL,'new');
+set sql_log_bin=1;
+delete from t1 where n=4;
 start slave;
-select * from t1;
-n
-1
-2
-3
+select * from t1 order by n;
+n	s
+1	new
+2	new
+3	new
 drop table t1;

--- 1.9/mysql-test/t/rpl_stm_mystery22.test	2005-08-13 10:58:26 +02:00
+++ 1.10/mysql-test/t/rpl_stm_mystery22.test	2005-12-12 16:33:06 +01:00
@@ -1,4 +1,3 @@
-# TBI - row-based result mismatch
 -- source include/have_binlog_format_statement.inc
 
 # test case to make slave thread get ahead by 22 bytes
@@ -6,16 +5,17 @@
 -- source include/master-slave.inc
 
 # first, cause a duplicate key problem on the slave
-create table t1(n int auto_increment primary key);
+create table t1(n int auto_increment primary key, s char(10));
 sync_slave_with_master;
-insert into t1 values (2);
+insert into t1 values (2,'old');
 connection master;
-insert into t1 values(NULL);
-insert into t1 values(NULL);
+insert into t1 values(NULL,'new');
+insert into t1 values(NULL,'new');
 save_master_pos;
 connection slave;
-sleep 3; # there is no way around this sleep - we have to wait until
-# the slave tries to run the query, fails and aborts slave thread
+# wait until the slave tries to run the query, fails and aborts slave thread
+wait_for_slave_to_stop;
+select * from t1 order by n;
 delete from t1 where n = 2;
 --disable_warnings
 start slave;
@@ -29,7 +29,12 @@
 # events in the log
 create table t2(n int);
 drop table t2;
-insert into t1 values(NULL);
+insert into t1 values(NULL,'new');
+# what happens when we delete a row which does not exist on slave?
+set sql_log_bin=0;
+insert into t1 values(NULL,'new');
+set sql_log_bin=1;
+delete from t1 where n=4;
 save_master_pos;
 connection slave;
 --disable_warnings
@@ -38,7 +43,7 @@
 #now the truth comes out - if the slave is buggy, it will never sync because
 #the slave thread is not able to read events
 sync_with_master;
-select * from t1;
+select * from t1 order by n;
 #clean up
 connection master;
 drop table t1;
Thread
bk commit into 5.1 tree (guilhem:1.1986)guilhem12 Dec