tracker r1384 - in branches/indexer-split: . src/libtracker-db src/trackerd
- From: pvanhoof svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1384 - in branches/indexer-split: . src/libtracker-db src/trackerd
- Date: Fri, 9 May 2008 10:08:32 +0100 (BST)
Author: pvanhoof
Date: Fri May 9 09:08:32 2008
New Revision: 1384
URL: http://svn.gnome.org/viewvc/tracker?rev=1384&view=rev
Log:
2008-05-09 Philip Van Hoof <pvanhoof gnome org>
* src/trackerd/tracker-db-sqlite.c:
* src/libtracker-db/tracker-db-interface.h:
* src/libtracker-db/tracker-db-interface-sqlite.c:
* src/libtracker-db/tracker-db-interface.c: Improvement for queries
that have no reply
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c
branches/indexer-split/src/libtracker-db/tracker-db-interface.c
branches/indexer-split/src/libtracker-db/tracker-db-interface.h
branches/indexer-split/src/trackerd/tracker-db-sqlite.c
Modified: branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c Fri May 9 09:08:32 2008
@@ -732,6 +732,27 @@
}
static void
+tracker_db_interface_sqlite_execute_query_no_reply (TrackerDBInterface *db_interface,
+ GError **error,
+ const gchar *query)
+{
+ TrackerDBInterfaceSqlitePrivate *priv;
+ TrackerDBQueryTask *task;
+
+ priv = TRACKER_DB_INTERFACE_SQLITE_GET_PRIVATE (db_interface);
+
+ task = create_db_query_task (db_interface,
+ query,
+ QUERY,
+ NULL,
+ error);
+
+ task->nowait = TRUE;
+
+ g_thread_pool_push (priv->pool, task, NULL);
+}
+
+static void
tracker_db_interface_sqlite_iface_init (TrackerDBInterfaceIface *iface)
{
iface->set_procedure_table = tracker_db_interface_sqlite_set_procedure_table;
@@ -739,6 +760,7 @@
iface->execute_procedure_no_reply = tracker_db_interface_sqlite_execute_procedure_no_reply;
iface->execute_procedure_len = tracker_db_interface_sqlite_execute_procedure_len;
iface->execute_query = tracker_db_interface_sqlite_execute_query;
+ iface->execute_query_no_reply = tracker_db_interface_sqlite_execute_query_no_reply;
}
TrackerDBInterface *
Modified: branches/indexer-split/src/libtracker-db/tracker-db-interface.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-interface.c (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-interface.c Fri May 9 09:08:32 2008
@@ -254,6 +254,29 @@
return ensure_result_set_state (result_set);
}
+
+void
+tracker_db_interface_execute_vquery_no_reply (TrackerDBInterface *interface,
+ GError **error,
+ const gchar *query,
+ va_list args)
+{
+ gchar *str;
+
+ g_return_if_fail (TRACKER_IS_DB_INTERFACE (interface));
+ g_return_if_fail (query != NULL);
+
+ if (!TRACKER_DB_INTERFACE_GET_IFACE (interface)->execute_query_no_reply) {
+ g_critical ("Database abstraction %s doesn't implement the method execute_vquery()", G_OBJECT_TYPE_NAME (interface));
+ return;
+ }
+
+ str = g_strdup_vprintf (query, args);
+ TRACKER_DB_INTERFACE_GET_IFACE (interface)->execute_query_no_reply (interface, error, str);
+ g_free (str);
+}
+
+
TrackerDBResultSet *
tracker_db_interface_execute_query (TrackerDBInterface *interface,
GError **error,
Modified: branches/indexer-split/src/libtracker-db/tracker-db-interface.h
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-interface.h (original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-interface.h Fri May 9 09:08:32 2008
@@ -71,6 +71,10 @@
TrackerDBResultSet * (* execute_query) (TrackerDBInterface *interface,
GError **error,
const gchar *query);
+ void (* execute_query_no_reply)(TrackerDBInterface *interface,
+ GError **error,
+ const gchar *query);
+
};
struct TrackerDBResultSet {
@@ -94,6 +98,11 @@
GError **error,
const gchar *query,
va_list args);
+void tracker_db_interface_execute_vquery_no_reply
+ (TrackerDBInterface *interface,
+ GError **error,
+ const gchar *query,
+ va_list args);
TrackerDBResultSet * tracker_db_interface_execute_query (TrackerDBInterface *interface,
GError **error,
const gchar *query,
Modified: branches/indexer-split/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db-sqlite.c (original)
+++ branches/indexer-split/src/trackerd/tracker-db-sqlite.c Fri May 9 09:08:32 2008
@@ -1164,22 +1164,14 @@
gboolean
tracker_db_exec_no_reply (DBConnection *db_con, const char *query, ...)
{
- TrackerDBResultSet *result_set;
va_list args;
tracker_nfs_lock_obtain ();
va_start (args, query);
- result_set = tracker_db_interface_execute_vquery (db_con->db, NULL, query, args);
+ tracker_db_interface_execute_vquery_no_reply (db_con->db, NULL, query, args);
va_end (args);
- /* This function is meant for queries that don't return any result set,
- * if it's passed some query that returns a result set, just discard it.
- */
- if (G_UNLIKELY (result_set)) {
- g_object_unref (result_set);
- }
-
tracker_nfs_lock_release ();
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]