Bug #69890 error: mysqld_error.h: No such file or directory
Submitted: 1 Aug 2013 6:12 Modified: 9 May 2014 12:57
Reporter: Giam Teck Choon Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5.32 OS:Linux (CentOS 6)
Assigned to: CPU Architecture:Any

[1 Aug 2013 6:12] Giam Teck Choon
Description:
Doing compiling with the same options for version 5.5.31 successful but with version 5.5.32 and 5.5.33 are not with error: mysqld_error.h: No such file or directory.

The following are the cmake options used to compile version 5.5.31 successfully but not for version 5.5.32 and 5.5.33.  Note the below are just part of my rpm packaging though.

cmake . -DBUILD_CONFIG=mysql_release \
        -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \
        -DFEATURE_SET="community" \
        -DINSTALL_LAYOUT=RPM \
        -DWITHOUT_SERVER=ON \
        -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
        -DINSTALL_INCLUDEDIR=include/mysql \
        -DINSTALL_INFODIR=share/info \
        -DINSTALL_LIBDIR="%{_lib}/mysql" \
        -DINSTALL_MANDIR=share/man \
        -DINSTALL_MYSQLSHAREDIR=share/mysql \
        -DINSTALL_SBINDIR=libexec \
        -DINSTALL_SUPPORTFILESDIR=share/mysql \
        -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
        -DENABLED_LOCAL_INFILE=ON \
        -DENABLE_DTRACE=ON \
        -DWITH_EMBEDDED_SERVER=ON \
        -DWITH_READLINE=ON \
        -DWITH_SSL=system \
        -DWITH_ZLIB=system

make %{?_smp_mflags} VERBOSE=1

I remembered I saw one similar bug report about this for version 5.6.x and the fix is related to patching CMakeLists.txt but unable to find it.

How to repeat:
Just download mysql-5.5.32.tar.gz or mysql-5.5.33.tar.gz then unpack it then use the above cmake options (change the %{_prefix} and %{_lib}) to /usr and lib) and remove %{?_smp_mflags}... such as:

cmake . -DBUILD_CONFIG=mysql_release \
        -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \
        -DFEATURE_SET="community" \
        -DINSTALL_LAYOUT=RPM \
        -DWITHOUT_SERVER=ON \
        -DCMAKE_INSTALL_PREFIX="/usr" \
        -DINSTALL_INCLUDEDIR=include/mysql \
        -DINSTALL_INFODIR=share/info \
        -DINSTALL_LIBDIR="lib/mysql" \
        -DINSTALL_MANDIR=share/man \
        -DINSTALL_MYSQLSHAREDIR=share/mysql \
        -DINSTALL_SBINDIR=libexec \
        -DINSTALL_SUPPORTFILESDIR=share/mysql \
        -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
        -DENABLED_LOCAL_INFILE=ON \
        -DENABLE_DTRACE=ON \
        -DWITH_EMBEDDED_SERVER=ON \
        -DWITH_READLINE=ON \
        -DWITH_SSL=system \
        -DWITH_ZLIB=system

make VERBOSE=1

You mostly will get the following:

cd /builddir/build/BUILD/mysql-5.5.33/vio && /usr/bin/cmake -E cmake_link_script CMakeFiles/vio.dir/link.txt --verbose=1
/usr/bin/ar cr libvio.a  CMakeFiles/vio.dir/vio.c.o CMakeFiles/vio.dir/viosocket.c.o CMakeFiles/vio.dir/viossl.c.o CMakeFiles/vio.dir/viosslfactories.c.o
/usr/bin/ranlib libvio.a
/builddir/build/BUILD/mysql-5.5.33/unittest/mysys/explain_filename-t.cc:21:26: error: mysqld_error.h: No such file or directory
make[2]: Leaving directory `/builddir/build/BUILD/mysql-5.5.33'
/usr/bin/cmake -E cmake_progress_report /builddir/build/BUILD/mysql-5.5.33/CMakeFiles  35 36
[ 12%] Built target vio
/usr/bin/cmake -E cmake_progress_report /builddir/build/BUILD/mysql-5.5.33/CMakeFiles 

SNAP...

/usr/bin/cmake -E cmake_progress_report /builddir/build/BUILD/mysql-5.5.33/CMakeFiles 
[ 13%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/display.c.o
cd /builddir/build/BUILD/mysql-5.5.33/cmd-line-utils/readline && /usr/bin/gcc  -DDBUG_OFF -DHAVE_CONFIG_H -DHAVE_CONFIG_H -DNO_KILL_INTR -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC  -fPIC -Wall -I/builddir/build/BUILD/mysql-5.5.33/include -I/builddir/build/BUILD/mysql-5.5.33/cmd-line-utils   -o CMakeFiles/readline.dir/display.c.o   -c /builddir/build/BUILD/mysql-5.5.33/cmd-line-utils/readline/display.c
/usr/bin/cmake -E cmake_progress_report /builddir/build/BUILD/mysql-5.5.33/CMakeFiles 
/builddir/build/BUILD/mysql-5.5.33/unittest/mysys/explain_filename-t.cc: In function 'int setup()':
/builddir/build/BUILD/mysql-5.5.33/unittest/mysys/explain_filename-t.cc:37: error: 'ER_DATABASE_NAME' was not declared in this scope
/builddir/build/BUILD/mysql-5.5.33/unittest/mysys/explain_filename-t.cc:37: error: 'ER_ERROR_FIRST' was not declared in this scope
/builddir/build/BUILD/mysql-5.5.33/unittest/mysys/explain_filename-t.cc:38: error: 'ER_TABLE_NAME' was not declared in this scope
/builddir/build/BUILD/mysql-5.5.33/unittest/mysys/explain_filename-t.cc:39: error: 'ER_PARTITION_NAME' was not declared in this scope
/builddir/build/BUILD/mysql-5.5.33/unittest/mysys/explain_filename-t.cc:40: error: 'ER_SUBPARTITION_NAME' was not declared in this scope
/builddir/build/BUILD/mysql-5.5.33/unittest/mysys/explain_filename-t.cc:41: error: 'ER_TEMPORARY_NAME' was not declared in this scope
/builddir/build/BUILD/mysql-5.5.33/unittest/mysys/explain_filename-t.cc:42: error: 'ER_RENAMED_NAME' was not declared in this scope
[ 13%] make[2]: *** [unittest/mysys/CMakeFiles/explain_filename-t.dir/explain_filename-t.cc.o] Error 1
make[2]: Leaving directory `/builddir/build/BUILD/mysql-5.5.33'
/usr/bin/cmake -E cmake_progress_report /builddir/build/BUILD/mysql-5.5.33/CMakeFiles 5
make[1]: *** [unittest/mysys/CMakeFiles/explain_filename-t.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Building C object strings/CMakeFiles/strings.dir/ctype-czech.c.o
[9 Apr 2014 12:57] MySQL Verification Team
Please check with version 5.5.37. Thanks.
[10 May 2014 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".