git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 07bd77b) | patch
Fix handling of NULLs returned by aggregate combine functions.
2017年11月24日 01:13:09 +0000 (17:13 -0800)
2017年11月24日 01:15:27 +0000 (17:15 -0800)
commit 59b71c6fe6ca89566f40439bcdff94a2f5b39a92
Fix handling of NULLs returned by aggregate combine functions.

When strict aggregate combine functions, used in multi-stage/parallel
aggregation, returned NULL, we didn't check for that, invoking the
combine function with NULL the next round, despite it being strict.

The equivalent code invoking normal transition functions has a check
for that situation, which did not get copied in a7de3dc5c346. Fix the
bug by adding the equivalent check.

Based on a quick look I could not find any strict combine functions in
core actually returning NULL, and it doesn't seem very likely external
users have done so. So this isn't likely to have caused issues in
practice.

Add tests verifying transition / combine functions returning NULL is
tested.

Reported-By: Andres Freund
Author: Andres Freund
Discussion: https://postgr.es/m/20171121033642.7xvmjqrl4jdaaat3@alap3.anarazel.de
Backpatch: 9.6, where parallel aggregation was introduced
src/backend/executor/nodeAgg.c diff | blob | blame | history
src/test/regress/expected/aggregates.out diff | blob | blame | history
src/test/regress/sql/aggregates.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /