mirror of https://gitee.com/bigwinds/arangodb
cleaning up and readded toJsonHelper method for IndexRangeNode.
This commit is contained in:
parent
4ba4ec4523
commit
3987067339
|
@ -485,11 +485,11 @@ void IndexRangeNode::toJsonHelper (triagens::basics::Json& nodes,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now put info about vocbase and cid in there
|
// Now put info about vocbase and cid in there
|
||||||
/*json("database", Json(_vocbase->_name))
|
json("database", Json(_vocbase->_name))
|
||||||
("collection", Json(_collection->name))
|
("collection", Json(_collection->name))
|
||||||
("outVariable", _outVariable->toJson())
|
("outVariable", _outVariable->toJson())
|
||||||
("index", _index->index()->json(_index->index()))
|
("index", _index->json(_index))
|
||||||
("ranges", ranges);*/
|
("ranges", ranges);
|
||||||
|
|
||||||
// And add it:
|
// And add it:
|
||||||
nodes(json);
|
nodes(json);
|
||||||
|
|
|
@ -93,14 +93,16 @@ void RangesInfo::insert (std::string var, std::string name,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto oldRange = find(var, name); //TODO improve, using oldMap
|
auto it = oldMap->find(name);
|
||||||
|
|
||||||
if (oldRange == nullptr) {
|
if (it == oldMap->end()) {
|
||||||
// TODO add exception . . .
|
// TODO add exception . . .
|
||||||
oldMap->insert(make_pair(name, newRange));
|
oldMap->insert(make_pair(name, newRange));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto oldRange = (*it).second;
|
||||||
|
|
||||||
if (!oldRange->_valid) { // intersection of the empty set with any set is empty!
|
if (!oldRange->_valid) { // intersection of the empty set with any set is empty!
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,21 +29,10 @@
|
||||||
#define ARANGODB_AQL_RANGE_INFO_H 1
|
#define ARANGODB_AQL_RANGE_INFO_H 1
|
||||||
|
|
||||||
#include <Basics/Common.h>
|
#include <Basics/Common.h>
|
||||||
|
|
||||||
#include <Basics/JsonHelper.h>
|
#include <Basics/JsonHelper.h>
|
||||||
|
|
||||||
#include "Aql/AstNode.h"
|
#include "Aql/AstNode.h"
|
||||||
|
|
||||||
//#include <VocBase/voc-types.h>
|
|
||||||
//#include <VocBase/vocbase.h>
|
|
||||||
//#include "Aql/Expression.h"
|
|
||||||
//#include "Aql/Index.h"
|
|
||||||
//#include "Aql/ModificationOptions.h"
|
|
||||||
//#include "Aql/Variable.h"
|
|
||||||
//#include "Aql/Types.h"
|
|
||||||
//#include "Aql/WalkerWorker.h"
|
|
||||||
//#include "Aql/Query.h"
|
|
||||||
|
|
||||||
#include "lib/Basics/json-utilities.h"
|
#include "lib/Basics/json-utilities.h"
|
||||||
|
|
||||||
using Json = triagens::basics::Json;
|
using Json = triagens::basics::Json;
|
||||||
|
@ -131,7 +120,7 @@ namespace triagens {
|
||||||
}
|
}
|
||||||
|
|
||||||
// is the range a unique value (i.e. something like x<=1 and x>=1)
|
// is the range a unique value (i.e. something like x<=1 and x>=1)
|
||||||
bool is1ValueRangeInfo () { //i.e. the range only covers single value
|
bool is1ValueRangeInfo () {
|
||||||
return _valid && _low != nullptr && _high != nullptr &&
|
return _valid && _low != nullptr && _high != nullptr &&
|
||||||
TRI_CheckSameValueJson(_low->_bound.json(), _high->_bound.json())
|
TRI_CheckSameValueJson(_low->_bound.json(), _high->_bound.json())
|
||||||
&& _low->_include && _high->_include;
|
&& _low->_include && _high->_include;
|
||||||
|
|
Loading…
Reference in New Issue