forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd5daae4
committed
Fix construction of updated-columns bitmap in logical replication.
Commitb9c130a failed to apply the publisher-to-subscriber columnmapping while checking which columns were updated. Perhaps lesssignificantly, it didn't exclude dropped columns either. This couldresult in an incorrect updated-columns bitmap and thus wrong decisionsabout whether to fire column-specific triggers on the subscriber whileapplying updates. In HEAD (since commit9de77b5), it could alsoresult in accesses off the end of the colstatus array, as detected bybuildfarm member skink. Fix the logic, and adjust 003_constraints.plso that the problem is exposed in unpatched code.In HEAD, also add some assertions to check that we don't access offthe ends of these newly variable-sized arrays.Back-patch to v10, asb9c130a was.Discussion:https://postgr.es/m/CAH2-Wz=79hKQ4++c5A060RYbjTHgiYTHz=fw6mptCtgghH2gJA@mail.gmail.com1 parentd98c08c commitd5daae4
File tree
4 files changed
+29
-9
lines changed- src
- backend/replication/logical
- include/replication
- test/subscription/t
4 files changed
+29
-9
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
548 | 548 |
| |
549 | 549 |
| |
550 | 550 |
| |
| 551 | + | |
551 | 552 |
| |
552 | 553 |
| |
553 | 554 |
| |
|
Lines changed: 15 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
354 | 354 |
| |
355 | 355 |
| |
356 | 356 |
| |
| 357 | + | |
| 358 | + | |
357 | 359 |
| |
358 | 360 |
| |
359 | 361 |
| |
| |||
477 | 479 |
| |
478 | 480 |
| |
479 | 481 |
| |
| 482 | + | |
| 483 | + | |
480 | 484 |
| |
481 | 485 |
| |
482 | 486 |
| |
| |||
831 | 835 |
| |
832 | 836 |
| |
833 | 837 |
| |
834 |
| - | |
835 |
| - | |
836 |
| - | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
837 | 849 |
| |
838 | 850 |
| |
839 | 851 |
| |
|
Lines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 |
| - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 |
| |
32 | 35 |
| |
33 | 36 |
| |
34 | 37 |
| |
35 | 38 |
| |
36 | 39 |
| |
| 40 | + | |
| 41 | + | |
37 | 42 |
| |
38 | 43 |
| |
39 | 44 |
| |
|
Lines changed: 7 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
22 |
| - | |
| 22 | + | |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
| 29 | + | |
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
| 45 | + | |
45 | 46 |
| |
46 |
| - | |
| 47 | + | |
| 48 | + | |
47 | 49 |
| |
48 | 50 |
| |
49 | 51 |
| |
| |||
128 | 130 |
| |
129 | 131 |
| |
130 | 132 |
| |
131 |
| - | |
| 133 | + | |
132 | 134 |
| |
133 | 135 |
| |
134 | 136 |
|
0 commit comments
Comments
(0)