Skip to content

Commit

Permalink
fix(add gtags): correct tag count when tag name conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
hxy7yx committed Mar 8, 2024
1 parent c5a6b1f commit 092a8cb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/adapter/adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,12 +1287,17 @@ int neu_adapter_add_gtags(neu_adapter_t *adapter, neu_req_add_gtag_t *cmd,
cmd->groups[group_index].group,
cmd->groups[group_index].tags[added_tag_index].name);
}
for (int groups_count = 0; groups_count < cmd->n_group;
groups_count++) {

neu_adapter_driver_try_del_tag((neu_adapter_driver_t *) adapter,
cmd->groups[group_index].n_tag -
tag_index);

for (++group_index; group_index < cmd->n_group; group_index++) {
neu_adapter_driver_try_del_tag(
(neu_adapter_driver_t *) adapter,
cmd->groups[groups_count].n_tag);
cmd->groups[group_index].n_tag);
}

resp->index = 0;
resp->error = add_tag_result;
return add_tag_result;
Expand Down

0 comments on commit 092a8cb

Please sign in to comment.