os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/SomeExceptions.ini
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 
     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.
     6 
     7 // First some basic RSqlDatabase tests.
     8 [Top]
     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;
    17 ColumnIndex6=hatstand
    18 ExpectedError6=KErrNotFound
    19 Next7=KSqlAtEnd
    20 St_Close8=
    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.
    30 BindReal14=0,3.14159
    31 BindReal15=1,2.7182818284
    32 St_Exec16=
    33 Reset17=
    34 St_Close18=
    35 Prepare19=select Field3 from Table1;
    36 ColumnIndex20=Field3
    37 Next21=KSqlAtRow
    38 ColumnReal22=0,2.7182818284
    39 // Check only one of the two reals got into the table.
    40 Next23=KSqlAtEnd
    41 St_Close24=
    42 Close25=
    43 Delete26=C:\SomeExceptions.db
    44 
    45 EndBlock27=
    46 
    47 [GenerateErrors]
    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
    58 
    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
    64 Close6=
    65 Delete7=c:\GenerateErrors.db
    66 
    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
    74 NoOperation9=
    75 Close10=
    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
    80 NoOperation12=
    81 Close13=
    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
    86 // give KSqlErrNotDb.
    87 Exec15=Select * from Minnie;
    88 ExpectedError15=KSqlErrGeneral
    89 LastErrorMessage16=no such table: Minnie
    90 Exec17=Create Table Table2(Field1 int);
    91 ExpectedError17=KSqlErrReadOnly
    92 Close18=
    93 // Obviously this will fail - the file is in ROM.
    94 Delete19=Z:\TEF_SQL\TestData\ReadOnly.db
    95 ExpectedError19=KErrAccessDenied
    96 EndBlock20=
    97 
    98 [DoErrSchema]
    99 Delete0=C:\DoErr.db
   100 ExpectedError0=KErrNotFound
   101 Create1=C:\DoErr.db
   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;
   109 Next9=
   110 ExpectedError9=KSqlErrSchema
   111 St_Close10=
   112 Close11=
   113 Delete12=C:\DoErr.db
   114 EndBlock13=
   115 
   116 [CorruptedDb]
   117 Open0=Z:\TEF_SQL\TestData\Corrupt.db
   118 ExpectedError0=KSqlErrCorrupt
   119 Close1=
   120 EndBlock2=
   121