mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:triAGENS/AvocadoDB into devel
This commit is contained in:
commit
3690f91948
|
@ -48,7 +48,7 @@ extern "C" {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief internal state of dump
|
||||
/// @brief internal state of dumper
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct TRI_aql_dump_s {
|
||||
|
|
|
@ -74,7 +74,6 @@ static inline void InitNode (TRI_aql_parse_context_t* const context,
|
|||
static void FreeNodeList (TRI_aql_node_t* const node) {
|
||||
TRI_aql_node_list_t* _node = (TRI_aql_node_list_t*) node;
|
||||
|
||||
// todo: free values
|
||||
TRI_DestroyVectorPointer(&_node->_values);
|
||||
}
|
||||
|
||||
|
@ -85,7 +84,6 @@ static void FreeNodeList (TRI_aql_node_t* const node) {
|
|||
static void FreeNodeArray (TRI_aql_node_t* const node) {
|
||||
TRI_aql_node_array_t* _node = (TRI_aql_node_array_t*) node;
|
||||
|
||||
// todo: free values
|
||||
TRI_DestroyAssociativePointer(&_node->_values);
|
||||
}
|
||||
|
||||
|
@ -419,8 +417,8 @@ TRI_aql_node_t* TRI_CreateNodeVariableAql (TRI_aql_parse_context_t* const contex
|
|||
}
|
||||
|
||||
if (!TRI_AddVariableParseContextAql(context, name)) {
|
||||
printf("fail in %lu\n",(unsigned long) __LINE__);
|
||||
TRI_SetErrorAql(context, TRI_ERROR_OUT_OF_MEMORY, name); // TODO: duplicate variable name
|
||||
// duplicate variable name
|
||||
TRI_SetErrorAql(context, TRI_ERROR_QUERY_VARIABLE_REDECLARED, name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1435,7 +1433,8 @@ bool TRI_PushArrayAql (TRI_aql_parse_context_t* const context,
|
|||
}
|
||||
|
||||
if (TRI_InsertKeyAssociativePointer(&array->_values, element->_name, (void*) element, false)) {
|
||||
// duplicate element TODO
|
||||
// duplicate element in a document/array, e.g. { "name" : "John", "name" : "Jim" }
|
||||
TRI_SetErrorAql(context, TRI_ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -116,6 +116,8 @@ ERROR_QUERY_BIND_PARAMETER_NUMBER_OUT_OF_RANGE,1517,"bind parameter number '%s'
|
|||
ERROR_QUERY_FUNCTION_NAME_UNKNOWN,1518,"usage of unknown function '%s'","Will be raised when an undefined function is called."
|
||||
ERROR_QUERY_RUNTIME_ERROR,1520,"runtime error in query","Will be raised when a Javascript runtime error occurs while executing a query."
|
||||
ERROR_QUERY_LIMIT_VALUE_OUT_OF_RANGE,1521,"limit value '%s' is out of range","Will be raised when a limit value in the query is outside the allowed range (e. g. when passing a negative skip value)."
|
||||
ERROR_QUERY_VARIABLE_REDECLARED,1522,"variable '%s' is assigned multiple times","Will be raised when a variable gets re-assigned in a query."
|
||||
ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED,1523,"document attribute '%s' is assigned multiple times","Will be raised when a document attribute is re-assigned."
|
||||
|
||||
################################################################################
|
||||
## AvocadoDB cursor errors
|
||||
|
|
|
@ -82,6 +82,8 @@ void TRI_InitialiseErrorMessages (void) {
|
|||
REG_ERROR(ERROR_QUERY_FUNCTION_NAME_UNKNOWN, "usage of unknown function '%s'");
|
||||
REG_ERROR(ERROR_QUERY_RUNTIME_ERROR, "runtime error in query");
|
||||
REG_ERROR(ERROR_QUERY_LIMIT_VALUE_OUT_OF_RANGE, "limit value '%s' is out of range");
|
||||
REG_ERROR(ERROR_QUERY_VARIABLE_REDECLARED, "variable '%s' is assigned multiple times");
|
||||
REG_ERROR(ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED, "document attribute '%s' is assigned multiple times");
|
||||
REG_ERROR(ERROR_CURSOR_NOT_FOUND, "cursor not found");
|
||||
REG_ERROR(ERROR_SESSION_USERHANDLER_URL_INVALID, "expecting <prefix>/user/<username>");
|
||||
REG_ERROR(ERROR_SESSION_USERHANDLER_CANNOT_CREATE_USER, "cannot create user");
|
||||
|
|
|
@ -180,6 +180,10 @@ extern "C" {
|
|||
/// - 1521: @CODE{limit value '\%s' is out of range}
|
||||
/// Will be raised when a limit value in the query is outside the allowed
|
||||
/// range (e. g. when passing a negative skip value).
|
||||
/// - 1522: @CODE{variable '\%s' is assigned multiple times}
|
||||
/// Will be raised when a variable gets re-assigned in a query.
|
||||
/// - 1523: @CODE{document attribute '\%s' is assigned multiple times}
|
||||
/// Will be raised when a document attribute is re-assigned.
|
||||
/// - 1600: @CODE{cursor not found}
|
||||
/// Will be raised when a cursor is requested via its id but a cursor with
|
||||
/// that id cannot be found.
|
||||
|
@ -1003,6 +1007,26 @@ void TRI_InitialiseErrorMessages (void);
|
|||
|
||||
#define TRI_ERROR_QUERY_LIMIT_VALUE_OUT_OF_RANGE (1521)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief 1522: ERROR_QUERY_VARIABLE_REDECLARED
|
||||
///
|
||||
/// variable '%s' is assigned multiple times
|
||||
///
|
||||
/// Will be raised when a variable gets re-assigned in a query.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_ERROR_QUERY_VARIABLE_REDECLARED (1522)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief 1523: ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED
|
||||
///
|
||||
/// document attribute '%s' is assigned multiple times
|
||||
///
|
||||
/// Will be raised when a document attribute is re-assigned.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED (1523)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief 1600: ERROR_CURSOR_NOT_FOUND
|
||||
///
|
||||
|
|
|
@ -76,6 +76,8 @@ ModuleCache["/internal"].exports.errors = {
|
|||
"ERROR_QUERY_FUNCTION_NAME_UNKNOWN" : { "code" : 1518, "message" : "usage of unknown function '%s'" },
|
||||
"ERROR_QUERY_RUNTIME_ERROR" : { "code" : 1520, "message" : "runtime error in query" },
|
||||
"ERROR_QUERY_LIMIT_VALUE_OUT_OF_RANGE" : { "code" : 1521, "message" : "limit value '%s' is out of range" },
|
||||
"ERROR_QUERY_VARIABLE_REDECLARED" : { "code" : 1522, "message" : "variable '%s' is assigned multiple times" },
|
||||
"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED" : { "code" : 1523, "message" : "document attribute '%s' is assigned multiple times" },
|
||||
"ERROR_CURSOR_NOT_FOUND" : { "code" : 1600, "message" : "cursor not found" },
|
||||
"ERROR_SESSION_USERHANDLER_URL_INVALID" : { "code" : 1700, "message" : "expecting <prefix>/user/<username>" },
|
||||
"ERROR_SESSION_USERHANDLER_CANNOT_CREATE_USER" : { "code" : 1701, "message" : "cannot create user" },
|
||||
|
|
|
@ -77,6 +77,8 @@ static string JS_common_bootstrap_errors =
|
|||
" \"ERROR_QUERY_FUNCTION_NAME_UNKNOWN\" : { \"code\" : 1518, \"message\" : \"usage of unknown function '%s'\" }, \n"
|
||||
" \"ERROR_QUERY_RUNTIME_ERROR\" : { \"code\" : 1520, \"message\" : \"runtime error in query\" }, \n"
|
||||
" \"ERROR_QUERY_LIMIT_VALUE_OUT_OF_RANGE\" : { \"code\" : 1521, \"message\" : \"limit value '%s' is out of range\" }, \n"
|
||||
" \"ERROR_QUERY_VARIABLE_REDECLARED\" : { \"code\" : 1522, \"message\" : \"variable '%s' is assigned multiple times\" }, \n"
|
||||
" \"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED\" : { \"code\" : 1523, \"message\" : \"document attribute '%s' is assigned multiple times\" }, \n"
|
||||
" \"ERROR_CURSOR_NOT_FOUND\" : { \"code\" : 1600, \"message\" : \"cursor not found\" }, \n"
|
||||
" \"ERROR_SESSION_USERHANDLER_URL_INVALID\" : { \"code\" : 1700, \"message\" : \"expecting <prefix>/user/<username>\" }, \n"
|
||||
" \"ERROR_SESSION_USERHANDLER_CANNOT_CREATE_USER\" : { \"code\" : 1701, \"message\" : \"cannot create user\" }, \n"
|
||||
|
|
Loading…
Reference in New Issue