From 6df30178576ad1324cd1c437175ad61d284efdbe Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Mon, 31 Jul 2023 21:16:25 +0800 Subject: [PATCH] :art: Update av --- kernel/model/attribute_view.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index f0fb30408..c0eeb642f 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -386,14 +386,13 @@ func setAttributeViewColumnCalc(operation *Operation) (err error) { } func (tx *Transaction) doInsertAttrViewBlock(operation *Operation) (ret *TxErr) { - firstSrcID := operation.SrcIDs[0] - tree, err := tx.loadTree(firstSrcID) - if nil != err { - logging.LogErrorf("load tree [%s] failed: %s", firstSrcID, err) - return &TxErr{code: TxErrCodeBlockNotFound, id: firstSrcID, msg: err.Error()} - } - for _, id := range operation.SrcIDs { + tree, err := tx.loadTree(id) + if nil != err { + logging.LogErrorf("load tree [%s] failed: %s", id, err) + return &TxErr{code: TxErrCodeBlockNotFound, id: id, msg: err.Error()} + } + var avErr error if avErr = addAttributeViewBlock(id, operation, tree, tx); nil != avErr { return &TxErr{code: TxErrWriteAttributeView, id: operation.AvID, msg: avErr.Error()}