diff --git a/NEWS b/NEWS index 8d7f205b7ab..41267187e06 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 5cb416e5ceb..21a542517a9 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);