| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# Test that aliases of variables in binary log aren't ignored with NAME_CONST. |
| 4 |
# |
| 5 |
# ==== Method ==== |
| 6 |
# |
| 7 |
# Create a procedure with aliases of variables, then replicate it to slave. |
| 8 |
# BUG#35515 Aliases of variables in binary log are ignored with NAME_CONST. |
| 9 |
# |
| 10 |
--source include/not_group_replication_plugin.inc |
| 11 |
source include/set_privilege_checks_user_as_system_user.inc; |
| 12 |
source include/master-slave.inc; |
| 13 |
|
| 14 |
--echo ==== Initialize ==== |
| 15 |
|
| 16 |
--echo [on master] |
| 17 |
--connection master |
| 18 |
|
| 19 |
create table t1 (id int); |
| 20 |
|
| 21 |
--echo ==== create a procedure that has a column aliase in a subquery ==== |
| 22 |
--disable_warnings |
| 23 |
drop procedure if exists test_procedure; |
| 24 |
--enable_warnings |
| 25 |
delimiter $$; |
| 26 |
create procedure test_procedure(_id int) |
| 27 |
begin |
| 28 |
insert into t1 (id) |
| 29 |
select a.id |
| 30 |
from |
| 31 |
( select _id as id ) a; |
| 32 |
end;$$ |
| 33 |
delimiter ;$$ |
| 34 |
|
| 35 |
--echo ==== enable the binary log, then call the procedure ==== |
| 36 |
call test_procedure(1234); |
| 37 |
|
| 38 |
|
| 39 |
--echo [on slave] |
| 40 |
--source include/sync_slave_sql_with_master.inc |
| 41 |
select * from t1 order by id; |
| 42 |
|
| 43 |
--echo ==== Clean up ==== |
| 44 |
|
| 45 |
--echo [on master] |
| 46 |
connection master; |
| 47 |
drop table t1; |
| 48 |
drop procedure test_procedure; |
| 49 |
--source include/rpl_end.inc |