summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-02-26 18:33:25 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2020-02-27 09:35:04 +0100
commit8654c32b584d448cbf9f341693b227db193fe155 (patch)
treefb2a0cf1c3c6b9ec42989228632d979c4020fe3f
parent8c6a7c3326f000af0a8ea266143059e5a463e626 (diff)
downloadphp-git-8654c32b584d448cbf9f341693b227db193fe155.tar.gz
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.
-rw-r--r--NEWS3
-rw-r--r--ext/mysqli/mysqli_driver.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 12208cf46a..353f7b0a13 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 019e902391..3464fccbc7 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;
}
/* }}} */