Skip to content

Commit

Permalink
delete: add the nil check for primary index parts
Browse files Browse the repository at this point in the history
Implemented the `nil` check for primary index parts
fetching when `opts.bucket_id`  is not set.
  • Loading branch information
GRISHNOV committed Jun 3, 2023
1 parent 781ef16 commit 7f97ac6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crud/delete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ local function call_delete_on_router(vshard_router, space_name, key, opts)

local sharding_key = key
if opts.bucket_id == nil then
if space.index[0] == nil then
return nil, DeleteError:new("Cannot fetch primary index parts"), const.NEED_SCHEMA_RELOAD
end
local primary_index_parts = space.index[0].parts

local sharding_key_data, err = sharding_metadata_module.fetch_sharding_key_on_router(vshard_router, space_name)
Expand Down

0 comments on commit 7f97ac6

Please sign in to comment.