Bug #10079 Float function doesn't return result in full precision through ODBC
Submitted: 21 Apr 2005 22:59 Modified: 13 Jun 2007 9:20
Reporter: Nikos Sarris Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51.11 OS:Windows (Windows XP Pro SP2)
Assigned to: CPU Architecture:Any
Tags: FLOAT, ODBC

[21 Apr 2005 22:59] Nikos Sarris
Description:
When a float function is called from the query browser(which as far as I can tell is written in Java and thus uses JDBC) the result when the function is called is returned in full precision

However, when the same functioned is called in the exact same manner through MyODBC 3.51.11-1 in a VB6 app for example, then the precision is cut down to 2 digits.

Example , function f_CalcR:

CREATE FUNCTION f_CALCR(Voltage float, Curent float) RETURNS float
Return (Voltage-6)*1000/Curent

From within query browser:
SELECT F_CALCR(12,7) -> returns 857.14288330078

through any MyODBC 3.51 call though, the same query 
SELECT F_CALCR(12,7)
returns 857,1429

How to repeat:
Example , function f_CalcR:

CREATE FUNCTION f_CALCR(Voltage float, Curent float) RETURNS float
Return (Voltage-6)*1000/Curent

From within query browser:
SELECT F_CALCR(12,7) -> returns 857.14288330078

through any MyODBC 3.51 call though, the same query 
SELECT F_CALCR(12,7)
returns 857,1429

Suggested fix:
I'd probably say that MyODBC doesn't look at the function's return type in some way and always assumes the return has precision of four decimals, or something in that direction
[22 Apr 2005 0:09] Jorge del Conde
Verified w/3.1.11-2
[13 Jun 2007 9:20] Georg Richter
Can't repeat.

Tested with VB and 3.51.16

Result: 857.14288330078125