Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0005229Openbravo ERP00. Application dictionarypublic2008-09-24 12:562009-04-21 11:06
Dowid 
Dowid 
normalminoralways
closedfixed 
10SP2
 
 
Core
No
0005229: Temporary tables T_Selection and T_Selection2 have been ported from v2.22 to 2.35 improperly
Temporary tables T_Selection and T_Selection2 have been ported from v2.22 to 2.35 improperly. Temporary tables have been ported as regular tables.
move T_Selection and T_Selection2 tables into the prescript.
No tags attached.
depends on backport 0005756 closed Dowid Temporary tables T_Selection and T_Selection2 have been ported from v2.22 to 2.35 improperly 
depends on backport 0005757 closed Dowid Temporary tables T_Selection and T_Selection2 have been ported from v2.22 to 2.35 improperly 
related to defect 0005215 closed Dowid Verify Bom button works incorrectly 
related to defect 0006521 closed Dowid Application Dictionary AD_Table contains records: C_Selection/C_Selection2 but these tables do not exist in the db 
patch postscript.patch (54,973) 2008-10-28 16:05
https://issues.openbravo.com/file_download.php?file_id=361&type=bug
Issue History
2008-09-24 12:56DowidNew Issue
2008-09-24 12:58DowidRelationship addedblocks 0005215
2008-09-26 10:07DowidIssue Monitored: Dowid
2008-10-06 09:46DowidNote Added: 0009362
2008-10-24 12:15DowidRelationship deletedblocks 0005215
2008-10-24 12:16DowidRelationship addedrelated to 0005215
2008-10-28 16:05DowidNote Added: 0009802
2008-10-28 16:05DowidFile Added: postscript.patch
2008-10-29 17:24cromeroProject@4@ => Openbravo ERP
2008-10-29 17:25cromeroCategory => 00. Application dictionary
2008-10-29 17:41DowidNote Added: 0009831
2008-10-30 14:31DowidStatusnew => scheduled
2008-10-30 14:31DowidAssigned To => Dowid
2008-10-30 14:31Dowidfix_in_branch => trunk
2008-11-04 16:06DowidNote Edited: 0009831
2008-11-05 16:52DowidNote Edited: 0009831
2008-11-06 18:47svnbotCheckin
2008-11-06 18:47svnbotNote Added: 0010055
2008-11-06 18:47svnbotStatusscheduled => resolved
2008-11-06 18:47svnbotResolutionopen => fixed
2008-11-06 18:47svnbotsvn_revision => 9767
2008-12-02 13:02jaimetorresf_bug_id0 => 2377094
2009-01-10 18:09rafarodaRelationship addedrelated to 0006521
2009-04-21 11:06psarobeStatusresolved => closed

Notes
(0009362)
Dowid   
2008-10-06 09:46   
This bug leads these functions M_PRICELIST_CREATE(),M_PRODUCT_BOM_CHECK() to work incorrectly, if 2 users launch them simultaneously.
(0009802)
Dowid   
2008-10-28 16:05   
2 Temporary tables (T_Selection, T_Selection2) are used by 2 functions (M_PRICELIST_CREATE(),M_PRODUCT_BOM_CHECK().

The DBSourceManager doesn't support the creation of TEMPORARY tables, however these tables can be created in the postscript. This would be fine, but Oracle and Postgre create TEMPORARY tables differently. Oracle creates the temporary tables during the creation of a "schema" and they exist in the schema with regular tables. Postgre on the other hand, creates these tables during the runtime. For these reasons we will have 2 function variants, one for postgre, and one for oracle.


The proposed solution for this bug.

1. Delete C_Selection.xml, C_Selection2.xml, M_PRICELIST_CREATE.xml and M_PRODUCT_BOM_CHECK.xml
2. Modify postscript-Oracle.sql, postscript-PostgreSql.sql by using patch.



Please Note:

1. I used prefix Temp_ for temporary tables

2. Postscript-PostgreSql.sql will be correct for postgre version 8.3. For version 8.2 and lower modifications are required. Every "select * from temp_table" will have to be replaced by "Execute 'Select * from Temp_table'".

3. There is another radical solution for this bug, however it requires to abandon the use of temporary tables. This solution would require to re-write the logic of functions that use temporary tables so that they do not use them.
(0009831)
Dowid   
2008-10-29 17:41   
(edited on: 2008-11-05 16:52)
New improved solution for this bug.

1. Add C_CREATE_TEMPORAL_TABLES() function. This function should be empty for oracle and will create temporary tables for postgre
2. The same functions for postgre and Oracle (M_PRICELIST_CREATE(),M_PRODUCT_BOM_CHECK()) using C_CREATE_TEMPORAL_TABLES
3. modify (M_PRICELIST_CREATE(),M_PRODUCT_BOM_CHECK()) with EXECUTE for support Postgres 8.2
4. Add Creation Temporary tables into the prescript Oracle
5. Use the C_TEMP prefix for the functions and temporal tables
6. Add "C_CREATE_TEMPORARY_TABLES" into the OpenbravoExcludeFilter.getExcludedFunctions()
and add "C_TEMP_SELECTION", "C_TEMP_SELECTION" into the OpenbravoExcludeFilter.getExcludedTables()

(0010055)
svnbot   
2008-11-06 18:47   
Repository: openbravo
Revision: 9767
Author: dowid
Date: 2008-11-06 18:47:27 +0100 (Thu, 06 Nov 2008)

Fixed bug 0005229: Temporary tables T_Selection and T_Selection2 have been ported from v2.22 to 2.35 improperly

---
U trunk/src-db/database/model/functions/M_PRICELIST_CREATE.xml
U trunk/src-db/database/model/functions/M_PRODUCT_BOM_CHECK.xml
U trunk/src-db/database/model/prescript-Oracle.sql
U trunk/src-db/database/model/prescript-PostgreSql.sql
D trunk/src-db/database/model/tables/C_SELECTION.xml
D trunk/src-db/database/model/tables/C_SELECTION2.xml
U trunk/src-db/src/com/openbravo/db/OpenbravoExcludeFilter.java
---

https://dev.openbravo.com/websvn/openbravo/?rev=9767&sc=1 [^]