Closed Bug 296039 Opened 16 years ago Closed 16 years ago

[PostgreSQL] Cannot create a new product

Categories

(Bugzilla :: Database, defect, P1)

2.19.3

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: werner, Assigned: mkanat)

References

Details

Attachments

(1 file)

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
Blocks: bz-postgres
Version: unspecified → 2.19.3
mkanat, our Pg guru, can you reproduce?
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: administration → mkanat
Component: Administration → Database
Status: NEW → ASSIGNED
Priority: -- → P1
Summary: Cannot create a new product on PostgreSQL → [PostgreSQL] Cannot create a new product
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)
*** Bug 297608 has been marked as a duplicate of this bug. ***
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+
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
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.