Functions don't work with NUMERIC type
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Stado |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
Discovered a bug relating to functions taking a numeric type as an argument:
Example:
select sum(count) from testtable;
results in:
ERROR: Can not prepare request: Unable To Determine Type For (SQLEXPRESSION)
I suspect this error also relates to max and various other functions.
This was found to be related to a type getTypeString issue for NUMERIC, and the following was applied to fix the problem:
[lpmike@dredd stado]$ svn diff src/org/
Index: src/org/
=======
--- src/org/
+++ src/org/
@@ -334,7 +334,6 @@
*/
public String getTypeString() {
String typeString = "";
-
@@ -394,9 +393,19 @@
break;
case java.sql.
- if (scale != 0) {
+ if (scale != 0)
+ {
}
+// mike added 2 more cases to NUMERIC template
+ else if (precision > 0)
+ {
+ typeString = TypeConstants.
+ }
+ else
+ {
+ typeString = TypeConstants.
+ }
break;
Hope this helps :)
Mike
This fix has been committed. Thanks for the patch