Bug 1257476 - some fields have the wrong type causing some searches to fail
Summary: some fields have the wrong type causing some searches to fail
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Query/Bug List
Version: 4.4
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: 5.0-RH9
Assignee: Jeff Fearn 🐞
QA Contact: tools-bugs
URL:
Whiteboard:
: 1207506 1257449 1257479 1264778 1264779 1679014 (view as bug list)
Depends On:
Blocks: 1260009
TreeView+ depends on / blocked
 
Reported: 2015-08-27 07:36 UTC by Rony Gong 🔥
Modified: 2019-12-09 22:44 UTC (History)
2 users (show)

Fixed In Version: 5.0.4-rh35
Clone Of:
Environment:
Last Closed: 2019-12-09 22:44:52 UTC
Embargoed:


Attachments (Terms of Use)

Description Rony Gong 🔥 2015-08-27 07:36:59 UTC
Description of problem:
sql error of invalid input syntax for type numeric when custom search hours left/worked is (not) empty

Version-Release number of selected component (if applicable):
4.4.9039-3

How reproducible:
Always

Steps to Reproduce:
1.Custom search:
Hours Left     is (not) empty
Hours worked    is (not) empty


Actual results:
DBD::Pg::db selectcol_arrayref failed: ERROR:  invalid input syntax for type numeric: ""
LINE 13: ... bugs.remaining_time IS NULL OR bugs.remaining_time = '' ) )
                                                                  ^ [for Statement "SELECT bugs.bug_id AS bug_id, bugs.priority AS priority, bugs.bug_severity AS bug_severity
  FROM bugs

Expected results:
no sql error

Additional info:

Comment 1 Jeff Fearn 🐞 2018-03-18 23:21:04 UTC
This is a general problem with filter selection. The filters include all the possible filters for all the possible field types, allowing the user to select invalid combinations of field and filter.

What should happen is that when you chose a field to search on the filters should be ... filtered ... to exclude invalid filters for the chosen field.

e.g. content only has two valid filters, matches and does not match, so only these two filters should be available when you chose to search the content field.

Comment 2 Jeff Fearn 🐞 2018-03-18 23:24:49 UTC
*** Bug 1257479 has been marked as a duplicate of this bug. ***

Comment 3 Jeff Fearn 🐞 2018-03-18 23:25:14 UTC
*** Bug 1264778 has been marked as a duplicate of this bug. ***

Comment 4 Jeff Fearn 🐞 2018-03-18 23:25:31 UTC
*** Bug 1264779 has been marked as a duplicate of this bug. ***

Comment 5 Jeff Fearn 🐞 2018-03-18 23:25:52 UTC
*** Bug 1257449 has been marked as a duplicate of this bug. ***

Comment 6 Jeff Fearn 🐞 2018-03-18 23:27:34 UTC
*** Bug 1207506 has been marked as a duplicate of this bug. ***

Comment 7 Jeff Fearn 🐞 2019-02-20 10:03:04 UTC
*** Bug 1679014 has been marked as a duplicate of this bug. ***

Comment 8 Jeff Fearn 🐞 2019-06-27 10:59:46 UTC
Adding this to RH6 to properly scope out creating a mapping for this.

Comment 9 Jeff Fearn 🐞 2019-10-16 06:18:31 UTC
This actually works in BMO, so it is most like a postgresql casting issue. It's going to be a big effort so moving to the next target milestone.

Comment 10 Jeff Fearn 🐞 2019-11-07 06:27:33 UTC
It turns out that this is due to some field having their type set to 0, updating the field to the correct type fixes issues where it's supplying the wrong empty type to the DB. e.g. '' instead of 0 for integers.

Comment 11 Meiying Li 2019-11-29 06:33:05 UTC
Test environment:
https://bugzilla-qe-rdu2.usersys.redhat.com

Steps to verify:
1. Check the table fielddefs, find the field type changed or not.
Result: The following items changed type to 10 (FIELD_TYPE_INTEGER)
    'bug_agile_pool.pool_id',
    'bug_agile_pool.pool_order',
    'docs_contact',
    'ext_bz_bug_map.ext_bz_bug_id',
    'percentage_complete',
    'reporter_accessible',
    'rh_rule',
    'votes'
And bug_id is changed type to 6 FIELD_TYPE_BUG_ID.
'creation_ts' and 'delta_ts' is changed type to 5.

2. Advance search, custom search, choose 'Bug ID' is equal to a numeric value 1360309
Result: Can search this bug out
3. Advance search, custom search, choose 'Bug ID' is equal to a numeric value 'slkdfjlsdf'
Result:The value 'slkdfjlsdf' in the Bug ID field is not a numeric value. 
4. Advance search, custom search, choose 'Pool ID' is equal to a numeric value 2
Result: Can search bugs which belong to this pool
5. Advance search, custom search, choose 'Creation Date' contains the string '2016-07-26'
Result: Can search bugs which belong to this date

Test Result: PASS

Comment 13 Jeff Fearn 🐞 2019-12-06 23:12:15 UTC
This change has been deployed to https://partner-bugzilla.redhat.com for public pre-production testing.

Comment 14 Jeff Fearn 🐞 2019-12-09 22:44:52 UTC
This change is now live. If there are any issues, do not reopen this
bug. Instead, you should create a new bug and reference this bug.


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