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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036934
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] Y. DBSourceManagermajoralways2017-09-20 18:572017-09-25 12:49
ReportermalsasuaView Statuspublic 
Assigned ToAugustoMauch 
PriorityimmediateResolutionfixedFixed in Version3.0PR17Q3.1
StatusclosedFix in branchFixed in SCM revision8aaf059025dc
ProjectionnoneETAnoneTarget Version3.0PR17Q3.1
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression levelProduction - Confirmed Stable
Regression date2017-01-11
Regression introduced in release3.0PR17Q2
Regression introduced by commithttp://code.openbravo.com/erp/devel/pi/rev/47c768943f70d1c674cb0a2701faf29edde3da84 [^]
Triggers an Emergency PackNo
Summary

0036934: It is not possible to change the size of columns if the column is used in a view

Descriptionwhen a column is used in a view, and the column size is changed, the update.database process returns one error:
     [java] 113277 WARN - SQL Command failed with: ERROR: cannot alter type of a column used by a view or rule
     [java] Detail: rule _RETURN on view c_invoice_v2 depends on column "poreference"
     [java] 113285 WARN - -- END
     [java] ALTER TABLE C_INVOICE ALTER COLUMN POREFERENCE TYPE VARCHAR(255)
Steps To Reproduce. in xml file (src-db/database/model/tables/C_INVOICE.xml), change the size of column "POREFERENCE" to 255 in c_invoice table
. execute:
ant update.database
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0036908 closedAugustoMauch It is not possible to change the size of columns if the column is used in a view 

-  Notes
(0099519)
hgbot (developer)
2017-09-25 10:57

Repository: erp/backports/3.0PR17Q3.1
Changeset: 8aaf059025dc59ec7e1280eeb52ce775092aed4c
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Sep 25 10:25:17 2017 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR17Q3.1/rev/8aaf059025dc59ec7e1280eeb52ce775092aed4c [^]

Fixes bug 36934:Updating the column length on table referenced by a view works

There was a problem when a the column length of a table (T) referenced by a view (V) was updated, if that view was referenced by another view (V2).

In the step to update the model, the following steps were done in single batch:
- The views are dropped (forced = true)
- The model is updated (forced = false)
- The views are recreated

What happened is that the view V1 could not be dropped because V2 referenced it (and drop on cascade was not used). Then the batch failed, and only those
commands with forced=true were recreated, so the model was not updated.

To fix this, now the views are dropped in a different batch than the one used to update the model. There is an API change, since before this change this step
was enough to do the whole update of the model:

getSqlBuilder().alterDatabase(currentModel, desiredModel, params);

And now this it is required to call and evalue the following command:

getSqlBuilder().prepareDatabaseForAlter(currentModel, desiredModel, params, changes);

This has been changed in all Openbravo occurrences, and no occurrences outside Openbravo have been found.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0099535)
alostale (developer)
2017-09-25 12:49

reviewed + tested

- Issue History
Date Modified Username Field Change
2017-09-25 09:41 AugustoMauch Type defect => backport
2017-09-25 09:41 AugustoMauch Target Version => 3.0PR17Q3.2
2017-09-25 10:41 AugustoMauch Target Version 3.0PR17Q3.2 => 3.0PR17Q3.1
2017-09-25 10:57 hgbot Checkin
2017-09-25 10:57 hgbot Note Added: 0099519
2017-09-25 10:57 hgbot Status scheduled => resolved
2017-09-25 10:57 hgbot Resolution open => fixed
2017-09-25 10:57 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/dbsm-main/rev/7cdd957ca8790f1c9bb971e66c40b9f38a842b7d [^] => http://code.openbravo.com/erp/backports/3.0PR17Q3.1/rev/8aaf059025dc59ec7e1280eeb52ce775092aed4c [^]
2017-09-25 12:49 alostale Note Added: 0099535
2017-09-25 12:49 alostale Status resolved => closed
2017-09-25 12:49 alostale Fixed in Version => 3.0PR17Q3.1


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker