database
database copied to clipboard
updated string sizing code and test cases
if ($size > 16777215) { return 'LONGTEXT'; } if ($size > 65535) { return 'MEDIUMTEXT'; } if ($size > 16381) { return 'TEXT'; } return "VARCHAR({$size})";
To
if ($size > 767) { return 'LONGTEXT'; } return "VARCHAR({$size})";
Summary by CodeRabbit
-
Bug Fixes
- Simplified handling of large string attributes in MariaDB: strings over the maximum index length are stored as LONGTEXT, others as VARCHAR.
- Adjusted maximum varchar length limit to dynamically reflect the maximum index length for consistency.
-
Tests
- Updated tests to expect LONGTEXT type and revised maximum length values for large string attributes.
- Enhanced test coverage by dynamically generating multiple attributes to better simulate size limit conditions.