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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034048
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2016-09-21 16:312016-09-23 09:34
ReportercaristuView Statuspublic 
Assigned Toplatform 
PriorityhighResolutioninvalidFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0034048: Not null constraint removed from database under some circumnstances

DescriptionA not null constraint defined for a column of an AD table disappears when AD XML files are older than new column definition, if that column does not have an oncreatedefault.
Steps To Reproduce1) Install the attached patch which adds a new test column to the OBUIAPP_Report table (this is an AD table)

2) Install the following module: https://code.openbravo.com/erp/mods/org.openbravo.platform.features/ [^] this module contains some sourcedata for the OBUIAPP_Report table which obviously does not define any value for the test column

3) Notice that after the execution of the update.database task, the NOT NULL constraint is gone for the test column in the database. In addition, the following error is displayed:

     [java] 38957 INFO - Batch statement failed. Rolling back and retrying all the statements in a non-batched connection.
     [java] 46518 WARN - SQL Command failed with: ERROR: column "test" contains null values
     [java] 46528 WARN - -- END
     [java] ALTER TABLE OBUIAPP_REPORT ALTER TEST SET NOT NULL
     [java] 48633 INFO - Executed 886 SQL command(s) with 1 error(s)


Note: this error can be workarounded by defining an onCreateDefault[1] for the column.

[1] http://wiki.openbravo.com/wiki/How_to_define_an_on_Create_Default [^]
TagsNo tags attached.
Attached Filesdiff file icon testColumn.diff [^] (4,461 bytes) 2016-09-21 17:32 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0029270 closedalostale prevent table recreation in update.database 

-  Notes
(0090185)
alostale (manager)
2016-09-23 09:34

Working as designed: AD not null columns require of an on create default in order to populate values when they are not present in xml.

- Issue History
Date Modified Username Field Change
2016-09-21 16:31 caristu New Issue
2016-09-21 16:31 caristu Assigned To => platform
2016-09-21 16:31 caristu Modules => Core
2016-09-21 16:31 caristu Triggers an Emergency Pack => No
2016-09-21 16:31 caristu File Added: testColumn.diff
2016-09-21 16:33 caristu Relationship added related to 0029270
2016-09-21 16:34 caristu Description Updated View Revisions
2016-09-21 16:45 caristu Proposed Solution updated
2016-09-21 16:55 caristu Steps to Reproduce Updated View Revisions
2016-09-21 16:55 caristu Steps to Reproduce Updated View Revisions
2016-09-21 16:59 caristu Description Updated View Revisions
2016-09-21 17:32 caristu File Deleted: testColumn.diff
2016-09-21 17:32 caristu File Added: testColumn.diff
2016-09-23 09:34 alostale Note Added: 0090185
2016-09-23 09:34 alostale Status new => closed
2016-09-23 09:34 alostale Resolution open => invalid


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker