Forward-patch regression test for "could not find pathkey item to sort".

Commit a87c729153 already fixed the bug this
is checking for, but the regression test case it added didn't cover this
scenario.  Since we managed to miss the fact that there was a bug at all,
it seems like a good idea to propagate the extra test case forward to HEAD.
This commit is contained in:
Tom Lane 2014-06-26 10:40:50 -07:00
parent de42ed401a
commit 344eed91e9
2 changed files with 38 additions and 0 deletions

View File

@ -551,6 +551,28 @@ explain (costs off)
reset enable_seqscan;
reset enable_indexscan;
reset enable_bitmapscan;
-- This simpler variant of the above test has been observed to fail differently
create table events (event_id int primary key);
create table other_events (event_id int primary key);
create table events_child () inherits (events);
explain (costs off)
select event_id
from (select event_id from events
union all
select event_id from other_events) ss
order by event_id;
QUERY PLAN
----------------------------------------------------------
Merge Append
Sort Key: events.event_id
-> Index Scan using events_pkey on events
-> Sort
Sort Key: events_child.event_id
-> Seq Scan on events_child
-> Index Scan using other_events_pkey on other_events
(7 rows)
drop table events_child, events, other_events;
reset enable_indexonlyscan;
-- Test constraint exclusion of UNION ALL subqueries
explain (costs off)

View File

@ -229,6 +229,22 @@ explain (costs off)
reset enable_seqscan;
reset enable_indexscan;
reset enable_bitmapscan;
-- This simpler variant of the above test has been observed to fail differently
create table events (event_id int primary key);
create table other_events (event_id int primary key);
create table events_child () inherits (events);
explain (costs off)
select event_id
from (select event_id from events
union all
select event_id from other_events) ss
order by event_id;
drop table events_child, events, other_events;
reset enable_indexonlyscan;
-- Test constraint exclusion of UNION ALL subqueries