1
0
Fork 0

Fix a bug in AQL COLLECT statement. Sorts out #1127.

This concerned every COLLECT statement, only the first group had access
to the values of the variables before the COLLECT statement.
This commit is contained in:
Max Neunhoeffer 2014-11-28 16:14:44 +01:00
parent faef09a576
commit 7664fc643c
1 changed files with 9 additions and 0 deletions

View File

@ -2602,6 +2602,15 @@ void AggregateBlock::emitGroup (AqlItemBlock const* cur,
AqlItemBlock* res,
size_t row) {
if (row > 0) {
// re-use already copied aqlvalues
for (RegisterId i = 0; i < cur->getNrRegs(); i++) {
res->setValue(row, i, res->getValue(0, i));
// Note: if this throws, then all values will be deleted
// properly since the first one is.
}
}
size_t i = 0;
for (auto it = _aggregateRegisters.begin(); it != _aggregateRegisters.end(); ++it) {
// FIXME: can throw: