mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
Fix a crash bug of bulkinsert for dynamic field (#25982)
Signed-off-by: yhmo <yihua.mo@zilliz.com>
This commit is contained in:
parent
eaf53c7b39
commit
c2693ea284
@ -445,11 +445,12 @@ func fillDynamicData(blockData BlockData, collectionSchema *schemapb.CollectionS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if dynamicData.RowNum() == 0 {
|
if dynamicData.RowNum() < rowCount {
|
||||||
// fill the dynamic data by row count
|
// fill the dynamic data by an empty JSON object, make sure the row count is eaual to other fields
|
||||||
data := dynamicData.(*storage.JSONFieldData)
|
data := dynamicData.(*storage.JSONFieldData)
|
||||||
bs := []byte("{}")
|
bs := []byte("{}")
|
||||||
for i := 0; i < rowCount; i++ {
|
dynamicRowCount := dynamicData.RowNum()
|
||||||
|
for i := 0; i < rowCount-dynamicRowCount; i++ {
|
||||||
data.Data = append(data.Data, bs)
|
data.Data = append(data.Data, bs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user