Below is the list of changes that have just been committed into a local
5.1 repository of elkin. When elkin 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@stripped, 2007-06-04 15:02:40+03:00, aelkin@stripped
+7 -0
Bug #27716 multi-update did partially and has not binlogged
manual merge with 5.0: automatic merge went incorrectly; fixing tests in rbr mode.
mysql-test/r/innodb.result@stripped, 2007-06-04 15:02:37+03:00,
aelkin@stripped +36 -3
results changed because of some more queries are added
mysql-test/r/multi_update.result@stripped, 2007-06-04 15:02:37+03:00,
aelkin@stripped +5 -4
results changed
mysql-test/r/rpl_row_basic_11bugs.result@stripped, 2007-06-04 15:02:37+03:00,
aelkin@stripped +24 -0
results changed
mysql-test/t/innodb.test@stripped, 2007-06-04 15:02:37+03:00,
aelkin@stripped +2 -2
error code is diff in 5.0
mysql-test/t/multi_update.test@stripped, 2007-06-04 15:02:37+03:00,
aelkin@stripped +10 -5
making explicit comments and forcing execution in mixed (stmt) mode.
mysql-test/t/rpl_row_basic_11bugs.test@stripped, 2007-06-04 15:02:37+03:00,
aelkin@stripped +39 -0
checking how binlogging works when a query on non-ta table completed partly.
sql/sql_update.cc@stripped, 2007-06-04 15:02:37+03:00,
aelkin@stripped +3 -3
manual merge after authomatic one failed (semantic drift)
# 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: aelkin
# Host: dsl-hkibras1-ff5dc300-70.dhcp.inet.fi
# Root: /tmp/merge_5.0
--- 1.243/sql/sql_update.cc 2007-06-02 17:56:36 +03:00
+++ 1.244/sql/sql_update.cc 2007-06-04 15:02:37 +03:00
@@ -1589,9 +1589,9 @@ void multi_update::send_error(uint errco
*/
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query, thd->query_length,
- transactional_tables, FALSE);
- mysql_bin_log.write(&qinfo);
+ thd->binlog_query(THD::ROW_QUERY_TYPE,
+ thd->query, thd->query_length,
+ transactional_tables, FALSE);
}
if (!trans_safe)
thd->no_trans_update.all= TRUE;
--- 1.16/mysql-test/r/rpl_row_basic_11bugs.result 2007-03-30 11:27:01 +03:00
+++ 1.17/mysql-test/r/rpl_row_basic_11bugs.result 2007-06-04 15:02:37 +03:00
@@ -218,3 +218,27 @@ k HEX(a) HEX(b)
2 0 8
**** On Master ****
DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb;
+drop table if exists t1, t2;
+CREATE TABLE `t1` (
+`a` int(11) NOT NULL auto_increment,
+`b` int(11) default NULL,
+PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+CREATE TABLE `t2` (
+`a` int(11) NOT NULL auto_increment,
+`b` int(11) default NULL,
+PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+insert into t1 values (1,1),(2,2);
+insert into t2 values (1,1),(4,4);
+UPDATE t2,t1 SET t2.a=t1.a+2;
+ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
+select * from t2 /* must be (3,1), (4,4) */;
+a b
+3 1
+4 4
+select * from t2 /* must be (3,1), (4,4) */;
+a b
+3 1
+4 4
+drop table t1,t2;
--- 1.15/mysql-test/t/rpl_row_basic_11bugs.test 2007-04-25 22:33:16 +03:00
+++ 1.16/mysql-test/t/rpl_row_basic_11bugs.test 2007-06-04 15:02:37 +03:00
@@ -184,3 +184,42 @@ SELECT k, HEX(a),HEX(b) FROM t2_innodb;
connection master;
DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb;
sync_slave_with_master;
+
+#
+# Bug#27716 multi-update did partially and has not binlogged
+#
+
+connection master;
+
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+CREATE TABLE `t1` (
+ `a` int(11) NOT NULL auto_increment,
+ `b` int(11) default NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+
+CREATE TABLE `t2` (
+ `a` int(11) NOT NULL auto_increment,
+ `b` int(11) default NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+
+# testing multi_update::send_error() effective update
+insert into t1 values (1,1),(2,2);
+insert into t2 values (1,1),(4,4);
+
+connection master;
+--error ER_DUP_ENTRY_WITH_KEY_NAME
+UPDATE t2,t1 SET t2.a=t1.a+2;
+select * from t2 /* must be (3,1), (4,4) */;
+sync_slave_with_master;
+
+connection slave;
+select * from t2 /* must be (3,1), (4,4) */;
+
+connection master;
+drop table t1,t2;
+
+sync_slave_with_master;
--- 1.194/mysql-test/r/innodb.result 2007-06-02 17:47:40 +03:00
+++ 1.195/mysql-test/r/innodb.result 2007-06-04 15:02:37 +03:00
@@ -1086,6 +1086,39 @@ n d
1 30
2 20
drop table t1,t2;
+CREATE TABLE `t1` (
+`a` int(11) NOT NULL auto_increment,
+`b` int(11) default NULL,
+PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+CREATE TABLE `t2` (
+`a` int(11) NOT NULL auto_increment,
+`b` int(11) default NULL,
+PRIMARY KEY (`a`)
+) ENGINE=INNODB DEFAULT CHARSET=latin1 ;
+insert into t1 values (1,1),(2,2);
+insert into t2 values (1,1),(4,4);
+reset master;
+UPDATE t2,t1 SET t2.a=t1.a+2;
+ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
+select * from t2 /* must be (3,1), (4,4) */;
+a b
+1 1
+4 4
+show master status /* there must no UPDATE in binlog */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 106
+delete from t1;
+delete from t2;
+insert into t1 values (1,2),(3,4),(4,4);
+insert into t2 values (1,2),(3,4),(4,4);
+reset master;
+UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+show master status /* there must be no UPDATE query event */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 106
+drop table t1, t2;
create table t1 (a int, b int) engine=innodb;
insert into t1 values(20,null);
select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
@@ -1775,13 +1808,13 @@ Variable_name Value
Innodb_page_size 16384
show status like "Innodb_rows_deleted";
Variable_name Value
-Innodb_rows_deleted 2070
+Innodb_rows_deleted 2072
show status like "Innodb_rows_inserted";
Variable_name Value
-Innodb_rows_inserted 3083
+Innodb_rows_inserted 3088
show status like "Innodb_rows_updated";
Variable_name Value
-Innodb_rows_updated 886
+Innodb_rows_updated 888
show status like "Innodb_row_lock_waits";
Variable_name Value
Innodb_row_lock_waits 0
--- 1.163/mysql-test/t/innodb.test 2007-06-02 17:42:26 +03:00
+++ 1.164/mysql-test/t/innodb.test 2007-06-04 15:02:37 +03:00
@@ -774,7 +774,7 @@ CREATE TABLE `t2` (
insert into t1 values (1,1),(2,2);
insert into t2 values (1,1),(4,4);
reset master;
---error ER_DUP_ENTRY
+--error ER_DUP_ENTRY_WITH_KEY_NAME
UPDATE t2,t1 SET t2.a=t1.a+2;
# check
select * from t2 /* must be (3,1), (4,4) */;
@@ -786,7 +786,7 @@ delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
insert into t2 values (1,2),(3,4),(4,4);
reset master;
---error ER_DUP_ENTRY
+--error ER_DUP_ENTRY_WITH_KEY_NAME
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
show master status /* there must be no UPDATE query event */;
--- 1.48/mysql-test/r/multi_update.result 2007-06-02 17:56:36 +03:00
+++ 1.49/mysql-test/r/multi_update.result 2007-06-04 15:02:37 +03:00
@@ -614,27 +614,28 @@ CREATE TABLE `t2` (
`b` int(11) default NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
+set @@session.binlog_format= mixed;
insert into t1 values (1,1),(2,2);
insert into t2 values (1,1),(4,4);
reset master;
UPDATE t2,t1 SET t2.a=t1.a+2;
-ERROR 23000: Duplicate entry '3' for key 1
+ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
select * from t2 /* must be (3,1), (4,4) */;
a b
3 1
4 4
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 189
+master-bin.000001 197
delete from t1;
delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
insert into t2 values (1,2),(3,4),(4,4);
reset master;
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
-ERROR 23000: Duplicate entry '4' for key 1
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 204
+master-bin.000001 212
drop table t1, t2;
end of tests
--- 1.53/mysql-test/t/multi_update.test 2007-06-02 17:56:36 +03:00
+++ 1.54/mysql-test/t/multi_update.test 2007-06-04 15:02:37 +03:00
@@ -570,10 +570,10 @@ delete t1.*,t2.* from t1,t2 where t1.i2=
select * from t1 order by i1;
select * from t2 order by id;
drop table t1, t2;
+
#
# Bug#27716 multi-update did partially and has not binlogged
#
-
CREATE TABLE `t1` (
`a` int(11) NOT NULL auto_increment,
`b` int(11) default NULL,
@@ -586,23 +586,28 @@ CREATE TABLE `t2` (
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
-# A. testing multi_update::send_eof() execution branch
+# as the test is about to see erroed queries in binlog
+set @@session.binlog_format= mixed;
+
+
+# A. testing multi_update::send_error() effective update
insert into t1 values (1,1),(2,2);
insert into t2 values (1,1),(4,4);
reset master;
---error ER_DUP_ENTRY
+--error ER_DUP_ENTRY_WITH_KEY_NAME
UPDATE t2,t1 SET t2.a=t1.a+2;
# check
select * from t2 /* must be (3,1), (4,4) */;
show master status /* there must be the UPDATE query event */;
-# B. testing multi_update::send_error() execution branch
+# B. testing multi_update::send_error() ineffective update
+# (as there is a policy described at mysql_update() still go to binlog)
delete from t1;
delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
insert into t2 values (1,2),(3,4),(4,4);
reset master;
---error ER_DUP_ENTRY
+--error ER_DUP_ENTRY_WITH_KEY_NAME
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
show master status /* there must be the UPDATE query event */;
| Thread |
|---|
| • bk commit into 5.1 tree (aelkin:1.2537) BUG#27716 | Andrei Elkin | 4 Jun |