summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-08-02 16:43:19 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2019-08-02 16:44:15 +0200
commit81efd489db387a6ab3c9bcafdfd65e304cf2ab08 (patch)
tree494dee916f0930c22f2795bdb6d3a8dd9d14a574
parentd89157cd677a00dd02ab890b0af9dc40389514e2 (diff)
parentf9f4a68368406a2ba2bd9fab0494261090183e8e (diff)
downloadphp-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--NEWS1
-rw-r--r--ext/mysqlnd/mysqlnd_connection.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 8d7f205b7a..41267187e0 100644
--- a/NEWS
+++ b/NEWS
@@ -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);