Closed Bug 557495 Opened 10 years ago Closed 10 years ago

PostgreSQL crashes when deleting a custom field of type BugID

Categories

(Bugzilla :: Administration, task)

task
Not set

Tracking

()

RESOLVED FIXED
Bugzilla 3.4

People

(Reporter: LpSolit, Assigned: LpSolit)

Details

(Keywords: selenium)

Attachments

(1 file)

DBD::Pg::db selectrow_array failed: ERREUR:  syntaxe en entrée invalide pour l'entier : «  » [for Statement "SELECT COUNT(*) FROM bugs WHERE cf_crash IS NOT NULL AND cf_crash != ''"] at Bugzilla/Field.pm line 836
	Bugzilla::Field::remove_from_db('Bugzilla::Field=HASH(0xa58a030)') called at /var/www/html/bugzilla-pg/editfields.cgi line 161
 at Bugzilla/Field.pm line 836
	Bugzilla::Field::remove_from_db('Bugzilla::Field=HASH(0xa58a030)') called at /var/www/html/bugzilla-pg/editfields.cgi line 161

This is because cf_crash is of type integer:

       Colonne       |              Type              |
---------------------+--------------------------------+
 cf_crash            | integer                        |
Flags: blocking3.6+
Flags: blocking3.4.7+
Attached patch patch, v1Splinter Review
If the custom field type is FIELD_TYPE_BUG_ID, we don't need to look for '' as the DB column can only contain integers.
Assignee: administration → LpSolit
Status: NEW → ASSIGNED
Attachment #437275 - Flags: review?(mkanat)
Flags: testcase?
Attachment #437275 - Flags: review?(mkanat) → review+
  BTW, I think there might be a dup of this bug filed already somewhere. Also, it will only be triggered by Pg 8.3 and later, I believe.
Flags: approval3.6+
Flags: approval3.4+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/qa/3.6/
added t/test_custom_fields_admin.t
Committed revision 126.

Custom fields of type Date/Time also crash on deletion. I will file a separate bug for them.
Flags: testcase? → testcase+
Keywords: selenium
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Field.pm
Committed revision 7115.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/3.6/
modified Bugzilla/Field.pm
Committed revision 7073.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/3.4/
modified Bugzilla/Field.pm
Committed revision 6757.


The Selenium script also applies to 3.4:

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/qa/3.4/
added t/test_custom_fields_admin.t
Committed revision 114.


I reported the problem with Date/Time in bug 557686.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.