View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0024056||mantisbt||custom fields||public||2018-02-28 17:59||2018-11-22 18:44|
|Target Version||2.13.0||Fixed in Version||2.13.0|
|Summary||0024056: Custom Fields of type "Textarea" cannot contain more than 255 chars due to bug_history table|
I have a custom field of type 10 (textarea) that is meant to contain more than 255 characters. If I report an issue and enter more than 255 characters, I run into an SQL error because Mantis tries to write the field's whole content to the bug_history table's new_value field, which is defined as varchar(255).
It would be okay to cut the value for the history at 255 characters.
|Tags||No tags attached.|
For my scenario solution 1 would be sufficient. Solution 3 could break plugins that access those fields in SQL queries. I don't consider this very common though.
I think (1) is good enough for now.
Regarding (3), instead of going for a specific functionality for custom fields, i'd rather propose an extension of history table itself, having change header and detail in separated tables (for long texts as a start)
Having long texts can be a performance hit when reading multiple rows cointaining that field when it may not actually be needed. As found in Oracle, where they are CLOB fields that need a separate query for retrieving each individual clob value (which is done under the hood by adodb)
MantisBT: master 339cf883
2018-03-01 07:53:03Details Diff
|Truncate values before writing to database history table
TEXTAREA custom fields can contain more than 255 characters.
Changing such fields fails, as the new value can't be stored
in history table.
This change fixes the issue by truncating the string.
See 0024056 for other options to fix it.
|mod - core/constant_inc.php||Diff File|
|mod - core/history_api.php||Diff File|