tracker r1737 - in branches/indexer-split: . src/libtracker-db
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1737 - in branches/indexer-split: . src/libtracker-db
- Date: Mon, 23 Jun 2008 12:02:31 +0000 (UTC)
Author: pvanhoof
Date: Mon Jun 23 12:02:31 2008
New Revision: 1737
URL: http://svn.gnome.org/viewvc/tracker?rev=1737&view=rev
Log:
2008-06-23 Philip Van Hoof <pvanhoof gnome org>
* src/libtracker-db/tracker-db-manager.c: Also setting DB parameters
in case of attach_all=true. Fixes load_sql_file for sqlite-services.sql
for file-meta.db and email-meta.db (UTF8 collate function was not set)
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 Mon Jun 23 12:02:31 2008
@@ -1392,7 +1392,8 @@
db_set_params (TrackerDBInterface *iface,
gint cache_size,
gint page_size,
- gboolean add_functions)
+ gboolean add_functions,
+ gboolean created)
{
tracker_db_interface_execute_query (iface, NULL, "PRAGMA synchronous = NORMAL;");
tracker_db_interface_execute_query (iface, NULL, "PRAGMA count_changes = 0;");
@@ -1417,27 +1418,29 @@
g_critical ("Collation sequence failed");
}
- /* Create user defined functions that can be used in sql */
- tracker_db_interface_sqlite_create_function (iface,
- "FormatDate",
- function_date_to_str,
- 1);
- tracker_db_interface_sqlite_create_function (iface,
- "GetServiceName",
- function_get_service_name,
- 1);
- tracker_db_interface_sqlite_create_function (iface,
- "GetServiceTypeID",
- function_get_service_type,
- 1);
- tracker_db_interface_sqlite_create_function (iface,
- "GetMaxServiceTypeID",
- function_get_max_service_type,
- 1);
- tracker_db_interface_sqlite_create_function (iface,
- "REGEXP",
- function_regexp,
- 2);
+ if (created) {
+ /* Create user defined functions that can be used in sql */
+ tracker_db_interface_sqlite_create_function (iface,
+ "FormatDate",
+ function_date_to_str,
+ 1);
+ tracker_db_interface_sqlite_create_function (iface,
+ "GetServiceName",
+ function_get_service_name,
+ 1);
+ tracker_db_interface_sqlite_create_function (iface,
+ "GetServiceTypeID",
+ function_get_service_type,
+ 1);
+ tracker_db_interface_sqlite_create_function (iface,
+ "GetMaxServiceTypeID",
+ function_get_max_service_type,
+ 1);
+ tracker_db_interface_sqlite_create_function (iface,
+ "REGEXP",
+ function_regexp,
+ 2);
+ }
}
}
@@ -1694,17 +1697,14 @@
iface = tracker_db_interface_sqlite_new (path);
tracker_db_interface_set_procedure_table (iface,
prepared_queries);
-
- /* FIXME: Shouldn't we do this for common/cache dbs too? */
- if (type != TRACKER_DB_COMMON &&
- type != TRACKER_DB_CACHE) {
- db_set_params (iface,
- dbs[type].cache_size,
- dbs[type].page_size,
- dbs[type].add_functions);
- }
}
+ db_set_params (iface,
+ dbs[type].cache_size,
+ dbs[type].page_size,
+ dbs[type].add_functions,
+ *create);
+
return iface;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]