mirror of https://github.com/citusdata/citus.git
Merge pull request #1851 from citusdata/fix_annoying_bug
Fix bug related to incrementing an index not properlypull/1857/head
commit
3ceb15ccdf
|
@ -745,11 +745,14 @@ GenerateCommonEquivalence(List *attributeEquivalenceList,
|
||||||
addedEquivalenceIds = bms_add_member(addedEquivalenceIds,
|
addedEquivalenceIds = bms_add_member(addedEquivalenceIds,
|
||||||
firstEquivalenceClass->equivalenceId);
|
firstEquivalenceClass->equivalenceId);
|
||||||
|
|
||||||
for (; equivalenceClassIndex < equivalenceListSize; ++equivalenceClassIndex)
|
while (equivalenceClassIndex < equivalenceListSize)
|
||||||
{
|
{
|
||||||
AttributeEquivalenceClass *currentEquivalenceClass =
|
AttributeEquivalenceClass *currentEquivalenceClass = NULL;
|
||||||
list_nth(attributeEquivalenceList, equivalenceClassIndex);
|
|
||||||
ListCell *equivalenceMemberCell = NULL;
|
ListCell *equivalenceMemberCell = NULL;
|
||||||
|
bool restartLoop = false;
|
||||||
|
|
||||||
|
currentEquivalenceClass = list_nth(attributeEquivalenceList,
|
||||||
|
equivalenceClassIndex);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is an optimization. If we already added the same equivalence class,
|
* This is an optimization. If we already added the same equivalence class,
|
||||||
|
@ -758,6 +761,8 @@ GenerateCommonEquivalence(List *attributeEquivalenceList,
|
||||||
*/
|
*/
|
||||||
if (bms_is_member(currentEquivalenceClass->equivalenceId, addedEquivalenceIds))
|
if (bms_is_member(currentEquivalenceClass->equivalenceId, addedEquivalenceIds))
|
||||||
{
|
{
|
||||||
|
equivalenceClassIndex++;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -781,11 +786,20 @@ GenerateCommonEquivalence(List *attributeEquivalenceList,
|
||||||
* But, we should somehow restart from the beginning to test that
|
* But, we should somehow restart from the beginning to test that
|
||||||
* whether the already skipped ones are equal or not.
|
* whether the already skipped ones are equal or not.
|
||||||
*/
|
*/
|
||||||
equivalenceClassIndex = 0;
|
restartLoop = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (restartLoop)
|
||||||
|
{
|
||||||
|
equivalenceClassIndex = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
++equivalenceClassIndex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return commonEquivalenceClass;
|
return commonEquivalenceClass;
|
||||||
|
|
Loading…
Reference in New Issue