details:   https://code.openbravo.com/erp/devel/pi/rev/38d87f5ca8e1
changeset: 30310:38d87f5ca8e1
user:      Naroa Iriarte <naroa.iriarte <at> openbravo.com>
date:      Thu Sep 22 10:40:12 2016 +0200
summary:   Fixed issue 33787: Some PL functions needed to be properly removed

The hex_to_int and is_trigger_enabled functions were not properly removed, it 
was neccessary to do an install.source to have them properly removed. Now these 
functios are removed if they exist when an update is done.

diffstat:

 src-db/database/model/postscript-Oracle.sql    |  11 +++++++++++
 src-db/database/model/prescript-PostgreSql.sql |   6 ++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diffs (44 lines):

diff -r 13f7a8be3163 -r 38d87f5ca8e1 src-db/database/model/postscript-Oracle.sql
--- a/src-db/database/model/postscript-Oracle.sql       Wed Sep 21 00:20:58 
2016 +0530
+++ b/src-db/database/model/postscript-Oracle.sql       Thu Sep 22 10:40:12 
2016 +0200
@@ -22,6 +22,17 @@
 END NOW;
 /-- END NOW
 
+DECLARE
+  isPresent number;
+BEGIN
+  SELECT count(*) INTO isPresent
+  FROM USER_PROCEDURES WHERE object_name ='HEX_TO_INT' AND object_type = 
'FUNCTION';
+  IF isPresent != 0 THEN
+    EXECUTE IMMEDIATE 'drop function hex_to_int';
+  end if;
+END;
+/-- END
+
 CREATE OR REPLACE FUNCTION ad_script_execute (param_Message VARCHAR2)
   RETURN VARCHAR2
 AS
diff -r 13f7a8be3163 -r 38d87f5ca8e1 
src-db/database/model/prescript-PostgreSql.sql
--- a/src-db/database/model/prescript-PostgreSql.sql    Wed Sep 21 00:20:58 
2016 +0530
+++ b/src-db/database/model/prescript-PostgreSql.sql    Thu Sep 22 10:40:12 
2016 +0200
@@ -415,6 +415,10 @@
 ' language 'plpgsql' IMMUTABLE
 /-- END
 
+DROP function IF EXISTS hex_to_int(varchar);
+
+DROP function IF EXISTS hex_to_int(numeric);
+
 CREATE OR REPLACE FUNCTION add_months
 (
 date,
@@ -963,6 +967,8 @@
   RIGHTARG = numeric)
 /-- END
 
+DROP function IF EXISTS is_Trigger_Enabled(text);
+
 -- Creating auxiliar functions for view dropping
 CREATE or REPLACE function drop_view (view_name IN varchar) returns varchar as 
'
 DECLARE

------------------------------------------------------------------------------
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to