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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0014060
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagermajorhave not tried2010-07-27 10:572010-08-11 00:00
ReportermarvintmView Statuspublic 
Assigned Tomarvintm 
PriorityurgentResolutionfixedFixed in Version2.50MP21
StatusclosedFix in branchFixed in SCM revision3324bf350dfe
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

0014060: update.database will fail when recreating the table if a column had an illegal datatype

DescriptionRight now, if a column has an illegal datatype, the export.database will fail with a clear error. However, this was not the case in previous versions of dbsourcemanager. This means that there could be modules out there with illegal datatypes in their physical columns (usually identified by being of type "VARCHAR" with length 0).

Update.database will attempt to create the table with that incorrect type (VARCHAR(0)), and will of course fail. This could lead to data loss.
Steps To ReproduceIn an old version of Openbravo, export a table with a column of type "INTEGER" in PostgreSQL. Verify that it is indeed exported with type "VARCHAR 0". Then, try to do update.database. The table creation will fail, and data could be lost.
Proposed SolutionUpdate.database will do a validation while initializing the model. If it finds out an illegal type in the XML files, it will stop without doing anything to the database.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0029615)
hgbot (developer)
2010-07-27 17:35

Repository: erp/devel/pi
Changeset: c1df94e38a27320896984f63a13fe99ae12428e7
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue Jul 27 17:32:06 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c1df94e38a27320896984f63a13fe99ae12428e7 [^]

Fixed issue 14060. Changed handling of illegal datatypes
Now, both update.database and update.database.mod will fail early if an illegal datatype is detected either in the database or in the XML files, therefore minimizing the risk of data loss. Before, the change was attempted, usually ending in failure, and in some cases, with loss of data, due to failed recreation of the table.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0029618)
hgbot (developer)
2010-07-27 18:10

Repository: erp/devel/dbsm-main
Changeset: 3324bf350dfed9decea6c9ee76a000ca9b6b2033
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue Jul 27 17:26:16 2010 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/3324bf350dfed9decea6c9ee76a000ca9b6b2033 [^]

Fixed issue 14060. Changed handling of illegal datatypes
Now, both update.database and update.database.mod will fail early if an illegal datatype is detected either in the database or in the XML files, therefore minimizing the risk of data loss. Before, the change was attempted, usually ending in failure, and in some cases, with loss of data, due to failed recreation of the table.

---
M src/org/apache/ddlutils/model/Database.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
M src/org/openbravo/ddlutils/task/AlterDatabaseDataMod.java
---
(0029623)
hudsonbot (developer)
2010-07-27 23:48

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/c1df94e38a27 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/5cf2bb15d5b1 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17927.obx [^]

- Issue History
Date Modified Username Field Change
2010-07-27 10:57 marvintm New Issue
2010-07-27 10:57 marvintm Assigned To => marvintm
2010-07-27 17:35 hgbot Checkin
2010-07-27 17:35 hgbot Note Added: 0029615
2010-07-27 17:35 hgbot Status new => resolved
2010-07-27 17:35 hgbot Resolution open => fixed
2010-07-27 17:35 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c1df94e38a27320896984f63a13fe99ae12428e7 [^]
2010-07-27 18:10 hgbot Checkin
2010-07-27 18:10 hgbot Note Added: 0029618
2010-07-27 18:10 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/c1df94e38a27320896984f63a13fe99ae12428e7 [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/3324bf350dfed9decea6c9ee76a000ca9b6b2033 [^]
2010-07-27 23:48 hudsonbot Checkin
2010-07-27 23:48 hudsonbot Note Added: 0029623
2010-08-10 16:15 alostale Status resolved => closed
2010-08-10 16:15 alostale Fixed in Version => 2.50MP21
2010-08-11 00:00 anonymous sf_bug_id 0 => 3042776


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker