GNOME Bugzilla – Bug 721880
fts:offsets returns wrong values
Last modified: 2014-01-21 11:43:56 UTC
While investigating the FTS functional-tests failures, I discovered that since the fts4 branch was merged fts:offsets has been broken. See patch for details. This fix requires that we record the 'fulltext-indexed' property in the GVDB ontology cache; it would be nice if there was a way to force this to be recreated on existing installations, but since fts:offset is broken either way I'm not sure if it matters.
Created attachment 265865 [details] [review] Fix fts:offsets() Since the fts4 branch was merged, the fts:offsets() function has been broken, because it assumed that properties were stored in the 'fts' table in ID order but this was no longer the case. The property names list is now created on init as static data, but this requires having the 'fulltext_indexed' property available in all cases where previously it has only been available if the ontologies were loaded directly rather than from the GVDB cache. tests/functional-tests/03-fts-functions.py has been improved to test the fts:offsets() function more thoroughly.
Comment on attachment 265865 [details] [review] Fix fts:offsets() Ugh, very nice catch Sam. I remember that relying on that sort of implicit ordering felt quite weak at the time, this looks indeed nicer. Just one nitpick: + ptr = property_names = g_new0(gchar *, g_list_length (columns)); + while (columns) { + *ptr = g_strdup(columns->data); Missing spaces after g_new0 and g_strdup
Review of attachment 265865 [details] [review]: Committed with those two fixups, thanks!