From dba48cff2dce500d85dd241d123d92beb276304e Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Fri, 25 Apr 2014 13:31:58 +0200 Subject: [PATCH] fixed test --- UnitTests/HttpInterface/api-async-spec.rb | 2 +- arangod/Ahuacatl/ahuacatl-optimiser.c | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/UnitTests/HttpInterface/api-async-spec.rb b/UnitTests/HttpInterface/api-async-spec.rb index 6195a9d20e..4b4730ffdf 100644 --- a/UnitTests/HttpInterface/api-async-spec.rb +++ b/UnitTests/HttpInterface/api-async-spec.rb @@ -226,7 +226,7 @@ describe ArangoDB do cmd = "/_api/job/" + id doc = ArangoDB.log_put("#{prefix}-create-cursor-check-status-408", cmd) - #doc.code.should eq(408) + doc.code.should eq(408) end it "checks whether we can cancel a transaction" do diff --git a/arangod/Ahuacatl/ahuacatl-optimiser.c b/arangod/Ahuacatl/ahuacatl-optimiser.c index d953344b3a..5a36b092d8 100644 --- a/arangod/Ahuacatl/ahuacatl-optimiser.c +++ b/arangod/Ahuacatl/ahuacatl-optimiser.c @@ -717,7 +717,7 @@ static TRI_aql_node_t* OptimiseFcall (TRI_aql_context_t* const context, res = TRI_GetErrorExecutionContext(execContext); TRI_FreeExecutionContext(execContext); - if (res != TRI_ERROR_NO_ERROR) { + if (res == TRI_ERROR_REQUEST_CANCELED) { TRI_SetErrorContextAql(__FILE__, __LINE__, context, res, NULL); return node; } @@ -1232,12 +1232,10 @@ static TRI_aql_node_t* OptimiseBinaryRelationalOperation (TRI_aql_context_t* con if (res != TRI_ERROR_NO_ERROR) { TRI_FreeExecutionContext(execContext); - if (res != TRI_ERROR_REQUEST_CANCELED) { - // we need to return this specific error code - res = TRI_ERROR_QUERY_SCRIPT; + if (res == TRI_ERROR_REQUEST_CANCELED) { + TRI_SetErrorContextAql(__FILE__, __LINE__, context, res, NULL); } - TRI_SetErrorContextAql(__FILE__, __LINE__, context, res, NULL); return node; } @@ -1246,14 +1244,9 @@ static TRI_aql_node_t* OptimiseBinaryRelationalOperation (TRI_aql_context_t* con TRI_FreeExecutionContext(execContext); - if (res != TRI_ERROR_NO_ERROR) { - if (res != TRI_ERROR_REQUEST_CANCELED) { - // we need to return this specific error code - res = TRI_ERROR_QUERY_SCRIPT; - } - + if (res == TRI_ERROR_REQUEST_CANCELED) { TRI_SetErrorContextAql(__FILE__, __LINE__, context, res, NULL); - return NULL; + return node; } if (json == NULL) {