Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: third_party/sqlite/src/test/minmax3.test

Issue 5626002: Update sqlite to 3.7.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/third_party/sqlite/src
Patch Set: Remove misc change. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/src/test/memsubsys1.test ('k') | third_party/sqlite/src/test/misc1.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 2008 January 5 1 # 2008 January 5
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #*********************************************************************** 10 #***********************************************************************
11 # $Id: minmax3.test,v 1.5 2008/07/12 14:52:20 drh Exp $ 11 # $Id: minmax3.test,v 1.5 2008/07/12 14:52:20 drh Exp $
12 12
13 set testdir [file dirname $argv0] 13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl 14 source $testdir/tester.tcl
15 15
16 # Do not use a codec for tests in this file, as the database file is
17 # manipulated directly using tcl scripts (using the [hexio_write] command).
18 #
19 do_not_use_codec
20
16 # Do an SQL statement. Append the search count to the end of the result. 21 # Do an SQL statement. Append the search count to the end of the result.
17 # 22 #
18 proc count sql { 23 proc count sql {
19 set ::sqlite_search_count 0 24 set ::sqlite_search_count 0
20 return [concat [execsql $sql] $::sqlite_search_count] 25 return [concat [execsql $sql] $::sqlite_search_count]
21 } 26 }
22 27
23 # This procedure sets the value of the file-format in file 'test.db' 28 # This procedure sets the value of the file-format in file 'test.db'
24 # to $newval. Also, the schema cookie is incremented. 29 # to $newval. Also, the schema cookie is incremented.
25 # 30 #
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 do_test minmax3-2.6 { 172 do_test minmax3-2.6 {
168 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b<2; } 173 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b<2; }
169 } {1} 174 } {1}
170 do_test minmax3-2.7 { 175 do_test minmax3-2.7 {
171 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b<1; } 176 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b<1; }
172 } {{}} 177 } {{}}
173 do_test minmax3-2.8 { 178 do_test minmax3-2.8 {
174 execsql { SELECT min(b) FROM t2 WHERE a = 3 AND b<1; } 179 execsql { SELECT min(b) FROM t2 WHERE a = 3 AND b<1; }
175 } {{}} 180 } {{}}
176 181
177 do_test minmax3-2.1 { 182 do_test minmax3-3.1 {
178 execsql { 183 execsql {
179 DROP TABLE t2; 184 DROP TABLE t2;
180 CREATE TABLE t2(a, b); 185 CREATE TABLE t2(a, b);
181 CREATE INDEX i3 ON t2(a, b DESC); 186 CREATE INDEX i3 ON t2(a, b DESC);
182 INSERT INTO t2 VALUES(1, NULL); 187 INSERT INTO t2 VALUES(1, NULL);
183 INSERT INTO t2 VALUES(1, 1); 188 INSERT INTO t2 VALUES(1, 1);
184 INSERT INTO t2 VALUES(1, 2); 189 INSERT INTO t2 VALUES(1, 2);
185 INSERT INTO t2 VALUES(1, 3); 190 INSERT INTO t2 VALUES(1, 3);
186 INSERT INTO t2 VALUES(2, NULL); 191 INSERT INTO t2 VALUES(2, NULL);
187 INSERT INTO t2 VALUES(2, 1); 192 INSERT INTO t2 VALUES(2, 1);
188 INSERT INTO t2 VALUES(2, 2); 193 INSERT INTO t2 VALUES(2, 2);
189 INSERT INTO t2 VALUES(2, 3); 194 INSERT INTO t2 VALUES(2, 3);
190 INSERT INTO t2 VALUES(3, 1); 195 INSERT INTO t2 VALUES(3, 1);
191 INSERT INTO t2 VALUES(3, 2); 196 INSERT INTO t2 VALUES(3, 2);
192 INSERT INTO t2 VALUES(3, 3); 197 INSERT INTO t2 VALUES(3, 3);
193 } 198 }
194 } {} 199 } {}
195 do_test minmax3-2.2 { 200 do_test minmax3-3.2 {
196 execsql { SELECT min(b) FROM t2 WHERE a = 1; } 201 execsql { SELECT min(b) FROM t2 WHERE a = 1; }
197 } {1} 202 } {1}
198 do_test minmax3-2.3 { 203 do_test minmax3-3.3 {
199 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b>1; } 204 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b>1; }
200 } {2} 205 } {2}
201 do_test minmax3-2.4 { 206 do_test minmax3-3.4 {
202 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b>-1; } 207 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b>-1; }
203 } {1} 208 } {1}
204 do_test minmax3-2.5 { 209 do_test minmax3-3.5 {
205 execsql { SELECT min(b) FROM t2 WHERE a = 1; } 210 execsql { SELECT min(b) FROM t2 WHERE a = 1; }
206 } {1} 211 } {1}
207 do_test minmax3-2.6 { 212 do_test minmax3-3.6 {
208 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b<2; } 213 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b<2; }
209 } {1} 214 } {1}
210 do_test minmax3-2.7 { 215 do_test minmax3-3.7 {
211 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b<1; } 216 execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b<1; }
212 } {{}} 217 } {{}}
213 do_test minmax3-2.8 { 218 do_test minmax3-3.8 {
214 execsql { SELECT min(b) FROM t2 WHERE a = 3 AND b<1; } 219 execsql { SELECT min(b) FROM t2 WHERE a = 3 AND b<1; }
215 } {{}} 220 } {{}}
216 221
222 do_test minmax3-4.1 {
223 execsql {
224 CREATE TABLE t4(x);
225 INSERT INTO t4 VALUES('abc');
226 INSERT INTO t4 VALUES('BCD');
227 SELECT max(x) FROM t4;
228 }
229 } {abc}
230 do_test minmax3-4.2 {
231 execsql {
232 SELECT max(x COLLATE nocase) FROM t4;
233 }
234 } {BCD}
235 do_test minmax3-4.3 {
236 execsql {
237 SELECT max(x), max(x COLLATE nocase) FROM t4;
238 }
239 } {abc BCD}
240 do_test minmax3-4.4 {
241 execsql {
242 SELECT max(x COLLATE binary), max(x COLLATE nocase) FROM t4;
243 }
244 } {abc BCD}
245 do_test minmax3-4.5 {
246 execsql {
247 SELECT max(x COLLATE nocase), max(x COLLATE rtrim) FROM t4;
248 }
249 } {BCD abc}
250 do_test minmax3-4.6 {
251 execsql {
252 SELECT max(x COLLATE nocase), max(x) FROM t4;
253 }
254 } {BCD abc}
255 do_test minmax3-4.10 {
256 execsql {
257 SELECT min(x) FROM t4;
258 }
259 } {BCD}
260 do_test minmax3-4.11 {
261 execsql {
262 SELECT min(x COLLATE nocase) FROM t4;
263 }
264 } {abc}
265 do_test minmax3-4.12 {
266 execsql {
267 SELECT min(x), min(x COLLATE nocase) FROM t4;
268 }
269 } {BCD abc}
270 do_test minmax3-4.13 {
271 execsql {
272 SELECT min(x COLLATE binary), min(x COLLATE nocase) FROM t4;
273 }
274 } {BCD abc}
275 do_test minmax3-4.14 {
276 execsql {
277 SELECT min(x COLLATE nocase), min(x COLLATE rtrim) FROM t4;
278 }
279 } {abc BCD}
280 do_test minmax3-4.15 {
281 execsql {
282 SELECT min(x COLLATE nocase), min(x) FROM t4;
283 }
284 } {abc BCD}
285
286
217 finish_test 287 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/memsubsys1.test ('k') | third_party/sqlite/src/test/misc1.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698