Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||||||||||||||||
View Issue Details | ||||||||||||||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||||||||||||||||
0012693 | Openbravo ERP | Z. Others | public | 2010-03-16 11:26 | 2010-05-18 12:12 | |||||||||||||||||||||
Reporter | adrianromero | |||||||||||||||||||||||||
Assigned To | adrianromero | |||||||||||||||||||||||||
Priority | normal | Severity | major | Reproducibility | have not tried | |||||||||||||||||||||
Status | closed | Resolution | fixed | |||||||||||||||||||||||
Platform | OS | 5 | OS Version | |||||||||||||||||||||||
Product Version | 2.50MP12 | |||||||||||||||||||||||||
Target Version | 2.50MP17 | Fixed in Version | ||||||||||||||||||||||||
Merge Request Status | ||||||||||||||||||||||||||
Review Assigned To | ||||||||||||||||||||||||||
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 | 0012693: Review on delete triggers | |||||||||||||||||||||||||
Description | Copied ALO's mail Fixing this issue [1], I've realized that triggers work in a slightly different way between Oracle and PostrgreSQL: -Oracle: 1."before" triggers are executed 2. "after" triggers are executed 3. constraints are verified -PostgreSQL 1."before" triggers are executed 2. constraints are verified 3. "after" triggers are executed This means that triggers to be executed on delete that are used to do cascade deletions (as the one reported in the issue), in Oracle can be defined as before or after, but in Postgre they will not work unless they are "before". Looking in the core code I've found these candidates to be reviewed: grep -i 'delete\s*from' `grep -l 'fires="after".*delete="true"' *` AD_REFERENCE_TRG2.xml: DELETE FROM AD_MODEL_OBJECT_MAPPING WHERE AD_MODEL_OBJECT_ID IN ( AD_REFERENCE_TRG2.xml: DELETE FROM AD_MODEL_OBJECT WHERE ACTION = 'S' AND AD_MODEL_OBJECT.AD_REFERENCE_ID = :OLD.AD_REFERENCE_ID; AD_TAB_TRG2.xml: DELETE FROM AD_MODEL_OBJECT_MAPPING WHERE AD_MODEL_OBJECT_ID IN ( AD_TAB_TRG2.xml: DELETE FROM AD_MODEL_OBJECT WHERE ACTION = 'W' AND AD_MODEL_OBJECT.AD_TAB_ID = :OLD.AD_TAB_ID; C_BPARTNER_TRG.xml: DELETE FROM AD_TreeNodeBP WHERE AD_Client_ID = :old.AD_Client_ID AND Node_ID = :old.C_BPartner_ID; C_INVOICELINETAX_TRG.xml: DELETE FROM C_INVOICETAX C_INVOICELINE_TRG2.xml: DELETE FROM C_INVOICELINE_OFFER C_INVOICELINE_TRG2.xml: DELETE FROM C_INVOICELINETAX WHERE C_INVOICELINE_ID = :new.C_InvoiceLine_ID; C_ORDERLINETAX_TRG.xml: DELETE FROM C_ORDERTAX C_ORDERLINE_TRG2.xml: DELETE FROM C_ORDERLINE_OFFER C_ORDERLINE_TRG2.xml: DELETE FROM C_ORDERLINETAX WHERE C_ORDERLINE_ID = :new.C_OrderLine_ID; M_PRODUCT_TRG.xml: DELETE FROM AD_TreeNodePR WHERE AD_Client_ID = :old.AD_Client_ID AND Node_ID = :old.M_Product_ID; I will review and fix the platform ones (ad_reference_trg2, ad_tab_trg2), and I'd like to someone else to review the other ones. You also should take this note into account when creating new triggers. [1] https://issues.openbravo.com/view.php?id=12601 [^] | |||||||||||||||||||||||||
Steps To Reproduce | ||||||||||||||||||||||||||
Proposed Solution | ||||||||||||||||||||||||||
Additional Information | ||||||||||||||||||||||||||
Tags | No tags attached. | |||||||||||||||||||||||||
Relationships |
| |||||||||||||||||||||||||
Attached Files | ||||||||||||||||||||||||||
Issue History | ||||||||||||||||||||||||||
Date Modified | Username | Field | Change | |||||||||||||||||||||||
2010-03-16 11:26 | adrianromero | New Issue | ||||||||||||||||||||||||
2010-03-16 11:26 | adrianromero | Assigned To | => adrianromero | |||||||||||||||||||||||
2010-03-16 11:26 | adrianromero | OBNetwork customer | => No | |||||||||||||||||||||||
2010-03-16 11:27 | adrianromero | Relationship added | related to 0012601 | |||||||||||||||||||||||
2010-03-16 11:32 | adrianromero | Status | new => scheduled | |||||||||||||||||||||||
2010-03-16 11:32 | adrianromero | fix_in_branch | => pi | |||||||||||||||||||||||
2010-03-17 12:55 | adrianromero | Relationship added | related to 0011933 | |||||||||||||||||||||||
2010-03-17 13:00 | rafaroda | Issue Monitored: rafaroda | ||||||||||||||||||||||||
2010-03-17 18:17 | adrianromero | version | => 2.50MP12 | |||||||||||||||||||||||
2010-03-17 18:17 | adrianromero | fix_in_branch | pi => | |||||||||||||||||||||||
2010-03-22 18:52 | hgbot | Checkin | ||||||||||||||||||||||||
2010-03-22 18:52 | hgbot | Note Added: 0025654 | ||||||||||||||||||||||||
2010-03-22 18:52 | hgbot | Status | scheduled => resolved | |||||||||||||||||||||||
2010-03-22 18:52 | hgbot | Resolution | open => fixed | |||||||||||||||||||||||
2010-03-22 18:52 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/419a4aedd233a3e1697c4c610cbc45d61eee39ce [^] | |||||||||||||||||||||||
2010-03-22 18:54 | adrianromero | Note Added: 0025655 | ||||||||||||||||||||||||
2010-03-23 11:50 | adrianromero | Relationship added | depends on 0012771 | |||||||||||||||||||||||
2010-04-15 11:32 | plujan | Note Added: 0026238 | ||||||||||||||||||||||||
2010-04-15 11:32 | plujan | Status | resolved => closed | |||||||||||||||||||||||
2010-04-16 00:00 | anonymous | sf_bug_id | 0 => 2987966 | |||||||||||||||||||||||
2010-04-19 21:10 | hudsonbot | Checkin | ||||||||||||||||||||||||
2010-04-19 21:10 | hudsonbot | Note Added: 0026368 | ||||||||||||||||||||||||
2010-05-18 12:12 | gorka_gil | Target Version | 2.50MP15 => 2.50MP17 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|