Skip to content

Commit

Permalink
MONDRIAN
Browse files Browse the repository at this point in the history
       If the Time dimension had attribute hasAll="false" and a range such as
       outside dimension range
           ([Time].CurrentMember : [Time].CurrentMember.Lag(6000.0)
       within a given year
           ([Time].CurrentMember : [Time].CurrentMember.Lag(3.0)
       then one gets the same answer as hasAll="true", but if the query
       spans a year boundary
           ([Time].CurrentMember : [Time].CurrentMember.Lag(60.0)
       then hasAll="false" fails.

[git-p4: depot-paths = "//open/mondrian/": change = 5019]
  • Loading branch information
Richard Emberson committed Jan 10, 2006
1 parent 89a9e1e commit ceec0a1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/mondrian/rolap/SmartMemberReader.java
Expand Up @@ -361,6 +361,27 @@ public int compare(RolapMember m1,
// including case where both parents are null
if (siblingsAreEqual) {
return 0;
} else if (m1.getParentMember() == null) {
// at this point we know that both parent members are null.
int pos1 = -1, pos2 = -1;
List siblingList = getRootMembers();
for (int i = 0, n = siblingList.size(); i < n; i++) {
RolapMember child = (RolapMember) siblingList.get(i);
if (child == m1) {
pos1 = i;
}
if (child == m2) {
pos2 = i;
}
}
if (pos1 == -1) {
throw Util.newInternal(m1 + " not found among siblings");
}
if (pos2 == -1) {
throw Util.newInternal(m2 + " not found among siblings");
}
Util.assertTrue(pos1 != pos2);
return pos1 < pos2 ? -1 : 1;
} else {
List children = new ArrayList();
getMemberChildren((RolapMember) m1.getParentMember(), children);
Expand Down

0 comments on commit ceec0a1

Please sign in to comment.