Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041460Openbravo ERPY. DBSourceManagerpublic2019-07-26 10:032019-08-22 14:45
mauricio_peccorini 
alostale 
lowminoralways
closedfixed 
5
 
3.0PR19Q4 
caristu
Core
No
0041460: A foreign key composed of more than 1 field will produced duplicated information when the database is exported by DBSM
If a primary/unique key is composted of 2 or more fields and a foreign key references it, DBSM will produce a cross-product of the referencing and referenced fields instead of the correct 1 to 1 association.
1. Create a table with a primary key composed by two or more fields
2. Create a second table and add a foreign key to the first table
3. Export the database using 'ant export.database'
4. Inspect the generated XML file, the list of fields in the foreign key will present the problem
Fix the query that returns the list of fields of the constraints with the patch attached.
No tags attached.
blocks feature request 0041484 closed cberner make job scheduling clusterizable 
patch PostgreSqlModelLoader.patch (1,113) 2019-07-26 10:03
https://issues.openbravo.com/file_download.php?file_id=13177&type=bug
Issue History
2019-07-26 10:03mauricio_peccoriniNew Issue
2019-07-26 10:03mauricio_peccoriniAssigned To => platform
2019-07-26 10:03mauricio_peccoriniFile Added: PostgreSqlModelLoader.patch
2019-07-26 10:03mauricio_peccoriniModules => Core
2019-07-26 10:03mauricio_peccoriniTriggers an Emergency Pack => No
2019-07-30 12:31alostaleRelationship addedblocks 0041484
2019-07-31 13:20hgbotCheckin
2019-07-31 13:20hgbotNote Added: 0113734
2019-07-31 13:20hgbotStatusnew => resolved
2019-07-31 13:20hgbotResolutionopen => fixed
2019-07-31 13:20hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/58004f8efa540f17758f4148ea71120eb5e62573 [^]
2019-07-31 13:21hgbotCheckin
2019-07-31 13:21hgbotNote Added: 0113736
2019-07-31 13:21hgbotCheckin
2019-07-31 13:21hgbotNote Added: 0113737
2019-07-31 13:21hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/58004f8efa540f17758f4148ea71120eb5e62573 [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/21e06878a298a5c2cce1c7c846be9462f01c95c2 [^]
2019-07-31 13:22alostaleAssigned Toplatform => alostale
2019-07-31 13:22alostaleReview Assigned To => caristu
2019-08-02 09:14caristuNote Added: 0113774
2019-08-02 09:14caristuStatusresolved => closed
2019-08-02 09:14caristuFixed in Version => 3.0PR19Q4
2019-08-22 14:45hudsonbotCheckin
2019-08-22 14:45hudsonbotNote Added: 0114188
2019-08-22 14:45hudsonbotCheckin
2019-08-22 14:45hudsonbotNote Added: 0114190

Notes
(0113734)
hgbot   
2019-07-31 13:20   
Repository: erp/devel/pi
Changeset: 58004f8efa540f17758f4148ea71120eb5e62573
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Jul 31 13:20:31 2019 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/58004f8efa540f17758f4148ea71120eb5e62573 [^]

fixed bug 41460 fixed bug 41366: allow multi col checks, don't upper case check

fixed issue 41460: multi colum FKs are not supported in PG

  The query to obtain columns participating in FKs was incorrect in PG as it
  assumed FKs have a single column.

  As PG catalog stores FK column information as a couple of arrays (one for local
  and another one for external column) each of them corresponding each other by
  array's position, it is not possible to retrieve all information using a single
  query. This has been changed so now column information is retrieved by an additional
  query based on array's position.


fixed issue 41366: string literals in check contrains are upper cased

  When exporting check constraints in PostgreSQL, they are converted to upper case
  in order to keep ORA - PG stability. This conversion was to aggressive as string
  literals were also modified.

  Now strings are kept while the rest is still transformed.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0113736)
hgbot   
2019-07-31 13:21   
Repository: erp/devel/dbsm-main
Changeset: 69d70100c9928b5c48f30b3d46812ebc4e74adf2
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jul 30 11:19:09 2019 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/69d70100c9928b5c48f30b3d46812ebc4e74adf2 [^]

related to issue 41460: added test cases

---
M src-test/src/org/openbravo/dbsm/test/base/DbsmTest.java
M src-test/src/org/openbravo/dbsm/test/model/ModelSuite.java
A src-test/model/multiColumnFK/PK/CHILD.xml
A src-test/model/multiColumnFK/PK/PARENT.xml
A src-test/model/multiColumnFK/unique/CHILD.xml
A src-test/model/multiColumnFK/unique/PARENT.xml
A src-test/src/org/openbravo/dbsm/test/model/MultiColumnFK.java
---
(0113737)
hgbot   
2019-07-31 13:21   
Repository: erp/devel/dbsm-main
Changeset: 21e06878a298a5c2cce1c7c846be9462f01c95c2
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jul 30 11:23:06 2019 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/21e06878a298a5c2cce1c7c846be9462f01c95c2 [^]

fixed issue 41460: multi colum FKs are not supported in PG

  The query to obtain columns participating in FKs was incorrect in PG as it
  assumed FKs have a single column.

  As PG catalog stores FK column information as a couple of arrays (one for local
  and another one for external column) each of them corresponding each other by
  array's position, it is not possible to retrieve all information using a single
  query. This has been changed so now column information is retrieved by an additional
  query based on array's position.

---
M src/org/apache/ddlutils/platform/ModelLoaderBase.java
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlModelLoader.java
---
(0113774)
caristu   
2019-08-02 09:14   
Reviewed
(0114188)
hudsonbot   
2019-08-22 14:45   
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/ad3efd3bd07c [^]
Maturity status: Test
(0114190)
hudsonbot   
2019-08-22 14:45   
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/ad3efd3bd07c [^]
Maturity status: Test