1
0
Fork 0

fixed field access for non-constant values

This commit is contained in:
Jan Steemann 2012-05-15 15:55:45 +02:00
parent 6aab456034
commit 2eb43caaf6
2 changed files with 13 additions and 1 deletions

View File

@ -40,6 +40,7 @@
/// @{ /// @{
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#ifdef DEBUG_AQL
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief return the name of an access type /// @brief return the name of an access type
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -62,7 +63,7 @@ static char* AccessName (const TRI_aql_access_e type) {
return "unknown"; return "unknown";
} }
} }
#endif
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief free access member data, but do not free the access struct itself /// @brief free access member data, but do not free the access struct itself
@ -1628,6 +1629,13 @@ static TRI_vector_pointer_t* ProcessNode (TRI_aql_context_t* const context,
return NULL; return NULL;
} }
if (node2->_type != AQL_NODE_VALUE &&
node2->_type != AQL_NODE_LIST &&
node2->_type != AQL_NODE_ARRAY) {
// only the above types are supported
return NULL;
}
field = GetAttributeName(context, node1); field = GetAttributeName(context, node1);
if (field) { if (field) {
@ -1859,6 +1867,7 @@ void TRI_FreeRangesAql (TRI_vector_pointer_t* const ranges) {
/// @brief dump a single range for debugging purposes /// @brief dump a single range for debugging purposes
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#if DEBUG_AQL
void TRI_DumpRangeAql (const TRI_aql_field_access_t* const fieldAccess) { void TRI_DumpRangeAql (const TRI_aql_field_access_t* const fieldAccess) {
printf("\nFIELD ACCESS\n- FIELD: %s\n",fieldAccess->_fullName); printf("\nFIELD ACCESS\n- FIELD: %s\n",fieldAccess->_fullName);
printf("- TYPE: %s\n", AccessName(fieldAccess->_type)); printf("- TYPE: %s\n", AccessName(fieldAccess->_type));
@ -1907,6 +1916,7 @@ void TRI_DumpRangesAql (const TRI_vector_pointer_t* const ranges) {
TRI_DumpRangeAql(fieldAccess); TRI_DumpRangeAql(fieldAccess);
} }
} }
#endif
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief free all field access structs in a vector /// @brief free all field access structs in a vector

View File

@ -189,6 +189,7 @@ int TRI_PickAccessAql (const TRI_aql_field_access_t* const,
void TRI_FreeRangesAql (TRI_vector_pointer_t* const); void TRI_FreeRangesAql (TRI_vector_pointer_t* const);
#ifdef DEBUG_AQL
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief dump a single range for debugging purposes /// @brief dump a single range for debugging purposes
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -200,6 +201,7 @@ void TRI_DumpRangeAql (const TRI_aql_field_access_t* const);
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void TRI_DumpRangesAql (const TRI_vector_pointer_t* const); void TRI_DumpRangesAql (const TRI_vector_pointer_t* const);
#endif
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief free all field access structs in a vector /// @brief free all field access structs in a vector