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

[Bug]: Delete with invalid expr gets error: collection not loaded #674

Closed
1 task done
ThreadDao opened this issue Mar 18, 2024 · 1 comment
Closed
1 task done
Assignees

Comments

@ThreadDao
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

  • image: master-20240313-1d962391-amd64
    Delete with invalid expr, like `` or id in [0] (there is no id field), return error: collection not loaded. It's not make scene
  • case TestDeleteInvalidExpr in delete_test.go file:
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
	mc := createMilvusClient(ctx, t)

	// create collection
	cp := CollectionParams{
		CollectionFieldsType: Int64FloatVecJSON,
		AutoID:               false,
		EnableDynamicField:   true,
		ShardsNum:            common.DefaultShards,
		Dim:                  common.DefaultDim,
	}
	collName := createCollection(ctx, t, mc, cp)

	// insert
	dp := DataParams{
		CollectionName:       collName,
		PartitionName:        "",
		CollectionFieldsType: Int64FloatVecJSON,
		start:                0,
		nb:                   common.DefaultNb,
		dim:                  common.DefaultDim,
		EnableDynamicField:   true,
	}
	_, _ = 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")

	for _, _invalidExprs := range common.InvalidExpressions {
		err := mc.Delete(ctx, collName, "", _invalidExprs.Expr)
		common.CheckErr(t, err, _invalidExprs.ErrNil, _invalidExprs.ErrMsg)
	}
}
2024/03/18 14:41:32 milvus_client.go:14: (ApiRequest): func [Delete], args: [context.Background.WithDeadline(2024-03-18 14:43:32.603857489 +0800 CST m=+120.004630793 [1m59.64800912s]) XQwJ  ]
2024/03/18 14:41:32 milvus_client.go:19: (ApiResponse): func [Delete], error: collection not loaded[collection=448345475624960899]

Expected Behavior

No response

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

congqixia added a commit to congqixia/milvus-sdk-go that referenced this issue Mar 18, 2024
congqixia added a commit to congqixia/milvus-sdk-go that referenced this issue Mar 18, 2024
@congqixia
Copy link
Contributor

Collection shall be loaded by before delete by expr, #677 updates the testcase
/assign @ThreadDao

sre-ci-robot pushed a commit that referenced this issue Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants