php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19159 Incorrect MySQL version test for mysql_field_count
Submitted: 2002-08-28 18:32 UTC Modified: 2002-08-28 21:18 UTC
From: cag at us dot ibm dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.2.2 OS: N/A
Private report: No CVE-ID: None
 [2002-08-28 18:32 UTC] cag at us dot ibm dot com
According to MySQL documentation (http://www.mysql.com/doc/en/mysql_field_count.html), mysql_field_count became available in version 3.22.24. The test within php_mysql.c tests for versions prior to 3.22.23 instead of 3.22.24. Anyone using 3.22.23 will have linker errors with the referenced symbol not being found. Below is a patch to correct the version test.

*** php_mysql.c.orig	Wed Aug 28 16:55:24 2002
--- php_mysql.c	Wed Aug 28 16:55:32 2002
***************
*** 103,109 ****
  #define MYSQL_USE_RESULT	0
  #define MYSQL_STORE_RESULT	1
  
! #if MYSQL_VERSION_ID < 32223
  #define PHP_MYSQL_VALID_RESULT(mysql)		\
  	(mysql_num_fields(mysql)>0)
  #else
--- 103,109 ----
  #define MYSQL_USE_RESULT	0
  #define MYSQL_STORE_RESULT	1
  
! #if MYSQL_VERSION_ID < 32224
  #define PHP_MYSQL_VALID_RESULT(mysql)		\
  	(mysql_num_fields(mysql)>0)
  #else

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-28 21:18 UTC] sniper@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 10:00:01 2026 UTC