postgresql/src/test/regress
Tom Lane d3b642ad99 Cope with lateral references in the quals of a subquery RTE.
The qual pushdown logic assumed that all Vars in a restriction clause
must be Vars referencing subquery outputs; but since we introduced
LATERAL, it's possible for such a Var to be a lateral reference instead.
This led to an assertion failure in debug builds.  In a non-debug
build, there might be no ill effects (if qual_is_pushdown_safe decided
the qual was unsafe anyway), or we could get failures later due to
construction of an invalid plan.  I've not gone to much length to
characterize the possible failures, but at least segfaults in the
executor have been observed.

Given that this has been busted since 9.3 and it took this long for
anybody to notice, I judge that the case isn't worth going to great
lengths to optimize.  Hence, fix by just teaching qual_is_pushdown_safe
that such quals are unsafe to push down, matching the previous behavior
when it accidentally didn't fail.

Per report from Tom Ellis.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/20200713175124.GQ8220@cloudinit-builder
2020-07-13 20:38:21 -04:00
..
data Fix full text search to handle NOT above a phrase search correctly. 2020-04-27 12:21:04 -04:00
expected Cope with lateral references in the quals of a subquery RTE. 2020-07-13 20:38:21 -04:00
input Fix typos. 2020-06-11 14:26:17 +05:30
output Fix typos. 2020-06-11 14:26:17 +05:30
sql Cope with lateral references in the quals of a subquery RTE. 2020-07-13 20:38:21 -04:00
.gitignore Update .gitignore for config.cache. 2014-12-18 19:56:42 +09:00
GNUmakefile Make install-tests target work with vpath builds 2020-05-31 18:35:08 -04:00
Makefile Fix non-GNU makefiles for AIX make. 2017-11-30 00:57:22 -08:00
parallel_schedule Fix crashes with currtid() and currtid2() 2020-06-01 10:32:53 +09:00
pg_regress.c Blind attempt to fix SSPI-auth case in 010_dump_connstr.pl. 2019-06-30 13:34:45 -04:00
pg_regress.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pg_regress_main.c tableam: introduce table AM infrastructure. 2019-03-06 09:54:38 -08:00
README Don't generate plain-text HISTORY and src/test/regress/README anymore. 2014-02-10 20:48:04 -05:00
regress.c Fix deadlock danger when atomic ops are done under spinlock. 2020-06-18 14:13:06 -07:00
regressplans.sh Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
resultmap Cygwin and Mingw floating-point fixes. 2019-02-16 01:50:16 +00:00
serial_schedule Fix crashes with currtid() and currtid2() 2020-06-01 10:32:53 +09:00
standby_schedule Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00

Documentation concerning how to run these regression tests and interpret
the results can be found in the PostgreSQL manual, in the chapter
"Regression Tests".