Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029284Openbravo ERPY. DBSourceManagerpublic2015-03-16 09:532015-04-28 16:58
alostale 
alostale 
urgentmajoralways
closedfixed 
5
 
3.0PR15Q2 
AugustoMauch
Core
No
0029284: Oracle: onCretateDefault not executed for appended non mandatory columns
When a new non mandatory column with an onCreateDefault different to its default is appended, the new column has null values instead of the one defined in the onCretateDefault. OnCreateDefault should prevail over the default.

This can be reproduced in Oracle, in PostgreSQL it works as expected.

-For any non AD table add in xml files a non mandatory column with onCreateDefault 'A' and default 'B' (ensure this is the only change for that column in this table)
-Ensure this table has in DB at least one row
-Execute update.database
-Check new column values
   -> It is 'A' (default value) but it should be what onCreateDefault defines ('B')
No tags attached.
related to feature request 0029270 closed alostale prevent table recreation in update.database 
Issue History
2015-03-16 09:53alostaleNew Issue
2015-03-16 09:53alostaleAssigned To => alostale
2015-03-16 09:53alostaleModules => Core
2015-03-16 09:53alostaleTriggers an Emergency Pack => No
2015-03-16 10:09alostaleDescription Updatedbug_revision_view_page.php?rev_id=7973#r7973
2015-03-16 10:09alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7975#r7975
2015-03-16 10:10alostaleRelationship addedrelated to 0029270
2015-03-16 10:58hgbotCheckin
2015-03-16 10:58hgbotNote Added: 0075609
2015-03-16 10:58hgbotCheckin
2015-03-16 10:58hgbotNote Added: 0075610
2015-03-16 10:58hgbotStatusnew => resolved
2015-03-16 10:58hgbotResolutionopen => fixed
2015-03-16 10:58hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4a5316fc24e18a102a83a3ae651afc7108455dde [^]
2015-03-16 10:58hgbotCheckin
2015-03-16 10:58hgbotNote Added: 0075611
2015-03-16 10:58hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/4a5316fc24e18a102a83a3ae651afc7108455dde [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/21e9c00975191584b2914b24dd54401e82891d70 [^]
2015-03-16 23:53hudsonbotCheckin
2015-03-16 23:53hudsonbotNote Added: 0075667
2015-03-17 08:05alostaleReview Assigned To => AugustoMauch
2015-03-17 08:05alostaleDescription Updatedbug_revision_view_page.php?rev_id=8003#r8003
2015-03-17 08:05alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8004#r8004
2015-03-23 09:21AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=8061#r8061
2015-03-23 10:20AugustoMauchNote Added: 0075844
2015-03-23 10:20AugustoMauchStatusresolved => closed
2015-03-23 10:20AugustoMauchFixed in Version => 3.0PR15Q2
2015-04-28 16:58hgbotCheckin
2015-04-28 16:58hgbotNote Added: 0076835

Notes
(0075609)
hgbot   
2015-03-16 10:58   
Repository: erp/devel/dbsm-main
Changeset: 30c278456e796cfc43f89651e950615b28391f9f
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Mar 16 10:07:34 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/30c278456e796cfc43f89651e950615b28391f9f [^]

related to bug 29284: added test cases to cover onCreateDefault behavior

  Bug 0029284 makes two of these test cases fail in Oracle:

    nonMandatoryOnCreateDefault[DB: oracle - append](org.openbravo.dbsm.test.model.data.CreateDefault)
    java.lang.AssertionError: Value for column NM2
    Expected: "A"
         but: was null

    nonMandatoryDifferentDefaultAndOnCreateDefault[DB: oracle - append](org.openbravo.dbsm.test.model.data.CreateDefault)
    java.lang.AssertionError: Value for column NM4
    Expected: "B"
         but: was "A"

---
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/createDefault/BASE_MODEL.xml
A src-test/model/createDefault/BASE_MODEL2.xml
A src-test/model/createDefault/M1.xml
A src-test/model/createDefault/M2.xml
A src-test/model/createDefault/M3.xml
A src-test/model/createDefault/M4.xml
A src-test/model/createDefault/NM1.xml
A src-test/model/createDefault/NM2.xml
A src-test/model/createDefault/NM3.xml
A src-test/model/createDefault/NM4.xml
A src-test/src/org/openbravo/dbsm/test/model/data/CreateDefault.java
---
(0075610)
hgbot   
2015-03-16 10:58   
Repository: erp/devel/pi
Changeset: 4a5316fc24e18a102a83a3ae651afc7108455dde
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Mar 16 10:34:58 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/4a5316fc24e18a102a83a3ae651afc7108455dde [^]

fixed bug 29284: onCreateDefault not executed for appended non mandatory cols

  In Oracle new non mandatory columns with a onCreateDefault appended to a table
  did not execute the onCreateDefault.

  Current fix recreates the whole table in this case. A complete fix where the
  onCreateDefault is executed in this case without the need of recreating the table
  will be implemented in the scope of the "Prevent Table Recreation" project (see
  issue 0029270).

---
M src-db/database/lib/dbsourcemanager.jar
---
(0075611)
hgbot   
2015-03-16 10:58   
Repository: erp/devel/dbsm-main
Changeset: 21e9c00975191584b2914b24dd54401e82891d70
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Mar 16 10:32:39 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/21e9c00975191584b2914b24dd54401e82891d70 [^]

fixed bug 29284: onCreateDefault not executed for appended non mandatory cols

  In Oracle new non mandatory columns with a onCreateDefault appended to a table
  did not execute the onCreateDefault.

  Current fix recreates the whole table in this case. A complete fix where the
  onCreateDefault is executed in this case without the need of recreating the table
  will be implemented in the scope of the "Prevent Table Recreation" project (see
  issue 0029270).

---
M src/org/apache/ddlutils/platform/oracle/Oracle8Builder.java
---
(0075667)
hudsonbot   
2015-03-16 23:53   
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/28f92fd2fba0 [^]
Maturity status: Test
(0075844)
AugustoMauch   
2015-03-23 10:20   
Code reviewed and verified in pi@b7fd6844f03f
(0076835)
hgbot   
2015-04-28 16:58   
Repository: erp/devel/dbsm-main
Changeset: 78ed6f6270318043734bd11e5ae7346a71a5bcc0
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Mar 17 10:24:19 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/78ed6f6270318043734bd11e5ae7346a71a5bcc0 [^]

[recreation] related to bug 29284

  Oracle: prevent table recreation for non mandatory tables with onCreateDefault

---
M src/org/apache/ddlutils/platform/SqlBuilder.java
M src/org/apache/ddlutils/platform/oracle/Oracle8Builder.java
---