cat > script <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
select from tt;
create view vv as select from tt;
select from vv;
select from ttt;
create view vvv as select from ttt;
select from vvv;
create view v1 as select from t1 where b in (select aa from tt);
select from v1;
create view v2 as select from t1 where b in (select aa from vv);
select from v2;
create view v3 as select from t1 where b in (select aa from tt where
	aa in (select aaa from ttt));
select from v3;
create view v4 as select from t1 where b in (select aa from tt where
	aa in (select aaa from vvv));
select from v4;
create view v5 as select from t1 where b in (select aa from vv where
	aa in (select aaa from vvv));
select from v5;
create view v6 as select from t1 where b in (select aa from vv where
	aa in (select aaa from ttt));
select from v6;
create view v7 as select from t1 where b in (select aa from tt, tt);
select from v7;
create view v8 as select from t1 where b in (select aa from tt, ttt);
select from v8;
create view v9 as select from t1 where b in (select aaa from tt, ttt);
select from v9;
select from ttt insert into tt2;
rename attr tt2.aaa aa;
create view v10 as select from t1 where b in (select aa from tt, tt2);
select from v10;
create view v11 as select from t1 where b in (select aa from tt2, tt);
select from v11;
create view v12 as select from t1 where b > (select aaa from ttt);
select from v12;
create view v12a as select from v12;
select from v12a;
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 script
cat > stdout <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
* select from tt;
    aa

     1
     3
     5
* create view vv as select from tt;
* select from vv;
    aa

     1
     3
     5
* select from ttt;
   aaa

     3
* create view vvv as select from ttt;
* select from vvv;
   aaa

     3
* create view v1 as select from t1 where b in (select aa from tt);
* select from v1;
a                b

abc              1
cde              3
efg              5
* create view v2 as select from t1 where b in (select aa from vv);
* select from v2;
a                b

abc              1
cde              3
efg              5
* create view v3 as select from t1 where b in (select aa from tt where
. 	aa in (select aaa from ttt));
* select from v3;
a                b

cde              3
* create view v4 as select from t1 where b in (select aa from tt where
. 	aa in (select aaa from vvv));
* select from v4;
a                b

cde              3
* create view v5 as select from t1 where b in (select aa from vv where
. 	aa in (select aaa from vvv));
* select from v5;
a                b

cde              3
* create view v6 as select from t1 where b in (select aa from vv where
. 	aa in (select aaa from ttt));
* select from v6;
a                b

cde              3
* create view v7 as select from t1 where b in (select aa from tt, tt);
* select from v7;
a                b

abc              1
cde              3
efg              5
* create view v8 as select from t1 where b in (select aa from tt, ttt);
* select from v8;
a                b

abc              1
cde              3
efg              5
* create view v9 as select from t1 where b in (select aaa from tt, ttt);
* select from v9;
a                b

cde              3
* select from ttt insert into tt2;
* rename attr tt2.aaa aa;
* create view v10 as select from t1 where b in (select aa from tt, tt2);
* select from v10;
a                b

abc              1
cde              3
efg              5
* create view v11 as select from t1 where b in (select aa from tt2, tt);
* select from v11;
a                b

cde              3
* create view v12 as select from t1 where b > (select aaa from ttt);
* select from v12;
a                b

def              4
efg              5
* create view v12a as select from v12;
* select from v12a;
a                b

def              4
efg              5
* 
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 stdout
cat > tag <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
Test nested select capability on views.
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 tag
