Commit dbcfef4
Alfranio Correia
BUG#28976 Mixing trans and non-trans tables in one transaction results in incorrect
binlog
Mixing transactional (T) and non-transactional (N) tables on behalf of a
transaction may lead to inconsistencies among masters and slaves in STATEMENT
mode. The problem stems from the fact that although modifications done to
non-transactional tables on behalf of a transaction become immediately visible
to other connections they do not immediately get to the binary log and therefore
consistency is broken. Although there may be issues in mixing T and M tables in
STATEMENT mode, there are safe combinations that clients find useful.
In this bug, we fix the following issue. Mixing N and T tables in multi-level
(e.g. a statement that fires a trigger) or multi-table table statements (e.g.
update t1, t2...) were not handled correctly. In such cases, it was not possible
to distinguish when a T table was updated if the sequence of changes was N and T.
In a nutshell, just the flag "modified_non_trans_table" was not enough to reflect
that both a N and T tables were changed. To circumvent this issue, we check if an
engine is registered in the handler's list and changed something which means that
a T table was modified.
Check WL 2687 for a full-fledged patch that will make the use of either the MIXED or
ROW modes completely safe.1 parent 31afccc commit dbcfef4
File tree
9 files changed
+1642
-7
lines changed- mysql-test
- extra/rpl_tests
- include
- r
- suite
- binlog/r
- rpl
- r
- t
- sql
9 files changed
+1642
-7
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | | - | |
| 728 | + | |
729 | 729 | | |
730 | | - | |
| 730 | + | |
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
841 | 841 | | |
842 | 842 | | |
843 | 843 | | |
844 | | - | |
| 844 | + | |
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
848 | | - | |
| 848 | + | |
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
853 | | - | |
854 | | - | |
| 853 | + | |
| 854 | + | |
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
382 | 383 | | |
| 384 | + | |
383 | 385 | | |
384 | 386 | | |
385 | 387 | | |
| |||
838 | 840 | | |
839 | 841 | | |
840 | 842 | | |
| 843 | + | |
841 | 844 | | |
842 | 845 | | |
| 846 | + | |
843 | 847 | | |
844 | 848 | | |
845 | 849 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
349 | 350 | | |
| 351 | + | |
350 | 352 | | |
351 | 353 | | |
352 | 354 | | |
| |||
545 | 547 | | |
546 | 548 | | |
547 | 549 | | |
| 550 | + | |
548 | 551 | | |
549 | 552 | | |
| 553 | + | |
550 | 554 | | |
551 | 555 | | |
552 | 556 | | |
| |||
782 | 786 | | |
783 | 787 | | |
784 | 788 | | |
| 789 | + | |
785 | 790 | | |
786 | 791 | | |
| 792 | + | |
787 | 793 | | |
788 | 794 | | |
789 | 795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
963 | 963 | | |
964 | 964 | | |
965 | 965 | | |
| 966 | + | |
966 | 967 | | |
| 968 | + | |
967 | 969 | | |
968 | 970 | | |
969 | 971 | | |
| |||
0 commit comments