Skip to content

Commit

Permalink
MONDRIAN: Oops!
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 3524]
  • Loading branch information
julianhyde committed May 4, 2005
1 parent c56f118 commit 1bf9393
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/main/mondrian/olap/fun/FunTableImpl.java
Expand Up @@ -192,18 +192,36 @@ private static Exp convert_(Exp fromExp, int to) {
return null;
}
case Category.Numeric | Category.Constant:
case Category.Integer | Category.Constant:
switch (to) {
case Category.Value:
case Category.Integer:
case Category.Numeric:
return fromExp;
default:
return null;
}
case Category.Integer:
switch (to) {
case Category.Value:
case Category.Numeric:
return fromExp;
case Category.Numeric | Category.Constant:
case Category.Integer | Category.Constant:
return new FunCall(
"_Value",
Syntax.Function,
new Exp[] {fromExp});
default:
return null;
}
case Category.Numeric:
switch (to) {
case Category.Value:
case Category.Integer:
return fromExp;
case Category.Numeric | Category.Constant:
case Category.Integer | Category.Constant:
return new FunCall(
"_Value",
Syntax.Function,
Expand Down Expand Up @@ -329,6 +347,13 @@ static boolean canConvert(Exp fromExp, int to, int[] conversionCount) {
to == Category.Numeric;
case Category.Numeric:
return to == Category.Value ||
to == Category.Integer ||
to == (Category.Integer | Category.Constant) ||
to == (Category.Numeric | Category.Constant);
case Category.Integer:
return to == Category.Value ||
to == (Category.Integer | Category.Constant) ||
to == Category.Numeric ||
to == (Category.Numeric | Category.Constant);
case Category.Set:
return false;
Expand Down Expand Up @@ -364,7 +389,7 @@ public FunDef getDef(FunCall call, Validator resolver) {
resolvers = emptyResolverArray;
}

int[] conversionCount = new int[1];
int[] conversionCount = new int[] {0};
int minConversions = Integer.MAX_VALUE;
int matchCount = 0;
FunDef matchDef = null;
Expand Down

0 comments on commit 1bf9393

Please sign in to comment.