Closed Bug 296054 Opened 20 years ago Closed 19 years ago

[PostgreSQL] Cannot add a new query for event/whining

Categories

(Bugzilla :: Database, defect, P1)

2.19.3
defect

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 query for an event/whining (editwhines.cgi) a simple SQL-failure hits me.


Reproducible: Always

Steps to Reproduce:
1. Setup Bugzilla 2.19.3 with PostgreSQL-backend
2. Login as admin
3. "Edit: Whining"
(4. Add new event)
5. Add a new query

Actual Results:  
Software error:

DBD::Pg::st execute failed: ERROR:  null value in column "title" violates
not-null constraint
 [for Statement "INSERT INTO whine_queries (eventid) VALUES (?)" with
ParamValues: 1='1'] at editwhines.cgi line 173


Expected Results:  
Printed some options for the query.
Blocks: bz-postgres
Version: unspecified → 2.19.3
mkanat, our Pg guru, can you reproduce?
Yeah, we have little NOT NULL violations all over the place, like that. Thanks
for the reports -- catching things like this is really helpful to me, since I
can't test Pg support all day. :-)
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → Bugzilla 2.20
Assignee: erik → mkanat
Component: Whining → Database
Status: NEW → ASSIGNED
Summary: SQL-fault when adding a new query for event/whining (PostgreSQL) → [PostgreSQL] Cannot add a new query for event/whining
Erik -- I'm looking over the Whine code, and it looks like it's doing something
very strange... inserting an empty record and then updating it in the DB later?
That works on MySQL, but not on any database that actually enforces NOT NULL
constraints.

I either have to give a DEFAULT to all those fields (which I don't really want
to do) or re-architect the editwhines code so that it doesn't need to insert
empty records (which I probably don't want to do, because we're frozen).

Do you have any other ideas?
editwhines.cgi needs some cleanup anyway. I may take a look later (in the next
two weeks).
OK, I can confirm that this fixes editwhines.cgi. Let's get this in, and we can
pretty much close bug 98304. :-)
Attachment #188887 - Flags: review?(LpSolit)
Attachment #188887 - Flags: review?(LpSolit) → review?(wurblzap)
Comment on attachment 188887 [details] [diff] [review]
Fixes Whines on PostgreSQL

Tested on PostgreSQL 8.0.1. Works fine. r=LpSolit
Attachment #188887 - Flags: review?(wurblzap) → review+
Flags: approval?
Flags: approval2.20?
Flags: approval?
Flags: approval2.20?
Flags: approval2.20+
Flags: approval+
Whiteboard: DELAY CHECK-IN until after bug 299848
Depends on: 299848
2.20:

Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.412.2.7; previous revision: 1.412.2.6
done
Checking in Bugzilla/DB/Schema.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm,v  <--  Schema.pm
new revision: 1.32.2.3; previous revision: 1.32.2.2
done

tip:

Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.428; previous revision: 1.427
done
Checking in Bugzilla/DB/Schema.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm,v  <--  Schema.pm
new revision: 1.35; previous revision: 1.34
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: DELAY CHECK-IN until after bug 299848
Blocks: 304997
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: