postgresql/src/test
Tom Lane d5b760ecb5 Fix crash when columns have been added to the end of a view.
expandRTE() supposed that an RTE_SUBQUERY subquery must have exactly
as many non-junk tlist items as the RTE has column aliases for it.
This was true at the time the code was written, and is still true so
far as parse analysis is concerned --- but when the function is used
during planning, the subquery might have appeared through insertion
of a view that now has more columns than it did when the outer query
was parsed.  This results in a core dump if, for instance, we have
to expand a whole-row Var that references the subquery.

To avoid crashing, we can either stop expanding the RTE when we run
out of aliases, or invent new aliases for the added columns.  While
the latter might be more useful, the former is consistent with what
expandRTE() does for composite-returning functions in the RTE_FUNCTION
case, so it seems like we'd better do it that way.

Per bug #14876 from Samuel Horwitz.  This has been busted since commit
ff1ea2173 allowed views to acquire more columns, so back-patch to all
supported branches.

Discussion: https://postgr.es/m/20171026184035.1471.82810@wrigleys.postgresql.org
2017-10-27 17:28:54 -04:00
..
authentication Post-PG 10 beta1 pgperltidy run 2017-05-17 19:01:23 -04:00
examples Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
isolation Exclude flex-generated code from coverage testing 2017-10-16 16:28:11 -04:00
ldap Log diagnostic messages if errors occur during LDAP auth. 2017-10-12 22:37:14 -04:00
locale Clean up Perl code according to perlcritic 2017-03-27 08:18:22 -04:00
mb Fix MB regression tests for WAL-logging of hash indexes. 2017-03-15 07:25:36 -04:00
modules Add missing clean step to src/test/modules/brin/Makefile. 2017-10-10 12:51:09 -04:00
perl Turn on log_replication_commands in PostgresNode 2017-09-26 16:05:25 -04:00
recovery Try to make crash restart test work on windows. 2017-10-01 15:24:58 -07:00
regress Fix crash when columns have been added to the end of a view. 2017-10-27 17:28:54 -04:00
ssl Remove incorrect comment 2017-06-17 10:19:48 +02:00
subscription Handle heap rewrites better in logical replication 2017-09-26 10:13:43 -04:00
thread Avoid use of bool in thread_test.c 2017-09-14 13:27:54 -04: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

README

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