[Spacewalk-list] Corrected query for pgsql support

Pierre Casenove pcasenove at gmail.com
Wed Jun 27 16:29:17 UTC 2012


Hello,
Please find attached a complementary patch to correct the remove patch query.
Note that the first patch was already correcting part of the query

Thanks,

Pierre

2012/6/27 Pierre Casenove <pcasenove at gmail.com>:
> hello,
> Please find attached another patch for solaris support on pgsql.
> On spacewalk 1.7 patch install fails due to:
> - not using AS
> - using NVL2
>
> Please note that file backend/server/action/solarispkgs.py still
> contains one query (remove) that needs to be fixed:
> _query_remove = rhnSQL.Statement("""
>     select distinct
>            pn.name as name,
>            pe.epoch as epoch,
>            pe.version asversion,
>            pe.release as release,
>            pa.label as arch
>       from rhnActionPackage ap,
>            rhnPackageName pn,
>            rhnPackageEVR pe,
>            rhnPackageArch pa
>      where ap.action_id = :action_id
>        and ap.evr_id = pe.id
>        and ap.name_id = pn.id
>        and ap.package_arch_id = pa.id (+)
> """)
>
> If someone is willing to correct it...
>
> Pierre
-------------- next part --------------
From 0acb024729605bb78e7fcaad44f42c1a2f9e187f Mon Sep 17 00:00:00 2001
From: Pierre Casenove <pcasenove at gmail.com>
Date: Wed, 27 Jun 2012 16:24:49 +0000
Subject: [PATCH 2/2] Correct SQL query for installing and removing solaris patches

---
 backend/server/action/solarispkgs.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/backend/server/action/solarispkgs.py b/backend/server/action/solarispkgs.py
index 1fca8ce..39610bd 100644
--- a/backend/server/action/solarispkgs.py
+++ b/backend/server/action/solarispkgs.py
@@ -57,14 +57,13 @@ _query_remove = rhnSQL.Statement("""
            pe.version asversion,
            pe.release as release,
            pa.label as arch
-      from rhnActionPackage ap,
-           rhnPackageName pn,
+      from rhnPackageName pn,
            rhnPackageEVR pe,
-           rhnPackageArch pa
+           rhnActionPackage ap
+      left join rhnPackageArch pa on ap.package_arch_id = pa.id
      where ap.action_id = :action_id
        and ap.evr_id = pe.id
        and ap.name_id = pn.id
-       and ap.package_arch_id = pa.id (+)
 """)

 def install(server_id, action_id, dry_run=0):
--
1.7.4.1id;


More information about the Spacewalk-list mailing list