-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Muhammad: I think you may have accidentally done a master to pgsql
merge for me. :) 

http://hosted2.fedoraproject.org/cgit/spacewalk.git/commit/?h=pgsql&id=20a473edd51cf26e19220b8a048b2e250606b047

It appears the merge was clean, no conflicts, thus why it was probably
somewhat easy to not realize this was happening.

I think I've pieced together a way to check the diff of what's changed
in the existing Oracle rhnsat schema, attaching the diff, much smaller
this time around.

Gurjeet: I think you mentioned the last diff was addressed in the
PostgreSQL schema (sent on Feb 18) but just wanted to confirm.

Remember that 'git merge SOMETHING' means you're merging 'SOMETHING'
into whatever branch you're currently working on. In this case it was
probably 'git merge master' when it was intended to be 'git merge my
workbranch'. Fortunately we intend to merge in master frequently so no
harm no foul. :)

Muhammad could you check and make sure the work you were
trying to merge in actually made it? 

Thanks,

Devan

- -- 
  Devan Goodwin <[email protected]>
  Software Engineer     Spacewalk / RHN Satellite
  Halifax, Canada       650.567.9039x79267
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkmr7fEACgkQAyHWaPV9my4OuQCg3m3rdpsuSG6zUU8Ke5KW8eD6
RTAAn0EtlYJ084xZx1NmrgvFJiz6x8Qk
=tPg1
-----END PGP SIGNATURE-----
diff --git a/schema/spacewalk/rhnsat/class/evr_t.sql b/schema/spacewalk/rhnsat/class/evr_t.sql
index 0d03097..a9debe5 100644
--- a/schema/spacewalk/rhnsat/class/evr_t.sql
+++ b/schema/spacewalk/rhnsat/class/evr_t.sql
@@ -61,3 +61,26 @@ end;
 /
 show errors
 
+create or replace function evr_t_as_vre( a evr_t )
+  return varchar2
+is
+begin
+        return a.version || '-' || a.release || ':' || a.epoch;
+end;
+
+create or replace function evr_t_as_vre_simple( a evr_t )
+  return VARCHAR2
+is
+    vre_out VARCHAR2(256);
+begin
+    vre_out := a.version || '-' || a.release;
+    
+    if a.epoch is not null
+    then
+        vre_out := vre_out || ':' || a.epoch;
+    end if;
+    
+    return vre_out;
+end;
+
+
diff --git a/schema/spacewalk/rhnsat/procs/lookup_client_capability.sql b/schema/spacewalk/rhnsat/procs/lookup_client_capability.sql
index 366b4db..0d2ed85 100644
--- a/schema/spacewalk/rhnsat/procs/lookup_client_capability.sql
+++ b/schema/spacewalk/rhnsat/procs/lookup_client_capability.sql
@@ -15,33 +15,20 @@
 --
 --
 --
-
 CREATE OR REPLACE FUNCTION
-LOOKUP_CLIENT_CAPABILITY(name_in IN VARCHAR2)
-RETURN NUMBER
-IS
-	PRAGMA AUTONOMOUS_TRANSACTION;
-	cap_name_id		NUMBER;
+LOOKUP_CLIENT_CAPABILITY(name_in IN VARCHAR)
+RETURNS NUMERIC
+AS $$
+DECLARE
+        ret_val         NUMERIC;
 BEGIN
-	SELECT id
-          INTO cap_name_id
-          FROM rhnClientCapabilityName
-         WHERE name = name_in;
+        SELECT retcode into ret_val from dblink('dbname='||current_database(),
+        'select lookup_client_capabality_autonomous('
+        ||coalesce(name_in::varchar,'null')||')') 
+        as f(retcode int);
 
-	RETURN cap_name_id;
-EXCEPTION
-        WHEN NO_DATA_FOUND THEN
-            INSERT INTO rhnClientCapabilityName (id, name) 
-                VALUES (rhn_client_capname_id_seq.nextval, name_in)
-                RETURNING id INTO cap_name_id;
-            COMMIT;
-	RETURN cap_name_id;
-END;
-/
-SHOW ERRORS
 
---
--- Revision 1.1  2003/07/21 22:30:04  misa
--- bugzilla: none  Lookup function for capabilities
---
---
+        RETURN ret_val;
+END; $$
+LANGUAGE plpgsql;
+
diff --git a/schema/spacewalk/rhnsat/tables/rhnRepoRegenQueue.sql b/schema/spacewalk/rhnsat/tables/rhnRepoRegenQueue.sql
index 51fde2a..8b9f13d 100644
--- a/schema/spacewalk/rhnsat/tables/rhnRepoRegenQueue.sql
+++ b/schema/spacewalk/rhnsat/tables/rhnRepoRegenQueue.sql
@@ -44,3 +44,6 @@ for each row
 begin
     :new.modified := sysdate;
 end;
+/
+show errors
+
_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to