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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0010829
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminoralways2009-09-30 13:132009-11-20 00:00
ReporternetworkbView Statuspublic 
Assigned Tomarvintm 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisiond341fcdd39f9
ProjectionnoneETAnoneTarget Version2.50MP9
OSLinux 32 bitDatabasePostgreSQLJava version1.6.0_11
OS VersionrPath LinuxDatabase version8.3.5Ant version1.7.1
Product Version2.50MP5SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0010829: process "export database module" incorrect with a procedure in database with text PERFORM

Descriptionwhen you run process "export database module" with a procedure in database with text "PERFORM", xml generated is incorrect: xml has twice word "perform"
Steps To Reproduce. create module
. create procedure in BD with text PERFORM:
   sample:
    CREATE OR REPLACE FUNCTION prueba_f(p_pinstance_id character varying)
    RETURNS void AS
    $BODY$ DECLARE
    BEGIN
     perform AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'Y', NULL, NULL) ;
    END ; $BODY$
    LANGUAGE 'plpgsql' VOLATILE
    COST 100;
    ALTER FUNCTION prueba_f(character varying) OWNER TO tad;

run "ant export.database -Dmodule="nombreModulo"

XML generated is:
<?xml version="1.0"?>
  <database name="FUNCTION PRUEBA_F">
    <function name="PRUEBA_F" type="NULL">
      <parameter name="p_pinstance_id" type="VARCHAR" mode="in">
        <default/>
      </parameter>
      <body><![CDATA[BEGIN

      PERFORM AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'Y', NULL, NULL) ;
END PRUEBA_F
]]></body>
    </function>
  </database>

but when you execute
ant update.database -Dmodule="nombreModulo"
error is returned and function is not loaded to database:
.....
SQL Command failed with: ERROR: error de sintaxis en o cerca de «AD_UPDATE_PINSTANCE»
-- END
-- -----------------------------------------------------------------------
-- FUNCTION PRUEBA_F
-- -----------------------------------------------------------------------
CREATE FUNCTION PRUEBA_F(p_pinstance_id IN VARCHAR) RETURNS VOID

AS $BODY$ DECLARE
BEGIN
     perform PERFORM AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'Y', NULL, NULL) ;
END ; $BODY$ LANGUAGE plpgsql;
Executed 423 SQL command(s) with 1 error(s)
......

Thanks,
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
has duplicate defect 0011271 closedrafaroda Function not created(failed) when installing module. 

-  Notes
(0020673)
marvintm (developer)
2009-10-02 16:30

I understand that this problem could happen sometimes. However, this particular example worked for me perfectly (I created the function copy/pasting the CREATE FUNCTION statement in pgadmin, and then did export.database, and the PERFORM statement was gone, which is the correct behaviour).

Can you provide me with a working example in which this problem happens?
(0020680)
networkb (developer)
2009-10-02 18:05

sorry, the steps to reproduce the error were not correct.
I have updated this steps.
Thanks
(0020711)
marvintm (developer)
2009-10-05 16:52

Thanks for the additional steps to reproduce the error. However, the crucial part of it is still missing. The example PL/SQL code you provided works fine (in any 2.50 version, just create the function and export.database, and the "PERFORM" keyword will _not_ appear).

I know that you encountered this problem sometime, so if you could provide me with the exact code for the function that doesn't work, it would be great, because it's a hard issue to reproduce.

The important thing to note is that the function provided, as it is, _does_ work.
(0020791)
networkb (developer)
2009-10-06 16:44

I have the problem with that function in my enviroment test with 250mp5.
The partner has reported the problem with c_invoice_create function.

Thanks
(0021950)
hgbot (developer)
2009-11-18 10:02

Repository: erp/devel/pi
Changeset: d341fcdd39f918850c53f04fd3e86ed494ec4955
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue Nov 17 10:37:29 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d341fcdd39f918850c53f04fd3e86ed494ec4955 [^]

Fixed issue 10829. Export.database will not export PL functions with the 'PERFORM' keyword included in the xml file.

---
M src-db/database/build.xml
M src-db/database/lib/dbsourcemanager.jar
---
(0022029)
shuehner (administrator)
2009-11-19 16:47

Tested with the function shown in steps to reproduce, that normal update.databse and export.database to update and export this function without errors. As the resolution for this issue did remove the -Dmodule option from export.database this is enough to fix the issue.

- Issue History
Date Modified Username Field Change
2009-09-30 13:13 networkb New Issue
2009-09-30 13:13 networkb Assigned To => rafaroda
2009-10-01 19:00 psarobe Status new => scheduled
2009-10-01 19:00 psarobe Assigned To rafaroda => marvintm
2009-10-01 19:00 psarobe fix_in_branch => pi
2009-10-02 16:30 marvintm Note Added: 0020673
2009-10-02 16:30 marvintm Status scheduled => feedback
2009-10-02 18:05 networkb Note Added: 0020680
2009-10-02 18:05 networkb fix_in_branch pi =>
2009-10-02 18:05 networkb Proposed Solution updated
2009-10-05 07:53 rafaroda Priority immediate => high
2009-10-05 07:53 rafaroda Status feedback => scheduled
2009-10-05 16:52 marvintm Note Added: 0020711
2009-10-05 16:52 marvintm Status scheduled => feedback
2009-10-06 16:44 networkb Note Added: 0020791
2009-10-08 09:32 networkb Status feedback => new
2009-10-09 09:41 psarobe Status new => scheduled
2009-10-09 09:41 psarobe fix_in_branch => pi
2009-10-22 10:04 networkb Target Version 2.50MP8 => 2.50MP9
2009-10-22 10:04 networkb fix_in_branch pi =>
2009-11-18 10:02 hgbot Checkin
2009-11-18 10:02 hgbot Note Added: 0021950
2009-11-18 10:02 hgbot Status scheduled => resolved
2009-11-18 10:02 hgbot Resolution open => fixed
2009-11-18 10:02 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d341fcdd39f918850c53f04fd3e86ed494ec4955 [^]
2009-11-19 16:47 shuehner Note Added: 0022029
2009-11-19 16:47 shuehner Status resolved => closed
2009-11-20 00:00 anonymous sf_bug_id 0 => 2900810
2009-12-29 11:21 shuehner Relationship added related to 0011271
2009-12-30 10:05 shuehner Relationship replaced has duplicate 0011271


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker