Modify

Opened 10 years ago

Closed 9 years ago

#11912 closed defect (fixed)

Error cloning test plan with PostgreSQL database

Reported by: sistemas@… Owned by: Roberto Longobardi
Priority: normal Component: TestManagerForTracPlugin
Severity: normal Keywords: postgres, postgresql
Cc: Trac Release: 1.0

Description

Hi,

I'm using TestManagerForTracPlugin with PostgreSQL database. When I try cloning a test plan an error is reported. The reason is the INSERT in testplan table. This table has two fields defines as INTEGER:

CREATE TABLE testplan
(
[...]
  contains_all integer,
  freeze_tc_versions integer,
  CONSTRAINT testplan_pkey PRIMARY KEY (id)
)

but when I try coloning a testplan the source code (testman4trac.1.8.1/testman4trac/testmanager/api.py, line 775) does:

new_tp = TestPlan(self.env, id, tp['catid'], tp['page_name'], new_name, author, True, False)

using BOOLEAN values for these fields, so the SQL INSERT instruction sent to PostgreSQL is:

INSERT INTO testplan (id,catid,page_name,name,author,time,contains_all,freeze_tc_versions) VALUES ('39','9','TC_TT7_TT9','Copy of Backups','testuser',1407250163512659,True,False)

And PostgreSQL rises an error:

column "contains_all" is of type integer but expression is of type boolean

The attached patch works for me.

Plugin version: 1.8.1 DataBase: PostgreSQL 9.1

Attachments (1)

postgresql-issue.patch (698 bytes) - added by sistemas@… 10 years ago.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by sistemas@…

Attachment: postgresql-issue.patch added

comment:1 Changed 9 years ago by Roberto Longobardi

Hi there, thanks so much for your patch!

There have always been issues with PostgreSQL due to its different handling of column types.

I'll include your patch in the upcoming 1.8.2 release.

Thanks, ciao. Roberto

comment:2 Changed 9 years ago by Roberto Longobardi

Status: newaccepted

comment:3 Changed 9 years ago by Roberto Longobardi

Resolution: fixed
Status: acceptedclosed

Fixed in 1.8.2.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Roberto Longobardi.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.