pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix handling of NULLs returned by aggregate combine functions. 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix handling of NULLs returned by aggregate combine functions. @ 2017-11-24 01:19 Andres Freund <andres@anarazel.de> 0 siblings, 0 replies; 3+ messages in thread From: Andres Freund @ 2017-11-24 01:19 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/59b71c6fe6ca89566f40439bcdff94a2f5b39a92 Modified Files -------------- src/backend/executor/nodeAgg.c | 11 +++++ src/test/regress/expected/aggregates.out | 71 ++++++++++++++++++++++++++++++++ src/test/regress/sql/aggregates.sql | 63 ++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix handling of NULLs returned by aggregate combine functions. @ 2017-11-24 01:19 Andres Freund <andres@anarazel.de> 0 siblings, 0 replies; 3+ messages in thread From: Andres Freund @ 2017-11-24 01:19 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c60b898453f9b4d7de94c8e88bf08e930d117958 Modified Files -------------- src/backend/executor/nodeAgg.c | 11 +++++ src/test/regress/expected/aggregates.out | 71 ++++++++++++++++++++++++++++++++ src/test/regress/sql/aggregates.sql | 63 ++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix handling of NULLs returned by aggregate combine functions. @ 2017-11-24 01:19 Andres Freund <andres@anarazel.de> 0 siblings, 0 replies; 3+ messages in thread From: Andres Freund @ 2017-11-24 01:19 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c253b722f616d15c0b45c729465b4b85849cbcda Modified Files -------------- src/backend/executor/nodeAgg.c | 11 +++++ src/test/regress/expected/aggregates.out | 73 ++++++++++++++++++++++++++++++++ src/test/regress/sql/aggregates.sql | 65 ++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2017-11-24 01:19 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2017-11-24 01:19 pgsql: Fix handling of NULLs returned by aggregate combine functions. Andres Freund <andres@anarazel.de> 2017-11-24 01:19 pgsql: Fix handling of NULLs returned by aggregate combine functions. Andres Freund <andres@anarazel.de> 2017-11-24 01:19 pgsql: Fix handling of NULLs returned by aggregate combine functions. Andres Freund <andres@anarazel.de>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox