tracker r1654 - in branches/indexer-split: . src/libtracker-db
- From: carlosg svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1654 - in branches/indexer-split: . src/libtracker-db
- Date: Thu, 12 Jun 2008 11:57:26 +0000 (UTC)
Author: carlosg
Date: Thu Jun 12 11:57:26 2008
New Revision: 1654
URL: http://svn.gnome.org/viewvc/tracker?rev=1654&view=rev
Log:
2008-06-12 Carlos Garnacho <carlos imendio com>
* src/libtracker-db/tracker-db-manager.c: Actually deal with a single
TrackerDBInterface if attach_all is TRUE.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/libtracker-db/tracker-db-manager.c
Modified: branches/indexer-split/src/libtracker-db/tracker-db-manager.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-manager.c (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-manager.c Thu Jun 12 11:57:26 2008
@@ -77,7 +77,7 @@
TRACKER_DB_LOCATION_DATA_DIR,
NULL,
"file-meta.db",
- NULL,
+ "file-meta",
NULL,
512,
TRACKER_DB_PAGE_SIZE_DEFAULT,
@@ -86,7 +86,7 @@
TRACKER_DB_LOCATION_DATA_DIR,
NULL,
"file-contents.db",
- NULL,
+ "file-contents",
NULL,
1024,
TRACKER_DB_PAGE_SIZE_DEFAULT,
@@ -95,7 +95,7 @@
TRACKER_DB_LOCATION_DATA_DIR,
NULL,
"email-meta.db",
- NULL,
+ "email-meta",
NULL,
512,
TRACKER_DB_PAGE_SIZE_DEFAULT,
@@ -104,7 +104,7 @@
TRACKER_DB_LOCATION_DATA_DIR,
NULL,
"email-contents.db",
- NULL,
+ "email-contents",
NULL,
512,
TRACKER_DB_PAGE_SIZE_DEFAULT,
@@ -113,7 +113,7 @@
TRACKER_DB_LOCATION_DATA_DIR,
NULL,
"xesam.db",
- NULL,
+ "xesam",
NULL,
512,
TRACKER_DB_PAGE_SIZE_DEFAULT,
@@ -132,6 +132,7 @@
static gchar *services_dir;
static gchar *sql_dir;
static gpointer db_type_enum_class_pointer;
+static TrackerDBInterface *attach_interface = NULL;
static const gchar *
location_to_directory (TrackerDBLocation location,
@@ -1539,11 +1540,22 @@
path,
db_type_to_string (type));
- iface = tracker_db_interface_sqlite_new (path);
- tracker_db_interface_set_procedure_table (iface, prepared_queries);
+ if (attach_all && attach_interface) {
+ iface = g_object_ref (attach_interface);
+ } else {
+ iface = tracker_db_interface_sqlite_new (path);
+ tracker_db_interface_set_procedure_table (iface, prepared_queries);
+
+ if (attach_all) {
+ attach_interface = g_object_ref (iface);
+ }
+
+ db_exec_no_reply (iface, "ANALYZE");
+ }
/* FIXME: Shouldn't we do this for common/cache dbs too? */
- if (type != TRACKER_DB_COMMON &&
+ if (!attach_all &&
+ type != TRACKER_DB_COMMON &&
type != TRACKER_DB_CACHE) {
db_set_params (iface,
dbs[type].cache_size,
@@ -1551,8 +1563,6 @@
dbs[type].add_functions);
}
- db_exec_no_reply (iface, "ANALYZE");
-
if (attach_all) {
g_message (" Attaching to current DB connection");
db_exec_no_reply (iface,
@@ -2083,6 +2093,10 @@
g_type_class_unref (db_type_enum_class_pointer);
db_type_enum_class_pointer = NULL;
+ if (attach_interface) {
+ g_object_unref (attach_interface);
+ }
+
initialized = FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]