Skip to content

Commit

Permalink
MONDRIAN: fixed NullPointerException in HighCardinality code when axi…
Browse files Browse the repository at this point in the history
…s returned an empty result.

[git-p4: depot-paths = "//open/mondrian/": change = 12152]
  • Loading branch information
Will Gorman committed Dec 22, 2008
1 parent 8dd1f74 commit d107217
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/mondrian/rolap/Target.java
Expand Up @@ -222,8 +222,8 @@ public RolapMember get(final int idx) {
}

if (idx == 0) {
this.firstMemberAssigned = true;
this.first = list.get(index);
this.firstMemberAssigned = true;
return this.first;
} else {
return list.get(index);
Expand Down
14 changes: 14 additions & 0 deletions testsrc/main/mondrian/rolap/NonEmptyTest.java
Expand Up @@ -3404,6 +3404,20 @@ public void testNonEmptyLevelMembers() {
}
}

public void testNonEmptyResults() {
// This unit test was failing with a NullPointerException in JPivot
// after the highcardinality feature was added, I've included it
// here to make sure it continues to work.
assertQueryReturns(
"select NON EMPTY {[Measures].[Unit Sales], [Measures].[Store Cost]} ON columns, "
+ "NON EMPTY Filter([Product].[Brand Name].Members, ([Measures].[Unit Sales] > 100000.0)) ON rows "
+ "from [Sales] where [Time].[1997]",
fold("Axis #0:\n" +
"{[Time].[1997]}\n" +
"Axis #1:\n" +
"Axis #2:\n"));
}

/**
* Make sure the mdx runs correctly and not in native mode.
*
Expand Down

0 comments on commit d107217

Please sign in to comment.