mirror of https://gitee.com/bigwinds/arangodb
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:
parent
faef09a576
commit
7664fc643c
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue