Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014020Openbravo ERPY. DBSourceManagerpublic2010-07-21 13:102012-09-24 23:32
marvintm 
marvintm 
normalmajoralways
scheduledopen 
5
 
 
Core
No
0014020: oncreatedefaults which reference other columns from the same record are not correctly executed
Oncreatedefault expressions which reference other columns of the same record are not correctly executed. This happens because oncreatedefaults are currently used in two different kind of sql statements:

- UPDATE table SET column=(oncreatedefault) WHERE column IS NULL

- INSERT INTO table (c1, c2, ..., cn) SELECT (v1, v2, ..., oncreatedefault) FROM table_

This second statement will not work with oncreatedefaults which make a reference to the table. However, this second statements are actually not needed anymore, because of a previous change in the execution of NOT NULL constraints.

No tags attached.
related to design defect 0014157 scheduled marvintm Check constraints should be disabled so that oncreatedefaults can work correctly 
related to defect 0014193 closed alostale Oncreatedefault for column commercial_tier in ad_module is illegal, because it references other columns 
Issue History
2010-07-21 13:10marvintmNew Issue
2010-07-21 13:10marvintmAssigned To => marvintm
2010-07-21 13:13hgbotCheckin
2010-07-21 13:13hgbotNote Added: 0029437
2010-07-21 13:13hgbotStatusnew => resolved
2010-07-21 13:13hgbotResolutionopen => fixed
2010-07-21 13:13hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/c8ea94ac56969b1381987094b871ab17cd584bb9 [^]
2010-07-21 13:14hgbotCheckin
2010-07-21 13:14hgbotNote Added: 0029438
2010-07-21 13:14hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/dbsm-main/rev/c8ea94ac56969b1381987094b871ab17cd584bb9 [^] => http://code.openbravo.com/erp/devel/pi/rev/220470337d06980a66996b02fc1f7db9f951250d [^]
2010-07-27 15:41hudsonbotCheckin
2010-07-27 15:41hudsonbotNote Added: 0029593
2010-07-29 12:10alostaleStatusresolved => closed
2010-07-29 12:10alostaleFixed in Version => 2.50MP21
2010-07-30 00:00anonymoussf_bug_id0 => 3036811
2010-08-16 09:55marvintmNote Added: 0029980
2010-08-16 09:55marvintmStatusclosed => new
2010-08-16 09:55marvintmResolutionfixed => open
2010-08-16 09:55marvintmFixed in Version2.50MP21 =>
2010-08-16 09:58hgbotCheckin
2010-08-16 09:58hgbotNote Added: 0029982
2010-08-16 10:01marvintmRelationship addedrelated to 0014193
2010-08-16 10:02hgbotCheckin
2010-08-16 10:02hgbotNote Added: 0029987
2010-08-16 22:29hudsonbotCheckin
2010-08-16 22:29hudsonbotNote Added: 0030036
2010-08-30 09:02alostaleStatusnew => scheduled
2012-02-22 15:23marvintmTypedefect => design defect
2012-09-10 15:50alostaleRelationship addedrelated to 0014157
2012-09-24 23:32AugustoMauchNote Added: 0052488
2012-09-24 23:32AugustoMauchPriorityurgent => normal

Notes
(0029437)
hgbot   
2010-07-21 13:13   
Repository: erp/devel/dbsm-main
Changeset: c8ea94ac56969b1381987094b871ab17cd584bb9
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Wed Jul 21 13:12:26 2010 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/c8ea94ac56969b1381987094b871ab17cd584bb9 [^]

Fixed issue 14020. oncreatedefaults which reference other columns should work now.
The main change basically has been not to execute the oncreatedefault on the INSERT SELECT statement which is executed when a table is recreated. This will allow oncreatedefaults which reference other tables and columns to work, and the statements shouldn't be needed anyway, because the same oncreatedefault is executed at the end of the update.database process, and the NOT NULL constraints are not activated when the data is copied.

---
M src/org/apache/ddlutils/platform/SqlBuilder.java
---
(0029438)
hgbot   
2010-07-21 13:14   
Repository: erp/devel/pi
Changeset: 220470337d06980a66996b02fc1f7db9f951250d
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Wed Jul 21 13:13:07 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/220470337d06980a66996b02fc1f7db9f951250d [^]

Fixed issue 14020. oncreatedefaults which reference other columns should work now.
> The main change basically has been not to execute the oncreatedefault on the INSERT SELECT statement which is executed when a table is recreated. This will allow oncreatedefaults which reference other tables and columns to work, and the statements shouldn't be needed anyway, because the same oncreatedefault is executed at the end of the update.database process, and the NOT NULL constraints are not activated when the data is copied.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0029593)
hudsonbot   
2010-07-27 15:41   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/220470337d06 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/634cc0909ed2 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17922.obx [^]
(0029980)
marvintm   
2010-08-16 09:55   
Due to this issue:

https://issues.openbravo.com/view.php?id=14157 [^]

this fix is a problem when installing modules which do not yet contain information for some columns with oncreatedefaults and check constraints (such as the iscommercial column). Therefore, the fix will be reverted until the issue is fixed.
(0029982)
hgbot   
2010-08-16 09:58   
Repository: erp/devel/dbsm-main
Changeset: 2516e1a6419edc3b329d40147e3fbef00b199f8c
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon Aug 16 09:58:20 2010 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/2516e1a6419edc3b329d40147e3fbef00b199f8c [^]

Reverted change related to issue 14020.
Will do the change after the issue 14157 is fixed.

---
M src/org/apache/ddlutils/platform/SqlBuilder.java
---
(0029987)
hgbot   
2010-08-16 10:02   
Repository: erp/devel/pi
Changeset: 5faedaed0aafa587ca1f9e3302a86d2935a8fac5
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon Aug 16 10:02:04 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/5faedaed0aafa587ca1f9e3302a86d2935a8fac5 [^]

Reverted change related to issue 14020.
Will do the change after the issue 14157 is fixed.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0030036)
hudsonbot   
2010-08-16 22:29   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/5faedaed0aaf [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/cb95e054be79 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18165.obx [^]
(0052488)
AugustoMauch   
2012-09-24 23:32   
Effort: 5
Impact: low
Plan: mid