Commit ea3ff730 authored by Daniele Sciascia's avatar Daniele Sciascia Committed by Nirbhay Choubey

GCF-837 Fix crash when loading wrong provider version

mysqld would crash with "double free or corrruption message"
if wrong provider version was given.
parent bf19492e
...@@ -484,8 +484,7 @@ int wsrep_init() ...@@ -484,8 +484,7 @@ int wsrep_init()
WSREP_ERROR("wsrep_load(%s) failed: %s (%d). Reverting to no provider.", WSREP_ERROR("wsrep_load(%s) failed: %s (%d). Reverting to no provider.",
wsrep_provider, strerror(rcode), rcode); wsrep_provider, strerror(rcode), rcode);
strcpy((char*)wsrep_provider, WSREP_NONE); // damn it's a dirty hack strcpy((char*)wsrep_provider, WSREP_NONE); // damn it's a dirty hack
(void) wsrep_init(); return wsrep_init();
return rcode;
} }
else /* this is for recursive call above */ else /* this is for recursive call above */
{ {
...@@ -671,6 +670,9 @@ void wsrep_init_startup (bool first) ...@@ -671,6 +670,9 @@ void wsrep_init_startup (bool first)
wsrep_thr_lock_init(wsrep_thd_is_BF, wsrep_abort_thd, wsrep_thr_lock_init(wsrep_thd_is_BF, wsrep_abort_thd,
wsrep_debug, wsrep_convert_LOCK_to_trx, wsrep_on); wsrep_debug, wsrep_convert_LOCK_to_trx, wsrep_on);
/* Skip replication start if dummy wsrep provider is loaded */
if (!strcmp(wsrep_provider, WSREP_NONE)) return;
/* Skip replication start if no cluster address */ /* Skip replication start if no cluster address */
if (!wsrep_cluster_address || strlen(wsrep_cluster_address) == 0) return; if (!wsrep_cluster_address || strlen(wsrep_cluster_address) == 0) return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment