[tracker/wip/carlosg/shuffle-dirs: 3/15] libtracker-fts: Drop in-tree fts5 module
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/shuffle-dirs: 3/15] libtracker-fts: Drop in-tree fts5 module
- Date: Sun, 3 Apr 2022 17:49:57 +0000 (UTC)
commit aa94f2f8e2c580815c19d261c7b3f91237011f3e
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Apr 2 19:09:23 2022 +0200
libtracker-fts: Drop in-tree fts5 module
This was only a last resort for sqlite < 3.20, since module loading
API changed around that version, also it probably did us a disservice
since we barely updated the fts5.c file.
We no longer accept such old versions and we expect that sqlite has
a builtin FTS5 module, so we can drop this.
meson.build | 16 +-
src/libtracker-fts/fts5.c | 20402 ---------------------------
src/libtracker-fts/fts5.h | 578 -
src/libtracker-fts/meson.build | 7 -
src/libtracker-fts/tracker-fts-tokenizer.c | 1 -
src/libtracker-fts/tracker-fts.c | 20 -
6 files changed, 2 insertions(+), 21022 deletions(-)
---
diff --git a/meson.build b/meson.build
index 1ae34ceb4..d3f6da31d 100644
--- a/meson.build
+++ b/meson.build
@@ -191,21 +191,11 @@ else
error('Failed to compile SQLite FTS test.')
endif
- if result.returncode() == 0
- sqlite3_has_builtin_fts5 = true
- else
- sqlite3_has_builtin_fts5 = false
+ if result.returncode() != 0
+ error('SQLite has no builtin FTS5.')
endif
endif
-if sqlite3_has_builtin_fts5
- message('Using sqlite3 builtin FTS module')
-elif sqlite.version().version_compare('>= 3.20.0')
- error('FTS support was enabled but SQLite doesn\'t have the FTS module built in')
-else
- message('sqlite3 is older than version 3.20.0, using FTS module that is bundled with Tracker')
-endif
-
##################################################################
# Check for libtracker-data and libtracker-fts: Unicode support
#
@@ -299,7 +289,6 @@ conf = configuration_data()
# Config that goes in config.h
-conf.set('HAVE_BUILTIN_FTS', sqlite3_has_builtin_fts5)
conf.set('HAVE_LIBICU', unicode_library_name == 'icu')
conf.set('HAVE_LIBSTEMMER', have_libstemmer)
conf.set('HAVE_LIBUNISTRING', unicode_library_name == 'unistring')
@@ -415,7 +404,6 @@ summary = [
' Compiler: ' + cc.get_id(),
'\nFeature Support:',
' Unicode support library: ' + unicode_library_name,
- ' Use external FTS module: ' + (not sqlite3_has_builtin_fts5).to_string(),
' Build with Stemming support: ' + have_libstemmer.to_string(),
' API documentation: ' + get_option('docs').to_string(),
' CLI documentation (manpages): ' + get_option('man').to_string(),
diff --git a/src/libtracker-fts/meson.build b/src/libtracker-fts/meson.build
index 44e514484..72e5d9dcd 100644
--- a/src/libtracker-fts/meson.build
+++ b/src/libtracker-fts/meson.build
@@ -1,15 +1,8 @@
-if sqlite3_has_builtin_fts5
- libtracker_fts_fts5 = []
-else
- libtracker_fts_fts5 = files('fts5.c')
-endif
-
libtracker_fts_dependencies = [sqlite]
libtracker_fts = static_library('tracker-fts',
'tracker-fts.c',
'tracker-fts-tokenizer.c',
- libtracker_fts_fts5,
dependencies: [tracker_common_dep],
c_args: tracker_c_args,
gnu_symbol_visibility: 'hidden'
diff --git a/src/libtracker-fts/tracker-fts-tokenizer.c b/src/libtracker-fts/tracker-fts-tokenizer.c
index 707e81a81..e0c8c08f8 100644
--- a/src/libtracker-fts/tracker-fts-tokenizer.c
+++ b/src/libtracker-fts/tracker-fts-tokenizer.c
@@ -31,7 +31,6 @@
#include <libtracker-data/tracker-ontologies.h>
#include "tracker-fts-tokenizer.h"
-#include "fts5.h"
typedef struct TrackerTokenizerData TrackerTokenizerData;
typedef struct TrackerTokenizer TrackerTokenizer;
diff --git a/src/libtracker-fts/tracker-fts.c b/src/libtracker-fts/tracker-fts.c
index f3805e4d0..353685992 100644
--- a/src/libtracker-fts/tracker-fts.c
+++ b/src/libtracker-fts/tracker-fts.c
@@ -26,15 +26,6 @@
#include "tracker-fts-tokenizer.h"
#include "tracker-fts.h"
-#ifndef HAVE_BUILTIN_FTS
-
-#include "sqlite3.h"
-#include "fts5.h"
-
-int sqlite3_fts5_init ();
-
-#endif
-
static gchar **
get_fts_properties (GHashTable *tables)
{
@@ -73,17 +64,6 @@ tracker_fts_init_db (sqlite3 *db,
{
gchar **property_names;
gboolean retval;
-#ifndef HAVE_BUILTIN_FTS
- gchar *err;
-
- if (sqlite3_load_extension (db, NULL, "sqlite3_fts5_init", &err) != SQLITE_OK) {
- g_set_error (error,
- TRACKER_DB_INTERFACE_ERROR,
- TRACKER_DB_OPEN_ERROR,
- "Could not load fts5 module: %s", err);
- return FALSE;
- }
-#endif
property_names = get_fts_properties (tables);
retval = tracker_tokenizer_initialize (db, interface, flags, (const gchar **) property_names, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]