The weight info was mistakenly handled by Float8GetDatum although the
function prototype is float4. The oversight made the weight value to 0
or certain insane value. Change it to Float4GetDatum. It is amazing
that nobody (including me) did not notice it until today.
* pgpool_adm.c
*
*
- * Copyright (c) 2002-2015, PostgreSQL Global Development Group
+ * Copyright (c) 2002-2021, PostgreSQL Global Development Group
*
* Author: Jehan-Guillaume (ioguix) de Rorthais <jgdr@dalibo.com>
*
break;
}
nulls[2] = false;
- values[3] = Float8GetDatum(backend_info->backend_weight/RAND_MAX);
+ values[3] = Float4GetDatum(backend_info->backend_weight / RAND_MAX);
nulls[3] = false;
pcp_disconnect(pcpConnInfo);