Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0044069Openbravo ERPY. DBSourceManagerpublic2020-05-14 17:482020-05-29 08:45
guillermogil 
alostale 
normalmajoralways
closedfixed 
5
3.0PR20Q1.1 
PR20Q3 
caristu
Core
No
0044069: If there is a change of size of a column in a template it fails in Oracle
If there is a change of size of a column in a template it fails in Oracle with the following error:
ALTER TABLE C_BPARTNER_LOCATION MODIFY NAME NVARCHAR2(100) NOT NULL
Seems to be modifying the nullable property instead of only the size.

Error can be seen here:
https://builds.openbravo.com/job/mod-simple/6787/ [^]
Generate an Config script like the following:

<?xml version="1.0"?>
  <vector>
    <versionInfo version="3.0.35625"/>
    <columnSizeChange tablename="C_BPARTNER_LOCATION" columnname="NAME" newSize="100" oldSize="60"/>
    <columnSizeChange tablename="C_LOCATION" columnname="ADDRESS1" newSize="100" oldSize="60"/>
    <columnDataChange tablename="AD_COLUMN" columnname="FIELDLENGTH" pkRow="817">
      <oldValue><![CDATA[60]]></oldValue>
      <newValue><![CDATA[100]]></newValue>
    </columnDataChange>
    <columnDataChange tablename="AD_COLUMN" columnname="FIELDLENGTH" pkRow="2960">
      <oldValue><![CDATA[60]]></oldValue>
      <newValue><![CDATA[100]]></newValue>
    </columnDataChange>
  </vector>

Do an install.source in Oracle.
Following error raises:
[createdatabase] 209384 [main] WARN org.apache.ddlutils.platform.OracleStandardBatchEvaluator - SQL Command failed with: ORA-01442: column to be modified to NOT NULL is already NOT NULL
[createdatabase]
[createdatabase] 209384 [main] WARN org.apache.ddlutils.platform.OracleStandardBatchEvaluator - -- END
[createdatabase] ALTER TABLE C_BPARTNER_LOCATION MODIFY NAME NVARCHAR2(100) NOT NULL
No tags attached.
Issue History
2020-05-14 17:48guillermogilNew Issue
2020-05-14 17:48guillermogilAssigned To => platform
2020-05-14 17:48guillermogilModules => Core
2020-05-14 17:48guillermogilTriggers an Emergency Pack => No
2020-05-15 07:13guillermogilResolution time => 1591221600
2020-05-15 09:16alostaleNote Added: 0119906
2020-05-15 09:16alostaleAssigned Toplatform => alostale
2020-05-15 09:16alostaleStatusnew => acknowledged
2020-05-15 09:16alostaleReview Assigned To => caristu
2020-05-19 15:31hgbotCheckin
2020-05-19 15:31hgbotNote Added: 0120043
2020-05-19 15:31hgbotStatusacknowledged => resolved
2020-05-19 15:31hgbotResolutionopen => fixed
2020-05-19 15:31hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/2a5eb79c1afbc677c392363c99d1cb93f23021a1 [^]
2020-05-29 08:45caristuNote Added: 0120444
2020-05-29 08:45caristuStatusresolved => closed
2020-05-29 08:45caristuFixed in Version => 3.0PR20Q3

Notes
(0119906)
alostale   
2020-05-15 09:16   
MR: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/9 [^]
(0120043)
hgbot   
2020-05-19 15:31   
Repository: erp/devel/pi
Changeset: 2a5eb79c1afbc677c392363c99d1cb93f23021a1
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue May 19 15:31:03 2020 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/2a5eb79c1afbc677c392363c99d1cb93f23021a1 [^]

fixed BUG-44069: mandatory column size change in config script fails in ORA

When a config script includes a size change for a mandatory column, it
fails to be applied in Oracle. The alter statement that DBSM produces,
includes NOT NULL together with the actual modification. This is not
allowed in Oracle causing the failure.

It is fixed by using the deferNotNull option when writing the statement.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0120444)
caristu   
2020-05-29 08:45   
Reviewed