os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/APIBasic2.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.script.
sl@0
     3
// Tests that  a transaction which is not completed   is visible to a EReadUncommitted
sl@0
     4
// session and simultaneously (so a bit of concurrency), not visible
sl@0
     5
// to a EReadSerializable session.
sl@0
     6
sl@0
     7
// Set up a new database.
sl@0
     8
[Thread1]
sl@0
     9
WaitB0=2
sl@0
    10
Delete1=C:\Transaction0.db
sl@0
    11
ExpectedError1=KErrNotFound
sl@0
    12
Create2=C:\Transaction0.db
sl@0
    13
Exec3=Create Table Curtab(f1 int primary key, f2 real, f3 text);
sl@0
    14
Prepare4=Insert into Curtab(f1, f2, f3) values(:mary, :mungo, :midge);
sl@0
    15
ParameterIndex5=:mary
sl@0
    16
ParameterIndex6=:mungo
sl@0
    17
ParameterIndex7=:midge
sl@0
    18
BindInt8=0,-4853
sl@0
    19
BindReal9=1,6.0827626
sl@0
    20
BindText10=2,Here's some text
sl@0
    21
St_Exec11=
sl@0
    22
Reset12=
sl@0
    23
St_Close13=
sl@0
    24
// At this point one record outside of a transaction is present.
sl@0
    25
sl@0
    26
NoOperation14=
sl@0
    27
Exec15=Begin Transaction;
sl@0
    28
Prepare16=Insert into Curtab(f1, f2, f3) values(:mary, :mungo, :midge);
sl@0
    29
ParameterIndex17=:mary
sl@0
    30
ParameterIndex18=:mungo
sl@0
    31
ParameterIndex19=:midge
sl@0
    32
BindInt20=0,9876
sl@0
    33
BindReal21=1,7.0710678
sl@0
    34
BindText22=2,Here's yet more text
sl@0
    35
St_Exec23=
sl@0
    36
Reset24=
sl@0
    37
BindInt25=0,1011010
sl@0
    38
BindReal26=1,182282.397
sl@0
    39
BindText27=2,I want chocolate. Now.
sl@0
    40
St_Exec28=
sl@0
    41
Reset29=
sl@0
    42
BindInt30=0,7070707
sl@0
    43
BindReal31=1,-1.60217733e-19
sl@0
    44
BindText32=2,Now I want ice-cream.
sl@0
    45
St_Exec33=
sl@0
    46
Reset34=
sl@0
    47
St_Close35=
sl@0
    48
// At this point we've added one row outside of the transaction and 3 more
sl@0
    49
// within it. Send a signal to the slave threads which will check for the
sl@0
    50
// above content (one is ESerializable, one is EReadUncommitted, so they'll
sl@0
    51
// see different content).
sl@0
    52
// Wake up 2 threads..
sl@0
    53
SignalA36=2
sl@0
    54
// Wait for two signals to show they've finished..
sl@0
    55
WaitB37=2
sl@0
    56
Exec38=Rollback;
sl@0
    57
Close39=
sl@0
    58
EndBlock40=
sl@0
    59
sl@0
    60
// ESerializable thread.
sl@0
    61
[Thread2]
sl@0
    62
SignalB0=1
sl@0
    63
// Wait until the db has been setup.
sl@0
    64
WaitA1=1
sl@0
    65
Open2=C:\Transaction0.db
sl@0
    66
SetIsolationLevel3=ESerializable
sl@0
    67
Prepare4=Select * from Curtab;
sl@0
    68
ColumnIndex5=f1
sl@0
    69
ColumnIndex6=f2
sl@0
    70
ColumnIndex7=f3
sl@0
    71
Next8=
sl@0
    72
ExpectedError8=KSqlErrLocked
sl@0
    73
St_Close9=
sl@0
    74
Close10=
sl@0
    75
SignalB11=1
sl@0
    76
EndBlock12=
sl@0
    77
sl@0
    78
[Thread3]
sl@0
    79
SignalB0=1
sl@0
    80
// Wait until the db has been setup.
sl@0
    81
WaitA1=1
sl@0
    82
Open2=C:\Transaction0.db
sl@0
    83
SetIsolationLevel3=EReadUncommitted
sl@0
    84
Prepare4=Select * from Curtab;
sl@0
    85
ColumnIndex5=f1
sl@0
    86
ColumnIndex6=f2
sl@0
    87
ColumnIndex7=f3
sl@0
    88
Next8=KSqlAtRow
sl@0
    89
ColumnInt9=0,-4853
sl@0
    90
ColumnReal10=1,6.0827626
sl@0
    91
ColumnTextL11=2,Here's some text
sl@0
    92
Next12=KSqlAtRow
sl@0
    93
ColumnInt13=0,9876
sl@0
    94
ColumnReal14=1,7.0710678
sl@0
    95
ColumnTextL15=2,Here's yet more text
sl@0
    96
Next16=KSqlAtRow
sl@0
    97
ColumnInt17=0,1011010
sl@0
    98
ColumnReal18=1,182282.397
sl@0
    99
ColumnTextL19=2,I want chocolate. Now.
sl@0
   100
Next20=KSqlAtRow
sl@0
   101
ColumnInt21=0,7070707
sl@0
   102
ColumnReal22=1,-1.60217733e-19
sl@0
   103
ColumnTextL23=2,Now I want ice-cream.
sl@0
   104
Next24=KSqlAtEnd
sl@0
   105
St_Close25=
sl@0
   106
Close26=
sl@0
   107
SignalB27=1
sl@0
   108
EndBlock28=
sl@0
   109
sl@0
   110
[CheckFollowingRollback]
sl@0
   111
Open0=C:\Transaction0.db
sl@0
   112
NoOperation1=
sl@0
   113
NoOperation2=
sl@0
   114
Prepare3=Select * from Curtab;
sl@0
   115
ColumnIndex4=f1
sl@0
   116
ColumnIndex5=f2
sl@0
   117
ColumnIndex6=f3
sl@0
   118
Next7=KSqlAtRow
sl@0
   119
ColumnInt8=0,-4853
sl@0
   120
ColumnReal9=1,6.0827626
sl@0
   121
ColumnTextL10=2,Here's some text
sl@0
   122
Next11=KSqlAtEnd
sl@0
   123
St_Close12=
sl@0
   124
Close13=
sl@0
   125
Delete14=C:\Transaction0.db
sl@0
   126
EndBlock15=
sl@0
   127
sl@0
   128
sl@0
   129
// Create some cells with text in. Copy these with streams - passing
sl@0
   130
// an RSqlColumnReadStream to an RSqlParamWriteStream.
sl@0
   131
[CopyCellsWithStreams]
sl@0
   132
Delete0=C:\CopyCells.db
sl@0
   133
ExpectedError0=KErrNotFound
sl@0
   134
Create1=C:\CopyCells.db
sl@0
   135
Exec2=Create table Table1(field1 text(50));
sl@0
   136
Exec3=Create table Table2(field1 text(50));
sl@0
   137
sl@0
   138
Exec4=Insert Into Table1(field1) values("We're going to copy this string");
sl@0
   139
Exec5=Insert Into Table1(field1) values("And this one");
sl@0
   140
Exec6=Insert Into Table1(field1) values("In fact, all of them. There's a loop");
sl@0
   141
sl@0
   142
// This is used to select the field we want to copy.
sl@0
   143
Prepare7=select field1 from Table1;
sl@0
   144
NoOperation8=
sl@0
   145
sl@0
   146
// This will copy the first cell into a new one (using a separate
sl@0
   147
// RSqlStatement object). The two lines below define values for the separate
sl@0
   148
// RSqlStatement to use.
sl@0
   149
Function9=CopyCellsUsingStreams
sl@0
   150
PrepareStatement=Insert into Table2(field1) values(:mob);
sl@0
   151
ParamName=:mob
sl@0
   152
sl@0
   153
// Close Prepare6 and read back the content of Table2 to see if the cell
sl@0
   154
// copied correctly.
sl@0
   155
St_Close10=
sl@0
   156
Prepare11=select field1 from Table2;
sl@0
   157
Next12=KSqlAtRow
sl@0
   158
ColumnIndex13=field1
sl@0
   159
ColumnTextL14=0,We're going to copy this string
sl@0
   160
Next15=KSqlAtRow
sl@0
   161
ColumnTextL16=0,And this one
sl@0
   162
Next17=KSqlAtRow
sl@0
   163
ColumnTextL18=0,In fact, all of them. There's a loop
sl@0
   164
Next19=KSqlAtEnd
sl@0
   165
sl@0
   166
// Shut down our RSqlStatement and RSqlDatabase resources.
sl@0
   167
St_Close20=
sl@0
   168
Close21=
sl@0
   169
Delete22=C:\CopyCells.db
sl@0
   170
EndBlock23=
sl@0
   171
sl@0
   172
// A separate test, here we bind the content of one file (to an integer
sl@0
   173
// field actually, but SQLite doesn't care about that), then we bind the
sl@0
   174
// content of another before performing the exec/reset. So which data
sl@0
   175
// ends up in the cell? The data from the second bind.
sl@0
   176
[DoubleBind]
sl@0
   177
Delete0=C:\GenerateErrors2.db
sl@0
   178
ExpectedError0=KErrNotFound
sl@0
   179
Create1=C:\GenerateErrors2.db
sl@0
   180
Exec2=Create Table Table1(Field1 int);
sl@0
   181
Prepare3=Insert into Table1(Field1) Values (:Mickey);
sl@0
   182
ParameterIndex4=:Mickey
sl@0
   183
StreamWriteBindText5=0,Z:\TEF_SQL\TestData\reference1.bin
sl@0
   184
StreamWriteBindText6=0,Z:\TEF_SQL\TestData\reference1.txt
sl@0
   185
St_Exec7=
sl@0
   186
Reset8=
sl@0
   187
St_Close9=
sl@0
   188
Prepare10=select * from Table1;
sl@0
   189
ColumnIndex11=Field1
sl@0
   190
Next12=KSqlAtRow
sl@0
   191
ColumnTextL13=0,Z:\TEF_SQL\TestData\reference1.txt
sl@0
   192
St_Close14=
sl@0
   193
Close15=
sl@0
   194
Delete16=C:\GenerateErrors2.db
sl@0
   195
EndBlock17=-
sl@0
   196
sl@0
   197
sl@0
   198
// Test the 'leaving' version of Create, Prepare and Open, also see what
sl@0
   199
// happens if you try creating a database on ROM..
sl@0
   200
[LeaveMethods]
sl@0
   201
Delete0=C:\Leave1.db
sl@0
   202
ExpectedError0=KErrNotFound
sl@0
   203
OpenL1=C:\Leave1.db
sl@0
   204
ExpectedError1=KErrNotFound
sl@0
   205
CreateL2=C:\Leave1.db
sl@0
   206
Exec3=Create table Leavetable(f1 text(50), f2 int, f3 real);
sl@0
   207
PrepareL4=Insert into Leavetable values(:wonka, :charlie, :joe);
sl@0
   208
ParameterIndex5=:wonka
sl@0
   209
ParameterIndex6=:charlie
sl@0
   210
ParameterIndex7=:joe
sl@0
   211
BindText8=0,Great Glass Elevator
sl@0
   212
BindInt9=1,5
sl@0
   213
BindReal10=2,1.23456
sl@0
   214
St_Exec11=
sl@0
   215
Reset12=
sl@0
   216
BindText13=0,Chocolate Factory
sl@0
   217
BindInt14=1,54
sl@0
   218
BindReal15=2,9.87654
sl@0
   219
St_Exec16=
sl@0
   220
Reset17=
sl@0
   221
St_Close18=
sl@0
   222
PrepareL19=select * from Leavetable;
sl@0
   223
NoOperation20=
sl@0
   224
Next21=KSqlAtRow
sl@0
   225
ColumnIndex22=f1
sl@0
   226
ColumnIndex23=f2
sl@0
   227
ColumnIndex24=f3
sl@0
   228
ColumnTextL25=0,Great Glass Elevator
sl@0
   229
ColumnInt26=1,5
sl@0
   230
ColumnReal27=2,1.23456
sl@0
   231
Next28=KSqlAtRow
sl@0
   232
ColumnTextL29=0,Chocolate Factory
sl@0
   233
ColumnInt30=1,54
sl@0
   234
ColumnReal31=2,9.87654
sl@0
   235
Next32=KSqlAtEnd
sl@0
   236
St_Close33=
sl@0
   237
sl@0
   238
Close34=
sl@0
   239
CreateL35=C:\Leave1.db
sl@0
   240
ExpectedError35=KErrAlreadyExists
sl@0
   241
Delete36=C:\Leave1.db
sl@0
   242
CreateL37=Z:\TEF_SQL\TestData\ReadOnly.db
sl@0
   243
ExpectedError37=KErrAlreadyExists
sl@0
   244
CreateL38=Z:\TEF_SQL\TestData\DoesntExist.db
sl@0
   245
ExpectedError38=KErrAccessDenied
sl@0
   246
EndBlock39=
sl@0
   247
sl@0
   248
// Create (and implicitly open) a database, then another, then another, etc.
sl@0
   249
// This actually isn't supposed to generate errors.
sl@0
   250
// This leaks memory, normally the programmer would be expected to close
sl@0
   251
// each of the databases before opening another, but we're explicitly
sl@0
   252
// checking that successive Opens/Creates give no error.
sl@0
   253
[MultipleCreateOpen]
sl@0
   254
Delete0=C:\MCO1.db
sl@0
   255
ExpectedError0=KErrNotFound
sl@0
   256
Delete1=C:\MCO2.db
sl@0
   257
ExpectedError1=KErrNotFound
sl@0
   258
Delete2=C:\MCO3.db
sl@0
   259
ExpectedError2=KErrNotFound
sl@0
   260
Delete3=C:\MCO4.db
sl@0
   261
ExpectedError3=KErrNotFound
sl@0
   262
Delete4=C:\MCO5.db
sl@0
   263
ExpectedError4=KErrNotFound
sl@0
   264
sl@0
   265
CreateL5=C:\MCO1.db
sl@0
   266
Create6=C:\MCO2.db
sl@0
   267
OpenL7=Z:\TEF_SQL\TestData\test1.db
sl@0
   268
CreateL8=C:\MCO3.db
sl@0
   269
Create9=C:\MCO4.db
sl@0
   270
CreateL10=C:\MCO5.db
sl@0
   271
sl@0
   272
Delete11=C:\MCO1.db
sl@0
   273
ExpectedError11=KErrInUse
sl@0
   274
Delete12=C:\MCO2.db
sl@0
   275
ExpectedError12=KErrInUse
sl@0
   276
Delete13=C:\MCO3.db
sl@0
   277
ExpectedError13=KErrInUse
sl@0
   278
Delete14=C:\MCO4.db
sl@0
   279
ExpectedError14=KErrInUse
sl@0
   280
Delete15=C:\MCO5.db
sl@0
   281
ExpectedError15=KErrInUse
sl@0
   282
Close16=
sl@0
   283
Delete17=C:\MCO5.db
sl@0
   284
sl@0
   285
Open18=Z:\TEF_SQL\TestData\ReadOnly.db
sl@0
   286
OpenL19=Z:\TEF_SQL\TestData\test1.db
sl@0
   287
Open20=Z:\TEF_SQL\TestData\ReadOnly.db
sl@0
   288
NoOperation21=10000000
sl@0
   289
sl@0
   290
EndBlock22=
sl@0
   291
sl@0
   292
[ExtraBindTest]
sl@0
   293
WaitB0=1
sl@0
   294
SignalA1=1
sl@0
   295
// First set up a table.
sl@0
   296
Delete2=C:\ExtraBindTest.db
sl@0
   297
ExpectedError2=KErrNotFound
sl@0
   298
Create3=C:\ExtraBindTest.db
sl@0
   299
Exec4=Create table Sometable(Someint int, Somereal real, Sometext text);
sl@0
   300
Prepare5=Insert into Sometable(Someint, Somereal, Sometext) values (:FInt, :FReal, :FText);
sl@0
   301
Function6=WriteBigTable
sl@0
   302
LowCount=105
sl@0
   303
HighCount=119
sl@0
   304
CountStep=3
sl@0
   305
Multiplier=0.0
sl@0
   306
Text=Here's some rather pointless text
sl@0
   307
EventuallyExpectedError=KErrNone
sl@0
   308
St_Close7=
sl@0
   309
// Now try a non-trivial select. Ok then, fairly trivial, ;-)
sl@0
   310
Prepare8=Select * from Sometable where Someint > :Brian;
sl@0
   311
ParameterIndex9=:Brian
sl@0
   312
BindInt10=0,112
sl@0
   313
Next11=KSqlAtRow
sl@0
   314
ColumnIndex12=Someint
sl@0
   315
ColumnIndex13=Somereal
sl@0
   316
ColumnIndex14=Sometext
sl@0
   317
ColumnInt15=0,114
sl@0
   318
ColumnReal16=1,0.0
sl@0
   319
ColumnTextL17=2,Here's some rather pointless text
sl@0
   320
Next18=KSqlAtRow
sl@0
   321
ColumnInt19=0,117
sl@0
   322
ColumnReal20=1,0.0
sl@0
   323
ColumnTextL21=2,Here's some rather pointless text
sl@0
   324
Next22=KSqlAtEnd
sl@0
   325
St_Close23=
sl@0
   326
Close24=
sl@0
   327
Delete25=C:\ExtraBindTest.db
sl@0
   328
EndBlock26=
sl@0
   329
sl@0
   330
[ExtraBindTest2]
sl@0
   331
SignalB0=1
sl@0
   332
WaitA1=1
sl@0
   333
Delete2=C:\ExtraBindTest2.db
sl@0
   334
ExpectedError2=KErrNotFound
sl@0
   335
Create3=C:\ExtraBindTest2.db
sl@0
   336
Exec4=Create table Sometable(Someint int, Somereal real, Sometext text);
sl@0
   337
Prepare5=Insert into Sometable(Sometext) values (:FText);
sl@0
   338
ParameterIndex6=:FText
sl@0
   339
NewBlock7=WriteInts20
sl@0
   340
St_Exec8=
sl@0
   341
Reset9=
sl@0
   342
NewBlock10=WriteInts21
sl@0
   343
St_Exec11=
sl@0
   344
Reset12=
sl@0
   345
NewBlock13=WriteInts22
sl@0
   346
St_Exec14=
sl@0
   347
Reset15=
sl@0
   348
NewBlock16=WriteInts400
sl@0
   349
St_Exec17=
sl@0
   350
Reset18=
sl@0
   351
St_Close19=
sl@0
   352
Prepare20=Select * from Sometable;
sl@0
   353
ColumnIndex21=Sometext
sl@0
   354
Next22=KSqlAtRow
sl@0
   355
ColumnSize23=0,80
sl@0
   356
Next24=KSqlAtRow
sl@0
   357
ColumnSize25=0,84
sl@0
   358
Next26=KSqlAtRow
sl@0
   359
ColumnSize27=0,88
sl@0
   360
Next28=KSqlAtRow
sl@0
   361
ColumnSize29=0,1600
sl@0
   362
Next30=KSqlAtEnd
sl@0
   363
// MUST close the Statement or confusion ensues!!
sl@0
   364
St_Close31==
sl@0
   365
Prepare32=Select Sometext from Sometable where Sometext=:Block
sl@0
   366
ParameterIndex33=:Block
sl@0
   367
// We're trying to recover one of the blocks. This function does a bind..
sl@0
   368
NewBlock34=WriteInts21
sl@0
   369
Next35=KSqlAtRow
sl@0
   370
ColumnIndex36=Sometext
sl@0
   371
ColumnSize37=0,84
sl@0
   372
Next38=KSqlAtEnd
sl@0
   373
St_Close39=
sl@0
   374
Close40=
sl@0
   375
Delete41=C:\ExtraBindTest2.db
sl@0
   376
EndBlock42=
sl@0
   377
sl@0
   378
[WriteInts20]
sl@0
   379
Function0=WriteIntsToStream
sl@0
   380
Count=20
sl@0
   381
EndBlock1=
sl@0
   382
[WriteInts21]
sl@0
   383
Function0=WriteIntsToStream
sl@0
   384
Count=21
sl@0
   385
EndBlock1=
sl@0
   386
[WriteInts22]
sl@0
   387
Function0=WriteIntsToStream
sl@0
   388
Count=22
sl@0
   389
EndBlock1=
sl@0
   390
[WriteInts400]
sl@0
   391
Function0=WriteIntsToStream
sl@0
   392
Count=400
sl@0
   393
EndBlock1=