Re: Wrong aggregate result when sorting by a NULL value
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
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:44:10Z
Lists: pgsql-bugs
On 2018-11-04 11:19:59 -0500, Tom Lane wrote:
> Jeff Janes <jeff.janes@gmail.com> writes:
> > I'm now getting a compiler warning:
>
> > execExpr.c: In function 'ExecBuildAggTrans':
> > execExpr.c:2864:7: warning: unused variable 'numInputs' [-Wunused-variable]
> > int numInputs = pertrans->numInputs;
>
> 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.
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