Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] Y. DBSourceManagermajoralways2017-09-20 18:572017-09-25 12:45
ReportermalsasuaView Statuspublic 
Assigned ToAugustoMauch 
PriorityimmediateResolutionfixedFixed in Version3.0PR17Q2.4
StatusclosedFix in branchFixed in SCM revisionf7d032aa5982
ProjectionnoneETAnoneTarget Version3.0PR17Q2.4
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
Regression levelProduction - Confirmed Stable
Regression date2017-01-11
Regression introduced in release3.0PR17Q2
Regression introduced by commit [^]
Triggers an Emergency PackNo

0036933: 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
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
hgbot (developer)
2017-09-25 10:57

Repository: erp/backports/3.0PR17Q2.4
Changeset: f7d032aa59828520dbd057236261c0bf65eeb8fd
Author: Augusto Mauch <augusto.mauch <at>>
Date: Mon Sep 25 10:24:56 2017 +0200
URL: [^]

Fixes bug 36933: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
alostale (developer)
2017-09-25 12:45

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.0PR17Q4.1
2017-09-25 10:41 AugustoMauch Target Version 3.0PR17Q4.1 => 3.0PR17Q2.4
2017-09-25 10:57 hgbot Checkin
2017-09-25 10:57 hgbot Note Added: 0099518
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 [^] => [^]
2017-09-25 12:45 alostale Note Added: 0099534
2017-09-25 12:45 alostale Status resolved => closed
2017-09-25 12:45 alostale Fixed in Version => 3.0PR17Q2.4

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker