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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0033964
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2016-09-13 12:352016-09-29 09:02
ReportergorkaionView Statuspublic 
Assigned Tocaristu 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q4
StatusclosedFix in branchFixed in SCM revisionfb801d35d711
ProjectionnoneETAnoneTarget Version
OSAnyDatabasePostgreSQLJava version
OS VersionDatabase version9.4Ant version
Product VersionpiSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0033964: Default value is not dropped when column definition changes

DescriptionIf a database column definition changes removing the default value the udpate.database task is not dropping the default value in the database.
Steps To Reproduce1 Create a date column not null with sysdate as default value and on create default value.
2 Check that it is properly created in the database.
3 Modify the xml definition to set is as required false and remove the default and onCreateDefault values.
4 Update the database and check that the required and onCreateDefault values are properly updated but the default value is still "now()".
5 Modify the xml definition and set the default value to null.
6 Update the database again and check that the default value is still "now()"
TagsNo tags attached.
Attached Filesdiff file icon issue33964.diff [^] (6,574 bytes) 2016-09-15 10:10 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0089921)
caristu (developer)
2016-09-13 15:45

The problem is on the ModelComparator class.

When comparing the source default value and the target default value, it parses both values expecting that they are fixed values.

When the default value is a function like now(), the default value should not be parsed before comparing it.
(0089970)
caristu (developer)
2016-09-15 10:11

Attached issue with the proposed solution + test case
(0090271)
hgbot (developer)
2016-09-26 16:53

Repository: erp/devel/dbsm-main
Changeset: 88837e2a0158e88052615a17326efe44d036caeb
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Sep 26 16:52:29 2016 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/88837e2a0158e88052615a17326efe44d036caeb [^]

related to issue 33964: Default value not dropped if column definition changes

The problem was caused because when the default value was a function (NOW()) this value was being parsed returning a null value. This was making impossible to detect the change in the default value by DB Source Manager. Now if the default value is function the value is not parsed.

Together with this, now when the default value is changed to NULL for a character varying column in Postgres the NULL value is translated properly within the PostgreSqlModelLoader.

---
M src/org/apache/ddlutils/model/ValueObject.java
M src/org/apache/ddlutils/platform/ModelLoaderBase.java
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlModelLoader.java
A src-test/model/defaults/BASE_MODEL.xml
A src-test/model/defaults/BASE_MODEL2.xml
A src-test/model/defaults/BASE_MODEL2_WITH_DEFAULT.xml
A src-test/model/defaults/BASE_MODEL_WITH_DEFAULT.xml
A src-test/src/org/openbravo/dbsm/test/model/data/DefaultValuesTest.java
---
(0090272)
hgbot (developer)
2016-09-26 16:57

Repository: erp/devel/dbsm-main
Changeset: 6bb0a381189b2a2a99c6a1222aea495191d9eb38
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Sep 26 16:57:01 2016 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/6bb0a381189b2a2a99c6a1222aea495191d9eb38 [^]

related to issue 33964: include new test cases for defaults into the test suite

---
M src-test/src/org/openbravo/dbsm/test/model/ModelSuite.java
---
(0090273)
hgbot (developer)
2016-09-26 17:01

Repository: erp/devel/pi
Changeset: fb801d35d71193ac5a7448ed8346b0d376afa311
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Sep 26 17:00:54 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fb801d35d71193ac5a7448ed8346b0d376afa311 [^]

fixes issue 33964: Default value not dropped if column definition changes

---
M src-db/database/lib/dbsourcemanager.jar
---
(0090277)
hudsonbot (developer)
2016-09-26 22:05

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/d32e95b900dd [^]
Maturity status: Test
(0090355)
hgbot (developer)
2016-09-28 19:00

Repository: erp/devel/dbsm-main
Changeset: 19aa8c3018b71ce47bf9550a6baae32f799cae80
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Sep 28 18:51:42 2016 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/19aa8c3018b71ce47bf9550a6baae32f799cae80 [^]

related to issue 33964: use DROP DEFAULT when the column default is removed

---
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlBuilder.java
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlModelLoader.java
---
(0090356)
hgbot (developer)
2016-09-28 19:03

Repository: erp/devel/pi
Changeset: cfcdef1f8efe7ba22f3e98a29eaaf93d5805f05a
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Sep 28 19:02:56 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/cfcdef1f8efe7ba22f3e98a29eaaf93d5805f05a [^]

related to issue 33964: update DB Source Manager with code review improvements

---
M src-db/database/lib/dbsourcemanager.jar
---
(0090365)
hudsonbot (developer)
2016-09-29 00:02

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/2cd54ee6264a [^]
Maturity status: Test
(0090368)
alostale (manager)
2016-09-29 09:02

Code reviewed + tested

- Issue History
Date Modified Username Field Change
2016-09-13 12:35 gorkaion New Issue
2016-09-13 12:35 gorkaion Assigned To => caristu
2016-09-13 12:35 gorkaion Modules => Core
2016-09-13 12:35 gorkaion Triggers an Emergency Pack => No
2016-09-13 12:37 gorkaion Steps to Reproduce Updated View Revisions
2016-09-13 15:45 caristu Note Added: 0089921
2016-09-13 15:45 caristu Status new => acknowledged
2016-09-13 15:45 caristu Status acknowledged => scheduled
2016-09-15 10:10 caristu File Added: issue33964.diff
2016-09-15 10:11 caristu Note Added: 0089970
2016-09-15 10:11 caristu Note View State: public: 89970
2016-09-26 16:53 hgbot Checkin
2016-09-26 16:53 hgbot Note Added: 0090271
2016-09-26 16:57 hgbot Checkin
2016-09-26 16:57 hgbot Note Added: 0090272
2016-09-26 17:01 hgbot Checkin
2016-09-26 17:01 hgbot Note Added: 0090273
2016-09-26 17:01 hgbot Status scheduled => resolved
2016-09-26 17:01 hgbot Resolution open => fixed
2016-09-26 17:01 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fb801d35d71193ac5a7448ed8346b0d376afa311 [^]
2016-09-26 17:02 caristu Review Assigned To => alostale
2016-09-26 17:03 caristu Issue Monitored: alostale
2016-09-26 22:05 hudsonbot Checkin
2016-09-26 22:05 hudsonbot Note Added: 0090277
2016-09-28 19:00 hgbot Checkin
2016-09-28 19:00 hgbot Note Added: 0090355
2016-09-28 19:03 hgbot Checkin
2016-09-28 19:03 hgbot Note Added: 0090356
2016-09-29 00:02 hudsonbot Checkin
2016-09-29 00:02 hudsonbot Note Added: 0090365
2016-09-29 09:02 alostale Note Added: 0090368
2016-09-29 09:02 alostale Status resolved => closed
2016-09-29 09:02 alostale Fixed in Version => 3.0PR16Q4


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker