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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0035474
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2017-03-09 18:352017-03-17 09:54
ReporteraaroncaleroView Statuspublic 
Assigned Toalostale 
PriorityurgentResolutionfixedFixed 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

0035474: Function based indexes do not support arithmetic operations on columns

DescriptionCurrently the dbsourcemanager supports exporting function based indexes.
This works fine when the indexed part is just a call to a function (e.g. indexes defined here[1]).
However if the index is compound of an arithmetic operation, this requires an extra set of parenthesis when the index is defined, but then at the time of exporting this index, the parentheses are removed.


[1] https://code.openbravo.com/erp/pmods/org.openbravo.retail.highvolumesconfig/file/tip/src-db/database/model/modifiedTables/C_BPARTNER.xml [^]
Steps To ReproduceCreate the following index:
create index EM_OBPOS_ORDLINE_QTYPENDING on c_orderline ((QTYORDERED-QTYDELIVERED))

Try exporting the index. The xml will show the following:
+ <index name="EM_OBPOS_ORDLINE_QTYPENDING" unique="false">
+ <index-column name="functionBasedColumn" functionExpression="QTYORDERED-QTYDELIVERED"/>
+ </index>
(notify that the parentheses are missing).

After executing ant update.database, the following warning will be raised:
SQL Command failed with: ERROR: syntax error at or near "-"
  Position: 78
-- END
CREATE INDEX EM_OBPOS_ORDLINE_QTYPENDING ON C_ORDERLINE (QTYORDERED-QTYDELIVERED)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 00301793.0PR15Q4 closedAugustoMauch DBSourceManager support indexes with functions 
related to design defect 0029492 closedalostale Wrong export of a view 
related to design defect 0035519 closedalostale can only have one function column in db indexes 
related to defect 0035543 closedalostale incorrect export of indexes including CASE expressions 

-  Notes
(0095034)
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
---
(0095036)
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
---
(0095302)
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
(0095355)
caristu (developer)
2017-03-17 09:54

Code reviewed + testing OK.

- Issue History
Date Modified Username Field Change
2017-03-09 18:35 aaroncalero New Issue
2017-03-09 18:35 aaroncalero Assigned To => platform
2017-03-09 18:35 aaroncalero Modules => Core
2017-03-09 18:35 aaroncalero Triggers an Emergency Pack => No
2017-03-10 13:47 alostale Relationship added related to 0035467
2017-03-10 13:48 alostale Relationship added related to 0030179
2017-03-10 13:49 alostale Relationship added related to 0029492
2017-03-10 13:50 alostale Relationship deleted related to 0035467
2017-03-15 10:53 alostale Priority normal => urgent
2017-03-15 10:53 alostale Status new => acknowledged
2017-03-15 10:53 alostale Type feature request => defect
2017-03-15 10:53 alostale Assigned To platform => alostale
2017-03-15 10:54 alostale Review Assigned To => caristu
2017-03-15 14:08 hgbot Checkin
2017-03-15 14:08 hgbot Note Added: 0095034
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: 0095036
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: 0095302
2017-03-17 09:54 caristu Note Added: 0095355
2017-03-17 09:54 caristu Status resolved => closed
2017-03-17 09:54 caristu Fixed in Version => 3.0PR17Q2
2017-03-17 09:59 caristu Relationship added related to 0035519
2017-03-17 10:02 caristu Relationship added related to 0035543


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker