Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031149Openbravo ERPY. DBSourceManagerpublic2015-10-14 11:152022-02-01 08:05
mfuertes 
Triage Platform Base 
normalminorhave not tried
acknowledgedopen 
5
3.0PR15Q1.5 
 
Core
No
0031149: "minus" word in PL function shows warning when exporting db
When columns have names like "yf_minus_one_point_eight" or "yf_minus1_point_five" it gets converted to different names containing [EXCEPT][minus+] and so on. So export.database its taking this in-between-quotes text as SQL keywords and it shouldn't.

- Create a Module and a db prefix.
- Add a function to that module, in my case:

CREATE OR REPLACE FUNCTION HK_TEST(i integer) RETURNS integer AS $$
        BEGIN
                select 1 as minus_ten from c_order limit 1;
        END;
$$ LANGUAGE plpgsql;

- Export database and the result should be something like:

Found differences in HK_TEST
********************************************************
BEGIN
                select 1 as [EXCEPT][minus+]_ten from c_order limit 1;[ +]END[ ]
********************************************************
(see atachments for full export.log and client export images)




Aditionally, client used this query inside a function:

select ad_client_id, ad_org_id, isactive,
created, createdby, updated, updatedby, sapm_trip_detail_id,
container_no, seal_no, type_no, mix, loading_date, c_bpartner_id,
destination, status, yf_60, yf_40_60, yf_20_40, yf_10, yf_3_point_4,
yf_1_point_8, yf_minus_one_point_eight, yf_minus1_point_five,
sk_3_point_4, sk_1_point_8, skyfin_negative_1_point_8, sk_minus_1_point_5,
be_60, be_40_60, be_20_40, be_10_20, be_3_point_5, be_1_point_8,
be_ngvt_1_point_8, be_minus_1_point_5, ger, mel, rej, total,
booking_no, container_size from sapm_trip_detail_line
where sapm_trip_detail_id =v_record_id and c_bpartner_id=Cur_Parameter.c_bpartner_id
and destination=Cur_Parameter.destination and booking_no=Cur_Parameter.booking_no
No tags attached.
related to design defect 0029492 closed alostale Wrong export of a view 
log export.log (3,394) 2015-10-27 15:15
https://issues.openbravo.com/file_download.php?file_id=8650&type=bug
png ScreenShot2015-08-19at11.10.06am.png (339,367) 2015-10-27 15:16
https://issues.openbravo.com/file_download.php?file_id=8651&type=bug
Issue History
2015-10-14 11:15mfuertesNew Issue
2015-10-14 11:15mfuertesAssigned To => platform
2015-10-14 11:15mfuertesModules => Core
2015-10-14 11:15mfuertesTriggers an Emergency Pack => No
2015-10-14 11:16mfuertesDescription Updatedbug_revision_view_page.php?rev_id=9687#r9687
2015-10-14 12:02alostaleNote Added: 0081003
2015-10-14 12:02alostaleAssigned Toplatform => mfuertes
2015-10-14 12:02alostaleStatusnew => feedback
2015-10-14 12:02alostaleNote Edited: 0081003bug_revision_view_page.php?bugnote_id=0081003#r9693
2015-10-14 12:03alostaleNote Edited: 0081003bug_revision_view_page.php?bugnote_id=0081003#r9694
2015-10-27 15:15mfuertesAssigned Tomfuertes => platform
2015-10-27 15:15mfuertesSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9929#r9929
2015-10-27 15:15mfuertesFile Added: export.log
2015-10-27 15:16mfuertesFile Added: ScreenShot2015-08-19at11.10.06am.png
2015-10-27 15:18mfuertesStatusfeedback => new
2015-10-27 15:18mfuertesSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9930#r9930
2015-10-27 15:24alostaleStatusnew => acknowledged
2015-11-10 16:32alostalePriorityhigh => normal
2015-11-10 16:32alostaleSummary"MINUS" keyword in colname => "minus" word in PL function shows warning when exporting db
2015-11-10 16:32alostaleRelationship addedrelated to 0029492
2022-02-01 08:05alostaleAssigned Toplatform => Triage Platform Base

Notes
(0081003)
alostale   
2015-10-14 12:02   
(edited on: 2015-10-14 12:03)
Please, provide accurate steps to reproduce this issue.

Testing with the following steps, names are correctly exported:

$ psql -U postgres -d pi -h localhost -p 5432
psql (9.5alpha2, server 9.4.4)
Type "help" for help.

pi=# alter table c_order add column yf_minus_one_point_eight numeric, add column yf_minus1_point_five numeric;
ALTER TABLE
pi=# \q

$ ant export.database -Dforce=yes -Dvalidate.model=false
$ hg diff src-db/database/model/tables/C_ORDER.xml
  diff -r f1f0e628b7d9 src-db/database/model/tables/C_ORDER.xml
--- a/src-db/database/model/tables/C_ORDER.xml Mon Sep 28 13:17:45 2015 +0200
+++ b/src-db/database/model/tables/C_ORDER.xml Wed Oct 14 11:58:19 2015 +0200
@@ -341,6 +341,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+ <column name="YF_MINUS_ONE_POINT_EIGHT" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
+ <default/>
+ <onCreateDefault/>
+ </column>
+ <column name="YF_MINUS1_POINT_FIVE" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
+ <default/>
+ <onCreateDefault/>
+ </column>
       <foreign-key foreignTable="C_DOCTYPE" name="C_DOCTYPE_CORDER">
         <reference local="C_DOCTYPE_ID" foreign="C_DOCTYPE_ID"/>
       </foreign-key>