Skip to content

Commit

Permalink
fix: fix altercollectionfield interceptor dbname (#38662)
Browse files Browse the repository at this point in the history
fix altercollectionfield interceptor dbname 
issue: #37436

Signed-off-by: Xianhui.Lin <[email protected]>
  • Loading branch information
JsDove authored Dec 23, 2024
1 parent 82d85e8 commit d718bbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/proxy/database_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ func fillDatabase(ctx context.Context, req interface{}) (context.Context, interf
r.DbName = GetCurDBNameFromContextOrDefault(ctx)
}
return ctx, r
case *milvuspb.AlterCollectionFieldRequest:
if r.DbName == "" {
r.DbName = GetCurDBNameFromContextOrDefault(ctx)
}
return ctx, r
case *milvuspb.CreatePartitionRequest:
if r.DbName == "" {
r.DbName = GetCurDBNameFromContextOrDefault(ctx)
Expand Down
1 change: 1 addition & 0 deletions internal/proxy/database_interceptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func TestDatabaseInterceptor(t *testing.T) {
&milvuspb.GetCollectionStatisticsRequest{},
&milvuspb.ShowCollectionsRequest{},
&milvuspb.AlterCollectionRequest{},
&milvuspb.AlterCollectionFieldRequest{},
&milvuspb.CreatePartitionRequest{},
&milvuspb.DropPartitionRequest{},
&milvuspb.HasPartitionRequest{},
Expand Down

0 comments on commit d718bbb

Please sign in to comment.