Skip to content
Permalink
Browse files
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.
  • Loading branch information
Jan Lindström committed Sep 22, 2022
1 parent 0c0a569 commit db7e04e
Showing 1 changed file with 5 additions and 2 deletions.
@@ -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:

0 comments on commit db7e04e

Please sign in to comment.