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

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

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months 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/fts3defer2.test ('k') | third_party/sqlite/src/test/fts3fault.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 # 2006 September 9 1 # 2006 September 9
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 #*************************************************************************
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 # errors in query expressions. This is done using a real fts3 table and 329 # errors in query expressions. This is done using a real fts3 table and
330 # MATCH clauses, not the parser test interface. 330 # MATCH clauses, not the parser test interface.
331 # 331 #
332 do_test fts3expr-4.1 { 332 do_test fts3expr-4.1 {
333 execsql { CREATE VIRTUAL TABLE t1 USING fts3(a, b, c) } 333 execsql { CREATE VIRTUAL TABLE t1 USING fts3(a, b, c) }
334 } {} 334 } {}
335 335
336 # Mismatched parenthesis: 336 # Mismatched parenthesis:
337 do_test fts3expr-4.2.1 { 337 do_test fts3expr-4.2.1 {
338 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example AND (hello OR world))' } 338 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example AND (hello OR world))' }
339 } {1 {SQL logic error or missing database}} 339 } {1 {malformed MATCH expression: [example AND (hello OR world))]}}
340 do_test fts3expr-4.2.2 { 340 do_test fts3expr-4.2.2 {
341 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example AND (hello OR world' } 341 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example AND (hello OR world' }
342 } {1 {SQL logic error or missing database}} 342 } {1 {malformed MATCH expression: [example AND (hello OR world]}}
343 do_test fts3expr-4.2.3 { 343 do_test fts3expr-4.2.3 {
344 catchsql { SELECT * FROM t1 WHERE t1 MATCH '(hello' } 344 catchsql { SELECT * FROM t1 WHERE t1 MATCH '(hello' }
345 } {1 {SQL logic error or missing database}} 345 } {1 {malformed MATCH expression: [(hello]}}
346 do_test fts3expr-4.2.4 { 346 do_test fts3expr-4.2.4 {
347 catchsql { SELECT * FROM t1 WHERE t1 MATCH '(' } 347 catchsql { SELECT * FROM t1 WHERE t1 MATCH '(' }
348 } {1 {SQL logic error or missing database}} 348 } {1 {malformed MATCH expression: [(]}}
349 do_test fts3expr-4.2.5 { 349 do_test fts3expr-4.2.5 {
350 catchsql { SELECT * FROM t1 WHERE t1 MATCH ')' } 350 catchsql { SELECT * FROM t1 WHERE t1 MATCH ')' }
351 } {1 {SQL logic error or missing database}} 351 } {1 {malformed MATCH expression: [)]}}
352 352
353 do_test fts3expr-4.2.6 { 353 do_test fts3expr-4.2.6 {
354 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example (hello world' } 354 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example (hello world' }
355 } {1 {SQL logic error or missing database}} 355 } {1 {malformed MATCH expression: [example (hello world]}}
356 356
357 # Unterminated quotation marks: 357 # Unterminated quotation marks:
358 do_test fts3expr-4.3.1 { 358 do_test fts3expr-4.3.1 {
359 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example OR "hello world' } 359 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example OR "hello world' }
360 } {1 {SQL logic error or missing database}} 360 } {1 {malformed MATCH expression: [example OR "hello world]}}
361 do_test fts3expr-4.3.2 { 361 do_test fts3expr-4.3.2 {
362 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example OR hello world"' } 362 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example OR hello world"' }
363 } {1 {SQL logic error or missing database}} 363 } {1 {malformed MATCH expression: [example OR hello world"]}}
364 364
365 # Binary operators without the required operands. 365 # Binary operators without the required operands.
366 do_test fts3expr-4.4.1 { 366 do_test fts3expr-4.4.1 {
367 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'OR hello world' } 367 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'OR hello world' }
368 } {1 {SQL logic error or missing database}} 368 } {1 {malformed MATCH expression: [OR hello world]}}
369 do_test fts3expr-4.4.2 { 369 do_test fts3expr-4.4.2 {
370 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'hello world OR' } 370 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'hello world OR' }
371 } {1 {SQL logic error or missing database}} 371 } {1 {malformed MATCH expression: [hello world OR]}}
372 do_test fts3expr-4.4.3 { 372 do_test fts3expr-4.4.3 {
373 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'one (hello world OR) two' } 373 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'one (hello world OR) two' }
374 } {1 {SQL logic error or missing database}} 374 } {1 {malformed MATCH expression: [one (hello world OR) two]}}
375 do_test fts3expr-4.4.4 { 375 do_test fts3expr-4.4.4 {
376 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'one (OR hello world) two' } 376 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'one (OR hello world) two' }
377 } {1 {SQL logic error or missing database}} 377 } {1 {malformed MATCH expression: [one (OR hello world) two]}}
378 378
379 # NEAR operators with something other than phrases as arguments. 379 # NEAR operators with something other than phrases as arguments.
380 do_test fts3expr-4.5.1 { 380 do_test fts3expr-4.5.1 {
381 catchsql { SELECT * FROM t1 WHERE t1 MATCH '(hello OR world) NEAR one' } 381 catchsql { SELECT * FROM t1 WHERE t1 MATCH '(hello OR world) NEAR one' }
382 } {1 {SQL logic error or missing database}} 382 } {1 {malformed MATCH expression: [(hello OR world) NEAR one]}}
383 do_test fts3expr-4.5.2 { 383 do_test fts3expr-4.5.2 {
384 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'one NEAR (hello OR world)' } 384 catchsql { SELECT * FROM t1 WHERE t1 MATCH 'one NEAR (hello OR world)' }
385 } {1 {SQL logic error or missing database}} 385 } {1 {malformed MATCH expression: [one NEAR (hello OR world)]}}
386 386
387 #------------------------------------------------------------------------ 387 #------------------------------------------------------------------------
388 # The following OOM tests are designed to cover cases in fts3_expr.c. 388 # The following OOM tests are designed to cover cases in fts3_expr.c.
389 # 389 #
390 source $testdir/malloc_common.tcl 390 source $testdir/malloc_common.tcl
391 do_malloc_test fts3expr-malloc-1 -sqlbody { 391 do_malloc_test fts3expr-malloc-1 -sqlbody {
392 SELECT fts3_exprtest('simple', 'a b c "d e f"', 'a', 'b', 'c') 392 SELECT fts3_exprtest('simple', 'a b c "d e f"', 'a', 'b', 'c')
393 } 393 }
394 do_malloc_test fts3expr-malloc-2 -tclprep { 394 do_malloc_test fts3expr-malloc-2 -tclprep {
395 set sqlite_fts3_enable_parentheses 0 395 set sqlite_fts3_enable_parentheses 0
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 execsql { 490 execsql {
491 CREATE VIRTUAL TABLE test USING fts3 (keyword); 491 CREATE VIRTUAL TABLE test USING fts3 (keyword);
492 INSERT INTO test VALUES ('abc'); 492 INSERT INTO test VALUES ('abc');
493 SELECT * FROM test WHERE keyword MATCH '""'; 493 SELECT * FROM test WHERE keyword MATCH '""';
494 } 494 }
495 } {} 495 } {}
496 496
497 497
498 set sqlite_fts3_enable_parentheses 0 498 set sqlite_fts3_enable_parentheses 0
499 finish_test 499 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/fts3defer2.test ('k') | third_party/sqlite/src/test/fts3fault.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698