Modify ↓
Opened 10 years ago
Closed 10 years ago
#11912 closed defect (fixed)
Error cloning test plan with PostgreSQL database
Reported by: | 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)
Change History (4)
Changed 10 years ago by
Attachment: | postgresql-issue.patch added |
---|
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Status: | new → accepted |
---|
Note: See
TracTickets for help on using
tickets.
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