From 02da87f7378053e6386a8b28aa8cbd4e50fc0f66 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Mon, 30 Nov 2015 18:18:29 +0200 Subject: [PATCH] Fix to MXS-439: Weightby value of 0 no longer causes a crash A weightby parameter with a value of 0 no longer causes SIGFPE and the invalid weight value is set to the correct value of 1. --- server/modules/routing/readwritesplit/readwritesplit.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index 2b3215d74..433fcf24e 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -665,10 +665,7 @@ createInstance(SERVICE *service, char **options) if (perc == 0) { - if (wght != 0) - { - perc = 1; - } + perc = 1; MXS_ERROR("Weighting parameter '%s' with a value of %d for" " server '%s' rounds down to zero with total weight" " of %d for service '%s'. No queries will be "