Skip to content

Commit 8654c32

Browse files
committed
Fix #64032: mysqli reports different client_version
While `mysqli_get_client_version()` calls `mysql_get_client_version()` to retrieve the client version, `mysql::$client_version` is initialized to `MYSQL_VERSION_ID`. Both should match though, and since the former is the more useful information, we fix `mysql::$client_version`. We do not add a regression test, because it would usually succeed anyway, and we already have several tests with respective `assert()`s.
1 parent 8c6a7c3 commit 8654c32

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ PHP NEWS
2020
cmb)
2121
. Fixed bug #79271 (DOMDocumentType::$childNodes is NULL). (cmb)
2222

23+
- MySQLi:
24+
. Fixed bug #64032 (mysqli reports different client_version). (cmb)
25+
2326
- PCRE:
2427
. Fixed bug #79188 (Memory corruption in preg_replace/preg_replace_callback
2528
and unicode). (Nikita)

ext/mysqli/mysqli_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static zval *driver_embedded_read(mysqli_object *obj, zval *retval)
9696
/* {{{ property driver_client_version_read */
9797
static zval *driver_client_version_read(mysqli_object *obj, zval *retval)
9898
{
99-
ZVAL_LONG(retval, MYSQL_VERSION_ID);
99+
ZVAL_LONG(retval, mysql_get_client_version());
100100
return retval;
101101
}
102102
/* }}} */

0 commit comments

Comments
 (0)