Skip to content
Snippets Groups Projects
Commit 29654ffe authored by Georgiy Lebedev's avatar Georgiy Lebedev Committed by Vladimir Davydov
Browse files

box: improve check for dangerous `select` calls

Consider the following case a safe `select` call (i.e., do not issue a
warning):
* offset + limit <= 1000 (default value of offset is 0, default value of
limit is 4294967295);

Add new dangerous `select` call case:
* 'ALL', 'GE', 'GT', 'LE', 'LT' iterator even with key present.

Because of the additional logic, it was decided to refactor
`check_select_args` and call it after resolving options in
`check_select_opts`.

Closes #7129

@TarantoolBot document
Title: improve check for dangerous `select` calls

Calls with `offset + limit <= 100`
are now considered safe (i.e., a warning is not issued), e.g.:
box.space.s:select(nil, {offset = 1000})
box.space.s:select(nil, {limit = 1000})
box.space.s:select(nil, {offset = 500, limit = 500})

'ALL', 'GE', 'GT', 'LE', 'LT' iterators are now considered dangerous by
default even with key present, e.g.:
box.space.s:select({0})
box.space.s:select({0}, {iterator = 'GE'})

But not that these calls are still safe:
box.space.s:select({0}, {limit = 1000})
box.space.s:select({0}, {limit = 1000, iterator = 'GE'})
box.space.s:select({0}, {iterator = 'EQ'})
parent d56840d7
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