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.
sl@0
     1
sl@0
     2
// This config file contains various cases which don't cause a PANIC, but
sl@0
     3
// are wrong and thus generate an error. For type conversion examples
sl@0
     4
// along similar lines (e.g attempting to do a ColumnBinary on a SqlText
sl@0
     5
// field) see TypeConversion.ini/.script.
sl@0
     6
sl@0
     7
// First some basic RSqlDatabase tests.
sl@0
     8
[Top]
sl@0
     9
Delete0=C:\SomeExceptions.db
sl@0
    10
ExpectedError0=KErrNotFound
sl@0
    11
Create1=C:\SomeExceptions.db
sl@0
    12
Exec2=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
sl@0
    13
Prepare3=Insert into Table1(Field97) values(:goofy);
sl@0
    14
ExpectedError3=KSqlErrGeneral
sl@0
    15
LastErrorMessage4=table Table1 has no column named Field97
sl@0
    16
Prepare5=select * from table1;
sl@0
    17
ColumnIndex6=hatstand
sl@0
    18
ExpectedError6=KErrNotFound
sl@0
    19
Next7=KSqlAtEnd
sl@0
    20
St_Close8=
sl@0
    21
// This will fail, we already have this table..
sl@0
    22
Exec9=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
sl@0
    23
ExpectedError9=KSqlErrGeneral
sl@0
    24
LastErrorMessage10=table Table1 already exists
sl@0
    25
Prepare11=Insert into Table1(Field3) values(:goofy);
sl@0
    26
ParameterIndex12=:goofy
sl@0
    27
ParameterIndex13=:goofy
sl@0
    28
// The next row will get overridden by the following one because the two
sl@0
    29
// binds refer to the same column.
sl@0
    30
BindReal14=0,3.14159
sl@0
    31
BindReal15=1,2.7182818284
sl@0
    32
St_Exec16=
sl@0
    33
Reset17=
sl@0
    34
St_Close18=
sl@0
    35
Prepare19=select Field3 from Table1;
sl@0
    36
ColumnIndex20=Field3
sl@0
    37
Next21=KSqlAtRow
sl@0
    38
ColumnReal22=0,2.7182818284
sl@0
    39
// Check only one of the two reals got into the table.
sl@0
    40
Next23=KSqlAtEnd
sl@0
    41
St_Close24=
sl@0
    42
Close25=
sl@0
    43
Delete26=C:\SomeExceptions.db
sl@0
    44
sl@0
    45
EndBlock27=
sl@0
    46
sl@0
    47
[GenerateErrors]
sl@0
    48
Delete0=c:\GenerateErrors.db
sl@0
    49
ExpectedError0=KErrNotFound
sl@0
    50
Create1=C:\GenerateErrors.db
sl@0
    51
Exec2=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
sl@0
    52
Prepare3=Insert into NotThere(rubbish) values (:Pluto);
sl@0
    53
// The prepare above generates an error. Initially I expected a
sl@0
    54
// 'KSqlErrNotFound', but the SQLite engine seems to treat inserting into
sl@0
    55
// a non-existent table as a syntax error, hence 'KSqlErrGeneral'.
sl@0
    56
ExpectedError3=KSqlErrGeneral
sl@0
    57
LastErrorMessage4=no such table: NotThere
sl@0
    58
sl@0
    59
Delete5=C:\GenerateErrors.db
sl@0
    60
// The delete will have failed because the database is still open. I originally
sl@0
    61
// expected 'KSqlErrLocked' here or perhaps 'KSqlErrBusy', but no we get
sl@0
    62
// the more general 'KErrInUse'...
sl@0
    63
ExpectedError5=KErrInUse
sl@0
    64
Close6=
sl@0
    65
Delete7=c:\GenerateErrors.db
sl@0
    66
sl@0
    67
// This file isn't a database and it is very small, so we get 'KErrEof'
sl@0
    68
// because the engine hasn't figured out what the file is before running out
sl@0
    69
// of input. UPDATE: This now gives 'KSqlErrNotDb' to be more consistent.
sl@0
    70
// NOTE: This will fail on Open if a configuration file (SqlServer.cfg)
sl@0
    71
// is present in the SQLite private datacage.
sl@0
    72
Open8=Z:\TEF_SQL\TestData\ShortNonDb.db
sl@0
    73
ExpectedError8=KSqlErrNotDb
sl@0
    74
NoOperation9=
sl@0
    75
Close10=
sl@0
    76
// NOTE: This will fail on Open if a configuration file (SqlServer.cfg)
sl@0
    77
// is present in the SQLite private datacage.
sl@0
    78
Open11=Z:\TEF_SQL\TestData\LongNonDb.db
sl@0
    79
ExpectedError11=KSqlErrNotDb
sl@0
    80
NoOperation12=
sl@0
    81
Close13=
sl@0
    82
// ReadOnly.db is actually a zero-length file which is naturally read-only
sl@0
    83
// because it lives in ROM.
sl@0
    84
Open14=Z:\TEF_SQL\TestData\ReadOnly.db
sl@0
    85
// A zero length file is however a valid database, so this select should not
sl@0
    86
// give KSqlErrNotDb.
sl@0
    87
Exec15=Select * from Minnie;
sl@0
    88
ExpectedError15=KSqlErrGeneral
sl@0
    89
LastErrorMessage16=no such table: Minnie
sl@0
    90
Exec17=Create Table Table2(Field1 int);
sl@0
    91
ExpectedError17=KSqlErrReadOnly
sl@0
    92
Close18=
sl@0
    93
// Obviously this will fail - the file is in ROM.
sl@0
    94
Delete19=Z:\TEF_SQL\TestData\ReadOnly.db
sl@0
    95
ExpectedError19=KErrAccessDenied
sl@0
    96
EndBlock20=
sl@0
    97
sl@0
    98
[DoErrSchema]
sl@0
    99
Delete0=C:\DoErr.db
sl@0
   100
ExpectedError0=KErrNotFound
sl@0
   101
Create1=C:\DoErr.db
sl@0
   102
Exec2=Create Table SomeTable(Field1 int, Field2 int);
sl@0
   103
Exec3=Insert into SomeTable(Field1, Field2) values(12, 14);
sl@0
   104
Exec4=Insert into SomeTable(Field1, Field2) values(9, 1);
sl@0
   105
Exec5=Insert into SomeTable(Field1, Field2) values(14, 140);
sl@0
   106
Exec6=Insert into SomeTable(Field1, Field2) values(208, 145324);
sl@0
   107
Prepare7=Select Field2 from SomeTable;
sl@0
   108
Exec8=Alter Table SomeTable Rename To Henry;
sl@0
   109
Next9=
sl@0
   110
ExpectedError9=KSqlErrSchema
sl@0
   111
St_Close10=
sl@0
   112
Close11=
sl@0
   113
Delete12=C:\DoErr.db
sl@0
   114
EndBlock13=
sl@0
   115
sl@0
   116
[CorruptedDb]
sl@0
   117
Open0=Z:\TEF_SQL\TestData\Corrupt.db
sl@0
   118
ExpectedError0=KSqlErrCorrupt
sl@0
   119
Close1=
sl@0
   120
EndBlock2=
sl@0
   121