Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for CONC-600: Do not release rpl_event if event_type is unknown #193

Closed
wants to merge 1 commit into from

Conversation

007gzs
Copy link

@007gzs 007gzs commented Mar 10, 2022

When i got a unsupport event_typ like PREVIOUS_GTIDS_LOG_EVENT, mariadb_rpl_fetch will free rpl_event and return null;
If my code is

while ((event = mariadb_rpl_fetch(rpl, event)))
{
	//todo
}

when i got unsupport event, the loop will finish.

I can check rpl->buffer_size out of function mariadb_rpl_fetch like

	while (1)
	{
		while ((event = mariadb_rpl_fetch(rpl, event)))
		{
			//todo
		}
		if (rpl->buffer_size == 0) break;
		unsupport_event_type = rpl->buffer[5];
               //todo
	}

but rpl_event->memroot will be ma_free_root and ma_init_alloc_root in next call mariadb_rpl_fetch

When i got a unsupport event_typ like `PREVIOUS_GTIDS_LOG_EVENT`, `mariadb_rpl_fetch` will free rpl_event and return null;
If my code is 
```
while ((event = mariadb_rpl_fetch(rpl, event)))
{
	//todo
}
``` when i got unsupport event, the loop will finish.

I can check rpl->buffer_size out of function `mariadb_rpl_fetch` like
```
	while (1)
	{
		while ((event = mariadb_rpl_fetch(rpl, event)))
		{
			//todo
		}
		if (rpl->buffer_size == 0) break;
		unsupport_event_type = rpl->buffer[5];
               //todo
	}
```
 but `rpl_event->memroot` will be `ma_free_root` and `ma_init_alloc_root` in next call `mariadb_rpl_fetch`
@9EOR9 9EOR9 self-assigned this Jun 21, 2022
@9EOR9 9EOR9 changed the title donnot free rpl_event when not support event_type Fix for CONC-600: Do not release rpl_event if event_type is unknown Jun 21, 2022
@9EOR9
Copy link
Collaborator

9EOR9 commented Jun 21, 2022

Thanks for you contribution (applied rev. 1e2f6d5).

@9EOR9 9EOR9 closed this Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants