Commit 16bc3763 authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/mysql_src/mysql-5.0

into  mysql.com:/home/mysql_src/mysql-5.1-new; will fix manually sp_head.cc and mysqld.cc later soon.


mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  Auto merged
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
  Auto merged
mysql-test/r/rpl_sp.result:
  Auto merged
mysql-test/r/sql_mode.result:
  Auto merged
mysql-test/t/rpl_sp-slave.opt:
  Auto merged
mysql-test/t/rpl_sp.test:
  Auto merged
mysql-test/t/sql_mode.test:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/log.cc:
  auto merged
sql/mysqld.cc:
  will fix manually
sql/sp_head.cc:
  will fix manually
parents 309f51cd 8dc567db
Loading
Loading
Loading
Loading
+32 −1
Original line number Diff line number Diff line
@@ -250,5 +250,36 @@ show binlog events from 102;
do release_lock("lock1");
drop table t0,t2;


# End of 4.1 tests

# Test for BUG#16559 (ROLLBACK should always have a zero error code in
# binlog). Has to be here and not earlier, as the SELECTs influence
# XIDs differently between normal and ps-protocol (and SHOW BINLOG
# EVENTS above read XIDs).

connect (con4,localhost,root,,);
connection con3;
reset master;
create table t1 (a int) engine=innodb;
create table t2 (a int) engine=myisam;
select get_lock("a",10);
begin;
insert into t1 values(8);
insert into t2 select * from t1;
disconnect con3;

connection con4;
select get_lock("a",10); # wait for rollback to finish

# we check that the error code of the "ROLLBACK" event is 0 and not
# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
# and does not make slave to stop)
--exec $MYSQL_BINLOG --start-position=547 $MYSQL_TEST_DIR/var/log/master-bin.000001 > var/tmp/mix_innodb_myisam_binlog.output
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval select
(@a:=load_file("$MYSQL_TEST_DIR/var/tmp/mix_innodb_myisam_binlog.output"))
is not null;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval select
@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%",
@a not like "%#%error_code=%error_code=%";
+23 −0
Original line number Diff line number Diff line
@@ -256,3 +256,26 @@ master-bin.000001 1654 Query 1 # use `test`; create table t2 (n int) engine=inno
master-bin.000001	1754	Query	1	#	use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
do release_lock("lock1");
drop table t0,t2;
reset master;
create table t1 (a int) engine=innodb;
create table t2 (a int) engine=myisam;
select get_lock("a",10);
get_lock("a",10)
1
begin;
insert into t1 values(8);
insert into t2 select * from t1;
select get_lock("a",10);
get_lock("a",10)
1
select
(@a:=load_file("MYSQL_TEST_DIR/var/tmp/mix_innodb_myisam_binlog.output"))
is not null;
(@a:=load_file("MYSQL_TEST_DIR/var/tmp/mix_innodb_myisam_binlog.output"))
is not null
1
select
@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%",
@a not like "%#%error_code=%error_code=%";
@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%"	@a not like "%#%error_code=%error_code=%"
1	1
+13 −8
Original line number Diff line number Diff line
@@ -233,20 +233,25 @@ end @ # #
delete from t2;
alter table t2 add unique (a);
drop function fn1;
create function fn1()
create function fn1(x int)
returns int
begin
insert into t2 values(20),(20);
insert into t2 values(x),(x);
return 10;
end|
select fn1();
do fn1(100);
Warnings:
Error	1062	Duplicate entry '100' for key 1
select fn1(20);
ERROR 23000: Duplicate entry '20' for key 1
select * from t2;
a
20
100
select * from t2;
a
20
100
create trigger trg before insert on t1 for each row set new.a= 10;
ERROR 42000: Access denied; you need the SUPER privilege for this operation
delete from t1;
@@ -324,7 +329,7 @@ insert into t1 values (x);
return x+2;
end
master-bin.000001	#	Query	1	#	use `mysqltest1`; delete t1,t2 from t1,t2
master-bin.000001	#	Query	1	#	use `mysqltest1`; DO `fn1`(20)
master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `fn1`(20)
master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t2 values(fn1(21))
master-bin.000001	#	Query	1	#	use `mysqltest1`; drop function fn1
master-bin.000001	#	Query	1	#	use `mysqltest1`; create function fn1()
@@ -351,13 +356,14 @@ end
master-bin.000001	#	Query	1	#	use `mysqltest1`; delete from t2
master-bin.000001	#	Query	1	#	use `mysqltest1`; alter table t2 add unique (a)
master-bin.000001	#	Query	1	#	use `mysqltest1`; drop function fn1
master-bin.000001	#	Query	1	#	use `mysqltest1`; create function fn1()
master-bin.000001	#	Query	1	#	use `mysqltest1`; create function fn1(x int)
returns int
begin
insert into t2 values(20),(20);
insert into t2 values(x),(x);
return 10;
end
master-bin.000001	#	Query	1	#	use `mysqltest1`; DO `fn1`()
master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `fn1`(100)
master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `fn1`(20)
master-bin.000001	#	Query	1	#	use `mysqltest1`; delete from t1
master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values (1)
@@ -415,4 +421,3 @@ col
test
DROP PROCEDURE p1;
drop table t1;
reset master;
+16 −0
Original line number Diff line number Diff line
@@ -460,4 +460,20 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER="root"@"localhost" SQL SECURITY DEFINER VI
create view v2 as select a from t2 where a in (select a from v1);
drop view v2, v1;
drop table t1, t2;
select @@sql_mode;
@@sql_mode
ANSI_QUOTES
set sql_mode=2097152;
select @@sql_mode;
@@sql_mode
STRICT_TRANS_TABLES
set sql_mode=16384+(65536*4);
select @@sql_mode;
@@sql_mode
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_TABLE_OPTIONS,ANSI
set sql_mode=2147483648;
ERROR 42000: Variable 'sql_mode' can't be set to the value of '2147483648'
select @@sql_mode;
@@sql_mode
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_TABLE_OPTIONS,ANSI
SET @@SQL_MODE=@OLD_SQL_MODE;
+1 −1
Original line number Diff line number Diff line
--log_bin_trust_routine_creators=0 --slave-skip-errors=1062
--log_bin_trust_routine_creators=0
Loading