pgpool2.git / summary / log / commit / refs

commit    caf5215479ee7a5b55c1dcdeb00a2fccf0ed7133
Author:   Tatsuo Ishii <ishii@sraoss.co.jp>
Date:     Sun Feb 14 00:28:38 2021 +0000

    Fix pcp_node_info() in pgpool_adm extension.
    
    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.


src/sql/pgpool_adm/pgpool_adm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sql/pgpool_adm/pgpool_adm.c b/src/sql/pgpool_adm/pgpool_adm.c index f7950f7f9..4da51a00f 100644 --- a/src/sql/pgpool_adm/pgpool_adm.c +++ b/src/sql/pgpool_adm/pgpool_adm.c @@ -3,7 +3,7 @@ * pgpool_adm.c * * - * Copyright (c) 2002-2020, PostgreSQL Global Development Group + * Copyright (c) 2002-2021, PostgreSQL Global Development Group * * Author: Jehan-Guillaume (ioguix) de Rorthais <jgdr@dalibo.com> * @@ -214,7 +214,7 @@ _pcp_node_info(PG_FUNCTION_ARGS) 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; nulls[4] = false; [parent: 7bd103a6a33a]