Validating Data Corruption in MySQL Database
To validate data corruption, do the following:
-
Run the following SQL script to check if there is data corruption.
SELECT COUNT(*) FROM test_step_result WHERE LENGTH(CONVERT(REPLACE(REPLACE(comments, '<', '<'), '>', '>') USING utf8mb3)) > 65000; -
Check the count from the initial SQL query. If the count is zero, proceed with the regular upgrade.
-
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, '<', '<'), '>', '>') USING utf8mb3)) > 65000; UPDATE test_step_result SET comments = LEFT(CONVERT(REPLACE(REPLACE(comments, '<', '<'), '>', '>') USING utf8mb3), 21833) WHERE LENGTH(CONVERT(REPLACE(REPLACE(comments, '<', '<'), '>', '>') USING utf8mb3)) > 65000; UPDATE test_step_result SET comments = REPLACE(REPLACE(comments, '<', '<'), '>', '>') WHERE comments LIKE '%<%' OR comments LIKE '%>%'; -
After you fix the data, you can upgrade to Zephyr Enterprise version 8.4.