os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/APIBasic.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. This config file contains information
     3 // for basic API tests. We're going to exercise to some basic level all
     4 // client side APIs the SQLite system. In some cases we'll make deliberate
     5 // errors and look for the expected error codes and messages.
     6 
     7 
     8 // First some basic RSqlDatabase tests.
     9 [Top]
    10 Close0=
    11 Delete1=C:\BrieflyExists.db
    12 ExpectedError1=KErrNotFound
    13 Open2=C:\BrieflyExists.db
    14 ExpectedError2=KErrNotFound
    15 NoOperation3=
    16 NoOperation4=C:\BrieflyExists.db
    17 NoOperation4=KErrNotFound
    18 Create5=C:\BrieflyExists.db
    19 Close6=
    20 Create7=C:\BrieflyExists.db
    21 ExpectedError7=KErrAlreadyExists
    22 Open8=C:\BrieflyExists.db
    23 Exec9=what a load of gibberish
    24 ExpectedError9=KSqlErrGeneral
    25 LastErrorMessage10=near "what": syntax error
    26 Exec11=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
    27 SetIsolationLevel12=EReadUncommitted
    28 Close13=
    29 Delete14=C:\BrieflyExists.db
    30 Delete15=C:\SqlStatement.db
    31 ExpectedError15=KErrNotFound
    32 Create16=C:\SqlStatement.db
    33 Exec17=Create Table Table1(Field1 int primary key, Field2 text, Field3 Real);
    34 NewBlock18=rsqlstatement
    35 Close19=
    36 EndBlock20=
    37 // Leave the db lying around, we'll do some more in another script line.
    38 
    39 // Play with BindInt, BindReal, BindNull and BindText.
    40 // Check the result with AtRow, ColumnInt, ColumnReal, ColumnTextL (result
    41 // specified inline, not in a file), also checks IsNull to check the previous
    42 // BindNull.
    43 [rsqlstatement]
    44 Prepare0=Insert into Table1(Field1, Field2, Field3) values(:huey, :dewey, :louie);
    45 ParameterIndex1=:huey
    46 ParameterIndex2=:dewey
    47 ParameterIndex3=:louie
    48 BindInt4=0,711
    49 BindText5=1,Here's some text.
    50 BindReal6=2,2.7182818282
    51 St_Exec7=
    52 Reset8=
    53 BindInt9=0,1234
    54 BindText10=1,Some more text....
    55 BindReal11=2,3.141592654
    56 St_Exec12=
    57 Reset13=
    58 BindInt14=0,1235
    59 BindText15=1,Yet more text....
    60 BindReal16=2,9.869604401
    61 St_Exec17=
    62 Reset18=
    63 BindInt19=0,1236
    64 BindNull20=1
    65 BindReal21=2,6.0827626
    66 St_Exec22=
    67 St_Close23=
    68 Prepare24=select * from table1;
    69 AtRow25=FAlse
    70 ColumnIndex26=Field1
    71 ColumnIndex27=Field2
    72 ColumnIndex28=Field3
    73 Next29=
    74 AtRow30=TruE
    75 ColumnInt31=0,711
    76 ColumnType32=1,ESqlText
    77 ColumnTextL33=1,Here's some text.
    78 ColumnReal34=2,2.7182818282
    79 Next35=
    80 ColumnInt36=0,1234
    81 ColumnSize37=1,18
    82 ColumnTextL38=1,Some more text....
    83 ColumnReal39=2,3.141592654
    84 ColumnSize40=2,8
    85 Next41=
    86 ColumnInt42=0,1235
    87 ColumnTextL43=1,Yet more text....
    88 ColumnReal44=2,9.869604401
    89 Next45=
    90 ColumnInt46=0,1236
    91 IsNull47=1,tRue
    92 ColumnReal48=2,6.0827626
    93 Delete49=C:\SqlStatement.db
    94 ExpectedError49=KErrInUse
    95 Next50=
    96 AtRow51=FalSe
    97 St_Close52=
    98 EndBlock53=
    99 
   100 // This is a separate case, trigger by the second line in the script file.
   101 // It adds to the existing table in SqlStatement.db, checks 'ColumnInt64',
   102 // and BindInt64, plus verifies the return from 'Next'. On completion this
   103 // section deletes the database.
   104 [AddtoTable]
   105 Open0=C:\SqlStatement.db
   106 Exec1=alter table Table1 add Field4 int;
   107 Prepare2=Update Table1 Set Field4=108 where Field3 < 5.8;
   108 St_Exec3=
   109 Reset4=
   110 St_Close5=
   111 Prepare6=Insert into Table1(Field1, Field2, Field3, Field4) values(:huey, :dewey, :louie, :donald);
   112 ParameterIndex7=:huey
   113 ParameterIndex8=:dewey
   114 ParameterIndex9=:louie
   115 ParameterIndex10=:donald
   116 ParameterIndex11=:somerubbish
   117 ExpectedError11=KErrNotFound
   118 // The next line may not be appropriate - I think LastErrorMessage is only
   119 // relevant following a 'KSqlErrGeneral' (which we don't have).
   120 LastErrorMessage12=not an error
   121 BindInt13=0,17141
   122 BindText14=1,AddtoTable stuff
   123 BindReal15=2,299792458
   124 BindInt64_16=3,123456789012345
   125 St_Exec17=
   126 Reset18=
   127 St_Close19=
   128 Prepare20=select * from table1 where Field1=17141;
   129 ColumnIndex21=Field4
   130 AtRow22=FaLse
   131 Next23=
   132 AtRow24=trUe
   133 ColumnType25=0,ESqlInt64
   134 ColumnInt64_26=0,123456789012345
   135 Next27=KSqlAtEnd
   136 St_Close28=
   137 Close29=
   138 Delete30=C:\SqlStatement.db
   139 EndBlock31=
   140 
   141 // Tests writing to a text field with a stream (RSqlParamWriteStream).
   142 // Checks the content with all variants of ColumnText.
   143 [SWBindText]
   144 Delete0=C:\texttest1
   145 ExpectedError0=KErrNotFound
   146 Create1=C:\texttest1
   147 Exec2=create table table2(field1 text(32770), field2 integer);
   148 Prepare3=insert into table2(field1, field2) values(:largetext, :int);
   149 ParameterIndex4=:largetext
   150 ParameterIndex5=:int
   151 StreamWriteBindText6=0,Z:\TEF_SQL\TestData\reference1.txt
   152 BindInt7=1,1234321
   153 St_Exec8=
   154 Reset9=
   155 St_Close10=
   156 
   157 Prepare11=SELECT * from table2;
   158 ColumnIndex12=field1
   159 ColumnIndex13=field2
   160 Next14=KSqlAtRow
   161 ColumnSize15=0,3626
   162 ColumnSize16=1,4
   163 ColumnTextP17=0,Z:\TEF_SQL\TestData\reference1.txt
   164 ColumnInt18=1,1234321
   165 Next19=KSqlAtEnd
   166 St_Close20=ignored
   167 
   168 Prepare21=SELECT * from table2;
   169 ColumnIndex22=field1
   170 ColumnIndex23=field2
   171 Next24=KSqlAtRow
   172 ColumnSize25=0,3626
   173 ColumnSize26=1,4
   174 ColumnTextL27=0,Z:\TEF_SQL\TestData\reference1.txt
   175 ColumnInt28=1,1234321
   176 Next29=KSqlAtEnd
   177 St_Close30=ignored
   178 
   179 Prepare31=SELECT * from table2;
   180 ColumnIndex32=field1
   181 ColumnIndex33=field2
   182 Next34=KSqlAtRow
   183 ColumnSize35=0,3626
   184 ColumnSize36=1,4
   185 ColumnTextD37=0,Z:\TEF_SQL\TestData\reference1.txt
   186 ColumnInt38=1,1234321
   187 Next39=KSqlAtEnd
   188 St_Close40=ignored
   189 
   190 Prepare41=SELECT * from table2;
   191 ColumnIndex42=field1
   192 ColumnIndex43=field2
   193 Next44=KSqlAtRow
   194 ColumnSize45=0,3626
   195 ColumnSize46=1,4
   196 StreamReadColText47=0,Z:\TEF_SQL\TestData\reference1.txt
   197 ColumnInt48=1,1234321
   198 Next49=KSqlAtEnd
   199 St_Close50=ignored
   200 
   201 Close51=also ignored
   202 Delete52=C:\texttest1
   203 EndBlock53=
   204 
   205 [SWBindBinary]
   206 Delete0=C:\binarytest1
   207 ExpectedError0=KErrNotFound
   208 Create1=C:\binarytest1
   209 Exec2=create table table2(field1 blob(32770));
   210 Prepare3=insert into table2(field1) values(:largebin);
   211 ParameterIndex4=:largebin
   212 StreamWriteBindBin5=0,Z:\TEF_SQL\TestData\reference1.bin
   213 St_Exec6=
   214 Reset7=
   215 St_Close8=
   216 
   217 Prepare9=SELECT field1 from table2;
   218 ColumnIndex10=field1
   219 Next11=KSqlAtRow
   220 ColumnSize12=0,8094
   221 ColumnBinaryL13=0,Z:\TEF_SQL\TestData\reference1.bin
   222 Next14=KSqlAtEnd
   223 St_Close15=ignored
   224 
   225 Prepare16=SELECT field1 from table2;
   226 ColumnIndex17=field1
   227 Next18=KSqlAtRow
   228 ColumnSize19=0,8094
   229 ColumnBinaryP20=0,Z:\TEF_SQL\TestData\reference1.bin
   230 Next21=KSqlAtEnd
   231 St_Close22=ignored
   232 
   233 Prepare23=SELECT field1 from table2;
   234 ColumnIndex24=field1
   235 Next25=KSqlAtRow
   236 ColumnSize26=0,8094
   237 ColumnBinaryD27=0,Z:\TEF_SQL\TestData\reference1.bin
   238 Next28=KSqlAtEnd
   239 St_Close29=ignored
   240 
   241 Prepare30=SELECT field1 from table2;
   242 ColumnIndex31=field1
   243 Next32=KSqlAtRow
   244 ColumnSize33=0,8094
   245 StreamReadColBin34=0,Z:\TEF_SQL\TestData\reference1.bin
   246 Next35=KSqlAtEnd
   247 St_Close36=ignored
   248 
   249 Close37=also ignored
   250 Delete38=C:\binarytest1
   251 EndBlock39=
   252 
   253 // Use anonymous (if that's the right word) column indices to check, for
   254 // example the number of records in a database.
   255 // Use a Copy..
   256 [Countlines]
   257 Copy0=Z:\TEF_SQL\TestData\test1.db,Z:\test1.db
   258 ExpectedError0=KErrAccessDenied
   259 Delete1=C:\test1.db
   260 ExpectedError1=KErrNotFound
   261 Copy2=Z:\TEF_SQL\TestData\test1.db,C:\test1.db
   262 Open3=C:\test1.db
   263 Prepare4=select count(*) from phone;
   264 Next5=KSqlAtRow
   265 ColumnIndex6=
   266 ColumnInt7=0,1000
   267 Next8=KSqlAtEnd
   268 St_Close9=
   269 Prepare10=select avg(cm_id) from phone;
   270 Next11=KSqlAtRow
   271 ColumnIndex12=
   272 ColumnReal13=0,500.5
   273 Next14=KSqlAtEnd
   274 St_Close15=
   275 Prepare16=select sum(cm_id) from phone;
   276 Next17=KSqlAtRow
   277 AtRow18=True
   278 ColumnIndex19=
   279 ColumnInt20=0,500500
   280 Next21=KSqlAtEnd
   281 St_Close22=
   282 Close23=
   283 // This delete is in itself a test - the 'Copy' above does not and should not
   284 // propagate file permissions from the Z: drive. If it did, this delete would
   285 // fail, but it should not.
   286 Delete24=C:\test1.db
   287 EndBlock25=
   288