Skip to content

Commit

Permalink
MONDRIAN: Disable pre-condition that the list of parent members passe…
Browse files Browse the repository at this point in the history
…d to a call to SmartMemberReader.readMemberChildren is already sorted; and add a test which is known to breach that pre-condition.

[git-p4: depot-paths = "//open/mondrian/": change = 2108]
  • Loading branch information
julianhyde committed Jun 10, 2004
1 parent 3a1f6c9 commit 3042001
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/mondrian/rolap/SmartMemberReader.java
Expand Up @@ -294,10 +294,18 @@ private double getBenefit()
*
* @param result Children are written here, in order
* @param members Members whose children to read
* @pre isSorted(members)
**/
private void readMemberChildren(List members, List result) {
Util.assertPrecondition(isSorted(members), "isSorted(members)");
if (false) {
// Pre-condition disabled. It makes sense to have the pre-
// condition, because lists of parent members are typically
// sorted by construction, and we should be able to exploit this
// when constructing the (significantly larger) set of children.
// But currently BasicQueryTest.testBasketAnalysis() fails this
// assert, and I haven't had time to figure out why.
// -- jhyde, 2004/6/10.
Util.assertPrecondition(isSorted(members), "isSorted(members)");
}
ArrayList children = new ArrayList();
source.getMemberChildren(members, children);
// Put them in a temporary hash table first. Register them later, when
Expand Down
9 changes: 9 additions & 0 deletions testsrc/main/mondrian/test/BasicQueryTest.java
Expand Up @@ -2653,6 +2653,15 @@ public void testBasketAnalysis() {
"Row #16: 260,178.24" + nl);
}

/**
* Flushes the cache then runs {@link #testBasketAnalysis}, because this
* test has been known to fail when run standalone.
*/
public void testBasketAnalysisAfterFlush() {
CachePool.instance().flush();
testBasketAnalysis();
}

/**
* <b>How Can I Perform Complex String Comparisons?</b>
*
Expand Down

0 comments on commit 3042001

Please sign in to comment.