From 2319836cb6f6e3f246ab79fdd2bcbcc09d0ef249 Mon Sep 17 00:00:00 2001 From: Pierre Senellart Date: Fri, 30 Aug 2024 15:59:28 +0800 Subject: [PATCH] Avoid hard-coding OIDs --- src/provsql.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/provsql.c b/src/provsql.c index 2476383..e1fb8d1 100644 --- a/src/provsql.c +++ b/src/provsql.c @@ -17,6 +17,7 @@ #include "parser/parsetree.h" #include "storage/lwlock.h" #include "storage/shmem.h" +#include "utils/fmgroids.h" #include "utils/syscache.h" #include "utils/lsyscache.h" #include "utils/guc.h" @@ -559,7 +560,7 @@ static Expr *make_aggregation_expression( expr_s->funcresulttype = constants->OID_TYPE_UUID; //check the particular case of count - if(agg_ref->aggfnoid==2803||agg_ref->aggfnoid==2147) //count(*) or count(arg) + if(agg_ref->aggfnoid==F_COUNT_||agg_ref->aggfnoid==F_COUNT_ANY) //count(*) or count(arg) { Const *one = makeConst(constants->OID_TYPE_INT, -1,