Begin;
Initialize;
InitializeSession  "TESTDB";
Command "create database TESTDB";
TerminateSession;
InitializeSession  "TESTDB";
Command "create table T(f1 int, f2 int)";
Command "create  index I_f1 on T(f1)";
Command "insert T values (?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?)" [6543210,-34567890,-34567890,2147483647,2147483647,-2147483648,-2147483648,0,0,1,1,-1,-1,6543210,6543210,-34567890,-34567890,2147483647,2147483647,-2147483648];
CreatePreparedCommand "sel1" "select * from T where ? = f1";
PreparedCommand "sel1" [-2147483648];
PreparedCommand "sel1" [-2147483648];
Command "start transaction read write";
PreparedCommand "sel1" [-2147483648];
Command "commit";
ErasePreparedCommand "sel1";
CreatePreparedCommand "sel2" "select * from T where f1 = ? or f2 > -5000000 limit 1";
PreparedCommand "sel2" [-2147483648];
PreparedCommand "sel2" [-2147483648];
Command "start transaction read write";
PreparedCommand "sel2" [-2147483648];
Command "commit";
ErasePreparedCommand "sel2";
CreatePreparedCommand "sel3" "select * from T where ? > f1 or f2 > -5000000";
PreparedCommand "sel3" [0];
PreparedCommand "sel3" [0];
Command "start transaction read write";
PreparedCommand "sel3" [0];
Command "commit";
ErasePreparedCommand "sel3";
CreatePreparedCommand "sel4" "select * from T where f1 < ? limit 1";
PreparedCommand "sel4" [0];
PreparedCommand "sel4" [0];
Command "start transaction read write";
PreparedCommand "sel4" [0];
Command "commit";
ErasePreparedCommand "sel4";
CreatePreparedCommand "sel5" "select * from T where not(? < f1) limit 1";
PreparedCommand "sel5" [0];
PreparedCommand "sel5" [0];
Command "start transaction read write";
PreparedCommand "sel5" [0];
Command "commit";
ErasePreparedCommand "sel5";
CreatePreparedCommand "sel6" "select * from T where not(f1 > ?)";
PreparedCommand "sel6" [0];
PreparedCommand "sel6" [0];
Command "start transaction read write";
PreparedCommand "sel6" [0];
Command "commit";
ErasePreparedCommand "sel6";
CreatePreparedCommand "sel7" "select * from T where not(f1 = -2147483648)";
PreparedCommand "sel7" [];
PreparedCommand "sel7" [];
Command "start transaction read write";
PreparedCommand "sel7" [];
Command "commit";
ErasePreparedCommand "sel7";
CreatePreparedCommand "sel8" "select * from T where f1 < 0 limit 1";
PreparedCommand "sel8" [];
PreparedCommand "sel8" [];
Command "start transaction read write";
PreparedCommand "sel8" [];
Command "commit";
ErasePreparedCommand "sel8";
CreatePreparedCommand "sel9" "select * from T where f1 > 0 or f2 > -5000000";
PreparedCommand "sel9" [];
PreparedCommand "sel9" [];
Command "start transaction read write";
PreparedCommand "sel9" [];
Command "commit";
ErasePreparedCommand "sel9";
CreatePreparedCommand "sel10" "select * from T where not(? > f1) limit 1";
PreparedCommand "sel10" [0];
PreparedCommand "sel10" [0];
Command "start transaction read write";
PreparedCommand "sel10" [0];
Command "commit";
ErasePreparedCommand "sel10";
CreatePreparedCommand "sel11" "select * from T where f1 > ?";
PreparedCommand "sel11" [0];
PreparedCommand "sel11" [0];
Command "start transaction read write";
PreparedCommand "sel11" [0];
Command "commit";
ErasePreparedCommand "sel11";
Command "drop table T";
TerminateSession;
InitializeSession  "TESTDB";
Command "drop database TESTDB";
TerminateSession;
Terminate;
End;
