Bug 486142 - New new custom field type FIELD_TYPE_INTEGER for proper checking of integer values
Summary: New new custom field type FIELD_TYPE_INTEGER for proper checking of integer v...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Bugzilla
Classification: Community
Component: Database
Version: 3.6
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: PnT DevOps Devs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-18 16:39 UTC by David Lawrence
Modified: 2013-06-24 02:18 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of: 486036
Environment:
Last Closed: 2012-07-19 05:28:22 UTC
Embargoed:


Attachments (Terms of Use)

Description David Lawrence 2009-02-18 16:39:04 UTC
+++ This bug was initially created as a clone of Bug #486036 +++

Description of problem:
The custom field called 'cf_pm_score' is created in the database as a freetext field type (varchar) and even though it only contains integer values it is not sorted correctly by numerical order. Therefore you get results such as:

http://hurl.test.redhat.com/G48Zdo

Changing to the column type in the database for bugs.cf_pm_score to INTEGER does fix the sorting issue but is not optimal as anything other than an integer entered there will cause a database error to occur.

Another fix is to hack Bugzilla/Search to alter the ORDER BY clause to do a type conversion on the fly of the cf_pm_score data to integer allowing the order by to work numerically.

I have a patch that does the latter and works well.

Dave

--- Additional comment from dkl on 2009-02-17 18:13:26 EDT ---

Created an attachment (id=332312)
Patch to hack the order by for cf_pm_score to sort numerically (v1)

Patch to hack the order by for cf_pm_score to sort numerically.

Please review
Dave

--- Additional comment from nelhawar on 2009-02-18 00:00:17 EDT ---

(From update of attachment 332312 [details])
Hey Dave, I tested the patch on bz-web2 and works good.

Noura

--- Additional comment from kbaker on 2009-02-18 11:09:41 EDT ---

definitely a hack. 

Riek or Subhendu can confirm but AIUI this field will always be integer. Can we take a copy of the data, drop the custom field and re-add it as an int cf?

Bill Peck is hitting a simliar issue in beaker.

--- Additional comment from dkl on 2009-02-18 11:26:11 EDT ---

(In reply to comment #3)
> definitely a hack. 
> 
> Riek or Subhendu can confirm but AIUI this field will always be integer. Can we
> take a copy of the data, drop the custom field and re-add it as an int cf?
> 
> Bill Peck is hitting a simliar issue in beaker.

I agree but if I change the column to INT and someone per chance enters something with alpha character in it, the code currently thinks the columns is a varchar type which will produce a nasty DB error.

I would rather take the time do this right in another bug that creates a new FIELD_TYPE_INTEGER that has the proper sanity checks before inserting/updating the data in the db. Currently the code will still think that the column is a FIELD_TYPE_FREETEXT.

This order by hack will get his reports working until we can add the new functionality and properly convert the cf_pm_score over to FIELD_TYPE_INTEGER.

Dave

Comment 1 David Lawrence 2009-02-19 22:52:21 UTC
NOTE: Bugzilla 3.4 (not yet released) will have support for two new field types.
FIELD_TYPE_BUG_ID (INT3) and FIELD_TYPE_BUG_URLS (multiple value). We will be able to exploit the FIELD_TYPE_BUG_ID as cf_pm_score. We will need to create a script to migrate the existing cf_pm_score values to the new field once we have it created.

Dave

Comment 2 David Lawrence 2010-01-15 17:33:24 UTC
Red Hat Bugzilla is now using version 3.4 of the Bugzilla codebase and
therefore this feature will need to be implemented against the new release.
Updating bug version to 3.2.

Comment 3 David Lawrence 2010-08-25 21:41:48 UTC
Red Hat has now upgraded to Bugzilla 3.6 and this bug will now be reassigned to that version. It would be helpful to the Bugzilla Development Team if this bug is verified to still be an issue with the latest version. If it is no longer an issue, then feel free to close, otherwise please comment that it is still a problem and we will try to address the issue as soon as we can.

Thanks
Bugzilla Development Team

Comment 6 Jeff Fearn 🐞 2012-05-30 04:41:12 UTC
As part of the recent Bugzilla 2.4 upgrade the Bugzilla team are cleaning up bugs opened against old versions of Bugzilla. This bug has been flagged as an old bug and will be CLOSED WONTFIX in 7 days time.

If you believe this bug is an issue in the latest Bugzilla version please comment on this bug within 7 days. Doing so will ensure this bug is not closed automatically.

Thanks, the Bugzilla team.

Comment 7 Jeff Fearn 🐞 2012-07-19 05:28:22 UTC
As noted previously, the Bugzilla Team is cleaning up a large number of outstanding issues that have bit rotted. This bug is being closed as there has been no response to that notification.

If you believe this bug is still important please reopen this bug in the NEW status and PM will consider it.


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