Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0033964 | Openbravo ERP | A. Platform | public | 2016-09-13 12:35 | 2016-09-29 09:02 |
|
Reporter | gorkaion | |
Assigned To | caristu | |
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | pi | |
Target Version | | Fixed in Version | 3.0PR16Q4 | |
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()"
|
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | |
Attached Files | issue33964.diff (6,574) 2016-09-15 10:10 https://issues.openbravo.com/file_download.php?file_id=9819&type=bug |
|
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 | 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 | bug_revision_view_page.php?rev_id=13099#r13099 |
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 |
Notes |
|
|
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. |
|
|
|
Attached issue with the proposed solution + test case |
|
|
(0090271)
|
hgbot
|
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
|
2016-09-26 16:57
|
|
|
|
(0090273)
|
hgbot
|
2016-09-26 17:01
|
|
|
|
|
|
|
(0090355)
|
hgbot
|
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
|
2016-09-28 19:03
|
|
|
|
|
|
|
|
|