MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:January 8 2007 10:52pm
Subject:bk commit into 5.1 tree (guilhem:1.2371) BUG#19725
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@stripped, 2007-01-08 23:52:21+01:00, guilhem@stripped +3 -0
  Manual merge of the fix for BUG#19725 "Calls to SF in other database are not replicated
  correctly in some cases", from 5.0.
  In short, calls to a stored function located in another database
  than the default database, may fail to replicate if the call was made
  by SET, SELECT, or DO.
  sp_head.cc automerged, only the test and test's result had to be hand-merged.

  mysql-test/r/rpl_sp.result@stripped, 2007-01-08 23:52:19+01:00, guilhem@stripped +153 -110
    manual merge of the result of the test for BUG#19725

  mysql-test/r/rpl_switch_stm_row_mixed.result@stripped, 2007-01-08 23:52:19+01:00, guilhem@stripped +8 -8
    the bugfix changes results as expected

  mysql-test/t/rpl_sp.test@stripped, 2007-01-08 23:52:19+01:00, guilhem@stripped +42 -11
    manual merge of the test for BUG#19725

# 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-rpl-19725

--- 1.31/mysql-test/r/rpl_sp.result	2007-01-08 23:52:28 +01:00
+++ 1.32/mysql-test/r/rpl_sp.result	2007-01-08 23:52:28 +01:00
@@ -269,6 +269,118 @@ insert into t1 values (1);
 select * from t1;
 a
 1
+select * from t1;
+a
+1
+create procedure foo()
+not deterministic
+reads sql data
+select * from t1;
+call foo();
+a
+1
+drop procedure foo;
+drop function fn1;
+drop database mysqltest1;
+drop user "zedjzlcsjhd"@127.0.0.1;
+use test;
+use test;
+drop function if exists f1;
+create function f1() returns int reads sql data
+begin
+declare var integer;
+declare c cursor for select a from v1;
+open c;
+fetch c into var;
+close c;
+return var;
+end|
+create view v1 as select 1 as a;
+create table t1 (a int);
+insert into t1 (a) values (f1());
+select * from t1;
+a
+1
+drop view v1;
+drop function f1;
+select * from t1;
+a
+1
+DROP PROCEDURE IF EXISTS p1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(col VARCHAR(10));
+CREATE PROCEDURE p1(arg VARCHAR(10))
+INSERT INTO t1 VALUES(arg);
+CALL p1('test');
+SELECT * FROM t1;
+col
+test
+SELECT * FROM t1;
+col
+test
+DROP PROCEDURE p1;
+
+---> Test for BUG#20438
+
+---> Preparing environment...
+---> connection: master
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+
+---> Synchronizing slave with master...
+
+---> connection: master
+
+---> Creating procedure...
+/*!50003 CREATE PROCEDURE p1() SET @a = 1 */;
+/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */;
+
+---> Checking on master...
+SHOW CREATE PROCEDURE p1;
+Procedure	sql_mode	Create Procedure
+p1		CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SET @a = 1
+SHOW CREATE FUNCTION f1;
+Function	sql_mode	Create Function
+f1		CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+RETURN 0
+
+---> Synchronizing slave with master...
+---> connection: master
+
+---> Checking on slave...
+SHOW CREATE PROCEDURE p1;
+Procedure	sql_mode	Create Procedure
+p1		CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SET @a = 1
+SHOW CREATE FUNCTION f1;
+Function	sql_mode	Create Function
+f1		CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
+RETURN 0
+
+---> connection: master
+
+---> Cleaning up...
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+drop table t1;
+drop database if exists mysqltest;
+drop database if exists mysqltest2;
+create database mysqltest;
+create database mysqltest2;
+use mysqltest2;
+create table t ( t integer );
+create procedure mysqltest.test() begin end;
+insert into t values ( 1 );
+create procedure `\\`.test() begin end;
+ERROR 42000: Unknown database '\\'
+create function f1 () returns int
+begin
+insert into t values (1);
+return 0;
+end|
+use mysqltest;
+set @a:= mysqltest2.f1();
 show binlog events in 'master-bin.000001' from 102;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	1	#	drop database if exists mysqltest1
@@ -329,7 +441,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`; SELECT `fn1`(20)
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `mysqltest1`.`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 DEFINER=`root`@`localhost` function fn1()
@@ -362,32 +474,23 @@ begin
 insert into t2 values(x),(x);
 return 10;
 end
-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`; SELECT `mysqltest1`.`fn1`(100)
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `mysqltest1`.`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)
 master-bin.000001	#	Query	1	#	use `mysqltest1`; delete from t1
 master-bin.000001	#	Query	1	#	use `mysqltest1`; drop trigger trg
 master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values (1)
-select * from t1;
-a
-1
-create procedure foo()
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo()
 not deterministic
 reads sql data
-select * from t1;
-call foo();
-a
-1
-drop procedure foo;
-drop function fn1;
-drop database mysqltest1;
-drop user "zedjzlcsjhd"@127.0.0.1;
-use test;
-use test;
-drop function if exists f1;
-create function f1() returns int reads sql data
+select * from t1
+master-bin.000001	#	Query	1	#	use `mysqltest1`; drop procedure foo
+master-bin.000001	#	Query	1	#	use `mysqltest1`; drop function fn1
+master-bin.000001	#	Query	1	#	drop database mysqltest1
+master-bin.000001	#	Query	1	#	drop user "zedjzlcsjhd"@127.0.0.1
+master-bin.000001	#	Query	1	#	use `test`; CREATE DEFINER=`root`@`localhost` function f1() returns int reads sql data
 begin
 declare var integer;
 declare c cursor for select a from v1;
@@ -395,99 +498,39 @@ open c;
 fetch c into var;
 close c;
 return var;
-end|
-create view v1 as select 1 as a;
-create table t1 (a int);
-insert into t1 (a) values (f1());
-select * from t1;
-a
-1
-drop view v1;
-drop function f1;
-select * from t1;
-a
-1
-DROP PROCEDURE IF EXISTS p1;
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1(col VARCHAR(10));
-CREATE PROCEDURE p1(arg VARCHAR(10))
-INSERT INTO t1 VALUES(arg);
-CALL p1('test');
-SELECT * FROM t1;
-col
-test
-SELECT * FROM t1;
-col
-test
-DROP PROCEDURE p1;
-
----> Test for BUG#20438
-
----> Preparing environment...
----> connection: master
-DROP PROCEDURE IF EXISTS p1;
-DROP FUNCTION IF EXISTS f1;
-
----> Synchronizing slave with master...
-
----> connection: master
-
----> Creating procedure...
-/*!50003 CREATE PROCEDURE p1() SET @a = 1 */;
-/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */;
-
----> Checking on master...
-SHOW CREATE PROCEDURE p1;
-Procedure	sql_mode	Create Procedure
-p1		CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
-SET @a = 1
-SHOW CREATE FUNCTION f1;
-Function	sql_mode	Create Function
-f1		CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
-RETURN 0
-
----> Synchronizing slave with master...
----> connection: master
-
----> Checking on slave...
-SHOW CREATE PROCEDURE p1;
-Procedure	sql_mode	Create Procedure
-p1		CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
-SET @a = 1
-SHOW CREATE FUNCTION f1;
-Function	sql_mode	Create Function
-f1		CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
-RETURN 0
-
----> connection: master
-
----> Cleaning up...
-DROP PROCEDURE p1;
-DROP FUNCTION f1;
-drop table t1;
+end
+master-bin.000001	#	Query	1	#	use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 as a
+master-bin.000001	#	Query	1	#	use `test`; create table t1 (a int)
+master-bin.000001	#	Query	1	#	use `test`; insert into t1 (a) values (f1())
+master-bin.000001	#	Query	1	#	use `test`; drop view v1
+master-bin.000001	#	Query	1	#	use `test`; drop function f1
+master-bin.000001	#	Query	1	#	use `test`; DROP TABLE IF EXISTS t1
+master-bin.000001	#	Query	1	#	use `test`; CREATE TABLE t1(col VARCHAR(10))
+master-bin.000001	#	Query	1	#	use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE p1(arg VARCHAR(10))
+INSERT INTO t1 VALUES(arg)
+master-bin.000001	#	Query	1	#	use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test'))
+master-bin.000001	#	Query	1	#	use `test`; DROP PROCEDURE p1
+master-bin.000001	#	Query	1	#	use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE p1() SET @a = 1
+master-bin.000001	#	Query	1	#	use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION f1() RETURNS INT RETURN 0
+master-bin.000001	#	Query	1	#	use `test`; DROP PROCEDURE p1
+master-bin.000001	#	Query	1	#	use `test`; DROP FUNCTION f1
+master-bin.000001	#	Query	1	#	use `test`; drop table t1
+master-bin.000001	#	Query	1	#	drop database if exists mysqltest
+master-bin.000001	#	Query	1	#	drop database if exists mysqltest2
+master-bin.000001	#	Query	1	#	create database mysqltest
+master-bin.000001	#	Query	1	#	create database mysqltest2
+master-bin.000001	#	Query	1	#	use `mysqltest2`; create table t ( t integer )
+master-bin.000001	#	Query	1	#	use `mysqltest2`; CREATE DEFINER=`root`@`localhost` procedure mysqltest.test() begin end
+master-bin.000001	#	Query	1	#	use `mysqltest2`; insert into t values ( 1 )
+master-bin.000001	#	Query	1	#	use `mysqltest2`; CREATE DEFINER=`root`@`localhost` function f1 () returns int
+begin
+insert into t values (1);
+return 0;
+end
+master-bin.000001	#	Query	1	#	use `mysqltest`; SELECT `mysqltest2`.`f1`()
 set global log_bin_trust_function_creators=0;
 set global log_bin_trust_function_creators=0;
-End of 5.0 tests
-reset master;
-drop database if exists mysqltest;
-drop database if exists mysqltest2;
-create database mysqltest;
-create database mysqltest2;
-use mysqltest2;
-create table t ( t integer );
-create procedure mysqltest.test() begin end;
-insert into t values ( 1 );
-show binlog events in 'master-bin.000001' from 102;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	102	Query	1	203	drop database if exists mysqltest
-master-bin.000001	203	Query	1	306	drop database if exists mysqltest2
-master-bin.000001	306	Query	1	399	create database mysqltest
-master-bin.000001	399	Query	1	494	create database mysqltest2
-master-bin.000001	494	Query	1	591	use `mysqltest2`; create table t ( t integer )
-master-bin.000001	591	Query	1	730	use `mysqltest2`; CREATE DEFINER=`root`@`localhost` procedure mysqltest.test() begin end
-master-bin.000001	730	Query	1	825	use `mysqltest2`; insert into t values ( 1 )
-create procedure `\\`.test() begin end;
-ERROR 42000: Unknown database '\\'
 drop database mysqltest;
 drop database mysqltest2;
+End of 5.0 tests
 End of 5.1 tests

--- 1.28/mysql-test/t/rpl_sp.test	2007-01-08 23:52:28 +01:00
+++ 1.29/mysql-test/t/rpl_sp.test	2007-01-08 23:52:28 +01:00
@@ -343,13 +343,13 @@ delete from t1;
 drop trigger trg;
 insert into t1 values (1);
 select * from t1;
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
-show binlog events in 'master-bin.000001' from 102;
 sync_slave_with_master;
 select * from t1;
 
 
+# ********************** PART 4 : RELATED FIXED BUGS ***************
+
+
 #
 # Test for bug #13969 "Routines which are replicated from master can't be
 # executed on slave".
@@ -522,17 +522,11 @@ connection master;
 drop table t1;
 sync_slave_with_master;
 
-# Restore log_bin_trust_function_creators to original value
-set global log_bin_trust_function_creators=0;
-connection master;
-set global log_bin_trust_function_creators=0;
---echo End of 5.0 tests
-
 #
 # Bug22043: MySQL don't add "USE <DATABASE>" before "DROP PROCEDURE IF EXISTS"
 #
+
 connection master;
-reset master;
 --disable_warnings
 drop database if exists mysqltest;
 drop database if exists mysqltest2;
@@ -543,12 +537,49 @@ use mysqltest2;
 create table t ( t integer );
 create procedure mysqltest.test() begin end;
 insert into t values ( 1 );
-show binlog events in 'master-bin.000001' from 102;
 --error ER_BAD_DB_ERROR
 create procedure `\\`.test() begin end;
+
+#
+# BUG#19725: Calls to stored function in other database are not
+# replicated correctly in some cases
+#
+
+connection master;
+delimiter |;
+create function f1 () returns int
+begin
+  insert into t values (1);
+  return 0;
+end|
+delimiter ;|
+sync_slave_with_master;
+# Let us test if we don't forget to binlog the function's database
+connection master;
+use mysqltest;
+set @a:= mysqltest2.f1();
+sync_slave_with_master;
+connection master;
+
+
+# Final inspection which verifies how all statements of this test file
+# were written to the binary log.
+--replace_column 2 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/
+show binlog events in 'master-bin.000001' from 102;
+
+
+# Restore log_bin_trust_function_creators to its original value.
+# This is a cleanup for all parts above where we tested stored
+# functions and triggers.
+set global log_bin_trust_function_creators=0;
+connection master;
+set global log_bin_trust_function_creators=0;
+
 # Clean up
 drop database mysqltest;
 drop database mysqltest2;
 
+--echo End of 5.0 tests
 --echo End of 5.1 tests
 

--- 1.15/mysql-test/r/rpl_switch_stm_row_mixed.result	2007-01-08 23:52:28 +01:00
+++ 1.16/mysql-test/r/rpl_switch_stm_row_mixed.result	2007-01-08 23:52:28 +01:00
@@ -559,7 +559,7 @@ begin
 insert into t2 select x;
 return 100;
 end
-master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `foo6`(_latin1'foo6_1_')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_')
 master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
 master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
@@ -620,7 +620,7 @@ master-bin.000001	#	Query	1	#	use `mysql
 master-bin.000001	#	Query	1	#	use `mysqltest1`; drop table t1
 master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t1 (a int, b varchar(100), key(a))
 master-bin.000001	#	Intvar	1	#	INSERT_ID=4
-master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `f`(_latin1'try_45_')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_')
 master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t13 select * from t1
 master-bin.000001	#	Query	1	#	use `mysqltest1`; drop table t1
 master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
@@ -660,9 +660,9 @@ set y = (select count(*) from t2);
 return y;
 end
 master-bin.000001	#	Intvar	1	#	INSERT_ID=4
-master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `f1`(_latin1'try_53_')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_')
 master-bin.000001	#	Intvar	1	#	INSERT_ID=5
-master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `f2`(_latin1'try_54_')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_')
 master-bin.000001	#	Query	1	#	use `mysqltest1`; drop function f2
 master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row
 begin
@@ -869,7 +869,7 @@ begin
 insert into t2 select x;
 return 100;
 end
-master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `foo6`(_latin1'foo6_1_')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_')
 master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
 master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
@@ -930,7 +930,7 @@ master-bin.000001	#	Query	1	#	use `mysql
 master-bin.000001	#	Query	1	#	use `mysqltest1`; drop table t1
 master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t1 (a int, b varchar(100), key(a))
 master-bin.000001	#	Intvar	1	#	INSERT_ID=4
-master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `f`(_latin1'try_45_')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_')
 master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t13 select * from t1
 master-bin.000001	#	Query	1	#	use `mysqltest1`; drop table t1
 master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
@@ -970,9 +970,9 @@ set y = (select count(*) from t2);
 return y;
 end
 master-bin.000001	#	Intvar	1	#	INSERT_ID=4
-master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `f1`(_latin1'try_53_')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_')
 master-bin.000001	#	Intvar	1	#	INSERT_ID=5
-master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `f2`(_latin1'try_54_')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_')
 master-bin.000001	#	Query	1	#	use `mysqltest1`; drop function f2
 master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row
 begin
Thread
bk commit into 5.1 tree (guilhem:1.2371) BUG#19725Guilhem Bichot8 Jan