cat > script <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
select from t1;
select from t1 where b in (1, 2, 4);
select from tt;
select from t1 where b in (select aa from tt);
select from ttt;
select from t1 where b in (select aa from tt where aa in (select aaa from ttt));
select from t1 where b in (select aa from tt, tt);
select from t1 where b in (select aa from tt, ttt);
select from t1 where b in (select aaa from tt, ttt);
select from ttt insert into tt2;
rename attr tt2.aaa aa;
select from t1 where b in (select aa from tt, tt2);
select from t1 where b in (select aa from tt2, tt);
select from ttt;
select from t1 where b > (select aaa from ttt);
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 script
cat > stdout <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
* select from t1;
a                b

abc              1
bcd              2
cde              3
def              4
efg              5
* select from t1 where b in (1, 2, 4);
a                b

abc              1
bcd              2
def              4
* select from tt;
    aa

     1
     3
     5
* select from t1 where b in (select aa from tt);
a                b

abc              1
cde              3
efg              5
* select from ttt;
   aaa

     3
* select from t1 where b in (select aa from tt where aa in (select aaa from ttt));
a                b

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

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

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

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

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

cde              3
* select from ttt;
   aaa

     3
* select from t1 where b > (select aaa from ttt);
a                b

def              4
efg              5
* 
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 stdout
cat > tag <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
Test to make sure "complex select" still work.
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 tag
