Bug #20811 files missing from install after "./configure --without-server"
Submitted: 2 Jul 2006 4:35 Modified: 22 Nov 2006 15:03
Reporter: Mark Johnson (Basic Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51.12 OS:Linux (linux 2.6.15/Slackware 10.2)
Assigned to: CPU Architecture:Any

[2 Jul 2006 4:35] Mark Johnson
Description:
I found this problem while trying to build MyODBC.
Running configure for MyODBC checks for the presence of the MySQL client libraries and headers.  However, compiling MyODBC requires header files and libraries that are not installed with a client-only install of MySQL.

How to repeat:
-Downloaded mysql-5.0.22.tar.gz
-Extracted it.
./configure --without-server
make
DESTDIR=`pwd`/tmp make install
(built & installed Slackware package from tmp directory)

-extracted mysql-connector-odbc-3.51.12.tar.gz
./configure --with-mysql-path=/usr/local --with-unixODBC=/usr
make

Make fails with the following error:
error.c:42:26: mysqld_error.h: No such file or directory
error.c: In function `translate_error':
error.c:224: error: `ER_WRONG_VALUE_COUNT' undeclared (first use in this function)
error.c:224: error: (Each undeclared identifier is reported only once
error.c:224: error: for each function it appears in.)
error.c:227: error: `ER_DUP_ENTRY' undeclared (first use in this function)
error.c:228: error: `ER_DUP_KEY' undeclared (first use in this function)
error.c:231: error: `ER_NO_DB_ERROR' undeclared (first use in this function)
error.c:234: error: `ER_PARSE_ERROR' undeclared (first use in this function)
error.c:237: error: `ER_TABLE_EXISTS_ERROR' undeclared (first use in this function)
error.c:240: error: `ER_FILE_NOT_FOUND' undeclared (first use in this function)
error.c:241: error: `ER_NO_SUCH_TABLE' undeclared (first use in this function)
error.c:242: error: `ER_CANT_OPEN_FILE' undeclared (first use in this function)
error.c:243: error: `ER_BAD_TABLE_ERROR' undeclared (first use in this function)
error.c:246: error: `ER_NO_SUCH_INDEX' undeclared (first use in this function)
error.c:247: error: `ER_CANT_DROP_FIELD_OR_KEY' undeclared (first use in this function)
error.c:250: error: `ER_DUP_FIELDNAME' undeclared (first use in this function)
error.c:253: error: `ER_BAD_FIELD_ERROR' undeclared (first use in this function)
make[2]: *** [error.lo] Error 1
make[2]: Leaving directory `/mnt/raid/download/computer/software/mysql/src/mysql-connector-odbc-3.51.12/driver'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/mnt/raid/download/computer/software/mysql/src/mysql-connector-odbc-3.51.12/driver'
make: *** [all-recursive] Error 1

At this point I copied the file mysqld_error.h from a system with the full database (5.0.21) installed, and re-issued the make command. (Yes, I should have used a matching version....)

Later it failed again:
/bin/sh ../libtool --tag=CC --mode=link gcc  -O3 -DDBUG_OFF -O2 -march=i486 -mcpu=pentium2  -I/usr/local/include/mysql -march=i486 -mcpu=pentium2   -o libmyodbc3_r.la -rpath /usr/local/lib -release 3.51.12 catalog.lo connect.lo cursor.lo dll.lo error.lo execute.lo handle.lo info.lo myodbc3.lo options.lo prepare.lo results.lo transact.lo utility.lo setup.lo -L/usr/local/lib/mysql -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread ../util/libmyodbcutil.la -L/usr/lib -lz  -lodbcinst
gcc -shared  .libs/catalog.o .libs/connect.o .libs/cursor.o .libs/dll.o .libs/error.o .libs/execute.o .libs/handle.o .libs/info.o .libs/myodbc3.o .libs/options.o .libs/prepare.o .libs/results.o .libs/transact.o .libs/utility.o .libs/setup.o -Wl,--whole-archive ../util/.libs/libmyodbcutil.a -Wl,--no-whole-archive  -L/usr/local/lib/mysql -lmysqlclient_r -lcrypt -lnsl -lm /usr/lib/libltdl.so -L/usr/lib -ldl -lpthread -lz /usr/lib/libodbcinst.so  -march=i486 -mcpu=pentium2 -march=i486 -mcpu=pentium2 -Wl,-soname -Wl,libmyodbc3_r-3.51.12.so -o .libs/libmyodbc3_r-3.51.12.so
/usr/lib/gcc-lib/i486-slackware-linux/3.3.6/../../../../i486-slackware-linux/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
make[1]: *** [libmyodbc3_r.la] Error 1
make[1]: Leaving directory `/mnt/raid/download/computer/software/mysql/src/mysql-connector-odbc-3.51.12/driver_r'
make: *** [all-recursive] Error 1
From mysql-standard-5.0.22-linux-i686-glibc23.tar.gz, I copied the file
libmysqlclient_r.a to my installation at /usr/local/mysql/lib
and restarted make.  (I note that this is a static library, while the rest of my client installation is shared libraries.)

This time, make succeeded.

Suggested fix:
-The MyODBC required header (mysqld_error.h) and the required library (mysqlclient_r) should be included in the install when MySQL is configure'd with --without-server
[2 Jul 2006 4:38] Mark Johnson
I just noticed I put the MyODBC version into the version field.
My version of the MySQL is actually 5.0.22.  I have corrected this.

The version of MyODBC is 3.51.12.
[2 Jul 2006 4:44] Mark Johnson
Fixed synopsis.
[5 Jul 2006 5:40] Mark Johnson
I found that I can have the correct client libraries built with:
./configure --prefix=/usr --libdir=/usr/lib --without-server --enable-thread-safe-client

Therefore, this bug is primarily about the MyODBC configure script, and secondarily about the MySQL client compilation.  The MyODBC configure script has a defective check.  It tests for the presence of the NON-thread-safe client library.  However, the build fails without the presence of the THREAD-SAFE client library.  Therefore, this test needs to be fixed.

I also request consideration of the following two issues with the MySQL client build:
1. Consider making --enable-thread-safe-client the default behaviour when --without-server is specified.
2. Consider installing the mysqld_error.h file when only the NON-thread-safe client is built.  It is installed when both client libraries are built, but appears to be the sort of file that belongs with both.  Therefore, it appears that it should be installed even when just the NON-thread-safe client is built.
[23 Jul 2006 10:45] Valeriy Kravchuk
> Therefore, this bug is primarily about the MyODBC configure script, and
> secondarily about the MySQL client compilation.  The MyODBC configure script
> has a defective check.  It tests for the presence of the NON-thread-safe
> client library.  However, the build fails without the presence of the
> THREAD-SAFE client library.  Therefore, this test needs to be fixed.

So, this is MyODBC-related bug report. Do you agree with me?

As for other issues you mentioned, they sound like a feature requests:

1. Consider making --enable-thread-safe-client the default behaviour when
--without-server is specified.

2. Consider installing the mysqld_error.h file when only the NON-thread-safe
client is built.

You can add them as separate reports, if you want.
[25 Jul 2006 5:45] Mark Johnson
Yes, that is correct. This bug is about the MyODBC configure script.  It did take me a while of exploring the building of MySQL and MyODBC to decide that though.

The other two issues have been filed as separate bug reports.
#1 is feature request 21264.
#2 is bug report 21265.
[22 Nov 2006 15:03] Tonci Grgin
As requested, two separate verified reports are created for this problem, both verified.
Bug#21264
Bug#21265