mirror of https://gitee.com/bigwinds/arangodb
don't update if there's nothing to do
This commit is contained in:
parent
f9bafa4b14
commit
7455ef20ef
|
@ -750,6 +750,7 @@ AqlItemBlock* UpsertBlock::work(std::vector<AqlItemBlock*>& blocks) {
|
||||||
AqlValue const& updateDoc = res->getValueReference(i, updateRegisterId);
|
AqlValue const& updateDoc = res->getValueReference(i, updateRegisterId);
|
||||||
|
|
||||||
if (updateDoc.isObject()) {
|
if (updateDoc.isObject()) {
|
||||||
|
if (updateDoc.length() > 0) {
|
||||||
VPackSlice toUpdate = updateDoc.slice();
|
VPackSlice toUpdate = updateDoc.slice();
|
||||||
|
|
||||||
keyBuilder.clear();
|
keyBuilder.clear();
|
||||||
|
@ -763,7 +764,7 @@ AqlItemBlock* UpsertBlock::work(std::vector<AqlItemBlock*>& blocks) {
|
||||||
} else {
|
} else {
|
||||||
updateBuilder = VPackCollection::merge(toUpdate, keyBuilder.slice(), false, false);
|
updateBuilder = VPackCollection::merge(toUpdate, keyBuilder.slice(), false, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
errorCode = TRI_ERROR_ARANGO_DOCUMENT_TYPE_INVALID;
|
errorCode = TRI_ERROR_ARANGO_DOCUMENT_TYPE_INVALID;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue