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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0027453
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 08. Project and service managementminorhave not tried2014-08-24 14:082015-09-15 15:56
ReportershuehnerView Statuspublic 
Assigned ToAtulOpenbravo 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisionbb2a1e390853
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Todmiguelez
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0027453: pl function c_project_generate has broken sql

DescriptionThis functions contains the following sql:
182 SELECT COALESCE(MAX(C_UOM_ID), '100'),
183 MAX(C_Tax_ID) -- UOM 100=EA
184 INTO v_C_UOM_ID,
185 v_C_Tax_ID
186 FROM M_PRODUCT p,
187 C_TAX t
188 WHERE P.C_TaxCategory_ID=t.C_TaxCategory_ID
189 AND P.M_Product_ID=CUR_PLines.M_Product_ID
190 ORDER BY t.IsDefault DESC;

Note: line numbers as per \sf+ c_project_generate

This sql is broken as leads to the following error when executed 'with some random product':
obpi93=# SELECT COALESCE(MAX(C_UOM_ID), '100'),
  MAX(C_Tax_ID) -- UOM 100=EA
FROM M_PRODUCT p,
  C_TAX t
WHERE P.C_TaxCategory_ID=t.C_TaxCategory_ID
  AND P.M_Product_ID='0DC5C5281B3643DEAB978EB04139516B'
ORDER BY t.IsDefault DESC;
ERROR: column "t.isdefault" must appear in the GROUP BY clause or be used in an aggregate function
LINE 7: ORDER BY t.IsDefault DESC;

Note: This code seems to be unchanged since hg-revision 0 (from 2007)

Note: similar bug technically as in 27452.
That sql also functionally is questionable as either the order by is useless or the code is functionally wrong.
Steps To ReproduceReview code & or run that sql snipped
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0069667)
shuehner (administrator)
2014-08-24 14:08

Found using plpgsql_check
(0080377)
hgbot (developer)
2015-09-14 16:57

Repository: erp/devel/pi
Changeset: bb2a1e39085308d1688052d6da4ee958b663ea01
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Jul 21 11:02:59 2015 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/bb2a1e39085308d1688052d6da4ee958b663ea01 [^]

Fixes Issue 27453:pl function c_project_generate has broken sql

Inorder to give first preference to default taxes defined under
tax category used in product, group by isdefault column is added
so that result set could be sorted using isdefault in descending
order. Loop is provided to handle more than one row.

---
M src-db/database/model/functions/C_PROJECT_GENERATE.xml
---
(0080378)
dmiguelez (developer)
2015-09-14 16:58

Code Review + Testing Ok
(0080404)
hudsonbot (developer)
2015-09-15 15:56

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

- Issue History
Date Modified Username Field Change
2014-08-24 14:08 shuehner New Issue
2014-08-24 14:08 shuehner Assigned To => dmiguelez
2014-08-24 14:08 shuehner Modules => Core
2014-08-24 14:08 shuehner Triggers an Emergency Pack => No
2014-08-24 14:08 shuehner Note Added: 0069667
2014-08-24 14:09 shuehner Description Updated View Revisions
2014-09-03 14:02 eduardo_Argal Assigned To dmiguelez => eduardo_Argal
2015-07-21 07:12 AtulOpenbravo Assigned To eduardo_Argal => AtulOpenbravo
2015-07-21 07:12 AtulOpenbravo Status new => scheduled
2015-09-14 16:57 hgbot Checkin
2015-09-14 16:57 hgbot Note Added: 0080377
2015-09-14 16:57 hgbot Status scheduled => resolved
2015-09-14 16:57 hgbot Resolution open => fixed
2015-09-14 16:57 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bb2a1e39085308d1688052d6da4ee958b663ea01 [^]
2015-09-14 16:58 dmiguelez Review Assigned To => dmiguelez
2015-09-14 16:58 dmiguelez Note Added: 0080378
2015-09-14 16:58 dmiguelez Status resolved => closed
2015-09-15 15:56 hudsonbot Checkin
2015-09-15 15:56 hudsonbot Note Added: 0080404


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker