Skip to content

Commit

Permalink
fix: [2.5]fix altercollectionfield interceptor dbname (milvus-io#38663)
Browse files Browse the repository at this point in the history
fix altercollectionfield interceptor dbname
issue: milvus-io#37436
master pr: milvus-io#38662

Signed-off-by: Xianhui.Lin <[email protected]>
  • Loading branch information
JsDove authored Dec 24, 2024
1 parent bb3d993 commit c51b458
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 c51b458

Please sign in to comment.