[tracker/direct-access] libtracker-data: Use single DB file
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/direct-access] libtracker-data: Use single DB file
- Date: Tue, 20 Jul 2010 08:40:54 +0000 (UTC)
commit 0028d37abd1930415f53e31089a3d5662a9385ac
Author: Jürg Billeter <j bitron ch>
Date: Tue Jul 20 10:39:54 2010 +0200
libtracker-data: Use single DB file
WAL does not guarantee atomicity with multiple DB files.
src/libtracker-data/tracker-db-manager.c | 40 ++++-------------------------
src/libtracker-fts/tracker-fts.c | 6 ++--
2 files changed, 9 insertions(+), 37 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index ab6b68d..cc68cdb 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -128,17 +128,6 @@ static TrackerDBDefinition dbs[] = {
FALSE,
FALSE,
0 },
- { TRACKER_DB_FULLTEXT,
- TRACKER_DB_LOCATION_DATA_DIR,
- NULL,
- "fulltext.db",
- "fulltext",
- NULL,
- 512,
- TRACKER_DB_PAGE_SIZE_DONT_SET,
- FALSE,
- TRUE,
- 0 },
};
static gboolean db_exec_no_reply (TrackerDBInterface *iface,
@@ -328,17 +317,6 @@ db_interface_get (TrackerDB type,
}
static TrackerDBInterface *
-db_interface_get_fulltext (void)
-{
- TrackerDBInterface *iface;
- gboolean create;
-
- iface = db_interface_get (TRACKER_DB_FULLTEXT, &create);
-
- return iface;
-}
-
-static TrackerDBInterface *
db_interface_get_metadata (void)
{
TrackerDBInterface *iface;
@@ -368,9 +346,6 @@ db_interface_create (TrackerDB db)
case TRACKER_DB_METADATA:
return db_interface_get_metadata ();
- case TRACKER_DB_FULLTEXT:
- return db_interface_get_fulltext ();
-
default:
g_critical ("This TrackerDB type:%d->'%s' has no interface set up yet!!",
db,
@@ -884,13 +859,11 @@ tracker_db_manager_init (TrackerDBManagerFlags flags,
thread_ifaces = g_hash_table_new (NULL, NULL);
if (flags & TRACKER_DB_MANAGER_READONLY) {
- resources_iface = tracker_db_manager_get_db_interfaces_ro (2,
- TRACKER_DB_METADATA,
- TRACKER_DB_FULLTEXT);
+ resources_iface = tracker_db_manager_get_db_interfaces_ro (1,
+ TRACKER_DB_METADATA);
} else {
- resources_iface = tracker_db_manager_get_db_interfaces (2,
- TRACKER_DB_METADATA,
- TRACKER_DB_FULLTEXT);
+ resources_iface = tracker_db_manager_get_db_interfaces (1,
+ TRACKER_DB_METADATA);
}
g_static_private_set (&interface_data_key, resources_iface, free_thread_interface);
@@ -1207,9 +1180,8 @@ tracker_db_manager_get_db_interface (void)
/* Ensure the interface is there */
if (!interface) {
- interface = tracker_db_manager_get_db_interfaces (2,
- TRACKER_DB_METADATA,
- TRACKER_DB_FULLTEXT);
+ interface = tracker_db_manager_get_db_interfaces (1,
+ TRACKER_DB_METADATA);
tracker_db_interface_sqlite_fts_init (interface, FALSE);
diff --git a/src/libtracker-fts/tracker-fts.c b/src/libtracker-fts/tracker-fts.c
index 6782a8e..67bbd03 100644
--- a/src/libtracker-fts/tracker-fts.c
+++ b/src/libtracker-fts/tracker-fts.c
@@ -7906,10 +7906,10 @@ int tracker_fts_init(sqlite3 *db, int create, GObject *object){
int rc = SQLITE_OK;
if (create){
- createTables (db, "fulltext", "fts");
+ createTables (db, "main", "fts");
}
- constructVtab(db, "fulltext", "fts", NULL, object);
+ constructVtab(db, "main", "fts", NULL, object);
/* Create the virtual table wrapper around the hash-table and overload
** the two scalar functions. If this is successful, register the
@@ -7932,7 +7932,7 @@ int tracker_fts_init(sqlite3 *db, int create, GObject *object){
return rc;
if (create){
- rc = sqlite3_exec(db, "CREATE VIRTUAL TABLE fulltext.fts USING trackerfts", NULL, 0, NULL);
+ rc = sqlite3_exec(db, "CREATE VIRTUAL TABLE fts USING trackerfts", NULL, 0, NULL);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]