8000 Bugfix/modify document coordinator (#3266) · MohammedDeveloper/arangodb@111c826 · GitHub
[go: up one dir, main page]

Skip to content

Commit 111c826

Browse files
authored
Bugfix/modify document coordinator (arangodb#3266)
* Fixed ModifyDocument on coordinator. It uses the internally optimized function to extract _key values, which fails on Compact objects * do not crash server when passing invalid document key type
1 parent f0ae3d3 commit 111c826

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arangod/Cluster/ClusterMethods.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,9 +2164,12 @@ int modifyDocumentOnCoordinator(
21642164
TRI_ASSERT(it.second.size() == 1);
21652165
body = std::make_shared<std::string>(slice.toJson());
21662166

2167-
TRI_ASSERT(slice.get(StaticStrings::KeyString).isString());
2167+
auto keySlice = slice.get(StaticStrings::KeyString);
2168+
if (!keySlice.isString()) {
2169+
return TRI_ERROR_ARANGO_DOCUMENT_KEY_BAD;
2170+
}
21682171

2169-
StringRef keyStr(slice.get(StaticStrings::KeyString));
2172+
StringRef keyStr(keySlice);
21702173
// We send to single endpoint
21712174
requests.emplace_back(
21722175
"shard:" + it.first, reqType,

0 commit comments

Comments
 (0)
0