• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / crud / 7784053629
88%

Build:
DEFAULT BRANCH: master
Ran 05 Feb 2024 12:12PM UTC
Jobs 1
Files 61
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Feb 2024 11:59AM UTC coverage: 88.645% (+0.04%) from 88.606%
7784053629

push

github

DifferentialOrange
scan: fix filter erroneous early exit

The issue described below is related to the read operations which
allows to scan: `crud.select`, `crud.pairs`, `crud.count`,
`readview:select` and `readview:pairs`.

The erroneous behavior reported by [1] and #418 is as follows:
- result changes when reordering operation conditions;
- when `>=` condition operation is changed to `=`, there are more rows
  in the result.

The reason is as follows. Scanning read operates with two entities:
an iterator and a filter. The iterator includes an index, a starting
value and iterator type (EQ, GT, etc.). The iterator is built from
conditions, if possible, otherwise primary index is used. Remaining
conditions form the filter, so the actual result satisfies all operation
conditions.

The filter supports early exit. Let's consider the following example.
For `crud.select(space, {{'>=', 'id', 1}, {'<=', 'id', 10}})`, where
`id` is an index (or an indexed field), the iterator uses index
`id`, starts from key = `1` and goes by GE rules, covering [1, +inf)
ordered keys. On the other hand, when iterator reaches the tuple
with `id` = `11`, all tuples after this one will never satisfy
the second condition, because our iterator yields tuples sorted by `id`
(due to underlying index). So filter tells than there is no reason
to scan anymore, and we finish the scanning procedure.

Before this patch, the function behind early exit decision had worked
as follows: "if the condition is an index, we go in forward (reverse)
order and `<=` or `<` (`>=` or `>`) condition is violated, there is no
reason to scan anymore". But the valid approach is "if the condition is
SCANNING index...". Before this patch, filter had assumed that if the
condition for index is specified, tuples are ordered, but it works only
if iterator uses the same index as in the condition. This patch fixes
the issue.

The erroneous behavior may happen in the following case:
- there are multiple conditions,
- there are at least tw... (continued)

4731 of 5337 relevant lines covered (88.65%)

6264.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 7784053629.1 05 Feb 2024 12:12PM UTC 61
88.65
GitHub Action Run
Source Files on build 7784053629
  • Tree
  • List 61
  • Changed 32
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 9af394e7 on github
  • Prev Build on master (#7530526980)
  • Next Build on master (#7784345136)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc