postgresql/src/test
Tom Lane 90947674fc Fix incorrect handling of subquery pullup in the presence of grouping sets.
If we flatten a subquery whose target list contains constants or
expressions, when those output columns are used in GROUPING SET columns,
the planner was capable of doing the wrong thing by merging a pulled-up
expression into the surrounding expression during const-simplification.
Then the late processing that attempts to match subexpressions to grouping
sets would fail to match those subexpressions to grouping sets, with the
effect that they'd not go to null when expected.

To fix, wrap such subquery outputs in PlaceHolderVars, ensuring that
they preserve their separate identity throughout the planner's expression
processing.  This is a bit of a band-aid, because the wrapper defeats
const-simplification even in places where it would be safe to allow.
But a nicer fix would likely be too invasive to back-patch, and the
consequences of the missed optimizations probably aren't large in most
cases.

Back-patch to 9.5 where grouping sets were introduced.

Heikki Linnakangas, with small mods and better test cases by me;
additional review by Andrew Gierth

Discussion: https://postgr.es/m/7dbdcf5c-b5a6-ef89-4958-da212fe10176@iki.fi
2018-01-12 12:24:50 -05:00
..
authentication Update copyright for 2018 2018-01-02 23:30:12 -05:00
examples Update copyright for 2018 2018-01-02 23:30:12 -05:00
isolation Revert "Fix isolation test to be less timing-dependent" 2018-01-03 18:22:41 -03:00
ldap Allow ldaps when using ldap authentication 2018-01-03 10:11:26 -05:00
locale Add a temp-install prerequisite to "check"-like targets not having one. 2017-11-05 18:51:08 -08:00
mb Fix MB regression tests for WAL-logging of hash indexes. 2017-03-15 07:25:36 -04:00
modules Update copyright for 2018 2018-01-02 23:30:12 -05:00
perl Refactor subscription tests to use PostgresNode's wait_for_catchup 2018-01-11 13:35:38 -05:00
recovery Update copyright for 2018 2018-01-02 23:30:12 -05:00
regress Fix incorrect handling of subquery pullup in the presence of grouping sets. 2018-01-12 12:24:50 -05:00
ssl Fix ssl tests for when tls-server-end-point is not supported 2018-01-09 12:28:49 -05:00
subscription Refactor subscription tests to use PostgresNode's wait_for_catchup 2018-01-11 13:35:38 -05:00
thread Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Add LDAP authentication test suite 2017-09-15 11:44:29 -04:00
README Add TAP tests for password-based authentication methods. 2017-03-17 11:34:16 +02:00

PostgreSQL tests
================

This directory contains a variety of test infrastructure as well as some of the
tests in PostgreSQL. Not all tests are here -- in particular, there are more in
individual contrib/ modules and in src/bin.

Not all these tests get run by "make check". Check src/test/Makefile to see
which tests get run automatically.

authentication/
  Tests for authentication

examples/
  Demonstration programs for libpq that double as regression tests via
  "make check"

isolation/
  Tests for concurrent behavior at the SQL level

locale/
  Sanity checks for locale data, encodings, etc

mb/
  Tests for multibyte encoding (UTF-8) support

modules/
  Extensions used only or mainly for test purposes, generally not suitable
  for installing in production databases

perl/
  Infrastructure for Perl-based TAP tests

recovery/
  Test suite for recovery and replication

regress/
  PostgreSQL's main regression test suite, pg_regress

ssl/
  Tests to exercise and verify SSL certificate handling

subscription/
  Tests for logical replication

thread/
  A thread-safety-testing utility used by configure