Added fix for MariaDB 10.0 embedded server missing the 5.5.5- string from the server handshake.

This commit is contained in:
Markus Makela 2015-04-28 18:31:30 +03:00
parent 3874400abf
commit 74b5e1ddcf

View File

@ -211,10 +211,18 @@ int rval;
if (mysql_real_connect(conn, NULL, NULL, NULL, NULL, 0, NULL, 0)) {
char *ptr;
version_string = (char *)mysql_get_server_info(conn);
unsigned int server_version = mysql_get_server_version(conn);
ptr = strstr(version_string, "-embedded");
if (ptr) {
*ptr = '\0';
}
if (server_version >= 100000)
{
char* tmpstr = malloc(strlen(version_string) + strlen("5.5.5-") + 1);
strcpy(tmpstr,"5.5.5-");
strcat(tmpstr,version_string);
version_string = tmpstr;
}
}
mysql_close(conn);
}