mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MDEV-26910 mysqld_multi starts same instance multiple times with the risk to crash database
a group name may be present in a file more than once. use hash to deduplicate.
This commit is contained in:
@@ -620,7 +620,7 @@ sub find_groups
|
||||
my ($raw_gids) = @_;
|
||||
|
||||
my %gids;
|
||||
my @groups;
|
||||
my %groups;
|
||||
|
||||
if (defined($raw_gids))
|
||||
{
|
||||
@@ -659,7 +659,7 @@ sub find_groups
|
||||
# Use $2 + 0 to normalize numbers (002 + 0 -> 2)
|
||||
if (not defined($raw_gids) or $gids{$2 + 0})
|
||||
{
|
||||
push @groups, "$1$2";
|
||||
$groups{"$1$2"} = 1;
|
||||
}
|
||||
}
|
||||
elsif (/^\s*!include\s+(\S.*?)\s*$/)
|
||||
@@ -674,7 +674,7 @@ sub find_groups
|
||||
|
||||
close CONF;
|
||||
}
|
||||
return @groups;
|
||||
return keys %groups;
|
||||
}
|
||||
|
||||
####
|
||||
|
||||
Reference in New Issue
Block a user