os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/SomeExceptions.ini
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/SomeExceptions.ini	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,121 @@
     1.4 +
     1.5 +// This config file contains various cases which don't cause a PANIC, but
     1.6 +// are wrong and thus generate an error. For type conversion examples
     1.7 +// along similar lines (e.g attempting to do a ColumnBinary on a SqlText
     1.8 +// field) see TypeConversion.ini/.script.
     1.9 +
    1.10 +// First some basic RSqlDatabase tests.
    1.11 +[Top]
    1.12 +Delete0=C:\SomeExceptions.db
    1.13 +ExpectedError0=KErrNotFound
    1.14 +Create1=C:\SomeExceptions.db
    1.15 +Exec2=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
    1.16 +Prepare3=Insert into Table1(Field97) values(:goofy);
    1.17 +ExpectedError3=KSqlErrGeneral
    1.18 +LastErrorMessage4=table Table1 has no column named Field97
    1.19 +Prepare5=select * from table1;
    1.20 +ColumnIndex6=hatstand
    1.21 +ExpectedError6=KErrNotFound
    1.22 +Next7=KSqlAtEnd
    1.23 +St_Close8=
    1.24 +// This will fail, we already have this table..
    1.25 +Exec9=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
    1.26 +ExpectedError9=KSqlErrGeneral
    1.27 +LastErrorMessage10=table Table1 already exists
    1.28 +Prepare11=Insert into Table1(Field3) values(:goofy);
    1.29 +ParameterIndex12=:goofy
    1.30 +ParameterIndex13=:goofy
    1.31 +// The next row will get overridden by the following one because the two
    1.32 +// binds refer to the same column.
    1.33 +BindReal14=0,3.14159
    1.34 +BindReal15=1,2.7182818284
    1.35 +St_Exec16=
    1.36 +Reset17=
    1.37 +St_Close18=
    1.38 +Prepare19=select Field3 from Table1;
    1.39 +ColumnIndex20=Field3
    1.40 +Next21=KSqlAtRow
    1.41 +ColumnReal22=0,2.7182818284
    1.42 +// Check only one of the two reals got into the table.
    1.43 +Next23=KSqlAtEnd
    1.44 +St_Close24=
    1.45 +Close25=
    1.46 +Delete26=C:\SomeExceptions.db
    1.47 +
    1.48 +EndBlock27=
    1.49 +
    1.50 +[GenerateErrors]
    1.51 +Delete0=c:\GenerateErrors.db
    1.52 +ExpectedError0=KErrNotFound
    1.53 +Create1=C:\GenerateErrors.db
    1.54 +Exec2=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
    1.55 +Prepare3=Insert into NotThere(rubbish) values (:Pluto);
    1.56 +// The prepare above generates an error. Initially I expected a
    1.57 +// 'KSqlErrNotFound', but the SQLite engine seems to treat inserting into
    1.58 +// a non-existent table as a syntax error, hence 'KSqlErrGeneral'.
    1.59 +ExpectedError3=KSqlErrGeneral
    1.60 +LastErrorMessage4=no such table: NotThere
    1.61 +
    1.62 +Delete5=C:\GenerateErrors.db
    1.63 +// The delete will have failed because the database is still open. I originally
    1.64 +// expected 'KSqlErrLocked' here or perhaps 'KSqlErrBusy', but no we get
    1.65 +// the more general 'KErrInUse'...
    1.66 +ExpectedError5=KErrInUse
    1.67 +Close6=
    1.68 +Delete7=c:\GenerateErrors.db
    1.69 +
    1.70 +// This file isn't a database and it is very small, so we get 'KErrEof'
    1.71 +// because the engine hasn't figured out what the file is before running out
    1.72 +// of input. UPDATE: This now gives 'KSqlErrNotDb' to be more consistent.
    1.73 +// NOTE: This will fail on Open if a configuration file (SqlServer.cfg)
    1.74 +// is present in the SQLite private datacage.
    1.75 +Open8=Z:\TEF_SQL\TestData\ShortNonDb.db
    1.76 +ExpectedError8=KSqlErrNotDb
    1.77 +NoOperation9=
    1.78 +Close10=
    1.79 +// NOTE: This will fail on Open if a configuration file (SqlServer.cfg)
    1.80 +// is present in the SQLite private datacage.
    1.81 +Open11=Z:\TEF_SQL\TestData\LongNonDb.db
    1.82 +ExpectedError11=KSqlErrNotDb
    1.83 +NoOperation12=
    1.84 +Close13=
    1.85 +// ReadOnly.db is actually a zero-length file which is naturally read-only
    1.86 +// because it lives in ROM.
    1.87 +Open14=Z:\TEF_SQL\TestData\ReadOnly.db
    1.88 +// A zero length file is however a valid database, so this select should not
    1.89 +// give KSqlErrNotDb.
    1.90 +Exec15=Select * from Minnie;
    1.91 +ExpectedError15=KSqlErrGeneral
    1.92 +LastErrorMessage16=no such table: Minnie
    1.93 +Exec17=Create Table Table2(Field1 int);
    1.94 +ExpectedError17=KSqlErrReadOnly
    1.95 +Close18=
    1.96 +// Obviously this will fail - the file is in ROM.
    1.97 +Delete19=Z:\TEF_SQL\TestData\ReadOnly.db
    1.98 +ExpectedError19=KErrAccessDenied
    1.99 +EndBlock20=
   1.100 +
   1.101 +[DoErrSchema]
   1.102 +Delete0=C:\DoErr.db
   1.103 +ExpectedError0=KErrNotFound
   1.104 +Create1=C:\DoErr.db
   1.105 +Exec2=Create Table SomeTable(Field1 int, Field2 int);
   1.106 +Exec3=Insert into SomeTable(Field1, Field2) values(12, 14);
   1.107 +Exec4=Insert into SomeTable(Field1, Field2) values(9, 1);
   1.108 +Exec5=Insert into SomeTable(Field1, Field2) values(14, 140);
   1.109 +Exec6=Insert into SomeTable(Field1, Field2) values(208, 145324);
   1.110 +Prepare7=Select Field2 from SomeTable;
   1.111 +Exec8=Alter Table SomeTable Rename To Henry;
   1.112 +Next9=
   1.113 +ExpectedError9=KSqlErrSchema
   1.114 +St_Close10=
   1.115 +Close11=
   1.116 +Delete12=C:\DoErr.db
   1.117 +EndBlock13=
   1.118 +
   1.119 +[CorruptedDb]
   1.120 +Open0=Z:\TEF_SQL\TestData\Corrupt.db
   1.121 +ExpectedError0=KSqlErrCorrupt
   1.122 +Close1=
   1.123 +EndBlock2=
   1.124 +