mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
3cc95a23fd
|
@ -1125,10 +1125,8 @@ static void GeneratePrimaryAccess (TRI_aql_codegen_js_t* const generator,
|
||||||
const TRI_aql_collection_t* const collection,
|
const TRI_aql_collection_t* const collection,
|
||||||
const char* const collectionName) {
|
const char* const collectionName) {
|
||||||
TRI_aql_field_access_t* fieldAccess;
|
TRI_aql_field_access_t* fieldAccess;
|
||||||
size_t n;
|
|
||||||
|
|
||||||
n = idx->_fieldAccesses->_length;
|
TRI_ASSERT(idx->_fieldAccesses->_length == 1);
|
||||||
TRI_ASSERT(n == 1);
|
|
||||||
|
|
||||||
fieldAccess = (TRI_aql_field_access_t*) TRI_AtVectorPointer(idx->_fieldAccesses, 0);
|
fieldAccess = (TRI_aql_field_access_t*) TRI_AtVectorPointer(idx->_fieldAccesses, 0);
|
||||||
|
|
||||||
|
@ -1269,10 +1267,8 @@ static void GenerateEdgeAccess (TRI_aql_codegen_js_t* const generator,
|
||||||
const TRI_aql_collection_t* const collection,
|
const TRI_aql_collection_t* const collection,
|
||||||
const char* const collectionName) {
|
const char* const collectionName) {
|
||||||
TRI_aql_field_access_t* fieldAccess;
|
TRI_aql_field_access_t* fieldAccess;
|
||||||
size_t n;
|
|
||||||
|
|
||||||
n = idx->_fieldAccesses->_length;
|
TRI_ASSERT(idx->_fieldAccesses->_length > 0);
|
||||||
TRI_ASSERT(n > 0);
|
|
||||||
|
|
||||||
fieldAccess = (TRI_aql_field_access_t*) TRI_AtVectorPointer(idx->_fieldAccesses, 0);
|
fieldAccess = (TRI_aql_field_access_t*) TRI_AtVectorPointer(idx->_fieldAccesses, 0);
|
||||||
|
|
||||||
|
|
|
@ -389,33 +389,24 @@ static bool CheckPathRestriction (TRI_aql_field_access_t* fieldAccess,
|
||||||
static void OptimisePaths (const TRI_aql_node_t* const fcallNode,
|
static void OptimisePaths (const TRI_aql_node_t* const fcallNode,
|
||||||
TRI_aql_context_t* const context,
|
TRI_aql_context_t* const context,
|
||||||
TRI_aql_field_access_t* fieldAccess) {
|
TRI_aql_field_access_t* fieldAccess) {
|
||||||
TRI_aql_node_t* args;
|
TRI_aql_node_t* args = TRI_AQL_NODE_MEMBER(fcallNode, 0);
|
||||||
TRI_aql_node_t* vertexCollection;
|
|
||||||
TRI_aql_node_t* edgeCollection;
|
|
||||||
TRI_aql_node_t* direction;
|
|
||||||
char* directionValue;
|
|
||||||
char* name;
|
|
||||||
size_t n;
|
|
||||||
|
|
||||||
args = TRI_AQL_NODE_MEMBER(fcallNode, 0);
|
if (args == nullptr) {
|
||||||
|
|
||||||
if (args == NULL) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vertexCollection = TRI_AQL_NODE_MEMBER(args, 0);
|
TRI_aql_node_t* vertexCollection = TRI_AQL_NODE_MEMBER(args, 0);
|
||||||
edgeCollection = TRI_AQL_NODE_MEMBER(args, 1);
|
TRI_aql_node_t* direction = TRI_AQL_NODE_MEMBER(args, 2);
|
||||||
direction = TRI_AQL_NODE_MEMBER(args, 2);
|
|
||||||
|
|
||||||
TRI_ASSERT(vertexCollection);
|
TRI_ASSERT(vertexCollection != nullptr);
|
||||||
TRI_ASSERT(edgeCollection);
|
TRI_ASSERT(TRI_AQL_NODE_MEMBER(args, 1) != nullptr); // edgeCollection
|
||||||
TRI_ASSERT(direction);
|
TRI_ASSERT(direction != nullptr);
|
||||||
TRI_ASSERT(fieldAccess);
|
TRI_ASSERT(fieldAccess != nullptr);
|
||||||
|
|
||||||
n = strlen(fieldAccess->_fullName);
|
size_t n = strlen(fieldAccess->_fullName);
|
||||||
name = fieldAccess->_fullName + fieldAccess->_variableNameLength;
|
char* name = fieldAccess->_fullName + fieldAccess->_variableNameLength;
|
||||||
|
|
||||||
directionValue = TRI_AQL_NODE_STRING(direction);
|
char* directionValue = TRI_AQL_NODE_STRING(direction);
|
||||||
// try to optimise the vertex collection access
|
// try to optimise the vertex collection access
|
||||||
if (TRI_EqualString(directionValue, "outbound")) {
|
if (TRI_EqualString(directionValue, "outbound")) {
|
||||||
CheckPathRestriction(fieldAccess, context, vertexCollection, ".source.", name, n);
|
CheckPathRestriction(fieldAccess, context, vertexCollection, ".source.", name, n);
|
||||||
|
|
|
@ -209,7 +209,7 @@ static TRI_shape_aid_t FindOrCreateAttributeByName (TRI_shaper_t* shaper,
|
||||||
THROW_ARANGO_EXCEPTION(slotInfo.errorCode);
|
THROW_ARANGO_EXCEPTION(slotInfo.errorCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* f = TRI_InsertKeyAssociativeSynced(&s->_attributeIds, &aid, const_cast<void*>(slotInfo.mem), false);
|
void* f TRI_UNUSED = TRI_InsertKeyAssociativeSynced(&s->_attributeIds, &aid, const_cast<void*>(slotInfo.mem), false);
|
||||||
TRI_ASSERT(f == nullptr);
|
TRI_ASSERT(f == nullptr);
|
||||||
|
|
||||||
// enter into the dictionaries
|
// enter into the dictionaries
|
||||||
|
|
Loading…
Reference in New Issue