sl@0: sl@0: // This config file contains various cases which don't cause a PANIC, but sl@0: // are wrong and thus generate an error. For type conversion examples sl@0: // along similar lines (e.g attempting to do a ColumnBinary on a SqlText sl@0: // field) see TypeConversion.ini/.script. sl@0: sl@0: // First some basic RSqlDatabase tests. sl@0: [Top] sl@0: Delete0=C:\SomeExceptions.db sl@0: ExpectedError0=KErrNotFound sl@0: Create1=C:\SomeExceptions.db sl@0: Exec2=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real); sl@0: Prepare3=Insert into Table1(Field97) values(:goofy); sl@0: ExpectedError3=KSqlErrGeneral sl@0: LastErrorMessage4=table Table1 has no column named Field97 sl@0: Prepare5=select * from table1; sl@0: ColumnIndex6=hatstand sl@0: ExpectedError6=KErrNotFound sl@0: Next7=KSqlAtEnd sl@0: St_Close8= sl@0: // This will fail, we already have this table.. sl@0: Exec9=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real); sl@0: ExpectedError9=KSqlErrGeneral sl@0: LastErrorMessage10=table Table1 already exists sl@0: Prepare11=Insert into Table1(Field3) values(:goofy); sl@0: ParameterIndex12=:goofy sl@0: ParameterIndex13=:goofy sl@0: // The next row will get overridden by the following one because the two sl@0: // binds refer to the same column. sl@0: BindReal14=0,3.14159 sl@0: BindReal15=1,2.7182818284 sl@0: St_Exec16= sl@0: Reset17= sl@0: St_Close18= sl@0: Prepare19=select Field3 from Table1; sl@0: ColumnIndex20=Field3 sl@0: Next21=KSqlAtRow sl@0: ColumnReal22=0,2.7182818284 sl@0: // Check only one of the two reals got into the table. sl@0: Next23=KSqlAtEnd sl@0: St_Close24= sl@0: Close25= sl@0: Delete26=C:\SomeExceptions.db sl@0: sl@0: EndBlock27= sl@0: sl@0: [GenerateErrors] sl@0: Delete0=c:\GenerateErrors.db sl@0: ExpectedError0=KErrNotFound sl@0: Create1=C:\GenerateErrors.db sl@0: Exec2=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real); sl@0: Prepare3=Insert into NotThere(rubbish) values (:Pluto); sl@0: // The prepare above generates an error. Initially I expected a sl@0: // 'KSqlErrNotFound', but the SQLite engine seems to treat inserting into sl@0: // a non-existent table as a syntax error, hence 'KSqlErrGeneral'. sl@0: ExpectedError3=KSqlErrGeneral sl@0: LastErrorMessage4=no such table: NotThere sl@0: sl@0: Delete5=C:\GenerateErrors.db sl@0: // The delete will have failed because the database is still open. I originally sl@0: // expected 'KSqlErrLocked' here or perhaps 'KSqlErrBusy', but no we get sl@0: // the more general 'KErrInUse'... sl@0: ExpectedError5=KErrInUse sl@0: Close6= sl@0: Delete7=c:\GenerateErrors.db sl@0: sl@0: // This file isn't a database and it is very small, so we get 'KErrEof' sl@0: // because the engine hasn't figured out what the file is before running out sl@0: // of input. UPDATE: This now gives 'KSqlErrNotDb' to be more consistent. sl@0: // NOTE: This will fail on Open if a configuration file (SqlServer.cfg) sl@0: // is present in the SQLite private datacage. sl@0: Open8=Z:\TEF_SQL\TestData\ShortNonDb.db sl@0: ExpectedError8=KSqlErrNotDb sl@0: NoOperation9= sl@0: Close10= sl@0: // NOTE: This will fail on Open if a configuration file (SqlServer.cfg) sl@0: // is present in the SQLite private datacage. sl@0: Open11=Z:\TEF_SQL\TestData\LongNonDb.db sl@0: ExpectedError11=KSqlErrNotDb sl@0: NoOperation12= sl@0: Close13= sl@0: // ReadOnly.db is actually a zero-length file which is naturally read-only sl@0: // because it lives in ROM. sl@0: Open14=Z:\TEF_SQL\TestData\ReadOnly.db sl@0: // A zero length file is however a valid database, so this select should not sl@0: // give KSqlErrNotDb. sl@0: Exec15=Select * from Minnie; sl@0: ExpectedError15=KSqlErrGeneral sl@0: LastErrorMessage16=no such table: Minnie sl@0: Exec17=Create Table Table2(Field1 int); sl@0: ExpectedError17=KSqlErrReadOnly sl@0: Close18= sl@0: // Obviously this will fail - the file is in ROM. sl@0: Delete19=Z:\TEF_SQL\TestData\ReadOnly.db sl@0: ExpectedError19=KErrAccessDenied sl@0: EndBlock20= sl@0: sl@0: [DoErrSchema] sl@0: Delete0=C:\DoErr.db sl@0: ExpectedError0=KErrNotFound sl@0: Create1=C:\DoErr.db sl@0: Exec2=Create Table SomeTable(Field1 int, Field2 int); sl@0: Exec3=Insert into SomeTable(Field1, Field2) values(12, 14); sl@0: Exec4=Insert into SomeTable(Field1, Field2) values(9, 1); sl@0: Exec5=Insert into SomeTable(Field1, Field2) values(14, 140); sl@0: Exec6=Insert into SomeTable(Field1, Field2) values(208, 145324); sl@0: Prepare7=Select Field2 from SomeTable; sl@0: Exec8=Alter Table SomeTable Rename To Henry; sl@0: Next9= sl@0: ExpectedError9=KSqlErrSchema sl@0: St_Close10= sl@0: Close11= sl@0: Delete12=C:\DoErr.db sl@0: EndBlock13= sl@0: sl@0: [CorruptedDb] sl@0: Open0=Z:\TEF_SQL\TestData\Corrupt.db sl@0: ExpectedError0=KSqlErrCorrupt sl@0: Close1= sl@0: EndBlock2= sl@0: