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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0035519
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] Y. DBSourceManagerminorhave not tried2017-03-15 10:192017-03-17 09:59
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in Version3.0PR17Q2
StatusclosedFix in branchFixed in SCM revision2686a1fd45b9
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

0035519: can only have one function column in db indexes

DescriptionDB indexes can only have one column based on an index. This limitation is documented [1].

[1] http://wiki.openbravo.com/wiki/Constraints_and_Triggers#Indexes [^]
Steps To Reproduce1. Create the following index in PG:
CREATE INDEX c_bpartner_name2_id
  ON c_bpartner
  USING btree
  (UPPER(REPLACE(name, 'a', 'b')),
   UPPER(c_bpartner_id));
2. export database
3. check how it gets exported -> ERROR: both functions are merged in a single column
hg diff src-db/database/model/tables/C_BPARTNER.xml
diff -r afcca1baf74c src-db/database/model/tables/C_BPARTNER.xml
--- a/src-db/database/model/tables/C_BPARTNER.xml Tue Mar 14 09:22:54 2017 +0100
+++ b/src-db/database/model/tables/C_BPARTNER.xml Wed Mar 15 10:17:33 2017 +0100
@@ -468,6 +468,9 @@
         <index-column name="NAME"/>
         <index-column name="C_BPARTNER_ID"/>
       </index>
+ <index name="C_BPARTNER_NAME2_ID" unique="false">
+ <index-column name="functionBasedColumn" functionExpression="UPPER(REPLACE(NAME,'a','b')), upper(c_bpartner_id)"/>
+ </index>
       <index name="C_BPARTNER_REFNO_ID" unique="false">
         <index-column name="REFERENCENO"/>
         <index-column name="C_BPARTNER_ID"/>
4. update database
5. Check index definition
  -> ERROR: it is not as the original
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 00301793.0PR15Q4 closedAugustoMauch DBSourceManager support indexes with functions 
related to defect 0035474 closedalostale Function based indexes do not support arithmetic operations on columns 

-  Notes
(0095035)
hgbot (developer)
2017-03-15 14:08

Repository: erp/devel/pi
Changeset: a62a7a94d7eefa6c84ef3fb5eb2748c5172171e7
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Mar 15 14:08:12 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a62a7a94d7eefa6c84ef3fb5eb2748c5172171e7 [^]

fixed bug 35474, fixed issue 35519: function based indexes improvements

  Improved the way function definitions in indexes are read from DB, now they are
  read per column, using in PG the index specific function pg_get_indexdef. This
  allows to:

   * properly read indexes based on arithmethic expressions ie (col1-col2)
   * support more than one index column based on function

---
M src-db/database/lib/dbsourcemanager.jar
---
(0095037)
hgbot (developer)
2017-03-15 14:09

Repository: erp/devel/dbsm-main
Changeset: 2686a1fd45b975ea70ca9eb413a38775bff31190
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Mar 15 13:35:00 2017 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/2686a1fd45b975ea70ca9eb413a38775bff31190 [^]

fixed bug 35474, fixed issue 35519: function based indexes improvements

  Improved the way function definitions in indexes are read from DB, now they are
  read per column, using in PG the index specific function pg_get_indexdef. This
  allows to:

   * properly read indexes based on arithmethic expressions ie (col1-col2)
   * support more than one index column based on function

---
M src-test/src/org/openbravo/dbsm/test/model/FunctionBasedIndexes.java
M src/org/apache/ddlutils/platform/SqlBuilder.java
M src/org/apache/ddlutils/platform/oracle/OracleModelLoader.java
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlModelLoader.java
A src-test/model/indexes/FUNCTION_INDEX_MULTI_COL.xml
A src-test/model/indexes/FUNCTION_INDEX_OPERATOR.xml
---
(0095303)
hudsonbot (developer)
2017-03-15 20:22

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/54e102bef53e [^]
Maturity status: Test
(0095356)
caristu (developer)
2017-03-17 09:58

Code reviewed + testing OK.

- Issue History
Date Modified Username Field Change
2017-03-15 10:19 alostale New Issue
2017-03-15 10:19 alostale Assigned To => platform
2017-03-15 10:19 alostale Modules => Core
2017-03-15 10:19 alostale Triggers an Emergency Pack => No
2017-03-15 10:19 alostale Status new => acknowledged
2017-03-15 10:19 alostale Relationship added related to 0030179
2017-03-15 14:07 alostale Review Assigned To => caristu
2017-03-15 14:07 alostale Steps to Reproduce Updated View Revisions
2017-03-15 14:08 hgbot Checkin
2017-03-15 14:08 hgbot Note Added: 0095035
2017-03-15 14:08 hgbot Status acknowledged => resolved
2017-03-15 14:08 hgbot Resolution open => fixed
2017-03-15 14:08 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a62a7a94d7eefa6c84ef3fb5eb2748c5172171e7 [^]
2017-03-15 14:09 hgbot Checkin
2017-03-15 14:09 hgbot Note Added: 0095037
2017-03-15 14:09 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/a62a7a94d7eefa6c84ef3fb5eb2748c5172171e7 [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/2686a1fd45b975ea70ca9eb413a38775bff31190 [^]
2017-03-15 20:22 hudsonbot Checkin
2017-03-15 20:22 hudsonbot Note Added: 0095303
2017-03-17 09:58 caristu Note Added: 0095356
2017-03-17 09:58 caristu Status resolved => closed
2017-03-17 09:58 caristu Fixed in Version => 3.0PR17Q2
2017-03-17 09:59 caristu Relationship added related to 0035474
2017-03-17 09:59 caristu Assigned To platform => alostale


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker