Skip to content

Commit

Permalink
fix: Load collection before delete by expr (#677)
Browse files Browse the repository at this point in the history
See also #674

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Mar 18, 2024
1 parent aa29152 commit d927718
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/testcases/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ func TestDeleteExpressions(t *testing.T) {
}

func TestDeleteInvalidExpr(t *testing.T) {
t.Skip("invalid error message like failed to create expr plan or collection not loaded")
t.Parallel()
ctx := createContext(t, time.Second*common.DefaultTimeout)
// connect
Expand Down Expand Up @@ -379,8 +378,14 @@ func TestDeleteInvalidExpr(t *testing.T) {
}
_, _ = insertData(ctx, t, mc, dp)

err := mc.Delete(ctx, collName, "", "")
common.CheckErr(t, err, false, "invalid expression: expected=valid expr, actual=empty expr: invalid parameter")
idx, _ := entity.NewIndexHNSW(entity.L2, 8, 96)
_ = mc.CreateIndex(ctx, collName, common.DefaultFloatVecFieldName, idx, false)

err := mc.LoadCollection(ctx, collName, false)
common.CheckErr(t, err, true, "")

err = mc.Delete(ctx, collName, "", "")
common.CheckErr(t, err, false, "invalid expression")

for _, _invalidExprs := range common.InvalidExpressions {
err := mc.Delete(ctx, collName, "", _invalidExprs.Expr)
Expand Down

0 comments on commit d927718

Please sign in to comment.