1
0
Fork 0

cleaning up and readded toJsonHelper method for IndexRangeNode.

This commit is contained in:
James 2014-08-22 10:55:51 +02:00
parent 4ba4ec4523
commit 3987067339
3 changed files with 8 additions and 17 deletions

View File

@ -485,11 +485,11 @@ void IndexRangeNode::toJsonHelper (triagens::basics::Json& nodes,
}
// Now put info about vocbase and cid in there
/*json("database", Json(_vocbase->_name))
json("database", Json(_vocbase->_name))
("collection", Json(_collection->name))
("outVariable", _outVariable->toJson())
("index", _index->index()->json(_index->index()))
("ranges", ranges);*/
("index", _index->json(_index))
("ranges", ranges);
// And add it:
nodes(json);

View File

@ -93,14 +93,16 @@ void RangesInfo::insert (std::string var, std::string name,
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 . . .
oldMap->insert(make_pair(name, newRange));
return;
}
auto oldRange = (*it).second;
if (!oldRange->_valid) { // intersection of the empty set with any set is empty!
return;
}

View File

@ -29,21 +29,10 @@
#define ARANGODB_AQL_RANGE_INFO_H 1
#include <Basics/Common.h>
#include <Basics/JsonHelper.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"
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)
bool is1ValueRangeInfo () { //i.e. the range only covers single value
bool is1ValueRangeInfo () {
return _valid && _low != nullptr && _high != nullptr &&
TRI_CheckSameValueJson(_low->_bound.json(), _high->_bound.json())
&& _low->_include && _high->_include;