Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MONDRIAN: Fix bug MONDRIAN-560, "StrToMember function doesn't use
IgnoreInvalidMembers option". (Basic fix contributed by Anton Nitikin.) Also fix StrToTuple and StrToSet. Break out StrToMemberFunDef as a top-level class. Rationalize how we figure out whether the schema is being loaded, and therefore we should use IgnoreInvalidMembers as opposed to IgnoreInvalidMembersDuringQuery. [git-p4: depot-paths = "//open/mondrian-release/3.2/": change = 13595]
- Loading branch information
1 parent
80b8dc2
commit 69f3df6
Showing
12 changed files
with
314 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
// $Id$ | ||
// This software is subject to the terms of the Eclipse Public License v1.0 | ||
// Agreement, available at the following URL: | ||
// http://www.eclipse.org/legal/epl-v10.html. | ||
// Copyright (C) 2010-2010 Julian Hyde | ||
// All Rights Reserved. | ||
// You must accept the terms of that agreement to use this software. | ||
*/ | ||
package mondrian.olap.fun; | ||
|
||
import mondrian.calc.*; | ||
import mondrian.calc.impl.AbstractMemberCalc; | ||
import mondrian.mdx.ResolvedFunCall; | ||
import mondrian.olap.*; | ||
|
||
/** | ||
* Definition of the <code>StrToMember</code> MDX function. | ||
* | ||
* <p>Syntax: | ||
* <blockquote><code>StrToMember(<String Expression>) | ||
* </code></blockquote> | ||
* | ||
* @version $Id$ | ||
*/ | ||
class StrToMemberFunDef extends FunDefBase { | ||
public static final FunDef INSTANCE = new StrToMemberFunDef(); | ||
|
||
private StrToMemberFunDef() { | ||
super( | ||
"StrToMember", | ||
"Returns a member from a unique name String in MDX format.", | ||
"fmS"); | ||
} | ||
|
||
public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) { | ||
final StringCalc memberNameCalc = | ||
compiler.compileString(call.getArg(0)); | ||
return new AbstractMemberCalc(call, new Calc[] {memberNameCalc}) { | ||
public Member evaluateMember(Evaluator evaluator) { | ||
String memberName = | ||
memberNameCalc.evaluateString(evaluator); | ||
return parseMember(evaluator, memberName, null); | ||
} | ||
}; | ||
} | ||
} | ||
|
||
// End StrToMemberFunDef.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.