Skip to content

Commit 81efd48

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Fix #78179: MariaDB server version incorrectly detected
2 parents d89157c + f9f4a68 commit 81efd48

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ PHP NEWS
2525
. Updated to LiteSpeed SAPI V7.5 (Fixed clean shutdown). (George Wang)
2626

2727
- MySQLnd:
28+
. Fixed bug #78179 (MariaDB server version incorrectly detected). (cmb)
2829
. Fixed bug #78213 (Empty row pocket). (cmb)
2930

3031
- Standard:

ext/mysqlnd/mysqlnd_connection.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA *
14361436
return 0;
14371437
}
14381438

1439+
#define MARIA_DB_VERSION_HACK_PREFIX "5.5.5-"
1440+
1441+
if (conn->server_capabilities & CLIENT_PLUGIN_AUTH
1442+
&& !strncmp(p, MARIA_DB_VERSION_HACK_PREFIX, sizeof(MARIA_DB_VERSION_HACK_PREFIX)-1))
1443+
{
1444+
p += sizeof(MARIA_DB_VERSION_HACK_PREFIX)-1;
1445+
}
1446+
14391447
major = ZEND_STRTOL(p, &p, 10);
14401448
p += 1; /* consume the dot */
14411449
minor = ZEND_STRTOL(p, &p, 10);

0 commit comments

Comments
 (0)