From: | Richard Guo <guofenglinux(at)gmail(dot)com> |
---|---|
To: | David Rowley <dgrowleyml(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, dqetool(at)126(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org |
Subject: | Re: BUG #18764: server closed the connection unexpectedly |
Date: | 2025-01-09 07:38:09 |
Message-ID: | CAMbWs49c7-RbgZ-_6c4HTOS52LJjoGkkdCP7Q1E9yEq=tziR6w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Thu, Jan 9, 2025 at 12:44 PM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> On Tue, 7 Jan 2025 at 02:14, Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> > --- a/src/backend/optimizer/plan/planner.c
> > +++ b/src/backend/optimizer/plan/planner.c
> > @@ -8091,6 +8091,9 @@ generate_setop_child_grouplist(SetOperationStmt
> > *op, List *targetlist)
> > {
> > TargetEntry *tle = (TargetEntry *) lfirst(lt);
> > SortGroupClause *sgc;
> > + Oid opfamily,
> > + opcintype;
> > + int16 strategy;
> >
> > /* resjunk columns could have sortgrouprefs. Leave these alone */
> > if (tle->resjunk)
> > @@ -8101,6 +8104,18 @@ generate_setop_child_grouplist(SetOperationStmt
> > *op, List *targetlist)
> > sgc = (SortGroupClause *) lfirst(lg);
> > lg = lnext(grouplist, lg);
> >
> > + if (!OidIsValid(sgc->sortop))
> > + return NIL;
> > +
> > + /* Find the operator in pg_amop --- failure shouldn't happen */
> > + if (!get_ordering_op_properties(sgc->sortop,
> > + &opfamily, &opcintype, &strategy))
> > + elog(ERROR, "operator %u is not a valid ordering operator",
> > + sgc->sortop);
> > +
> > + if (exprType((Node *) tle->expr) != opcintype)
> > + return NIL;
> > +
> > /* assign a tleSortGroupRef, or reuse the existing one */
> > sgc->tleSortGroupRef = assignSortGroupRef(tle, targetlist);
> > }
>
> Can't you just look up the setop's type from op->colTypes instead of
> looking the type up via the sortop? i.e. the attached?
Yeah, right. Using SetOperationStmt.colTypes is more convenient here.
Thanks
Richard
From | Date | Subject | |
---|---|---|---|
Next Message | PG Bug reporting form | 2025-01-09 09:45:43 | BUG #18769: ldapscheme is not displayed in pg_hba_file_rules |
Previous Message | Tom Lane | 2025-01-09 04:14:38 | Re: BUG #18764: server closed the connection unexpectedly |