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