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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034131
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagermajorhave not tried2016-09-29 16:092016-09-30 19:07
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PriorityurgentResolutionfixedFixed in Version3.0PR16Q4
StatusclosedFix in branchFixed in SCM revisionc2059804fd2c
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0034131: can't export database in verbose mode if there's a config script changing a column to nullable

DescriptionIf there is a config script that changes a column from not null to null (or in the other way around), when trying to export DB a NPE is thrown and the process stops in case bbdd.verbosity is set to debug.
Steps To Reproduce1. Install attached template
2. Set bbdd.verbosity=DEBUG in Openbravo.properties
3. run ant export.database
  -> NPE is thrown:
/opt/OpenbravoERP/build.xml:787: The following error occurred while executing this line:
/opt/OpenbravoERP/src-db/database/build.xml:159: java.lang.NullPointerException
    at org.apache.ddlutils.alteration.ColumnRequiredChange.toString(ColumnRequiredChange.java:122)
    at java.lang.String.valueOf(String.java:2849)
    at java.lang.StringBuilder.append(StringBuilder.java:128)
    at org.openbravo.utils.OBLogAppender.append(OBLogAppender.java:95)
    at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
    at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
    at org.apache.log4j.Category.callAppenders(Category.java:206)
    at org.apache.log4j.Category.forcedLog(Category.java:391)
    at org.apache.log4j.Category.debug(Category.java:260)
    at org.openbravo.ddlutils.util.DBSMOBUtil.applyConfigScripts(DBSMOBUtil.java:997)
    at org.openbravo.ddlutils.util.DBSMOBUtil.loadDataStructures(DBSMOBUtil.java:928)
    at org.openbravo.ddlutils.util.DBSMOBUtil.loadDataStructures(DBSMOBUtil.java:896)
    at org.openbravo.ddlutils.util.DBSMOBUtil.loadDataStructures(DBSMOBUtil.java:890)
TagsNo tags attached.
Attached Files? file icon org.openbravo.test.template-0.0.0.obx [^] (2,169 bytes) 2016-09-30 09:12

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0034102 closedplatform Update.database and Install.Source tasks should use the same flow to create the database and the db model 
related to feature request 0034138 closedcaristu Create a Test Suite for Configuration Scripts 
related to defect 0034144 closedcaristu Prevent NPE on RemoveTriggerChange toString() method 

-  Notes
(0090400)
hgbot (developer)
2016-09-30 09:26

Repository: erp/devel/dbsm-main
Changeset: 9ea2ed34264c8659fccac2445b8692a375cd44ea
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Sep 30 09:20:16 2016 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/9ea2ed34264c8659fccac2445b8692a375cd44ea [^]

fixed bug 34131: NPE exporting DB with template change for column required

  A NPE was thrown and export.database process stopped in case there was a config
  script with a change for column required and the log level was set to debug.

  The problem was in ColumnRequiredChange.toString which assumed _column to be
  not null, which is not true in all cases.

  Fixed by being deffensive on this case. Also improved information in toString
  by adding table name and new required value.

---
M src/org/apache/ddlutils/alteration/ColumnRequiredChange.java
---
(0090401)
hgbot (developer)
2016-09-30 09:27

Repository: erp/devel/pi
Changeset: c2059804fd2c23c306a39dbb7c9281a09dfc8568
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Sep 30 09:26:25 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c2059804fd2c23c306a39dbb7c9281a09dfc8568 [^]

fixed bug 34131: NPE exporting DB with template change for column required

  A NPE was thrown and export.database process stopped in case there was a config
  script with a change for column required and the log level was set to debug.

  The problem was in ColumnRequiredChange.toString which assumed _column to be
  not null, which is not true in all cases.

  Fixed by being deffensive on this case. Also improved information in toString
  by adding table name and new required value.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0090407)
caristu (developer)
2016-09-30 09:59

Code review + testing OK
(0090441)
hudsonbot (developer)
2016-09-30 19:07

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

- Issue History
Date Modified Username Field Change
2016-09-29 16:09 alostale New Issue
2016-09-29 16:09 alostale Assigned To => platform
2016-09-29 16:09 alostale Modules => Core
2016-09-29 16:09 alostale Triggers an Emergency Pack => No
2016-09-29 16:13 alostale Description Updated View Revisions
2016-09-29 16:13 alostale Steps to Reproduce Updated View Revisions
2016-09-30 09:12 alostale Assigned To platform => alostale
2016-09-30 09:12 alostale File Added: org.openbravo.test.template-0.0.0.obx
2016-09-30 09:14 alostale Summary can't export database if there's a config script changing a column to nullable => can't export database in verbose mode if there's a config script changing a column to nullable
2016-09-30 09:14 alostale Description Updated View Revisions
2016-09-30 09:14 alostale Steps to Reproduce Updated View Revisions
2016-09-30 09:26 hgbot Checkin
2016-09-30 09:26 hgbot Note Added: 0090400
2016-09-30 09:26 hgbot Status new => resolved
2016-09-30 09:26 hgbot Resolution open => fixed
2016-09-30 09:26 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/9ea2ed34264c8659fccac2445b8692a375cd44ea [^]
2016-09-30 09:27 hgbot Checkin
2016-09-30 09:27 hgbot Note Added: 0090401
2016-09-30 09:27 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/dbsm-main/rev/9ea2ed34264c8659fccac2445b8692a375cd44ea [^] => http://code.openbravo.com/erp/devel/pi/rev/c2059804fd2c23c306a39dbb7c9281a09dfc8568 [^]
2016-09-30 09:27 alostale Review Assigned To => caristu
2016-09-30 09:28 alostale Relationship added related to 0034102
2016-09-30 09:58 caristu Relationship added related to 0034138
2016-09-30 09:59 caristu Note Added: 0090407
2016-09-30 09:59 caristu Status resolved => closed
2016-09-30 09:59 caristu Fixed in Version => 3.0PR16Q4
2016-09-30 10:02 caristu Relationship added related to 0034144
2016-09-30 19:07 hudsonbot Checkin
2016-09-30 19:07 hudsonbot Note Added: 0090441


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker