os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/SomeExceptions.ini
First public contribution.
2 // This config file contains various cases which don't cause a PANIC, but
3 // are wrong and thus generate an error. For type conversion examples
4 // along similar lines (e.g attempting to do a ColumnBinary on a SqlText
5 // field) see TypeConversion.ini/.script.
7 // First some basic RSqlDatabase tests.
9 Delete0=C:\SomeExceptions.db
10 ExpectedError0=KErrNotFound
11 Create1=C:\SomeExceptions.db
12 Exec2=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
13 Prepare3=Insert into Table1(Field97) values(:goofy);
14 ExpectedError3=KSqlErrGeneral
15 LastErrorMessage4=table Table1 has no column named Field97
16 Prepare5=select * from table1;
18 ExpectedError6=KErrNotFound
21 // This will fail, we already have this table..
22 Exec9=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
23 ExpectedError9=KSqlErrGeneral
24 LastErrorMessage10=table Table1 already exists
25 Prepare11=Insert into Table1(Field3) values(:goofy);
26 ParameterIndex12=:goofy
27 ParameterIndex13=:goofy
28 // The next row will get overridden by the following one because the two
29 // binds refer to the same column.
31 BindReal15=1,2.7182818284
35 Prepare19=select Field3 from Table1;
38 ColumnReal22=0,2.7182818284
39 // Check only one of the two reals got into the table.
43 Delete26=C:\SomeExceptions.db
48 Delete0=c:\GenerateErrors.db
49 ExpectedError0=KErrNotFound
50 Create1=C:\GenerateErrors.db
51 Exec2=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
52 Prepare3=Insert into NotThere(rubbish) values (:Pluto);
53 // The prepare above generates an error. Initially I expected a
54 // 'KSqlErrNotFound', but the SQLite engine seems to treat inserting into
55 // a non-existent table as a syntax error, hence 'KSqlErrGeneral'.
56 ExpectedError3=KSqlErrGeneral
57 LastErrorMessage4=no such table: NotThere
59 Delete5=C:\GenerateErrors.db
60 // The delete will have failed because the database is still open. I originally
61 // expected 'KSqlErrLocked' here or perhaps 'KSqlErrBusy', but no we get
62 // the more general 'KErrInUse'...
63 ExpectedError5=KErrInUse
65 Delete7=c:\GenerateErrors.db
67 // This file isn't a database and it is very small, so we get 'KErrEof'
68 // because the engine hasn't figured out what the file is before running out
69 // of input. UPDATE: This now gives 'KSqlErrNotDb' to be more consistent.
70 // NOTE: This will fail on Open if a configuration file (SqlServer.cfg)
71 // is present in the SQLite private datacage.
72 Open8=Z:\TEF_SQL\TestData\ShortNonDb.db
73 ExpectedError8=KSqlErrNotDb
76 // NOTE: This will fail on Open if a configuration file (SqlServer.cfg)
77 // is present in the SQLite private datacage.
78 Open11=Z:\TEF_SQL\TestData\LongNonDb.db
79 ExpectedError11=KSqlErrNotDb
82 // ReadOnly.db is actually a zero-length file which is naturally read-only
83 // because it lives in ROM.
84 Open14=Z:\TEF_SQL\TestData\ReadOnly.db
85 // A zero length file is however a valid database, so this select should not
87 Exec15=Select * from Minnie;
88 ExpectedError15=KSqlErrGeneral
89 LastErrorMessage16=no such table: Minnie
90 Exec17=Create Table Table2(Field1 int);
91 ExpectedError17=KSqlErrReadOnly
93 // Obviously this will fail - the file is in ROM.
94 Delete19=Z:\TEF_SQL\TestData\ReadOnly.db
95 ExpectedError19=KErrAccessDenied
100 ExpectedError0=KErrNotFound
102 Exec2=Create Table SomeTable(Field1 int, Field2 int);
103 Exec3=Insert into SomeTable(Field1, Field2) values(12, 14);
104 Exec4=Insert into SomeTable(Field1, Field2) values(9, 1);
105 Exec5=Insert into SomeTable(Field1, Field2) values(14, 140);
106 Exec6=Insert into SomeTable(Field1, Field2) values(208, 145324);
107 Prepare7=Select Field2 from SomeTable;
108 Exec8=Alter Table SomeTable Rename To Henry;
110 ExpectedError9=KSqlErrSchema
117 Open0=Z:\TEF_SQL\TestData\Corrupt.db
118 ExpectedError0=KSqlErrCorrupt