mirror of https://gitee.com/bigwinds/arangodb
proper difference of or conditions with dynamic bounds.
This commit is contained in:
parent
12eb461181
commit
f96bc93512
|
@ -701,12 +701,30 @@ RangeInfo* RangeInfoMapVec::differenceRangeInfo (RangeInfo* newRi) {
|
||||||
if (contained == -1) {
|
if (contained == -1) {
|
||||||
// oldRi is a subset of newRi, erase the old RI
|
// oldRi is a subset of newRi, erase the old RI
|
||||||
// continuing finding the difference of the new one and existing RIs
|
// continuing finding the difference of the new one and existing RIs
|
||||||
|
if (oldRi->isConstant()) {
|
||||||
rim->erase(oldRi);
|
rim->erase(oldRi);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// unassign _lowConst and _highConst
|
||||||
|
RangeInfoBound rib;
|
||||||
|
oldRi->_lowConst.assign(rib);
|
||||||
|
oldRi->_highConst.assign(rib);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (contained == 1) {
|
else if (contained == 1) {
|
||||||
// newRi is a subset of oldRi, disregard new
|
// newRi is a subset of oldRi, disregard new
|
||||||
|
if (newRi->isConstant()) {
|
||||||
return nullptr; // i.e. do nothing on return of this function
|
return nullptr; // i.e. do nothing on return of this function
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
|
// unassign _lowConst and _highConst
|
||||||
|
RangeInfoBound rib;
|
||||||
|
newRi->_lowConst.assign(rib);
|
||||||
|
newRi->_highConst.assign(rib);
|
||||||
|
return newRi;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
// oldRi and newRi have non-empty intersection
|
// oldRi and newRi have non-empty intersection
|
||||||
int LoLo = CompareRangeInfoBound(oldRi->_lowConst, newRi->_lowConst, -1);
|
int LoLo = CompareRangeInfoBound(oldRi->_lowConst, newRi->_lowConst, -1);
|
||||||
if (LoLo == 1) { // replace low bound of new with high bound of old
|
if (LoLo == 1) { // replace low bound of new with high bound of old
|
||||||
|
@ -738,13 +756,29 @@ static RangeInfo* differenceIndexOrAndRangeInfo (
|
||||||
if (contained == -1) {
|
if (contained == -1) {
|
||||||
// oldRi is a subset of newRi, erase the old RI
|
// oldRi is a subset of newRi, erase the old RI
|
||||||
// continuing finding the difference of the new one and existing RIs
|
// continuing finding the difference of the new one and existing RIs
|
||||||
|
if (oldRi.isConstant()) {
|
||||||
oldRi.invalidate();
|
oldRi.invalidate();
|
||||||
// FIXME want to do andCond.erase(andCond.begin()+i) but can't
|
}
|
||||||
|
else {
|
||||||
|
// unassign _lowConst and _highConst
|
||||||
|
RangeInfoBound rib;
|
||||||
|
oldRi._lowConst.assign(rib);
|
||||||
|
oldRi._highConst.assign(rib);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (contained == 1) {
|
else if (contained == 1) {
|
||||||
// newRi is a subset of oldRi, disregard new
|
// newRi is a subset of oldRi, disregard new
|
||||||
|
if (newRi->isConstant()) {
|
||||||
return nullptr; // i.e. do nothing on return of this function
|
return nullptr; // i.e. do nothing on return of this function
|
||||||
} else {
|
} else {
|
||||||
|
// unassign _lowConst and _highConst
|
||||||
|
RangeInfoBound rib;
|
||||||
|
newRi->_lowConst.assign(rib);
|
||||||
|
newRi->_highConst.assign(rib);
|
||||||
|
return newRi;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
// oldRi and newRi have non-empty intersection
|
// oldRi and newRi have non-empty intersection
|
||||||
int LoLo = CompareRangeInfoBound(oldRi._lowConst, newRi->_lowConst, -1);
|
int LoLo = CompareRangeInfoBound(oldRi._lowConst, newRi->_lowConst, -1);
|
||||||
if (LoLo == 1) { // replace low bound of new with high bound of old
|
if (LoLo == 1) { // replace low bound of new with high bound of old
|
||||||
|
|
|
@ -159,7 +159,6 @@ namespace triagens {
|
||||||
}
|
}
|
||||||
|
|
||||||
void assign (RangeInfoBound const& copy) {
|
void assign (RangeInfoBound const& copy) {
|
||||||
_defined = false;
|
|
||||||
_bound = copy._bound.copy();
|
_bound = copy._bound.copy();
|
||||||
_include = copy._include;
|
_include = copy._include;
|
||||||
_isConstant = copy._isConstant;
|
_isConstant = copy._isConstant;
|
||||||
|
|
Loading…
Reference in New Issue