This helper function is used to removes roles and grantees from the corresponding cross-reference arrays. see remove_role_user_mapping(). as such, it asserts that an element to delete is present in the array, and is present only once. */
| 4085 | and is present only once. |
| 4086 | */ |
| 4087 | static void remove_ptr_from_dynarray(DYNAMIC_ARRAY *array, void *ptr) |
| 4088 | { |
| 4089 | bool found __attribute__((unused))= false; |
| 4090 | for (size_t i= 0; i < array->elements; i++) |
| 4091 | { |
| 4092 | if (ptr == *dynamic_element(array, i, void**)) |
| 4093 | { |
| 4094 | DBUG_ASSERT(!found); |
| 4095 | delete_dynamic_element(array, i); |
| 4096 | IF_DBUG_ASSERT(found= true, break); |
| 4097 | } |
| 4098 | } |
| 4099 | DBUG_ASSERT(found); |
| 4100 | } |
| 4101 | |
| 4102 | static void remove_role_user_mapping(ACL_USER_BASE *grantee, ACL_ROLE *role, |
| 4103 | int grantee_idx=-1, int role_idx=-1) |
no test coverage detected