Re: Wrong aggregate result when sorting by a NULL value

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Jeff Janes <jeff.janes@gmail.com>, Andrew Gierth <andrew@tao11.riddles.org.uk>, obouda@email.cz, Pg Bugs <pgsql-bugs@postgresql.org>
Date: 2018-11-04T23:49:40Z
Lists: pgsql-bugs
Andres Freund <andres@anarazel.de> writes:
> On 2018-11-04 11:19:59 -0500, Tom Lane wrote:
>> Used-for-asserts-only problem.  Will fix.

> Thanks.  I wonder if we shouldn't turn Asserts() into something roughly
> akin to if (0) {expr};. That way we'd not deal with errors about unused
> variables anymore - we're not safe against unreachable code warnings
> anyway.

Meh.  I'm unexcited about getting rid of one type of compiler warning by
introducing another one.

			regards, tom lane


Commits

  1. Fix unused-variable warning.

  2. Prevent generating EEOP_AGG_STRICT_INPUT_CHECK operations when nargs == 0.

  3. Fix STRICT check for strict aggregates with NULL ORDER BY columns.

  4. Expression evaluation based aggregate transition invocation.