Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034236Openbravo ERPY. DBSourceManagerpublic2016-10-19 10:232016-12-16 18:39
caristu 
caristu 
highminorhave not tried
closedfixed 
5
 
3.0PR17Q1 
alostale
Core
No
0034236: newIndexesPostAction is executing duplicated actions
At this point[1] newIndexesPostAction is being executed once per table. Each execution contains the map of new indexes even if those indexes does not belong to the current table in the loop.

This causes that the post actions (for example creating new comments) are being executed once per table, but they should be executed just once.


[1] https://code.openbravo.com/erp/devel/dbsm-main/file/ee257b63e917/src/org/apache/ddlutils/platform/SqlBuilder.java#l809 [^]
Execute the attached test case (testCase34236.diff) which does the following:

1) Creates a model with two tables
2) Prints the statements needed to add a new function based index with an operator class into ONE table of the model

Notice that the following statement is executed twice (once per table in the model):

COMMENT ON TABLE TEST IS 'OP_CLASS_INDEX1.functionBasedColumn.operatorClass=varchar_pattern_ops$'

It should be executed once as we are adding a new index to just one of the tables
Send to new newIndexesPostAction a list of the new indexes of the current table in the loop
Performance
related to feature request 0030525 closed AugustoMauch Provide support in DBSourceManager to define an operator class in index columns 
related to feature request 0032211 closed caristu support for partial indexes 
diff issue34236.diff (4,802) 2016-10-19 10:29
https://issues.openbravo.com/file_download.php?file_id=9930&type=bug
diff testCase34236.diff (3,849) 2016-10-19 10:41
https://issues.openbravo.com/file_download.php?file_id=9931&type=bug
Issue History
2016-10-19 10:23caristuNew Issue
2016-10-19 10:23caristuAssigned To => platform
2016-10-19 10:23caristuModules => Core
2016-10-19 10:23caristuTriggers an Emergency Pack => No
2016-10-19 10:27caristuDescription Updatedbug_revision_view_page.php?rev_id=13407#r13407
2016-10-19 10:28caristuRelationship addedrelated to 0030525
2016-10-19 10:28caristuRelationship addedrelated to 0032211
2016-10-19 10:29caristuFile Added: issue34236.diff
2016-10-19 10:30caristuNote Added: 0090694
2016-10-19 10:30caristuNote Edited: 0090694bug_revision_view_page.php?bugnote_id=0090694#r13409
2016-10-19 10:41caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13411#r13411
2016-10-19 10:41caristuFile Added: testCase34236.diff
2016-10-19 10:42caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13412#r13412
2016-10-19 10:43caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13413#r13413
2016-10-31 18:56caristuTag Attached: Performance
2016-12-01 13:02alostaleStatusnew => acknowledged
2016-12-01 13:20alostalePriorityhigh => normal
2016-12-01 14:01alostalePrioritynormal => high
2016-12-01 14:13alostaleAssigned Toplatform => caristu
2016-12-02 10:26hgbotCheckin
2016-12-02 10:26hgbotNote Added: 0092012
2016-12-02 10:26hgbotStatusacknowledged => resolved
2016-12-02 10:26hgbotResolutionopen => fixed
2016-12-02 10:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/cb46c26bac25b58f43d8102538ae757fb7c343ac [^]
2016-12-02 10:34hgbotCheckin
2016-12-02 10:34hgbotNote Added: 0092014
2016-12-02 10:35caristuReview Assigned To => alostale
2016-12-13 11:23alostaleNote Added: 0092309
2016-12-13 11:23alostaleStatusresolved => closed
2016-12-13 11:23alostaleFixed in Version => 3.0PR17Q1
2016-12-16 18:39hudsonbotCheckin
2016-12-16 18:39hudsonbotNote Added: 0092684

Notes
(0090694)
caristu   
2016-10-19 10:30   
Attached patch with the proposed solution

(0092012)
hgbot   
2016-12-02 10:26   
Repository: erp/devel/dbsm-main
Changeset: cb46c26bac25b58f43d8102538ae757fb7c343ac
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Dec 02 10:24:32 2016 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/cb46c26bac25b58f43d8102538ae757fb7c343ac [^]

fixes issue 34236: newIndexesPostAction is executing duplicated actions

This refactor allows to execute the new index post actions just once per table in the model. Added a new test case also to add coverage to this scenario.

---
M src-test/src/org/openbravo/dbsm/test/model/OperatorClassIndexes.java
M src/org/apache/ddlutils/platform/SqlBuilder.java
M src/org/apache/ddlutils/platform/oracle/Oracle8Builder.java
A src-test/model/indexes/MODEL_WITH_TWO_TABLES.xml
A src-test/model/indexes/MODEL_WITH_TWO_TABLES_AND_INDEX.xml
---
(0092014)
hgbot   
2016-12-02 10:34   
Repository: erp/devel/pi
Changeset: 0fba1fd4f0761c0dc6fbeb52b6034300e6b4b309
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Dec 02 10:33:48 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/0fba1fd4f0761c0dc6fbeb52b6034300e6b4b309 [^]

related to issue 34236: updated dbsourcemanager library

---
M src-db/database/lib/dbsourcemanager.jar
---
(0092309)
alostale   
2016-12-13 11:23   
code reviewed and tested
(0092684)
hudsonbot   
2016-12-16 18:39   
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/dc8bf00badd0 [^]
Maturity status: Test