1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
scottashton 2014-06-24 14:27:16 +02:00
commit 3cc95a23fd
3 changed files with 14 additions and 27 deletions

View File

@ -1125,10 +1125,8 @@ static void GeneratePrimaryAccess (TRI_aql_codegen_js_t* const generator,
const TRI_aql_collection_t* const collection,
const char* const collectionName) {
TRI_aql_field_access_t* fieldAccess;
size_t n;
n = idx->_fieldAccesses->_length;
TRI_ASSERT(n == 1);
TRI_ASSERT(idx->_fieldAccesses->_length == 1);
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 char* const collectionName) {
TRI_aql_field_access_t* fieldAccess;
size_t n;
n = idx->_fieldAccesses->_length;
TRI_ASSERT(n > 0);
TRI_ASSERT(idx->_fieldAccesses->_length > 0);
fieldAccess = (TRI_aql_field_access_t*) TRI_AtVectorPointer(idx->_fieldAccesses, 0);

View File

@ -389,33 +389,24 @@ static bool CheckPathRestriction (TRI_aql_field_access_t* fieldAccess,
static void OptimisePaths (const TRI_aql_node_t* const fcallNode,
TRI_aql_context_t* const context,
TRI_aql_field_access_t* fieldAccess) {
TRI_aql_node_t* args;
TRI_aql_node_t* vertexCollection;
TRI_aql_node_t* edgeCollection;
TRI_aql_node_t* direction;
char* directionValue;
char* name;
size_t n;
TRI_aql_node_t* args = TRI_AQL_NODE_MEMBER(fcallNode, 0);
args = TRI_AQL_NODE_MEMBER(fcallNode, 0);
if (args == NULL) {
if (args == nullptr) {
return;
}
vertexCollection = TRI_AQL_NODE_MEMBER(args, 0);
edgeCollection = TRI_AQL_NODE_MEMBER(args, 1);
direction = TRI_AQL_NODE_MEMBER(args, 2);
TRI_aql_node_t* vertexCollection = TRI_AQL_NODE_MEMBER(args, 0);
TRI_aql_node_t* direction = TRI_AQL_NODE_MEMBER(args, 2);
TRI_ASSERT(vertexCollection);
TRI_ASSERT(edgeCollection);
TRI_ASSERT(direction);
TRI_ASSERT(fieldAccess);
TRI_ASSERT(vertexCollection != nullptr);
TRI_ASSERT(TRI_AQL_NODE_MEMBER(args, 1) != nullptr); // edgeCollection
TRI_ASSERT(direction != nullptr);
TRI_ASSERT(fieldAccess != nullptr);
n = strlen(fieldAccess->_fullName);
name = fieldAccess->_fullName + fieldAccess->_variableNameLength;
size_t n = strlen(fieldAccess->_fullName);
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
if (TRI_EqualString(directionValue, "outbound")) {
CheckPathRestriction(fieldAccess, context, vertexCollection, ".source.", name, n);

View File

@ -209,7 +209,7 @@ static TRI_shape_aid_t FindOrCreateAttributeByName (TRI_shaper_t* shaper,
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);
// enter into the dictionaries