Author: shawkins
Date: 2009-09-21 16:50:45 -0400 (Mon, 21 Sep 2009)
New Revision: 1442
Modified:
branches/6.2.x/engine/src/main/java/com/metamatrix/query/resolver/util/ResolverUtil.java
branches/6.2.x/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java
Log:
TEIID-847 fix to use comparison to detect biginteger equality
Modified:
branches/6.2.x/engine/src/main/java/com/metamatrix/query/resolver/util/ResolverUtil.java
===================================================================
---
branches/6.2.x/engine/src/main/java/com/metamatrix/query/resolver/util/ResolverUtil.java 2009-09-21
20:37:54 UTC (rev 1441)
+++
branches/6.2.x/engine/src/main/java/com/metamatrix/query/resolver/util/ResolverUtil.java 2009-09-21
20:50:45 UTC (rev 1442)
@@ -240,7 +240,7 @@
Constant reverse = getProperlyTypedConstant(result.getValue(),
constant.getType());
- if (constant.equals(reverse)) {
+ if (((Comparable)constant.getValue()).compareTo(reverse.getValue()) == 0) {
return result;
}
} catch (QueryResolverException e) {
Modified:
branches/6.2.x/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java
===================================================================
---
branches/6.2.x/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java 2009-09-21
20:37:54 UTC (rev 1441)
+++
branches/6.2.x/engine/src/test/java/com/metamatrix/query/rewriter/TestQueryRewriter.java 2009-09-21
20:50:45 UTC (rev 1442)
@@ -2276,4 +2276,10 @@
helpTestRewriteCriteria(original, expected);
}
+ @Test public void testRewriteLong() {
+ String original = "convert(BQT1.SmallA.LongNum, bigdecimal) =
'22.0'"; //$NON-NLS-1$
+ CompareCriteria crit = new CompareCriteria(new
ElementSymbol("BQT1.SmallA.LongNum"), CompareCriteria.EQ, new Constant(new
Long(22))); //$NON-NLS-1$
+ helpTestRewriteCriteria(original, crit, FakeMetadataFactory.exampleBQTCached());
+ }
+
}
Show replies by date