Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0016713Openbravo ERPY. DBSourceManagerpublic2011-04-07 18:522012-04-01 20:37
marvintm 
marvintm 
normalminorhave not tried
closedfixed 
5
 
3.0MP10 
Core
No
0016713: DBSM doesn't handle not null CLOB columns correctly
An error is shown when doing create.database with a not null CLOB column:

SQL Command failed with: ORA-22296: invalid ALTER TABLE option for conversion of LONG datatype to LOB

-- END
ALTER TABLE OBUIAPP_NOTE MODIFY NOTE CLOB NOT NULL

The problem happens when dbsm tries to remove the NOT NULL constraint for the column.
No tags attached.
Issue History
2011-04-07 18:52marvintmNew Issue
2011-04-07 18:52marvintmAssigned To => marvintm
2011-04-07 18:52marvintmModules => Core
2011-04-07 18:57hgbotCheckin
2011-04-07 18:57hgbotNote Added: 0035748
2011-04-11 10:16alostaleStatusnew => scheduled
2011-04-11 10:16alostalefix_in_branch => pi
2011-11-22 21:43roklenardicIssue Monitored: roklenardic
2012-03-06 16:16hgbotCheckin
2012-03-06 16:16hgbotNote Added: 0046094
2012-03-06 16:16hgbotStatusscheduled => resolved
2012-03-06 16:16hgbotResolutionopen => fixed
2012-03-06 16:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/3b00e6c2cbb5f83698411727cbd210cc85ee8100 [^]
2012-03-06 16:25hgbotCheckin
2012-03-06 16:25hgbotNote Added: 0046097
2012-03-06 16:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/dbsm-main/rev/3b00e6c2cbb5f83698411727cbd210cc85ee8100 [^] => http://code.openbravo.com/erp/devel/pi/rev/166d61e84811936bdf1c85c74041974314d77931 [^]
2012-03-30 14:07AugustoMauchNote Added: 0046986
2012-03-30 14:07AugustoMauchStatusresolved => closed
2012-03-30 14:07AugustoMauchFixed in Version => 3.0MP10
2012-04-01 20:37hudsonbotCheckin
2012-04-01 20:37hudsonbotNote Added: 0047049

Notes
(0035748)
hgbot   
2011-04-07 18:57   
Repository: erp/devel/pi
Changeset: e5716dbd8be4ee7b1bd730693fb00bcbb4456f4f
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Apr 07 18:54:29 2011 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e5716dbd8be4ee7b1bd730693fb00bcbb4456f4f [^]

Make column non mandatory until issue 16713 is fixed.
Note: AD column is set as mandatory, so the user will not notice it

---
M modules/org.openbravo.client.application/src-db/database/model/tables/OBUIAPP_NOTE.xml
---
(0046094)
hgbot   
2012-03-06 16:16   
Repository: erp/devel/dbsm-main
Changeset: 3b00e6c2cbb5f83698411727cbd210cc85ee8100
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue Mar 06 16:15:29 2012 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/3b00e6c2cbb5f83698411727cbd210cc85ee8100 [^]

Fixed issue 16713. Change the way NOT NULLs for CLOB columns are handled in Oracle:
Before, CLOB columns were handled like the rest of the columns. Therefore, when disabling a NOT NULL column, a statement of the form: 'ALTER TABLE table MODIFY column CLOB NULL' statement was issued. However, this doesn't work in Oracle. The statement has now been changed to 'ALTER table MODIFY column NULL', which is a correct statement.
PostgreSQL behaviour has not been changed (notice that the changed methods are overridden in the PostgreSqlBuilder class).

---
M src/org/apache/ddlutils/platform/SqlBuilder.java
---
(0046097)
hgbot   
2012-03-06 16:25   
Repository: erp/devel/pi
Changeset: 166d61e84811936bdf1c85c74041974314d77931
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue Mar 06 16:23:15 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/166d61e84811936bdf1c85c74041974314d77931 [^]

Fixed issue 16713. Change the way NOT NULLs for CLOB columns are handled in Oracle:
> Before, CLOB columns were handled like the rest of the columns. Therefore, when disabling a NOT NULL column, a statement of the form: 'ALTER TABLE table MODIFY column CLOB NULL' statement was issued. However, this doesn't work in Oracle. The statement has now been changed to 'ALTER table MODIFY column NULL', which is a correct statement.
> PostgreSQL behaviour has not been changed (notice that the changed methods are overridden in the PostgreSqlBuilder class).

---
M src-db/database/lib/dbsourcemanager.jar
---
(0046986)
AugustoMauch   
2012-03-30 14:07   
Code reviewed a verified.

Test plan:
Both in postgresql and in Oracle:
- Add two clob columns to a table, one mandatory and the other one not mandatory.
- Export the changes. The new columns should be reflected in the xml of the table.
- Remove the columns from the database, and execute update.database. The columns should be added to the database.
- Give some values to the recently created columns. Add a new column in the xml files, and execute update.database. The new column should be added to the database, and the clob columns should not have lost its data.
(0047049)
hudsonbot   
2012-04-01 20:37   
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/640de9acc2d5 [^]

Maturity status: Test