Closed Bug 191080 Opened 22 years ago Closed 22 years ago

process_bug.cgi: SQL error (die) if no component has been selected

Categories

(Bugzilla :: Creating/Changing Bugs, defect, P1)

2.17.3
defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: burnus, Assigned: bbaetz)

References

Details

Attachments

(1 file)

Try to commit a new bug report with no component selected. Result: Dies in globals.pl's get_component_id with: DBD::mysql::st execute failed: You have an error in your SQL syntax near '' at line 1 at Bugzilla/DB.pm line 64 Bugzilla::DB::SendSQL('SELECT id FROM components WHERE product_id = 1 AND name = ') called at globals.pl line 897 main::get_component_id(1, undef) called at /web/server/zedv/docroot/bugzilla/post_bug.cgi line 110 main::die_with_dignity('DBD::mysql::st execute failed: You have an error in your SQL syn...') called at Bugzilla/DB.pm line 64 Bugzilla::DB::SendSQL('SELECT id FROM components WHERE product_id = 1 AND name = ') called at globals.pl line 897 main::get_component_id(1, undef) called at /web/server/zedv/docroot/bugzilla/post_bug.cgi line 110 This is called in process_bug.cgi this way: if ($::FORM{'component'} ne $::FORM{'dontchange'}) { if (!defined $prod_id) { ThrowUserError("no_component_change_for_multiple_products"); } $comp_id = get_component_id($prod_id, $::FORM{'component'}); This seems to fail after the recent DBI change. One should check whether $::FORM{'component'} is set before quering the data base. Either in get_component_id/get_product_id or in the function call (process_bug.cgi).
I filed a bug for this today (bug 191043)
Attached patch oopsSplinter Review
Sigh. '' ne "''". process_bug should still test earlier, though.
Attachment #112962 - Flags: review?(gerv)
*** Bug 191043 has been marked as a duplicate of this bug. ***
Severity: normal → critical
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → Bugzilla 2.18
Comment on attachment 112962 [details] [diff] [review] oops r=gerv. Gerv
Attachment #112962 - Flags: review?(gerv) → review+
Flags: approval+
Fixed
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: