Server crashed when search using java-sdk (#3994)

Signed-off-by: fishpenguin <kun.yu@zilliz.com>
This commit is contained in:
yukun 2020-10-15 16:11:30 +08:00 committed by GitHub
parent 42470b86b3
commit 9d06bf3dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,7 @@ Please mark all changes in change log and use the issue from GitHub
- \#3946 The result format is wrong returned by 'get collections'
- \#3962 The 'num' in return of search is incorrect when use http-api
- \#3976 Web_impl restful doc bugs
- \#3990 Server crashed when search using java-sdk
## Feature
- \#2319 Redo metadata to support MVCC

View File

@ -81,6 +81,11 @@ SearchReq::OnExecute() {
// check dim
int64_t dimension = field->GetParams()[engine::PARAM_DIMENSION];
auto vector_query = query_ptr_->vectors.begin()->second;
if (vector_query->field_name != field->GetName()) {
return Status(SERVER_INVALID_ARGUMENT,
"DSL vector query field name: " + vector_query->field_name + " is wrong");
}
if (!vector_query->query_vector.binary_data.empty()) {
if (vector_query->query_vector.binary_data.size() !=
vector_query->query_vector.vector_count * dimension / 8) {