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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036137
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagermajoralways2017-05-30 14:132017-09-21 16:50
ReporteradrianromeroView Statuspublic 
Assigned Toinigosanchez 
PriorityurgentResolutionfixedFixed in Version3.0PR17Q4
StatusclosedFix in branchFixed in SCM revisiond936b7f0882f
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToAugustoMauch
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036137: [SER-QA 2918] Config script removeCheckChange are not applied on install.source

DescriptionconfigScript entries that remove check constraints are not applied on install.source.

Executing the build task install.source with sample data that does not comply with a check constraint removed in a configScript.xml file throws an error. In any case, the build tasks ends with a success message
Steps To Reproduce* Clone a pi repository
* Configure the Openbravo.properties file
* Apply the attacked diff dbsourcemanager-removecheck.diff to force the error. This changeset does the following:
** Modifies configScript.xml to remove a check constraint
** Modifies sample date to fail if the previous check constraint is activated.
* Execute the build task install.source
* Observe the build task ends successfully but the following error appears in the build log. The log is attached.

Enabling constraints...
   Enabling check constraints
Batch statement failed. Rolling back and retrying all the statements in a non-batched connection.
SQL Command failed with: ERROR: la restricción «check» «a_amortization_isactive_check» es violada por alguna fila
-- END
ALTER TABLE A_AMORTIZATION
    ADD CONSTRAINT A_AMORTIZATION_ISACTIVE_CHECK CHECK (ISACTIVE IN ('Y', 'N'))
Executed 2362 SQL command(s) with 1 error(s)

If afterwards, update.database is executed, the constraint is removed.
TagsSER-QA
Attached Filesdiff file icon dbsourcemanager-removecheck.diff [^] (1,517 bytes) 2017-05-30 14:13 [Show Content]
txt file icon installsource.txt [^] (117,046 bytes) 2017-05-30 14:13 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0032921 closedinigosanchez Openbravo ERP Constraint and trigger remain after being eliminated in a template 
related to defect 0030489 closedinigosanchez Openbravo ERP configScript(retail.pack) seems not applied when doing install.source 
has duplicate defect 0010839 closedmarvintm Modules REMOVE CONSTRAINTS ON TABLES C_BANK, C_BANKACCOUNT 
related to defect 0036112 closedinigosanchez Openbravo ERP excludeFilter + manual db object creation does not work when installing module during install.source 
related to design defect 0034102 closedplatform Openbravo ERP Update.database and Install.Source tasks should use the same flow to create the database and the db model 
causes defect 0036902 closedinigosanchez Openbravo ERP Update.database fails under some circumstances if a model change is defined 
causes defect 0036950 closedinigosanchez Openbravo ERP CheckAPIDistribution task is not working as expected 

-  Notes
(0097253)
hgbot (developer)
2017-06-08 19:40

Repository: erp/devel/dbsm-main
Changeset: caf3e0060501d4d483ff097b34f22e4104707c17
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Jun 08 19:35:10 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/caf3e0060501d4d483ff097b34f22e4104707c17 [^]

Related to bug 36137: Added test case and some clean up.

- A test has been added.
- Some code has been removed because update.database and Install.Source
tasks should use the same flow to create the database and the db model.
When the issue 0034102 will fixed this code would be obsolete.

---
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/ConfigScriptColumnRequiredChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnSizeChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveCheckChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveIndexChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveTriggerChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptSuite.java
A src-test/model/removeCheckChange/BASE_MODEL_CHECK_CONSTRAINT.xml
A src-test/model/removeCheckChange/configScript.xml
A src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveCheckChangeConstraint.java
---
(0097254)
hgbot (developer)
2017-06-08 19:40

Repository: erp/devel/dbsm-main
Changeset: fc5a3b89948e267c597a5b0a8f5ab87f9c9ad4c0
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Jun 08 19:39:16 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/fc5a3b89948e267c597a5b0a8f5ab87f9c9ad4c0 [^]

related to bug 36137:ConfigScript with removeCheckChange on installsource fails

When applying data changes (RemoveCheckChange) of a Configuration Script on install.source
the changes was not take into account and no errors thrown.

This happend because code for install.source task is different than update.database task.
A design defect issue 0034102 has been reported in order to fix this problem in a complete way.

The problem has been solved using the same logic which is being used on update.database. Now
applyConfigScriptModelChanges method is take into account RemoveCheckChange changes.

---
M src/org/apache/ddlutils/platform/PlatformImplBase.java
---
(0097256)
hgbot (developer)
2017-06-08 20:46

Repository: erp/devel/pi
Changeset: ab2414306cbc019eb9a8e6b93bc95448a74b74dd
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Jun 08 20:46:16 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ab2414306cbc019eb9a8e6b93bc95448a74b74dd [^]

Fixes issue 36137: ConfigScript with removeCheckChange on install.source fails

---
M src-db/database/lib/dbsourcemanager.jar
---
(0097266)
hudsonbot (developer)
2017-06-09 02:49

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/682983c2eead [^]
Maturity status: Test
(0097305)
hgbot (developer)
2017-06-12 12:21

Repository: erp/devel/dbsm-main
Changeset: 124639134186a84bc31bcf3ceb8c83acdf813250
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Mon Jun 12 12:20:23 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/124639134186a84bc31bcf3ceb8c83acdf813250 [^]

Related with issue 36137: Apply code review improvements to the test.

---
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptBaseTest.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveCheckChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptSuite.java
R src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveCheckChangeConstraint.java
---
(0097329)
caristu (developer)
2017-06-12 20:03

Problem still can be reproduced:

https://docs.google.com/spreadsheets/d/18l2biKWeG6iGDIPqO6VuYQ_TtP_6YxyQU4KSrPvQlJ8/edit#gid=0 [^]
(0098470)
inigosanchez (developer)
2017-08-10 11:33

Added a test in TestLink: Platform > [DBSM] DBSourceManager > ConfigScripts > RemoveCheckChange is not applied on install.source
(0098933)
inigosanchez (developer)
2017-09-11 11:08

Document all the API changes (logical or not):
-DBSMOBUtil.loadDataStructures method is not executed DBSMOBUtil.applyConfigScripts anymore.
-AlterDatabaseDataAll.readDatabaseModel method is take into account model changes defined in configScript files while reading the model from XML files.
-CreateXML2SQL task is take into account model changes defined in configScript files.
-ImportSampledata task is take into account model changes defined in configScript files.
-Now CheckAPIDistribution task is take into account model changes defined in configScript files.
(0099034)
hgbot (developer)
2017-09-14 12:38

Repository: erp/devel/dbsm-main
Changeset: 5a5cd2a390fc17e319e4e52b080dc03ca4e64f75
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Sep 14 12:23:40 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/5a5cd2a390fc17e319e4e52b080dc03ca4e64f75 [^]

Fixed issue 36137: Config scripts are not applied on install.source

The problem was that config scripts could not be applied on install source task at the same way
that update.database task. The problem was in ImportSampledata because this task was not be able
to load the database model applying the config script files. Now this problem has been fixed
because ImportSampledata task read the database model from xml taking into account any model
changes defined in the configScript files.

Besides, it have been implemented new model changes unsupported till now: RemoveTriggerChange,
RemoveIndexChange, ColumnRequiredChange and RemoveCheckChange.

This fix introduced also some important changes:
- DBSMOBUtil.loadDataStructures method is not executed DBSMOBUtil.applyConfigScripts anymore.
- AlterDatabaseDataAll.readDatabaseModel method is take into account model changes defined in
configScript files while reading the model from XML files.
- CreateXML2SQL task is take into account model changes defined in configScript files.
- ImportSampledata task is take into account model changes defined in configScript files.
- Now CheckAPIDistribution task is take into account model changes defined in configScript files.

---
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/ConfigScriptColumnRequiredChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptColumnSizeChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveCheckChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveIndexChange.java
M src-test/src/org/openbravo/dbsm/test/configscript/ConfigScriptRemoveTriggerChange.java
M src/org/apache/ddlutils/platform/PlatformImplBase.java
M src/org/apache/ddlutils/platform/SqlBuilder.java
M src/org/apache/ddlutils/platform/oracle/Oracle8Builder.java
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlBuilder.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataMod.java
M src/org/openbravo/ddlutils/task/AlterXML2SQL.java
M src/org/openbravo/ddlutils/task/CheckAPI.java
M src/org/openbravo/ddlutils/task/CheckAPIDistribution.java
M src/org/openbravo/ddlutils/task/CreateDatabase.java
M src/org/openbravo/ddlutils/task/CreateXML2SQL.java
M src/org/openbravo/ddlutils/task/DatabaseUtils.java
M src/org/openbravo/ddlutils/task/ExportConfigScript.java
M src/org/openbravo/ddlutils/task/ExportDatabase.java
M src/org/openbravo/ddlutils/task/ExportSampledata.java
M src/org/openbravo/ddlutils/task/ImportSampledata.java
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
A src-test/model/configScripts/columnRequiredChange/configScript.xml
A src-test/model/configScripts/columnSizeChange/configScript.xml
A src-test/model/configScripts/removeCheckChange/BASE_MODEL_CHECK_CONSTRAINT.xml
A src-test/model/configScripts/removeCheckChange/configScript.xml
A src-test/model/configScripts/removeIndexChange/configScript.xml
A src-test/model/configScripts/removeTriggerChange/BASE_MODEL_TRIGGER.xml
A src-test/model/configScripts/removeTriggerChange/configScript.xml
R src-test/model/removeCheckChange/BASE_MODEL_CHECK_CONSTRAINT.xml
R src-test/model/removeCheckChange/configScript.xml
---
(0099035)
hgbot (developer)
2017-09-14 12:38

Repository: erp/devel/pi
Changeset: d936b7f0882fc286f9244d241514a3d6cb8d3f48
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Sep 14 12:37:20 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d936b7f0882fc286f9244d241514a3d6cb8d3f48 [^]

Fixes issue 36137: Config scripts are not applied on install.source

The problem was that config scripts could not be applied on install source task at the same way
that update.database task. The problem was in ImportSampledata because this task was not be able
to load the database model applying the config script files. Now this problem has been fixed
because ImportSampledata task read the database model from xml taking into account any model
changes defined in the configScript files.

Besides, it have been implemented new model changes unsupported till now: RemoveTriggerChange,
RemoveIndexChange, ColumnRequiredChange and RemoveCheckChange.

This fix introduced also some important changes:
-DBSMOBUtil.loadDataStructures method is not executed DBSMOBUtil.applyConfigScripts anymore.
-AlterDatabaseDataAll.readDatabaseModel method is take into account model changes defined in
configScript files while reading the model from XML files.
-CreateXML2SQL task is take into account model changes defined in configScript files.
-ImportSampledata task is take into account model changes defined in configScript files.
-Now CheckAPIDistribution task is take into account model changes defined in configScript files.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0099063)
AugustoMauch (developer)
2017-09-15 11:02

Code reviewed and verified: https://docs.google.com/spreadsheets/d/1UpyuAaM8FD9ga41HbCpjrEgaPp6jqVbMmgDoFd6xPqg/edit [^]
(0099392)
hudsonbot (developer)
2017-09-21 16:50

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/9750b78d3e5c [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-05-30 14:13 adrianromero New Issue
2017-05-30 14:13 adrianromero Assigned To => platform
2017-05-30 14:13 adrianromero Modules => Core
2017-05-30 14:13 adrianromero Triggers an Emergency Pack => No
2017-05-30 14:13 adrianromero File Added: dbsourcemanager-removecheck.diff
2017-05-30 14:13 adrianromero File Added: installsource.txt
2017-05-30 14:14 adrianromero Steps to Reproduce Updated View Revisions
2017-05-30 14:14 adrianromero Proposed Solution updated
2017-05-30 14:15 adrianromero Steps to Reproduce Updated View Revisions
2017-05-30 14:15 adrianromero Tag Attached: SER-QA
2017-05-30 14:21 adrianromero Summary Config script entries removeCheckChange are not properly processed => [SER-QA 2918] Config script entries removeCheckChange are not properly processed
2017-06-02 11:26 alostale Summary [SER-QA 2918] Config script entries removeCheckChange are not properly processed => [SER-QA 2918] Config script removeCheckChange are not applied on install.source
2017-06-02 11:26 alostale Description Updated View Revisions
2017-06-02 11:26 alostale Steps to Reproduce Updated View Revisions
2017-06-02 11:26 alostale Status new => acknowledged
2017-06-02 11:27 alostale Relationship added related to 0036112
2017-06-05 13:31 inigosanchez Status acknowledged => scheduled
2017-06-05 13:31 inigosanchez Assigned To platform => inigosanchez
2017-06-05 19:23 inigosanchez Relationship added blocks 0010839
2017-06-05 19:23 inigosanchez Relationship deleted blocks 0010839
2017-06-05 19:23 inigosanchez Relationship added related to 0010839
2017-06-06 17:43 inigosanchez Relationship added related to 0034102
2017-06-08 13:11 inigosanchez Relationship replaced has duplicate 0010839
2017-06-08 19:37 inigosanchez Review Assigned To => caristu
2017-06-08 19:40 hgbot Checkin
2017-06-08 19:40 hgbot Note Added: 0097253
2017-06-08 19:40 hgbot Checkin
2017-06-08 19:40 hgbot Note Added: 0097254
2017-06-08 20:46 hgbot Checkin
2017-06-08 20:46 hgbot Note Added: 0097256
2017-06-08 20:46 hgbot Status scheduled => resolved
2017-06-08 20:46 hgbot Resolution open => fixed
2017-06-08 20:46 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ab2414306cbc019eb9a8e6b93bc95448a74b74dd [^]
2017-06-09 02:49 hudsonbot Checkin
2017-06-09 02:49 hudsonbot Note Added: 0097266
2017-06-12 12:21 hgbot Checkin
2017-06-12 12:21 hgbot Note Added: 0097305
2017-06-12 20:03 caristu Note Added: 0097329
2017-06-12 20:03 caristu Status resolved => new
2017-06-12 20:03 caristu Resolution fixed => open
2017-06-13 10:05 inigosanchez Status new => scheduled
2017-07-26 11:24 alostale Relationship added related to 0032921
2017-08-10 11:33 inigosanchez Note Added: 0098470
2017-09-07 12:37 alostale Relationship added related to 0030489
2017-09-11 11:08 inigosanchez Note Added: 0098933
2017-09-14 12:38 hgbot Checkin
2017-09-14 12:38 hgbot Note Added: 0099034
2017-09-14 12:38 hgbot Status scheduled => resolved
2017-09-14 12:38 hgbot Resolution open => fixed
2017-09-14 12:38 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/ab2414306cbc019eb9a8e6b93bc95448a74b74dd [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/5a5cd2a390fc17e319e4e52b080dc03ca4e64f75 [^]
2017-09-14 12:38 hgbot Checkin
2017-09-14 12:38 hgbot Note Added: 0099035
2017-09-14 12:38 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/dbsm-main/rev/5a5cd2a390fc17e319e4e52b080dc03ca4e64f75 [^] => http://code.openbravo.com/erp/devel/pi/rev/d936b7f0882fc286f9244d241514a3d6cb8d3f48 [^]
2017-09-14 12:39 inigosanchez Review Assigned To caristu => AugustoMauch
2017-09-15 11:02 AugustoMauch Note Added: 0099063
2017-09-15 11:02 AugustoMauch Status resolved => closed
2017-09-15 11:02 AugustoMauch Fixed in Version => 3.0PR17Q4
2017-09-20 16:28 inigosanchez Relationship added causes 0036902
2017-09-21 16:50 hudsonbot Checkin
2017-09-21 16:50 hudsonbot Note Added: 0099392
2017-09-26 10:08 inigosanchez Relationship added causes 0036950


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker