Re: Core dump in range_table_mutator()

2022-06-26 Thread Tom Lane
Dean Rasheed writes: > On Sat, 25 Jun 2022 at 04:39, Tom Lane wrote: >> Well, if we want to clean this up a bit rather than just doing the >> minimum safe fix ... I spent some time why we were bothering with the >> FLATCOPY step at all, rather than just mutating the Query* pointer. >> I think

Re: Core dump in range_table_mutator()

2022-06-25 Thread Dean Rasheed
On Sat, 25 Jun 2022 at 04:39, Tom Lane wrote: > > Well, if we want to clean this up a bit rather than just doing the > minimum safe fix ... I spent some time why we were bothering with the > FLATCOPY step at all, rather than just mutating the Query* pointer. > I think the reason is to not fail if

Re: Core dump in range_table_mutator()

2022-06-24 Thread Tom Lane
Dean Rasheed writes: > Not directly related to that change ... I think it would be easier to > follow if the CHECKFLATCOPY() was replaced with a separate Assert() > and FLATCOPY() (I had to go and remind myself what CHECKFLATCOPY() > did). > Doing that would allow CHECKFLATCOPY() to be deleted,

Re: Core dump in range_table_mutator()

2022-06-24 Thread Dean Rasheed
On Fri, 24 Jun 2022 at 22:44, Tom Lane wrote: > > Commit 64919aaab made pull_up_simple_subquery set rte->subquery = NULL > after doing the deed, so that we don't waste cycles copying a > now-useless subquery tree around. I discovered today while > working on another patch that if you invoke

Core dump in range_table_mutator()

2022-06-24 Thread Tom Lane
Commit 64919aaab made pull_up_simple_subquery set rte->subquery = NULL after doing the deed, so that we don't waste cycles copying a now-useless subquery tree around. I discovered today while working on another patch that if you invoke query_tree_mutator or range_table_mutator on the whole Query