mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'aql2' of https://github.com/triAGENS/ArangoDB into aql2
This commit is contained in:
commit
8bf495f9b5
|
@ -51,39 +51,62 @@ namespace triagens {
|
||||||
|
|
||||||
struct RangeInfoBound {
|
struct RangeInfoBound {
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief constructors
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
RangeInfoBound (AstNode const* bound, bool include)
|
RangeInfoBound (AstNode const* bound, bool include)
|
||||||
: _include(include), _undefined(false){
|
: _include(include), _undefined(false){
|
||||||
_bound = Json(TRI_UNKNOWN_MEM_ZONE, bound->toJson(TRI_UNKNOWN_MEM_ZONE, true));
|
_bound = Json(TRI_UNKNOWN_MEM_ZONE,
|
||||||
|
bound->toJson(TRI_UNKNOWN_MEM_ZONE, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
RangeInfoBound (basics::Json const& json)
|
RangeInfoBound (basics::Json const& json)
|
||||||
: _bound(Json(TRI_UNKNOWN_MEM_ZONE,
|
: _bound(Json(TRI_UNKNOWN_MEM_ZONE,
|
||||||
basics::JsonHelper::checkAndGetArrayValue(json.json(), "bound"),
|
basics::JsonHelper::checkAndGetArrayValue(json.json(), "bound"),
|
||||||
basics::Json::NOFREE).copy()),
|
basics::Json::NOFREE).copy()),
|
||||||
_include(basics::JsonHelper::checkAndGetBooleanValue(json.json(), "include")),
|
_include(basics::JsonHelper::checkAndGetBooleanValue(json.json(),
|
||||||
_undefined(false) {}
|
"include")),
|
||||||
|
_undefined(false) {
|
||||||
|
}
|
||||||
|
|
||||||
RangeInfoBound () : _include(false), _undefined(true) {}
|
RangeInfoBound () : _include(false), _undefined(true) {
|
||||||
|
}
|
||||||
~RangeInfoBound(){}
|
|
||||||
|
|
||||||
RangeInfoBound ( RangeInfoBound const& copy )
|
RangeInfoBound ( RangeInfoBound const& copy )
|
||||||
: _bound(copy._bound.copy()), _include(copy._include),
|
: _bound(copy._bound.copy()), _include(copy._include),
|
||||||
_undefined(copy._undefined) {}
|
_undefined(copy._undefined) {
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destructor
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
~RangeInfoBound(){}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief delete assignment
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
RangeInfoBound& operator= ( RangeInfoBound const& copy ) = delete;
|
RangeInfoBound& operator= ( RangeInfoBound const& copy ) = delete;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief explicit assign
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void assign ( basics::Json const& json ) {
|
void assign ( basics::Json const& json ) {
|
||||||
_bound = Json(TRI_UNKNOWN_MEM_ZONE,
|
_bound = Json(TRI_UNKNOWN_MEM_ZONE,
|
||||||
basics::JsonHelper::checkAndGetArrayValue(json.json(), "bound"),
|
basics::JsonHelper::checkAndGetArrayValue(json.json(), "bound"),
|
||||||
basics::Json::NOFREE).copy();
|
basics::Json::NOFREE).copy();
|
||||||
_include = basics::JsonHelper::checkAndGetBooleanValue(json.json(), "include");
|
_include = basics::JsonHelper::checkAndGetBooleanValue(json.json(),
|
||||||
|
"include");
|
||||||
_undefined = false;
|
_undefined = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void assign (AstNode const* bound, bool include) {
|
void assign (AstNode const* bound, bool include) {
|
||||||
_include = include;
|
_include = include;
|
||||||
_bound = Json(TRI_UNKNOWN_MEM_ZONE, bound->toJson(TRI_UNKNOWN_MEM_ZONE, true));
|
_bound = Json(TRI_UNKNOWN_MEM_ZONE,
|
||||||
|
bound->toJson(TRI_UNKNOWN_MEM_ZONE, true));
|
||||||
_undefined = false;
|
_undefined = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,6 +116,10 @@ namespace triagens {
|
||||||
_undefined = false;
|
_undefined = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief toJson
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Json toJson () const {
|
Json toJson () const {
|
||||||
Json item(basics::Json::Array);
|
Json item(basics::Json::Array);
|
||||||
item("bound", Json(TRI_UNKNOWN_MEM_ZONE,
|
item("bound", Json(TRI_UNKNOWN_MEM_ZONE,
|
||||||
|
@ -101,7 +128,11 @@ namespace triagens {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
// doesn't work with unbounded above and below RangeInfos
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief toIndexOperator, doesn't work with unbounded above and below
|
||||||
|
/// RangeInfos
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
TRI_index_operator_t* toIndexOperator (bool high, Json parameters,
|
TRI_index_operator_t* toIndexOperator (bool high, Json parameters,
|
||||||
TRI_shaper_t* shaper) const {
|
TRI_shaper_t* shaper) const {
|
||||||
TRI_index_operator_type_e op;
|
TRI_index_operator_type_e op;
|
||||||
|
@ -128,8 +159,22 @@ namespace triagens {
|
||||||
shaper, NULL, nr, NULL);
|
shaper, NULL, nr, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief _bound as Json
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Json _bound;
|
Json _bound;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief _include, flag indicating whether or not bound is included
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool _include;
|
bool _include;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief _undefined, if this is true the bound is undefined
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool _undefined;
|
bool _undefined;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -4034,7 +4034,7 @@ function ahuacatlFunctionsTestSuite () {
|
||||||
// allow some tolerance for the time diff
|
// allow some tolerance for the time diff
|
||||||
// TODO: we're currently sleeping twice because we're testing
|
// TODO: we're currently sleeping twice because we're testing
|
||||||
// old AQL against new AQL. when we're done comparing, remove the 2 *
|
// old AQL against new AQL. when we're done comparing, remove the 2 *
|
||||||
assertTrue(diff >= 1.8 && diff <= 2.5);
|
assertTrue(diff >= 1.8 && diff <= 2.5, "SLEEP(2) did not take between 1.8 and 2.5 seconds");
|
||||||
},
|
},
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue