Skip to content
Snippets Groups Projects
Commit 48950020 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Vladimir Davydov
Browse files

index: add space_read_view pointer to index_read_view

This will let us access space read view format (added later) from
the code that uses an index read view.

Needed for https://github.com/tarantool/tarantool-ee/issues/207

NO_DOC=internal
NO_TEST=ee
NO_CHANGELOG=internal
parent f4f1659d
No related branches found
No related tags found
No related merge requests found
......@@ -612,6 +612,7 @@ index_read_view_create(struct index_read_view *rv,
rv->def = index_def_dup(def);
if (rv->def == NULL)
return -1;
rv->space = NULL;
return 0;
}
......
......@@ -44,6 +44,7 @@ extern "C" {
struct tuple;
struct engine;
struct space;
struct space_read_view;
struct index;
struct index_read_view;
struct index_read_view_iterator;
......@@ -586,6 +587,8 @@ struct index_read_view {
const struct index_read_view_vtab *vtab;
/** Copy of the index definition. */
struct index_def *def;
/** Pointer to the space read view that owns this index. */
struct space_read_view *space;
};
/** Iterator over an index read view. */
......
......@@ -49,8 +49,10 @@ space_read_view_delete(struct space_read_view *space_rv)
{
for (uint32_t i = 0; i <= space_rv->index_id_max; i++) {
struct index_read_view *index_rv = space_rv->index_map[i];
if (index_rv != NULL)
if (index_rv != NULL) {
assert(index_rv->space == space_rv);
index_read_view_delete(index_rv);
}
}
TRASH(space_rv);
free(space_rv);
......@@ -84,6 +86,7 @@ space_read_view_new(struct space *space, const struct read_view_opts *opts)
space_rv->index_map[i] = index_create_read_view(index);
if (space_rv->index_map[i] == NULL)
goto fail;
space_rv->index_map[i]->space = space_rv;
}
return space_rv;
fail:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment