Skip to content

Commit e60c507

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

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
@@ -22,6 +22,7 @@ PHP NEWS
2222
Jung)
2323

2424
- MySQLnd:
25+
. Fixed bug #78179 (MariaDB server version incorrectly detected). (cmb)
2526
. Fixed bug #78213 (Empty row pocket). (cmb)
2627

2728
- Opcache:

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)