Bug #9053 Perl-DBD compiling error with MySQL 4.1.10
Submitted: 8 Mar 2005 15:33 Modified: 7 May 2005 8:44
Reporter: Alex Castellarnau Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.10 OS:Linux (Linux RH9 and FC2)
Assigned to: CPU Architecture:Any

[8 Mar 2005 15:33] Alex Castellarnau
Description:
Here is the problem I detected: 

I have two machines one with
RH9 and the other with FC2, in both machines I have
installed the following MySQL packages:

MySQL-shared-4.1.10-0
MySQL-client-4.1.10-0
MySQL-devel-4.1.10-0
MySQL-server-4.1.10-0

I have downloaded
perl-DBD-MySQL-2.1021-3.src.rpm

I got a mysql.xs:180 error when doing:
rpmbuild -bb perl-DBD-MySQL.spec

I'm attaching the output of rpmbuild.

Alex Castellarnau
alex@lanzanet.net

How to repeat:
Everytime I build the perl-DBD.
[8 Mar 2005 15:34] Alex Castellarnau
Here is the output od rpmbuild:

#######################################################################
[root@kamehouse SPECS]# rpmbuild -bb perl-DBD-MySQL.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.84229
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ cd /usr/src/redhat/BUILD
+ rm -rf DBD-mysql-2.1021
+ /usr/bin/gzip -dc /usr/src/redhat/SOURCES/DBD-mysql-2.1021.tar.gz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd DBD-mysql-2.1021
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.84229
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd DBD-mysql-2.1021
+ LANG=C
+ export LANG
+ CFLAGS=-O2 -g -pipe -march=i386 -mcpu=i686
+ perl Makefile.PL PREFIX=/var/tmp/perl-DBD-MySQL-2.1021-root/usr INSTALLDIRS=vendor --ssl
I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/include/mysql -mcpu=i486 -fno-strength-reduce
  libs          (mysql_config) = -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv
  nocatchstderr (default     ) = 0
  ssl           (Users choice) = 1
  testdb        (default     ) = test
  testhost      (default     ) =
  testpassword  (default     ) =
  testuser      (default     ) =

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Checking if your kit is complete...
Looks good
Using DBI 1.32 installed in /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBI
Writing Makefile for DBD::mysql
+ make
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Mysql.pm blib/lib/Mysql.pm
cp lib/Mysql/Statement.pm blib/lib/Mysql/Statement.pm
cp lib/DBD/mysql.pod blib/lib/DBD/mysql.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
gcc -c  -I/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBI -I/usr/include/mysql -mcpu=i486 -fno-strength-reduce -DDBD_MYSQL_WITH_SSL -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -march=i386 -mcpu=i686 -g   -DVERSION=\"2.1021\" -DXS_VERSION=\"2.1021\" -fPIC "-I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE"   dbdimp.c
dbdimp.c: In function `mysql_db_login':
dbdimp.c:847: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
dbdimp.c: In function `mysql_db_commit':
dbdimp.c:892: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
dbdimp.c: In function `mysql_db_rollback':
dbdimp.c:913: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
dbdimp.c: In function `mysql_db_FETCH_attrib':
dbdimp.c:1160: warning: initialization discards qualifiers from pointer target type
dbdimp.c:1164: warning: initialization discards qualifiers from pointer target type
dbdimp.c:1170: warning: initialization discards qualifiers from pointer target type
dbdimp.c:1177: warning: initialization discards qualifiers from pointer target type
dbdimp.c:1192: warning: initialization discards qualifiers from pointer target type
dbdimp.c:1200: warning: initialization discards qualifiers from pointer target type
dbdimp.c:1205: warning: initialization discards qualifiers from pointer target type
dbdimp.c: In function `mysql_st_internal_execute':
dbdimp.c:1350: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
dbdimp.c:1362: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
dbdimp.c:1371: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
dbdimp.c: In function `mysql_st_fetch':
dbdimp.c:1516: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
dbdimp.c: In function `mysql_db_reconnect':
dbdimp.c:2033: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" < /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBI/Driver.xst > mysql.xsi
/usr/bin/perl /usr/lib/perl5/5.8.0/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8.0/ExtUtils/typemap  mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'rows' detected in mysql.xs, line 289
gcc -c  -I/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBI -I/usr/include/mysql -mcpu=i486 -fno-strength-reduce -DDBD_MYSQL_WITH_SSL -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -march=i386 -mcpu=i686 -g   -DVERSION=\"2.1021\" -DXS_VERSION=\"2.1021\" -fPIC "-I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE"   mysql.c
mysql.xs: In function `XS_DBD__mysql__dr__ListDBs':
mysql.xs:54: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
mysql.xs: In function `XS_DBD__mysql__dr__admin_internal':
mysql.xs:93: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
mysql.xs:99: too few arguments to function `mysql_shutdown'
mysql.xs:137: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
mysql.xs: In function `XS_DBD__mysql__db__ListDBs':
mysql.xs:180: warning: passing arg 3 of `mysql_dr_error' discards qualifiers from pointer target type
make: *** [mysql.o] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.84229 (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.84229 (%build)
######################################################################
[7 May 2005 8:44] Hartmut Holzgraefe
The MySQL client API changed from 4.0 to 4.1.

DBD-mysql 2.1 only supports the 4.0 API, 
current DBD-mysql 2.9 supports both API versions