10BC0 Bug fix/begin trx disjoint (#14641) · arangodb/arangodb@94aba32 · GitHub
[go: up one dir, main page]

Skip to content

Commit 94aba32

Browse files
authored
Bug fix/begin trx disjoint (#14641)
1 parent a33e95c commit 94aba32

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
devel
22
-----
33

4+
* Fixed: _api/transaction/begin called on edge collections of disjoint
5+
SmartGraphs falsely returned CollectionNotFound errors.
6+
47
* Bug-Fix: In more complex queries there was a code-path where a (Disjoint-) Smart
58
graph access was not properly optimized.
69

arangod/Transaction/Manager.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -494,15 +494,17 @@ Result Manager::lockCollections(TRI_vocbase_t& vocbase,
494494
if (res.fail()) {
495495
return false;
496496
}
497-
res.reset(state->addCollection(theEdge->getFromCid(), "_from_" + cname,
498-
mode, /*lockUsage*/ false));
499-
if (res.fail()) {
500-
return false;
501-
}
502-
res.reset(state->addCollection(theEdge->getToCid(), "_to_" + cname,
503-
mode, /*lockUsage*/ false));
504-
if (res.fail()) {
505-
return false;
497+
if (!col->isDisjoint()) {
498+
res.reset(state->addCollection(theEdge->getFromCid(), "_from_" + cname,
499+
mode, /*lockUsage*/ false));
500+
if (res.fail()) {
501+
return false;
502+
}
503+
res.reset(state->addCollection(theEdge->getToCid(), "_to_" + cname,
504+
mode, /*lockUsage*/ false));
505+
if (res.fail()) {
506+
return false;
507+
}
506508
}
507509
}
508510
} catch (basics::Exception const& ex) {

js/common/modules/jsunity.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,28 +290,31 @@ function Run (testsuite) {
290290
PASSED += result.passed;
291291
FAILED += result.failed;
292292
DURATION += result.duration;
293+
COMPLETE[suite.suiteName] = COMPLETE[suite.suiteName] || {};
293294

294295
let duplicates = [];
296+
// Reference will be modified within complete
297+
let cmpl = COMPLETE[suite.suiteName];
295298
for (var attrname in RESULTS) {
296299
if (typeof(RESULTS[attrname]) === 'number') {
297-
if (!COMPLETE.hasOwnProperty(attrname)) {
298-
COMPLETE[attrname] = { };
300+
if (!cmpl.hasOwnProperty(attrname)) {
301+
cmpl[attrname] = { };
299302
}
300-
COMPLETE[attrname][suite.suiteName] = RESULTS[attrname];
303+
cmpl[attrname] = RESULTS[attrname];
301304
} else if (RESULTS.hasOwnProperty(attrname)) {
302-
if (COMPLETE.hasOwnProperty(attrname)) {
305+
if (cmpl.hasOwnProperty(attrname)) {
303306
if (attrname === 'message') {
304-
COMPLETE[attrname] += "\n\n" + RESULTS[attrname];
307+
cmpl[attrname] += "\n\n" + RESULTS[attrname];
305308
continue;
306309
}
307-
print("Duplicate testsuite '" + attrname + "' - already have: " + JSON.stringify(COMPLETE[attrname]) + "");
310+
print("Duplicate testcase '" + suite.suiteName + "::" + attrname + "' - already have: " + JSON.stringify(cmpl[attrname]) + "");
308311
duplicates.push(attrname);
309312
}
310-
COMPLETE[attrname] = RESULTS[attrname];
313+
cmpl[attrname] = RESULTS[attrname];
311314
}
312315
}
313316
if (duplicates.length !== 0) {
314-
throw("Duplicate testsuite '" + duplicates + "'");
317+
throw("Duplicate testcase '" + duplicates + "'");
315318
}
316319
return result;
317320
}

0 commit comments

Comments
 (0)
0