diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-08-02 16:43:19 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-08-02 16:44:15 +0200 |
commit | 81efd489db387a6ab3c9bcafdfd65e304cf2ab08 (patch) | |
tree | 494dee916f0930c22f2795bdb6d3a8dd9d14a574 | |
parent | d89157cd677a00dd02ab890b0af9dc40389514e2 (diff) | |
parent | f9f4a68368406a2ba2bd9fab0494261090183e8e (diff) | |
download | php-git-81efd489db387a6ab3c9bcafdfd65e304cf2ab08.tar.gz |
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
Fix #78179: MariaDB server version incorrectly detected
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_connection.c | 8 |
2 files changed, 9 insertions, 0 deletions
@@ -25,6 +25,7 @@ PHP NEWS . Updated to LiteSpeed SAPI V7.5 (Fixed clean shutdown). (George Wang) - MySQLnd: + . Fixed bug #78179 (MariaDB server version incorrectly detected). (cmb) . Fixed bug #78213 (Empty row pocket). (cmb) - Standard: diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c index 5cb416e5ce..21a542517a 100644 --- a/ext/mysqlnd/mysqlnd_connection.c +++ b/ext/mysqlnd/mysqlnd_connection.c @@ -1436,6 +1436,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA * return 0; } +#define MARIA_DB_VERSION_HACK_PREFIX "5.5.5-" + + if (conn->server_capabilities & CLIENT_PLUGIN_AUTH + && !strncmp(p, MARIA_DB_VERSION_HACK_PREFIX, sizeof(MARIA_DB_VERSION_HACK_PREFIX)-1)) + { + p += sizeof(MARIA_DB_VERSION_HACK_PREFIX)-1; + } + major = ZEND_STRTOL(p, &p, 10); p += 1; /* consume the dot */ minor = ZEND_STRTOL(p, &p, 10); |