From 728a439d3fc08bc2889183c0ddbcf3d219943edd Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Wed, 30 Jul 2014 09:30:41 +0200 Subject: [PATCH 1/6] readline vs. linenoise vs. dummyshell: next try --- lib/Utilities/ShellImplFactory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Utilities/ShellImplFactory.cpp b/lib/Utilities/ShellImplFactory.cpp index c9c5525c77..be0f2bb608 100644 --- a/lib/Utilities/ShellImplFactory.cpp +++ b/lib/Utilities/ShellImplFactory.cpp @@ -30,9 +30,9 @@ #ifdef _WIN32 #include "LinenoiseShell.h" -#elif TRI_HAVE_LINENOISE +#elif defined TRI_HAVE_LINENOISE #include "LinenoiseShell.h" -#elif TRI_HAVE_READLINE +#elif defined TRI_HAVE_READLINE #include "ReadlineShell.h" #else #include "DummyShell.h" From 944ba6597de25c210b820b083fe9f43d4061d642 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Wed, 30 Jul 2014 09:30:59 +0200 Subject: [PATCH 2/6] Add projection and sort node. --- arangod/Aql/ExecutionPlan.cpp | 48 +++++++-- arangod/Aql/ExecutionPlan.h | 193 ++++++++++++++++++++++++++++++++-- 2 files changed, 229 insertions(+), 12 deletions(-) diff --git a/arangod/Aql/ExecutionPlan.cpp b/arangod/Aql/ExecutionPlan.cpp index 9805420191..175a10219e 100644 --- a/arangod/Aql/ExecutionPlan.cpp +++ b/arangod/Aql/ExecutionPlan.cpp @@ -175,22 +175,28 @@ Json LimitPlan::toJson (TRI_memory_zone_t* zone) const { } // ----------------------------------------------------------------------------- -// --SECTION-- methods of CalculationPlan +// --SECTION-- methods of ProjectionPlan // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// -/// @brief toJson, for CalculationPlan +/// @brief toJson, for ProjectionPlan //////////////////////////////////////////////////////////////////////////////// -Json CalculationPlan::toJson (TRI_memory_zone_t* zone) const { +Json ProjectionPlan::toJson (TRI_memory_zone_t* zone) const { Json json(ExecutionPlan::toJson(zone)); // call base class method if (json.isEmpty()) { return json; } try { - json("varNumber", Json(static_cast(_varNumber))) - ("varName", Json(_varName)) - ("expression", _expression->toJson(TRI_UNKNOWN_MEM_ZONE)); + Json vec(Json::List,_keepAttributes.size()); + for (auto it = _keepAttributes.begin(); it != _keepAttributes.end(); ++it) { + vec(Json(*it)); + } + json("inVarNumber", Json(static_cast(_inVar))) + ("inVarName", Json(_inVarName)) + ("outVarNumber", Json(static_cast(_outVar))) + ("outVarName", Json(_outVarName)) + ("keepAttributes", vec); } catch (std::exception& e) { return Json(); @@ -226,6 +232,36 @@ Json FilterPlan::toJson (TRI_memory_zone_t* zone) const { return json; } +// ----------------------------------------------------------------------------- +// --SECTION-- methods of SortPlan +// ----------------------------------------------------------------------------- + +//////////////////////////////////////////////////////////////////////////////// +/// @brief toJson, for SortPlan +//////////////////////////////////////////////////////////////////////////////// + +Json SortPlan::toJson (TRI_memory_zone_t* zone) const { + Json json(ExecutionPlan::toJson(zone)); // call base class method + if (json.isEmpty()) { + return json; + } + try { + Json vec(Json::List,_sortAttributes.size()); + for (auto it = _sortAttributes.begin(); it != _sortAttributes.end(); ++it) { + vec(Json(*it)); + } + json("varNumber", Json(static_cast(_varNumber))) + ("varName", Json(_varName)) + ("sortAttributes", vec); + } + catch (std::exception& e) { + return Json(); + } + + // And return it: + return json; +} + // ----------------------------------------------------------------------------- // --SECTION-- methods of RootPlan // ----------------------------------------------------------------------------- diff --git a/arangod/Aql/ExecutionPlan.h b/arangod/Aql/ExecutionPlan.h index 940f12c8aa..f4977d9b63 100644 --- a/arangod/Aql/ExecutionPlan.h +++ b/arangod/Aql/ExecutionPlan.h @@ -35,6 +35,7 @@ #include #include +#include "Aql/Variable.h" #include "Aql/Types.h" namespace triagens { @@ -59,15 +60,15 @@ namespace triagens { SINGLETON, // done ENUMERATE_COLLECTION, // done INDEX_RANGE, - STATIC_LIST, // 4. + STATIC_LIST, // todo FILTER, // done LIMIT, // done INTERSECTION, - PROJECTION, // 1. + PROJECTION, // done CALCULATION, // done - SORT, // 3. + SORT, // done AGGREGATE_ON_SORTED, - AGGREGATE_ON_UNSORTED, // 2. + AGGREGATE_ON_UNSORTED, // todo LOOKUP_JOIN, MERGE_JOIN, LOOKUP_INDEX_UNIQUE, @@ -422,6 +423,104 @@ namespace triagens { }; +// ----------------------------------------------------------------------------- +// --SECTION-- class ProjectionPlan +// ----------------------------------------------------------------------------- + +//////////////////////////////////////////////////////////////////////////////// +/// @brief class ProjectionPlan, derived from ExecutionPlan +//////////////////////////////////////////////////////////////////////////////// + + class ProjectionPlan : public ExecutionPlan { + +//////////////////////////////////////////////////////////////////////////////// +/// @brief constructor +//////////////////////////////////////////////////////////////////////////////// + + public: + + ProjectionPlan (VariableId inVar, + std::string inVarName, + VariableId outVar, + std::string outVarName, + std::vector keepAttributes) + : ExecutionPlan(), _inVar(inVar), _inVarName(inVarName), + _outVar(outVar), _outVarName(outVarName), + _keepAttributes(keepAttributes) { + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief return the type of the node +//////////////////////////////////////////////////////////////////////////////// + + virtual NodeType getType () const { + return PROJECTION; + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief return the type of the node as a string +//////////////////////////////////////////////////////////////////////////////// + + virtual std::string getTypeString () const { + return std::string("ProjectionPlan"); + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief export to JSON +//////////////////////////////////////////////////////////////////////////////// + + virtual triagens::basics::Json toJson ( + TRI_memory_zone_t* zone = TRI_UNKNOWN_MEM_ZONE) const; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief clone execution plan recursively +//////////////////////////////////////////////////////////////////////////////// + + virtual ExecutionPlan* clone () const { + auto c = new ProjectionPlan(_inVar, _inVarName, _outVar, _outVarName, + _keepAttributes); + cloneDependencies(c); + return static_cast(c); + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief private data +//////////////////////////////////////////////////////////////////////////////// + + private: + +//////////////////////////////////////////////////////////////////////////////// +/// @brief input variable +//////////////////////////////////////////////////////////////////////////////// + + VariableId _inVar; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief _inVarName, name of variable to read from +//////////////////////////////////////////////////////////////////////////////// + + std::string _inVarName; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief output variable +//////////////////////////////////////////////////////////////////////////////// + + VariableId _outVar; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief _outVarName, name of variable to write to +//////////////////////////////////////////////////////////////////////////////// + + std::string _outVarName; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief vector of attributes to leave in the object +//////////////////////////////////////////////////////////////////////////////// + + std::vector _keepAttributes; + + }; + // ----------------------------------------------------------------------------- // --SECTION-- class CalculationPlan // ----------------------------------------------------------------------------- @@ -438,7 +537,7 @@ namespace triagens { public: - CalculationPlan (AqlExpression* expr, uint32_t varNumber, + CalculationPlan (AqlExpression* expr, VariableId varNumber, std::string varName) : ExecutionPlan(), _expression(expr), _varNumber(varNumber), _varName(varName) { @@ -493,7 +592,7 @@ namespace triagens { /// @brief _varNumber, global number of variable to write to //////////////////////////////////////////////////////////////////////////////// - uint32_t _varNumber; + VariableId _varNumber; //////////////////////////////////////////////////////////////////////////////// /// @brief _varName, name of variable to write to @@ -567,6 +666,88 @@ namespace triagens { }; +// ----------------------------------------------------------------------------- +// --SECTION-- class SortPlan +// ----------------------------------------------------------------------------- + +//////////////////////////////////////////////////////////////////////////////// +/// @brief class SortPlan, derived from ExecutionPlan +//////////////////////////////////////////////////////////////////////////////// + + class SortPlan : public ExecutionPlan { + +//////////////////////////////////////////////////////////////////////////////// +/// @brief constructor +//////////////////////////////////////////////////////////////////////////////// + + public: + + SortPlan (VariableId varNumber, + std::string varName, + std::vector sortAttributes) + : ExecutionPlan(), _varNumber(varNumber), _varName(varName), + _sortAttributes(sortAttributes) { + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief return the type of the node +//////////////////////////////////////////////////////////////////////////////// + + virtual NodeType getType () const { + return SORT; + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief return the type of the node as a string +//////////////////////////////////////////////////////////////////////////////// + + virtual std::string getTypeString () const { + return std::string("SortPlan"); + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief export to JSON +//////////////////////////////////////////////////////////////////////////////// + + virtual triagens::basics::Json toJson ( + TRI_memory_zone_t* zone = TRI_UNKNOWN_MEM_ZONE) const; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief clone execution plan recursively +//////////////////////////////////////////////////////////////////////////////// + + virtual ExecutionPlan* clone () const { + auto c = new SortPlan(_varNumber, _varName, _sortAttributes); + cloneDependencies(c); + return static_cast(c); + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief private data +//////////////////////////////////////////////////////////////////////////////// + + private: + +//////////////////////////////////////////////////////////////////////////////// +/// @brief input variable +//////////////////////////////////////////////////////////////////////////////// + + VariableId _varNumber; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief _inVarName, name of variable to read from +//////////////////////////////////////////////////////////////////////////////// + + std::string _varName; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief vector of attributes to sort by +//////////////////////////////////////////////////////////////////////////////// + + std::vector _sortAttributes; + + }; + // ----------------------------------------------------------------------------- // --SECTION-- class RootPlan From 83d49c0d9d1d00ad1cf19f86c76de54fb4a68642 Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Wed, 30 Jul 2014 09:41:57 +0200 Subject: [PATCH 3/6] Fixed a minor bug where it was not allowed to remove a vertex from a graph by its key --- .../js/modules/org/arangodb/general-graph.js | 5 ++- .../modules/org/arangodb/general-graph.js | 5 ++- js/common/tests/shell-general-graph.js | 36 ++++++++++++++++--- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/js/apps/system/aardvark/frontend/js/modules/org/arangodb/general-graph.js b/js/apps/system/aardvark/frontend/js/modules/org/arangodb/general-graph.js index cde4ee3ac8..ef003d0a06 100644 --- a/js/apps/system/aardvark/frontend/js/modules/org/arangodb/general-graph.js +++ b/js/apps/system/aardvark/frontend/js/modules/org/arangodb/general-graph.js @@ -1891,7 +1891,10 @@ var bindVertexCollections = function(self, vertexCollections) { wrap.remove = function(vertexId, options) { //delete all edges using the vertex in all graphs var graphs = getGraphCollection().toArray(); - var vertexCollectionName = vertexId.split("/")[0]; + var vertexCollectionName = key; + if (vertexId.indexOf("/") === -1) { + vertexId = key + "/" + vertexId; + } self.__collectionsToLock.push(vertexCollectionName); graphs.forEach( function(graph) { diff --git a/js/common/modules/org/arangodb/general-graph.js b/js/common/modules/org/arangodb/general-graph.js index 378e77e055..873711d338 100644 --- a/js/common/modules/org/arangodb/general-graph.js +++ b/js/common/modules/org/arangodb/general-graph.js @@ -1890,7 +1890,10 @@ var bindVertexCollections = function(self, vertexCollections) { wrap.remove = function(vertexId, options) { //delete all edges using the vertex in all graphs var graphs = getGraphCollection().toArray(); - var vertexCollectionName = vertexId.split("/")[0]; + var vertexCollectionName = key; + if (vertexId.indexOf("/") === -1) { + vertexId = key + "/" + vertexId; + } self.__collectionsToLock.push(vertexCollectionName); graphs.forEach( function(graph) { diff --git a/js/common/tests/shell-general-graph.js b/js/common/tests/shell-general-graph.js index 1a639e896c..6909ffa126 100644 --- a/js/common/tests/shell-general-graph.js +++ b/js/common/tests/shell-general-graph.js @@ -1979,8 +1979,8 @@ function EdgesAndVerticesSuite() { var myED = "unitTestEdgeCollection4711"; var myVD1 = "unitTestVertexCollection4711"; var myVD2 = "unitTestVertexCollection4712"; - try {graph._drop(myGraphName, true)} catch (ignore){} - try {db._drop(myED)} catch (ignore){} + try {graph._drop(myGraphName, true);} catch (ignore){} + try {db._drop(myED);} catch (ignore){} try { graph._create( myGraphName, @@ -2045,9 +2045,24 @@ function EdgesAndVerticesSuite() { }, test_vC_remove : function () { - var vertex = g[vc1].save({first_name: "Tim"}); + var col = g[vc1]; + var counter = col.count(); + var vertex = col.save({first_name: "Tim"}); + assertEqual(col.count(), counter + 1); var vertexId = vertex._id; - var result = g[vc1].remove(vertexId); + var result = col.remove(vertexId); + assertEqual(col.count(), counter); + assertTrue(result); + }, + + test_vC_remove_by_key : function () { + var col = g[vc1]; + var counter = col.count(); + var vertex = col.save({first_name: "Tim"}); + assertEqual(col.count(), counter + 1); + var vertexId = vertex._key; + var result = col.remove(vertexId); + assertEqual(col.count(), counter); assertTrue(result); }, @@ -2143,6 +2158,19 @@ function EdgesAndVerticesSuite() { assertTrue(edge); }, + test_eC_remove_by_key : function () { + var vertex1 = g[vc1].save({first_name: "Tom"}); + var vertexId1 = vertex1._id; + var vertex2 = g[vc1].save({first_name: "Tim"}); + var vertexId2 = vertex2._id; + var counter = g[ec1].count(); + var edge = g[ec1].save(vertexId1, vertexId2, {}); + assertEqual(g[ec1].count(), counter + 1); + var edgeId1 = edge._key; + edge = g[ec1].remove(edgeId1); + assertTrue(edge); + assertEqual(g[ec1].count(), counter); + }, test_eC_removeWithEdgesAsVertices : function () { From b657c61bee12542a189d4a4cbbe98886c5041583 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Wed, 30 Jul 2014 09:43:38 +0200 Subject: [PATCH 4/6] readline vs. linenoise vs. dummyshell: finally... --- lib/Utilities/ShellImplFactory.cpp | 4 ++-- lib/Utilities/ShellImplFactory.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Utilities/ShellImplFactory.cpp b/lib/Utilities/ShellImplFactory.cpp index be0f2bb608..f07abce1b8 100644 --- a/lib/Utilities/ShellImplFactory.cpp +++ b/lib/Utilities/ShellImplFactory.cpp @@ -28,6 +28,8 @@ /// @author Copyright 2011-2014, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// +#include "ShellImplFactory.h" + #ifdef _WIN32 #include "LinenoiseShell.h" #elif defined TRI_HAVE_LINENOISE @@ -38,8 +40,6 @@ #include "DummyShell.h" #endif -#include "ShellImplFactory.h" - using namespace triagens; using namespace std; diff --git a/lib/Utilities/ShellImplFactory.h b/lib/Utilities/ShellImplFactory.h index d71df221ef..29298ee7e1 100644 --- a/lib/Utilities/ShellImplFactory.h +++ b/lib/Utilities/ShellImplFactory.h @@ -34,6 +34,10 @@ #include "Basics/Common.h" namespace triagens { + + class ShellImplementation; + class Completer; + class ShellImplFactory { public: From 2b8d497bc89773169e82150028f865c4b624788f Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Wed, 30 Jul 2014 10:00:25 +0200 Subject: [PATCH 5/6] Repair CalculationPlan, add Json for expressions. --- arangod/Aql/ExecutionPlan.cpp | 53 ++++++++++++++++++++++- arangod/Aql/ExecutionPlan.h | 80 +++++++++++++++++++++++++++++++++-- arangod/Aql/Types.h | 2 +- 3 files changed, 130 insertions(+), 5 deletions(-) diff --git a/arangod/Aql/ExecutionPlan.cpp b/arangod/Aql/ExecutionPlan.cpp index 175a10219e..647fafa575 100644 --- a/arangod/Aql/ExecutionPlan.cpp +++ b/arangod/Aql/ExecutionPlan.cpp @@ -148,6 +148,31 @@ Json EnumerateCollectionPlan::toJson (TRI_memory_zone_t* zone) const { return json; } +// ----------------------------------------------------------------------------- +// --SECTION-- methods of EnumerateListPlan +// ----------------------------------------------------------------------------- + +//////////////////////////////////////////////////////////////////////////////// +/// @brief toJson, for EnumerateListPlan +//////////////////////////////////////////////////////////////////////////////// + +Json EnumerateListPlan::toJson (TRI_memory_zone_t* zone) const { + Json json(ExecutionPlan::toJson(zone)); // call base class method + if (json.isEmpty()) { + return json; + } + try { + json("varNumber", Json(static_cast(_varNumber))) + ("varName", Json(_varName)); + } + catch (std::exception& e) { + return Json(); + } + + // And return it: + return json; +} + // ----------------------------------------------------------------------------- // --SECTION-- methods of LimitPlan // ----------------------------------------------------------------------------- @@ -174,6 +199,32 @@ Json LimitPlan::toJson (TRI_memory_zone_t* zone) const { return json; } +// ----------------------------------------------------------------------------- +// --SECTION-- methods of CalculationPlan +// ----------------------------------------------------------------------------- + +//////////////////////////////////////////////////////////////////////////////// +/// @brief toJson, for CalculationPlan +//////////////////////////////////////////////////////////////////////////////// + +Json CalculationPlan::toJson (TRI_memory_zone_t* zone) const { + Json json(ExecutionPlan::toJson(zone)); // call base class method + if (json.isEmpty()) { + return json; + } + try { + json("varNumber", Json(static_cast(_varNumber))) + ("varName", Json(_varName)) + ("expression", _expression->toJson(TRI_UNKNOWN_MEM_ZONE)); + } + catch (std::exception& e) { + return Json(); + } + + // And return it: + return json; +} + // ----------------------------------------------------------------------------- // --SECTION-- methods of ProjectionPlan // ----------------------------------------------------------------------------- @@ -233,7 +284,7 @@ Json FilterPlan::toJson (TRI_memory_zone_t* zone) const { } // ----------------------------------------------------------------------------- -// --SECTION-- methods of SortPlan +// --SECTION-- methods of SortPlan // ----------------------------------------------------------------------------- //////////////////////////////////////////////////////////////////////////////// diff --git a/arangod/Aql/ExecutionPlan.h b/arangod/Aql/ExecutionPlan.h index f4977d9b63..c53f515626 100644 --- a/arangod/Aql/ExecutionPlan.h +++ b/arangod/Aql/ExecutionPlan.h @@ -60,7 +60,7 @@ namespace triagens { SINGLETON, // done ENUMERATE_COLLECTION, // done INDEX_RANGE, - STATIC_LIST, // todo + ENUMERATE_LIST, // done FILTER, // done LIMIT, // done INTERSECTION, @@ -355,6 +355,80 @@ namespace triagens { }; +// ----------------------------------------------------------------------------- +// --SECTION-- class EnumerateListPlan +// ----------------------------------------------------------------------------- + +//////////////////////////////////////////////////////////////////////////////// +/// @brief class EnumerateListPlan, derived from ExecutionPlan +//////////////////////////////////////////////////////////////////////////////// + + class EnumerateListPlan : public ExecutionPlan { + +//////////////////////////////////////////////////////////////////////////////// +/// @brief constructor +//////////////////////////////////////////////////////////////////////////////// + + public: + + EnumerateListPlan (VariableId varNumber, std::string varName) + : ExecutionPlan(), _varNumber(varNumber), _varName(varName) { + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief return the type of the node +//////////////////////////////////////////////////////////////////////////////// + + virtual NodeType getType () const { + return ENUMERATE_LIST; + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief return the type of the node as a string +//////////////////////////////////////////////////////////////////////////////// + + virtual std::string getTypeString () const { + return std::string("EnumerateListPlan"); + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief export to JSON +//////////////////////////////////////////////////////////////////////////////// + + virtual triagens::basics::Json toJson ( + TRI_memory_zone_t* zone = TRI_UNKNOWN_MEM_ZONE) const; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief clone execution plan recursively +//////////////////////////////////////////////////////////////////////////////// + + virtual ExecutionPlan* clone () const { + auto c = new EnumerateListPlan(_varNumber, _varName); + cloneDependencies(c); + return static_cast(c); + } + +//////////////////////////////////////////////////////////////////////////////// +/// @brief private data +//////////////////////////////////////////////////////////////////////////////// + + private: + +//////////////////////////////////////////////////////////////////////////////// +/// @brief _varNumber, input variable +//////////////////////////////////////////////////////////////////////////////// + + VariableId _varNumber; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief _varName, name of variable to read from +//////////////////////////////////////////////////////////////////////////////// + + std::string _varName; + + }; + + // ----------------------------------------------------------------------------- // --SECTION-- class LimitPlan // ----------------------------------------------------------------------------- @@ -729,13 +803,13 @@ namespace triagens { private: //////////////////////////////////////////////////////////////////////////////// -/// @brief input variable +/// @brief _varNumber, input variable //////////////////////////////////////////////////////////////////////////////// VariableId _varNumber; //////////////////////////////////////////////////////////////////////////////// -/// @brief _inVarName, name of variable to read from +/// @brief _varName, name of variable to read from //////////////////////////////////////////////////////////////////////////////// std::string _varName; diff --git a/arangod/Aql/Types.h b/arangod/Aql/Types.h index f47f6d5517..f9763f659b 100644 --- a/arangod/Aql/Types.h +++ b/arangod/Aql/Types.h @@ -240,7 +240,7 @@ namespace triagens { //////////////////////////////////////////////////////////////////////////////// triagens::basics::Json toJson (TRI_memory_zone_t* zone) const { - return triagens::basics::Json("hier wird ein Ausdruck stehen"); + return triagens::basics::Json(zone, _ast->toJson(zone)); } //////////////////////////////////////////////////////////////////////////////// From 14c465ec4d9ebc6343710b206fb3b7c8e040090b Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Wed, 30 Jul 2014 11:42:13 +0200 Subject: [PATCH 6/6] Fix signature of FilterPlan. --- arangod/Aql/ExecutionPlan.cpp | 4 ++-- arangod/Aql/ExecutionPlan.h | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/arangod/Aql/ExecutionPlan.cpp b/arangod/Aql/ExecutionPlan.cpp index 647fafa575..54706efc9f 100644 --- a/arangod/Aql/ExecutionPlan.cpp +++ b/arangod/Aql/ExecutionPlan.cpp @@ -272,8 +272,8 @@ Json FilterPlan::toJson (TRI_memory_zone_t* zone) const { } // Now put info about offset and limit in try { - json("attribute", Json(_attribute)) - ("value", Json(_value.copy())); + json("varName", Json(_varName)) + ("varNumber", Json(static_cast(_varNumber))); } catch (std::exception& e) { return Json(); diff --git a/arangod/Aql/ExecutionPlan.h b/arangod/Aql/ExecutionPlan.h index c53f515626..e93ba70bc8 100644 --- a/arangod/Aql/ExecutionPlan.h +++ b/arangod/Aql/ExecutionPlan.h @@ -692,8 +692,8 @@ namespace triagens { public: - FilterPlan (std::string attribute, triagens::basics::Json value) - : ExecutionPlan(), _attribute(attribute), _value(value) { + FilterPlan (VariableId varNumber, std::string varName) + : ExecutionPlan(), _varNumber(varNumber), _varName(varName) { } //////////////////////////////////////////////////////////////////////////////// @@ -724,7 +724,7 @@ namespace triagens { //////////////////////////////////////////////////////////////////////////////// virtual ExecutionPlan* clone () const { - auto c = new FilterPlan(_attribute, _value.copy()); + auto c = new FilterPlan(_varNumber, _varName); cloneDependencies(c); return static_cast(c); } @@ -735,8 +735,17 @@ namespace triagens { private: - std::string _attribute; - triagens::basics::Json _value; +//////////////////////////////////////////////////////////////////////////////// +/// @brief _varNumber, input variable +//////////////////////////////////////////////////////////////////////////////// + + VariableId _varNumber; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief _varName, name of variable to read from +//////////////////////////////////////////////////////////////////////////////// + + std::string _varName; };