Bug 915549 - Task table is missing a unique constraint on 'Name' field
Summary: Task table is missing a unique constraint on 'Name' field
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Community
Component: scheduler
Version: 0.11
Hardware: Unspecified
OS: Unspecified
high
urgent vote
Target Milestone: 0.12
Assignee: Amit Saha
QA Contact: Dan Callaghan
URL:
Whiteboard: Misc
Keywords:
Depends On:
Blocks: 912205
TreeView+ depends on / blocked
 
Reported: 2013-02-26 03:30 UTC by Amit Saha
Modified: 2018-02-06 00:41 UTC (History)
7 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2013-04-11 04:57:31 UTC


Attachments (Terms of Use)

Description Amit Saha 2013-02-26 03:30:59 UTC
Description of problem:

The Task table should have a unique constraint on the 'Name' field which allows multiple tasks of the same name to exist, which is not desirable and task queries break.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:

'sqlalchemy.orm.exc.MultipleResultsFound'>:Multiple rows were found for one()"


Expected results:

The enforced constraint should automatically disallow duplicate more than one task with the same name.


Additional info:

Comment 1 Amit Saha 2013-02-26 03:33:29 UTC
(In reply to comment #0)
> Description of problem:
> 
> The Task table should have a unique constraint on the 'Name' field which
> allows multiple tasks of the same name to exist, which is not desirable and
> task queries break.
> 
> Version-Release number of selected component (if applicable):
> 
> 
> How reproducible:
> 
> 
> Steps to Reproduce:
> 1.
> 2.
> 3.
>   
> Actual results:
> 
> 'sqlalchemy.orm.exc.MultipleResultsFound'>:Multiple rows were found for
> one()"
> 
> 
> Expected results:
> 
> The enforced constraint should automatically disallow duplicate more than
> one task with the same name.

The enforced constraint should automatically disallow more than one task with the same name.


> 
> 
> Additional info:

Comment 2 Dan Callaghan 2013-02-26 22:38:22 UTC
Complete stack trace for reference:

 Traceback (most recent call last):
   File "/usr/lib/python2.6/site-packages/bkr/server/xmlrpccontroller.py", line 54, in RPC2
     response = self.process_rpc(method,params)
   File "/usr/lib/python2.6/site-packages/bkr/server/xmlrpccontroller.py", line 43, in process_rpc
     response = obj(*params)
   File "/usr/lib/python2.6/site-packages/bkr/server/tasks.py", line 518, in to_xml
     return Task.by_name(name, valid).to_xml(pretty)
   File "/usr/lib/python2.6/site-packages/bkr/server/model.py", line 6243, in by_name
     return query.one()
   File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/query.py", line 1687, in one
     "Multiple rows were found for one()")
 MultipleResultsFound: Multiple rows were found for one()

Comment 3 Amit Saha 2013-03-21 05:46:29 UTC
On  Gerrit: http://gerrit.beaker-project.org/#/c/1812/

Comment 7 Dan Callaghan 2013-04-11 04:57:31 UTC
Beaker 0.12 has been released.


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