Defect #5676
closedSearch for Numeric Value
100%
Description
I created a custom field of type LongText to hold a ticket number from a vendor. I created an issue and entered the value 4615713488 in the field. I made it searchable and filterable. However, when I search for the value 4615713488 from the search box on the top, it throws an Internal Server Error. This is the dump from the production.log:
Processing SearchController#index (for 192.168.21.66 at 2010-06-11 13:13:23) [GET] Parameters: {"action"=>"index", "id"=>"jrit", "issues"=>"1", "q"=>"567577567576", "controller"=>"search"} [4;35;1mSQL (0.0ms)[0m [0mSELECT max("settings".updated_on) AS max_updated_on FROM "settings" [0m [4;36;1mUser Load (0.0ms)[0m [0;1mSELECT * FROM "users" WHERE ("users"."id" = 3) AND (users.status = 1) AND ( ("users"."type" = 'User' OR "users"."type" = 'AnonymousUser' ) ) [0m [4;35;1mProject Load (0.0ms)[0m [0mSELECT * FROM "projects" WHERE ("projects"."identifier" = E'jrit') LIMIT 1[0m [4;36;1mRole Load (0.0ms)[0m [0;1mSELECT * FROM "roles" WHERE ("roles"."builtin" = 1) LIMIT 1[0m [4;35;1mMember Load Including Associations (0.0ms)[0m [0mSELECT "members"."id" AS t0_r0, "members"."user_id" AS t0_r1, "members"."project_id" AS t0_r2, "members"."created_on" AS t0_r3, "members"."mail_notification" AS t0_r4, "projects"."id" AS t1_r0, "projects"."name" AS t1_r1, "projects"."description" AS t1_r2, "projects"."homepage" AS t1_r3, "projects"."is_public" AS t1_r4, "projects"."parent_id" AS t1_r5, "projects"."created_on" AS t1_r6, "projects"."updated_on" AS t1_r7, "projects"."identifier" AS t1_r8, "projects"."status" AS t1_r9, "projects"."lft" AS t1_r10, "projects"."rgt" AS t1_r11, "roles"."id" AS t2_r0, "roles"."name" AS t2_r1, "roles"."position" AS t2_r2, "roles"."assignable" AS t2_r3, "roles"."builtin" AS t2_r4, "roles"."permissions" AS t2_r5 FROM "members" LEFT OUTER JOIN "projects" ON "projects".id = "members".project_id LEFT OUTER JOIN "member_roles" ON ("members"."id" = "member_roles"."member_id") LEFT OUTER JOIN "roles" ON ("roles"."id" = "member_roles"."role_id") WHERE ("members".user_id = 3 AND (projects.status=1)) ORDER BY projects.name[0m [4;36;1mIssue Load Including Associations (0.0ms)[0m [0;1mPGError: ERROR: value "567577567576" is out of range for type integer LINE 1: ...".id = "issues".project_id WHERE ("issues"."id" = E'56757756...
It appears to me that the system thinks it is an issue number because the value is numeric. However, it I put it in double quotes like this "4615713488" it returns the correct ticket. I cannot count on my users knowing to do that when searching for something.
Any advice?
Files
Updated by Holger Just over 14 years ago
Postgres stumbles over the too large integer. Sqlite3 does not care. And I have no idea about mysql.
The attached patch should fix this.
Updated by Eric Davis over 14 years ago
- Status changed from New to Closed
- Assignee set to Eric Davis
- Target version set to 1.0.0 (RC)
- % Done changed from 0 to 100
- Resolution set to Fixed
Committed a fix in r3806. I could only reproduce this on Postgres 8.3, I think 8.4 changed this behavior.