|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44502 Compiling ok with MySQL 5.0
Submitted: 2008-03-22 03:34 UTC Modified: 2008-03-23 13:18 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: nickg78 at gmail dot com Assigned:
Status: Suspended Package: Compile Failure
PHP Version: 6CVS-2008-03-22 (snap) OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-03-22 03:34 UTC] nickg78 at gmail dot com
While trying to compile PHP 6 with mysql or mysqli, compile fails with error /ext/mysql/php_mysql.c:2086: error: 'MYSQL_TYPE_VARCHAR' undeclared (first use in this function)

Reproduce code:
These are the configure options for MySQL that were working with no problems while compiling PHP 5.0-5.2:

./configure --with-mysqli --with-mysql=/usr

Expected result:
Successful PHP compile

Actual result:
ext/mysql/php_mysql.c: In function 'php_mysql_fetch_hash':
ext/mysql/php_mysql.c:2086: error: 'MYSQL_TYPE_VARCHAR' undeclared (first use in this function)
ext/mysql/php_mysql.c:2086: error: (Each undeclared identifier is reported only once
ext/mysql/php_mysql.c:2086: error: for each function it appears in.)
make: *** [ext/mysql/php_mysql.lo] Error 1

MySQL version is 4.1.22


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-22 05:05 UTC] nickg78 at gmail dot com
Finally after some further testing, it appears that the problem does not occur with MySQL 5.0, but only with 4.1

I upgraded my MySQL version to 5.0 and now PHP is compiled without errors. Please ignore this bug report if PHP 6.0 is officially announced to be incompatible with MySQL 4.1 but I have not found anything mentioning this.
 [2008-03-23 12:03 UTC]
Looks that it was added in 5.0.3 version, here's a patch: (non tested)

Changing mysql/php_mysql.c, mysqli/mysqli.c and mysqli/mysqli_api.c
 [2008-03-23 13:18 UTC]
I don't think we should make the code complexer (even if it's just a little) for supporting MySQL libraries odler than 5.0 with PHP 6. There are three reasons for that:

- The active support lifecycle from MySQL/Sun ended 2006-12-31, the extended will end 2009-12-31 (
- You can use --with-mysql=mysqlnd and --with-mysqli=mysqlnd to use MySQLnd library which is not dependant from an external library, and I hope it will be default with PHP 6
- It will take quite some time until PHP 6 will be released.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 19 07:03:36 2021 UTC