Bug 705002 - rhnreg_ks after kickstart install fails with PG backend
Summary: rhnreg_ks after kickstart install fails with PG backend
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space15
TreeView+ depends on / blocked
 
Reported: 2011-05-16 10:54 UTC by Julian Einwag
Modified: 2011-07-21 14:43 UTC (History)
0 users

Fixed In Version: spacewalk-backend-1.5.24-1
Clone Of:
Environment:
Last Closed: 2011-07-21 14:43:34 UTC
Embargoed:


Attachments (Terms of Use)
Makes the query PostgreSQL compatible but will break Oracle compatibility. (629 bytes, text/plain)
2011-05-17 08:57 UTC, Julian Einwag
no flags Details
Query should now work with both PostgreSQL and Oracle (640 bytes, text/plain)
2011-05-17 10:46 UTC, Julian Einwag
no flags Details

Description Julian Einwag 2011-05-16 10:54:09 UTC
rhnreg_ks after kickstart install fails with PG backend due to an incompatible SQL query in backend/server/rhnAction.py (line 40):

    insert into rhnAction 
               (id, org_id, action_type, name, scheduler, earliest_action, prerequisite)
        values (:action_id, :org_id, :action_type_id, :action_name, :scheduler, 
                sysdate + :delta / 86400, :prerequisite) 

Sysdate does not work with PostgreSQL.

Comment 1 Julian Einwag 2011-05-17 08:57:30 UTC
Created attachment 499288 [details]
Makes the query PostgreSQL compatible but will break Oracle compatibility.

Comment 2 Michael Mráka 2011-05-17 09:58:31 UTC
Hi Julian,

did you consult PostgreSQL Porting Guide on our wiki? There is a couple of similar fixes so you might find out more appropriate fix there - https://fedorahosted.org/spacewalk/wiki/PostgreSQLPortingGuide#Datearithmetics

Regards,
Michael

Comment 3 Julian Einwag 2011-05-17 10:46:29 UTC
Created attachment 499302 [details]
Query should now work with both PostgreSQL and Oracle

Hi Michael,

thanks for the hint. I changed the query again so that it should work with both PostgreSQL and Oracle, though I currently don't have an Oracle installation available for testing.

Best regards,
Julian

Comment 4 Michael Mráka 2011-05-17 11:19:27 UTC
I did a quick check...
current_timestamp + interval ':delta' second  doesn't work in oracle, 
current_timestamp + numtodsinterval(:delta, 'second')  works both in oracle and PG.

Comment 5 Michael Mráka 2011-05-19 08:51:13 UTC
Fixed in spacewalk master as
commit 7d3571ed25b8c9e4b6855e7776ebd72c3faff005
    705002 - made query pg compatible

Comment 6 Jan Pazdziora (Red Hat) 2011-07-19 19:36:47 UTC
This bugzilla is currently MODIFIED, so we believe the fix is in the Spacewalk nightly yum repository at http://spacewalk.redhat.com/yum/nightly/

Therefore, moving ON_QA.

Comment 7 Jan Pazdziora (Red Hat) 2011-07-21 14:43:34 UTC
Spacewalk 1.5 was released.


Note You need to log in before you can comment on or make changes to this bug.