table_id is defined differently in sql/table.h vs sql/log_event.h

Bug #1289754 reported by Sergei Glushchenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Invalid
Undecided
Unassigned
5.1
Won't Fix
Undecided
Unassigned
5.5
Fix Committed
Medium
Sergei Glushchenko
5.6
Invalid
Undecided
Unassigned

Bug Description

Description:
Binary log structure assumes that table_id in the event can be ulong, while the value is then assigned to table_id filed in TABLE structure that is defined as uint. This can cause overflow and problems during replication (events are not applied to correct table).

See https://bugs.launchpad.net/percona-server/+bug/1070255 for more details on when overflow can happen and real impact for replication.

How to repeat:
Just do code review.

[openxs@chief mysql-5.6]$ grep -n 'table_id;' sql/table.h
1569: uint table_id; /* table id (from binlog) for opened table */
[openxs@chief mysql-5.6]$ grep -n 'table_id;' sql/log_event.h
3794: ulong get_table_id() const { return m_table_id; }
3859: ulong m_table_id;
3983: ulong get_table_id() const { return m_table_id; }
4078: ulong m_table_id; /* Table ID */

See http://bugs.mysql.com/bug.php?id=67352 for details.

We need back port the fix to PS 5.5

Tags: upstream
tags: added: upstream
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.