os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/APIBasic.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/APIBasic.ini	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,288 @@
     1.4 +
     1.5 +// Called by BasicSQL2.script. This config file contains information
     1.6 +// for basic API tests. We're going to exercise to some basic level all
     1.7 +// client side APIs the SQLite system. In some cases we'll make deliberate
     1.8 +// errors and look for the expected error codes and messages.
     1.9 +
    1.10 +
    1.11 +// First some basic RSqlDatabase tests.
    1.12 +[Top]
    1.13 +Close0=
    1.14 +Delete1=C:\BrieflyExists.db
    1.15 +ExpectedError1=KErrNotFound
    1.16 +Open2=C:\BrieflyExists.db
    1.17 +ExpectedError2=KErrNotFound
    1.18 +NoOperation3=
    1.19 +NoOperation4=C:\BrieflyExists.db
    1.20 +NoOperation4=KErrNotFound
    1.21 +Create5=C:\BrieflyExists.db
    1.22 +Close6=
    1.23 +Create7=C:\BrieflyExists.db
    1.24 +ExpectedError7=KErrAlreadyExists
    1.25 +Open8=C:\BrieflyExists.db
    1.26 +Exec9=what a load of gibberish
    1.27 +ExpectedError9=KSqlErrGeneral
    1.28 +LastErrorMessage10=near "what": syntax error
    1.29 +Exec11=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
    1.30 +SetIsolationLevel12=EReadUncommitted
    1.31 +Close13=
    1.32 +Delete14=C:\BrieflyExists.db
    1.33 +Delete15=C:\SqlStatement.db
    1.34 +ExpectedError15=KErrNotFound
    1.35 +Create16=C:\SqlStatement.db
    1.36 +Exec17=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
    1.37 +NewBlock18=rsqlstatement
    1.38 +Close19=
    1.39 +EndBlock20=
    1.40 +// Leave the db lying around, we'll do some more in another script line.
    1.41 +
    1.42 +// Play with BindInt, BindReal, BindNull and BindText.
    1.43 +// Check the result with AtRow, ColumnInt, ColumnReal, ColumnTextL (result
    1.44 +// specified inline, not in a file), also checks IsNull to check the previous
    1.45 +// BindNull.
    1.46 +[rsqlstatement]
    1.47 +Prepare0=Insert into Table1(Field1, Field2, Field3) values(:huey, :dewey, :louie);
    1.48 +ParameterIndex1=:huey
    1.49 +ParameterIndex2=:dewey
    1.50 +ParameterIndex3=:louie
    1.51 +BindInt4=0,711
    1.52 +BindText5=1,Here's some text.
    1.53 +BindReal6=2,2.7182818282
    1.54 +St_Exec7=
    1.55 +Reset8=
    1.56 +BindInt9=0,1234
    1.57 +BindText10=1,Some more text....
    1.58 +BindReal11=2,3.141592654
    1.59 +St_Exec12=
    1.60 +Reset13=
    1.61 +BindInt14=0,1235
    1.62 +BindText15=1,Yet more text....
    1.63 +BindReal16=2,9.869604401
    1.64 +St_Exec17=
    1.65 +Reset18=
    1.66 +BindInt19=0,1236
    1.67 +BindNull20=1
    1.68 +BindReal21=2,6.0827626
    1.69 +St_Exec22=
    1.70 +St_Close23=
    1.71 +Prepare24=select * from table1;
    1.72 +AtRow25=FAlse
    1.73 +ColumnIndex26=Field1
    1.74 +ColumnIndex27=Field2
    1.75 +ColumnIndex28=Field3
    1.76 +Next29=
    1.77 +AtRow30=TruE
    1.78 +ColumnInt31=0,711
    1.79 +ColumnType32=1,ESqlText
    1.80 +ColumnTextL33=1,Here's some text.
    1.81 +ColumnReal34=2,2.7182818282
    1.82 +Next35=
    1.83 +ColumnInt36=0,1234
    1.84 +ColumnSize37=1,18
    1.85 +ColumnTextL38=1,Some more text....
    1.86 +ColumnReal39=2,3.141592654
    1.87 +ColumnSize40=2,8
    1.88 +Next41=
    1.89 +ColumnInt42=0,1235
    1.90 +ColumnTextL43=1,Yet more text....
    1.91 +ColumnReal44=2,9.869604401
    1.92 +Next45=
    1.93 +ColumnInt46=0,1236
    1.94 +IsNull47=1,tRue
    1.95 +ColumnReal48=2,6.0827626
    1.96 +Delete49=C:\SqlStatement.db
    1.97 +ExpectedError49=KErrInUse
    1.98 +Next50=
    1.99 +AtRow51=FalSe
   1.100 +St_Close52=
   1.101 +EndBlock53=
   1.102 +
   1.103 +// This is a separate case, trigger by the second line in the script file.
   1.104 +// It adds to the existing table in SqlStatement.db, checks 'ColumnInt64',
   1.105 +// and BindInt64, plus verifies the return from 'Next'. On completion this
   1.106 +// section deletes the database.
   1.107 +[AddtoTable]
   1.108 +Open0=C:\SqlStatement.db
   1.109 +Exec1=alter table Table1 add Field4 int;
   1.110 +Prepare2=Update Table1 Set Field4=108 where Field3 < 5.8;
   1.111 +St_Exec3=
   1.112 +Reset4=
   1.113 +St_Close5=
   1.114 +Prepare6=Insert into Table1(Field1, Field2, Field3, Field4) values(:huey, :dewey, :louie, :donald);
   1.115 +ParameterIndex7=:huey
   1.116 +ParameterIndex8=:dewey
   1.117 +ParameterIndex9=:louie
   1.118 +ParameterIndex10=:donald
   1.119 +ParameterIndex11=:somerubbish
   1.120 +ExpectedError11=KErrNotFound
   1.121 +// The next line may not be appropriate - I think LastErrorMessage is only
   1.122 +// relevant following a 'KSqlErrGeneral' (which we don't have).
   1.123 +LastErrorMessage12=not an error
   1.124 +BindInt13=0,17141
   1.125 +BindText14=1,AddtoTable stuff
   1.126 +BindReal15=2,299792458
   1.127 +BindInt64_16=3,123456789012345
   1.128 +St_Exec17=
   1.129 +Reset18=
   1.130 +St_Close19=
   1.131 +Prepare20=select * from table1 where Field1=17141;
   1.132 +ColumnIndex21=Field4
   1.133 +AtRow22=FaLse
   1.134 +Next23=
   1.135 +AtRow24=trUe
   1.136 +ColumnType25=0,ESqlInt64
   1.137 +ColumnInt64_26=0,123456789012345
   1.138 +Next27=KSqlAtEnd
   1.139 +St_Close28=
   1.140 +Close29=
   1.141 +Delete30=C:\SqlStatement.db
   1.142 +EndBlock31=
   1.143 +
   1.144 +// Tests writing to a text field with a stream (RSqlParamWriteStream).
   1.145 +// Checks the content with all variants of ColumnText.
   1.146 +[SWBindText]
   1.147 +Delete0=C:\texttest1
   1.148 +ExpectedError0=KErrNotFound
   1.149 +Create1=C:\texttest1
   1.150 +Exec2=create table table2(field1 text(32770), field2 integer);
   1.151 +Prepare3=insert into table2(field1, field2) values(:largetext, :int);
   1.152 +ParameterIndex4=:largetext
   1.153 +ParameterIndex5=:int
   1.154 +StreamWriteBindText6=0,Z:\TEF_SQL\TestData\reference1.txt
   1.155 +BindInt7=1,1234321
   1.156 +St_Exec8=
   1.157 +Reset9=
   1.158 +St_Close10=
   1.159 +
   1.160 +Prepare11=SELECT * from table2;
   1.161 +ColumnIndex12=field1
   1.162 +ColumnIndex13=field2
   1.163 +Next14=KSqlAtRow
   1.164 +ColumnSize15=0,3626
   1.165 +ColumnSize16=1,4
   1.166 +ColumnTextP17=0,Z:\TEF_SQL\TestData\reference1.txt
   1.167 +ColumnInt18=1,1234321
   1.168 +Next19=KSqlAtEnd
   1.169 +St_Close20=ignored
   1.170 +
   1.171 +Prepare21=SELECT * from table2;
   1.172 +ColumnIndex22=field1
   1.173 +ColumnIndex23=field2
   1.174 +Next24=KSqlAtRow
   1.175 +ColumnSize25=0,3626
   1.176 +ColumnSize26=1,4
   1.177 +ColumnTextL27=0,Z:\TEF_SQL\TestData\reference1.txt
   1.178 +ColumnInt28=1,1234321
   1.179 +Next29=KSqlAtEnd
   1.180 +St_Close30=ignored
   1.181 +
   1.182 +Prepare31=SELECT * from table2;
   1.183 +ColumnIndex32=field1
   1.184 +ColumnIndex33=field2
   1.185 +Next34=KSqlAtRow
   1.186 +ColumnSize35=0,3626
   1.187 +ColumnSize36=1,4
   1.188 +ColumnTextD37=0,Z:\TEF_SQL\TestData\reference1.txt
   1.189 +ColumnInt38=1,1234321
   1.190 +Next39=KSqlAtEnd
   1.191 +St_Close40=ignored
   1.192 +
   1.193 +Prepare41=SELECT * from table2;
   1.194 +ColumnIndex42=field1
   1.195 +ColumnIndex43=field2
   1.196 +Next44=KSqlAtRow
   1.197 +ColumnSize45=0,3626
   1.198 +ColumnSize46=1,4
   1.199 +StreamReadColText47=0,Z:\TEF_SQL\TestData\reference1.txt
   1.200 +ColumnInt48=1,1234321
   1.201 +Next49=KSqlAtEnd
   1.202 +St_Close50=ignored
   1.203 +
   1.204 +Close51=also ignored
   1.205 +Delete52=C:\texttest1
   1.206 +EndBlock53=
   1.207 +
   1.208 +[SWBindBinary]
   1.209 +Delete0=C:\binarytest1
   1.210 +ExpectedError0=KErrNotFound
   1.211 +Create1=C:\binarytest1
   1.212 +Exec2=create table table2(field1 blob(32770));
   1.213 +Prepare3=insert into table2(field1) values(:largebin);
   1.214 +ParameterIndex4=:largebin
   1.215 +StreamWriteBindBin5=0,Z:\TEF_SQL\TestData\reference1.bin
   1.216 +St_Exec6=
   1.217 +Reset7=
   1.218 +St_Close8=
   1.219 +
   1.220 +Prepare9=SELECT field1 from table2;
   1.221 +ColumnIndex10=field1
   1.222 +Next11=KSqlAtRow
   1.223 +ColumnSize12=0,8094
   1.224 +ColumnBinaryL13=0,Z:\TEF_SQL\TestData\reference1.bin
   1.225 +Next14=KSqlAtEnd
   1.226 +St_Close15=ignored
   1.227 +
   1.228 +Prepare16=SELECT field1 from table2;
   1.229 +ColumnIndex17=field1
   1.230 +Next18=KSqlAtRow
   1.231 +ColumnSize19=0,8094
   1.232 +ColumnBinaryP20=0,Z:\TEF_SQL\TestData\reference1.bin
   1.233 +Next21=KSqlAtEnd
   1.234 +St_Close22=ignored
   1.235 +
   1.236 +Prepare23=SELECT field1 from table2;
   1.237 +ColumnIndex24=field1
   1.238 +Next25=KSqlAtRow
   1.239 +ColumnSize26=0,8094
   1.240 +ColumnBinaryD27=0,Z:\TEF_SQL\TestData\reference1.bin
   1.241 +Next28=KSqlAtEnd
   1.242 +St_Close29=ignored
   1.243 +
   1.244 +Prepare30=SELECT field1 from table2;
   1.245 +ColumnIndex31=field1
   1.246 +Next32=KSqlAtRow
   1.247 +ColumnSize33=0,8094
   1.248 +StreamReadColBin34=0,Z:\TEF_SQL\TestData\reference1.bin
   1.249 +Next35=KSqlAtEnd
   1.250 +St_Close36=ignored
   1.251 +
   1.252 +Close37=also ignored
   1.253 +Delete38=C:\binarytest1
   1.254 +EndBlock39=
   1.255 +
   1.256 +// Use anonymous (if that's the right word) column indices to check, for
   1.257 +// example the number of records in a database.
   1.258 +// Use a Copy..
   1.259 +[Countlines]
   1.260 +Copy0=Z:\TEF_SQL\TestData\test1.db,Z:\test1.db
   1.261 +ExpectedError0=KErrAccessDenied
   1.262 +Delete1=C:\test1.db
   1.263 +ExpectedError1=KErrNotFound
   1.264 +Copy2=Z:\TEF_SQL\TestData\test1.db,C:\test1.db
   1.265 +Open3=C:\test1.db
   1.266 +Prepare4=select count(*) from phone;
   1.267 +Next5=KSqlAtRow
   1.268 +ColumnIndex6=
   1.269 +ColumnInt7=0,1000
   1.270 +Next8=KSqlAtEnd
   1.271 +St_Close9=
   1.272 +Prepare10=select avg(cm_id) from phone;
   1.273 +Next11=KSqlAtRow
   1.274 +ColumnIndex12=
   1.275 +ColumnReal13=0,500.5
   1.276 +Next14=KSqlAtEnd
   1.277 +St_Close15=
   1.278 +Prepare16=select sum(cm_id) from phone;
   1.279 +Next17=KSqlAtRow
   1.280 +AtRow18=True
   1.281 +ColumnIndex19=
   1.282 +ColumnInt20=0,500500
   1.283 +Next21=KSqlAtEnd
   1.284 +St_Close22=
   1.285 +Close23=
   1.286 +// This delete is in itself a test - the 'Copy' above does not and should not
   1.287 +// propagate file permissions from the Z: drive. If it did, this delete would
   1.288 +// fail, but it should not.
   1.289 +Delete24=C:\test1.db
   1.290 +EndBlock25=
   1.291 +