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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0041460
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagerminoralways2019-07-26 10:032019-08-22 14:45
Reportermauricio_peccoriniView Statuspublic 
Assigned Toalostale 
PrioritylowResolutionfixedFixed in Version3.0PR19Q4
StatusclosedFix in branchFixed in SCM revision21e06878a298
ProjectionnoneETAnoneTarget Version
OSAnyDatabasePostgreSQLJava version
OS VersionDatabase versionAnyAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0041460: A foreign key composed of more than 1 field will produced duplicated information when the database is exported by DBSM

DescriptionIf 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.
Steps To Reproduce1. 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
Proposed SolutionFix the query that returns the list of fields of the constraints with the patch attached.
TagsNo tags attached.
Attached Filespatch file icon PostgreSqlModelLoader.patch [^] (1,113 bytes) 2019-07-26 10:03 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
blocks feature request 0041484 closedcberner make job scheduling clusterizable 

-  Notes
(0113734)
hgbot (developer)
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 (developer)
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 (developer)
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 (developer)
2019-08-02 09:14

Reviewed
(0114188)
hudsonbot (developer)
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 (developer)
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

- Issue History
Date Modified Username Field Change
2019-07-26 10:03 mauricio_peccorini New Issue
2019-07-26 10:03 mauricio_peccorini Assigned To => platform
2019-07-26 10:03 mauricio_peccorini File Added: PostgreSqlModelLoader.patch
2019-07-26 10:03 mauricio_peccorini Modules => Core
2019-07-26 10:03 mauricio_peccorini Triggers an Emergency Pack => No
2019-07-30 12:31 alostale Relationship added blocks 0041484
2019-07-31 13:20 hgbot Checkin
2019-07-31 13:20 hgbot Note Added: 0113734
2019-07-31 13:20 hgbot Status new => resolved
2019-07-31 13:20 hgbot Resolution open => fixed
2019-07-31 13:20 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/58004f8efa540f17758f4148ea71120eb5e62573 [^]
2019-07-31 13:21 hgbot Checkin
2019-07-31 13:21 hgbot Note Added: 0113736
2019-07-31 13:21 hgbot Checkin
2019-07-31 13:21 hgbot Note Added: 0113737
2019-07-31 13:21 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/58004f8efa540f17758f4148ea71120eb5e62573 [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/21e06878a298a5c2cce1c7c846be9462f01c95c2 [^]
2019-07-31 13:22 alostale Assigned To platform => alostale
2019-07-31 13:22 alostale Review Assigned To => caristu
2019-08-02 09:14 caristu Note Added: 0113774
2019-08-02 09:14 caristu Status resolved => closed
2019-08-02 09:14 caristu Fixed in Version => 3.0PR19Q4
2019-08-22 14:45 hudsonbot Checkin
2019-08-22 14:45 hudsonbot Note Added: 0114188
2019-08-22 14:45 hudsonbot Checkin
2019-08-22 14:45 hudsonbot Note Added: 0114190


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker