summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--ext/mysqlnd/mysqlnd_connection.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index f8508d2a30..31b67125f6 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,9 @@ PHP NEWS
- LiteSpeed:
. Updated to LiteSpeed SAPI V7.5 (Fixed clean shutdown). (George Wang)
+- MySQLnd:
+ . Fixed bug #78179 (MariaDB server version incorrectly detected). (cmb)
+
- Standard:
. Fixed bug #69100 (Bus error from stream_copy_to_stream (file -> SSL stream)
with invalid length). (Nikita)
diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c
index dc42a16b6d..42de003ef9 100644
--- a/ext/mysqlnd/mysqlnd_connection.c
+++ b/ext/mysqlnd/mysqlnd_connection.c
@@ -1485,6 +1485,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);