Legacy Character Limit for Transaction Data/Ticket Subject

I want to share a recent problem I faced regarding the character limit for the Data column of the Transactions table. This column’s character limit, at one time, was 100. We started a long time ago on a 3.X version of RT, because my database name is rt3 and at one point I followed the upgrade procedure to 5. The Ticket.Subject column’s character limit is 200, but it seems that the ticket’s subject gets inserted into the Transactions.Data column as well, meaning a subject with more than 100 characters can cause what we experienced… replies simply just getting dropped and never seen because an exception gets thrown in the code and the reply never gets added to the ticket. I figured this out through debug logging, and will post the key line below I saw that tipped me off to this.

After the customer emailed my manager out-of-bound instead of our support address letting him know how upset she was that I was ignoring her, we began testing and that’s when I got the debug logging message seen below. The replies were just being dropped with no way for us to know she was ever trying to reply to the ticket.

I see in a new RT 5.0.3 install that this field’s limit is 255, but it would seem the upgrade scripts after we came from RT 3.x never changed the limit from 100. I wanted to warn others about this issue and perhaps someone will find this thread if they have issues like this… but again, without the debug logging, I would have just thought this ticket in particular was cursed.

I’ve changed both columns’ type to a VARCHAR(255).

[1129254] [Tue Oct 22 22:36:41 2024] [warning]: DBD::mysql::st execute failed: Data too long for column 'Data' at row 1 at /usr/local/share/perl5/5.32/DBIx/SearchBuilder/Handle.pm line 621. (/usr/local/share/perl5/5.32/DBIx/SearchBuilder/Handle.pm:621)
[1129254] [Tue Oct 22 22:36:41 2024] [warning]: RT::Handle=HASH(0x7fd1444a0f48) couldn't execute the query 'INSERT INTO `Transactions` (ObjectId, NewValue, Type, OldReference, ReferenceType, Created, Data, ObjectType, Field, NewReference, Creator, OldValue) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' at /usr/local/share/perl5/5.32/DBIx/SearchBuilder/Handle.pm line 634.

From the source haha:

That change was first included in RT 3.0.5, released in Sept. 2003. The first automated upgrade script we have is 3.1.0, so updates for 3.0.x → 3.2.0, so it seems it pre-dates our current automatic upgrade tooling.