# 副問い合わせに scalar subquery、row subquery 更新

Begin;
Initialize;
InitializeSession  "TESTDB";
Command "create database TESTDB";
TerminateSession;
InitializeSession  "TESTDB";
Command "create table T1(f1_index int, g1 int, h1 int, i1 int)";
Command "create  index I_T1_f1 on T1(f1_index)";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "create table T2(f2_index int, g2 int, h2 int, i2 int)";
Command "create  index I_T2_f2 on T2(f2_index)";
Command "insert T2 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647];
Command "create table T3(f3_index int, g3 int, h3 int, i3 int)";
Command "create  index I_T3_f3 on T3(f3_index)";
Command "insert T3 values (?,?,?,?),(?,?,?,?),(?,?,?,?)" [1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647];
Command "select * from (select f1_index from T1) as TBL left outer join (select avg(g1) from T1 where (f1_index = 6543210) and (TBL.f1_index = f1_index)) as X on (1=1)";
Command "update T1 as TBL set (f1_index) = (select avg(g1) from T1 where (f1_index = 6543210) and (TBL.f1_index = f1_index))";
Command "select f1_index from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "update T1 as TBL set (f1_index) = (select avg(g1) from T1 where (f1_index = 6543210) and (TBL.f1_index = f1_index))";
Command "select f1_index from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
Command "update T1 as TBL set (f1_index) = (select avg(g1) from T1 where (f1_index = 6543210) and (TBL.f1_index = f1_index))";
Command "commit";
Command "select f1_index from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1 where (f1_index = -2147483648)) as TBL left outer join (select h1,i1 from T1 where (exists (select * from T2 where T1.f1_index = T2.f2_index)) and (TBL.f1_index = f1_index) limit 1) as X on (1=1)";
CreatePreparedCommand "sel2" "update T1 as TBL set (f1_index,g1) = (select h1,i1 from T1 where (exists (select * from T2 where T1.f1_index = T2.f2_index)) and (TBL.f1_index = f1_index) limit 1),i1=i1 / 2 where (f1_index = -2147483648)";
PreparedCommand "sel2" [];
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
PreparedCommand "sel2" [];
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
PreparedCommand "sel2" [];
Command "commit";
Command "select f1_index,g1 from T1";
ErasePreparedCommand "sel2";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1 where (f1_index = -2147483648)) as TBL left outer join (select i2 from T2 where (f2_index = 6543210) and (TBL.f1_index = f2_index) limit 1) as X on (1=1)";
CreatePreparedCommand "sel3" "update T1 as TBL set (f1_index) = (select i2 from T2 where (f2_index = 6543210) and (TBL.f1_index = f2_index) limit 1) where (f1_index = -2147483648)";
PreparedCommand "sel3" [];
Command "select f1_index from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
PreparedCommand "sel3" [];
Command "select f1_index from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
PreparedCommand "sel3" [];
Command "commit";
Command "select f1_index from T1";
ErasePreparedCommand "sel3";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1) as TBL left outer join (select avg(f2_index),avg(g2) from T2 where (exists (select * from T3 where T2.f2_index = T3.f3_index)) and (TBL.f1_index = f2_index)) as X on (1=1)";
Command "update T1 as TBL set (f1_index,g1) = (select avg(f2_index),avg(g2) from T2 where (exists (select * from T3 where T2.f2_index = T3.f3_index)) and (TBL.f1_index = f2_index)),i1=i1 / 2";
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "update T1 as TBL set (f1_index,g1) = (select avg(f2_index),avg(g2) from T2 where (exists (select * from T3 where T2.f2_index = T3.f3_index)) and (TBL.f1_index = f2_index)),i1=i1 / 2";
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
Command "update T1 as TBL set (f1_index,g1) = (select avg(f2_index),avg(g2) from T2 where (exists (select * from T3 where T2.f2_index = T3.f3_index)) and (TBL.f1_index = f2_index)),i1=i1 / 2";
Command "commit";
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1 where (exists (select * from T2 where f1_index = T2.f2_index))) as TBL left outer join (select avg(g2),avg(h1),avg(i2),avg(f1_index) from T1,T2 where (T2.f2_index = 2147483647) and (TBL.f1_index = f1_index)) as X on (1=1)";
CreatePreparedCommand "sel5" "update T1 as TBL set (f1_index,g1,h1,i1) = (select avg(g2),avg(h1),avg(i2),avg(f1_index) from T1,T2 where (T2.f2_index = 2147483647) and (TBL.f1_index = f1_index)) where (exists (select * from T2 where f1_index = T2.f2_index))";
PreparedCommand "sel5" [];
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
PreparedCommand "sel5" [];
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
PreparedCommand "sel5" [];
Command "commit";
Command "select f1_index,g1,h1,i1 from T1";
ErasePreparedCommand "sel5";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1) as TBL left outer join (select h1,i2,f1_index,g2 from T1,T2 where (T1.f1_index = T2.f2_index) and (TBL.f1_index = f1_index) limit 1) as X on (1=1)";
Command "update T1 as TBL set (f1_index,g1,h1,i1) = (select h1,i2,f1_index,g2 from T1,T2 where (T1.f1_index = T2.f2_index) and (TBL.f1_index = f1_index) limit 1)";
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "update T1 as TBL set (f1_index,g1,h1,i1) = (select h1,i2,f1_index,g2 from T1,T2 where (T1.f1_index = T2.f2_index) and (TBL.f1_index = f1_index) limit 1)";
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
Command "update T1 as TBL set (f1_index,g1,h1,i1) = (select h1,i2,f1_index,g2 from T1,T2 where (T1.f1_index = T2.f2_index) and (TBL.f1_index = f1_index) limit 1)";
Command "commit";
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1 where (exists (select * from T2 where f1_index = T2.f2_index))) as TBL left outer join (select i3 from T2,T3 where (T3.f3_index = T2.f2_index) and (TBL.f1_index = f2_index) limit 1) as X on (1=1)";
Command "update T1 as TBL set (f1_index) = (select i3 from T2,T3 where (T3.f3_index = T2.f2_index) and (TBL.f1_index = f2_index) limit 1),i1=i1 / 2 where (exists (select * from T2 where f1_index = T2.f2_index))";
Command "select f1_index from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "update T1 as TBL set (f1_index) = (select i3 from T2,T3 where (T3.f3_index = T2.f2_index) and (TBL.f1_index = f2_index) limit 1),i1=i1 / 2 where (exists (select * from T2 where f1_index = T2.f2_index))";
Command "select f1_index from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
Command "update T1 as TBL set (f1_index) = (select i3 from T2,T3 where (T3.f3_index = T2.f2_index) and (TBL.f1_index = f2_index) limit 1),i1=i1 / 2 where (exists (select * from T2 where f1_index = T2.f2_index))";
Command "commit";
Command "select f1_index from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1 where (f1_index = -2147483648)) as TBL left outer join (select avg(f2_index),avg(g3) from T2,T3 where (T2.f2_index = -34567890) and (TBL.f1_index = f2_index)) as X on (1=1)";
Command "update T1 as TBL set (f1_index,g1) = (select avg(f2_index),avg(g3) from T2,T3 where (T2.f2_index = -34567890) and (TBL.f1_index = f2_index)) where (f1_index = -2147483648)";
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "update T1 as TBL set (f1_index,g1) = (select avg(f2_index),avg(g3) from T2,T3 where (T2.f2_index = -34567890) and (TBL.f1_index = f2_index)) where (f1_index = -2147483648)";
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
Command "update T1 as TBL set (f1_index,g1) = (select avg(f2_index),avg(g3) from T2,T3 where (T2.f2_index = -34567890) and (TBL.f1_index = f2_index)) where (f1_index = -2147483648)";
Command "commit";
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1) as TBL left outer join (select g3,h2,i3,f2_index from T2,T3 where (T3.f3_index = 6543210) and (TBL.f1_index = f2_index) limit 1) as X on (1=1)";
CreatePreparedCommand "sel9" "update T1 as TBL set (f1_index,g1,h1,i1) = (select g3,h2,i3,f2_index from T2,T3 where (T3.f3_index = 6543210) and (TBL.f1_index = f2_index) limit 1)";
PreparedCommand "sel9" [];
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
PreparedCommand "sel9" [];
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
PreparedCommand "sel9" [];
Command "commit";
Command "select f1_index,g1,h1,i1 from T1";
ErasePreparedCommand "sel9";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1 where (exists (select * from T2 where f1_index = T2.f2_index))) as TBL left outer join (select avg(h1),avg(i1),avg(f1_index),avg(g1) from T1 where (exists (select * from T2 where T1.f1_index = T2.f2_index)) and (TBL.f1_index = f1_index)) as X on (1=1)";
CreatePreparedCommand "sel10" "update T1 as TBL set (f1_index,g1,h1,i1) = (select avg(h1),avg(i1),avg(f1_index),avg(g1) from T1 where (exists (select * from T2 where T1.f1_index = T2.f2_index)) and (TBL.f1_index = f1_index)) where (exists (select * from T2 where f1_index = T2.f2_index))";
PreparedCommand "sel10" [];
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
PreparedCommand "sel10" [];
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
PreparedCommand "sel10" [];
Command "commit";
Command "select f1_index,g1,h1,i1 from T1";
ErasePreparedCommand "sel10";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1 where (f1_index = -2147483648)) as TBL left outer join (select avg(i2),avg(f2_index),avg(g2),avg(h2) from T2 where (exists (select * from T3 where T2.f2_index = T3.f3_index)) and (TBL.f1_index = f2_index)) as X on (1=1)";
Command "update T1 as TBL set (f1_index,g1,h1,i1) = (select avg(i2),avg(f2_index),avg(g2),avg(h2) from T2 where (exists (select * from T3 where T2.f2_index = T3.f3_index)) and (TBL.f1_index = f2_index)) where (f1_index = -2147483648)";
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "update T1 as TBL set (f1_index,g1,h1,i1) = (select avg(i2),avg(f2_index),avg(g2),avg(h2) from T2 where (exists (select * from T3 where T2.f2_index = T3.f3_index)) and (TBL.f1_index = f2_index)) where (f1_index = -2147483648)";
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
Command "update T1 as TBL set (f1_index,g1,h1,i1) = (select avg(i2),avg(f2_index),avg(g2),avg(h2) from T2 where (exists (select * from T3 where T2.f2_index = T3.f3_index)) and (TBL.f1_index = f2_index)) where (f1_index = -2147483648)";
Command "commit";
Command "select f1_index,g1,h1,i1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1 where (exists (select * from T2 where f1_index = T2.f2_index))) as TBL left outer join (select f1_index,g2 from T1,T2 where (T1.f1_index = -2147483648) and (TBL.f1_index = f1_index) limit 1) as X on (1=1)";
Command "update T1 as TBL set (f1_index,g1) = (select f1_index,g2 from T1,T2 where (T1.f1_index = -2147483648) and (TBL.f1_index = f1_index) limit 1) where (exists (select * from T2 where f1_index = T2.f2_index))";
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "update T1 as TBL set (f1_index,g1) = (select f1_index,g2 from T1,T2 where (T1.f1_index = -2147483648) and (TBL.f1_index = f1_index) limit 1) where (exists (select * from T2 where f1_index = T2.f2_index))";
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
Command "update T1 as TBL set (f1_index,g1) = (select f1_index,g2 from T1,T2 where (T1.f1_index = -2147483648) and (TBL.f1_index = f1_index) limit 1) where (exists (select * from T2 where f1_index = T2.f2_index))";
Command "commit";
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1 where (f1_index = -2147483648)) as TBL left outer join (select avg(g2) from T1,T2 where (T2.f2_index = T1.f1_index) and (TBL.f1_index = f1_index)) as X on (1=1)";
CreatePreparedCommand "sel13" "update T1 as TBL set (f1_index) = (select avg(g2) from T1,T2 where (T2.f2_index = T1.f1_index) and (TBL.f1_index = f1_index)),i1=i1 / 2 where (f1_index = -2147483648)";
PreparedCommand "sel13" [];
Command "select f1_index from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
PreparedCommand "sel13" [];
Command "select f1_index from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
PreparedCommand "sel13" [];
Command "commit";
Command "select f1_index from T1";
ErasePreparedCommand "sel13";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "select * from (select f1_index from T1 where (exists (select * from T2 where f1_index = T2.f2_index))) as TBL left outer join (select h2,i2 from T2 where (f2_index = -2147483648) and (TBL.f1_index = f2_index) limit 1) as X on (1=1)";
CreatePreparedCommand "sel14" "update T1 as TBL set (f1_index,g1) = (select h2,i2 from T2 where (f2_index = -2147483648) and (TBL.f1_index = f2_index) limit 1) where (exists (select * from T2 where f1_index = T2.f2_index))";
PreparedCommand "sel14" [];
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
PreparedCommand "sel14" [];
Command "select f1_index,g1 from T1";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "start transaction read write";
PreparedCommand "sel14" [];
Command "commit";
Command "select f1_index,g1 from T1";
ErasePreparedCommand "sel14";
Command "delete from T1";
Command "insert T1 values (?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?),(?,?,?,?)" [-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1,0,0,1,-1,1,1,-1,6543210,-1,-1,6543210,-34567890,6543210,6543210,-34567890,2147483647,-34567890,-34567890,2147483647,-2147483648,2147483647,2147483647,-2147483648,0,-2147483648,-2147483648,0,1];
Command "drop table T1";
Command "drop table T2";
Command "drop table T3";
TerminateSession;
InitializeSession  "TESTDB";
Command "drop database TESTDB";
TerminateSession;
Terminate;
End;
