diff --git a/crud/borders.lua b/crud/borders.lua index 1a54f9005..6c8a5187d 100644 --- a/crud/borders.lua +++ b/crud/borders.lua @@ -16,8 +16,8 @@ local borders = {} local STAT_FUNC_NAME = '_crud.get_border_on_storage' -local function get_border_on_storage(border_name, space_name, index_id, field_names) - dev_checks('string', 'string', 'number', '?table') +local function get_border_on_storage(border_name, space_name, index_name, field_names) + dev_checks('string', 'string', 'string|number', '?table') assert(border_name == 'min' or border_name == 'max') @@ -26,9 +26,9 @@ local function get_border_on_storage(border_name, space_name, index_id, field_na return nil, BorderError:new("Space %q doesn't exist", space_name) end - local index = space.index[index_id] + local index = space.index[index_name] if index == nil then - return nil, BorderError:new("Index %q of space doesn't exist", index_id, space_name) + return nil, BorderError:new("Index %q of space doesn't exist", index_name, space_name) end local function get_index_border(index) @@ -164,7 +164,7 @@ end -- A space name -- -- @param ?string index_name --- An index name (by default, primary index is used) +-- An index name as well as numerical id (by default, primary index is used) -- -- @tparam ?number opts.timeout -- Function call timeout @@ -175,8 +175,8 @@ end -- @return[1] result -- @treturn[2] nil -- @treturn[2] table Error description -function borders.min(space_name, index_id, opts) - return get_border('min', space_name, index_id, opts) +function borders.min(space_name, index_name, opts) + return get_border('min', space_name, index_name, opts) end --- Find the maximum value in the specified index @@ -187,7 +187,7 @@ end -- A space name -- -- @param ?string index_name --- An index name (by default, primary index is used) +-- An index name as well as numerical id (by default, primary index is used) -- -- @tparam ?number opts.timeout -- Function call timeout @@ -198,8 +198,8 @@ end -- @return[1] result -- @treturn[2] nil -- @treturn[2] table Error description -function borders.max(space_name, index_id, opts) - return get_border('max', space_name, index_id, opts) +function borders.max(space_name, index_name, opts) + return get_border('max', space_name, index_name, opts) end return borders diff --git a/crud/select.lua b/crud/select.lua index 41964e1fe..093901468 100644 --- a/crud/select.lua +++ b/crud/select.lua @@ -35,8 +35,8 @@ function checkers.vshard_call_mode(p) return p == 'write' or p == 'read' end -local function select_on_storage(space_name, index_id, conditions, opts) - dev_checks('string', 'number', '?table', { +local function select_on_storage(space_name, index_name, conditions, opts) + dev_checks('string', 'string|number', '?table', { scan_value = 'table', after_tuple = '?table', tarantool_iter = 'number', @@ -50,9 +50,9 @@ local function select_on_storage(space_name, index_id, conditions, opts) return nil, SelectError:new("Space %q doesn't exist", space_name) end - local index = space.index[index_id] + local index = space.index[index_name] if index == nil then - return nil, SelectError:new("Index with ID %s doesn't exist", index_id) + return nil, SelectError:new("Index with ID %s doesn't exist", index_name) end local filter_func, err = select_filters.gen_func(space, conditions, {