1
0
Fork 0

don't update if there's nothing to do

This commit is contained in:
Jan Steemann 2016-07-06 07:38:44 +02:00
parent f9bafa4b14
commit 7455ef20ef
1 changed files with 15 additions and 14 deletions

View File

@ -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;
} }