Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036902
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajorhave not tried2017-09-20 14:062017-09-22 13:26
ReporterasiermartirenaView Statuspublic 
Assigned Toinigosanchez 
PriorityimmediateResolutionfixedFixed in Version3.0PR17Q4
StatusclosedFix in branchFixed in SCM revision0e8f0e82bcd9
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression levelCoding ( Testing )
Regression date2017-09-14
Regression introduced in releasepi
Regression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/d936b7f0882f [^]
Triggers an Emergency PackNo
Summary

0036902: Update.database fails under some circumstances if a model change is defined

DescriptionUpdate.database fails if a model change such as columnSizeChange is defined in a configScript (Not all model changes generates the reported problem.) and the data is bigger than old size (defined in core) but smaller than new size.

This problem has been found trying to update a BUT Instance with the new fixed issue of DBSM (0036137).
Steps To Reproduce1.- Applied attached diff (columnSizeChange is done in description of AD_USER: 255 to 290) in pi
2.- Execute ant smartbuild -Dlocal=no -Dtr=no -> model change is applied properly.
3.- Update the value of description column for a user:
UPDATE ad_user SET description='{STRING_BIGGER_THAN_255_AND_SMALLER_THAN_290}' WHERE AD_USER_ID='167450A5BB284AB29C4FEF039E98C963';
4.- Execute ant smartbuild -Dlocal=no -Dtr=no again -> ERROR*

*The ERROR appears in the recreation of the table AD_USER, when it is tried to insert the data in the recreated table.
Proposed SolutionIt should be apply the configScript files properly BEFORE the 'platform.alterTables(originaldb, db, !isFailonerror());' method is invoked in update.database task.
TagsNo tags attached.
Attached Filesdiff file icon issue36902.diff [^] (626 bytes) 2017-09-20 16:56 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
caused by defect 0036137 closedinigosanchez [SER-QA 2918] Config script removeCheckChange are not applied on install.source 

-  Notes
(0099214)
hgbot (developer)
2017-09-21 15:08

Repository: erp/devel/dbsm-main
Changeset: e72db5668a01d3fcee179c1ba7f3b76100110ca8
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Wed Sep 20 17:09:41 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/e72db5668a01d3fcee179c1ba7f3b76100110ca8 [^]

Fixed issue 36902: Update.database+configScript fails under some circumstances

The problem was that update.database task fails under some circumstances if a model change
is defined in a configScript file. The problem has been found trying to update the database
in an instance with a columnSizeChange defined in the configScript file.

The problem was introduced in these improvements of DBSM sources (0036137). Before these
changesets on update.database task, the ModelChanges had been applied before and after the
platform.alterTables method was invoked. After these improvements were introduced into the
distribution, the ModelChanges had only applied after the platform.alterTables method was
invoked. (Only once)

The problem has been resolved by take into account this situation. Now the model changes are
applied (Data changes too) before platform.alterTables method is invoked in order to ensures
that when any table is recreated, all the model changes are applied properly.

---
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
---
(0099215)
hgbot (developer)
2017-09-21 15:09

Repository: erp/devel/dbsm-main
Changeset: e642cdd74ad2b1d11dbb0e9ea9c57b18e57ac8c3
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Sep 21 14:48:24 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/e642cdd74ad2b1d11dbb0e9ea9c57b18e57ac8c3 [^]

Related with issue 36902:Added test case and changes in the test infrastructure

On one hand it is added a test case for the reported regression. On the other hand several improvements in the test infrastructure have been done:
- now update.database of the test applys configScript files in the same moment as the update.database of the production.
- The final comparation in update.database task now it is realized as expected (model loaded from the db and model readed from the xml+configScript)
- Some methods have been moved to ConfigScriptBaseTest in order to avoid duplicated code.
- Now createDatabase method in DbsmTest applys configScript in the database (physically) too, not only in the model of the database.

---
M src-test/src/org/openbravo/dbsm/test/base/DbsmTest.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptBaseTest.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnDataChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnSizeChange.java
A src-test/data/configScriptsChangeSizeColumn/TEST.xml
---
(0099216)
hgbot (developer)
2017-09-21 15:13

Repository: erp/devel/pi
Changeset: 0e8f0e82bcd976a9988b821ca5bbd54cc7236d45
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Sep 21 14:53:58 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/0e8f0e82bcd976a9988b821ca5bbd54cc7236d45 [^]

Fixed issue 36902: Update.database+configScript fails under some circumstances

The problem was that update.database task fails under some circumstances if a model change
is defined in a configScript file. The problem has been found trying to update the database
in an instance with a columnSizeChange defined in the configScript file.

The problem was introduced in these improvements of DBSM sources (0036137). Before these
changesets on update.database task, the ModelChanges had been applied before and after the
platform.alterTables method was invoked. After these improvements were introduced into the
distribution, the ModelChanges had only applied after the platform.alterTables method was
invoked. (Only once)

The problem has been resolved by take into account this situation. Now the model changes are
applied (Data changes too) before platform.alterTables method is invoked in order to ensures
that when any table is recreated, all the model changes are applied properly.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0099451)
hudsonbot (developer)
2017-09-22 03:19

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/79f756868bba [^]
Maturity status: Test
(0099465)
alostale (manager)
2017-09-22 10:12

reopen: test fails after latest changes:

  org.openbravo.dbsm.test.model.recreation.PLCode.thereShouldNoBePLRecreationIfNotModified
(0099479)
hgbot (developer)
2017-09-22 12:31

Repository: erp/devel/dbsm-main
Changeset: 0feb46b0353da025e3675e426cbc4f6bd6320a5b
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Fri Sep 22 12:11:43 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/0feb46b0353da025e3675e426cbc4f6bd6320a5b [^]

Related with the issue 36902: Revert a change added by mistake

The reverted change is in test infraestructure. Also removed a comment.

---
M src-test/src/org/openbravo/dbsm/test/base/DbsmTest.java
---
(0099484)
alostale (manager)
2017-09-22 13:26

reviewed + tested

- Issue History
Date Modified Username Field Change
2017-09-20 14:06 asiermartirena New Issue
2017-09-20 14:06 asiermartirena Assigned To => inigosanchez
2017-09-20 14:06 asiermartirena Modules => Core
2017-09-20 14:06 asiermartirena Resolution time => 1506463200
2017-09-20 14:06 asiermartirena Regression level => Coding ( Testing )
2017-09-20 14:06 asiermartirena Regression date => 2017-09-14
2017-09-20 14:06 asiermartirena Regression introduced in release => pi
2017-09-20 14:06 asiermartirena Regression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/d936b7f0882f [^]
2017-09-20 14:06 asiermartirena Triggers an Emergency Pack => No
2017-09-20 14:49 inigosanchez Status new => acknowledged
2017-09-20 14:49 inigosanchez Status acknowledged => scheduled
2017-09-20 16:20 inigosanchez Steps to Reproduce Updated View Revisions
2017-09-20 16:20 inigosanchez Proposed Solution updated
2017-09-20 16:28 inigosanchez Summary Update database process doesn't apply length changes from templates => Update.database fails under some circumstances if a model change is defined
2017-09-20 16:28 inigosanchez Description Updated View Revisions
2017-09-20 16:28 inigosanchez Relationship added caused by 0036137
2017-09-20 16:56 inigosanchez File Added: issue36902.diff
2017-09-21 15:08 hgbot Checkin
2017-09-21 15:08 hgbot Note Added: 0099214
2017-09-21 15:08 hgbot Status scheduled => resolved
2017-09-21 15:08 hgbot Resolution open => fixed
2017-09-21 15:08 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/e72db5668a01d3fcee179c1ba7f3b76100110ca8 [^]
2017-09-21 15:09 hgbot Checkin
2017-09-21 15:09 hgbot Note Added: 0099215
2017-09-21 15:10 inigosanchez Review Assigned To => alostale
2017-09-21 15:13 hgbot Checkin
2017-09-21 15:13 hgbot Note Added: 0099216
2017-09-21 15:13 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/dbsm-main/rev/e72db5668a01d3fcee179c1ba7f3b76100110ca8 [^] => http://code.openbravo.com/erp/devel/pi/rev/0e8f0e82bcd976a9988b821ca5bbd54cc7236d45 [^]
2017-09-22 03:19 hudsonbot Checkin
2017-09-22 03:19 hudsonbot Note Added: 0099451
2017-09-22 10:12 alostale Note Added: 0099465
2017-09-22 10:12 alostale Status resolved => new
2017-09-22 10:12 alostale Resolution fixed => open
2017-09-22 10:14 alostale Priority urgent => immediate
2017-09-22 12:23 inigosanchez Status new => scheduled
2017-09-22 12:31 hgbot Checkin
2017-09-22 12:31 hgbot Note Added: 0099479
2017-09-22 13:26 alostale Status scheduled => resolved
2017-09-22 13:26 alostale Resolution open => fixed
2017-09-22 13:26 alostale Note Added: 0099484
2017-09-22 13:26 alostale Status resolved => closed
2017-09-22 13:26 alostale Fixed in Version => 3.0PR17Q4


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker