Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at
Bug 1094526 - SQL query incorrectly terminated for Oracle
Summary: SQL query incorrectly terminated for Oracle
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 2.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Red Hat Satellite QA List
Depends On:
Blocks: space22
TreeView+ depends on / blocked
Reported: 2014-05-05 22:27 UTC by Avi Miller
Modified: 2014-07-17 08:40 UTC (History)
1 user (show)

Fixed In Version: spacewalk-backend-2.2.28-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-07-17 08:40:49 UTC

Attachments (Terms of Use)

Description Avi Miller 2014-05-05 22:27:41 UTC
Description of problem:

The recent update for to provide the -l/--list option terminates the query with a semi-colon, which is invalid on Oracle database.

Version-Release number of selected component (if applicable):

Added in commit 5775e76647587f545ebc4d71ec8ec91ba1c98b00 on Github:

How reproducible:


Steps to Reproduce:
0. Install Spacewalk HEAD with an Oracle database backend
1. Setup a yum repository
2. Setup a software channel
3. Link the repository to the software channel
4. Attempt to run spacewalk-reposync

Actual results:

[root@ca-spacewalk-server-ol6-x86_64-test ~]# spacewalk-repo-sync
Traceback (most recent call last):
  File "/usr/bin/spacewalk-repo-sync", line 138, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/bin/spacewalk-repo-sync", line 98, in main
"/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/", line
59, in getChannelRepo
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/",
line 163, in execute
    return apply(self._execute_wrapper, (self._execute, ) + p, kw)
line 108, in _execute_wrapper
    retval = apply(function, p, kw)
  File "/usr/lib/python2.6/site-packages/spacewalk/server/rhnSQL/",
line 217, in _execute
    return self._execute_(args, kwargs)
line 161, in _execute_
    self._real_cursor.execute(*(None, ), **params)
spacewalk.server.rhnSQL.sql_base.SQLStatementPrepareError: ('ORA-00911: invalid
character\n', 911, 'select s.source_url, c.label from rhnContentSource s,
rhnChannelContentSource cs, rhnChannel c where = cs.source_id and;')

Expected results:

[root@ca-spacewalk-server-ol6-x86_64-test ~]# spacewalk-repo-sync -l
|   Channel Label   |   Repository   |
oraclelinux6-x86_64-mysql |
oraclelinux6-x86_64-server |

Additional info:

Prepared statements for Oracle shouldn't be terminated by a semi-colon.

Comment 1 Avi Miller 2014-05-05 23:17:04 UTC
Pull request with fix:

Comment 2 Michael Mráka 2014-06-06 09:05:29 UTC
Merged to spacewalk master as

commit 3b7527b6277b103290b504ea532200f347524984
    1094526 - remove trailing semi-colon from SQL query as this breaks Oracle support.

Comment 3 Milan Zázrivec 2014-07-17 08:40:49 UTC
Spacewalk 2.2 has been released:

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