Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0027261
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 05. Production managementminorhave not tried2014-08-01 17:172014-10-02 14:26
ReportershuehnerView Statuspublic 
Assigned Toreinaldoguerra 
PriorityurgentResolutionfixedFixed in Version3.0PR14Q4
StatusclosedFix in branchFixed in SCM revisiona80c97c10d98
ProjectionnoneETAnoneTarget Version3.0PR15Q1
OSAnyDatabasePostgreSQLJava version
OS VersionDatabase versionppas9.1Ant version
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0027261: Wrong usage of to_char in two xsql files

DescriptionThe 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 ReproduceCompare 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 SolutionApply attached patch to fix sql
TagsNo tags attached.
Attached Filesdiff file icon 27261.diff [^] (2,289 bytes) 2014-08-01 17:17 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(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
---

- Issue History
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 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 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
Powered by Mantis Bugtracker