os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/APIBasic2-8S.ini
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/APIBasic2-8S.ini	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,408 @@
     1.4 +
     1.5 +// Called by BasicSQL2-8S.script.
     1.6 +// Duplicates BasicSQL2.script/APIBasic2.ini but uses 8-bit methods (Prepare
     1.7 +// and Exec) and asynchronous methods rather than the usual synchronous
     1.8 +// UTF-16 methods.
     1.9 +//
    1.10 +// Tests that a transaction  which is not completed is visible  to a EReadUncommitted
    1.11 +// session and simultaneously (so a bit of concurrency), not visible
    1.12 +// to a EReadSerializable session.
    1.13 +
    1.14 +// Set up a new database.
    1.15 +[Thread1]
    1.16 +WaitB0=2
    1.17 +EightBit1=True
    1.18 +Async2=True
    1.19 +Delete3=C:\Transaction0.db
    1.20 +ExpectedError3=KErrNotFound
    1.21 +Create4=C:\Transaction0.db
    1.22 +Exec5=Create Table Curtab(f1 int primary key, f2 real, f3 text);
    1.23 +Prepare6=Insert into Curtab(f1, f2, f3) values(:mary, :mungo, :midge);
    1.24 +ParameterIndex7=:mary
    1.25 +ParameterIndex8=:mungo
    1.26 +ParameterIndex9=:midge
    1.27 +BindInt10=0,-4853
    1.28 +BindReal11=1,6.0827626
    1.29 +BindText12=2,Here's some text
    1.30 +St_Exec13=
    1.31 +Reset14=
    1.32 +St_Close15=
    1.33 +// At this point one record outside of a transaction is present.
    1.34 +
    1.35 +Exec16=Begin Transaction;
    1.36 +Prepare17=Insert into Curtab(f1, f2, f3) values(:mary, :mungo, :midge);
    1.37 +ParameterIndex18=:mary
    1.38 +ParameterIndex19=:mungo
    1.39 +ParameterIndex20=:midge
    1.40 +BindInt21=0,9876
    1.41 +BindReal22=1,7.0710678
    1.42 +BindText23=2,Here's yet more text
    1.43 +St_Exec24=
    1.44 +Reset25=
    1.45 +BindInt26=0,1011010
    1.46 +BindReal27=1,182282.397
    1.47 +BindText28=2,I want chocolate. Now.
    1.48 +St_Exec29=
    1.49 +Reset30=
    1.50 +BindInt31=0,7070707
    1.51 +BindReal32=1,-1.60217733e-19
    1.52 +BindText33=2,Now I want ice-cream.
    1.53 +St_Exec34=
    1.54 +Reset35=
    1.55 +St_Close36=
    1.56 +// At this point we've added one row outside of the transaction and 3 more
    1.57 +// within it. Send a signal to the slave threads which will check for the
    1.58 +// above content (one is ESerializable, one is EReadUncommitted, so they'll
    1.59 +// see different content).
    1.60 +// Wake up 2 threads..
    1.61 +SignalA37=2
    1.62 +// Wait for two signals to show they've finished..
    1.63 +WaitB38=2
    1.64 +Exec39=Rollback;
    1.65 +Close40=
    1.66 +EndBlock41=
    1.67 +
    1.68 +// ESerializable thread.
    1.69 +[Thread2]
    1.70 +SignalB0=1
    1.71 +EightBit1=True
    1.72 +Async2=True
    1.73 +// Wait until the db has been setup.
    1.74 +WaitA3=1
    1.75 +Open4=C:\Transaction0.db
    1.76 +SetIsolationLevel5=ESerializable
    1.77 +Prepare6=Select * from Curtab;
    1.78 +ColumnIndex7=f1
    1.79 +ColumnIndex8=f2
    1.80 +ColumnIndex9=f3
    1.81 +Next10=
    1.82 +ExpectedError10=KSqlErrLocked
    1.83 +St_Close11=
    1.84 +Close12=
    1.85 +SignalB13=1
    1.86 +EndBlock14=
    1.87 +
    1.88 +[Thread3]
    1.89 +SignalB0=1
    1.90 +EightBit1=True
    1.91 +Async2=True
    1.92 +// Wait until the db has been setup.
    1.93 +WaitA3=1
    1.94 +Open4=C:\Transaction0.db
    1.95 +SetIsolationLevel5=EReadUncommitted
    1.96 +Prepare6=Select * from Curtab;
    1.97 +ColumnIndex7=f1
    1.98 +ColumnIndex8=f2
    1.99 +ColumnIndex9=f3
   1.100 +Next10=KSqlAtRow
   1.101 +ColumnInt11=0,-4853
   1.102 +ColumnReal12=1,6.0827626
   1.103 +ColumnTextL13=2,Here's some text
   1.104 +Next14=KSqlAtRow
   1.105 +ColumnInt15=0,9876
   1.106 +ColumnReal16=1,7.0710678
   1.107 +ColumnTextL17=2,Here's yet more text
   1.108 +Next18=KSqlAtRow
   1.109 +ColumnInt19=0,1011010
   1.110 +ColumnReal20=1,182282.397
   1.111 +ColumnTextL21=2,I want chocolate. Now.
   1.112 +Next22=KSqlAtRow
   1.113 +ColumnInt23=0,7070707
   1.114 +ColumnReal24=1,-1.60217733e-19
   1.115 +ColumnTextL25=2,Now I want ice-cream.
   1.116 +Next26=KSqlAtEnd
   1.117 +St_Close27=
   1.118 +Close28=
   1.119 +SignalB29=1
   1.120 +EndBlock30=
   1.121 +
   1.122 +[CheckFollowingRollback]
   1.123 +EightBit0=True
   1.124 +Async1=True
   1.125 +Open2=C:\Transaction0.db
   1.126 +Prepare3=Select * from Curtab;
   1.127 +ColumnIndex4=f1
   1.128 +ColumnIndex5=f2
   1.129 +ColumnIndex6=f3
   1.130 +Next7=KSqlAtRow
   1.131 +ColumnInt8=0,-4853
   1.132 +ColumnReal9=1,6.0827626
   1.133 +ColumnTextL10=2,Here's some text
   1.134 +Next11=KSqlAtEnd
   1.135 +St_Close12=
   1.136 +Close13=
   1.137 +Delete14=C:\Transaction0.db
   1.138 +EndBlock15=
   1.139 +
   1.140 +
   1.141 +// Create some cells with text in. Copy these with streams - passing
   1.142 +// an RSqlColumnReadStream to an RSqlParamWriteStream.
   1.143 +[CopyCellsWithStreams]
   1.144 +EightBit0=True
   1.145 +Async1=True
   1.146 +Delete2=C:\CopyCells.db
   1.147 +ExpectedError2=KErrNotFound
   1.148 +Create3=C:\CopyCells.db
   1.149 +Exec4=Create table Table1(field1 text(50));
   1.150 +Exec5=Create table Table2(field1 text(50));
   1.151 +
   1.152 +Exec6=Insert Into Table1(field1) values("We're going to copy this string");
   1.153 +Exec7=Insert Into Table1(field1) values("And this one");
   1.154 +Exec8=Insert Into Table1(field1) values("In fact, all of them. There's a loop");
   1.155 +
   1.156 +// This is used to select the field we want to copy.
   1.157 +Prepare9=select field1 from Table1;
   1.158 +
   1.159 +// This will copy the first cell into a new one (using a separate
   1.160 +// RSqlStatement object). The two lines below define values for the separate
   1.161 +// RSqlStatement to use.
   1.162 +Function10=CopyCellsUsingStreams
   1.163 +PrepareStatement=Insert into Table2(field1) values(:mob);
   1.164 +ParamName=:mob
   1.165 +
   1.166 +// Close PrepareX and read back the content of Table2 to see if the cell
   1.167 +// copied correctly.
   1.168 +St_Close11=
   1.169 +Prepare12=select field1 from Table2;
   1.170 +Next13=KSqlAtRow
   1.171 +ColumnIndex14=field1
   1.172 +ColumnTextL15=0,We're going to copy this string
   1.173 +Next16=KSqlAtRow
   1.174 +ColumnTextL17=0,And this one
   1.175 +Next18=KSqlAtRow
   1.176 +ColumnTextL19=0,In fact, all of them. There's a loop
   1.177 +Next20=KSqlAtEnd
   1.178 +
   1.179 +// Shut down our RSqlStatement and RSqlDatabase resources.
   1.180 +St_Close21=
   1.181 +Close22=
   1.182 +Delete23=C:\CopyCells.db
   1.183 +EndBlock24=
   1.184 +
   1.185 +// A separate test, here we bind the content of one file (to an integer
   1.186 +// field actually, but SQLite doesn't care about that), then we bind the
   1.187 +// content of another before performing the exec/reset. So which data
   1.188 +// ends up in the cell? The data from the second bind.
   1.189 +[DoubleBind]
   1.190 +EightBit0=True
   1.191 +Async1=True
   1.192 +Delete2=C:\GenerateErrors2.db
   1.193 +ExpectedError2=KErrNotFound
   1.194 +Create3=C:\GenerateErrors2.db
   1.195 +Exec4=Create Table Table1(Field1 int);
   1.196 +Prepare5=Insert into Table1(Field1) Values (:Mickey);
   1.197 +ParameterIndex6=:Mickey
   1.198 +StreamWriteBindText7=0,Z:\TEF_SQL\TestData\reference1.bin
   1.199 +StreamWriteBindText8=0,Z:\TEF_SQL\TestData\reference1.txt
   1.200 +St_Exec9=
   1.201 +Reset10=
   1.202 +St_Close11=
   1.203 +Prepare12=select * from Table1;
   1.204 +ColumnIndex13=Field1
   1.205 +Next14=KSqlAtRow
   1.206 +ColumnTextL15=0,Z:\TEF_SQL\TestData\reference1.txt
   1.207 +St_Close16=
   1.208 +Close17=
   1.209 +Delete18=C:\GenerateErrors2.db
   1.210 +EndBlock19=
   1.211 +
   1.212 +
   1.213 +// Test the 'leaving' version of Create, Prepare and Open, also see what
   1.214 +// happens if you try creating a database on ROM..
   1.215 +[LeaveMethods]
   1.216 +EightBit0=True
   1.217 +Async1=True
   1.218 +Delete2=C:\Leave1.db
   1.219 +ExpectedError2=KErrNotFound
   1.220 +OpenL3=C:\Leave1.db
   1.221 +ExpectedError3=KErrNotFound
   1.222 +CreateL4=C:\Leave1.db
   1.223 +Exec5=Create table Leavetable(f1 text(50), f2 int, f3 real);
   1.224 +PrepareL6=Insert into Leavetable values(:wonka, :charlie, :joe);
   1.225 +ParameterIndex7=:wonka
   1.226 +ParameterIndex8=:charlie
   1.227 +ParameterIndex9=:joe
   1.228 +BindText10=0,Great Glass Elevator
   1.229 +BindInt11=1,5
   1.230 +BindReal12=2,1.23456
   1.231 +St_Exec13=
   1.232 +Reset14=
   1.233 +BindText15=0,Chocolate Factory
   1.234 +BindInt16=1,54
   1.235 +BindReal17=2,9.87654
   1.236 +St_Exec18=
   1.237 +Reset19=
   1.238 +St_Close20=
   1.239 +PrepareL21=select * from Leavetable;
   1.240 +Next22=KSqlAtRow
   1.241 +ColumnIndex23=f1
   1.242 +ColumnIndex24=f2
   1.243 +ColumnIndex25=f3
   1.244 +ColumnTextL26=0,Great Glass Elevator
   1.245 +ColumnInt27=1,5
   1.246 +ColumnReal28=2,1.23456
   1.247 +Next29=KSqlAtRow
   1.248 +ColumnTextL30=0,Chocolate Factory
   1.249 +ColumnInt31=1,54
   1.250 +ColumnReal32=2,9.87654
   1.251 +Next33=KSqlAtEnd
   1.252 +St_Close34=
   1.253 +
   1.254 +Close35=
   1.255 +CreateL36=C:\Leave1.db
   1.256 +ExpectedError36=KErrAlreadyExists
   1.257 +Delete37=C:\Leave1.db
   1.258 +CreateL38=Z:\TEF_SQL\TestData\ReadOnly.db
   1.259 +ExpectedError38=KErrAlreadyExists
   1.260 +CreateL39=Z:\TEF_SQL\TestData\DoesntExist.db
   1.261 +ExpectedError39=KErrAccessDenied
   1.262 +EndBlock40=
   1.263 +
   1.264 +// Create (and implicitly open) a database, then another, then another, etc.
   1.265 +// This actually isn't supposed to generate errors.
   1.266 +// This leaks memory, normally the programmer would be expected to close
   1.267 +// each of the databases before opening another, but we're explicitly
   1.268 +// checking that successive Opens/Creates give no error.
   1.269 +[MultipleCreateOpen]
   1.270 +EightBit0=True
   1.271 +Async1=True
   1.272 +Delete2=C:\MCO1.db
   1.273 +ExpectedError2=KErrNotFound
   1.274 +Delete3=C:\MCO2.db
   1.275 +ExpectedError3=KErrNotFound
   1.276 +Delete4=C:\MCO3.db
   1.277 +ExpectedError4=KErrNotFound
   1.278 +Delete5=C:\MCO4.db
   1.279 +ExpectedError5=KErrNotFound
   1.280 +Delete6=C:\MCO5.db
   1.281 +ExpectedError6=KErrNotFound
   1.282 +
   1.283 +CreateL7=C:\MCO1.db
   1.284 +Create8=C:\MCO2.db
   1.285 +OpenL9=Z:\TEF_SQL\TestData\test1.db
   1.286 +CreateL10=C:\MCO3.db
   1.287 +Create11=C:\MCO4.db
   1.288 +CreateL12=C:\MCO5.db
   1.289 +
   1.290 +Delete13=C:\MCO1.db
   1.291 +ExpectedError13=KErrInUse
   1.292 +Delete14=C:\MCO2.db
   1.293 +ExpectedError14=KErrInUse
   1.294 +Delete15=C:\MCO3.db
   1.295 +ExpectedError15=KErrInUse
   1.296 +Delete16=C:\MCO4.db
   1.297 +ExpectedError16=KErrInUse
   1.298 +Delete17=C:\MCO5.db
   1.299 +ExpectedError17=KErrInUse
   1.300 +Close18=
   1.301 +Delete19=C:\MCO5.db
   1.302 +
   1.303 +Open20=Z:\TEF_SQL\TestData\ReadOnly.db
   1.304 +OpenL21=Z:\TEF_SQL\TestData\test1.db
   1.305 +Open22=Z:\TEF_SQL\TestData\ReadOnly.db
   1.306 +
   1.307 +EndBlock23=
   1.308 +
   1.309 +[ExtraBindTest]
   1.310 +EightBit0=True
   1.311 +Async1=True
   1.312 +// First set up a table.
   1.313 +Delete2=C:\ExtraBindTest.db
   1.314 +ExpectedError2=KErrNotFound
   1.315 +Create3=C:\ExtraBindTest.db
   1.316 +Exec4=Create table Sometable(Someint int, Somereal real, Sometext text);
   1.317 +Prepare5=Insert into Sometable(Someint, Somereal, Sometext) values (:FInt, :FReal, :FText);
   1.318 +Function6=WriteBigTable
   1.319 +LowCount=105
   1.320 +HighCount=119
   1.321 +CountStep=3
   1.322 +Multiplier=0.0
   1.323 +Text=Here's some rather pointless text
   1.324 +EventuallyExpectedError=KErrNone
   1.325 +St_Close7=
   1.326 +// Now try a non-trivial select. Ok then, fairly trivial, ;-)
   1.327 +Prepare8=Select * from Sometable where Someint > :Brian;
   1.328 +ParameterIndex9=:Brian
   1.329 +BindInt10=0,112
   1.330 +Next11=KSqlAtRow
   1.331 +ColumnIndex12=Someint
   1.332 +ColumnIndex13=Somereal
   1.333 +ColumnIndex14=Sometext
   1.334 +ColumnInt15=0,114
   1.335 +ColumnReal16=1,0.0
   1.336 +ColumnTextL17=2,Here's some rather pointless text
   1.337 +Next18=KSqlAtRow
   1.338 +ColumnInt19=0,117
   1.339 +ColumnReal20=1,0.0
   1.340 +ColumnTextL21=2,Here's some rather pointless text
   1.341 +Next22=KSqlAtEnd
   1.342 +St_Close23=
   1.343 +Close24=
   1.344 +Delete25=C:\ExtraBindTest.db
   1.345 +EndBlock26=
   1.346 +
   1.347 +[ExtraBindTest2]
   1.348 +EightBit0=True
   1.349 +Async1=True
   1.350 +Delete2=C:\ExtraBindTest2.db
   1.351 +ExpectedError2=KErrNotFound
   1.352 +Create3=C:\ExtraBindTest2.db
   1.353 +Exec4=Create table Sometable(Someint int, Somereal real, Sometext text);
   1.354 +Prepare5=Insert into Sometable(Sometext) values (:FText);
   1.355 +ParameterIndex6=:FText
   1.356 +NewBlock7=WriteInts20
   1.357 +St_Exec8=
   1.358 +Reset9=
   1.359 +NewBlock10=WriteInts21
   1.360 +St_Exec11=
   1.361 +Reset12=
   1.362 +NewBlock13=WriteInts22
   1.363 +St_Exec14=
   1.364 +Reset15=
   1.365 +NewBlock16=WriteInts400
   1.366 +St_Exec17=
   1.367 +Reset18=
   1.368 +St_Close19=
   1.369 +Prepare20=Select * from Sometable;
   1.370 +ColumnIndex21=Sometext
   1.371 +Next22=KSqlAtRow
   1.372 +ColumnSize23=0,80
   1.373 +Next24=KSqlAtRow
   1.374 +ColumnSize25=0,84
   1.375 +Next26=KSqlAtRow
   1.376 +ColumnSize27=0,88
   1.377 +Next28=KSqlAtRow
   1.378 +ColumnSize29=0,1600
   1.379 +Next30=KSqlAtEnd
   1.380 +// MUST close the Statement or confusion ensues!!
   1.381 +St_Close31==
   1.382 +Prepare32=Select Sometext from Sometable where Sometext=:Block
   1.383 +ParameterIndex33=:Block
   1.384 +// We're trying to recover one of the blocks. This function does a bind..
   1.385 +NewBlock34=WriteInts21
   1.386 +Next35=KSqlAtRow
   1.387 +ColumnIndex36=Sometext
   1.388 +ColumnSize37=0,84
   1.389 +Next38=KSqlAtEnd
   1.390 +St_Close39=
   1.391 +Close40=
   1.392 +Delete41=C:\ExtraBindTest2.db
   1.393 +EndBlock42=
   1.394 +
   1.395 +[WriteInts20]
   1.396 +Function0=WriteIntsToStream
   1.397 +Count=20
   1.398 +EndBlock1=
   1.399 +[WriteInts21]
   1.400 +Function0=WriteIntsToStream
   1.401 +Count=21
   1.402 +EndBlock1=
   1.403 +[WriteInts22]
   1.404 +Function0=WriteIntsToStream
   1.405 +Count=22
   1.406 +EndBlock1=
   1.407 +[WriteInts400]
   1.408 +Function0=WriteIntsToStream
   1.409 +Count=400
   1.410 +EndBlock1=
   1.411 +