sl@0: sl@0: // Called by Panics.script. sl@0: // Tests that PANICs occur in the right situations. sl@0: sl@0: // Attempt to use an RSqlStatement object without an RSqlDatabase. sl@0: [One-a] sl@0: Prepare0=one sl@0: [One-b] sl@0: AtRow0=True sl@0: [One-c] sl@0: ParameterIndex0=x sl@0: [One-d] sl@0: Next0= sl@0: [One-e] sl@0: Reset0= sl@0: [One-f] sl@0: // Doesn't actually call ParameterIndex, just gets it on the internal array, sl@0: // position 0.. sl@0: ParameterIndex0=2,*explicit* sl@0: // Use position 0, which contains ParameterIndex 2 which is invalid. sl@0: StreamWriteBindBin1=0,Z:\TEF_SQL\TestData\reference1.bin sl@0: [One-g] sl@0: // Doesn't actually call ParameterIndex, just gets it on the internal array, sl@0: // position 0.. sl@0: ParameterIndex0=2,*explicit* sl@0: // Use position 0, which contains ParameterIndex 2 which is invalid. sl@0: BindInt64_1=0,Z:\TEF_SQL\TestData\reference1.bin sl@0: [One-h] sl@0: // Doesn't actually call ColumnIndex, just gets it on the internal array, sl@0: // position 0.. sl@0: ColumnIndex0=2,*explicit* sl@0: // Use position 0, which contains ColumnIndex 2 which is invalid. sl@0: ColumnSize1=0,43 sl@0: [One-i] sl@0: // Doesn't actually call ColumnIndex, just gets it on the internal array, sl@0: // position 0.. sl@0: ColumnIndex0=2,*explicit* sl@0: // Use position 0, which contains ColumnIndex 2 which is invalid. sl@0: ColumnInt1=0,43 sl@0: [One-j] sl@0: // Doesn't actually call ColumnIndex, just gets it on the internal array, sl@0: // position 0.. sl@0: ColumnIndex0=2,*explicit* sl@0: // Use position 0, which contains ColumnIndex 2 which is invalid. sl@0: ColumnTextL1=0,Banana sl@0: sl@0: // /////////////////////////////////////////////////////////////////////////// sl@0: sl@0: // Attempt to use an RSqlDatabase which isn't open. Not exhaustive.. sl@0: [Two] sl@0: Open0=Z:\TEF_SQL\TestData\test1.db sl@0: Close1= sl@0: Exec2=Select * from MonkeyPuzzle; sl@0: [Two-b] sl@0: Open0=Z:\TEF_SQL\TestData\test1.db sl@0: Close1= sl@0: SetIsolationLevel2=EReadUncommitted sl@0: [Two-c] sl@0: Open0=Z:\TEF_SQL\TestData\test1.db sl@0: Close1= sl@0: Attach2=Z:\TEF_SQL\TestData\test1.db,fruitgum sl@0: [Two-d] sl@0: Open0=Z:\TEF_SQL\TestData\test1.db sl@0: Close1= sl@0: Detach2=fruitgum sl@0: [Two-e] sl@0: Open0=Z:\TEF_SQL\TestData\test1.db sl@0: Close1= sl@0: LastErrorMessage2= sl@0: [Two-f] sl@0: Open0=Z:\TEF_SQL\TestData\test1.db sl@0: Close1= sl@0: FreeReservedSpace2= sl@0: // Runs a create that should fail, then attempts to run an Exec.. sl@0: [Two-g] sl@0: Create0=A:\wontwork.db sl@0: ExpectedError0=KErrNotReady sl@0: Exec1=delete * from hello; sl@0: sl@0: // /////////////////////////////////////////////////////////////////////////// sl@0: sl@0: // Try using a Column* call when we've gone off the end of the table, i.e sl@0: // Next gave a KSqlAtEnd. sl@0: [Three] sl@0: Delete0=C:\Panics0.db sl@0: ExpectedError0=KErrNotFound sl@0: Create1=C:\Panics0.db sl@0: Exec2=Create Table Con( Someint int primary key, Somereal real, Sometext text); sl@0: Exec3=Insert into Con values(1, 2.0, "Three"); sl@0: Exec4=Insert into Con values(2, 3.0, "Four"); sl@0: Exec5=Insert into Con values(3, 4.0, "Five"); sl@0: Prepare6=select * from Con; sl@0: ColumnIndex7=Someint sl@0: Next7=KSqlAtRow sl@0: Next8=KSqlAtRow sl@0: Next9=KSqlAtRow sl@0: Next10=KSqlAtEnd sl@0: IsNull11=0,false sl@0: // Try using a Column* call when we've gone off the end of the table. sl@0: [Three-b] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=select * from Con; sl@0: ColumnIndex2=Someint sl@0: Next3=KSqlAtRow sl@0: Next4=KSqlAtRow sl@0: Next5=KSqlAtRow sl@0: Next6=KSqlAtEnd sl@0: // Try using a Column* call when we've gone off the end of the table. sl@0: ColumnSize7=0,123 sl@0: [Three-c] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=select * from Con; sl@0: ColumnIndex2=Someint sl@0: Next3=KSqlAtRow sl@0: Next4=KSqlAtRow sl@0: Next5=KSqlAtRow sl@0: Next6=KSqlAtEnd sl@0: // Try using a Column* call when we've gone off the end of the table. sl@0: ColumnInt7=0,123 sl@0: [Three-d] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=select * from Con; sl@0: ColumnIndex2=Someint sl@0: Next3=KSqlAtRow sl@0: Next4=KSqlAtRow sl@0: Next5=KSqlAtRow sl@0: Next6=KSqlAtEnd sl@0: // Try using a Column* call when we've gone off the end of the table. sl@0: ColumnInt64_7=0,123 sl@0: [Three-e] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=select * from Con; sl@0: ColumnIndex2=Someint sl@0: Next3=KSqlAtRow sl@0: Next4=KSqlAtRow sl@0: Next5=KSqlAtRow sl@0: Next6=KSqlAtEnd sl@0: // Try using a Column* call when we've gone off the end of the table. sl@0: ColumnReal7=0,123 sl@0: [Three-f] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=select * from Con; sl@0: ColumnIndex2=Someint sl@0: Next3=KSqlAtRow sl@0: Next4=KSqlAtRow sl@0: Next5=KSqlAtRow sl@0: Next6=KSqlAtEnd sl@0: // Try using a Column* call when we've gone off the end of the table. sl@0: // Don't bother with all 3 different columntext methods. sl@0: ColumnTextP7=0,123 sl@0: [Three-g] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=select * from Con; sl@0: ColumnIndex2=Someint sl@0: Next3=KSqlAtRow sl@0: Next4=KSqlAtRow sl@0: Next5=KSqlAtRow sl@0: Next6=KSqlAtEnd sl@0: // Try using a Column* call when we've gone off the end of the table. sl@0: ColumnBinaryD7=0,123 sl@0: [Three-h] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=select * from Con; sl@0: ColumnIndex2=Someint sl@0: Next3=KSqlAtRow sl@0: Next4=KSqlAtRow sl@0: Next5=KSqlAtRow sl@0: Next6=KSqlAtEnd sl@0: // Try using a Column* call when we've gone off the end of the table. sl@0: StreamReadColText7=0,Z:\TEF_SQL\TestData\reference1.txt sl@0: // Use a bad parameter index. sl@0: [Three-i] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=insert into Con(Someint, Somereal) values(:a, :b); sl@0: ParameterIndex2=:a sl@0: ParameterIndex3=:b sl@0: // Parameter index 2 is bad. sl@0: ParameterIndex4=2,*explicit* sl@0: BindInt5=0,23 sl@0: BindReal6=1,2.3 sl@0: // Bang! sl@0: BindText7=2,Ivor sl@0: sl@0: // /////////////////////////////////////////////////////////////////////////// sl@0: sl@0: // Use a parameter index which is out of bounds. sl@0: [Four] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=insert into con(Sometext) values (:fred); sl@0: ParameterIndex2=:fred sl@0: ParameterIndex3=3,*explicit* sl@0: BindText4=0,My hovercraft sl@0: BindText5=1,is full of eels sl@0: sl@0: // Attempt to find the columntype for a bad columnindex. sl@0: [Four-b] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=select * from Con; sl@0: // Slot 0 ok.. sl@0: ColumnIndex2=Someint sl@0: // Setup a bad column index in slot 1.. sl@0: ColumnIndex3=3,*explicit* sl@0: Next4=KSqlAtRow sl@0: // Have to be at a row for ColumnType to work. This is because SQLite isn't sl@0: // strongly typed. sl@0: ColumnType5=0,ESqlInt sl@0: ColumnType6=1,kaboom! sl@0: sl@0: // Try doing a Next on an unprepared RSqlStatement. sl@0: [Four-c] sl@0: Open0=C:\Panics0.db sl@0: Next1=Kaboom! sl@0: sl@0: // /////////////////////////////////////////////////////////////////////////// sl@0: sl@0: // Attempt to read a column entry without selecting it. sl@0: [Five] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=select Sometext, Somereal from Con; sl@0: ColumnIndex2=Someint sl@0: ExpectedError2=KErrNotFound sl@0: Next3=KSqlAtRow sl@0: // Blows up here. sl@0: ColumnInt4=0,1 sl@0: Next5=KSqlAtRow sl@0: ColumnInt6=0,2 sl@0: Next7=KSqlAtRow sl@0: ColumnInt8=0,3 sl@0: Next9=KSqlAtEnd sl@0: EndBlock10= sl@0: sl@0: // /////////////////////////////////////////////////////////////////////////// sl@0: sl@0: // Runs ParameterIndex on a non-existent table. sl@0: [Six] sl@0: Open0=C:\Panics0.db sl@0: Prepare1=Insert into carpet(john, paul, george, ringo) values(:a, :b, :c, :d); sl@0: ExpectedError1=KSqlErrGeneral sl@0: LastErrorMessage2= sl@0: ParameterIndex3=:a sl@0: sl@0: // ///////////////////////////////////////////////////////////////////////////