Make MacOSX and FreeBSD ports

Bug #1201893 reported by Vladislav Klyachin
14
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Galera
Fix Released
Medium
Vladislav Klyachin
MySQL patches by Codership
Fix Released
Undecided
Vladislav Klyachin
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Fix Released
Undecided
Unassigned

Bug Description

Some files in wsrep patch contain platform-dependend code.
For example in sql/wsrep_utils.c:

// try to find the address of the first one
#if (TARGET_OS_LINUX == 1)
  const char cmd[] = "ip addr show | grep -E '^\\s*inet' | grep -m1 global |"
                     " awk '{ print $2 }' | sed 's/\\/.*//'";
#elif defined(__sun__)
  const char cmd[] = "/sbin/ifconfig -a | "
      "/usr/gnu/bin/grep -m1 -1 -E 'net[0-9]:' | tail -n 1 | awk '{ print $2 }'";
#else
  char *cmd;
#error "OS not supported"
#endif

also scripts files ./scripts/*.sh

It is required to make the code portable or to add support for MacOSX and FreeBSD.

Related branches

Changed in codership-mysql:
assignee: nobody → Vladislav Klyachin (klyachin)
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

The 'ip addr show/ifconfig' method also fails on many non-trivial setups (as seen from previous bugs), getifaddrs (http://man7.org/linux/man-pages/man3/getifaddrs.3.html) is more appropriate.

Changed in percona-xtradb-cluster:
milestone: none → 5.5.32-23.7.6
Revision history for this message
Alex Yurchenko (ayurchen) wrote :

But, most importantly, note that this is not an essential feature, and actually should not be relied on in production. It conceptually can not be fixed in general (machines with multiple interfaces) and should not be spent effort on. A clear error message instructing user to configure wsrep_node_address variable should be enough.

#error preprocessor macro was added there to enforce explicit handling of every OS, but the OS does not have to be supported, just handled.

Revision history for this message
Vladislav Klyachin (klyachin) wrote :
Changed in codership-mysql:
status: New → Fix Committed
Revision history for this message
Alex Yurchenko (ayurchen) wrote :
Changed in galera:
assignee: nobody → Vladislav Klyachin (klyachin)
importance: Undecided → Medium
milestone: none → 23.2.7
status: New → Fix Committed
Changed in percona-xtradb-cluster:
status: New → Fix Committed
Changed in codership-mysql:
status: Fix Committed → Fix Released
Changed in galera:
status: Fix Committed → Fix Released
Changed in percona-xtradb-cluster:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1399

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.