MariaDB10 embedded library version string

MariaDB10 embedded library version string
This commit is contained in:
MassimilianoPinto
2015-06-03 09:41:12 +02:00
parent 6cb0248ab8
commit cedaeb7fe9
2 changed files with 15 additions and 1 deletions

View File

@ -417,7 +417,21 @@ hashtable_memory_fns(monitorhash,strdup,NULL,free,NULL);
} }
if (version_string) { if (version_string) {
/** Add the 5.5.5- string to the start of the version string if
* the version string starts with "10.".
* This mimics MariaDB 10.0 replication which adds 5.5.5- for backwards compatibility. */
if(strncmp(version_string,"10.",3) == 0)
{
((SERVICE *)(obj->element))->version_string = malloc((strlen(version_string) +
strlen("5.5.5-") + 1) * sizeof(char));
strcpy(((SERVICE *)(obj->element))->version_string,"5.5.5-");
strcat(((SERVICE *)(obj->element))->version_string,version_string);
}
else
{
((SERVICE *)(obj->element))->version_string = strdup(version_string); ((SERVICE *)(obj->element))->version_string = strdup(version_string);
}
} else { } else {
if (gateway.version_string) if (gateway.version_string)
((SERVICE *)(obj->element))->version_string = strdup(gateway.version_string); ((SERVICE *)(obj->element))->version_string = strdup(gateway.version_string);

View File

@ -2381,7 +2381,7 @@ void blr_handle_change_master(ROUTER_INSTANCE* router, char *command) {
/* /*
* Change values in the router->service->dbref->server structure * Change values in the router->service->dbref->server structure
* Change binlogfilename and position in the router scrutcure * Change binlogfilename and position in the router structure
*/ */
spinlock_acquire(&router->lock); spinlock_acquire(&router->lock);