Hi,

Am Mittwoch, 18. April 2012, 15:00:01 schrieb Tomas Lestach:
> > Attached patch, rebased against master. It contains all suggestions and
> > fixed some formatting issues not relevant to the patch. Additionally
> > changed to_timestamp() to something that works in both databases.
> > 
> > Duncan
> 
> Thanks Duncan,
> 
> I committed your patch as: 433bd3a310f38577ff3066414a2f035e4c310e47

It seems that one query is not able to run on oracle and on postgres
it does not do what it should :-)

A possible fix is attached.

-- 
Regards

        Michael Calmer

--------------------------------------------------------------------------
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--------------------------------------------------------------------------
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From dfb7e3e922eee62b615ba1c1294560e85341dd78 Mon Sep 17 00:00:00 2001
From: Michael Calmer <m...@suse.de>
Date: Thu, 19 Apr 2012 11:47:24 +0200
Subject: [PATCH] fix has_errata_with_keyword_applied_since_last_reboot query

Fixes:
com.redhat.rhn.common.db.WrappedSQLException: ORA-00936: missing expression
---
 .../common/db/datasource/xml/System_queries.xml    |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
index ace71cb..c05c98f 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
@@ -790,7 +790,6 @@ SELECT DISTINCT S.id, S.NAME,
 
 <mode name="has_errata_with_keyword_applied_since_last_reboot">
   <query params="org_id, user_id, keyword, sid">
-  SELECT EXISTS (
 	SELECT 1
 	FROM rhnServer S,
 	  rhnErrata E,
@@ -808,7 +807,6 @@ SELECT DISTINCT S.id, S.NAME,
 	  AND EP.errata_id = E.id AND EP.package_id = P.id
 	  AND (to_date('1970-01-01', 'YYYY-MM-DD') + numtodsinterval(S.last_boot, 'second')) &lt; SP.installtime
 	  AND E.id IN (SELECT EK.errata_id FROM rhnErrataKeyword EK WHERE EK.keyword = :keyword)
-    )
     </query>
 </mode>
 
-- 
1.7.3.4

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to