diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-02-26 18:33:25 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-02-27 09:35:04 +0100 |
commit | 8654c32b584d448cbf9f341693b227db193fe155 (patch) | |
tree | fb2a0cf1c3c6b9ec42989228632d979c4020fe3f | |
parent | 8c6a7c3326f000af0a8ea266143059e5a463e626 (diff) | |
download | php-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-- | NEWS | 3 | ||||
-rw-r--r-- | ext/mysqli/mysqli_driver.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -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; } /* }}} */ |