os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/APIBasic2-8S.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
// Called by BasicSQL2-8S.script.
sl@0
     3
// Duplicates BasicSQL2.script/APIBasic2.ini but uses 8-bit methods (Prepare
sl@0
     4
// and Exec) and asynchronous methods rather than the usual synchronous
sl@0
     5
// UTF-16 methods.
sl@0
     6
//
sl@0
     7
// Tests that a transaction  which is not completed is visible  to a EReadUncommitted
sl@0
     8
// session and simultaneously (so a bit of concurrency), not visible
sl@0
     9
// to a EReadSerializable session.
sl@0
    10
sl@0
    11
// Set up a new database.
sl@0
    12
[Thread1]
sl@0
    13
WaitB0=2
sl@0
    14
EightBit1=True
sl@0
    15
Async2=True
sl@0
    16
Delete3=C:\Transaction0.db
sl@0
    17
ExpectedError3=KErrNotFound
sl@0
    18
Create4=C:\Transaction0.db
sl@0
    19
Exec5=Create Table Curtab(f1 int primary key, f2 real, f3 text);
sl@0
    20
Prepare6=Insert into Curtab(f1, f2, f3) values(:mary, :mungo, :midge);
sl@0
    21
ParameterIndex7=:mary
sl@0
    22
ParameterIndex8=:mungo
sl@0
    23
ParameterIndex9=:midge
sl@0
    24
BindInt10=0,-4853
sl@0
    25
BindReal11=1,6.0827626
sl@0
    26
BindText12=2,Here's some text
sl@0
    27
St_Exec13=
sl@0
    28
Reset14=
sl@0
    29
St_Close15=
sl@0
    30
// At this point one record outside of a transaction is present.
sl@0
    31
sl@0
    32
Exec16=Begin Transaction;
sl@0
    33
Prepare17=Insert into Curtab(f1, f2, f3) values(:mary, :mungo, :midge);
sl@0
    34
ParameterIndex18=:mary
sl@0
    35
ParameterIndex19=:mungo
sl@0
    36
ParameterIndex20=:midge
sl@0
    37
BindInt21=0,9876
sl@0
    38
BindReal22=1,7.0710678
sl@0
    39
BindText23=2,Here's yet more text
sl@0
    40
St_Exec24=
sl@0
    41
Reset25=
sl@0
    42
BindInt26=0,1011010
sl@0
    43
BindReal27=1,182282.397
sl@0
    44
BindText28=2,I want chocolate. Now.
sl@0
    45
St_Exec29=
sl@0
    46
Reset30=
sl@0
    47
BindInt31=0,7070707
sl@0
    48
BindReal32=1,-1.60217733e-19
sl@0
    49
BindText33=2,Now I want ice-cream.
sl@0
    50
St_Exec34=
sl@0
    51
Reset35=
sl@0
    52
St_Close36=
sl@0
    53
// At this point we've added one row outside of the transaction and 3 more
sl@0
    54
// within it. Send a signal to the slave threads which will check for the
sl@0
    55
// above content (one is ESerializable, one is EReadUncommitted, so they'll
sl@0
    56
// see different content).
sl@0
    57
// Wake up 2 threads..
sl@0
    58
SignalA37=2
sl@0
    59
// Wait for two signals to show they've finished..
sl@0
    60
WaitB38=2
sl@0
    61
Exec39=Rollback;
sl@0
    62
Close40=
sl@0
    63
EndBlock41=
sl@0
    64
sl@0
    65
// ESerializable thread.
sl@0
    66
[Thread2]
sl@0
    67
SignalB0=1
sl@0
    68
EightBit1=True
sl@0
    69
Async2=True
sl@0
    70
// Wait until the db has been setup.
sl@0
    71
WaitA3=1
sl@0
    72
Open4=C:\Transaction0.db
sl@0
    73
SetIsolationLevel5=ESerializable
sl@0
    74
Prepare6=Select * from Curtab;
sl@0
    75
ColumnIndex7=f1
sl@0
    76
ColumnIndex8=f2
sl@0
    77
ColumnIndex9=f3
sl@0
    78
Next10=
sl@0
    79
ExpectedError10=KSqlErrLocked
sl@0
    80
St_Close11=
sl@0
    81
Close12=
sl@0
    82
SignalB13=1
sl@0
    83
EndBlock14=
sl@0
    84
sl@0
    85
[Thread3]
sl@0
    86
SignalB0=1
sl@0
    87
EightBit1=True
sl@0
    88
Async2=True
sl@0
    89
// Wait until the db has been setup.
sl@0
    90
WaitA3=1
sl@0
    91
Open4=C:\Transaction0.db
sl@0
    92
SetIsolationLevel5=EReadUncommitted
sl@0
    93
Prepare6=Select * from Curtab;
sl@0
    94
ColumnIndex7=f1
sl@0
    95
ColumnIndex8=f2
sl@0
    96
ColumnIndex9=f3
sl@0
    97
Next10=KSqlAtRow
sl@0
    98
ColumnInt11=0,-4853
sl@0
    99
ColumnReal12=1,6.0827626
sl@0
   100
ColumnTextL13=2,Here's some text
sl@0
   101
Next14=KSqlAtRow
sl@0
   102
ColumnInt15=0,9876
sl@0
   103
ColumnReal16=1,7.0710678
sl@0
   104
ColumnTextL17=2,Here's yet more text
sl@0
   105
Next18=KSqlAtRow
sl@0
   106
ColumnInt19=0,1011010
sl@0
   107
ColumnReal20=1,182282.397
sl@0
   108
ColumnTextL21=2,I want chocolate. Now.
sl@0
   109
Next22=KSqlAtRow
sl@0
   110
ColumnInt23=0,7070707
sl@0
   111
ColumnReal24=1,-1.60217733e-19
sl@0
   112
ColumnTextL25=2,Now I want ice-cream.
sl@0
   113
Next26=KSqlAtEnd
sl@0
   114
St_Close27=
sl@0
   115
Close28=
sl@0
   116
SignalB29=1
sl@0
   117
EndBlock30=
sl@0
   118
sl@0
   119
[CheckFollowingRollback]
sl@0
   120
EightBit0=True
sl@0
   121
Async1=True
sl@0
   122
Open2=C:\Transaction0.db
sl@0
   123
Prepare3=Select * from Curtab;
sl@0
   124
ColumnIndex4=f1
sl@0
   125
ColumnIndex5=f2
sl@0
   126
ColumnIndex6=f3
sl@0
   127
Next7=KSqlAtRow
sl@0
   128
ColumnInt8=0,-4853
sl@0
   129
ColumnReal9=1,6.0827626
sl@0
   130
ColumnTextL10=2,Here's some text
sl@0
   131
Next11=KSqlAtEnd
sl@0
   132
St_Close12=
sl@0
   133
Close13=
sl@0
   134
Delete14=C:\Transaction0.db
sl@0
   135
EndBlock15=
sl@0
   136
sl@0
   137
sl@0
   138
// Create some cells with text in. Copy these with streams - passing
sl@0
   139
// an RSqlColumnReadStream to an RSqlParamWriteStream.
sl@0
   140
[CopyCellsWithStreams]
sl@0
   141
EightBit0=True
sl@0
   142
Async1=True
sl@0
   143
Delete2=C:\CopyCells.db
sl@0
   144
ExpectedError2=KErrNotFound
sl@0
   145
Create3=C:\CopyCells.db
sl@0
   146
Exec4=Create table Table1(field1 text(50));
sl@0
   147
Exec5=Create table Table2(field1 text(50));
sl@0
   148
sl@0
   149
Exec6=Insert Into Table1(field1) values("We're going to copy this string");
sl@0
   150
Exec7=Insert Into Table1(field1) values("And this one");
sl@0
   151
Exec8=Insert Into Table1(field1) values("In fact, all of them. There's a loop");
sl@0
   152
sl@0
   153
// This is used to select the field we want to copy.
sl@0
   154
Prepare9=select field1 from Table1;
sl@0
   155
sl@0
   156
// This will copy the first cell into a new one (using a separate
sl@0
   157
// RSqlStatement object). The two lines below define values for the separate
sl@0
   158
// RSqlStatement to use.
sl@0
   159
Function10=CopyCellsUsingStreams
sl@0
   160
PrepareStatement=Insert into Table2(field1) values(:mob);
sl@0
   161
ParamName=:mob
sl@0
   162
sl@0
   163
// Close PrepareX and read back the content of Table2 to see if the cell
sl@0
   164
// copied correctly.
sl@0
   165
St_Close11=
sl@0
   166
Prepare12=select field1 from Table2;
sl@0
   167
Next13=KSqlAtRow
sl@0
   168
ColumnIndex14=field1
sl@0
   169
ColumnTextL15=0,We're going to copy this string
sl@0
   170
Next16=KSqlAtRow
sl@0
   171
ColumnTextL17=0,And this one
sl@0
   172
Next18=KSqlAtRow
sl@0
   173
ColumnTextL19=0,In fact, all of them. There's a loop
sl@0
   174
Next20=KSqlAtEnd
sl@0
   175
sl@0
   176
// Shut down our RSqlStatement and RSqlDatabase resources.
sl@0
   177
St_Close21=
sl@0
   178
Close22=
sl@0
   179
Delete23=C:\CopyCells.db
sl@0
   180
EndBlock24=
sl@0
   181
sl@0
   182
// A separate test, here we bind the content of one file (to an integer
sl@0
   183
// field actually, but SQLite doesn't care about that), then we bind the
sl@0
   184
// content of another before performing the exec/reset. So which data
sl@0
   185
// ends up in the cell? The data from the second bind.
sl@0
   186
[DoubleBind]
sl@0
   187
EightBit0=True
sl@0
   188
Async1=True
sl@0
   189
Delete2=C:\GenerateErrors2.db
sl@0
   190
ExpectedError2=KErrNotFound
sl@0
   191
Create3=C:\GenerateErrors2.db
sl@0
   192
Exec4=Create Table Table1(Field1 int);
sl@0
   193
Prepare5=Insert into Table1(Field1) Values (:Mickey);
sl@0
   194
ParameterIndex6=:Mickey
sl@0
   195
StreamWriteBindText7=0,Z:\TEF_SQL\TestData\reference1.bin
sl@0
   196
StreamWriteBindText8=0,Z:\TEF_SQL\TestData\reference1.txt
sl@0
   197
St_Exec9=
sl@0
   198
Reset10=
sl@0
   199
St_Close11=
sl@0
   200
Prepare12=select * from Table1;
sl@0
   201
ColumnIndex13=Field1
sl@0
   202
Next14=KSqlAtRow
sl@0
   203
ColumnTextL15=0,Z:\TEF_SQL\TestData\reference1.txt
sl@0
   204
St_Close16=
sl@0
   205
Close17=
sl@0
   206
Delete18=C:\GenerateErrors2.db
sl@0
   207
EndBlock19=
sl@0
   208
sl@0
   209
sl@0
   210
// Test the 'leaving' version of Create, Prepare and Open, also see what
sl@0
   211
// happens if you try creating a database on ROM..
sl@0
   212
[LeaveMethods]
sl@0
   213
EightBit0=True
sl@0
   214
Async1=True
sl@0
   215
Delete2=C:\Leave1.db
sl@0
   216
ExpectedError2=KErrNotFound
sl@0
   217
OpenL3=C:\Leave1.db
sl@0
   218
ExpectedError3=KErrNotFound
sl@0
   219
CreateL4=C:\Leave1.db
sl@0
   220
Exec5=Create table Leavetable(f1 text(50), f2 int, f3 real);
sl@0
   221
PrepareL6=Insert into Leavetable values(:wonka, :charlie, :joe);
sl@0
   222
ParameterIndex7=:wonka
sl@0
   223
ParameterIndex8=:charlie
sl@0
   224
ParameterIndex9=:joe
sl@0
   225
BindText10=0,Great Glass Elevator
sl@0
   226
BindInt11=1,5
sl@0
   227
BindReal12=2,1.23456
sl@0
   228
St_Exec13=
sl@0
   229
Reset14=
sl@0
   230
BindText15=0,Chocolate Factory
sl@0
   231
BindInt16=1,54
sl@0
   232
BindReal17=2,9.87654
sl@0
   233
St_Exec18=
sl@0
   234
Reset19=
sl@0
   235
St_Close20=
sl@0
   236
PrepareL21=select * from Leavetable;
sl@0
   237
Next22=KSqlAtRow
sl@0
   238
ColumnIndex23=f1
sl@0
   239
ColumnIndex24=f2
sl@0
   240
ColumnIndex25=f3
sl@0
   241
ColumnTextL26=0,Great Glass Elevator
sl@0
   242
ColumnInt27=1,5
sl@0
   243
ColumnReal28=2,1.23456
sl@0
   244
Next29=KSqlAtRow
sl@0
   245
ColumnTextL30=0,Chocolate Factory
sl@0
   246
ColumnInt31=1,54
sl@0
   247
ColumnReal32=2,9.87654
sl@0
   248
Next33=KSqlAtEnd
sl@0
   249
St_Close34=
sl@0
   250
sl@0
   251
Close35=
sl@0
   252
CreateL36=C:\Leave1.db
sl@0
   253
ExpectedError36=KErrAlreadyExists
sl@0
   254
Delete37=C:\Leave1.db
sl@0
   255
CreateL38=Z:\TEF_SQL\TestData\ReadOnly.db
sl@0
   256
ExpectedError38=KErrAlreadyExists
sl@0
   257
CreateL39=Z:\TEF_SQL\TestData\DoesntExist.db
sl@0
   258
ExpectedError39=KErrAccessDenied
sl@0
   259
EndBlock40=
sl@0
   260
sl@0
   261
// Create (and implicitly open) a database, then another, then another, etc.
sl@0
   262
// This actually isn't supposed to generate errors.
sl@0
   263
// This leaks memory, normally the programmer would be expected to close
sl@0
   264
// each of the databases before opening another, but we're explicitly
sl@0
   265
// checking that successive Opens/Creates give no error.
sl@0
   266
[MultipleCreateOpen]
sl@0
   267
EightBit0=True
sl@0
   268
Async1=True
sl@0
   269
Delete2=C:\MCO1.db
sl@0
   270
ExpectedError2=KErrNotFound
sl@0
   271
Delete3=C:\MCO2.db
sl@0
   272
ExpectedError3=KErrNotFound
sl@0
   273
Delete4=C:\MCO3.db
sl@0
   274
ExpectedError4=KErrNotFound
sl@0
   275
Delete5=C:\MCO4.db
sl@0
   276
ExpectedError5=KErrNotFound
sl@0
   277
Delete6=C:\MCO5.db
sl@0
   278
ExpectedError6=KErrNotFound
sl@0
   279
sl@0
   280
CreateL7=C:\MCO1.db
sl@0
   281
Create8=C:\MCO2.db
sl@0
   282
OpenL9=Z:\TEF_SQL\TestData\test1.db
sl@0
   283
CreateL10=C:\MCO3.db
sl@0
   284
Create11=C:\MCO4.db
sl@0
   285
CreateL12=C:\MCO5.db
sl@0
   286
sl@0
   287
Delete13=C:\MCO1.db
sl@0
   288
ExpectedError13=KErrInUse
sl@0
   289
Delete14=C:\MCO2.db
sl@0
   290
ExpectedError14=KErrInUse
sl@0
   291
Delete15=C:\MCO3.db
sl@0
   292
ExpectedError15=KErrInUse
sl@0
   293
Delete16=C:\MCO4.db
sl@0
   294
ExpectedError16=KErrInUse
sl@0
   295
Delete17=C:\MCO5.db
sl@0
   296
ExpectedError17=KErrInUse
sl@0
   297
Close18=
sl@0
   298
Delete19=C:\MCO5.db
sl@0
   299
sl@0
   300
Open20=Z:\TEF_SQL\TestData\ReadOnly.db
sl@0
   301
OpenL21=Z:\TEF_SQL\TestData\test1.db
sl@0
   302
Open22=Z:\TEF_SQL\TestData\ReadOnly.db
sl@0
   303
sl@0
   304
EndBlock23=
sl@0
   305
sl@0
   306
[ExtraBindTest]
sl@0
   307
EightBit0=True
sl@0
   308
Async1=True
sl@0
   309
// First set up a table.
sl@0
   310
Delete2=C:\ExtraBindTest.db
sl@0
   311
ExpectedError2=KErrNotFound
sl@0
   312
Create3=C:\ExtraBindTest.db
sl@0
   313
Exec4=Create table Sometable(Someint int, Somereal real, Sometext text);
sl@0
   314
Prepare5=Insert into Sometable(Someint, Somereal, Sometext) values (:FInt, :FReal, :FText);
sl@0
   315
Function6=WriteBigTable
sl@0
   316
LowCount=105
sl@0
   317
HighCount=119
sl@0
   318
CountStep=3
sl@0
   319
Multiplier=0.0
sl@0
   320
Text=Here's some rather pointless text
sl@0
   321
EventuallyExpectedError=KErrNone
sl@0
   322
St_Close7=
sl@0
   323
// Now try a non-trivial select. Ok then, fairly trivial, ;-)
sl@0
   324
Prepare8=Select * from Sometable where Someint > :Brian;
sl@0
   325
ParameterIndex9=:Brian
sl@0
   326
BindInt10=0,112
sl@0
   327
Next11=KSqlAtRow
sl@0
   328
ColumnIndex12=Someint
sl@0
   329
ColumnIndex13=Somereal
sl@0
   330
ColumnIndex14=Sometext
sl@0
   331
ColumnInt15=0,114
sl@0
   332
ColumnReal16=1,0.0
sl@0
   333
ColumnTextL17=2,Here's some rather pointless text
sl@0
   334
Next18=KSqlAtRow
sl@0
   335
ColumnInt19=0,117
sl@0
   336
ColumnReal20=1,0.0
sl@0
   337
ColumnTextL21=2,Here's some rather pointless text
sl@0
   338
Next22=KSqlAtEnd
sl@0
   339
St_Close23=
sl@0
   340
Close24=
sl@0
   341
Delete25=C:\ExtraBindTest.db
sl@0
   342
EndBlock26=
sl@0
   343
sl@0
   344
[ExtraBindTest2]
sl@0
   345
EightBit0=True
sl@0
   346
Async1=True
sl@0
   347
Delete2=C:\ExtraBindTest2.db
sl@0
   348
ExpectedError2=KErrNotFound
sl@0
   349
Create3=C:\ExtraBindTest2.db
sl@0
   350
Exec4=Create table Sometable(Someint int, Somereal real, Sometext text);
sl@0
   351
Prepare5=Insert into Sometable(Sometext) values (:FText);
sl@0
   352
ParameterIndex6=:FText
sl@0
   353
NewBlock7=WriteInts20
sl@0
   354
St_Exec8=
sl@0
   355
Reset9=
sl@0
   356
NewBlock10=WriteInts21
sl@0
   357
St_Exec11=
sl@0
   358
Reset12=
sl@0
   359
NewBlock13=WriteInts22
sl@0
   360
St_Exec14=
sl@0
   361
Reset15=
sl@0
   362
NewBlock16=WriteInts400
sl@0
   363
St_Exec17=
sl@0
   364
Reset18=
sl@0
   365
St_Close19=
sl@0
   366
Prepare20=Select * from Sometable;
sl@0
   367
ColumnIndex21=Sometext
sl@0
   368
Next22=KSqlAtRow
sl@0
   369
ColumnSize23=0,80
sl@0
   370
Next24=KSqlAtRow
sl@0
   371
ColumnSize25=0,84
sl@0
   372
Next26=KSqlAtRow
sl@0
   373
ColumnSize27=0,88
sl@0
   374
Next28=KSqlAtRow
sl@0
   375
ColumnSize29=0,1600
sl@0
   376
Next30=KSqlAtEnd
sl@0
   377
// MUST close the Statement or confusion ensues!!
sl@0
   378
St_Close31==
sl@0
   379
Prepare32=Select Sometext from Sometable where Sometext=:Block
sl@0
   380
ParameterIndex33=:Block
sl@0
   381
// We're trying to recover one of the blocks. This function does a bind..
sl@0
   382
NewBlock34=WriteInts21
sl@0
   383
Next35=KSqlAtRow
sl@0
   384
ColumnIndex36=Sometext
sl@0
   385
ColumnSize37=0,84
sl@0
   386
Next38=KSqlAtEnd
sl@0
   387
St_Close39=
sl@0
   388
Close40=
sl@0
   389
Delete41=C:\ExtraBindTest2.db
sl@0
   390
EndBlock42=
sl@0
   391
sl@0
   392
[WriteInts20]
sl@0
   393
Function0=WriteIntsToStream
sl@0
   394
Count=20
sl@0
   395
EndBlock1=
sl@0
   396
[WriteInts21]
sl@0
   397
Function0=WriteIntsToStream
sl@0
   398
Count=21
sl@0
   399
EndBlock1=
sl@0
   400
[WriteInts22]
sl@0
   401
Function0=WriteIntsToStream
sl@0
   402
Count=22
sl@0
   403
EndBlock1=
sl@0
   404
[WriteInts400]
sl@0
   405
Function0=WriteIntsToStream
sl@0
   406
Count=400
sl@0
   407
EndBlock1=
sl@0
   408