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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034833
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2016-12-30 11:582017-03-15 20:19
ReporterinigosanchezView Statuspublic 
Assigned Toinigosanchez 
PriorityhighResolutionfixedFixed in Version3.0PR17Q2
StatusclosedFix in branchFixed in SCM revisionf730600d5079
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
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

0034833: audit triggers can have naming clashes

DescriptionTriggers created for audit trail can have clashes in naming, causing incorrect auditing in these cases.

This occurs because of the way name is generated [1], which doesn't validate there is no function nor trigger with the same name.

[1] https://code.openbravo.com/erp/devel/pi/file/2a03b4d16b5d/src-db/database/model/postscript-PostgreSql.sql#l421 [^]
Steps To Reproduce1. Log in as System Admin in an activated instance.
2. Open Table window and mark as audited OBKMO_Widget_Class_Menu and OBKMO_Widget_Class_Menu_Trl tables
3. Execute Update Audit Trail Infrastructure process
4. Check two triggers are created based on same function:


# select * from user_triggers where trigger_name like 'au_%';
         table_name | tablespace_name | trigger_name | status
-----------------------------+-----------------+--------------------------------+---------
 OBKMO_WIDGET_CLASS_MENU | PUBLIC | au_obkmo_widget_class_menu_trg | ENABLED
 OBKMO_WIDGET_CLASS_MENU_TRL | PUBLIC | au_obkmo_widget_class_menu_trg | ENABLED
(2 rows)


  ERROR: this is incorrect, each trigger should have its own function
5. Execute Update Audit Trail Infrastructure process again
  ERROR: cannot drop function au_obkmo_widget_class_menu_trg() because other objects depend on it
  This occurs because function is tried to be dropped after dropping 1st trigger, but keeping 2nd one.
Proposed SolutionAfter generating trigger name, validate it doesn't exist before creating, if it exists generate a different name till it doesn't exist.
TagsNo tags attached.
Attached Filespng file icon errorAuditTrail.png [^] (206,939 bytes) 2016-12-30 11:58

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0094080)
hgbot (developer)
2017-02-06 12:57

Repository: erp/devel/pi
Changeset: f730600d5079cc23e1e5e8254ec5de3949a8f6a4
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Mon Feb 06 12:56:44 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/f730600d5079cc23e1e5e8254ec5de3949a8f6a4 [^]

Fixed issue 34833: audit triggers can have naming clashes

The problem occurs because of the way audit trigger name is generated,
which doesn't validate there is no function nor trigger with the same name.

In order to fix this problem a validation is added. Now, this problem has
been managed properly.

---
M src-db/database/model/postscript-Oracle.sql
M src-db/database/model/postscript-PostgreSql.sql
---
(0094211)
alostale (manager)
2017-02-10 09:02

code reviewed

tested ora + pg
(0095161)
hudsonbot (developer)
2017-03-15 20:19

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

- Issue History
Date Modified Username Field Change
2016-12-30 11:58 inigosanchez New Issue
2016-12-30 11:58 inigosanchez Assigned To => platform
2016-12-30 11:58 inigosanchez File Added: errorAuditTrail.png
2016-12-30 11:58 inigosanchez Modules => Core
2016-12-30 11:58 inigosanchez Triggers an Emergency Pack => No
2016-12-30 12:18 inigosanchez Steps to Reproduce Updated View Revisions
2017-01-10 11:33 alostale Summary Update Audit Trail Infrastructure process doesn't works properly under some circumstances => audit trigger can have naming clashes
2017-01-10 11:33 alostale Description Updated View Revisions
2017-01-10 11:33 alostale Steps to Reproduce Updated View Revisions
2017-01-10 11:33 alostale Proposed Solution updated
2017-01-10 11:33 alostale Summary audit trigger can have naming clashes => audit triggers can have naming clashes
2017-01-10 11:34 alostale Status new => acknowledged
2017-01-10 11:43 alostale Priority low => high
2017-02-02 15:03 inigosanchez Status acknowledged => scheduled
2017-02-02 15:03 inigosanchez Assigned To platform => inigosanchez
2017-02-06 12:52 inigosanchez Review Assigned To => alostale
2017-02-06 12:57 hgbot Checkin
2017-02-06 12:57 hgbot Note Added: 0094080
2017-02-06 12:57 hgbot Status scheduled => resolved
2017-02-06 12:57 hgbot Resolution open => fixed
2017-02-06 12:57 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f730600d5079cc23e1e5e8254ec5de3949a8f6a4 [^]
2017-02-10 09:02 alostale Note Added: 0094211
2017-02-10 09:02 alostale Status resolved => closed
2017-02-10 09:02 alostale Fixed in Version => 3.0PR17Q2
2017-03-15 20:19 hudsonbot Checkin
2017-03-15 20:19 hudsonbot Note Added: 0095161


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker