mirror of https://gitee.com/bigwinds/arangodb
Fix bug in AssocMulti lookupByKeyContinue if batchSize==1.
This commit is contained in:
parent
7374fb7dce
commit
c87575ce33
|
@ -668,9 +668,29 @@ namespace triagens {
|
||||||
uint64_t hashByElm;
|
uint64_t hashByElm;
|
||||||
IndexType i = findElementPlace(b, element, true, hashByElm);
|
IndexType i = findElementPlace(b, element, true, hashByElm);
|
||||||
if (b._table[i].ptr == nullptr) {
|
if (b._table[i].ptr == nullptr) {
|
||||||
|
// This can only happen if the element was the first in its doubly
|
||||||
|
// linked list (after all, the caller guaranteed that element was
|
||||||
|
// the last of a previous lookup). To cover this case, we have to
|
||||||
|
// look in the position given by the hashByKey:
|
||||||
|
i = hashToIndex(hashByKey) % b._nrAlloc;
|
||||||
|
|
||||||
|
// Now find the first slot with an entry with the same key
|
||||||
|
// that is the start of a linked list, or a free slot:
|
||||||
|
while (b._table[i].ptr != nullptr &&
|
||||||
|
(b._table[i].prev != INVALID_INDEX ||
|
||||||
|
b._table[i].hashCache != hashByKey ||
|
||||||
|
! _isEqualElementElementByKey(element, b._table[i].ptr))) {
|
||||||
|
i = incr(b, i);
|
||||||
|
#ifdef TRI_INTERNAL_STATS
|
||||||
|
_nrProbes++;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (b._table[i].ptr == nullptr) {
|
||||||
|
// This cannot really happen, but we handle it gracefully anyway
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
// compute the hash
|
}
|
||||||
|
|
||||||
// continue search of the table
|
// continue search of the table
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
Loading…
Reference in New Issue