Commit 9a79911c authored by Martyn James Russell's avatar Martyn James Russell

Make sure we check the priv->readonly property before trying to add or

	* src/libtracker-db/tracker-db-index.c:
	(tracker_db_index_get_word_hits), (tracker_db_index_add_word),
	(tracker_db_index_remove_dud_hits): Make sure we check the
	priv->readonly property before trying to add or remove words from
	the QDBM index. As you may see from now on, this indicates that
	the only time we remove duds and words from the index is when the
	trackerd process finds them and it *ONLY* opens the index as
	readonly. We need to fix this removing dud issue ASAP - bring on
	FTS support!

svn path=/trunk/; revision=3017
parent 2aad5f43
2009-03-04 Martyn Russell <martyn@imendio.com>
* src/libtracker-db/tracker-db-index.c:
(tracker_db_index_get_word_hits), (tracker_db_index_add_word),
(tracker_db_index_remove_dud_hits): Make sure we check the
priv->readonly property before trying to add or remove words from
the QDBM index. As you may see from now on, this indicates that
the only time we remove duds and words from the index is when the
trackerd process finds them and it *ONLY* opens the index as
readonly. We need to fix this removing dud issue ASAP - bring on
FTS support!
2009-03-04 Martyn Russell <martyn@imendio.com>
* src/trackerd/tracker-monitor.c: Now we cache DELETE events. This
......
......@@ -1151,7 +1151,6 @@ tracker_db_index_get_word_hits (TrackerDBIndex *indez,
return NULL;
}
details = NULL;
if (count) {
......@@ -1159,7 +1158,7 @@ tracker_db_index_get_word_hits (TrackerDBIndex *indez,
}
if ((tmp = dpget (priv->index, word, -1, 0, MAX_HIT_BUFFER, &tsiz)) != NULL) {
if (tsiz >= (gint) sizeof (TrackerDBIndexItem)) {
if (tsiz >= sizeof (TrackerDBIndexItem)) {
details = (TrackerDBIndexItem *) tmp;
if (count) {
......@@ -1168,7 +1167,6 @@ tracker_db_index_get_word_hits (TrackerDBIndex *indez,
}
}
return details;
}
......@@ -1190,6 +1188,8 @@ tracker_db_index_add_word (TrackerDBIndex *indez,
priv = TRACKER_DB_INDEX_GET_PRIVATE (indez);
g_return_if_fail (priv->readonly == FALSE);
if (G_UNLIKELY (!priv->cur_cache)) {
priv->cur_cache = index_cache_new ();
}
......@@ -1273,9 +1273,9 @@ tracker_db_index_remove_dud_hits (TrackerDBIndex *indez,
gint tsiz;
gboolean retval = FALSE;
g_return_val_if_fail (indez, FALSE);
g_return_val_if_fail (word, FALSE);
g_return_val_if_fail (dud_list, FALSE);
g_return_val_if_fail (indez != NULL, FALSE);
g_return_val_if_fail (word != NULL, FALSE);
g_return_val_if_fail (dud_list != NULL, FALSE);
if (!check_index_is_up_to_date (indez)) {
return TRUE;
......@@ -1283,8 +1283,8 @@ tracker_db_index_remove_dud_hits (TrackerDBIndex *indez,
priv = TRACKER_DB_INDEX_GET_PRIVATE (indez);
g_return_val_if_fail (priv->index, FALSE);
g_return_val_if_fail (priv->readonly == FALSE, FALSE);
g_return_val_if_fail (priv->index != NULL, FALSE);
/* Check if existing record is there */
tmp = dpget (priv->index,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment