~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-proposed

« back to all changes in this revision

Viewing changes to src/test/regress/expected/join.out

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-07-24 16:13:59 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20140724161359-uk325qfv03euxuuh
Tags: 9.3.5-0ubuntu0.14.04.1
* New upstream bug fix release: (LP: #1348176)
  - pg_upgrade: Users who upgraded to version 9.3 using pg_upgrade may have
    an issue with transaction information which causes VACUUM to eventually
    fail. These users should run the script provided in the release notes to
    determine if their installation is affected, and then take the remedy
    steps outlined there.
  - Various data integrity and other bug fixes.
  - Secure Unix-domain sockets of temporary postmasters started during make
    check.
    Any local user able to access the socket file could connect as the
    server's bootstrap superuser, then proceed to execute arbitrary code as
    the operating-system user running the test, as we previously noted in
    CVE-2014-0067. This change defends against that risk by placing the
    server's socket in a temporary, mode 0700 subdirectory of /tmp.
  - See release notes for details:
    http://www.postgresql.org/about/news/1534/
* Remove pg_regress patches to support --host=/path, obsolete with above
  upstream changes and not applicable any more.
* Drop tcl8.6 patch, applied upstream.
* Add missing logrotate test dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2565
2565
(3 rows)
2566
2566
 
2567
2567
--
 
2568
-- nested nestloops can require nested PlaceHolderVars
 
2569
--
 
2570
create temp table nt1 (
 
2571
  id int primary key,
 
2572
  a1 boolean,
 
2573
  a2 boolean
 
2574
);
 
2575
create temp table nt2 (
 
2576
  id int primary key,
 
2577
  nt1_id int,
 
2578
  b1 boolean,
 
2579
  b2 boolean,
 
2580
  foreign key (nt1_id) references nt1(id)
 
2581
);
 
2582
create temp table nt3 (
 
2583
  id int primary key,
 
2584
  nt2_id int,
 
2585
  c1 boolean,
 
2586
  foreign key (nt2_id) references nt2(id)
 
2587
);
 
2588
insert into nt1 values (1,true,true);
 
2589
insert into nt1 values (2,true,false);
 
2590
insert into nt1 values (3,false,false);
 
2591
insert into nt2 values (1,1,true,true);
 
2592
insert into nt2 values (2,2,true,false);
 
2593
insert into nt2 values (3,3,false,false);
 
2594
insert into nt3 values (1,1,true);
 
2595
insert into nt3 values (2,2,false);
 
2596
insert into nt3 values (3,3,true);
 
2597
explain (costs off)
 
2598
select nt3.id
 
2599
from nt3 as nt3
 
2600
  left join
 
2601
    (select nt2.*, (nt2.b1 and ss1.a3) AS b3
 
2602
     from nt2 as nt2
 
2603
       left join
 
2604
         (select nt1.*, (nt1.id is not null) as a3 from nt1) as ss1
 
2605
         on ss1.id = nt2.nt1_id
 
2606
    ) as ss2
 
2607
    on ss2.id = nt3.nt2_id
 
2608
where nt3.id = 1 and ss2.b3;
 
2609
                  QUERY PLAN                   
 
2610
-----------------------------------------------
 
2611
 Nested Loop
 
2612
   ->  Nested Loop
 
2613
         ->  Index Scan using nt3_pkey on nt3
 
2614
               Index Cond: (id = 1)
 
2615
         ->  Index Scan using nt2_pkey on nt2
 
2616
               Index Cond: (id = nt3.nt2_id)
 
2617
   ->  Index Only Scan using nt1_pkey on nt1
 
2618
         Index Cond: (id = nt2.nt1_id)
 
2619
         Filter: (nt2.b1 AND (id IS NOT NULL))
 
2620
(9 rows)
 
2621
 
 
2622
select nt3.id
 
2623
from nt3 as nt3
 
2624
  left join
 
2625
    (select nt2.*, (nt2.b1 and ss1.a3) AS b3
 
2626
     from nt2 as nt2
 
2627
       left join
 
2628
         (select nt1.*, (nt1.id is not null) as a3 from nt1) as ss1
 
2629
         on ss1.id = nt2.nt1_id
 
2630
    ) as ss2
 
2631
    on ss2.id = nt3.nt2_id
 
2632
where nt3.id = 1 and ss2.b3;
 
2633
 id 
 
2634
----
 
2635
  1
 
2636
(1 row)
 
2637
 
 
2638
--
2568
2639
-- test case where a PlaceHolderVar is propagated into a subquery
2569
2640
--
2570
2641
explain (costs off)