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