HandlerSocket fails to compile if mysql-devel is installed

Bug #922768 reported by Ignacio Nin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Unassigned

Bug Description

In rhel5, HandlerSocket fails to compile if the package mysql-devel 5.0 is installed.

In the file ./handlersocket/mysql_incl.hpp, mysql_version.h is included and different headers are included depending on the version (less than 5.0.5 and greater than). This causes a strange error in the build run that can be avoided if the path to mysql_version.h in the Percona Server code being compiled is specified before /usr/include.

The path to this include dir is given to the HandlerSocket build via CXXFLAGS, but its toolchain prepends /usr/include to it (in rhel5). A solution is to use MYSQL_CFLAGS instead of CXXFLAGS when calling the configure script, which is prepended to all flags.

The error is present below. Notice /usr/include/mysql is present before /home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/release/include which is the actual headers directory.

 g++44 -DHAVE_CONFIG_H -I. -I. -I.. -I/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/sql -I/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/include -I/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/regex -I/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0 -I/usr/include/mysql -fPIC -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=rel24.0 -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1 -DDBUG_OFF -I../libhsclient -O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -DPERCONA_INNODB_VERSION=rel24.0 -I/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/release/include -Wall -g -fno-rtti -fno-exceptions -fPIC -DPIC -MT handlersocket_la-database.lo -MD -MP -MF .deps/handlersocket_la-database.Tpo -c database.cpp -fPIC -DPIC -o .libs/handlersocket_la-database.o
In file included from database.cpp:16:
mysql_incl.hpp:36:1: warning: "pthread_cond_timedwait" redefined
In file included from mysql_incl.hpp:24,
                 from database.cpp:16:
/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/include/my_pthread.h:572:1: warning: this is the location of the previous definition
In file included from database.cpp:16:
mysql_incl.hpp:37:1: warning: "pthread_mutex_lock" redefined
In file included from mysql_incl.hpp:24,
                 from database.cpp:16:
/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/include/my_pthread.h:568:1: warning: this is the location of the previous definition
In file included from database.cpp:16:
mysql_incl.hpp:38:1: warning: "pthread_mutex_unlock" redefined
In file included from mysql_incl.hpp:24,
                 from database.cpp:16:
/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/include/my_pthread.h:569:1: warning: this is the location of the previous definition
In file included from /home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/sql/sql_plugin.h:32,
                 from /home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/sql/structs.h:23,
                 from /home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/sql/unireg.h:167,
                 from /home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/sql/sql_class.h:28,
                 from mysql_incl.hpp:26,
                 from database.cpp:16:
/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/include/m_string.h: In function 'const uchar* skip_trailing_space(const uchar*, size_t)':
/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/include/m_string.h:271: error: cast from 'const uchar*' to 'intptr' loses precision
/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/include/m_string.h:273: error: cast from 'const uchar*' to 'intptr' loses precision
make[2]: *** [handlersocket_la-database.lo] Error 1
make[2]: Leaving directory `/home/jenkins/workspace/percona-server-5.5-rpms/label_exp/centos5-64/target/BUILD/Percona-Server-5.5.19-rel24.0/Percona-Server-5.5.19-rel24.0/storage/HandlerSocket-Plugin-for-MySQL/handlersocket'
make[1]: *** [all-recursive] Error 1

description: updated
Stewart Smith (stewart)
Changed in percona-server:
milestone: 5.5.20-24.1 → 5.5.21-24.1
Revision history for this message
Ignacio Nin (ignacio-nin) wrote :

Fixed in lp:~ignacio-nin/percona-server/5.5.19-handlersocket-CXXFLAGS, to be merged at release-5.5.20-24.1

Changed in percona-server:
milestone: 5.5.21-24.1 → 5.5.20-24.1
status: Confirmed → Fix Committed
Stewart Smith (stewart)
Changed in percona-server:
assignee: Ignacio Nin (ignacio-nin) → nobody
Changed in percona-server:
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/PS-1233

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

Other bug subscribers

Remote bug watches

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