MDEV-28868 : wsrep_incoming_address status variable prints 0 as port number if the port is not mentioned in wsrep_node_incoming_address system variable

Problem was that mysqld_port is not set on set_ports() because
it will be executed later. Fix is naturally fall back to
MYSQL_PORT.
This commit is contained in:
Jan Lindström 2022-09-22 08:46:30 +03:00
parent 0c0a569028
commit db7e04ed3a

View file

@ -652,11 +652,14 @@ static std::string wsrep_server_incoming_address()
/*
In case port is not specified in wsrep_node_incoming_address, we use
mysqld_port.
Note that we might get here before we execute set_ports().
*/
int port= (addr.get_port() > 0) ? addr.get_port() : (int) mysqld_port;
int local_port= (addr.get_port() > 0) ? addr.get_port() : (int) mysqld_port;
if (!local_port)
local_port= MYSQL_PORT;
const char *fmt= (addr.is_ipv6()) ? "[%s]:%u" : "%s:%u";
snprintf(inc_addr, inc_addr_max, fmt, addr.get_address(), port);
snprintf(inc_addr, inc_addr_max, fmt, addr.get_address(), local_port);
}
done: