1
0
Fork 0

backported some fixes from devel (#6698)

This commit is contained in:
Jan 2018-10-02 19:58:55 +02:00 committed by GitHub
parent 6b4e7178e2
commit f1eae110c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 6 deletions

View File

@ -150,7 +150,7 @@ void EngineInfoContainerDBServer::EngineInfo::addNode(ExecutionNode* node) {
}
// do not set '_type' of the engine here,
// bacause satellite collections may consists of
// because satellite collections may consist of
// multiple "main nodes"
break;

View File

@ -220,6 +220,8 @@ void IndexBlock::executeExpressions() {
void IndexBlock::initializeOnce() {
auto en = ExecutionNode::castTo<IndexNode const*>(getPlanNode());
auto ast = en->_plan->getAst();
_trx->pinData(_collection->id());
// instantiate expressions:
auto instantiateExpression = [&](AstNode* a,

View File

@ -4626,7 +4626,7 @@ void arangodb::aql::restrictToSingleShardRule(
currentType == ExecutionNode::DISTRIBUTE ||
currentType == ExecutionNode::SINGLETON) {
// we reached a new snippet or the end of the plan - we can abort
// searching now additionally, we cannot yet handle UPSERT well
// searching now. additionally, we cannot yet handle UPSERT well
break;
}

View File

@ -260,10 +260,6 @@ void OptimizerRulesFeature::addRules() {
);
#endif
// @brief replace WITHIN_RECTANGLE(...), NEAR(...), WITHIN(...)
/*OptimizerRulesFeature::registerRule("replace-legacy-geo-functions", replaceLegacyGeoFunctionsRule,
OptimizerRule::removeLegacyGeoFunctions_pass1, DoesNotCreateAdditionalPlans, CanBeDisabled);*/
// remove FILTER DISTANCE(...) and SORT DISTANCE(...)
OptimizerRulesFeature::registerRule("geo-index-optimizer", geoIndexRule,
OptimizerRule::applyGeoIndexRule, DoesNotCreateAdditionalPlans, CanBeDisabled);

View File

@ -215,6 +215,9 @@ bool IResearchViewBlockBase::readDocument(
TRI_ASSERT(_trx->state());
// this is necessary for MMFiles
_trx->pinData(docPk.cid());
// `Methods::documentCollection(TRI_voc_cid_t)` may throw exception
auto* collection = _trx->state()->collection(docPk.cid(), arangodb::AccessMode::Type::READ);

View File

@ -2956,6 +2956,7 @@ MMFilesDocumentPosition MMFilesCollection::lookupDocument(LocalDocumentId const&
if (old) {
return old;
}
TRI_ASSERT(false);
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL,
"got invalid revision value on lookup");
}
@ -2969,6 +2970,7 @@ uint8_t const* MMFilesCollection::lookupDocumentVPack(LocalDocumentId const& doc
TRI_ASSERT(VPackSlice(vpack).isObject());
return vpack;
}
TRI_ASSERT(false);
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL,
"got invalid vpack value on lookup");
}

View File

@ -62,6 +62,12 @@ ShardingInfo::ShardingInfo(arangodb::velocypack::Slice info, LogicalCollection*
"invalid number of shards");
}
}
VPackSlice v = info.get("numberOfShards");
if (!v.isNone() && !v.isNumber() && !v.isNull()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER,
"invalid number of shards");
}
if (info.hasKey("avoidServers")) {
auto avoidServersSlice = info.get("avoidServers");