プロジェクト

全般

プロフィール

Vote #67411

完了

Search for Numeric Value

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Search engine_16
対象バージョン:
開始日:
2010/06/11
期日:
進捗率:

100%

予定工数:
category_id:
16
version_id:
14
issue_org_id:
5676
author_id:
15230
assigned_to_id:
5
comments:
2
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
18
ステータス-->[Closed]

説明

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"}
  SQL (0.0ms)   SELECT max("settings".updated_on) AS max_updated_on FROM "settings" 
  User Load (0.0ms)   SELECT * FROM "users" WHERE ("users"."id" = 3) AND (users.status = 1) AND ( ("users"."type" = 'User' OR "users"."type" = 'AnonymousUser' ) ) 
  Project Load (0.0ms)   SELECT * FROM "projects" WHERE ("projects"."identifier" = E'jrit') LIMIT 1
  Role Load (0.0ms)   SELECT * FROM "roles" WHERE ("roles"."builtin" = 1) LIMIT 1
  Member Load Including Associations (0.0ms)   SELECT "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
  Issue Load Including Associations (0.0ms)   PGError: 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?


journals

Postgres stumbles over the too large integer. Sqlite3 does not care. And I have no idea about mysql.

The attached patch should fix this.
--------------------------------------------------------------------------------
Committed a fix in r3806. I could only reproduce this on Postgres 8.3, I think 8.4 changed this behavior.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリSearch engine_16 にセット
  • 対象バージョン1.0.0 (RC)_14 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0