Commit db7e04ed authored by Jan Lindström's avatar Jan Lindström

MDEV-28868 : wsrep_incoming_address status variable prints 0 as port number if...

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.
parent 0c0a5690
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment