Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0014769 | Openbravo ERP | A. Platform | public | 2010-10-05 18:04 | 2023-07-11 05:13 | |||||||
Reporter | christiancorrodi | |||||||||||
Assigned To | AugustoMauch | |||||||||||
Priority | urgent | Severity | major | Reproducibility | always | |||||||
Status | closed | Resolution | fixed | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | 2.40 | |||||||||||
Target Version | Fixed in Version | |||||||||||
Merge Request Status | ||||||||||||
Review Assigned To | ||||||||||||
OBNetwork customer | ||||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Support ticket | ||||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0014769: prescript-PostgreSql.sql: to_number(text) function returning wrong values for inputs in scientific notation | |||||||||||
Description | Given a number x as a String. When x >= 1E7 or x <= 1E-4 the value stored to the database is wrong. This error comes for example from calling Double.toString(). Under Oracle this function returns a value of the type numeric for this case. 1E7 -> 17 instead of 10000000 1E-4 -> 14 instead of .0001 | |||||||||||
Steps To Reproduce | ||||||||||||
Proposed Solution | CREATE OR REPLACE FUNCTION to_number ( text ) RETURNS NUMERIC AS ' DECLARE v_Pos INTEGER; v_Mant NUMERIC; v_Exp NUMERIC; v_Res NUMERIC; BEGIN v_Pos := position(''E'' in upper($1)); IF v_Pos = 0 THEN -- this is the old behaviour RETURN to_number($1, ''S99999999999999D999999''); ELSE v_Mant := substring($1 from 1 for v_Pos - 1); -- Mantissa, implicit cast to data type NUMERIC v_Exp := substring($1 from v_Pos + 1); -- Exponent, implicit cast to data type NUMERIC v_Res := v_Mant * power(10, v_Exp); RETURN v_Res; END IF; EXCEPTION WHEN OTHERS THEN RETURN NULL; END; ' LANGUAGE 'plpgsql' IMMUTABLE /-- END | |||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | ||||||||||||
Issue History | ||||||||||||
Date Modified | Username | Field | Change | |||||||||
2010-10-05 18:04 | christiancorrodi | New Issue | ||||||||||
2010-10-05 18:04 | christiancorrodi | Assigned To | => alostale | |||||||||
2010-10-11 09:05 | alostale | Priority | normal => urgent | |||||||||
2010-10-11 09:06 | alostale | Status | new => scheduled | |||||||||
2011-11-16 16:30 | alostale | Assigned To | alostale => marvintm | |||||||||
2012-02-13 12:08 | marvintm | Assigned To | marvintm => AugustoMauch | |||||||||
2012-02-13 16:31 | hgbot | Checkin | ||||||||||
2012-02-13 16:31 | hgbot | Note Added: 0045073 | ||||||||||
2012-02-13 16:31 | hgbot | Status | scheduled => resolved | |||||||||
2012-02-13 16:31 | hgbot | Resolution | open => fixed | |||||||||
2012-02-13 16:31 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/34727a4bec62fdee0e39b43a4b0d79605cd4a6b7 [^] | |||||||||
2012-02-13 16:39 | AugustoMauch | Note Added: 0045075 | ||||||||||
2012-02-21 17:26 | marvintm | Status | resolved => closed | |||||||||
2012-03-02 15:36 | hudsonbot | Checkin | ||||||||||
2012-03-02 15:36 | hudsonbot | Note Added: 0045836 | ||||||||||
2016-05-25 11:05 | alostale | Relationship added | related to 0032951 | |||||||||
2023-07-11 05:13 | thielmikayla | Note Added: 0152297 | ||||||||||
2023-07-11 13:48 | shuehner | Note Deleted: 0152297 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|