/ Check-in [ab85a6fc]
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:Change the fts5 multi-column syntax to use parenthesis instead of square brackets.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fts5
Files: files | file ages | folders
SHA1: ab85a6fc4f7580278fc9d1f0090fdcf0a90d065b
User & Date: dan 2015-06-02 19:38:15
Context
2015-06-03
11:23
Fix an fts5 problem in extracting columns from position lists containing large varints. check-in: 4ea015ab user: dan tags: fts5
2015-06-02
19:38
Change the fts5 multi-column syntax to use parenthesis instead of square brackets. check-in: ab85a6fc user: dan tags: fts5
18:07
Merge latest trunk changes with this branch. check-in: c9ffda4a user: dan tags: fts5
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts5/fts5_expr.c.

   150    150     while( fts5ExprIsspace(*z) ) z++;
   151    151   
   152    152     pToken->p = z;
   153    153     pToken->n = 1;
   154    154     switch( *z ){
   155    155       case '(':  tok = FTS5_LP;    break;
   156    156       case ')':  tok = FTS5_RP;    break;
   157         -    case '[':  tok = FTS5_LSP;   break;
   158         -    case ']':  tok = FTS5_RSP;   break;
          157  +    case '{':  tok = FTS5_LCP;   break;
          158  +    case '}':  tok = FTS5_RCP;   break;
   159    159       case ':':  tok = FTS5_COLON; break;
   160    160       case ',':  tok = FTS5_COMMA; break;
   161    161       case '+':  tok = FTS5_PLUS;  break;
   162    162       case '*':  tok = FTS5_STAR;  break;
   163    163       case '\0': tok = FTS5_EOF;   break;
   164    164   
   165    165       case '"': {

Changes to ext/fts5/fts5parse.y.

   102    102   }
   103    103   
   104    104   %type colset {Fts5ExprColset*}
   105    105   %destructor colset { sqlite3_free($$); }
   106    106   %type colsetlist {Fts5ExprColset*}
   107    107   %destructor colsetlist { sqlite3_free($$); }
   108    108   
   109         -colset(A) ::= LSP colsetlist(X) RSP. { A = X; }
          109  +colset(A) ::= LCP colsetlist(X) RCP. { A = X; }
   110    110   colset(A) ::= STRING(X). {
   111    111     A = sqlite3Fts5ParseColset(pParse, 0, &X);
   112    112   }
   113    113   
   114    114   colsetlist(A) ::= colsetlist(Y) STRING(X). { 
   115    115     A = sqlite3Fts5ParseColset(pParse, Y, &X); }
   116    116   colsetlist(A) ::= STRING(X). { 

Changes to ext/fts5/test/fts5ac.test.

   254    254     # Queries on a specific column.
   255    255     #
   256    256     foreach {tn expr} {
   257    257       1.1 "x:a"
   258    258       1.2 "y:a"
   259    259       1.3 "x:b"
   260    260       1.4 "y:b"
   261         -    2.1 "[x]:a"
   262         -    2.2 "[y]:a"
   263         -    2.3 "[x]:b"
   264         -    2.4 "[y]:b"
          261  +    2.1 "{x}:a"
          262  +    2.2 "{y}:a"
          263  +    2.3 "{x}:b"
          264  +    2.4 "{y}:b"
   265    265   
   266         -    3.1 "[x y]:a"
   267         -    3.2 "[y x]:a"
   268         -    3.3 "[x x]:b"
   269         -    3.4 "[y y]:b"
          266  +    3.1 "{x y}:a"
          267  +    3.2 "{y x}:a"
          268  +    3.3 "{x x}:b"
          269  +    3.4 "{y y}:b"
   270    270   
   271         -    4.1 {["x" "y"]:a}
   272         -    4.2 {["y" x]:a}
   273         -    4.3 {[x "x"]:b}
   274         -    4.4 {["y" y]:b}
          271  +    4.1 {{"x" "y"}:a}
          272  +    4.2 {{"y" x}:a}
          273  +    4.3 {{x "x"}:b}
          274  +    4.4 {{"y" y}:b}
   275    275     } {
   276    276       set res [matchdata 1 $expr]
   277    277       do_execsql_test $tn2.3.$tn.[llength $res] { 
   278    278         SELECT rowid, fts5_test_poslist(xx) FROM xx WHERE xx match $expr
   279    279       } $res
   280    280     }
   281    281   

Changes to ext/fts5/test/fts5auto.test.

   297    297       }
   298    298       }
   299    299     }
   300    300     execsql COMMIT
   301    301   
   302    302   
   303    303     foreach {tn expr} {
   304         -    A.1 { [a] : x }
   305         -    A.2 { [a b] : x }
   306         -    A.3 { [a b f] : x }
   307         -    A.4 { [f a b] : x }
   308         -    A.5 { [f a b] : x y }
   309         -    A.6 { [f a b] : x + y }
   310         -    A.7 { [c a b] : x + c }
   311         -    A.8 { [c d] : "l m" }
   312         -    A.9 { [c e] : "l m" }
          304  +    A.1 { {a} : x }
          305  +    A.2 { {a b} : x }
          306  +    A.3 { {a b f} : x }
          307  +    A.4 { {f a b} : x }
          308  +    A.5 { {f a b} : x y }
          309  +    A.6 { {f a b} : x + y }
          310  +    A.7 { {c a b} : x + c }
          311  +    A.8 { {c d} : "l m" }
          312  +    A.9 { {c e} : "l m" }
   313    313   
   314    314       B.1 { a NOT b }
   315    315       B.2 { a NOT a:b }
   316    316       B.3 { a OR (b AND c) }
   317         -    B.4 { a OR (b AND [a b c]:c) }
          317  +    B.4 { a OR (b AND {a b c}:c) }
   318    318       B.5 { a OR "b c" }
   319    319       B.6 { a OR b OR c }
   320    320   
   321    321       C.1 { a OR (b AND "b c") }
   322    322       C.2 { a OR (b AND "z c") }
   323    323     } {
   324    324       do_auto_test 3.$fold.$tn $expr
   325    325     }
   326    326   }
   327    327   
   328    328   finish_test
   329    329