Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0033964 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | major | always | 2016-09-13 12:35 | 2016-09-29 09:02 | |||
Reporter | gorkaion | View Status | public | |||||
Assigned To | caristu | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | 3.0PR16Q4 | |||
Status | closed | Fix in branch | Fixed in SCM revision | fb801d35d711 | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | PostgreSQL | Java version | ||||
OS Version | Database version | 9.4 | Ant version | |||||
Product Version | pi | SCM revision | ||||||
Merge Request Status | ||||||||
Review Assigned To | alostale | |||||||
OBNetwork customer | No | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0033964: Default value is not dropped when column definition changes | |||||||
Description | If a database column definition changes removing the default value the udpate.database task is not dropping the default value in the database. | |||||||
Steps To Reproduce | 1 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()" | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() | |||||||
![]() |
|
![]() |
|
(0089921) caristu (viewer) 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 (viewer) 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 (viewer) 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 (viewer) 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 (viewer) 2016-09-29 09:02 |
Code reviewed + tested |
![]() |
|||
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 | OBNetwork customer | => No |
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 |