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'})
Showing
- changelogs/unreleased/gh-7129-improve-check-for-dangerous-select-calls.md 6 additions, 0 deletions...eased/gh-7129-improve-check-for-dangerous-select-calls.md
- src/box/lua/schema.lua 24 additions, 14 deletionssrc/box/lua/schema.lua
- src/lua/log.lua 23 additions, 2 deletionssrc/lua/log.lua
- test/box-luatest/gh_6539_log_user_space_empty_or_nil_select_test.lua 66 additions, 15 deletions...atest/gh_6539_log_user_space_empty_or_nil_select_test.lua
Loading