Commit 9243079d authored by Sam Thursfield's avatar Sam Thursfield

Merge branch 'wip/carlosg/unbreak-writeback' into 'master'

Unbreak writeback

Closes tracker-miners#55

See merge request !96
parents 067ccc63 28f136c4
Pipeline #87916 passed with stage
in 2 minutes and 7 seconds
......@@ -98,17 +98,24 @@ tracker_triples_vtab_free (gpointer data)
}
static void
tracker_triples_cursor_free (gpointer data)
tracker_triples_cursor_reset (TrackerTriplesCursor *cursor)
{
TrackerTriplesCursor *cursor = data;
if (cursor->stmt)
sqlite3_finalize (cursor->stmt);
g_clear_pointer (&cursor->stmt, sqlite3_finalize);
g_clear_pointer (&cursor->match.graph, sqlite3_value_free);
g_clear_pointer (&cursor->match.subject, sqlite3_value_free);
g_clear_pointer (&cursor->match.predicate, sqlite3_value_free);
g_list_free (cursor->properties);
g_clear_pointer (&cursor->properties, g_list_free);
cursor->match.idxFlags = 0;
cursor->rowid = 0;
cursor->finished = FALSE;
}
static void
tracker_triples_cursor_free (gpointer data)
{
TrackerTriplesCursor *cursor = data;
tracker_triples_cursor_reset (cursor);
g_free (cursor);
}
......@@ -414,6 +421,8 @@ triples_filter (sqlite3_vtab_cursor *vtab_cursor,
TrackerTriplesCursor *cursor = (TrackerTriplesCursor *) vtab_cursor;
int rc;
tracker_triples_cursor_reset (cursor);
if (idx & IDX_COL_GRAPH) {
int idx = idx_str[COL_GRAPH];
cursor->match.graph = sqlite3_value_dup (argv[idx]);
......@@ -435,7 +444,10 @@ triples_filter (sqlite3_vtab_cursor *vtab_cursor,
rc = init_stmt (cursor);
if (rc == SQLITE_ROW)
if (rc == SQLITE_DONE)
cursor->finished = TRUE;
if (rc == SQLITE_ROW || rc == SQLITE_DONE)
return SQLITE_OK;
return rc;
......
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