mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Strip MariaDB 10 prefix
Closes GH-7972
This commit is contained in:
parent
03816fba46
commit
5fc0db989e
4 changed files with 30 additions and 8 deletions
|
@ -41,6 +41,8 @@ const char mysqlnd_read_body_name[] = "mysqlnd_read_body";
|
|||
#define ERROR_MARKER 0xFF
|
||||
#define EODATA_MARKER 0xFE
|
||||
|
||||
#define MARIADB_RPL_VERSION_HACK "5.5.5-"
|
||||
|
||||
/* {{{ mysqlnd_command_to_text */
|
||||
const char * const mysqlnd_command_to_text[COM_END] =
|
||||
{
|
||||
|
@ -369,6 +371,11 @@ php_mysqlnd_greet_read(MYSQLND_CONN_DATA * conn, void * _packet)
|
|||
DBG_RETURN(PASS);
|
||||
}
|
||||
|
||||
/* MariaDB always sends 5.5.5 before version string: 5.5.5 was never released,
|
||||
so just ignore it */
|
||||
if (!strncmp((char *) p, MARIADB_RPL_VERSION_HACK, sizeof(MARIADB_RPL_VERSION_HACK) - 1))
|
||||
p+= sizeof(MARIADB_RPL_VERSION_HACK) - 1;
|
||||
|
||||
packet->server_version = estrdup((char *)p);
|
||||
p+= strlen(packet->server_version) + 1; /* eat the '\0' */
|
||||
BAIL_IF_NO_MORE_DATA;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue