mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-33768: Memory leak found in the test main.constraints run with --ps-protocol against a server built with the option -DWITH_PROTECT_STATEMENT_MEMROOT
The discovered memory leak was introduced by the commit
762bf7a03b
(MDEV-22602 Disable UPDATE CASCADE for SQL constraints)
The reason why a memory leaked on running the test main.constraints
is that a statement arena was used for allocation a memory
for storing a constraint name. A constraint name is an entity having
temporary nature by its design so runtime arena should be used for its
allocation.
This commit is contained in:
@ -5861,7 +5861,8 @@ static bool make_unique_constraint_name(THD *thd, LEX_CSTRING *name,
|
||||
if (!check) // Found unique name
|
||||
{
|
||||
name->length= (size_t) (real_end - buff);
|
||||
name->str= strmake_root(thd->stmt_arena->mem_root, buff, name->length);
|
||||
name->str= thd->strmake(buff, name->length);
|
||||
|
||||
return (name->str == NULL);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user