summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/join.out
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2022-05-18 20:28:31 +0200
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2022-05-18 20:28:31 +0200
commit0fbf0112002355efb2bb525ab88edf891dbfd033 (patch)
treed7502d8094aaabafce51d66c914f2f11370a1e4d /src/test/regress/expected/join.out
parent598ac10be1c20961baac44db773eb826f788fdfa (diff)
downloadpostgresql-0fbf0112002355efb2bb525ab88edf891dbfd033.tar.gz
Check column list length in XMLTABLE/JSON_TABLE alias
We weren't checking the length of the column list in the alias clause of an XMLTABLE or JSON_TABLE function (a "tablefunc" RTE), and it was possible to make the server crash by passing an overly long one. Fix it by throwing an error in that case, like the other places that deal with alias lists. In passing, modify the equivalent test used for join RTEs to look like the other ones, which was different for no apparent reason. This bug came in when XMLTABLE was born in version 10; backpatch to all stable versions. Reported-by: Wang Ke <krking@zju.edu.cn> Discussion: https://postgr.es/m/17480-1c9d73565bb28e90@postgresql.org
Diffstat (limited to 'src/test/regress/expected/join.out')
-rw-r--r--src/test/regress/expected/join.out3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/regress/expected/join.out b/src/test/regress/expected/join.out
index bd3375f2ba..2538bd6a79 100644
--- a/src/test/regress/expected/join.out
+++ b/src/test/regress/expected/join.out
@@ -5872,6 +5872,9 @@ select * from
3 | 3
(6 rows)
+-- check the number of columns specified
+SELECT * FROM (int8_tbl i cross join int4_tbl j) ss(a,b,c,d);
+ERROR: join expression "ss" has 3 columns available but 4 columns specified
-- check we don't try to do a unique-ified semijoin with LATERAL
explain (verbose, costs off)
select * from