1
0
Fork 0

Bug fix/fixed analyzer removal from db (#9359)

* Added missing commit. Updated tests to check actual deletion from db.

* Added check for commit result
This commit is contained in:
Dronplane 2019-06-28 18:29:49 +03:00 committed by Andrey Abramov
parent 782cb49105
commit d561221201
2 changed files with 8 additions and 0 deletions

View File

@ -2117,6 +2117,11 @@ arangodb::Result IResearchAnalyzerFeature::remove( // remove analyzer
return result.result;
}
auto commitResult = trx.commit();
if (!commitResult.ok()) {
return commitResult;
}
_analyzers.erase(itr);
} catch (arangodb::basics::Exception const& e) {

View File

@ -93,6 +93,7 @@ function iResearchFeatureAqlTestSuite () {
testAnalyzers: function() {
let oldList = analyzers.toArray();
let oldListInCollection = db._analyzers.toArray();
assertTrue(Array === oldList.constructor);
// creation
@ -133,6 +134,8 @@ function iResearchFeatureAqlTestSuite () {
analyzers.remove(db._name() + "::testAnalyzer");
assertTrue(null === analyzers.analyzer(db._name() + "::testAnalyzer"));
assertEqual(oldList.length, analyzers.toArray().length);
// check the analyzers collection in database
assertEqual(oldListInCollection.length, db._analyzers.toArray().length);
},
testAnalyzersFeatures: function() {