Re: Patch to fix write after end of array in hashed agg initialization

2019-05-23 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: Andrew> My inclination is to fix this in the planner rather than the Andrew> executor; there seems no good reason to actually hash a Andrew> duplicate column more than once. I take this back; I don't believe it's possible to eliminate duplicates in all

Re: Patch to fix write after end of array in hashed agg initialization

2019-05-22 Thread Andrew Gierth
> "Tom" == Tom Lane writes: > Andrew Gierth writes: >> My inclination is to fix this in the planner rather than the >> executor; there seems no good reason to actually hash a duplicate >> column more than once. Tom> Sounds reasonable --- but would it make sense to introduce some Tom>

Re: Patch to fix write after end of array in hashed agg initialization

2019-05-22 Thread Tom Lane
Andrew Gierth writes: > My inclination is to fix this in the planner rather than the executor; > there seems no good reason to actually hash a duplicate column more than > once. Sounds reasonable --- but would it make sense to introduce some assertions, or other cheap tests, into the executor to

Re: Patch to fix write after end of array in hashed agg initialization

2019-05-22 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: >>> Attached is a patch for a write after allocated memory which we >>> found in testing. Its an obscure case but can happen if the same >>> column is used in different grouping keys, as in the example below, >>> which uses tables from the regress test

Re: Patch to fix write after end of array in hashed agg initialization

2019-05-22 Thread Andrew Gierth
> "Tom" == Tom Lane writes: >> Attached is a patch for a write after allocated memory which we >> found in testing. Its an obscure case but can happen if the same >> column is used in different grouping keys, as in the example below, >> which uses tables from the regress test suite (build

Re: Patch to fix write after end of array in hashed agg initialization

2019-05-22 Thread Tom Lane
Colm McHugh writes: > Attached is a patch for a write after allocated memory which we found in > testing. Its an obscure case but can happen if the same column is used in > different grouping keys, as in the example below, which uses tables from > the regress test suite (build with --enable-casser