Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Load collection before delete by expr #677

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading