[MDEV-8432] [PATCH] Slave cannot replicate signed integer-type values with high bit set to 1 Created: 2015-07-06 Updated: 2019-08-23 Resolved: 2015-07-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Delete, Data Manipulation - Update, Replication |
| Affects Version/s: | 10.0.20 |
| Fix Version/s: | 5.5.45 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Michael Widenius |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | replication | ||
| Description |
|
Let's create a simple table on our master server:
And then we can insert some data. To reproduce this issue, we need to make sure that the most significant bit of one of the integer values is '1':
Now let's change the 'id' column to 'bigint' on the slave:
We also need to set slave_type_conversions to ALL_NON_LOSSY to make this work:
Now back on the master, let's try to update these rows:
Now what data do we see on the slave:
The row with 'id' value 4294967295 created an error on the slave:
The slave seems to want to interpret the id value in the Update_rows_v1 event as a negative integer, since the most significant bit is 1. The master in this case is MySQL 5.5, if that makes a difference. |
| Comments |
| Comment by Geoff Montee (Inactive) [ 2015-07-06 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This also affects Delete_rows_v1 events. On master:
On slave:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2015-07-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Apparently it doesn't matter if the column is signed or unsigned on the slave. Either way, it fails. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kolbe Kegel (Inactive) [ 2015-07-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This behavior also exists in MySQL 5.6. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kolbe Kegel (Inactive) [ 2015-07-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kolbe Kegel (Inactive) [ 2015-07-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Perhaps what is needed is a backport of the ALL_SIGNED and ALL_UNSIGNED options for slave_type_conversions from MySQL 5.6? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kolbe Kegel (Inactive) [ 2015-07-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
http://dev.mysql.com/doc/refman/5.6/en/replication-features-differing-tables.html#replication-features-attribute-promotion tells us "Neither ALL_SIGNED nor ALL_UNSIGNED has any effect if at least one of ALL_LOSSY or ALL_NONLOSSY is not also used."
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2015-07-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Pull requests are available for MariaDB 10.0 and 10.1 that add ALL_SIGNED and ALL_UNSIGNED to slave_type_conversions: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-07-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Patches: I've set the Fix version to 10.1 because I doubt it can be added to a post-GA version, but the final decision will not be mine. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2015-07-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have now created a fix for the replication break problem for next I did not use the solution used by MySQL 5.6 as suggested by This because:
Instead I am using the following approach:
Replication already assumes that the above is always true for integer This means that one can safely change a column on the slave from an | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2015-07-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Fix pushed to 5.5 tree | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2019-08-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I trashed the branch that contained my original commit for this, so if we ever decide to port the ALL_SIGNED and ALL_UNSIGNED options for slave_type_conversions from MySQL 5.6, then here is the diff from that commit:
|