Commit 863a4da8 authored by Sam Thursfield's avatar Sam Thursfield
Browse files

Merge branch 'wip/carlosg/fts-consistence-fixes' into 'master'

libtracker-sparql: Fix handling of partial FTS deletion

Closes #361

See merge request !510
parents 399ca329 460e694d
Pipeline #396176 passed with stages
in 8 minutes and 17 seconds
......@@ -30,7 +30,7 @@
* at runtime, the former must be rebuilt for those to match perfectly
* to avoid returning meaningless results on FTS searches.
*/
#define TRACKER_PARSER_VERSION 3
#define TRACKER_PARSER_VERSION 4
G_BEGIN_DECLS
......
......@@ -1694,6 +1694,7 @@ get_old_property_values (TrackerData *data,
g_ptr_array_unref (fts_text);
old_values = g_hash_table_lookup (data->resource_buffer->predicates, property);
data->resource_buffer->fts_updated = TRUE;
} else {
old_values = get_property_values (data, property, error);
}
......@@ -2443,6 +2444,8 @@ delete_single_valued (TrackerData *data,
FALSE);
if (tracker_property_get_data_type (predicate) == TRACKER_PROPERTY_TYPE_RESOURCE)
tracker_data_resource_unref (data, g_value_get_int64 (value), multiple_values);
g_array_remove_index (old_values, 0);
} else {
/* no need to error out if statement does not exist for any reason */
g_clear_error (&inner_error);
......
SELECT ?u { ?u fts:match 'two' }
SELECT ?u { ?u fts:match 'one' }
INSERT OR REPLACE {
test:1 a test:A ; test:p "one" .
};
INSERT OR REPLACE {
test:1 a test:A ; test:p "two" .
};
SELECT ?u { ?u fts:match "two" }
"http://www.example.org/test#1"
select ?u { ?u fts:match 'three' }
INSERT DATA {
test:1 a test:A ; test:p "one" ; test:q "two" .
};
DELETE DATA {
test:1 test:q "two" .
}
INSERT DATA {
test:1 test:q "three" .
};
......@@ -35,6 +35,8 @@ struct _TestInfo {
const TestInfo tests[] = {
{ "fts3aa", 3 },
{ "fts3ae", 1 },
{ "consistency/partial-update", 2 },
{ "consistency/insert-or-replace", 2 },
{ "prefix/fts3prefix", 3 },
{ "limits/fts3limits", 4 },
{ "input/fts3input", 3 },
......
Supports Markdown
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