Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0019781Openbravo ERPA. Platformpublic2012-02-15 17:372012-04-01 20:38
mirurita 
migueldejuana 
normalminoralways
closedfixed 
5
3.0MP7.1 
3.0MP103.0MP10 
Core
No
0019781: Audit trail fails with tables having CLOB type columns (i.e. ad_process_request)
[only tested in oracle]

After you set as 'Fully Audit' a table having CLOB type column/s (for example ad_process_request).

When you run 'Update Audit Trail infrastructure' process it creates an 'invalid' trigger 'AU_AD_Process_Request_TRG' that does not compile.

the problem is with OB_CONTEXT column.
In the trigger it's trying to assign a CLOB variable to a NUMBER type.


V_OLD_NUMBER NUMBER := NULL;
V_NEW_NUMBER NUMBER := NULL;

IF (UPDATING AND COALESCE(:NEW.OB_CONTEXT, -1) != COALESCE(:OLD.OB_CONTEXT, -1))
OR DELETING OR INSERTING THEN
  IF (UPDATING OR INSERTING) THEN
    V_NEW_NUMBER := :NEW.OB_CONTEXT;
  END IF;
  IF (UPDATING OR DELETING) THEN
    V_OLD_NUMBER := :OLD.OB_CONTEXT;
  END IF;
1) Enable the instance.
2) Enable the audit trail for 'ad_process_request' table.
As system administrator go to table and turn on fully audited flag.
3) As system administrator run the 'Update Audit Trail infrastructure' process.
4) Create a new process request.
5) Modify any of the fields and when trying to save you will get an error (see attached screenshot).
No tags attached.
related to design defect 0019982 closed alostale Audit trail support for CLOB/Text 
related to defect 00203633.0MP13 closed alostale If you put the table OBUIAPP_UIPersonalization as fully audited it does not work form or view personalization 
png AuditTrail_clob.png (40,688) 2012-02-15 17:37
https://issues.openbravo.com/file_download.php?file_id=4999&type=bug
png
Issue History
2012-02-15 17:37miruritaNew Issue
2012-02-15 17:37miruritaAssigned To => alostale
2012-02-15 17:37miruritaFile Added: AuditTrail_clob.png
2012-02-15 17:37miruritaModules => Core
2012-02-16 17:03miruritaSeveritymajor => minor
2012-02-16 17:13egoitzResolution time => 1333576800
2012-02-16 17:13egoitzTarget Version => 3.0MP10
2012-02-21 17:28alostaleAssigned Toalostale => migueldejuana
2012-03-08 08:05hgbotCheckin
2012-03-08 08:05hgbotNote Added: 0046156
2012-03-08 08:05hgbotStatusnew => resolved
2012-03-08 08:05hgbotResolutionopen => fixed
2012-03-08 08:05hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c5bc41eed924d01965eb0fd82080d0b9600b83b5 [^]
2012-03-08 08:06alostaleNote Added: 0046157
2012-03-08 08:06alostaleStatusresolved => closed
2012-03-08 08:06alostaleFixed in Version => 3.0MP10
2012-03-08 08:09alostaleRelationship addedrelated to 0019982
2012-04-01 20:38hudsonbotCheckin
2012-04-01 20:38hudsonbotNote Added: 0047059
2012-06-14 15:46alostaleRelationship addedrelated to 0020363

Notes
(0046156)
hgbot   
2012-03-08 08:05   
Repository: erp/devel/pi
Changeset: c5bc41eed924d01965eb0fd82080d0b9600b83b5
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Wed Mar 07 15:46:53 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c5bc41eed924d01965eb0fd82080d0b9600b83b5 [^]

Fixed issue 19781: Fully audit table with CLOB column, launched trigger well.
Auditing a table with a CLOB column launch au_ad_process.request_trg without errors.

---
M src-db/database/model/postscript-Oracle.sql
---
(0046157)
alostale   
2012-03-08 08:06   
Code reviewed and tested on pi@c5bc41eed924
(0047059)
hudsonbot   
2012-04-01 20:38   
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/640de9acc2d5 [^]

Maturity status: Test