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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0040933
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminoralways2019-05-22 10:222019-05-29 13:51
ReporterguillermogilView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version3.0PR19Q3
StatusclosedFix in branchFixed in SCM revision0c831934d9a7
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0040933: Export database changes Index order if a template removes it

DescriptionIf you have a template that removes an index it will be moved to a different position on the XML file and it will fail on the DBCons test.

Steps To Reproduce- Create a template that removes EM_OBPOS_ORDER_DELIVERED index
- Put POSTerminal module in development
- Export database
- The following diff appears

diff -r 44ecec5ee66a src-db/database/model/modifiedTables/C_ORDER.xml
--- a/src-db/database/model/modifiedTables/C_ORDER.xml Tue May 21 19:01:42 2019 +0200
+++ b/src-db/database/model/modifiedTables/C_ORDER.xml Wed May 22 07:46:02 2019 +0000
@@ -65,9 +65,6 @@
       <index name="EM_OBPOS_DOCTYPE_IDX" unique="false">
         <index-column name="C_DOCTYPE_ID"/>
       </index>
- <index name="EM_OBPOS_ORDER_DELIVERED" unique="false">
- <index-column name="ISDELIVERED"/>
- </index>
       <index name="EM_OBPOS_ORDER_DOCNO_TRGM" unique="false" containsSearch="true">
         <index-column name="functionBasedColumn" functionExpression="UPPER(DOCUMENTNO)"/>
       </index>
@@ -78,6 +75,9 @@
         <index-column name="EM_OBPOS_REJECTED_QUOTAT_ID"/>
         <whereClause><![CDATA[EM_OBPOS_REJECTED_QUOTAT_ID IS NOT NULL]]></whereClause>
       </index>
+ <index name="EM_OBPOS_ORDER_DELIVERED" unique="false">
+ <index-column name="ISDELIVERED"/>
+ </index>
       <check name="EM_OBPOS_ISDELETED_CHECK"><![CDATA[EM_OBPOS_ISDELETED IN ('Y', 'N')]]></check>
       <check name="EM_OBPOS_ISLAYAWAY_CHK"><![CDATA[EM_OBPOS_ISLAYAWAY IN ('Y', 'N')]]></check>
     </table>
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0032211 closedcaristu support for partial indexes 

-  Notes
(0112160)
hgbot (developer)
2019-05-27 11:51

Repository: erp/devel/dbsm-main
Changeset: e770a97e88cf59a8d2ae3ac8f8a02fa1b5814c90
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon May 27 11:08:19 2019 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/e770a97e88cf59a8d2ae3ac8f8a02fa1b5814c90 [^]

Fixes issue 40933: Indexes are properly ordered when reversing a template

The problem was that when a template that removes an index is reversed, the index is added to the
end of the index list, instead of preserving the alphabetical order.

To fix it, just sort again indexes and constraints after reversing the templates.

---
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
(0112161)
hgbot (developer)
2019-05-27 11:51

Repository: erp/devel/pi
Changeset: a45b06d2479ee27970c45e3653cceb89098be2fb
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon May 27 11:48:56 2019 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a45b06d2479ee27970c45e3653cceb89098be2fb [^]

Fixes issue 40933: Indexes are properly ordered when reversing a template

The problem was that when a template that removes an index is reversed, the index is added to the
end of the index list, instead of preserving the alphabetical order.

To fix it, just sort again indexes and constraints after reversing the templates.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0112182)
caristu (developer)
2019-05-27 17:47

Reopened to check:

- Reordering should be done just once, when all the templates has been applied (outside the for loop)

- Is it the reordering operation expensive? Does it worth to check if any check/index removal has been applied by any template and just it that case apply the reordering?
(0112183)
hgbot (developer)
2019-05-27 18:01

Repository: erp/devel/dbsm-main
Changeset: 0c831934d9a77a4cfc4df1b0fa1800c4e203a7d0
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon May 27 17:59:29 2019 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/0c831934d9a77a4cfc4df1b0fa1800c4e203a7d0 [^]

Fixes issue 40933: Indexes and checks are sorted after reversing all templates

The previous changeset was reordering the table indexes and checks each time a template was reversed,
but it is enough to do it once, when all templates have been reversed.

---
M src/org/openbravo/ddlutils/util/DBSMOBUtil.java
---
(0112184)
AugustoMauch (manager)
2019-05-27 18:04

Reordering takes between 8-12 milliseconds. I think it is fast enough to do it always, instead of using a flag to keep track of when a template removed an index or a check constraint.
(0112186)
hudsonbot (developer)
2019-05-27 21: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/51ab3e41a42a [^]
Maturity status: Test
(0112225)
caristu (developer)
2019-05-29 13:51

Reviewed

- Issue History
Date Modified Username Field Change
2019-05-22 10:22 guillermogil New Issue
2019-05-22 10:22 guillermogil Assigned To => platform
2019-05-22 10:22 guillermogil Modules => Core
2019-05-22 10:22 guillermogil Triggers an Emergency Pack => No
2019-05-22 18:06 shuehner Issue Monitored: shuehner
2019-05-27 11:48 AugustoMauch Review Assigned To => caristu
2019-05-27 11:51 hgbot Checkin
2019-05-27 11:51 hgbot Note Added: 0112160
2019-05-27 11:51 hgbot Status new => resolved
2019-05-27 11:51 hgbot Resolution open => fixed
2019-05-27 11:51 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/e770a97e88cf59a8d2ae3ac8f8a02fa1b5814c90 [^]
2019-05-27 11:51 hgbot Checkin
2019-05-27 11:51 hgbot Note Added: 0112161
2019-05-27 11:51 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/dbsm-main/rev/e770a97e88cf59a8d2ae3ac8f8a02fa1b5814c90 [^] => http://code.openbravo.com/erp/devel/pi/rev/a45b06d2479ee27970c45e3653cceb89098be2fb [^]
2019-05-27 17:38 caristu Relationship added related to 0032211
2019-05-27 17:47 caristu Assigned To platform => AugustoMauch
2019-05-27 17:47 caristu Note Added: 0112182
2019-05-27 17:47 caristu Status resolved => new
2019-05-27 17:47 caristu Resolution fixed => open
2019-05-27 18:01 hgbot Checkin
2019-05-27 18:01 hgbot Note Added: 0112183
2019-05-27 18:01 hgbot Status new => resolved
2019-05-27 18:01 hgbot Resolution open => fixed
2019-05-27 18:01 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/a45b06d2479ee27970c45e3653cceb89098be2fb [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/0c831934d9a77a4cfc4df1b0fa1800c4e203a7d0 [^]
2019-05-27 18:04 AugustoMauch Note Added: 0112184
2019-05-27 21:02 hudsonbot Checkin
2019-05-27 21:02 hudsonbot Note Added: 0112186
2019-05-29 13:51 caristu Note Added: 0112225
2019-05-29 13:51 caristu Status resolved => closed
2019-05-29 13:51 caristu Fixed in Version => 3.0PR19Q3


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker