/ Check-in [95ef9632]
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:Add support for building with fts3. (CVS 4250)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 95ef963232ab1f15a7c42229819d33d3571a753e
User & Date: shess 2007-08-20 17:37:48
Context
2007-08-20
17:38
Replicate the fts2*.test files as fts3a*.test, and convert fts2 to fts3 in the text of the files. (CVS 4251) check-in: 24739f14 user: shess tags: trunk
17:37
Add support for building with fts3. (CVS 4250) check-in: 95ef9632 user: shess tags: trunk
17:37
Copy fts2 to fts3, renaming, and replacing references to fts2 with fts3, including capitalization variants. (CVS 4249) check-in: 216c91d2 user: shess tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to main.mk.

    62     62            opcodes.o os.o os_os2.o os_unix.o os_win.o \
    63     63            pager.o parse.o pragma.o prepare.o printf.o random.o \
    64     64            select.o table.o tclsqlite.o tokenize.o trigger.o \
    65     65            update.o util.o vacuum.o \
    66     66            vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbefifo.o vdbemem.o \
    67     67            where.o utf.o legacy.o vtab.o
    68     68   
    69         -EXTOBJ = icu.o fts2.o fts2_hash.o fts2_icu.o fts2_porter.o       \
    70         -         fts2_tokenizer.o fts2_tokenizer1.o
           69  +EXTOBJ = icu.o
           70  +EXTOBJ += fts1.o \
           71  +	  fts1_hash.o \
           72  +	  fts1_tokenizer1.o \
           73  +	  fts1_porter.o
           74  +EXTOBJ += fts2.o \
           75  +	  fts2_hash.o \
           76  +	  fts2_icu.o \
           77  +	  fts2_porter.o \
           78  +          fts2_tokenizer.o \
           79  +	  fts2_tokenizer1.o
           80  +EXTOBJ += fts3.o \
           81  +	  fts3_hash.o \
           82  +	  fts3_icu.o \
           83  +	  fts3_porter.o \
           84  +          fts3_tokenizer.o \
           85  +	  fts3_tokenizer1.o
    71     86   
    72     87   # All of the source code files.
    73     88   #
    74     89   SRC = \
    75     90     $(TOP)/src/alter.c \
    76     91     $(TOP)/src/analyze.c \
    77     92     $(TOP)/src/attach.c \
................................................................................
   147    162     $(TOP)/ext/fts2/fts2_hash.h \
   148    163     $(TOP)/ext/fts2/fts2_icu.c \
   149    164     $(TOP)/ext/fts2/fts2_porter.c \
   150    165     $(TOP)/ext/fts2/fts2_tokenizer.h \
   151    166     $(TOP)/ext/fts2/fts2_tokenizer.c \
   152    167     $(TOP)/ext/fts2/fts2_tokenizer1.c
   153    168   SRC += \
          169  +  $(TOP)/ext/fts3/fts3.c \
          170  +  $(TOP)/ext/fts3/fts3.h \
          171  +  $(TOP)/ext/fts3/fts3_hash.c \
          172  +  $(TOP)/ext/fts3/fts3_hash.h \
          173  +  $(TOP)/ext/fts3/fts3_icu.c \
          174  +  $(TOP)/ext/fts3/fts3_porter.c \
          175  +  $(TOP)/ext/fts3/fts3_tokenizer.h \
          176  +  $(TOP)/ext/fts3/fts3_tokenizer.c \
          177  +  $(TOP)/ext/fts3/fts3_tokenizer1.c
          178  +SRC += \
   154    179     $(TOP)/ext/icu/icu.c
   155    180   
   156    181   
   157    182   # Generated source code files
   158    183   #
   159    184   SRC += \
   160    185     keywordhash.h \
................................................................................
   199    224     $(TOP)/src/test_schema.c \
   200    225     $(TOP)/src/test_server.c \
   201    226     $(TOP)/src/test_tclvar.c \
   202    227     $(TOP)/src/utf.c \
   203    228     $(TOP)/src/util.c \
   204    229     $(TOP)/src/vdbe.c \
   205    230     $(TOP)/src/vdbeaux.c \
   206         -  $(TOP)/src/where.c \
   207         -  $(TOP)/ext/fts2/fts2_tokenizer.c
          231  +  $(TOP)/src/where.c
          232  +TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
          233  +TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c
   208    234   
   209    235   # Header files used by all library source files.
   210    236   #
   211    237   HDR = \
   212    238      sqlite3.h  \
   213    239      $(TOP)/src/btree.h \
   214    240      $(TOP)/src/btreeInt.h \
................................................................................
   228    254     $(TOP)/ext/fts1/fts1.h \
   229    255     $(TOP)/ext/fts1/fts1_hash.h \
   230    256     $(TOP)/ext/fts1/fts1_tokenizer.h
   231    257   EXTHDR += \
   232    258     $(TOP)/ext/fts2/fts2.h \
   233    259     $(TOP)/ext/fts2/fts2_hash.h \
   234    260     $(TOP)/ext/fts2/fts2_tokenizer.h
          261  +EXTHDR += \
          262  +  $(TOP)/ext/fts3/fts3.h \
          263  +  $(TOP)/ext/fts3/fts3_hash.h \
          264  +  $(TOP)/ext/fts3/fts3_tokenizer.h
   235    265   
   236    266   
   237    267   # Header files used by the VDBE submodule
   238    268   #
   239    269   VDBEHDR = \
   240    270      $(TOP)/src/vdbeInt.h
   241    271   
................................................................................
   278    308   	tclsh $(TOP)/tool/mksqlite3c.tcl
   279    309   	cp sqlite3.c tclsqlite3.c
   280    310   	cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c
   281    311   	tclsh $(TOP)/tool/mksqlite3internalh.tcl
   282    312   
   283    313   fts2amal.c:	target_source $(TOP)/ext/fts2/mkfts2amal.tcl
   284    314   	tclsh $(TOP)/ext/fts2/mkfts2amal.tcl
          315  +
          316  +fts3amal.c:	target_source $(TOP)/ext/fts3/mkfts3amal.tcl
          317  +	tclsh $(TOP)/ext/fts3/mkfts3amal.tcl
   285    318   
   286    319   # Rules to build the LEMON compiler generator
   287    320   #
   288    321   lemon:	$(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
   289    322   	$(BCC) -o lemon $(TOP)/tool/lemon.c
   290    323   	cp $(TOP)/tool/lempar.c .
   291    324   
................................................................................
   480    513   
   481    514   fts2_tokenizer.o:	$(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR)
   482    515   	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c
   483    516   
   484    517   fts2_tokenizer1.o:	$(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR)
   485    518   	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c
   486    519   
          520  +fts3.o:	$(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR)
          521  +	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c
          522  +
          523  +fts3_hash.o:	$(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR)
          524  +	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c
          525  +
          526  +fts3_icu.o:	$(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR)
          527  +	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c
          528  +
          529  +fts3_porter.o:	$(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR)
          530  +	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c
          531  +
          532  +fts3_tokenizer.o:	$(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
          533  +	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c
          534  +
          535  +fts3_tokenizer1.o:	$(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR)
          536  +	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c
          537  +
   487    538   
   488    539   # Rules for building test programs and for running tests
   489    540   #
   490    541   tclsqlite3:	$(TOP)/src/tclsqlite.c libsqlite3.a
   491    542   	$(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \
   492    543   		$(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
   493    544   

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.387 2007/08/20 16:07:01 danielk1977 Exp $
           17  +** $Id: main.c,v 1.388 2007/08/20 17:37:48 shess Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include "os.h"
    21     21   #include <ctype.h>
    22     22   
    23     23   /*
    24     24   ** The version of the library
................................................................................
   996    996   
   997    997   #ifdef SQLITE_ENABLE_FTS2
   998    998     if( !db->mallocFailed && rc==SQLITE_OK ){
   999    999       extern int sqlite3Fts2Init(sqlite3*);
  1000   1000       rc = sqlite3Fts2Init(db);
  1001   1001     }
  1002   1002   #endif
         1003  +
         1004  +#ifdef SQLITE_ENABLE_FTS3
         1005  +  if( !db->mallocFailed && rc==SQLITE_OK ){
         1006  +    extern int sqlite3Fts3Init(sqlite3*);
         1007  +    rc = sqlite3Fts3Init(db);
         1008  +  }
         1009  +#endif
  1003   1010   
  1004   1011   #ifdef SQLITE_ENABLE_ICU
  1005   1012     if( !db->mallocFailed && rc==SQLITE_OK ){
  1006   1013       extern int sqlite3IcuInit(sqlite3*);
  1007   1014       rc = sqlite3IcuInit(db);
  1008   1015     }
  1009   1016   #endif

Changes to src/test_config.c.

    12     12   ** 
    13     13   ** This file contains code used for testing the SQLite system.
    14     14   ** None of the code in this file goes into a deliverable build.
    15     15   ** 
    16     16   ** The focus of this file is providing the TCL testing layer
    17     17   ** access to compile-time constants.
    18     18   **
    19         -** $Id: test_config.c,v 1.7 2007/08/13 15:18:28 drh Exp $
           19  +** $Id: test_config.c,v 1.8 2007/08/20 17:37:48 shess Exp $
    20     20   */
    21     21   #include "sqliteInt.h"
    22     22   #include "tcl.h"
    23     23   #include "os.h"
    24     24   #include <stdlib.h>
    25     25   #include <string.h>
    26     26   
................................................................................
   192    192   #endif
   193    193   
   194    194   #ifdef SQLITE_ENABLE_FTS2
   195    195     Tcl_SetVar2(interp, "sqlite_options", "fts2", "1", TCL_GLOBAL_ONLY);
   196    196   #else
   197    197     Tcl_SetVar2(interp, "sqlite_options", "fts2", "0", TCL_GLOBAL_ONLY);
   198    198   #endif
          199  +
          200  +#ifdef SQLITE_ENABLE_FTS3
          201  +  Tcl_SetVar2(interp, "sqlite_options", "fts3", "1", TCL_GLOBAL_ONLY);
          202  +#else
          203  +  Tcl_SetVar2(interp, "sqlite_options", "fts3", "0", TCL_GLOBAL_ONLY);
          204  +#endif
   199    205   
   200    206   #ifdef SQLITE_OMIT_GLOBALRECOVER
   201    207     Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "0", TCL_GLOBAL_ONLY);
   202    208   #else
   203    209     Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "1", TCL_GLOBAL_ONLY);
   204    210   #endif
   205    211