Closed
Bug 687247
Opened 13 years ago
Closed 13 years ago
Bugzilla crashes when creating a new flagtype on PostgreSQL
Categories
(Bugzilla :: Administration, task)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.2
People
(Reporter: LpSolit, Assigned: LpSolit)
References
Details
(Keywords: regression)
Attachments
(1 file)
533 bytes,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
Due to the refactoring in bug 523205, creating a new flagtype on PostgreSQL crashes with:
DBD::Pg::db do failed: ERROR: value too long for type character(1) [for Statement "INSERT INTO flagtypes (grant_group_id, request_group_id, sortkey, name, description, cc_list, is_requestable, is_multiplicable, is_requesteeble, is_active, target_type) VALUES (?,?,?,?,?,?,?,?,?,?,?)"] at Bugzilla/Object.pm line 552
Bugzilla::Object::insert_create_data('Bugzilla::FlagType', 'HASH(0x8c1b1e0)') called at Bugzilla/FlagType.pm line 128
Bugzilla::FlagType::create('Bugzilla::FlagType', 'HASH(0x95e59d8)') called at /var/www/html/bugzilla_qa42/editflagtypes.cgi line 291
The reason is that target_type returns 'bug' or 'attachment' while the DB expects to get a single character 'b' or 'a'. MySQL doesn't crash, because it inserts as much data as possible, i.e. the first character. PostgreSQL just rejects a too long string and fails.
Flags: blocking4.2+
![]() |
Assignee | |
Updated•13 years ago
|
Flags: approval4.2+
Flags: approval+
![]() |
Assignee | |
Comment 2•13 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/FlagType.pm
Committed revision 7962.
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified Bugzilla/FlagType.pm
Committed revision 7930.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 3•13 years ago
|
||
Comment on attachment 560796 [details] [diff] [review]
patch, v1
Review of attachment 560796 [details] [diff] [review]:
-----------------------------------------------------------------
::: Bugzilla/FlagType.pm
@@ +118,5 @@
>
> $class->check_required_create_fields(@_);
> my $params = $class->run_create_validators(@_);
> + # In the DB, only the first character of the target type is stored.
> + $params->{target_type} = substr($params->{target_type}, 0, 1);
FWIW, the validator should be doing that.
You need to log in
before you can comment on or make changes to this bug.
Description
•