database icon indicating copy to clipboard operation
database copied to clipboard

updated string sizing code and test cases

Open ArnabChatterjee20k opened this issue 9 months ago • 1 comments

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.

ArnabChatterjee20k avatar May 14 '25 04:05 ArnabChatterjee20k