Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0041785 | Openbravo ERP | A. Platform | public | 2019-09-09 16:43 | 2019-09-27 09:00 |
|
Reporter | aferraz | |
Assigned To | alostale | |
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.0PR19Q4 | |
Merge Request Status | |
Review Assigned To | AugustoMauch |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0041785: Error with function index including a coalesce with a varchar |
Description | Error with function index including a coalesce with a varchar |
Steps To Reproduce | Create following index:
CREATE INDEX c_order_test ON public.c_order USING btree (COALESCE(c_order_id, 'X'));
Export database.
Check database is correctly exported and index is exported as follows:
<index name="C_ORDER_TEST" unique="false">
<index-column name="functionBasedColumn" functionExpression="COALESCE(C_ORDER_ID,'X' varying)"/>
</index>
Remove index from database and run ant update.database -Dlocal=yes in order to create the index from the xml.
Check you get following error:
SQL Command failed with: ERROR: error de sintaxis en o cerca de «varying»
CREATE INDEX C_ORDER_TEST ON C_ORDER ((COALESCE(C_ORDER_ID,'X' varying)))
Realize similar index including a coalesce with a decimal works fine:
CREATE INDEX c_order_test ON public.c_order USING btree (COALESCE(grandtotal, 0)); |
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | feature request | 0030179 | 3.0PR15Q4 | closed | AugustoMauch | DBSourceManager support indexes with functions | related to | defect | 0041795 | | closed | platform | Oracle only: multi-column index with function based column doesn't properly apply |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2019-09-09 16:43 | aferraz | New Issue | |
2019-09-09 16:43 | aferraz | Assigned To | => platform |
2019-09-09 16:43 | aferraz | Modules | => Core |
2019-09-09 16:43 | aferraz | Triggers an Emergency Pack | => No |
2019-09-09 16:56 | aferraz | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=19365#r19365 |
2019-09-09 17:10 | aferraz | Summary | Error with function index including a coalesce => Error with function index including a coalesce with a varchar |
2019-09-09 17:10 | aferraz | Description Updated | bug_revision_view_page.php?rev_id=19367#r19367 |
2019-09-09 17:10 | aferraz | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=19368#r19368 |
2019-09-10 10:30 | alostale | Assigned To | platform => alostale |
2019-09-10 10:30 | alostale | Relationship added | related to 0030179 |
2019-09-10 10:32 | alostale | Review Assigned To | => AugustoMauch |
2019-09-10 14:07 | hgbot | Checkin | |
2019-09-10 14:07 | hgbot | Note Added: 0114494 | |
2019-09-10 14:07 | hgbot | Status | new => resolved |
2019-09-10 14:07 | hgbot | Resolution | open => fixed |
2019-09-10 14:07 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/6bc6f363024ebdaad0fe307f972440f24e870205 [^] |
2019-09-10 14:07 | hgbot | Checkin | |
2019-09-10 14:07 | hgbot | Note Added: 0114495 | |
2019-09-10 14:07 | hgbot | Checkin | |
2019-09-10 14:07 | hgbot | Note Added: 0114496 | |
2019-09-10 14:07 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/devel/pi/rev/6bc6f363024ebdaad0fe307f972440f24e870205 [^] => http://code.openbravo.com/erp/devel/dbsm-main/rev/970f3f969462a63dcf01f1296eaf9a46efe18fcb [^] |
2019-09-10 14:07 | hgbot | Checkin | |
2019-09-10 14:07 | hgbot | Note Added: 0114497 | |
2019-09-10 18:12 | vmromanos | Relationship added | related to 0041795 |
2019-09-10 19:28 | hudsonbot | Checkin | |
2019-09-10 19:28 | hudsonbot | Note Added: 0114516 | |
2019-09-27 09:00 | AugustoMauch | Note Added: 0114827 | |
2019-09-27 09:00 | AugustoMauch | Status | resolved => closed |
2019-09-27 09:00 | AugustoMauch | Fixed in Version | => 3.0PR19Q4 |
Notes |
|
(0114494)
|
hgbot
|
2019-09-10 14:07
|
|
Repository: erp/devel/pi
Changeset: 6bc6f363024ebdaad0fe307f972440f24e870205
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Sep 10 13:57:18 2019 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/6bc6f363024ebdaad0fe307f972440f24e870205 [^]
fixed bug 41785: function indexes fail with character varying columns
When exporting indexes with functions castings added in PostgreSQL catalog are
removed to keep ORA<->PG compatiliblity. This is done through a regexp, which
incorrectly assumed cast is always a single word.
As character varying is the only type with two words, the regexp has been changed
to take this specific case into account, no more complex potential cases have
been included as this would add extra complexity for castings followed by other
expressions (ie. CASE col1 when col2 then 'Y'::text else 'N'::text).
---
M src-db/database/lib/dbsourcemanager.jar
---
|
|
|
(0114495)
|
hgbot
|
2019-09-10 14:07
|
|
|
|
(0114496)
|
hgbot
|
2019-09-10 14:07
|
|
Repository: erp/devel/dbsm-main
Changeset: 970f3f969462a63dcf01f1296eaf9a46efe18fcb
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Sep 10 10:44:19 2019 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/970f3f969462a63dcf01f1296eaf9a46efe18fcb [^]
fixed bug 41785: function indexes fail with character varying columns
When exporting indexes with functions castings added in PostgreSQL catalog are
removed to keep ORA<->PG compatiliblity. This is done through a regexp, which
incorrectly assumed cast is always a single word.
As character varying is the only type with two words, the regexp has been changed
to take this specific case into account, no more complex potential cases have
been included as this would add extra complexity for castings followed by other
expressions (ie. CASE col1 when col2 then 'Y'::text else 'N'::text).
---
M src/org/apache/ddlutils/platform/postgresql/PostgreSqlModelLoader.java
---
|
|
|
(0114497)
|
hgbot
|
2019-09-10 14:07
|
|
Repository: erp/devel/dbsm-main
Changeset: cf22a41569f8f5a18eb1299a56e26dcfe80d36c1
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Sep 10 14:03:02 2019 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/cf22a41569f8f5a18eb1299a56e26dcfe80d36c1 [^]
related to issue 41785: refactor index test cases
Making now use of standard export assertions instead of ad-hoc one.
---
M src-test/src/org/openbravo/dbsm/test/model/CheckIndexFunctionInPrescripts.java
M src-test/src/org/openbravo/dbsm/test/model/ContainsSearchIndexes.java
M src-test/src/org/openbravo/dbsm/test/model/FunctionBasedIndexes.java
M src-test/src/org/openbravo/dbsm/test/model/IndexBaseTest.java
M src-test/src/org/openbravo/dbsm/test/model/IndexParallelization.java
M src-test/src/org/openbravo/dbsm/test/model/OperatorClassIndexes.java
M src-test/src/org/openbravo/dbsm/test/model/PartialIndexes.java
---
|
|
|
|
|
|
|
Code reviewed and verified |
|