mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:arangodb/ArangoDB into devel
This commit is contained in:
commit
1b16f63cc2
14
CHANGELOG
14
CHANGELOG
|
@ -37,9 +37,21 @@ devel
|
|||
* Foxx OAuth2 module now correctly passes the `access_token` to the OAuth2 server
|
||||
|
||||
|
||||
v3.0.4 (XXXX-XX-XX)
|
||||
v3.0.5 (XXXX-XX-XX)
|
||||
-------------------
|
||||
|
||||
* fixed extraction of _id attribute in AQL traversal conditions
|
||||
|
||||
|
||||
v3.0.4 (2016-08-01)
|
||||
-------------------
|
||||
|
||||
* added missing lock for periodic jobs access
|
||||
|
||||
* fix multiple foxx related cluster issues
|
||||
|
||||
* fix handling of empty AQL query strings
|
||||
|
||||
* fixed issue in `INTERSECTION` AQL function with duplicate elements
|
||||
in the source arrays
|
||||
|
||||
|
|
|
@ -211,19 +211,24 @@ void TraverserExpression::toVelocyPack(VPackBuilder& builder) const {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool TraverserExpression::recursiveCheck(arangodb::aql::AstNode const* node,
|
||||
arangodb::velocypack::Slice& element) const {
|
||||
arangodb::velocypack::Slice& element,
|
||||
arangodb::velocypack::Slice& base) const {
|
||||
|
||||
base = arangodb::basics::VelocyPackHelper::EmptyObjectValue();
|
||||
|
||||
switch (node->type) {
|
||||
case arangodb::aql::NODE_TYPE_REFERENCE:
|
||||
// We are on the variable access
|
||||
return true;
|
||||
case arangodb::aql::NODE_TYPE_ATTRIBUTE_ACCESS: {
|
||||
std::string name(node->getString());
|
||||
if (!recursiveCheck(node->getMember(0), element)) {
|
||||
if (!recursiveCheck(node->getMember(0), element, base)) {
|
||||
return false;
|
||||
}
|
||||
if (!element.isObject() || !element.hasKey(name)) {
|
||||
return false;
|
||||
}
|
||||
base = element; // set base object
|
||||
element = element.get(name);
|
||||
break;
|
||||
}
|
||||
|
@ -232,7 +237,7 @@ bool TraverserExpression::recursiveCheck(arangodb::aql::AstNode const* node,
|
|||
if (!index->isIntValue()) {
|
||||
return false;
|
||||
}
|
||||
if (!recursiveCheck(node->getMember(0), element)) {
|
||||
if (!recursiveCheck(node->getMember(0), element, base)) {
|
||||
return false;
|
||||
}
|
||||
auto idx = index->getIntValue();
|
||||
|
@ -255,16 +260,24 @@ bool TraverserExpression::recursiveCheck(arangodb::aql::AstNode const* node,
|
|||
bool TraverserExpression::matchesCheck(arangodb::Transaction* trx,
|
||||
VPackSlice const& element) const {
|
||||
TRI_ASSERT(trx != nullptr);
|
||||
VPackSlice base = arangodb::basics::VelocyPackHelper::EmptyObjectValue();
|
||||
|
||||
VPackSlice value = element.resolveExternal();
|
||||
|
||||
// initialize compare value to Null
|
||||
VPackSlice result = arangodb::basics::VelocyPackHelper::NullValue();
|
||||
// perform recursive check. this may modify value
|
||||
if (recursiveCheck(varAccess, value)) {
|
||||
if (recursiveCheck(varAccess, value, base)) {
|
||||
result = value;
|
||||
}
|
||||
|
||||
// hack for _id attribute
|
||||
TransactionBuilderLeaser builder(trx);
|
||||
if (result.isCustom() && base.isObject()) {
|
||||
builder->add(VPackValue(trx->extractIdString(base)));
|
||||
result = builder->slice();
|
||||
}
|
||||
|
||||
TRI_ASSERT(compareTo != nullptr);
|
||||
VPackOptions* options = trx->transactionContext()->getVPackOptions();
|
||||
|
||||
|
|
|
@ -81,7 +81,8 @@ class TraverserExpression {
|
|||
|
||||
private:
|
||||
bool recursiveCheck(arangodb::aql::AstNode const*,
|
||||
arangodb::velocypack::Slice&) const;
|
||||
arangodb::velocypack::Slice& value,
|
||||
arangodb::velocypack::Slice& base) const;
|
||||
|
||||
// Required when creating this expression without AST
|
||||
std::vector<std::unique_ptr<arangodb::aql::AstNode const>> _nodeRegister;
|
||||
|
|
Loading…
Reference in New Issue