Re: Wrong aggregate result when sorting by a NULL value
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Ondřej Bouda <obouda@email.cz>, pgsql-bugs@postgresql.org
Date: 2018-11-03T05:57:00Z
Lists: pgsql-bugs
Hi, On 2018-11-02 17:34:43 +0000, Andrew Gierth wrote: > >>>>> "Andres" == Andres Freund <andres@anarazel.de> writes: > > >> Andres, do you have time to look at this right now? > > Andres> Thanks for bisecting. I'll take a look later today. > > Looks like this: > > + scratch.d.agg_strict_input_check.nargs = numInputs; > > should have been pertrans->numTransInputs instead? That looks like it's precisely the reason. I'll push something tomorrow PST morning, crediting both you (diagnosis) and Tom (bisecting) obviously, unless you prefer to do so yourself. It's a bit sad that we don't have any tests that test this :/. I'll add something for the specific case, but that'll obviously not be exhaustive. Greetings, Andres Freund
Commits
-
Fix unused-variable warning.
- 6f4e01c7d289 11.1 landed
- 3e0b05a75673 12.0 landed
-
Prevent generating EEOP_AGG_STRICT_INPUT_CHECK operations when nargs == 0.
- 6eb31cedb316 11.1 landed
- 793beab37e8f 12.0 landed
-
Fix STRICT check for strict aggregates with NULL ORDER BY columns.
- fd59b29c8739 11.1 landed
- 4c640f4f38d5 12.0 landed
-
Expression evaluation based aggregate transition invocation.
- 69c3936a1499 11.0 cited