Closed Bug 543432 Opened 16 years ago Closed 12 years ago

[PostgreSQL] Crash when typing a string in combination with a numeric field

Categories

(Bugzilla :: Query/Bug List, defect)

3.4.5
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: LpSolit, Assigned: LpSolit)

References

()

Details

Attachments

(2 files)

See the URL field: DBD::Pg::st execute failed: ERROR: invalid input syntax for integer: "" For some reason, we don't ignore empty strings and non-integers when looking for bug IDs. All Bugzilla 3.x versions are affected.
Same is true for "Bug ID" "is equal to" "foo".
Bugzilla 3.4 is now restricted to security bugs. We will retarget this bug (to 3.6 or later) when it's fixed.
Target Milestone: Bugzilla 3.4 → ---
Blocks: pg-xt-search
I had to fix Error.pm to correctly close the multipart document if such as document was in progress when the error is thrown.
Assignee: query-and-buglist → LpSolit
Status: NEW → ASSIGNED
Attachment #8337310 - Flags: review?(dkl)
Target Milestone: --- → Bugzilla 4.4
Comment on attachment 8337310 [details] [diff] [review] patch for trunk, v1 Sorry for the delay as I had to configure a PostgreSQL test environment. But unrelated the patch did not apply cleanly for me: patching file Bugzilla/CGI.pm Hunk #1 succeeded at 265 (offset -3 lines). Hunk #2 FAILED at 669. Hunk #3 FAILED at 692. 2 out of 3 hunks FAILED -- saving rejects to file Bugzilla/CGI.pm.rej patching file Bugzilla/Error.pm Hunk #1 succeeded at 92 (offset -2 lines). patching file Bugzilla/Search.pm Hunk #1 succeeded at 1951 (offset -36 lines). patching file buglist.cgi Reversed (or previously applied) patch detected! Assume -R? [n] Apply anyway? [n] Skipping patch. 3 out of 3 hunks ignored -- saving rejects to file buglist.cgi.rej Please submit a new patch and I will get to it promptly. dkl
Attachment #8337310 - Flags: review?(dkl) → review-
Comment on attachment 8337310 [details] [diff] [review] patch for trunk, v1 The patch applies cleanly to trunk code.
Attachment #8337310 - Flags: review- → review?(dkl)
(In reply to Frédéric Buclin from comment #5) > Comment on attachment 8337310 [details] [diff] [review] > patch, v1 > > The patch applies cleanly to trunk code. Sorry. Was applying against 4.4 which would explain it. Which also means we will need a separate patch for 4.4 and others. dkl
Comment on attachment 8337310 [details] [diff] [review] patch for trunk, v1 Review of attachment 8337310 [details] [diff] [review]: ----------------------------------------------------------------- After the fix in Bugzilla/Search.pm all works well and looks good so fix on commit. As stated before we will need a different patch for 4.4-. r=dkl ::: Bugzilla/Search.pm @@ +1988,5 @@ > my $numeric_value = ($value =~ NUMBER_REGEX) ? 1 : 0; > my $is_numeric = $numeric_operator && $numeric_field && $numeric_value; > + > + # These operators are really numeric operators with numeric fields. > + $numeric_operator = grep { $_ eq $operator } keys SIMPLE_OPERATORS; $numeric_operator = grep { $_ eq $operator } keys %{ SIMPLE_OPERATORS() };
Attachment #8337310 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval? → approval+
This bug is focused on comment 1 and similar queries involving simple comparison operators. One could still crash PostgreSQL by using anyexact or (not)regexp, but this make the code much more complex and is out of the goal of this bug.
Summary: [PostgreSQL] Crash when typing ",1" in the "Bug numbered" field → [PostgreSQL] Crash when typing a string in combination with a numeric field and a comparison operator
Summary: [PostgreSQL] Crash when typing a string in combination with a numeric field and a comparison operator → [PostgreSQL] Crash when typing a string in combination with a numeric field
Attachment #8343181 - Flags: review?(dkl)
Attachment #8337310 - Attachment description: patch, v1 → patch for trunk, v1
yanking approval flag for now since we still have patches pending review. rerequest when it's ready.
Flags: approval+
(I realize the pending patch is for a different branch, but it's easier to get them all at once when committing rather than trying to remember which ones are committed already)
Comment on attachment 8343181 [details] [diff] [review] patch for 4.4, v1 Review of attachment 8343181 [details] [diff] [review]: ----------------------------------------------------------------- r=dkl
Attachment #8343181 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval4.4?
Flags: approval?
Flags: approval4.4?
Flags: approval4.4+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ modified buglist.cgi modified Bugzilla/CGI.pm modified Bugzilla/Error.pm modified Bugzilla/Search.pm Committed revision 8847. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/ modified buglist.cgi modified Bugzilla/CGI.pm modified Bugzilla/Error.pm modified Bugzilla/Search.pm Committed revision 8647.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: