Commit cd731b48 authored by Martin Kampas's avatar Martin Kampas Committed by Carlos Garnacho

miner-fs: Fix tracking file move

Identified by MinerCrawlTest::test_07_move_from_monitored_to_monitored
(300-miner-basic-ops.py)

In item_move() it fails to get source_iri, does not check it's validity and
uses it in the DELETE expression of the SPARQL query constructed there.

Broken since d836f002 (libtracker-miner: Store iri transiently as GFile
qdata) - tracker_file_notifier_get_file_iri() is added 'force' argument
and (wrapped with lookup_file_urn) passed force=FALSE from item_move().
This call then fails for regular files because only directories are
cached once crawling has completed as stated in the comment in
finish_current_directory() in libtracker-miner/tracker-file-notifier.c.

https://bugzilla.gnome.org/show_bug.cgi?id=678986
parent 3808c423
......@@ -1877,7 +1877,7 @@ item_move (TrackerMinerFS *fs,
NULL, NULL);
/* Get 'source' ID */
source_iri = lookup_file_urn (fs, source_file, FALSE);
source_iri = lookup_file_urn (fs, source_file, TRUE);
source_exists = (source_iri != NULL);
if (!file_info) {
......
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