Commit cfeaa26
BUG#35998554: get_group_member_info_*() does not distinguish member not found from error
It was discovered that some methods from `Group_member_info_manager` class did return the same value for distinct situations, which could be masquerading errors. One case is ``` Group_member_info * Group_member_info_manager::get_group_member_info_by_member_id( const Gcs_member_identifier &id); ``` that does return a allocated copy of the `member_info` when the member exists on the `Group_member_info_manager`, or returns `nullprt` when the member does not exist. Though `nullptr` can also be returned when the memory allocation of the copy fails, which means that the method caller is unable to distinguish: * member not found; * no memory available to construct the object. On both situations the method caller will interpret `nullptr` as member not found which can leverage incorrect decisions. The same pattern exists on the methods: * Group_member_info_manager::get_group_member_info() * Group_member_info_manager::get_group_member_info_by_index() * Group_member_info_manager::get_group_member_info_by_member_id() * Group_member_info_manager::get_primary_member_info() To solve the above issue, the four methods were refactored to: 1) return a boolean value to state if the member was found; 2) receive a out parameter that is a local reference to the method caller that is updated when the member is found. The use of the reference eliminates the allocation of the memory. Change-Id: Ic10263943fc63f40cdda506a59f10962aa208d921 parent a32b194 commit cfeaa26
File tree
17 files changed
+413
-307
lines changed- plugin/group_replication
- include
- src
- group_actions
- perfschema
- plugin_handlers
- udf
- unittest/gunit/group_replication
17 files changed
+413
-307
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
256 | 265 | | |
257 | 266 | | |
258 | 267 | | |
| |||
274 | 283 | | |
275 | 284 | | |
276 | 285 | | |
277 | | - | |
278 | 286 | | |
279 | 287 | | |
280 | 288 | | |
281 | 289 | | |
282 | 290 | | |
283 | 291 | | |
| 292 | + | |
284 | 293 | | |
285 | 294 | | |
286 | 295 | | |
| |||
707 | 716 | | |
708 | 717 | | |
709 | 718 | | |
710 | | - | |
711 | | - | |
| 719 | + | |
| 720 | + | |
712 | 721 | | |
713 | 722 | | |
714 | 723 | | |
| |||
784 | 793 | | |
785 | 794 | | |
786 | 795 | | |
787 | | - | |
788 | | - | |
789 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
790 | 803 | | |
791 | | - | |
| 804 | + | |
| 805 | + | |
792 | 806 | | |
793 | 807 | | |
794 | 808 | | |
795 | 809 | | |
796 | 810 | | |
797 | 811 | | |
798 | | - | |
799 | | - | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
800 | 819 | | |
801 | | - | |
| 820 | + | |
| 821 | + | |
802 | 822 | | |
803 | 823 | | |
804 | 824 | | |
| |||
811 | 831 | | |
812 | 832 | | |
813 | 833 | | |
814 | | - | |
815 | | - | |
816 | | - | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
817 | 841 | | |
818 | | - | |
819 | | - | |
| 842 | + | |
| 843 | + | |
820 | 844 | | |
821 | 845 | | |
822 | 846 | | |
| |||
1003 | 1027 | | |
1004 | 1028 | | |
1005 | 1029 | | |
1006 | | - | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
1007 | 1033 | | |
1008 | | - | |
| 1034 | + | |
| 1035 | + | |
1009 | 1036 | | |
1010 | | - | |
| 1037 | + | |
| 1038 | + | |
1011 | 1039 | | |
1012 | 1040 | | |
1013 | 1041 | | |
| |||
1132 | 1160 | | |
1133 | 1161 | | |
1134 | 1162 | | |
1135 | | - | |
| 1163 | + | |
| 1164 | + | |
1136 | 1165 | | |
1137 | | - | |
| 1166 | + | |
| 1167 | + | |
1138 | 1168 | | |
1139 | 1169 | | |
1140 | 1170 | | |
1141 | | - | |
1142 | | - | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
1143 | 1174 | | |
1144 | 1175 | | |
1145 | 1176 | | |
| |||
1193 | 1224 | | |
1194 | 1225 | | |
1195 | 1226 | | |
1196 | | - | |
| 1227 | + | |
| 1228 | + | |
1197 | 1229 | | |
1198 | 1230 | | |
1199 | 1231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | | - | |
381 | | - | |
382 | | - | |
| 380 | + | |
| 381 | + | |
383 | 382 | | |
384 | | - | |
385 | | - | |
386 | | - | |
| 383 | + | |
387 | 384 | | |
388 | 385 | | |
389 | 386 | | |
| |||
662 | 659 | | |
663 | 660 | | |
664 | 661 | | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
670 | 673 | | |
671 | 674 | | |
672 | 675 | | |
673 | | - | |
| 676 | + | |
674 | 677 | | |
675 | | - | |
676 | | - | |
| 678 | + | |
| 679 | + | |
677 | 680 | | |
678 | 681 | | |
679 | | - | |
| 682 | + | |
680 | 683 | | |
681 | 684 | | |
682 | 685 | | |
683 | 686 | | |
684 | | - | |
| 687 | + | |
685 | 688 | | |
686 | | - | |
687 | | - | |
| 689 | + | |
| 690 | + | |
688 | 691 | | |
689 | 692 | | |
690 | 693 | | |
691 | | - | |
| 694 | + | |
692 | 695 | | |
693 | 696 | | |
694 | 697 | | |
695 | | - | |
696 | | - | |
697 | 698 | | |
698 | 699 | | |
699 | 700 | | |
| |||
790 | 791 | | |
791 | 792 | | |
792 | 793 | | |
793 | | - | |
794 | | - | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
795 | 798 | | |
796 | 799 | | |
797 | | - | |
| 800 | + | |
798 | 801 | | |
799 | | - | |
800 | | - | |
| 802 | + | |
801 | 803 | | |
802 | 804 | | |
803 | 805 | | |
804 | 806 | | |
805 | 807 | | |
806 | | - | |
807 | | - | |
| 808 | + | |
| 809 | + | |
808 | 810 | | |
809 | | - | |
810 | | - | |
| 811 | + | |
| 812 | + | |
811 | 813 | | |
812 | 814 | | |
813 | 815 | | |
814 | 816 | | |
815 | 817 | | |
816 | | - | |
817 | | - | |
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
| |||
1435 | 1435 | | |
1436 | 1436 | | |
1437 | 1437 | | |
1438 | | - | |
1439 | | - | |
1440 | | - | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
1441 | 1441 | | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
| 1442 | + | |
| 1443 | + | |
1445 | 1444 | | |
1446 | 1445 | | |
1447 | 1446 | | |
| |||
1690 | 1689 | | |
1691 | 1690 | | |
1692 | 1691 | | |
1693 | | - | |
1694 | | - | |
1695 | | - | |
1696 | | - | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
1697 | 1695 | | |
1698 | 1696 | | |
1699 | 1697 | | |
| |||
1704 | 1702 | | |
1705 | 1703 | | |
1706 | 1704 | | |
1707 | | - | |
| 1705 | + | |
1708 | 1706 | | |
1709 | | - | |
| 1707 | + | |
1710 | 1708 | | |
1711 | 1709 | | |
1712 | 1710 | | |
1713 | 1711 | | |
1714 | | - | |
| 1712 | + | |
1715 | 1713 | | |
1716 | 1714 | | |
1717 | | - | |
1718 | | - | |
1719 | 1715 | | |
1720 | 1716 | | |
1721 | 1717 | | |
| |||
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
| 56 | + | |
| 57 | + | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | | - | |
64 | | - | |
| 62 | + | |
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
| |||
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
89 | 89 | | |
90 | | - | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
0 commit comments