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

« back to all changes in this revision

Viewing changes to src/test/regress/sql/join.sql

  • 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:
661
661
  INNER JOIN tenk1 c ON qq = unique2;
662
662
 
663
663
--
 
664
-- nested nestloops can require nested PlaceHolderVars
 
665
--
 
666
 
 
667
create temp table nt1 (
 
668
  id int primary key,
 
669
  a1 boolean,
 
670
  a2 boolean
 
671
);
 
672
create temp table nt2 (
 
673
  id int primary key,
 
674
  nt1_id int,
 
675
  b1 boolean,
 
676
  b2 boolean,
 
677
  foreign key (nt1_id) references nt1(id)
 
678
);
 
679
create temp table nt3 (
 
680
  id int primary key,
 
681
  nt2_id int,
 
682
  c1 boolean,
 
683
  foreign key (nt2_id) references nt2(id)
 
684
);
 
685
 
 
686
insert into nt1 values (1,true,true);
 
687
insert into nt1 values (2,true,false);
 
688
insert into nt1 values (3,false,false);
 
689
insert into nt2 values (1,1,true,true);
 
690
insert into nt2 values (2,2,true,false);
 
691
insert into nt2 values (3,3,false,false);
 
692
insert into nt3 values (1,1,true);
 
693
insert into nt3 values (2,2,false);
 
694
insert into nt3 values (3,3,true);
 
695
 
 
696
explain (costs off)
 
697
select nt3.id
 
698
from nt3 as nt3
 
699
  left join
 
700
    (select nt2.*, (nt2.b1 and ss1.a3) AS b3
 
701
     from nt2 as nt2
 
702
       left join
 
703
         (select nt1.*, (nt1.id is not null) as a3 from nt1) as ss1
 
704
         on ss1.id = nt2.nt1_id
 
705
    ) as ss2
 
706
    on ss2.id = nt3.nt2_id
 
707
where nt3.id = 1 and ss2.b3;
 
708
 
 
709
select nt3.id
 
710
from nt3 as nt3
 
711
  left join
 
712
    (select nt2.*, (nt2.b1 and ss1.a3) AS b3
 
713
     from nt2 as nt2
 
714
       left join
 
715
         (select nt1.*, (nt1.id is not null) as a3 from nt1) as ss1
 
716
         on ss1.id = nt2.nt1_id
 
717
    ) as ss2
 
718
    on ss2.id = nt3.nt2_id
 
719
where nt3.id = 1 and ss2.b3;
 
720
 
 
721
--
664
722
-- test case where a PlaceHolderVar is propagated into a subquery
665
723
--
666
724