I am saving a raw letter in a TEXT column in MySQL with Ruby on Rails. It continues to truncate to 65535 characters, does anyone know what causes this?
MySQL works with max_allowed_packet=64M
max_allowed_packet=64M
Using InnoDB for a storage engine.
It is truncated to this length because ... well, that will fit the TEXT column .
You need MEDIUMTEXT or LONGTEXT if you want to save more.
Ruby on Rails did not truncate, MySQL did.
TEXT type is limited by characters 2^16 - 1 = 65535, see documentation .
2^16 - 1 = 65535
65535 " " - 2 ^ 16 - 1. , TEXT MySQL.
I'm not a Ruby specialist, but the number 65535 caught my attention - it's 16 bits (minus 1, which is usually special). You have probably come across a wall of size limits for the type you are using.