Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0011189Openbravo ERPA. Platformpublic2009-10-30 12:342009-11-25 00:00
networkb 
marvintm 
immediateminoralways
closedfixed 
5
2.50MP7 
2.50MP10 
Core
No
0011189: Some funcionts raise exceptions in an incorrect way
Some funcionts raise exceptions in an incorrect way
The following order is not correct
RAISE EXCEPTION '%',DATA_EXCEPTION;
Create the following pl:

CREATE OR REPLACE FUNCTION testpl()
  RETURNS void AS
$BODY$
BEGIN
RAISE EXCEPTION '%',DATA_EXCEPTION;
END;
$BODY$
  LANGUAGE 'plpgsql' IMMUTABLE
  COST 100;
ALTER FUNCTION testpl() OWNER TO tad;

Execute the pl:

select testpl();

See that you get an error:
the data_execption column does not exist.

See that the order that fails is used on many procedures and functions. For examplo c_invoice_post:
RAISE EXCEPTION '%',DATA_EXCEPTION;

No tags attached.
has duplicate defect 0011257 closed marvintm INVOICE POST 
Issue History
2009-10-30 12:34networkbNew Issue
2009-10-30 12:34networkbAssigned To => rafaroda
2009-11-02 05:36rafarodaNote Added: 0021496
2009-11-02 05:36rafarodaAssigned Torafaroda => marvintm
2009-11-02 05:36rafarodaStatusnew => acknowledged
2009-11-02 05:36rafarodaIssue Monitored: rafaroda
2009-11-03 15:50hgbotCheckin
2009-11-03 15:50hgbotNote Added: 0021538
2009-11-03 15:50hgbotStatusacknowledged => resolved
2009-11-03 15:50hgbotResolutionopen => fixed
2009-11-03 15:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/adfd8c3d4091b490fcebb21611b0fd778c932bf9 [^]
2009-11-03 15:54marvintmNote Added: 0021539
2009-11-05 10:04marvintmRelationship addedhas duplicate 0011257
2009-11-11 10:12rafarodaNote Added: 0021710
2009-11-11 10:12rafarodaTarget Version2.50MP11 => 2.50MP10
2009-11-24 11:54dbazStatusresolved => closed
2009-11-25 00:00anonymoussf_bug_id0 => 2903420

Notes
(0021496)
rafaroda   
2009-11-02 05:36   
Antonio,

Can you please comment on this issue?

Thanks.
(0021538)
hgbot   
2009-11-03 15:50   
Repository: erp/devel/pi
Changeset: adfd8c3d4091b490fcebb21611b0fd778c932bf9
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue Nov 03 15:45:50 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/adfd8c3d4091b490fcebb21611b0fd778c932bf9 [^]

Fixed issue 11189. RAISE NO_DATA_FOUND will from now on be translated with quotes in PostgreSQL

---
M src-db/database/lib/dbsourcemanager.jar
---
(0021539)
marvintm   
2009-11-03 15:54   
One note: RAISE NO_DATA_FOUND statements should no longer be a problem anymore. However, although statements:

EXCEPTION
   WHEN NO_DATA_FOUND THEN

do not fail in PostgreSQL, it's not clear if the exception is actually raised or not, because apparently NO_DATA_FOUND exceptions are raised differently in PostgreSQL and Oracle. Maybe a refactor of the functions and triggers that use this kind of syntax could be necessary.
(0021710)
rafaroda   
2009-11-11 10:12   
Changed target version to 2.50MP10 requested by ECA.