/ Check-in [de11cd5c]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Test the fts4 content and prefix options together.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: de11cd5cc903e56ff641079bc64dd0ae5e133aa7
User & Date: dan 2012-01-16 16:39:36
Context
2012-01-16
16:56
Enhance the command-lin shell to interpret CSV files as described by the wikipedia article on CSV. check-in: 93aa17d8 user: drh tags: trunk
16:39
Test the fts4 content and prefix options together. check-in: de11cd5c user: dan tags: trunk
13:28
Version 3.7.10 check-in: ebd01a8d user: drh tags: trunk, release, version-3.7.10
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/fts4content.test.

39
40
41
42
43
44
45



46
47
48
49
50
51
52
...
494
495
496
497
498
499
500





















501
#   6.* - Test the effects of messing with the schema of table xxx after
#         creating a content=xxx FTS index.
#   
#   7.* - Test that if content=xxx is specified and table xxx does not
#         exist, the FTS table can still be used for INSERT and some
#         SELECT statements.
#




do_execsql_test 1.1.1 {
  CREATE TABLE t1(a, b, c);
  INSERT INTO t1 VALUES('w x', 'x y', 'y z');
  CREATE VIRTUAL TABLE ft1 USING fts4(content=t1);
}

................................................................................
  SELECT name FROM sqlite_master WHERE name LIKE 'ft9_%';
} {ft9_segments ft9_segdir ft9_docsize ft9_stat}

do_catchsql_test 7.2.4 {
  SELECT * FROM ft9 WHERE ft9 MATCH 'N';
} {1 {SQL logic error or missing database}}






















finish_test







>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
...
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
#   6.* - Test the effects of messing with the schema of table xxx after
#         creating a content=xxx FTS index.
#   
#   7.* - Test that if content=xxx is specified and table xxx does not
#         exist, the FTS table can still be used for INSERT and some
#         SELECT statements.
#
#   8.* - Test that if the content=xxx and prefix options are used together,
#         the 'rebuild' command still works.
#

do_execsql_test 1.1.1 {
  CREATE TABLE t1(a, b, c);
  INSERT INTO t1 VALUES('w x', 'x y', 'y z');
  CREATE VIRTUAL TABLE ft1 USING fts4(content=t1);
}

................................................................................
  SELECT name FROM sqlite_master WHERE name LIKE 'ft9_%';
} {ft9_segments ft9_segdir ft9_docsize ft9_stat}

do_catchsql_test 7.2.4 {
  SELECT * FROM ft9 WHERE ft9 MATCH 'N';
} {1 {SQL logic error or missing database}}

#-------------------------------------------------------------------------
# Test cases 8.*
# 
do_execsql_test 8.1 {
  CREATE TABLE t10(a, b);
  INSERT INTO t10 VALUES(
      'abasia abasic abask', 'Abassin abastardize abatable');
  INSERT INTO t10 VALUES(
      'abate abatement abater', 'abatis abatised abaton');
  INSERT INTO t10 VALUES(
      'abator abattoir Abatua', 'abature abave abaxial');

  CREATE VIRTUAL TABLE ft10 USING fts4(content=t10, prefix="2,4", a, b);
}

do_execsql_test 8.2 { SELECT * FROM ft10 WHERE a MATCH 'ab*';          }
do_execsql_test 8.3 { INSERT INTO ft10(ft10) VALUES('rebuild');        }
do_execsql_test 8.4 { SELECT rowid FROM ft10 WHERE a MATCH 'ab*';      } {1 2 3}
do_execsql_test 8.5 { SELECT rowid FROM ft10 WHERE b MATCH 'abav*';    } {3}
do_execsql_test 8.6 { SELECT rowid FROM ft10 WHERE ft10 MATCH 'abas*'; } {1}

finish_test