|
1 | 1 | /* Copyright (c) 2013, Kristian Nielsen and MariaDB Services Ab.
|
2 |
| - Copyright (c) 2020, MariaDB Corporation. |
| 2 | + Copyright (c) 2020, 2022, MariaDB Corporation. |
3 | 3 |
|
4 | 4 | This program is free software; you can redistribute it and/or modify
|
5 | 5 | it under the terms of the GNU General Public License as published by
|
@@ -3603,41 +3603,34 @@ int Id_delegating_gtid_event_filter<T>::set_id_restrictions(
|
3603 | 3603 |
|
3604 | 3604 | size_t id_ctr;
|
3605 | 3605 | int err;
|
3606 |
| - Gtid_event_filter::gtid_event_filter_type filter_type; |
3607 | 3606 | const char *filter_name, *opposite_filter_name;
|
3608 | 3607 | Gtid_event_filter *(*construct_filter)(void);
|
3609 | 3608 | Gtid_event_filter *(*construct_default_filter)(void);
|
3610 | 3609 |
|
3611 |
| - DBUG_ASSERT(mode > id_restriction_mode::MODE_NOT_SET); |
3612 |
| - |
3613 | 3610 | /*
|
3614 | 3611 | Set up variables which help this filter either be in whitelist or blacklist
|
3615 | 3612 | mode
|
3616 | 3613 | */
|
3617 | 3614 | if (mode == Gtid_event_filter::id_restriction_mode::WHITELIST_MODE)
|
3618 | 3615 | {
|
3619 |
| - filter_type= Gtid_event_filter::ACCEPT_ALL_GTID_FILTER_TYPE; |
3620 | 3616 | filter_name= WHITELIST_NAME;
|
3621 | 3617 | opposite_filter_name= BLACKLIST_NAME;
|
3622 | 3618 | construct_filter=
|
3623 | 3619 | create_event_filter<Accept_all_gtid_filter>;
|
3624 | 3620 | construct_default_filter=
|
3625 | 3621 | create_event_filter<Reject_all_gtid_filter>;
|
3626 | 3622 | }
|
3627 |
| - else if (mode == Gtid_event_filter::id_restriction_mode::BLACKLIST_MODE) |
| 3623 | + else |
3628 | 3624 | {
|
3629 |
| - filter_type= Gtid_event_filter::REJECT_ALL_GTID_FILTER_TYPE; |
| 3625 | + DBUG_ASSERT(mode == |
| 3626 | + Gtid_event_filter::id_restriction_mode::BLACKLIST_MODE); |
3630 | 3627 | filter_name= BLACKLIST_NAME;
|
3631 | 3628 | opposite_filter_name= WHITELIST_NAME;
|
3632 | 3629 | construct_filter=
|
3633 | 3630 | create_event_filter<Reject_all_gtid_filter>;
|
3634 | 3631 | construct_default_filter=
|
3635 | 3632 | create_event_filter<Accept_all_gtid_filter>;
|
3636 | 3633 | }
|
3637 |
| - else |
3638 |
| - { |
3639 |
| - DBUG_ASSERT(0); |
3640 |
| - } |
3641 | 3634 |
|
3642 | 3635 | if (m_id_restriction_mode !=
|
3643 | 3636 | Gtid_event_filter::id_restriction_mode::MODE_NOT_SET)
|
@@ -3683,7 +3676,10 @@ int Id_delegating_gtid_event_filter<T>::set_id_restrictions(
|
3683 | 3676 | else
|
3684 | 3677 | {
|
3685 | 3678 | DBUG_ASSERT(map_element->filter->get_filter_type() ==
|
3686 |
| - filter_type); |
| 3679 | + (mode == |
| 3680 | + Gtid_event_filter::id_restriction_mode::WHITELIST_MODE) |
| 3681 | + ? Gtid_event_filter::ACCEPT_ALL_GTID_FILTER_TYPE |
| 3682 | + : Gtid_event_filter::REJECT_ALL_GTID_FILTER_TYPE); |
3687 | 3683 | }
|
3688 | 3684 | }
|
3689 | 3685 |
|
|
0 commit comments