Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0019164Openbravo ERPA. Platformpublic2011-11-24 10:012011-11-30 12:30
maite 
alostale 
immediatemajoralways
closedfixed 
5
3.0MP5.1 
3.0MP6 
Core
No
0019164: Error when "CallStoredProcedure" receives empty string ("") in PostgreSQL
Error when "CallStoredProcedure" receives empty string ("") in PostgreSQL as, in this case, it is set to NVARCHAR which is not supported type in PostgreSQL (http://wiki.openbravo.com/wiki/ERP/2.50/Developers_Guide/Concepts/DB/Tables#Supported_Column_Data_types [^])
1. Schedule FIN_PaymentMonitorProcess background process in a migrated environment with old invoices (which have debt_payments associated)

In that case, method "getMigratedPaymentStatus" will call to "FIN_Utility.isPaymentConfirmed" method (with second parameter set to null), which will try to execute "APRM_ISPAYMENTCONFIRMED" procedure.
Method "Call" inside "CallStoredProcedure" class in line 97 will perform:
ps.setNull(sqlIndex, Types.NVARCHAR);

That causes exception in PostgreSQL
substituting line 97 in "CallStoredProcedure" by:
ps.setNull(sqlIndex, Types.VARCHAR);
error is not obtained
Regression
related to feature request 0018277 closed gorkaion APR Payment monitor background process should update paid and outstanding amounts 
has duplicate defect 0019162 closed alostale CallStoredProcedure crashes if callling with NULL parameters 
? org.openbravo.issue19164-0.0.0.obx (7,791) 2011-11-24 16:02
https://issues.openbravo.com/file_download.php?file_id=4786&type=bug
Issue History
2011-11-24 10:01maiteNew Issue
2011-11-24 10:01maiteAssigned To => alostale
2011-11-24 10:01maiteModules => Core
2011-11-24 10:10maiteIssue Monitored: networkb
2011-11-24 12:36dmitry_mezentsevPriorityurgent => immediate
2011-11-24 12:36dmitry_mezentsevTag Attached: Regression
2011-11-24 12:36dmitry_mezentsevRelationship addedrelated to 0018277
2011-11-24 12:37dmitry_mezentsevNote Added: 0043151
2011-11-24 12:49alostaleRelationship addedhas duplicate 0019162
2011-11-24 12:49shuehnerIssue Monitored: shuehner
2011-11-24 13:26alostaleFile Added: org.openbravo.issue19164-0.0.0.obx
2011-11-24 13:26alostaleNote Added: 0043156
2011-11-24 13:28alostaleNote Added: 0043157
2011-11-24 14:36icematrix3kIssue Monitored: icematrix3k
2011-11-24 15:54maiteversion => 3.0MP5.1
2011-11-24 16:01alostaleFile Deleted: org.openbravo.issue19164-0.0.0.obx
2011-11-24 16:02alostaleFile Added: org.openbravo.issue19164-0.0.0.obx
2011-11-24 16:03alostaleNote Edited: 0043157bug_revision_view_page.php?bugnote_id=0043157#r2943
2011-11-24 16:05hgbotCheckin
2011-11-24 16:05hgbotNote Added: 0043178
2011-11-24 16:05hgbotStatusnew => resolved
2011-11-24 16:05hgbotResolutionopen => fixed
2011-11-24 16:05hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/77352f416244fd98a2923fedf7eecdf4d0f03f81 [^]
2011-11-24 19:30marvintmNote Added: 0043197
2011-11-24 19:30marvintmStatusresolved => closed
2011-11-25 08:21maiteNote Added: 0043199
2011-11-30 12:30hudsonbotCheckin
2011-11-30 12:30hudsonbotNote Added: 0043438

Notes
(0043151)
dmitry_mezentsev   
2011-11-24 12:37   
FR 18227 made this bug visible.
(0043156)
alostale   
2011-11-24 13:26   
It can also be reproduced installing attached module and executing dummy process from quick launch.
(0043157)
alostale   
2011-11-24 13:28   
(edited on: 2011-11-24 16:03)
Test plan:
-Install org.openbravo.issue19164 module and execute dummy process


Regression test:
-Do execute the test plan in Oracle and PostgreSQL, this fix solves a PostgreSQL specific issue, verify it also works on Oracle.
-Even not supported in Oracle and modules, in postgreSQL it is possible to overload a function having the same number of parameters but of different types, check it continues working if types are passed correctly.

(0043178)
hgbot   
2011-11-24 16:05   
Repository: erp/devel/pi
Changeset: 77352f416244fd98a2923fedf7eecdf4d0f03f81
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Nov 24 16:04:52 2011 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/77352f416244fd98a2923fedf7eecdf4d0f03f81 [^]

fixed bug 19164: PG error invoking PL functions with null parameters

---
M src/org/openbravo/service/db/CallStoredProcedure.java
---
(0043197)
marvintm   
2011-11-24 19:30   
Reviewed the diff and tested a process both in Oracle and PostgreSQL.
(0043199)
maite   
2011-11-25 08:21   
Verified that FIN_PaymentMonitorProcess background process works
(0043438)
hudsonbot   
2011-11-30 12:30   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/01809c7b3135 [^]

Maturity status: Test