Bug #53423 [Bgs]: mysql_statement.c uses C99 syntax
Edit report at http://bugs.php.net/bug.php?id=53423&edit=1
ID: 53423
Updated by: johannes@php.net
Reported by: jd at cpanel dot net
Summary: mysql_statement.c uses C99 syntax
Status: Bogus
Type: Bug
Package: PDO related
Operating System: Linux
PHP Version: 5.3SVN-2010-11-29 (SVN)
Block user comment: N
Private report: N
New Comment:
The actual issue is not C99 or such but that you are using an outdated
version of libmsql. You probabl might be successfull when using mysqlnd
(--with-mysql=mysqlnd --with-msqli=mysqlnd --with-pdo-mysql=msqlnd) or
updating your libmysql version.
The C99 macros are only used when using --enable-debug and GCC is
detected.
Previous Comments:
------------------------------------------------------------------------
[2010-11-29 17:13:40] jd at cpanel dot net
Also, to be clear, the compile that failed was linking with
libmysqlclient (MySQL 4.0.27), not mysqlnd. As far as I can tell
though, this has no bearing on the compile failure.
------------------------------------------------------------------------
[2010-11-29 17:07:25] jd at cpanel dot net
Just to be clear, the idea that RedHat 7.3 isn't supported is fine with
me. It's an ancient system and supporting it shouldn't factor into
anyone else's decision making. I always test with RedHat 7.3 because GCC
2.95 points out these types of bugs that many modern compilers allow
without complaint.
I'm a little concerned that PHP is going to suddenly start requiring a
C99 compatible compiler without testing the compiler for C99 support or
putting the compiler into C99 mode though.
PHP 5.3.3 did not require a C99 compatible compiler as far as I'm aware.
------------------------------------------------------------------------
[2010-11-29 16:58:49] uw@php.net
PS: Don't get me wrong when I say "from a MySQL perspective". Of course,
php.net can overrule me but "we MySQL guys" are the ones doing most of
the work on mysqlnd. So, "from a maintainer perspective", even with my
php.net hat on, ...
------------------------------------------------------------------------
[2010-11-29 16:54:26] uw@php.net
From a MySQL perspective supporting RH 7.3/gcc 2.95 is bogus. RH 7.4 has
been released in May 2002, hasn't it? That is a little too old for using
PHP 5.3 with mysqlnd. RH 7.3 is way before mysqlnd development has
started.
As there is an alternative (good old libmysqlclient) for those using 8
years old systems, I'm closing the report.
Of course, we'll check if we can add a test for the GCC version to bail
out in case of old GCC.
------------------------------------------------------------------------
[2010-11-29 16:43:39] jd at cpanel dot net
Description:
------------
PDO_MySQL fails to compile on an older RedHat 7.3 system using GCC 2.95
because the macros in mysql_statement.c expand into C99 style inline
variable declarations. This error was encountered while testing PHP
5.3.4RC1.
Error messages from the compiler:
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c: In
function `pdo_mysql_stmt_dtor':
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:52:
structure has no member named `stmt'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:70:
structure has no member named `params'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:71:
structure has no member named `params'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:73:
structure has no member named `in_null'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:74:
structure has no member named `in_null'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:76:
structure has no member named `in_length'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:77:
structure has no member named `in_length'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c: In
function `pdo_mysql_stmt_set_row_count':
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:127:
structure has no member named `stmt'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c: In
function `pdo_mysql_stmt_execute':
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:295:
structure has no member named `stmt'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c: In
function `pdo_mysql_stmt_param_hook':
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:469:
`MYSQL_BIND' undeclared (first use in this function)
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:469:
(Each undeclared identifier is reported only once
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:469:
for each function it appears in.)
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:469:
`b' undeclared (first use in this function)
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c: In
function `pdo_mysql_stmt_describe':
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:678:
structure has no member named `stmt'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c: In
function `pdo_mysql_stmt_get_col':
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:727:
structure has no member named `stmt'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c: In
function `pdo_mysql_stmt_col_meta':
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:831:
structure has no member named `stmt'
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c: In
function `pdo_mysql_stmt_cursor_closer':
/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql/mysql_statement.c:898:
structure has no member named `stmt'
Test script:
---------------
root@rh73 [/home/cpeasyapache/src/php-5.3.4RC1/ext/pdo_mysql]# cat
/home/cpeasyapache/src/php-5.3.4RC1/config.nice
#! /bin/sh
#
# Created by configure
CFLAGS=' -I/usr/kerberos/include' \
'./configure' \
--disable-fileinfo \
--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-libxml \
--enable-magic-quotes \
--enable-mbstring \
--enable-pdo=shared \
--enable-safe-mode \
--enable-soap \
--enable-sockets \
--enable-wddx \
--enable-zend-multibyte \
--enable-zip \
--prefix=/usr/local \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-bz2 \
--with-config-file-path=/usr/local/lib \
--with-config-file-scan-dir=/usr/local/lib/php.ini.d \
--with-curl=/opt/curlssl/ \
--with-curlwrappers \
--with-freetype-dir=/usr \
--with-gd \
--with-gettext \
--with-imap=/opt/php_with_imap_client/ \
--with-imap-ssl=/usr \
--with-jpeg-dir=/usr \
--with-kerberos \
--with-libexpat-dir=/usr \
--with-libxml-dir=/opt/xml2 \
--with-libxml-dir=/opt/xml2/ \
--with-mcrypt=/opt/libmcrypt/ \
--with-mm=/opt/mm/ \
--with-mysql=/usr \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-pcre-regex=/opt/pcre \
--with-pdo-mysql=shared \
--with-pdo-sqlite=shared \
--with-png-dir=/usr \
--with-pspell \
--with-sqlite=shared \
--with-tidy=/opt/tidy/ \
--with-xmlrpc \
--with-xpm-dir=/usr/X11R6 \
--with-xsl=/opt/xslt/ \
--with-zlib \
--with-zlib-dir=/usr \
"$@"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53423&edit=1
Thread (9 messages)