[PostgreSQL] Cannot create a new product

RESOLVED FIXED in Bugzilla 2.20

Status

()

defect
P1
major
RESOLVED FIXED
14 years ago
14 years ago

People

(Reporter: werner, Assigned: mkanat)

Tracking

2.19.3
Bugzilla 2.20
Bug Flags:
approval +

Details

Attachments

(1 attachment)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

I have configured Bugzilla 2.19.3 with PostgreSQL backend, and when I try to add
a new product a simple SQL-failure hits me:

Adding new product
Software error:

DBD::Pg::st execute failed: ERROR:  null value in column "sortkey" violates
not-null constraint
 [for Statement "INSERT INTO milestones (product_id, value) VALUES (5, '---')"]
at Bugzilla/DB.pm line 80
	Bugzilla::DB::SendSQL('INSERT INTO milestones (product_id, value) VALUES (5,
\'---\')') called at editproducts.cgi line 511



Reproducible: Always

Steps to Reproduce:
1. Setup Bugzilla 2.19.3 with PostgreSQL-backend
2. Login as admin
3. Add new product (default-values except name and description)

Actual Results:  
Adding new product
Software error:

DBD::Pg::st execute failed: ERROR:  null value in column "sortkey" violates
not-null constraint
 [for Statement "INSERT INTO milestones (product_id, value) VALUES (5, '---')"]
at Bugzilla/DB.pm line 80
	Bugzilla::DB::SendSQL('INSERT INTO milestones (product_id, value) VALUES (5,
\'---\')') called at editproducts.cgi line 511


Expected Results:  
new product added and a confirmation is printed

editproducts.cgi
(Reporter)

Updated

14 years ago
Blocks: bz-postgres
Version: unspecified → 2.19.3

Comment 1

14 years ago
mkanat, our Pg guru, can you reproduce?
(Assignee)

Comment 2

14 years ago
Yep. It's a pretty easy fix. We just either need to add a DEFAULT statement to
that field (which is probably what I'll do) or add it to the INSERT statement.
Severity: normal → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
Summary: SQL-fault when adding new product (PostgreSQL) → Cannot create a new product on PostgreSQL
Target Milestone: --- → Bugzilla 2.20
(Assignee)

Updated

14 years ago
Assignee: administration → mkanat
Component: Administration → Database
(Assignee)

Updated

14 years ago
Status: NEW → ASSIGNED
Priority: -- → P1
Summary: Cannot create a new product on PostgreSQL → [PostgreSQL] Cannot create a new product
(Assignee)

Comment 3

14 years ago
This is a really simple patch. All the other "sortkey" fields have a DEFAULT of
0 in the database, except milestone.sortkey. So now I've added that DB default.
Attachment #185912 - Flags: review?(wurblzap)

Comment 4

14 years ago
*** Bug 297608 has been marked as a duplicate of this bug. ***

Updated

14 years ago
Flags: blocking2.20?
Attachment #185912 - Flags: review?(wurblzap) → review+
r=wurblzap by inspection.

I think this qualifies as a low-risk polish patch; requesting approval for 2.20
checkin.
Flags: approval?
Approval granted.
Flags: blocking2.20?
Flags: approval?
Flags: approval+
(Assignee)

Comment 7

14 years ago
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.407; previous revision: 1.406
done
Checking in Bugzilla/DB/Schema.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm,v  <--  Schema.pm
new revision: 1.31; previous revision: 1.30
done
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.