Skip to content

Commit 56348ca

Browse files
GRISHNOVDifferentialOrange
authored andcommitted
delete: add the nil check for primary index parts
Implemented the `nil` check for primary index parts fetching when `opts.bucket_id` is not set.
1 parent 781ef16 commit 56348ca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crud/delete.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ local function call_delete_on_router(vshard_router, space_name, key, opts)
8282

8383
local sharding_key = key
8484
if opts.bucket_id == nil then
85+
if space.index[0] == nil then
86+
return nil, DeleteError:new("Cannot fetch primary index parts"), const.NEED_SCHEMA_RELOAD
87+
end
8588
local primary_index_parts = space.index[0].parts
8689

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

0 commit comments

Comments
 (0)