Loading mysql-test/r/rpl_sp.result +25 −0 Original line number Diff line number Diff line Loading @@ -375,3 +375,28 @@ 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 table t1; reset master; mysql-test/t/rpl_sp.test +36 −0 Original line number Diff line number Diff line Loading @@ -360,4 +360,40 @@ connection master; drop function fn1; drop database mysqltest1; drop user "zedjzlcsjhd"@127.0.0.1; use test; sync_slave_with_master; use test; # # Bug#14077 "Failure to replicate a stored function with a cursor": # verify that stored routines with cursors work on slave. # connection master; --disable_warnings drop function if exists f1; --enable_warnings delimiter |; 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| delimiter ;| create view v1 as select 1 as a; create table t1 (a int); insert into t1 (a) values (f1()); select * from t1; drop view v1; drop function f1; sync_slave_with_master; connection slave; select * from t1; # cleanup connection master; drop table t1; reset master; sql/sql_parse.cc +0 −12 Original line number Diff line number Diff line Loading @@ -2403,18 +2403,6 @@ mysql_execute_command(THD *thd) reset_one_shot_variables(thd); DBUG_RETURN(0); } #ifndef TO_BE_DELETED /* This is a workaround to deal with the shortcoming in 3.23.44-3.23.46 masters in RELEASE_LOCK() logging. We re-write SELECT RELEASE_LOCK() as DO RELEASE_LOCK() */ if (lex->sql_command == SQLCOM_SELECT) { lex->sql_command = SQLCOM_DO; lex->insert_list = &select_lex->item_list; } #endif } else #endif /* HAVE_REPLICATION */ Loading Loading
mysql-test/r/rpl_sp.result +25 −0 Original line number Diff line number Diff line Loading @@ -375,3 +375,28 @@ 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 table t1; reset master;
mysql-test/t/rpl_sp.test +36 −0 Original line number Diff line number Diff line Loading @@ -360,4 +360,40 @@ connection master; drop function fn1; drop database mysqltest1; drop user "zedjzlcsjhd"@127.0.0.1; use test; sync_slave_with_master; use test; # # Bug#14077 "Failure to replicate a stored function with a cursor": # verify that stored routines with cursors work on slave. # connection master; --disable_warnings drop function if exists f1; --enable_warnings delimiter |; 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| delimiter ;| create view v1 as select 1 as a; create table t1 (a int); insert into t1 (a) values (f1()); select * from t1; drop view v1; drop function f1; sync_slave_with_master; connection slave; select * from t1; # cleanup connection master; drop table t1; reset master;
sql/sql_parse.cc +0 −12 Original line number Diff line number Diff line Loading @@ -2403,18 +2403,6 @@ mysql_execute_command(THD *thd) reset_one_shot_variables(thd); DBUG_RETURN(0); } #ifndef TO_BE_DELETED /* This is a workaround to deal with the shortcoming in 3.23.44-3.23.46 masters in RELEASE_LOCK() logging. We re-write SELECT RELEASE_LOCK() as DO RELEASE_LOCK() */ if (lex->sql_command == SQLCOM_SELECT) { lex->sql_command = SQLCOM_DO; lex->insert_list = &select_lex->item_list; } #endif } else #endif /* HAVE_REPLICATION */ Loading