Validating Data Corruption in MySQL Database

To validate data corruption, do the following:

  1. Run the following SQL script to check if there is data corruption.

    SELECT COUNT(*) FROM test_step_result WHERE LENGTH(CONVERT(REPLACE(REPLACE(comments, '<', '&lt;'), '>', '&gt;') USING utf8mb3)) > 65000;
  2. Check the count from the initial SQL query. If the count is zero, proceed with the regular upgrade.

  3. Run the following SQL query to fix the data if the count exceeds zero.

    CREATE TABLE test_step_result_backup_before_8_4_0 SELECT * FROM test_step_result WHERE LENGTH(CONVERT(REPLACE(REPLACE(comments, '<', '&lt;'), '>', '&gt;') USING utf8mb3)) > 65000;
    UPDATE test_step_result SET comments = LEFT(CONVERT(REPLACE(REPLACE(comments, '<', '&lt;'), '>', '&gt;') USING utf8mb3), 21833) WHERE LENGTH(CONVERT(REPLACE(REPLACE(comments, '<', '&lt;'), '>', '&gt;') USING utf8mb3)) > 65000;
    UPDATE test_step_result SET comments = REPLACE(REPLACE(comments, '<', '&lt;'), '>', '&gt;') WHERE comments LIKE '%<%' OR comments LIKE '%>%';
  4. After you fix the data, you can upgrade to Zephyr Enterprise version 8.4.

Publication date: