mirror of https://gitee.com/bigwinds/arangodb
Copy document collection in slice and splice for AqlItemBlocks
This commit is contained in:
parent
135cce3250
commit
8d1ce3baf2
|
@ -125,6 +125,18 @@ AqlItemBlock* AqlItemBlock::splice (std::vector<AqlItemBlock*>& blocks) {
|
|||
auto res = new AqlItemBlock(totalSize, nrRegs);
|
||||
size_t pos = 0;
|
||||
for (it = blocks.begin(); it != blocks.end(); ++it) {
|
||||
if (it == blocks.begin()) {
|
||||
for (RegisterId col = 0; col < nrRegs; ++col) {
|
||||
res->getDocumentCollections().at(col)
|
||||
= (*it)->getDocumentCollections().at(col);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (RegisterId col = 0; col < nrRegs; ++col) {
|
||||
TRI_ASSERT(res->getDocumentCollections().at(col) ==
|
||||
(*it)->getDocumentCollections().at(col));
|
||||
}
|
||||
}
|
||||
for (size_t row = 0; row < (*it)->size(); ++row) {
|
||||
for (RegisterId col = 0; col < nrRegs; ++col) {
|
||||
res->setValue(pos+row, col, (*it)->getValue(row, col));
|
||||
|
|
|
@ -430,6 +430,9 @@ namespace triagens {
|
|||
|
||||
std::unordered_map<AqlValue, AqlValue> cache;
|
||||
auto res = new AqlItemBlock(to - from, _nrRegs);
|
||||
for (RegisterId col = 0; col < _nrRegs; col++) {
|
||||
res->_docColls[col] = _docColls[col];
|
||||
}
|
||||
for (size_t row = from; row < to; row++) {
|
||||
for (RegisterId col = 0; col < _nrRegs; col++) {
|
||||
AqlValue& a(_data[row * _nrRegs + col]);
|
||||
|
@ -459,6 +462,9 @@ namespace triagens {
|
|||
|
||||
std::unordered_map<AqlValue, AqlValue> cache;
|
||||
auto res = new AqlItemBlock(to - from, _nrRegs);
|
||||
for (RegisterId col = 0; col < _nrRegs; col++) {
|
||||
res->_docColls[col] = _docColls[col];
|
||||
}
|
||||
for (size_t row = from; row < to; row++) {
|
||||
for (RegisterId col = 0; col < _nrRegs; col++) {
|
||||
AqlValue& a(_data[chosen[row] * _nrRegs + col]);
|
||||
|
|
Loading…
Reference in New Issue