1
0
Fork 0

Merge branch 'aql2' of https://github.com/triAGENS/ArangoDB into aql2

This commit is contained in:
Jan Steemann 2014-08-11 14:54:25 +02:00
commit a2061f66a3
3 changed files with 54 additions and 11 deletions

View File

@ -114,12 +114,6 @@ void ExecutionBlock::staticAnalysis (ExecutionBlock* super) {
sq->getSubquery()->staticAnalysis(s);
}
v->reset();
// Now print the result:
for (auto it : _varOverview->varInfo) {
std::cout << "Variable ID:" << it.first << " RegisterId:"
<< it.second.registerId << " Depth:" << it.second.depth
<< std::endl;
}
}
// Local Variables:

View File

@ -1013,6 +1013,58 @@ namespace triagens {
return res;
}
////////////////////////////////////////////////////////////////////////////////
// skip between atLeast and atMost, returns the number actually skipped . . .
// will only return less than atLeast if there aren't atLeast many
// things to skip overall.
////////////////////////////////////////////////////////////////////////////////
size_t skipSome (size_t atLeast, size_t atMost) {
size_t skipped = 0;
if (_done) {
return skipped;
}
while (skipped < atLeast) {
if (_buffer.empty()) {
if (! getBlock(DefaultBatchSize, DefaultBatchSize)) {
_done = true;
return skipped;
}
_pos = 0; // this is in the first block
_posInAllDocs = 0; // Note that we know _allDocs.size() > 0,
// otherwise _done would be true already
}
// if we get here, then _buffer.front() exists
AqlItemBlock* cur = _buffer.front();
if (atMost > _documents.size() - _posInAllDocs) {
skipped += _documents.size() - _posInAllDocs;
_posInAllDocs = 0;
// fetch more documents into our buffer
if (! moreDocuments()) {
// nothing more to read, re-initialize fetching of documents
initDocuments();
if (++_pos >= cur->size()) {
_buffer.pop_front();
delete cur;
_pos = 0;
}
}
}
else {
skipped = atMost;
_posInAllDocs += atMost;
}
}
return skipped;
}
private:
////////////////////////////////////////////////////////////////////////////////
@ -1244,7 +1296,7 @@ namespace triagens {
if (_buffer.empty()) {
if (! getBlock(DefaultBatchSize, DefaultBatchSize)){
_done = true;
break;
return skipped;
}
_pos = 0;
}
@ -1426,9 +1478,6 @@ namespace triagens {
auto en = static_cast<CalculationNode const*>(getPlanNode());
std::unordered_set<Variable*> inVars = _expression->variables();
for (auto it : inVars) {
std::cout << it->name << ":" << it->id << std::endl;
}
for (auto it = inVars.begin(); it != inVars.end(); ++it) {
_inVars.push_back(*it);

View File

@ -582,7 +582,7 @@ namespace triagens {
else {
c._json = nullptr;
}
c._autofree = AUTOFREE;
c._autofree = autofree;
return c;
}