Bug #37137 | Func/proc calling func/proc written incorrectly to binlog | ||
---|---|---|---|
Submitted: | 2 Jun 2008 11:14 | Modified: | 29 Aug 2008 9:25 |
Reporter: | Sven Sandberg | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 5.1, 6.0 | OS: | Any |
Assigned to: | Zhenxing He | CPU Architecture: | Any |
Tags: | binlog, CALL, FUNCTION, PROCEDURE, RBR, recursive, table map, table_map_log_event, transaction |
[2 Jun 2008 11:14]
Sven Sandberg
[2 Jun 2008 19:13]
Sveta Smirnova
Thank you for the report. I see only master-bin.000001 1294 Query 1 1384 use `test`; SELECT `test`.`func_func`() master-bin.000001 1384 Query 1 1474 use `test`; SELECT `test`.`func_proc`() master-bin.000001 1474 Query 1 1562 use `test`; INSERT INTO t1 VALUES (5) master-bin.000001 1562 Query 1 1647 use `test`; SELECT `test`.`func`() master-bin.000001 1647 Query 1 1735 use `test`; INSERT INTO t1 VALUES (6) master-bin.000001 1735 Query 1 1823 use `test`; INSERT INTO t1 VALUES (1) in my environment. Do you use any options?
[4 Jun 2008 13:25]
Sven Sandberg
Right, I can only repeat with row-based logging. In statement mode, I can not repeat it. In mixed mode, it is repeatable if INSERT INTO t1 VALUES (<constant number>) is replaced by, e.g., INSERT INTO t1 VALUES (@@binlog_format) since that will turn on row-based logging.
[4 Jun 2008 20:36]
Sveta Smirnova
Thank you for the report. func_func, func_proc and proc_proc verified as described. With proc_func only 1 commit in my environment.
[22 Aug 2008 3:32]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/52275 2661 He Zhenxing 2008-08-22 BUG#37137 Func/proc calling func/proc written incorrectly to binlog In RBL, when a function calls other functions or procedures that modifies the same table, Table_map event of the same table was written several times. This patch fixed it by check if the Table_map event of given table map id has been written before and skip writeing Table_map event of current table map id if it has been written.
[29 Aug 2008 8:23]
Mats Kindahl
When executed on the master, the "CALL proc_proc()" statement will execute each statement individually, i.e., lock tables before each statement and unlock them after. In other words, the "CALL proc_proc()" statement does not behave as a transactional entity. Hence it is correct to log each statement as a separate group in the binary log, which means that 1 is expected behavior.
[29 Aug 2008 9:25]
Lars Thalmann
1 is not a bug. 2 is harmless. Closing bug as "won't fix".