
// This config file contains various cases which don't cause a PANIC, but
// are wrong and thus generate an error. For type conversion examples
// along similar lines (e.g attempting to do a ColumnBinary on a SqlText
// field) see TypeConversion.ini/.script.

// First some basic RSqlDatabase tests.
[Top]
Delete0=C:\SomeExceptions.db
ExpectedError0=KErrNotFound
Create1=C:\SomeExceptions.db
Exec2=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
Prepare3=Insert into Table1(Field97) values(:goofy);
ExpectedError3=KSqlErrGeneral
LastErrorMessage4=table Table1 has no column named Field97
Prepare5=select * from table1;
ColumnIndex6=hatstand
ExpectedError6=KErrNotFound
Next7=KSqlAtEnd
St_Close8=
// This will fail, we already have this table..
Exec9=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
ExpectedError9=KSqlErrGeneral
LastErrorMessage10=table Table1 already exists
Prepare11=Insert into Table1(Field3) values(:goofy);
ParameterIndex12=:goofy
ParameterIndex13=:goofy
// The next row will get overridden by the following one because the two
// binds refer to the same column.
BindReal14=0,3.14159
BindReal15=1,2.7182818284
St_Exec16=
Reset17=
St_Close18=
Prepare19=select Field3 from Table1;
ColumnIndex20=Field3
Next21=KSqlAtRow
ColumnReal22=0,2.7182818284
// Check only one of the two reals got into the table.
Next23=KSqlAtEnd
St_Close24=
Close25=
Delete26=C:\SomeExceptions.db

EndBlock27=

[GenerateErrors]
Delete0=c:\GenerateErrors.db
ExpectedError0=KErrNotFound
Create1=C:\GenerateErrors.db
Exec2=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
Prepare3=Insert into NotThere(rubbish) values (:Pluto);
// The prepare above generates an error. Initially I expected a
// 'KSqlErrNotFound', but the SQLite engine seems to treat inserting into
// a non-existent table as a syntax error, hence 'KSqlErrGeneral'.
ExpectedError3=KSqlErrGeneral
LastErrorMessage4=no such table: NotThere

Delete5=C:\GenerateErrors.db
// The delete will have failed because the database is still open. I originally
// expected 'KSqlErrLocked' here or perhaps 'KSqlErrBusy', but no we get
// the more general 'KErrInUse'...
ExpectedError5=KErrInUse
Close6=
Delete7=c:\GenerateErrors.db

// This file isn't a database and it is very small, so we get 'KErrEof'
// because the engine hasn't figured out what the file is before running out
// of input. UPDATE: This now gives 'KSqlErrNotDb' to be more consistent.
// NOTE: This will fail on Open if a configuration file (SqlServer.cfg)
// is present in the SQLite private datacage.
Open8=Z:\TEF_SQL\TestData\ShortNonDb.db
ExpectedError8=KSqlErrNotDb
NoOperation9=
Close10=
// NOTE: This will fail on Open if a configuration file (SqlServer.cfg)
// is present in the SQLite private datacage.
Open11=Z:\TEF_SQL\TestData\LongNonDb.db
ExpectedError11=KSqlErrNotDb
NoOperation12=
Close13=
// ReadOnly.db is actually a zero-length file which is naturally read-only
// because it lives in ROM.
Open14=Z:\TEF_SQL\TestData\ReadOnly.db
// A zero length file is however a valid database, so this select should not
// give KSqlErrNotDb.
Exec15=Select * from Minnie;
ExpectedError15=KSqlErrGeneral
LastErrorMessage16=no such table: Minnie
Exec17=Create Table Table2(Field1 int);
ExpectedError17=KSqlErrReadOnly
Close18=
// Obviously this will fail - the file is in ROM.
Delete19=Z:\TEF_SQL\TestData\ReadOnly.db
ExpectedError19=KErrAccessDenied
EndBlock20=

[DoErrSchema]
Delete0=C:\DoErr.db
ExpectedError0=KErrNotFound
Create1=C:\DoErr.db
Exec2=Create Table SomeTable(Field1 int, Field2 int);
Exec3=Insert into SomeTable(Field1, Field2) values(12, 14);
Exec4=Insert into SomeTable(Field1, Field2) values(9, 1);
Exec5=Insert into SomeTable(Field1, Field2) values(14, 140);
Exec6=Insert into SomeTable(Field1, Field2) values(208, 145324);
Prepare7=Select Field2 from SomeTable;
Exec8=Alter Table SomeTable Rename To Henry;
Next9=
ExpectedError9=KSqlErrSchema
St_Close10=
Close11=
Delete12=C:\DoErr.db
EndBlock13=

[CorruptedDb]
Open0=Z:\TEF_SQL\TestData\Corrupt.db
ExpectedError0=KSqlErrCorrupt
Close1=
EndBlock2=

