Project

General

Profile

Actions

Defect #47

closed

Error in journalizing an issue with longtext custom fields

Added by Amedeo Amedeo almost 17 years ago. Updated almost 17 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

When an issue has custom fields defined as longtext, whenever you try to save a very long text description (more than
255 chars) the system fails saving on table journal. This is due to the size of 255 for oldValue and newValue fields.

I managed temporarily with the attached patch.


Files

issue.patch (1.57 KB) issue.patch Amedeo Amedeo, 2008-02-03 10:49
Actions #1

Updated by Jean-Philippe Lang almost 17 years ago

I see 2 solutions:
- change the 2 database columns to 'text' (instead
of varchar255)
- truncate the values (as you did in your patch)

Do you need to have the full length value in the history ?

Actions #2

Updated by Amedeo Amedeo almost 17 years ago

I would go for the truncation, don't think has a real value having
a very long
decription in the history and also depending on the database
implementation
having text field rather than varchar(255) could increase
drammatically the size
of the journal table.

Thanks,
Amedeo

Actions #3

Updated by Jean-Philippe Lang almost 17 years ago

I agree with you. I'll fix this way.
Thanks.

Actions #4

Updated by Jean-Philippe Lang almost 17 years ago

I've just tested this. I get no errors and text is automaticaly
truncated and correctly saved.

Could tell me what version of rails and database you're using ?

Actions #5

Updated by Amedeo Amedeo almost 17 years ago

Rails 1.2.2 and PostgreSQL 8.1.4

The error I get is something like:

RuntimeError: ERROR C22001 Mvalue too long for type character
varying(255) Fvarchar.c L539 Rvarchar: INSERT INTO journal_details
("old_value", "property", "value",
"journal_id", "prop_key") VALUES('', 'cf',
'Lorem ipsum dolor sit amet

Actions #6

Updated by Jean-Philippe Lang almost 17 years ago

This problem doesn't occur with mysql. But I could reproduce
it after swithing to Postgresql.

Fixed in rev 477.

Actions #7

Updated by Amedeo Amedeo almost 17 years ago

Thanks for the prompt action :)

Actions

Also available in: Atom PDF