Skip to content
Snippets Groups Projects
Commit 17eb36d7 authored by Vladislav Shpilevoy's avatar Vladislav Shpilevoy Committed by Roman Tsisyk
Browse files

vinyl: fix error with return out of range stmts from read_iter

When the read iterator gets next range, it then calls
read_iterator_merge_next_key. But this function can call
read_iterator_restore, that causes also restore of the
range_iterator. This restore returns the previous range, and the
next statements are out of the range.
Example:

  curr_range
  curr_stmt      next_stmt
+-------------+--------------+
| -inf        x         +inf |
+-------------+--------------+

read_iterator_next_range

  curr_stmt      curr_range
                 next_stmt
+-------------+--------------+
| -inf        x         +inf |
+-------------+--------------+

read_iterator_merge_next_keys fails version checking and call
read_iterator_restore, which calls range_iterator_restore to the
curr_stmt. And then the merge_iterator returns the next_stmt, which
is out of the curr_range.

  curr_range     curr_stmt
+-------------+--------------+
| -inf        x         +inf |
+-------------+--------------+
parent 06099023
No related branches found
No related tags found
No related merge requests found
Loading
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