Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0027261 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] 05. Production management | minor | have not tried | 2014-08-01 17:17 | 2014-10-02 14:26 | |||
Reporter | shuehner | View Status | public | |||||
Assigned To | reinaldoguerra | |||||||
Priority | urgent | Resolution | fixed | Fixed in Version | 3.0PR14Q4 | |||
Status | closed | Fix in branch | Fixed in SCM revision | a80c97c10d98 | ||||
Projection | none | ETA | none | Target Version | 3.0PR15Q1 | |||
OS | Any | Database | PostgreSQL | Java version | ||||
OS Version | Database version | ppas9.1 | Ant version | |||||
Product Version | SCM revision | |||||||
Merge Request Status | ||||||||
Review Assigned To | vmromanos | |||||||
OBNetwork customer | OBPS | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0027261: Wrong usage of to_char in two xsql files | |||||||
Description | The following two files: src/org/openbravo/erpCommon/ad_actionButton/EditCCPMeasureValues_Values_data.xsql src/org/openbravo/erpCommon/ad_reports/ReportGuaranteeDate_data.xsql Have code similar to select to_date('31/12/9999') in them. Which is wrong. As checking to_date function (to_date(text) in prescript-postgresql) shows that this call boils down to: select to_timestamp('31/12/9999', dateFormat()); With that function dateFormat being created/updated from Openbravo.properties. But in short it means that dateformat can be configured and be anything so it cannot be compatible (at least not always) with a fixed format date-value. Most code instead does the following which is garanteed to work always: select to_date('31-12-9999', 'DD-MM-YYYY') The 2 files doing that wrong should be changed as well. NOTE: That wrong syntax to_timestamp is accepted by standard postgres. However it is not accepted by ppas 9.1 (enterprise db commercial version of postgres). | |||||||
Steps To Reproduce | Compare running that call: select pg_catalog.to_timestamp('31/12/9999', 'DD-MM-YYYY'); and check output on 1.) standard postgres 9999-12-31 00:00:00+01 So accepted 2.) ppas9.1 ERROR: invalid value "/1" for "MM" DETAIL: Value must be an integer. Rejected | |||||||
Proposed Solution | Apply attached patch to fix sql | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() | |||||||
![]() |
|
![]() |
|
(0069039) shuehner (administrator) 2014-08-01 17:18 |
NOTE: Patch only compile tested on postgres + ppas9.1 No functional testing done yet on neither postgres nor oracle. Has to be done by committer. |
(0069769) shuehner (administrator) 2014-08-26 17:28 |
Setting obps after talking to Dmitry to give bug more priority to get fixes soon. As issue very interesting for internal project from me. |
(0070572) hgbot (developer) 2014-09-30 17:25 |
Repository: erp/devel/pi Changeset: a80c97c10d9804d517eb3324b57b403f611c5183 Author: Reinaldo Guerra <reinaldo.guerra <at> peoplewalking.com> Date: Thu Sep 25 12:32:08 2014 -0500 URL: http://code.openbravo.com/erp/devel/pi/rev/a80c97c10d9804d517eb3324b57b403f611c5183 [^] Fixed bug 27261: Wrong usage of to_date in two xsql files. EditCCPMeasureValues_Values_data.xsql and ReportGuaranteeDate_data.xsql were modified by adding specified format on function to_date. Now when executed these process, all dates will be compared using the correct date format. --- M src/org/openbravo/erpCommon/ad_actionButton/EditCCPMeasureValues_Values_data.xsql M src/org/openbravo/erpCommon/ad_reports/ReportGuaranteeDate_data.xsql --- |
![]() |
|||
Date Modified | Username | Field | Change |
2014-08-01 17:17 | shuehner | New Issue | |
2014-08-01 17:17 | shuehner | Assigned To | => dmiguelez |
2014-08-01 17:17 | shuehner | OBNetwork customer | => No |
2014-08-01 17:17 | shuehner | Modules | => Core |
2014-08-01 17:17 | shuehner | Triggers an Emergency Pack | => No |
2014-08-01 17:17 | shuehner | File Added: 27261.diff | |
2014-08-01 17:18 | shuehner | Note Added: 0069039 | |
2014-08-26 17:28 | shuehner | OBNetwork customer | No => Yes |
2014-08-26 17:28 | shuehner | Note Added: 0069769 | |
2014-09-01 16:29 | jonalegriaesarte | Resolution time | => 1412114400 |
2014-09-03 14:05 | eduardo_Argal | Assigned To | dmiguelez => eduardo_Argal |
2014-09-22 16:34 | jonalegriaesarte | Target Version | 3.0PR14Q4 => 3.0PR15Q1 |
2014-09-25 05:49 | reinaldoguerra | Assigned To | eduardo_Argal => reinaldoguerra |
2014-09-25 05:49 | reinaldoguerra | Status | new => scheduled |
2014-09-30 17:25 | hgbot | Checkin | |
2014-09-30 17:25 | hgbot | Note Added: 0070572 | |
2014-09-30 17:25 | hgbot | Status | scheduled => resolved |
2014-09-30 17:25 | hgbot | Resolution | open => fixed |
2014-09-30 17:25 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/a80c97c10d9804d517eb3324b57b403f611c5183 [^] |
2014-09-30 17:26 | vmromanos | Review Assigned To | => vmromanos |
2014-09-30 17:26 | vmromanos | Status | resolved => closed |
2014-10-02 14:26 | shuehner | Fixed in Version | => 3.0PR14Q4 |
Copyright © 2000 - 2009 MantisBT Group |