Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014183Openbravo ERPY. DBSourceManagerpublic2010-08-13 13:312010-09-18 00:00
networkb 
marvintm 
highminoralways
closedfixed 
20Community Appliance
2.50MP20 
2.50MP22 
Core
No
0014183: error in update.database when exists lines without indent
when a function database, there are lines without indent, the process update.database returns an error
. create next function in database:
CREATE OR REPLACE FUNCTION TEST_PR(OUT aprobado character varying, IN p_pinstance_id character varying)
  RETURNS character varying AS

$BODY$ DECLARE
v_Message VARCHAR(2000):=''; -- will contain the final message to be logged
v_ResultStr VARCHAR(2000):=''; -- will contain text describing the stage the stored procedure is in
BEGIN


RAISE NOTICE '%','Updating PInstance - Finished ' || v_Message ;
PERFORM AD_UPDATE_PINSTANCE(p_pinstance_id, NULL, 'N', 1, v_Message) ;
RETURN;

EXCEPTION
 WHEN OTHERS THEN
   v_ResultStr:= '@Error=' || SQLERRM;
   RAISE NOTICE '%',v_ResultStr ;
   PERFORM AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'N', 0, v_ResultStr) ;
   RETURN;
END ;

$BODY$
  LANGUAGE 'plpgsql' VOLATILE
  COST 100;
ALTER FUNCTION TEST_PR(character varying) OWNER TO tad_250mp14;

. run export.database

. run update.database
. add several spaces, in the start of the lines
No tags attached.
Issue History
2010-08-13 13:31networkbNew Issue
2010-08-13 13:31networkbAssigned To => marvintm
2010-08-16 08:06alostaleStatusnew => scheduled
2010-08-16 08:06alostalefix_in_branch => pi
2010-09-06 13:38marvintmNote Added: 0030645
2010-09-06 13:38marvintmStatusscheduled => feedback
2010-09-14 09:33hgbotCheckin
2010-09-14 09:33hgbotNote Added: 0031020
2010-09-14 09:33hgbotStatusfeedback => resolved
2010-09-14 09:33hgbotResolutionopen => fixed
2010-09-14 09:33hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1d0e1fd77ec2bdf20e06b110fe196e2d6b0f00a8 [^]
2010-09-14 09:51hgbotCheckin
2010-09-14 09:51hgbotNote Added: 0031021
2010-09-14 09:51hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/1d0e1fd77ec2bdf20e06b110fe196e2d6b0f00a8 [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/0343104474d0aebf909855a82cce5382f34109b6 [^]
2010-09-14 10:04marvintmNote Added: 0031023
2010-09-15 20:55hudsonbotCheckin
2010-09-15 20:55hudsonbotNote Added: 0031114
2010-09-17 17:04shuehnerNote Added: 0031198
2010-09-17 17:04shuehnerStatusresolved => closed
2010-09-18 00:00anonymoussf_bug_id0 => 3069533

Notes
(0030645)
marvintm   
2010-09-06 13:38   
I've created the function as it was provided, and unfortunately the issue didn't reproduce. The function was exported with correct Oracle syntax, and the update.database ran without trouble.

I know that this issue at some point happened, but we need to find a way to reproduce it reliably.
(0031020)
hgbot   
2010-09-14 09:33   
Repository: erp/devel/pi
Changeset: 1d0e1fd77ec2bdf20e06b110fe196e2d6b0f00a8
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon Sep 13 19:33:03 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/1d0e1fd77ec2bdf20e06b110fe196e2d6b0f00a8 [^]

Fixed issue 14183. Translation for DBMS_OUTPUT structures will work even when there is no indentation.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0031021)
hgbot   
2010-09-14 09:51   
Repository: erp/devel/dbsm-main
Changeset: 0343104474d0aebf909855a82cce5382f34109b6
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon Sep 13 19:30:01 2010 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/0343104474d0aebf909855a82cce5382f34109b6 [^]

Fixed issue 14183. Translation for DBMS_OUTPUT structures will work even when there is no indentation.

---
M src/org/apache/ddlutils/platform/postgresql/ChangeFunction2Translation.java
---
(0031023)
marvintm   
2010-09-14 10:04   
1 note about the fix: the change done has been the less intrusive one possible, to minimize the probability of producing a regression when changing the PLSQL translation code. Therefore, the provided function will work, but it will be created in PostgreSQL with the two lines without indentation being translated into a single line of code. The syntax is correct, and although the generated code is not completely nice, it will work.
(0031114)
hudsonbot   
2010-09-15 20:55   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/1d0e1fd77ec2 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/80bfed94a6e8 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18410.obx [^]
(0031198)
shuehner   
2010-09-17 17:04   
Tested on pi/psql. Change is postgres specific and as the our translation consistency check and normal db-consistency tests on hudson run fine -> No need for special testing on oracle.
Tested specified function with export/update cycle -> Working fine now. Review of diff shows changed regex will only affect leading spaces of lines containing dbms_output -> very localized -> Closing as fixed.