summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/interval.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2013-11-15 11:58:04 -0500
committerBenety Goh <benety@mongodb.com>2013-11-19 10:32:19 -0500
commit31e272af4f900964997af2ce8b2e44013ea40187 (patch)
tree6890a31e4821b1ddef39230bf6dc31b6c1f0d1ee /src/mongo/db/query/interval.cpp
parent8b98dc053dae6a0db11dfb52d4a86b0274403d52 (diff)
downloadmongo-31e272af4f900964997af2ce8b2e44013ea40187.tar.gz
SERVER-11725 fixed interval comparison for INTERVAL_PRECEDES_COULD_UNION
Diffstat (limited to 'src/mongo/db/query/interval.cpp')
-rw-r--r--src/mongo/db/query/interval.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/query/interval.cpp b/src/mongo/db/query/interval.cpp
index 6c80632c4a5..49b75d0c250 100644
--- a/src/mongo/db/query/interval.cpp
+++ b/src/mongo/db/query/interval.cpp
@@ -150,7 +150,9 @@ namespace mongo {
//
if (precedes(*this, other)) {
- if (0 == end.woCompare(other.start, false)) {
+ // It's not possible for both endInclusive and other.startInclusive to be true because
+ // the bounds would intersect. Refer to section on "Intersect cases" above.
+ if ((endInclusive || other.startInclusive) && 0 == end.woCompare(other.start, false)) {
return INTERVAL_PRECEDES_COULD_UNION;
}
return INTERVAL_PRECEDES;