1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-23534: SIGSEGV in sf_malloc_usable_size/my_free on SET GLOBAL REPLICATE_DO_TABLE

Backporting fixes for:

MDEV-22317: SIGSEGV in my_free/delete_dynamic in optimized builds (ARIA)
  Backported following commits from: 10.5.3
  commit 77e1b0c397 -- Post push fix.
  commit 2e6b21be4a

MDEV-22059: MSAN report at replicate_ignore_table_grant
  Backported following  commits from: 10.5.4
  commit 840fb495ce
This commit is contained in:
Sujatha
2020-08-26 16:25:28 +05:30
parent 94e9dc95d4
commit cd36bc01a5
5 changed files with 48 additions and 16 deletions

View File

@ -349,16 +349,22 @@ Rpl_filter::set_do_table(const char* table_spec)
int status;
if (do_table_inited)
my_hash_reset(&do_table);
status= parse_filter_rule(table_spec, &Rpl_filter::add_do_table);
if (!do_table.records)
{
my_hash_free(&do_table);
do_table_inited= 0;
}
status= parse_filter_rule(table_spec, &Rpl_filter::add_do_table);
if (do_table_inited && status)
{
if (!do_table.records)
{
my_hash_free(&do_table);
do_table_inited= 0;
}
}
return status;
}
@ -369,16 +375,22 @@ Rpl_filter::set_ignore_table(const char* table_spec)
int status;
if (ignore_table_inited)
my_hash_reset(&ignore_table);
status= parse_filter_rule(table_spec, &Rpl_filter::add_ignore_table);
if (!ignore_table.records)
{
my_hash_free(&ignore_table);
ignore_table_inited= 0;
}
status= parse_filter_rule(table_spec, &Rpl_filter::add_ignore_table);
if (ignore_table_inited && status)
{
if (!ignore_table.records)
{
my_hash_free(&ignore_table);
ignore_table_inited= 0;
}
}
return status;
}
@ -411,14 +423,20 @@ Rpl_filter::set_wild_do_table(const char* table_spec)
int status;
if (wild_do_table_inited)
{
free_string_array(&wild_do_table);
wild_do_table_inited= 0;
}
status= parse_filter_rule(table_spec, &Rpl_filter::add_wild_do_table);
if (!wild_do_table.elements)
if (wild_do_table_inited && status)
{
delete_dynamic(&wild_do_table);
wild_do_table_inited= 0;
if (!wild_do_table.elements)
{
delete_dynamic(&wild_do_table);
wild_do_table_inited= 0;
}
}
return status;
@ -431,14 +449,20 @@ Rpl_filter::set_wild_ignore_table(const char* table_spec)
int status;
if (wild_ignore_table_inited)
{
free_string_array(&wild_ignore_table);
wild_ignore_table_inited= 0;
}
status= parse_filter_rule(table_spec, &Rpl_filter::add_wild_ignore_table);
if (!wild_ignore_table.elements)
if (wild_ignore_table_inited && status)
{
delete_dynamic(&wild_ignore_table);
wild_ignore_table_inited= 0;
if (!wild_ignore_table.elements)
{
delete_dynamic(&wild_ignore_table);
wild_ignore_table_inited= 0;
}
}
return status;