Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0031685 | Openbravo ERP | Y. DBSourceManager | public | 2015-12-10 10:41 | 2016-03-17 10:54 |
|
Reporter | AugustoMauch | |
Assigned To | AugustoMauch | |
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR16Q2 | |
Merge Request Status | |
Review Assigned To | alostale |
OBNetwork customer | No |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0031685: Allow using SQL wildcards in the dbsourmanager exclude filter |
Description | It would be great if SQL wildcards [1] could be used to define exclusions in the exclude filter.
For instance, if all the tables with the SYM_ prefix should be excluded, it would be enough to add this line to the exclude filter:
<excludedTable name="SYM\_%"/>
Otherwise all the tables that use the SYM_ prefix should be listed in the excluded filter.
Note that the underscore character must be escaped, because if not it is interpreted as a substitute for any single character.
[1] http://www.w3schools.com/sql/sql_wildcards.asp [^] |
Steps To Reproduce | - |
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | design defect | 0029800 | | closed | AugustoMauch | Allow excluding sequences from model | related to | feature request | 0031672 | | closed | AugustoMauch | Add tests to check that the exclusion filter works properly in DBSourceManager | blocks | defect | 0024051 | | closed | alostale | Audit trail triggers are exported to core | blocks | defect | 0028149 | | closed | alostale | update.database tries to delete pg_stat_statments and pg_stat_statments_reset | causes | defect | 0035258 | | closed | caristu | NullPointerException thrown when updating database having a wrong declaration in exclude filters |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2015-12-10 10:41 | AugustoMauch | New Issue | |
2015-12-10 10:41 | AugustoMauch | Assigned To | => platform |
2015-12-10 10:41 | AugustoMauch | OBNetwork customer | => No |
2015-12-10 10:41 | AugustoMauch | Modules | => Core |
2015-12-10 10:41 | AugustoMauch | Triggers an Emergency Pack | => No |
2015-12-10 10:41 | AugustoMauch | Assigned To | platform => AugustoMauch |
2015-12-10 16:57 | AugustoMauch | Description Updated | bug_revision_view_page.php?rev_id=10445#r10445 |
2015-12-10 18:36 | AugustoMauch | Relationship added | related to 0024051 |
2015-12-10 18:37 | AugustoMauch | Relationship replaced | blocks 0024051 |
2015-12-11 10:12 | AugustoMauch | Status | new => scheduled |
2015-12-11 10:13 | AugustoMauch | Note Added: 0082675 | |
2016-01-20 11:44 | AugustoMauch | Review Assigned To | => alostale |
2016-01-20 12:23 | hgbot | Checkin | |
2016-01-20 12:23 | hgbot | Note Added: 0083442 | |
2016-01-20 12:23 | hgbot | Status | scheduled => resolved |
2016-01-20 12:23 | hgbot | Resolution | open => fixed |
2016-01-20 12:23 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/9cbd94b17c8829193f42387b92d1d098b018637f [^] |
2016-01-20 12:24 | hgbot | Checkin | |
2016-01-20 12:24 | hgbot | Note Added: 0083447 | |
2016-01-20 12:24 | hgbot | Checkin | |
2016-01-20 12:24 | hgbot | Note Added: 0083448 | |
2016-01-20 12:24 | hgbot | Checkin | |
2016-01-20 12:24 | hgbot | Note Added: 0083449 | |
2016-01-20 12:24 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/devel/pi/rev/9cbd94b17c8829193f42387b92d1d098b018637f [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/edc057968bb024f542e540cfd6753b83665ee4b4 [^] |
2016-01-20 12:24 | hgbot | Checkin | |
2016-01-20 12:24 | hgbot | Note Added: 0083450 | |
2016-01-20 12:24 | hgbot | Checkin | |
2016-01-20 12:24 | hgbot | Note Added: 0083451 | |
2016-01-20 12:24 | hgbot | Checkin | |
2016-01-20 12:24 | hgbot | Note Added: 0083452 | |
2016-01-20 13:30 | AugustoMauch | Relationship added | related to 0029800 |
2016-01-20 13:30 | AugustoMauch | Relationship added | related to 0031672 |
2016-01-20 15:26 | alostale | Note Added: 0083465 | |
2016-01-20 15:26 | alostale | Status | resolved => closed |
2016-01-20 15:26 | alostale | Fixed in Version | => 3.0PR16Q2 |
2016-03-17 10:54 | hudsonbot | Checkin | |
2016-03-17 10:54 | hudsonbot | Note Added: 0085059 | |
2016-12-15 09:13 | alostale | Relationship added | related to 0028149 |
2017-01-24 16:30 | alostale | Relationship replaced | blocks 0028149 |
2017-02-14 13:08 | caristu | Relationship added | causes 0035258 |
Notes |
|
|
Done, waiting for the PR16Q2 window to be open |
|
|
(0083442)
|
hgbot
|
2016-01-20 12:23
|
|
|
|
(0083447)
|
hgbot
|
2016-01-20 12:24
|
|
Repository: erp/devel/dbsm-main
Changeset: 1cfc605b10b11f632cb65346042edd8ae873d760
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Dec 10 10:46:51 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/1cfc605b10b11f632cb65346042edd8ae873d760 [^]
Related with issue 31685: Refactor how the exclude filter where clause is built
The logic that builds the part of the query where clause to exclude the objects from the exclude filters has been moved from the ModelLoaders to the ExcludeFilter class. That way it is done only in one place and it is easier to modify, in anticipation of the changes to support SQL wildcards in the exclude filter.
---
M src/org/apache/ddlutils/platform/ExcludeFilter.java
M src/org/apache/ddlutils/platform/ModelLoaderBase.java
M src/org/apache/ddlutils/platform/oracle/OracleModelLoader.java
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlModelLoader.java
---
|
|
|
(0083448)
|
hgbot
|
2016-01-20 12:24
|
|
Repository: erp/devel/dbsm-main
Changeset: f8a00436a70d644ce63dacdf83fe83a0aecdc5ea
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Dec 10 14:45:07 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/f8a00436a70d644ce63dacdf83fe83a0aecdc5ea [^]
Related with issue 31685: Refactor the functions to check db objects exists
Before the refactor each function allowed to check for the existence of one specific object (EXCLUDED_TABLE, EXCLUDED_VIEW, etc). Now the name of the object is passed as a parameter.
---
M src-test/src/org/openbravo/dbsm/test/model/CheckExcludeFilter.java
---
|
|
|
(0083449)
|
hgbot
|
2016-01-20 12:24
|
|
Repository: erp/devel/dbsm-main
Changeset: edc057968bb024f542e540cfd6753b83665ee4b4
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Dec 10 17:01:21 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/edc057968bb024f542e540cfd6753b83665ee4b4 [^]
Fixes issue 31685: Wildcards are supported in exclude filter
Now it is supported to use wildcards [1] inside exclude filter, for instance:
<excludedTable name="SYM\_%"/>
That sentence will exclude all the tables whose smae starts with SYM_. It is supported for all the database objects that can be excluded: tables, views, triggers, functions and sequences.
An exclusion is considered to be a wildcard if it contains the '%' character, if not what will be excluded will be the database object whose name is equals to the provided name, ignoring the casing.
To escape the underscore character a backslash must be used, like in the example. The is logic inside ExcludeFilter and OracleModelLoader to handle how this must be escaped in Oracle (nothing else is required for Postgres).
[1] http://www.w3schools.com/sql/sql_wildcards.asp [^]
---
M src/org/apache/ddlutils/platform/ExcludeFilter.java
M src/org/apache/ddlutils/platform/oracle/OracleModelLoader.java
---
|
|
|
(0083450)
|
hgbot
|
2016-01-20 12:24
|
|
Repository: erp/devel/dbsm-main
Changeset: b3a2447d43a9a13918725ba4055a2ab5a9af0bb5
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Dec 10 17:14:24 2015 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/b3a2447d43a9a13918725ba4055a2ab5a9af0bb5 [^]
Related with issue 31685: Adds tests for exclusion filters that use wildcards
For each database object that can be excluded (tables, views, functions, triggers and sequences) three tests have been created:
- One with a exclusion filter that defines only one exclusion using a wildcard
- One with a exclusion filter that defines several exclusions using wildcards
- One with a exclusion filter that combines exclusions based on wildcards and exclusions not based on wildcards.
All tests passed using Postgres 9.1 and Oracle 11.2. In both RDBMS using '\_' to escape the underscore character in wildcards (i.e. <excludedTable name="SYM\_%"/>) worked properly.
---
M src-test/src/org/openbravo/dbsm/test/model/CheckExcludeFilter.java
A src-test/model/excludeFilter/BASE_MODEL_WITH_SEVERAL_EXCLUDED_FUNCTIONS.xml
A src-test/model/excludeFilter/BASE_MODEL_WITH_SEVERAL_EXCLUDED_SEQUENCES.xml
A src-test/model/excludeFilter/BASE_MODEL_WITH_SEVERAL_EXCLUDED_TABLES.xml
A src-test/model/excludeFilter/BASE_MODEL_WITH_SEVERAL_EXCLUDED_TRIGGERS.xml
A src-test/model/excludeFilter/BASE_MODEL_WITH_SEVERAL_EXCLUDED_VIEWS.xml
A src-test/model/excludeFilter/excludeFunctionWithMultipleWildcards.xml
A src-test/model/excludeFilter/excludeFunctionWithWildcard.xml
A src-test/model/excludeFilter/excludeFunctionWithWildcardsAndNonWildcards.xml
A src-test/model/excludeFilter/excludeSequenceWithMultipleWildcards.xml
A src-test/model/excludeFilter/excludeSequenceWithWildcard.xml
A src-test/model/excludeFilter/excludeSequenceWithWildcardsAndNonWildcards.xml
A src-test/model/excludeFilter/excludeTableWithMultipleWildcards.xml
A src-test/model/excludeFilter/excludeTableWithWildcard.xml
A src-test/model/excludeFilter/excludeTableWithWildcardsAndNonWildcards.xml
A src-test/model/excludeFilter/excludeTriggerWithMultipleWildcards.xml
A src-test/model/excludeFilter/excludeTriggerWithWildcard.xml
A src-test/model/excludeFilter/excludeTriggerWithWildcardsAndNonWildcards.xml
A src-test/model/excludeFilter/excludeViewWithMultipleWildcards.xml
A src-test/model/excludeFilter/excludeViewWithWildcard.xml
A src-test/model/excludeFilter/excludeViewWithWildcardsAndNonWildcards.xml
---
|
|
|
(0083451)
|
hgbot
|
2016-01-20 12:24
|
|
Repository: erp/devel/dbsm-main
Changeset: 4f9d5b36e94ae62602b0eb07429a4ea33cb90ece
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Jan 18 13:07:07 2016 +0100
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/4f9d5b36e94ae62602b0eb07429a4ea33cb90ece [^]
Related with issue 31685: Escapes properly the underscore in the exclude filter
---
M src-test/model/excludeFilter/excludeFunctionWithMultipleWildcards.xml
M src-test/model/excludeFilter/excludeFunctionWithWildcardsAndNonWildcards.xml
M src-test/model/excludeFilter/excludeSequenceWithMultipleWildcards.xml
M src-test/model/excludeFilter/excludeSequenceWithWildcardsAndNonWildcards.xml
M src-test/model/excludeFilter/excludeTableWithMultipleWildcards.xml
M src-test/model/excludeFilter/excludeTableWithWildcardsAndNonWildcards.xml
M src-test/model/excludeFilter/excludeTriggerWithMultipleWildcards.xml
M src-test/model/excludeFilter/excludeTriggerWithWildcardsAndNonWildcards.xml
M src-test/model/excludeFilter/excludeViewWithMultipleWildcards.xml
M src-test/model/excludeFilter/excludeViewWithWildcardsAndNonWildcards.xml
---
|
|
|
(0083452)
|
hgbot
|
2016-01-20 12:24
|
|
|
|
|
|
|
|
|