Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0047817Openbravo ERPA. Platformpublic2021-10-06 09:542021-10-22 12:29
aferraz 
platform 
normalminorhave not tried
closedfixed 
5
 
PR22Q1 
Core
No
0047817: Not able to use a database immutable function in a table index
If you create a new database immutable function and use it in a table index, the install.source fails as the index is created before the function.

If you run update.database instead of install.source it works fine because function is created before the index.
Apply attached diff and run ant install.source.
No tags attached.
diff Diff.diff (3,527) 2021-10-06 09:57
https://issues.openbravo.com/file_download.php?file_id=16251&type=bug
Issue History
2021-10-06 09:54aferrazNew Issue
2021-10-06 09:54aferrazAssigned To => platform
2021-10-06 09:54aferrazModules => Core
2021-10-06 09:54aferrazTriggers an Emergency Pack => No
2021-10-06 09:57aferrazFile Added: Diff.diff
2021-10-06 09:59aferrazSummaryNot able to use a database function defined by the user in a table index => Not able to use a database immutable function in a table index
2021-10-06 09:59aferrazDescription Updatedbug_revision_view_page.php?rev_id=23155#r23155
2021-10-14 09:52hgbotNote Added: 0132338
2021-10-22 10:00hgbotNote Added: 0132557
2021-10-22 11:42hgbotResolutionopen => fixed
2021-10-22 11:42hgbotStatusnew => closed
2021-10-22 11:42hgbotFixed in Version => PR22Q1
2021-10-22 11:42hgbotNote Added: 0132581
2021-10-22 11:42hgbotNote Added: 0132582
2021-10-22 12:29hgbotNote Added: 0132585
2021-10-22 12:29hgbotNote Added: 0132586

Notes
(0132338)
hgbot   
2021-10-14 09:52   
Merge Request created: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/32 [^]
(0132557)
hgbot   
2021-10-22 10:00   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/443 [^]
(0132581)
hgbot   
2021-10-22 11:42   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: bb422b20c7f51c400c70fbc6fff0629c2045fef4
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 2021-10-22T09:53:11+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/bb422b20c7f51c400c70fbc6fff0629c2045fef4 [^]

Fixes ISSUE-47817: Cannot use new immutable function in function index

Now the immutable functions are created before the tables and its indexes. This way it is possible to
define an immutable function, export it to a module and then reference it from a table index.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0132582)
hgbot   
2021-10-22 11:42   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/443 [^]
(0132585)
hgbot   
2021-10-22 12:29   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/dbsm [^]
Changeset: c2c0cfafbfca0d1c651abbe20b622ea4f3f1a52a
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 2021-10-22T09:56:41+02:00
URL: https://gitlab.com/openbravo/product/dbsm/-/commit/c2c0cfafbfca0d1c651abbe20b622ea4f3f1a52a [^]

Fixes ISSUE-47817: Cannot use new immutable function in function index

Now immutable functions are created just before updating the windows, so if an index reference
one of the new immutable functions, they will be already available

---
A src-test/model/indexes/FUNCTION_INDEX_WITH_OB_DEFINED_FUNCTION.xml
A src/org/apache/ddlutils/alteration/AddImmutableFunctionChange.java
A src/org/apache/ddlutils/alteration/AddMutableFunctionChange.java
M src-test/src/org/openbravo/dbsm/test/model/FunctionBasedIndexes.java
M src/org/apache/ddlutils/alteration/AddFunctionChange.java
M src/org/apache/ddlutils/alteration/ModelComparator.java
M src/org/apache/ddlutils/platform/SqlBuilder.java
---
(0132586)
hgbot   
2021-10-22 12:29   
Merge request merged: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/32 [^]