aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-06-26 10:40:55 -0700
committerTom Lane <tgl@sss.pgh.pa.us>2014-06-26 10:41:54 -0700
commit973837450c764b585321c965179eb8a57380ab5c (patch)
treefe43845e882f50466ac0a907d714efebe760f670 /src
parent2a741ca7658167c9061f9d0095992b326d6ffdbb (diff)
downloadpostgresql-973837450c764b585321c965179eb8a57380ab5c.tar.gz
postgresql-973837450c764b585321c965179eb8a57380ab5c.zip
Forward-patch regression test for "could not find pathkey item to sort".
Commit a87c729153e372f3731689a7be007bc2b53f1410 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.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/union.out22
-rw-r--r--src/test/regress/sql/union.sql16
2 files changed, 38 insertions, 0 deletions
diff --git a/src/test/regress/expected/union.out b/src/test/regress/expected/union.out
index 6a7d0f2a889..a678e960d49 100644
--- a/src/test/regress/expected/union.out
+++ b/src/test/regress/expected/union.out
@@ -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)
diff --git a/src/test/regress/sql/union.sql b/src/test/regress/sql/union.sql
index 5205435e2fd..9ff1551e5de 100644
--- a/src/test/regress/sql/union.sql
+++ b/src/test/regress/sql/union.sql
@@ -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