Re: BUG #18764: server closed the connection unexpectedly
От | Richard Guo |
---|---|
Тема | Re: BUG #18764: server closed the connection unexpectedly |
Дата | |
Msg-id | CAMbWs49c7-RbgZ-_6c4HTOS52LJjoGkkdCP7Q1E9yEq=tziR6w@mail.gmail.com обсуждение исходный текст |
Ответ на | BUG #18764: server closed the connection unexpectedly (PG Bug reporting form <noreply@postgresql.org>) |
Список | pgsql-bugs |
On Thu, Jan 9, 2025 at 12:44 PM David Rowley <dgrowleyml@gmail.com> wrote: > On Tue, 7 Jan 2025 at 02:14, Richard Guo <guofenglinux@gmail.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
В списке pgsql-bugs по дате отправления: