Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0007412 | Openbravo ERP | A. Platform | public | 2009-02-06 12:04 | 2017-03-31 14:36 | |||||||
Reporter | dalsasua | |||||||||||
Assigned To | AugustoMauch | |||||||||||
Priority | normal | Severity | minor | Reproducibility | always | |||||||
Status | acknowledged | Resolution | open | |||||||||
Platform | OS | 20 | OS Version | rPath Linux | ||||||||
Product Version | pi | |||||||||||
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 | 0007412: substr overloading for postgresql not working | |||||||||||
Description | In the Oracle native substr function, when an index of 0 is received as first position of the string, it turns it to a 1. In postgresql, if a 0 is received, then no value is returned as first character, so there exists a function called substr in OpenbravoERP that tries to emulate this behavior: -- Function: substr(character varying, numeric, numeric) CREATE OR REPLACE FUNCTION substr(character varying, numeric, numeric) RETURNS character varying AS $BODY$ BEGIN return substr($1,CAST((CASE $2 WHEN 0 THEN 1 ELSE $2 END) AS INTEGER), CAST($3 AS INTEGER)); END; $BODY$ LANGUAGE 'plpgsql' IMMUTABLE COST 100; Actually, this is not working, because when a substr function is invoked, then the postgresql native one is executed. The difference between both functions is in the parameter types: The one in Openbravo ERP: substr(character varying, numeric, numeric) Included in Postgresql catalog: substr(text, integer, integer) as well as substr(bytea, integer) substr(text, integer) substr(bytea, integer, integer) substr function must be re-defined | |||||||||||
Steps To Reproduce | In Oracle: select substr('123',0,2) from dual; -> 12 select substr('123',0,1) from dual; -> 1 In Postgresql: select substr('123',0,2); -> 1 select substr('123',0,1); -> <empty string> | |||||||||||
Proposed Solution | ||||||||||||
Additional Information | ||||||||||||
Tags | OB3-Reviewed | |||||||||||
Relationships |
| |||||||||||
Attached Files | ||||||||||||
Issue History | ||||||||||||
Date Modified | Username | Field | Change | |||||||||
2009-02-06 12:04 | dalsasua | New Issue | ||||||||||
2009-02-06 12:04 | dalsasua | Assigned To | => rafaroda | |||||||||
2009-02-06 12:04 | dalsasua | sf_bug_id | 0 => 2572052 | |||||||||
2009-02-06 12:04 | dalsasua | Regression testing | => No | |||||||||
2009-02-11 11:50 | rafaroda | Assigned To | rafaroda => pjuvara | |||||||||
2009-02-11 14:36 | pjuvara | Note Added: 0013343 | ||||||||||
2009-02-11 14:36 | pjuvara | Type | feature request => defect | |||||||||
2009-02-24 12:10 | psarobe | Status | new => scheduled | |||||||||
2009-02-24 12:10 | psarobe | Assigned To | pjuvara => shuehner | |||||||||
2009-02-24 12:10 | psarobe | fix_in_branch | => trunk | |||||||||
2011-10-28 10:03 | psarobe | Tag Attached: OB3-Reviewed | ||||||||||
2012-02-20 11:17 | shuehner | Assigned To | shuehner => alostale | |||||||||
2012-02-22 15:36 | alostale | Assigned To | alostale => marvintm | |||||||||
2012-02-22 16:10 | marvintm | Assigned To | marvintm => AugustoMauch | |||||||||
2012-02-23 10:25 | AugustoMauch | Note Added: 0045394 | ||||||||||
2012-02-23 10:25 | AugustoMauch | Type | defect => design defect | |||||||||
2012-02-23 10:25 | AugustoMauch | fix_in_branch | pi => | |||||||||
2017-03-31 14:36 | alostale | Status | scheduled => acknowledged |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|