pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Postpone aggregate checks until after collation is assigned. 6+ messages / 1 participants [nested] [flat]
* pgsql: Postpone aggregate checks until after collation is assigned. @ 2019-01-17 06:47 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Gierth @ 2019-01-17 06:47 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Postpone aggregate checks until after collation is assigned. Previously, parseCheckAggregates was run before assign_query_collations, but this causes problems if any expression has already had a collation assigned by some transform function (e.g. transformCaseExpr) before parseCheckAggregates runs. The differing collations would cause expressions not to be recognized as equal to the ones in the GROUP BY clause, leading to spurious errors about unaggregated column references. The result was that CASE expr WHEN val ... would fail when "expr" contained a GROUPING() expression or matched one of the group by expressions, and where collatable types were involved; whereas the supposedly identical CASE WHEN expr = val ... would succeed. Backpatch all the way; this appears to have been wrong ever since collations were introduced. Per report from Guillaume Lelarge, analysis and patch by me. Discussion: https://postgr.es/m/CAECtzeVSO_US8C2Khgfv54ZMUOBR4sWq+6_bLrETnWExHT=rFg@mail.gmail.com Discussion: https://postgr.es/m/87muo0k0c7.fsf@news-spur.riddles.org.uk Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/624046abe23f3da003b8db07d7028c70f1c672bd Modified Files -------------- src/backend/parser/analyze.c | 18 ++++++++++++------ src/test/regress/expected/aggregates.out | 19 +++++++++++++++++++ src/test/regress/expected/groupingsets.out | 25 +++++++++++++++++++++++++ src/test/regress/sql/aggregates.sql | 8 ++++++++ src/test/regress/sql/groupingsets.sql | 11 +++++++++++ 5 files changed, 75 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Postpone aggregate checks until after collation is assigned. @ 2019-01-17 06:47 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Gierth @ 2019-01-17 06:47 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Postpone aggregate checks until after collation is assigned. Previously, parseCheckAggregates was run before assign_query_collations, but this causes problems if any expression has already had a collation assigned by some transform function (e.g. transformCaseExpr) before parseCheckAggregates runs. The differing collations would cause expressions not to be recognized as equal to the ones in the GROUP BY clause, leading to spurious errors about unaggregated column references. The result was that CASE expr WHEN val ... would fail when "expr" contained a GROUPING() expression or matched one of the group by expressions, and where collatable types were involved; whereas the supposedly identical CASE WHEN expr = val ... would succeed. Backpatch all the way; this appears to have been wrong ever since collations were introduced. Per report from Guillaume Lelarge, analysis and patch by me. Discussion: https://postgr.es/m/CAECtzeVSO_US8C2Khgfv54ZMUOBR4sWq+6_bLrETnWExHT=rFg@mail.gmail.com Discussion: https://postgr.es/m/87muo0k0c7.fsf@news-spur.riddles.org.uk Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/174fab993414dc80c594219aac7ba35669780b84 Modified Files -------------- src/backend/parser/analyze.c | 18 ++++++++++++------ src/test/regress/expected/aggregates.out | 19 +++++++++++++++++++ src/test/regress/sql/aggregates.sql | 8 ++++++++ 3 files changed, 39 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Postpone aggregate checks until after collation is assigned. @ 2019-01-17 06:47 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Gierth @ 2019-01-17 06:47 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Postpone aggregate checks until after collation is assigned. Previously, parseCheckAggregates was run before assign_query_collations, but this causes problems if any expression has already had a collation assigned by some transform function (e.g. transformCaseExpr) before parseCheckAggregates runs. The differing collations would cause expressions not to be recognized as equal to the ones in the GROUP BY clause, leading to spurious errors about unaggregated column references. The result was that CASE expr WHEN val ... would fail when "expr" contained a GROUPING() expression or matched one of the group by expressions, and where collatable types were involved; whereas the supposedly identical CASE WHEN expr = val ... would succeed. Backpatch all the way; this appears to have been wrong ever since collations were introduced. Per report from Guillaume Lelarge, analysis and patch by me. Discussion: https://postgr.es/m/CAECtzeVSO_US8C2Khgfv54ZMUOBR4sWq+6_bLrETnWExHT=rFg@mail.gmail.com Discussion: https://postgr.es/m/87muo0k0c7.fsf@news-spur.riddles.org.uk Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/409230a721cf32a2df4fd02338e785b3993f9c7a Modified Files -------------- src/backend/parser/analyze.c | 18 ++++++++++++------ src/test/regress/expected/aggregates.out | 19 +++++++++++++++++++ src/test/regress/expected/groupingsets.out | 25 +++++++++++++++++++++++++ src/test/regress/sql/aggregates.sql | 8 ++++++++ src/test/regress/sql/groupingsets.sql | 11 +++++++++++ 5 files changed, 75 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Postpone aggregate checks until after collation is assigned. @ 2019-01-17 06:47 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Gierth @ 2019-01-17 06:47 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Postpone aggregate checks until after collation is assigned. Previously, parseCheckAggregates was run before assign_query_collations, but this causes problems if any expression has already had a collation assigned by some transform function (e.g. transformCaseExpr) before parseCheckAggregates runs. The differing collations would cause expressions not to be recognized as equal to the ones in the GROUP BY clause, leading to spurious errors about unaggregated column references. The result was that CASE expr WHEN val ... would fail when "expr" contained a GROUPING() expression or matched one of the group by expressions, and where collatable types were involved; whereas the supposedly identical CASE WHEN expr = val ... would succeed. Backpatch all the way; this appears to have been wrong ever since collations were introduced. Per report from Guillaume Lelarge, analysis and patch by me. Discussion: https://postgr.es/m/CAECtzeVSO_US8C2Khgfv54ZMUOBR4sWq+6_bLrETnWExHT=rFg@mail.gmail.com Discussion: https://postgr.es/m/87muo0k0c7.fsf@news-spur.riddles.org.uk Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/d16d453870958f79d49876b35e04682792f4ea99 Modified Files -------------- src/backend/parser/analyze.c | 18 ++++++++++++------ src/test/regress/expected/aggregates.out | 19 +++++++++++++++++++ src/test/regress/expected/groupingsets.out | 25 +++++++++++++++++++++++++ src/test/regress/sql/aggregates.sql | 8 ++++++++ src/test/regress/sql/groupingsets.sql | 11 +++++++++++ 5 files changed, 75 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Postpone aggregate checks until after collation is assigned. @ 2019-01-17 06:47 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Gierth @ 2019-01-17 06:47 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Postpone aggregate checks until after collation is assigned. Previously, parseCheckAggregates was run before assign_query_collations, but this causes problems if any expression has already had a collation assigned by some transform function (e.g. transformCaseExpr) before parseCheckAggregates runs. The differing collations would cause expressions not to be recognized as equal to the ones in the GROUP BY clause, leading to spurious errors about unaggregated column references. The result was that CASE expr WHEN val ... would fail when "expr" contained a GROUPING() expression or matched one of the group by expressions, and where collatable types were involved; whereas the supposedly identical CASE WHEN expr = val ... would succeed. Backpatch all the way; this appears to have been wrong ever since collations were introduced. Per report from Guillaume Lelarge, analysis and patch by me. Discussion: https://postgr.es/m/CAECtzeVSO_US8C2Khgfv54ZMUOBR4sWq+6_bLrETnWExHT=rFg@mail.gmail.com Discussion: https://postgr.es/m/87muo0k0c7.fsf@news-spur.riddles.org.uk Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/91448e7dcc1feb14e7ee05c15b157796331fa9e9 Modified Files -------------- src/backend/parser/analyze.c | 18 ++++++++++++------ src/test/regress/expected/aggregates.out | 19 +++++++++++++++++++ src/test/regress/expected/groupingsets.out | 25 +++++++++++++++++++++++++ src/test/regress/sql/aggregates.sql | 8 ++++++++ src/test/regress/sql/groupingsets.sql | 11 +++++++++++ 5 files changed, 75 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Postpone aggregate checks until after collation is assigned. @ 2019-01-17 06:47 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Andrew Gierth @ 2019-01-17 06:47 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Postpone aggregate checks until after collation is assigned. Previously, parseCheckAggregates was run before assign_query_collations, but this causes problems if any expression has already had a collation assigned by some transform function (e.g. transformCaseExpr) before parseCheckAggregates runs. The differing collations would cause expressions not to be recognized as equal to the ones in the GROUP BY clause, leading to spurious errors about unaggregated column references. The result was that CASE expr WHEN val ... would fail when "expr" contained a GROUPING() expression or matched one of the group by expressions, and where collatable types were involved; whereas the supposedly identical CASE WHEN expr = val ... would succeed. Backpatch all the way; this appears to have been wrong ever since collations were introduced. Per report from Guillaume Lelarge, analysis and patch by me. Discussion: https://postgr.es/m/CAECtzeVSO_US8C2Khgfv54ZMUOBR4sWq+6_bLrETnWExHT=rFg@mail.gmail.com Discussion: https://postgr.es/m/87muo0k0c7.fsf@news-spur.riddles.org.uk Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e74d8c5085aaf132be55670e8db5b019c7c3f4d3 Modified Files -------------- src/backend/parser/analyze.c | 18 ++++++++++++------ src/test/regress/expected/aggregates.out | 19 +++++++++++++++++++ src/test/regress/expected/groupingsets.out | 25 +++++++++++++++++++++++++ src/test/regress/sql/aggregates.sql | 8 ++++++++ src/test/regress/sql/groupingsets.sql | 11 +++++++++++ 5 files changed, 75 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2019-01-17 06:47 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-01-17 06:47 pgsql: Postpone aggregate checks until after collation is assigned. Andrew Gierth <rhodiumtoad@postgresql.org> 2019-01-17 06:47 pgsql: Postpone aggregate checks until after collation is assigned. Andrew Gierth <rhodiumtoad@postgresql.org> 2019-01-17 06:47 pgsql: Postpone aggregate checks until after collation is assigned. Andrew Gierth <rhodiumtoad@postgresql.org> 2019-01-17 06:47 pgsql: Postpone aggregate checks until after collation is assigned. Andrew Gierth <rhodiumtoad@postgresql.org> 2019-01-17 06:47 pgsql: Postpone aggregate checks until after collation is assigned. Andrew Gierth <rhodiumtoad@postgresql.org> 2019-01-17 06:47 pgsql: Postpone aggregate checks until after collation is assigned. Andrew Gierth <rhodiumtoad@postgresql.org>
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