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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0029732
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2015-04-29 13:222016-03-17 10:54
ReporterSandrahuguetView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version3.0PR15Q4
StatusclosedFix in branchFixed in SCM revision712d158da36e
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabasePostgreSQLJava version1.6.0_18
OS VersionCommunity ApplianceDatabase version8.3.9Ant version1.7.1
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0029732: In a mandatory field, the query created when filtering shouldn't have the functions 'coalesce' and 'to_char'

DescriptionIn a mandatory field, the query created when filtering shouldn't have the functions 'coalesce' and 'to_char'
Steps To Reproduce-Go to Discounts and Promotions Window
-Navigate to Business partner tab
-Filter by 'A' and pres tab key

The following query is executed:

select pricingadj0_.M_Offer_Bpartner_ID as M1_503_, pricingadj0_.AD_Client_ID as AD2_503_, pricingadj0_.AD_Org_ID as AD3_503_, pricingadj0_.IsActive as IsActive503_, pricingadj0_.Created as Created503_, pricingadj0_.Createdby as Createdby503_, pricingadj0_.Updated as Updated503_, pricingadj0_.Updatedby as Updatedby503_, pricingadj0_.M_Offer_ID as M9_503_, pricingadj0_.C_BPartner_ID as C10_503_ from M_Offer_BPartner pricingadj0_ left outer join C_BPartner businesspa1_ on pricingadj0_.C_BPartner_ID=businesspa1_.C_BPartner_ID where (upper(coalesce(to_char(businesspa1_.Name), '')) like upper(?) escape '|') and pricingadj0_.M_Offer_ID=? and (pricingadj0_.AD_Org_ID in ('D270A5AC50874F8BA67A88EE977F8E3B' , '4399136852B145BD96CC2A6CE0800C68' , '14B1927026BE471E9B85FE699BCA61C2' , '0' , 'B5DE96143D6642228E3B9DEC69886A47' , '3B187EC130A549A7A9388F8060EF156D' , '67839EEFA49E44AC969BD60093FCC899' , '01AD882EFC8545ACA6455E2F6FD51EE9' , 'BF129721D9FB4EB0819509934153E972')) and (pricingadj0_.AD_Client_ID in ('39363B0921BB4293B48383844325E84C' , '0')) order by businesspa1_.Name, pricingadj0_.M_Offer_Bpartner_ID limit ?
TagsNo tags attached.
Attached Files? file icon 29732.export [^] (2,202 bytes) 2015-05-11 13:20

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0029919 acknowledgedplatform The query done to populate table/tabledir dropdowns in forms when the user enters text can be improved 
blocks feature request 0029612 closedAugustoMauch Extend the grid configuration to improve the performance of the population of foreign key dropdowns 

-  Notes
(0078649)
hgbot (developer)
2015-07-06 09:23

Repository: erp/devel/pi
Changeset: e684c73bb502f85fb71b82f2e55ad35644dbe505
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon May 11 13:18:57 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e684c73bb502f85fb71b82f2e55ad35644dbe505 [^]

Fixes bug 29732: Get rid of coalesce(to_char()) when possible to improve query

We sometimes use the coalesce(to_char(value),'') functions to prevent passing null values in a where clause, replacing the null value with an empty string. The problem is that if those functions are used, then it will not be possible benefit from the indexes defined in the database.

In this issue we have made a distintion between mandatory and non-mandatory columns. Mandatory columns will no longer use the coalesce and to_char functions in the AdvancedQueryBuilder.createIdentifierLeftClause method. We can do that safely as it is not possible that those columns have null values.

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
---
(0078698)
alostale (developer)
2015-07-07 10:08

code reviewed + tested
(0079458)
hudsonbot (developer)
2015-08-20 23:15

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/8c91718397a5 [^]
Maturity status: Test
(0083537)
hgbot (developer)
2016-01-22 11:18

Repository: erp/devel/pi
Changeset: 712d158da36ea648c5ebbb347c22a947387adadb
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon May 11 13:18:57 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/712d158da36ea648c5ebbb347c22a947387adadb [^]

Fixes bug 29732: Get rid of coalesce(to_char()) when possible to improve query

We sometimes use the coalesce(to_char(value),'') functions to prevent passing null values in a where clause, replacing the null value with an empty string. The problem is that if those functions are used, then it will not be possible benefit from the indexes defined in the database.

In this issue we have made a distintion between mandatory and non-mandatory columns. Mandatory columns will no longer use the coalesce and to_char functions in the AdvancedQueryBuilder.createIdentifierLeftClause method. We can do that safely as it is not possible that those columns have null values.

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/AdvancedQueryBuilder.java
---
(0083700)
alostale (developer)
2016-01-29 08:32

closed again: was set as resolved incorrectly
(0085065)
hudsonbot (developer)
2016-03-17 10:54

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/b22fb0500156 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2015-04-29 13:22 Sandrahuguet New Issue
2015-04-29 13:22 Sandrahuguet Assigned To => platform
2015-04-29 13:22 Sandrahuguet Modules => Core
2015-04-29 13:22 Sandrahuguet Triggers an Emergency Pack => No
2015-04-29 13:23 AugustoMauch Assigned To platform => AugustoMauch
2015-04-29 13:23 AugustoMauch Status new => acknowledged
2015-05-11 13:11 AugustoMauch Relationship added blocks 0029612
2015-05-11 13:20 AugustoMauch File Added: 29732.export
2015-05-18 18:36 AugustoMauch Relationship added related to 0029919
2015-07-06 09:13 AugustoMauch Status acknowledged => scheduled
2015-07-06 09:23 hgbot Checkin
2015-07-06 09:23 hgbot Note Added: 0078649
2015-07-06 09:23 hgbot Status scheduled => resolved
2015-07-06 09:23 hgbot Resolution open => fixed
2015-07-06 09:23 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e684c73bb502f85fb71b82f2e55ad35644dbe505 [^]
2015-07-06 09:24 AugustoMauch Issue Monitored: alostale
2015-07-06 09:24 AugustoMauch Review Assigned To => alostale
2015-07-07 10:08 alostale Note Added: 0078698
2015-07-07 10:08 alostale Status resolved => closed
2015-07-07 10:08 alostale Fixed in Version => 3.0PR15Q4
2015-08-20 23:15 hudsonbot Checkin
2015-08-20 23:15 hudsonbot Note Added: 0079458
2016-01-22 11:18 hgbot Checkin
2016-01-22 11:18 hgbot Note Added: 0083537
2016-01-22 11:18 hgbot Status closed => resolved
2016-01-22 11:18 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/e684c73bb502f85fb71b82f2e55ad35644dbe505 [^] => http://code.openbravo.com/erp/devel/pi/rev/712d158da36ea648c5ebbb347c22a947387adadb [^]
2016-01-29 08:32 alostale Note Added: 0083700
2016-01-29 08:32 alostale Status resolved => closed
2016-03-17 10:54 hudsonbot Checkin
2016-03-17 10:54 hudsonbot Note Added: 0085065


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker