Skip to content

Commit

Permalink
MONDRIAN: Fix a couple of issues similar to bug 2150537.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 11680]
  • Loading branch information
julianhyde committed Oct 7, 2008
1 parent 0bd34d7 commit 0635649
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/main/mondrian/olap/fun/OrderFunDef.java
Expand Up @@ -50,8 +50,7 @@ public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {
final MemberCalc[] calcs = (MemberCalc[]) memberValueCalc.getCalcs();
for (MemberCalc memberCalc : calcs) {
if (memberCalc instanceof ConstantCalc &&
!listCalc.dependsOn(
memberCalc.getType().getHierarchy().getDimension())) {
!listCalc.dependsOn(memberCalc.getType().getDimension())) {
constantList.add(memberCalc);
} else {
variableList.add(memberCalc);
Expand Down
6 changes: 2 additions & 4 deletions src/main/mondrian/olap/fun/ParallelPeriodFunDef.java
Expand Up @@ -64,8 +64,7 @@ public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {
memberCalc = compiler.compileMember(args[2]);
break;
case 1:
final Dimension dimension =
args[0].getType().getHierarchy().getDimension();
final Dimension dimension = args[0].getType().getDimension();
memberCalc = new DimensionCurrentMemberCalc(dimension);
break;
default:
Expand All @@ -76,8 +75,7 @@ public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {
throw MondrianResource.instance().
NoTimeDimensionInCube.ex(getName());
}
memberCalc = new DimensionCurrentMemberCalc(
timeDimension);
memberCalc = new DimensionCurrentMemberCalc(timeDimension);
break;
}

Expand Down
3 changes: 3 additions & 0 deletions testsrc/main/mondrian/olap/fun/FunctionTest.java
Expand Up @@ -4523,6 +4523,9 @@ public void testLastPeriods() {
}

public void testParallelPeriod() {
getTestContext().assertSetExprDependsOn(
"parallelperiod([Time].CurrentMember)", "Xxx");

assertAxisReturns("parallelperiod([Time].[Quarter], 1, [Time].[1998].[Q1])",
"[Time].[1997].[Q4]");

Expand Down

0 comments on commit 0635649

Please sign in to comment.