From 8654c32b584d448cbf9f341693b227db193fe155 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 26 Feb 2020 18:33:25 +0100 Subject: [PATCH] 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. --- NEWS | 3 +++ ext/mysqli/mysqli_driver.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 12208cf46ab..353f7b0a13a 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,9 @@ PHP NEWS cmb) . Fixed bug #79271 (DOMDocumentType::$childNodes is NULL). (cmb) +- MySQLi: + . Fixed bug #64032 (mysqli reports different client_version). (cmb) + - PCRE: . Fixed bug #79188 (Memory corruption in preg_replace/preg_replace_callback and unicode). (Nikita) diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c index 019e9023917..3464fccbc7d 100644 --- a/ext/mysqli/mysqli_driver.c +++ b/ext/mysqli/mysqli_driver.c @@ -96,7 +96,7 @@ static zval *driver_embedded_read(mysqli_object *obj, zval *retval) /* {{{ property driver_client_version_read */ static zval *driver_client_version_read(mysqli_object *obj, zval *retval) { - ZVAL_LONG(retval, MYSQL_VERSION_ID); + ZVAL_LONG(retval, mysql_get_client_version()); return retval; } /* }}} */