[MDEV-18466] Unsafe to log updates on tables referenced by foreign keys with triggers in statement format Created: 2019-02-04 Updated: 2019-03-27 Resolved: 2019-03-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.0, 10.1, 10.1.36, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.2.24, 10.1.39, 10.3.14, 10.4.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Martin Reissner | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian GNU/Linux 9.7 (stretch) using Mariadb packages from Debian and from Mariadb repository |
||
| Attachments: |
|
| Description |
|
After updating our Debian servers from 10.1.26 to 10.1.37 from the Debian Stable repos I noticed that some simple UPDATE statements suddenly caused issues by either triggering a warning when using binlog_format=statement or by being logged in row format when using binlog_format=mixed or row. I investigated a bit and it showed that this behaviour started in 10.1.36 and is still prevalent in 10.3 and I found nothing in the changelogs so I decided to report it. I have attached a simple testcase that when run with binlogs enabled and everything else default on a 10.1 instance < 10.1.36 will run without issues but from 10.1.36 on will trigger the warning:
It seems to boil down to the triggers/actions in the foreign key constraints referencing the updated table. When those are not there no warning is triggered and I can't see why this query might actually be unsafe to be logged in statement format as the actual foreign key column is not touched. |
| Comments |
| Comment by Elena Stepanova [ 2019-02-06 ] | |||||||
|
Thanks for the test case.
I can't tell from the commit message or added test cases whether the effect on statement binary logging was intentional, so assigning to serg to clarify. | |||||||
| Comment by Martin Reissner [ 2019-03-18 ] | |||||||
|
I don't want to rush anything or anybody, I'm just commenting to state that this is still an issue for us. We're still stuck with 10.1.26-0+deb9u1 and this also makes dist-upgrades of old Debian 8 servers difficult as upgrading to Debian 9 usually brings the latest Mariadb version which we have to downgrade to 10.1.26 before we can use it. |