Bug 703143 - Trouble adding software channels to kickstart profile
Summary: Trouble adding software channels to kickstart profile
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.4
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
: 716592 (view as bug list)
Depends On:
Blocks: space15
TreeView+ depends on / blocked
 
Reported: 2011-05-09 12:39 UTC by Julian Einwag
Modified: 2011-09-16 10:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-21 14:42:56 UTC
Embargoed:


Attachments (Terms of Use)
Fixes the SQL query to work with PostgreSQL (1006 bytes, application/octet-stream)
2011-05-11 11:13 UTC, Julian Einwag
no flags Details
Fixes SQL typo in commit 645d46cbfc4c8fa217b90378b882357c887dae95 (650 bytes, application/octet-stream)
2011-05-16 06:57 UTC, Julian Einwag
no flags Details

Description Julian Einwag 2011-05-09 12:39:26 UTC
Trying to add software channels to a kickstart profile results in a SQL syntax error with the PG-backend.

Cause of the problem is Line 83 in ./java/code/src/com/redhat/rhn/domain/org/Org.hbm.xml in the Org.accessibleChannels query:


    <sql-query name="Org.accessibleChannels">
        <![CDATA[SELECT  {c.*}
                   FROM  rhnChannel {c},
                         rhnChannelCloned c_1_,
                         rhnAvailableChannels cfp
                                   WHERE c.id = cfp.channel_id AND
                                         c.id = c_1_.original_id (+) AND
                         cfp.org_id = :org_id]]>
        <return alias="c" class="com.redhat.rhn.domain.channel.Channel" />
    </sql-query>

The (+) syntax doesn't work with PostgreSQL.

Kind regards,
Julian

Comment 1 Bob Huisman 2011-05-10 10:29:18 UTC
Reproduced with a fresh 1.4 install.

Are there any workarounds?

Comment 2 Julian Einwag 2011-05-11 11:13:01 UTC
Created attachment 498257 [details]
Fixes the SQL query to work with PostgreSQL

Comment 3 Julian Einwag 2011-05-11 11:13:31 UTC
I believe the attached patch fixes the query, at least it does for me.

Comment 4 Michael Mráka 2011-05-11 12:06:53 UTC
Applied to spacewalk master as

commit 645d46cbfc4c8fa217b90378b882357c887dae95
    703143 - changed (+) to ANSI JOIN

Comment 5 Julian Einwag 2011-05-16 06:56:48 UTC
There's still a typo in the commit (trailing comma after rhnChannel {c}), I attached a patch that fixes it.

Comment 6 Julian Einwag 2011-05-16 06:57:30 UTC
Created attachment 499089 [details]
Fixes SQL typo in commit 645d46cbfc4c8fa217b90378b882357c887dae95

Comment 7 Michael Mráka 2011-05-16 07:40:07 UTC
I'm sorry for the typo. Thanks for the fix, it's commited as
commit 1032f3b62a976446776da2223692cc750d6b0755
    fixed SQL typo

Comment 8 Jan Pazdziora 2011-07-19 19:36:36 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 9 Jan Pazdziora 2011-07-21 14:42:56 UTC
Spacewalk 1.5 was released.

Comment 10 Tomas Lestach 2011-09-16 10:51:44 UTC
*** Bug 716592 has been marked as a duplicate of this bug. ***


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