Last Comment Bug 305927 - [PostgreSQL] Add product partly fails when 'makeproductgroups' is enabled
: [PostgreSQL] Add product partly fails when 'makeproductgroups' is enabled
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: Database (show other bugs)
: 2.20
: All All
: -- normal with 1 vote (vote)
: Bugzilla 2.22
Assigned To: Frédéric Buclin
: default-qa
:
Mentors:
: 329214 (view as bug list)
Depends on:
Blocks: meta-pg
  Show dependency treegraph
 
Reported: 2005-08-25 09:27 PDT by Brett
Modified: 2006-03-03 03:08 PST (History)
3 users (show)
justdave: approval+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch, v1 (869 bytes, patch)
2005-11-04 08:48 PST, Frédéric Buclin
mkanat: review-
Details | Diff | Splinter Review
patch, v2 (1.56 KB, patch)
2005-11-04 13:12 PST, Frédéric Buclin
mkanat: review+
Details | Diff | Splinter Review

Description Brett 2005-08-25 09:27:57 PDT
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

When trying to add a product in Bugzilla, an error message comes up with the
following error:


Software error:

DBD::Pg::st execute failed: ERROR:  ExecInsert: Fail to add null value in not
null attribute userregexp
 [for Statement "INSERT INTO groups (name, description, isbuggroup,
last_changed) VALUES ('Mongoose', 'Access to bugs in the Mongoose product', 1,
NOW())"] at Bugzilla/DB.pm line 84
	Bugzilla::DB::SendSQL('INSERT INTO groups (name, description, isbuggroup,
last_chang...') called at /var/www/html/bugzilla/editproducts.cgi line 550


When viewing the products page, the new product is there, but the group is not.

I have configured Bugzilla to add a group for each new product, option
'makeproductgroups'.


Reproducible: Always

Steps to Reproduce:
1. Install Bugzilla
2. Configure Bugzilla to create groups for new products.  Login, go to the
preferences page, turn 'makeproductgroups' on.
3. Use the links at the bottom of the page to go to the Products page and Add a
new product.
4. When you click 'Add' the error occurs

Actual Results:  
Software error:

DBD::Pg::st execute failed: ERROR:  ExecInsert: Fail to add null value in not
null attribute userregexp
 [for Statement "INSERT INTO groups (name, description, isbuggroup,
last_changed) VALUES ('Mongoose', 'Access to bugs in the Mongoose product', 1,
NOW())"] at Bugzilla/DB.pm line 84
	Bugzilla::DB::SendSQL('INSERT INTO groups (name, description, isbuggroup,
last_chang...') called at /var/www/html/bugzilla/editproducts.cgi line 550



Expected Results:  
Not presented and error.

If I change the configuration option 'makeproductgroups' to off, then the error
does not occur.
Comment 1 Max Kanat-Alexander 2005-08-25 12:50:03 PDT
I imagine you're using 2.20rc2?
Comment 2 Frédéric Buclin 2005-11-04 08:06:08 PST
confirming on 2.21.1+! The error only appears when 'makeproductgroups' is turned on.
Comment 3 Frédéric Buclin 2005-11-04 08:48:24 PST
Created attachment 201861 [details] [diff] [review]
patch, v1

userregexp has no default value and is not null, so it must be explicitly given. MySQL falls back to an empty string by default, but Pg doesn't.
Comment 4 Max Kanat-Alexander 2005-11-04 12:56:51 PST
Comment on attachment 201861 [details] [diff] [review]
patch, v1

Let's just give it a DEFAULT in the DB. I think a default makes sense for this field.
Comment 5 Frédéric Buclin 2005-11-04 13:12:03 PST
Created attachment 201878 [details] [diff] [review]
patch, v2
Comment 6 Max Kanat-Alexander 2005-11-04 13:37:15 PST
Comment on attachment 201878 [details] [diff] [review]
patch, v2

Yep, looks good to me, works as intended.
Comment 7 Frédéric Buclin 2005-11-05 04:16:48 PST
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.448; previous revision: 1.447
done
Checking in Bugzilla/DB/Schema.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm,v  <--  Schema.pm
new revision: 1.42; previous revision: 1.41
done
Comment 8 Frédéric Buclin 2006-03-03 03:08:53 PST
*** Bug 329214 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.