Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041503Openbravo ERPY. DBSourceManagerpublic2019-07-31 12:022019-08-22 14:45
mauricio_peccorini 
mauricio_peccorini 
lowminoralways
closedfixed 
5
 
3.0PR19Q4 
alostale
Core
No
0041503: DBSM doesn't handle not null BLOB columns correctly in Oracle
Oracle does not support changing the data type of a LOB column. As a result, the MODIFY COLUMN of an ALTER TABLE statement cannot include the data type when using one of the large object types.

During create.database DBSM issues statements to change the NULL or NOT NULL attribute of columns. When dealing with LOB columns it should not specify the data type. For example:
  ALTER TABLE OBSCHED_CALENDARS MODIFY CALENDAR BLOB NOT NULL
should be changed to:
  ALTER TABLE OBSCHED_CALENDARS MODIFY CALENDAR NOT NULL

This issue was already reported but it was only fixed for NOT NULL CLOB columns in: https://issues.openbravo.com/print_bug_page.php?bug_id=16713 [^]

The same solution should be applied for BLOB and NCLOB data types and for NULL columns.
1. Add a BLOB column to a database table
2. Export the database
3. Execute create.database
Modify the SqlBuilder to properly handle the different types of Large Object data types.

A proposed patch is included.
No tags attached.
blocks feature request 0041484 closed cberner make job scheduling clusterizable 
patch SqlBuilder.patch (3,215) 2019-07-31 12:13
https://issues.openbravo.com/file_download.php?file_id=13193&type=bug
Issue History
2019-07-31 12:02mauricio_peccoriniNew Issue
2019-07-31 12:02mauricio_peccoriniAssigned To => platform
2019-07-31 12:02mauricio_peccoriniFile Added: SqlBuilder.patch
2019-07-31 12:02mauricio_peccoriniModules => Core
2019-07-31 12:02mauricio_peccoriniTriggers an Emergency Pack => No
2019-07-31 12:03mauricio_peccoriniRelationship addedblocks 0041484
2019-07-31 12:13mauricio_peccoriniFile Deleted: SqlBuilder.patch
2019-07-31 12:13mauricio_peccoriniFile Added: SqlBuilder.patch
2019-08-02 14:06alostaleAssigned Toplatform => mauricio_peccorini
2019-08-02 14:06alostaleReview Assigned To => alostale
2019-08-07 10:49hgbotCheckin
2019-08-07 10:49hgbotNote Added: 0113866
2019-08-07 10:49hgbotStatusnew => resolved
2019-08-07 10:49hgbotResolutionopen => fixed
2019-08-07 10:49hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3c24ffd67ed161aff288655faee0517f5fe96e2c [^]
2019-08-07 10:50hgbotCheckin
2019-08-07 10:50hgbotNote Added: 0113867
2019-08-07 10:50hgbotCheckin
2019-08-07 10:50hgbotNote Added: 0113868
2019-08-07 10:50hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/3c24ffd67ed161aff288655faee0517f5fe96e2c [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/79fd9b1e2012f7ca9d0735b1411d393d682b6828 [^]
2019-08-07 10:50hgbotCheckin
2019-08-07 10:50hgbotNote Added: 0113869
2019-08-07 10:50hgbotCheckin
2019-08-07 10:50hgbotNote Added: 0113870
2019-08-09 09:00alostaleNote Added: 0113920
2019-08-09 09:00alostaleStatusresolved => closed
2019-08-09 09:00alostaleFixed in Version => 3.0PR19Q4
2019-08-22 14:45hudsonbotCheckin
2019-08-22 14:45hudsonbotNote Added: 0114212

Notes
(0113866)
hgbot   
2019-08-07 10:49   
Repository: erp/devel/pi
Changeset: 3c24ffd67ed161aff288655faee0517f5fe96e2c
Author: Mauricio Peccorini <mauricio.peccorini <at> openbravo.com>
Date: Wed Aug 07 10:48:18 2019 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3c24ffd67ed161aff288655faee0517f5fe96e2c [^]

fixed bug 41503: ORA cannot create DB with mandatory BLOB column

  When creating DB mandatory columns are first created as nullable to later be
  updated to not nullable. In case of *LOB objects in oracle this step was not
  correctly managed.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0113867)
hgbot   
2019-08-07 10:50   
Repository: erp/devel/dbsm-main
Changeset: 5788401bb2075e8760a666ef4292eed130dc6939
Author: Mauricio Peccorini <mauricio.peccorini <at> openbravo.com>
Date: Fri Aug 02 14:06:11 2019 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/5788401bb2075e8760a666ef4292eed130dc6939 [^]

related to issue 41503: added test case

---
M src-test/src/org/openbravo/dbsm/test/model/ModelSuite.java
A src-test/model/largeObjects/BLOB_TABLE_NOREQ.xml
A src-test/model/largeObjects/BLOB_TABLE_REQ.xml
A src-test/src/org/openbravo/dbsm/test/model/LargeObjects.java
---
(0113868)
hgbot   
2019-08-07 10:50   
Repository: erp/devel/dbsm-main
Changeset: 79fd9b1e2012f7ca9d0735b1411d393d682b6828
Author: Mauricio Peccorini <mauricio.peccorini <at> openbravo.com>
Date: Fri Aug 02 14:08:13 2019 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/79fd9b1e2012f7ca9d0735b1411d393d682b6828 [^]

fixed bug 41503: ORA cannot create DB with mandatory BLOB column

  When creating DB mandatory columns are first created as nullable to later be
  updated to not nullable. In case of *LOB objects in oracle this step was not
  correctly managed.

---
M src/org/apache/ddlutils/platform/SqlBuilder.java
---
(0113869)
hgbot   
2019-08-07 10:50   
Repository: erp/devel/dbsm-main
Changeset: c69a2dce04a47271ee418863b14c2fbdbf23ba44
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Aug 02 14:11:25 2019 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/c69a2dce04a47271ee418863b14c2fbdbf23ba44 [^]

related to issue 41503: removed some duplicity

---
M src/org/apache/ddlutils/platform/SqlBuilder.java
---
(0113870)
hgbot   
2019-08-07 10:50   
Repository: erp/devel/dbsm-main
Changeset: ec3c17db18fcd7bf8f6c4f7557c378046594bc22
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Aug 02 14:21:36 2019 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/ec3c17db18fcd7bf8f6c4f7557c378046594bc22 [^]

related to issue 41503: adds more test cases

---
M src-test/src/org/openbravo/dbsm/test/model/LargeObjects.java
---
(0113920)
alostale   
2019-08-09 09:00   
reviewed
(0114212)
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