Tag Archives: mysql

MySQL 5.6 chained replication stored procedure bug

mysql1 -> mysql2 -> mysql3 -> mysql4 How to replicate the issue: (1) create a stored procedure, that accepts parameter,

create procedure tellme( IN name varchar(128), address varchar(128))
BEGIN
SET @localname=name, @localaddress=address;
...
END
(2) call the procedure on mysql1 many times and sometimes you get the jackpot, that @localname and @localaddress are getting NULL value. Let’s look at the binlog: (1) When replication works well, you should see something like this:
# at 1058556811
#130509 14:13:03 server id 111  end_log_pos 1058556904  User_var
SET @`localname`:=_utf8 0x4334..D31394434 COLLATE `utf8_unicode_ci`/*!*/;

# at 1058556904
#130509 14:13:03 server id 111  end_log_pos 1058556973  User_var
SET @`localaddress`:=_utf8 0x726...656E69 COLLATE `utf8_general_ci`/*!*/;
(2) When replication is broken, you see those SET missing. If the columns only accept not null value, then replication will stop. Avoid using local variable until next fix, use parameter directly.]]>

Tagged , , , ,